Skip to content

Commit

Permalink
Update admin page route handler
Browse files Browse the repository at this point in the history
  • Loading branch information
aweiksnar committed Dec 8, 2015
1 parent cf42108 commit 460f489
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions app/pages/admin.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ React = require 'react'
counterpart = require 'counterpart'
Translate = require 'react-translate-component'
ChangeListener = require '../components/change-listener'
{Link} = require 'react-router'
{IndexLink, Link} = require 'react-router'

counterpart.registerTranslations 'en',
userAdminPage:
Expand All @@ -21,20 +21,22 @@ AdminPage = React.createClass
<div className="admin-content">
<aside className="secondary-page-side-bar admin-side-bar">
<nav>
<Link to="/admin"
<IndexLink to="/admin"
type="button"
className="secret-button admin-button" >
className="secret-button admin-button"
activeClassName="active">
<Translate content="userAdminPage.nav.createAdmin" />
</Link>
</IndexLink>
<Link to="/admin/project_status"
type="button"
className="secret-button admin-button" >
className="secret-button admin-button"
activeClassName="active">
<Translate content="userAdminPage.nav.projectStatus" />
</Link>
</nav>
</aside>
<section className="admin-tab-content">
React.cloneElement @props.children, {user: @props.user}
{React.cloneElement @props.children, @props}
</section>
</div>
</div>
Expand All @@ -48,7 +50,7 @@ module.exports = React.createClass
<ChangeListener target={@props.user}>{ =>
if @props.user?
if @props.user.admin?
<AdminPage user={@props.user}/>
<AdminPage {...@props} />
else
<div className="content-container">
<p>You're not an administrator</p>
Expand Down

0 comments on commit 460f489

Please sign in to comment.