Skip to content
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.

Commit

Permalink
Bug 1068598 - Add an admin menu with options for the different features
Browse files Browse the repository at this point in the history
  • Loading branch information
bobsilverberg committed Sep 22, 2014
1 parent e729067 commit 4f5d834
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 8 deletions.
39 changes: 39 additions & 0 deletions oneanddone/base/static/css/one-and-done.less
Expand Up @@ -398,3 +398,42 @@ section[class *="-section"] {
}

}

/* menu */

.drop-down {
ul[role="menu"] {
list-style: none;
&> li {
position: relative;
display: inline-block;
}
}
.top-level {
ul {
background-color: white;
position: absolute;
display: none;
list-style: none;
width: 10rem;
@radius: 0 6px 6px 6px;
.border-radius(@radius);
@shadow: 1px 1px 2px #e0e0e0;
.box-shadow(@shadow);
z-index: 99;
li {
margin-left: 0;
padding: .5rem;
border-bottom: 1px solid #edecec;
}
a {
display: block;
}
}
&:hover {
ul {
display: block;
}
}
}
}
26 changes: 18 additions & 8 deletions oneanddone/base/templates/base/base.html
Expand Up @@ -38,10 +38,10 @@
<div id="wrapper">
<header id="masthead">
<a href="http://www.mozilla.org/" id="tabzilla">Mozilla</a>
<nav id="nav-main" role="menubar">
<nav id="nav-main" role="menubar" class="drop-down">
<span class="toggle" role="button" aria-controls="nav-main-menu" tabindex="0">{{ _('Menu') }}</span>
<ul role="menu" id="nav-main-menu">
<li role="menuitem" class="auth-menu">
<li role="menuitem">
{% if user.is_authenticated() %}
{% if user.display_name %}
<a id="view-profile" href="{{ url('users.profile.mydetails') }}">
Expand All @@ -51,16 +51,26 @@
</a>
{% else %}
{{ _('Welcome!') }}
{% endif %} |
{% endif %}
{% endif %}
</li>
<li role="menuitem">
<a id="available-tasks" href="{{ url('tasks.available') }}">{{ _('Available Tasks') }}</a>
</li>
{% if user.is_staff %}
<li role="menuitem" class="top-level">
<a href="#">{{ _('Task Admin') }}</a>
<ul>
<li><a href="{{ url('tasks.list') }}">{{ _('List Tasks') }}</a></li>
<li><a href="{{ url('tasks.create') }}">{{ _('Create Task') }}</a></li>
</ul>
</li>
{% endif %}
<li role="menuitem" {% if not user.is_authenticated() %}class="auth-menu"{% endif %}>
{% if user.is_authenticated() %}
{% if user.is_staff %}
| <a href="{{ url('tasks.list') }}">{{ _('Task Admin') }}</a>
{% endif %}
| {{ browserid_logout(text=_('Sign out')) }}
{{ browserid_logout(text=_('Sign out')) }}
{% else %}
| {{ browserid_login(text=_('Sign in'), color='blue') }}
{{ browserid_login(text=_('Sign in'), color='blue') }}
{% endif %}
</li>
</ul>
Expand Down

0 comments on commit 4f5d834

Please sign in to comment.