Skip to content

Commit

Permalink
Move menu "Administration" inside user menu. Closes #560
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigok committed Aug 24, 2015
1 parent e9bb5cb commit 9a6e44c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
4 changes: 0 additions & 4 deletions client/views/app/sideNav/sideNav.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ Template.sideNav.events
'mouseleave .header': ->
SideNav.leaveArrow()

'click .open-admin': ->
SideNav.setFlex "adminFlex"
SideNav.openFlex()

Template.sideNav.onRendered ->
SideNav.init()
menu.init()
5 changes: 0 additions & 5 deletions client/views/app/sideNav/sideNav.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
<h3>
<a href="{{pathFor 'privateHistory'}}">{{_ "History"}}</a>
</h3>
{{#if isAdmin}}
<h3 class="open-admin">
{{_ "Administration"}}
</h3>
{{/if}}
</div>
</div>
<div class="flex-nav hidden">
Expand Down
7 changes: 7 additions & 0 deletions client/views/app/sideNav/userStatus.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ Template.userStatus.helpers
username: username
}

isAdmin: ->
return Meteor.user()?.admin is true

Template.userStatus.events
'click .options .status': (event) ->
event.preventDefault()
Expand All @@ -40,6 +43,10 @@ Template.userStatus.events
SideNav.openFlex()
FlowRouter.go 'account'

'click #admin': ->
SideNav.setFlex "adminFlex"
SideNav.openFlex()

'click .account-link': ->
menu.close()

Expand Down
3 changes: 3 additions & 0 deletions client/views/app/sideNav/userStatus.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ <h4>{{username}}</h4>
<a href="" data-status="busy" class="status busy"><span>{{_ "Busy" context="male"}}</span></a>
<a href="" data-status="offline" class="status offline"><span>{{_ "Invisible"}}</span></a>
<a href="" id="account" class='account-link'><i class="icon-sliders"></i><span>{{_ "My_Account"}}</span></a>
{{#if isAdmin}}
<a href="" id="admin" class='account-link'><i class="icon-wrench"></i><span>{{_ "Administration"}}</span></a>
{{/if}}
<a href="" id="logout"><i class="icon-logout"></i><span>{{_ "Logout"}}</span></a>
</div>
</nav>
Expand Down

0 comments on commit 9a6e44c

Please sign in to comment.