diff --git a/client/admin/admin.jsx b/client/admin/admin.jsx index 174cfaf..5a725b7 100644 --- a/client/admin/admin.jsx +++ b/client/admin/admin.jsx @@ -3,11 +3,9 @@ const _ = require('lodash'); const Nav = require('naturalcrit/nav/nav.jsx'); -//const HomebrewAdmin = require('./homebrewAdmin/homebrewAdmin.jsx'); - - const BrewLookup = require('./brewLookup/brewLookup.jsx'); - +const AdminSearch = require('./adminSearch/adminSearch.jsx'); +const InvalidBrew = require('./invalidBrew/invalidBrew.jsx'); const Admin = React.createClass({ getDefaultProps: function() { @@ -31,10 +29,11 @@ const Admin = React.createClass({ {this.renderNavbar()}
+ - Test - +
Danger Zone
+
} diff --git a/client/admin/admin.less b/client/admin/admin.less index e742b26..ef7d387 100644 --- a/client/admin/admin.less +++ b/client/admin/admin.less @@ -1,25 +1,23 @@ -@import 'naturalcrit/styles/core.less'; +@import 'naturalcrit/styles/core.less'; html,body, #reactRoot{ min-height : 100%; } - body{ - background-color : #ddd; - font-family : 'Open Sans', sans-serif; - color : #4b5055; - font-weight : 100; - text-rendering : optimizeLegibility; + height : 100%; margin : 0; padding : 0; - height : 100%; + background-color : #ddd; + font-family : 'Open Sans', sans-serif; + font-weight : 100; + color : #4b5055; + text-rendering : optimizeLegibility; } - .admin { nav { - background-color: @red; + background-color : @red; .navItem{ - background-color: @red; + background-color : @red; } .homebreweryLogo{ font-family : CodeBold; @@ -31,19 +29,25 @@ body{ } } } - h1{ - font-size: 2em; - font-weight: 800; - border-bottom: 1px solid #ddd; - margin-bottom: 10px; + margin-bottom : 10px; + font-size : 2em; + font-weight : 800; + border-bottom : 1px solid #ddd; } - - main.content{ - background-color: white; - padding: 50px 20px; - width : 1000px; - margin: 0 auto; + width : 1000px; + margin : 0 auto; + padding : 50px 20px; + background-color : white; + .dangerZone{ + margin : 30px 0px; + padding : 10px 20px; + background : repeating-linear-gradient(45deg, @yellow, @yellow 10px, darken(#333, 10%) 10px, darken(#333, 10%) 20px); + font-size : 1em; + font-weight : 800; + color : white; + text-transform : uppercase; + } } -} +} \ No newline at end of file diff --git a/server/admin.routes.js b/server/admin.routes.js index 6310d5e..7445cb3 100644 --- a/server/admin.routes.js +++ b/server/admin.routes.js @@ -8,7 +8,6 @@ const mw = require('./middleware.js'); const BrewData = require('./brew.data.js'); router.get('/admin', mw.adminLogin, (req, res, next) => { - console.log('yo'); return vitreumRender('admin', templateFn, { url : req.originalUrl, admin_key : config.get('admin:key') @@ -30,4 +29,26 @@ router.delete('/admin/invalid', mw.adminOnly, (req, res, next)=>{ .catch(next); }); +router.get('/admin/lookup/:search', (req, res) => { + //search for mathcing edit id + //search for matching share id + // search for partial match + + BrewData.get({editId : req.params.search}) + .then((brew) => { + + }) + + BrewData.get({ $or:[ + {editId : { "$regex": req.params.search, "$options": "i" }}, + {shareId : { "$regex": req.params.search, "$options": "i" }}, + ]}) + .then((brews) => { + console.log(brews); + return res.json(brews); + }) + + +}) + module.exports = router; \ No newline at end of file