From f1d1a7b622174afa82b2f8001cca9c3134932cff Mon Sep 17 00:00:00 2001 From: Chris Blanchard Date: Tue, 18 Aug 2015 12:02:27 +0100 Subject: [PATCH] Move admin options --- lib/react/user.jsx | 35 +++++++++++++---------- public/js/app.js | 61 ++++++++++++++++++++++------------------- views/partials/menu.hbs | 17 +++++++++++- 3 files changed, 70 insertions(+), 43 deletions(-) diff --git a/lib/react/user.jsx b/lib/react/user.jsx index a49ac09..2937461 100644 --- a/lib/react/user.jsx +++ b/lib/react/user.jsx @@ -80,20 +80,18 @@ var AdminPanel = React.createClass({ render() { return ( - - ) +
+
Swap Into a Different Account
+ +
Gather Options
+
+ +
+
+ ); } }); @@ -106,6 +104,14 @@ var CurrentUser = React.createClass({ render() { if (this.props.user) { + var adminOptions; + if (this.props.user.admin) { + adminOptions = ( +
  • + Administration +
  • + ) + } return (
  • @@ -127,6 +133,7 @@ var CurrentUser = React.createClass({
  • Design Goals
  • + {adminOptions} diff --git a/public/js/app.js b/public/js/app.js index 9e18dbf..b89eb39 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1280,36 +1280,28 @@ var AdminPanel = React.createClass({ render: function render() { return React.createElement( - "ul", - { className: "nav", id: "admin-menu" }, + "div", + null, React.createElement( - "li", + "h5", + null, + "Swap Into a Different Account" + ), + React.createElement(UserLogin, null), + React.createElement( + "h5", + null, + "Gather Options" + ), + React.createElement( + "div", null, React.createElement( - "div", - { className: "admin-panel" }, - React.createElement( - "h5", - null, - "Admin" - ), - React.createElement(UserLogin, null), - React.createElement( - "button", - { - className: "btn btn-danger max-width", - onClick: this.handleGatherReset }, - "Reset Gather" - ), - React.createElement( - "p", - { className: "text-center add-top" }, - React.createElement( - "small", - null, - "Only responds for admins on staging.ensl.org" - ) - ) + "button", + { + className: "btn btn-danger max-width", + onClick: this.handleGatherReset }, + "Reset Gather" ) ) ); @@ -1329,6 +1321,18 @@ var CurrentUser = React.createClass({ render: function render() { if (this.props.user) { + var adminOptions; + if (this.props.user.admin) { + adminOptions = React.createElement( + "li", + null, + React.createElement( + "a", + { href: "#", "data-toggle": "modal", "data-target": "#adminmodal" }, + "Administration" + ) + ); + } return React.createElement( "li", { className: "dropdown" }, @@ -1385,7 +1389,8 @@ var CurrentUser = React.createClass({ { href: "#", "data-toggle": "modal", "data-target": "#designmodal" }, "Design Goals" ) - ) + ), + adminOptions ) ); } else { diff --git a/views/partials/menu.hbs b/views/partials/menu.hbs index a967fc5..a07df70 100644 --- a/views/partials/menu.hbs +++ b/views/partials/menu.hbs @@ -24,6 +24,22 @@ + + \ No newline at end of file