Commit 38c2933ac9658c57ba287667a177cf95c4d19130
1 parent
9cc13db6
Exists in
master
and in
3 other branches
Adding active style to settings menu
Showing
5 changed files
with
13 additions
and
14 deletions
Show diff stats
amadeus/static/css/base/amadeus.css
@@ -192,6 +192,10 @@ | @@ -192,6 +192,10 @@ | ||
192 | background: #00695C !important; | 192 | background: #00695C !important; |
193 | } | 193 | } |
194 | 194 | ||
195 | +.navbar-nav li.settings_menu_active { | ||
196 | + background: #00695C | ||
197 | +} | ||
198 | + | ||
195 | .top-search { | 199 | .top-search { |
196 | color: #F5F5F5; | 200 | color: #F5F5F5; |
197 | } | 201 | } |
amadeus/templates/base.html
@@ -92,8 +92,7 @@ | @@ -92,8 +92,7 @@ | ||
92 | </div> | 92 | </div> |
93 | <ul class="nav navbar-nav navbar-right notifications"> | 93 | <ul class="nav navbar-nav navbar-right notifications"> |
94 | {% if user.is_staff %} | 94 | {% if user.is_staff %} |
95 | - | ||
96 | - <li class="dropdown-accordion dropdown" data-accordion="#system_accordion" title data-original-title="{% trans 'settings' %}"> | 95 | + <li class="dropdown-accordion dropdown {{ settings_menu_active }}" data-accordion="#system_accordion" title data-original-title="{% trans 'settings' %}"> |
97 | <a href="#" data-toggle="dropdown"><i class="fa fa-cog" aria-hidden="true"></i></a> | 96 | <a href="#" data-toggle="dropdown"><i class="fa fa-cog" aria-hidden="true"></i></a> |
98 | <ul class="dropdown-menu pull-right" role="menu"> | 97 | <ul class="dropdown-menu pull-right" role="menu"> |
99 | <li><a href="{% url 'users:manage' %}">{% trans 'Manage Users' %}</a></li> | 98 | <li><a href="{% url 'users:manage' %}">{% trans 'Manage Users' %}</a></li> |
categories/views.py
@@ -59,6 +59,7 @@ class IndexView(views.SuperuserRequiredMixin, LoginRequiredMixin, ListView): | @@ -59,6 +59,7 @@ class IndexView(views.SuperuserRequiredMixin, LoginRequiredMixin, ListView): | ||
59 | 59 | ||
60 | categories = self.get_queryset().order_by('name') | 60 | categories = self.get_queryset().order_by('name') |
61 | context['categories'] = categories | 61 | context['categories'] = categories |
62 | + context['settings_menu_active'] = "settings_menu_active" | ||
62 | 63 | ||
63 | return context | 64 | return context |
64 | 65 | ||
@@ -106,6 +107,7 @@ class CreateCategory(views.SuperuserRequiredMixin, HasRoleMixin, LogMixin, Creat | @@ -106,6 +107,7 @@ class CreateCategory(views.SuperuserRequiredMixin, HasRoleMixin, LogMixin, Creat | ||
106 | 107 | ||
107 | if 'categories' in self.request.META.get('HTTP_REFERER'): | 108 | if 'categories' in self.request.META.get('HTTP_REFERER'): |
108 | context['template_extends'] = 'categories/list.html' | 109 | context['template_extends'] = 'categories/list.html' |
110 | + context['settings_menu_active'] = "settings_menu_active" | ||
109 | else: | 111 | else: |
110 | context['template_extends'] = 'subjects/list.html' | 112 | context['template_extends'] = 'subjects/list.html' |
111 | 113 | ||
@@ -193,6 +195,7 @@ class UpdateCategory(LogMixin, UpdateView): | @@ -193,6 +195,7 @@ class UpdateCategory(LogMixin, UpdateView): | ||
193 | 195 | ||
194 | if 'categories' in self.request.META.get('HTTP_REFERER'): | 196 | if 'categories' in self.request.META.get('HTTP_REFERER'): |
195 | context['template_extends'] = 'categories/list.html' | 197 | context['template_extends'] = 'categories/list.html' |
198 | + context['settings_menu_active'] = "settings_menu_active" | ||
196 | else: | 199 | else: |
197 | context['template_extends'] = 'subjects/list.html' | 200 | context['template_extends'] = 'subjects/list.html' |
198 | 201 |
users/models.py
@@ -61,15 +61,3 @@ class User(AbstractBaseUser, PermissionsMixin): | @@ -61,15 +61,3 @@ class User(AbstractBaseUser, PermissionsMixin): | ||
61 | return _('Yes') | 61 | return _('Yes') |
62 | 62 | ||
63 | return _('Is not an admin') | 63 | return _('Is not an admin') |
64 | - | ||
65 | - def has_dependencies(self): | ||
66 | - if self.is_staff: | ||
67 | - return True | ||
68 | - | ||
69 | - #Check if is coordinator of something | ||
70 | - | ||
71 | - #Check if is professor of something | ||
72 | - | ||
73 | - #Check if is student of something | ||
74 | - | ||
75 | - return False |
users/views.py
@@ -43,6 +43,7 @@ class UsersListView(braces_mixins.LoginRequiredMixin, braces_mixins.StaffuserReq | @@ -43,6 +43,7 @@ class UsersListView(braces_mixins.LoginRequiredMixin, braces_mixins.StaffuserReq | ||
43 | def get_context_data (self, **kwargs): | 43 | def get_context_data (self, **kwargs): |
44 | context = super(UsersListView, self).get_context_data(**kwargs) | 44 | context = super(UsersListView, self).get_context_data(**kwargs) |
45 | context['title'] = _('Manage Users') | 45 | context['title'] = _('Manage Users') |
46 | + context['settings_menu_active'] = "settings_menu_active" | ||
46 | 47 | ||
47 | return context | 48 | return context |
48 | 49 | ||
@@ -73,6 +74,7 @@ class SearchView(braces_mixins.LoginRequiredMixin, braces_mixins.StaffuserRequir | @@ -73,6 +74,7 @@ class SearchView(braces_mixins.LoginRequiredMixin, braces_mixins.StaffuserRequir | ||
73 | context = super(SearchView, self).get_context_data(**kwargs) | 74 | context = super(SearchView, self).get_context_data(**kwargs) |
74 | context['title'] = _('Search Users') | 75 | context['title'] = _('Search Users') |
75 | context['search'] = self.request.GET.get('search') | 76 | context['search'] = self.request.GET.get('search') |
77 | + context['settings_menu_active'] = "settings_menu_active" | ||
76 | 78 | ||
77 | return context | 79 | return context |
78 | 80 | ||
@@ -97,6 +99,7 @@ class CreateView(braces_mixins.LoginRequiredMixin, braces_mixins.StaffuserRequir | @@ -97,6 +99,7 @@ class CreateView(braces_mixins.LoginRequiredMixin, braces_mixins.StaffuserRequir | ||
97 | def get_context_data (self, **kwargs): | 99 | def get_context_data (self, **kwargs): |
98 | context = super(CreateView, self).get_context_data(**kwargs) | 100 | context = super(CreateView, self).get_context_data(**kwargs) |
99 | context['title'] = _("Add User") | 101 | context['title'] = _("Add User") |
102 | + context['settings_menu_active'] = "settings_menu_active" | ||
100 | 103 | ||
101 | return context | 104 | return context |
102 | 105 | ||
@@ -133,6 +136,7 @@ class UpdateView(braces_mixins.LoginRequiredMixin, braces_mixins.StaffuserRequir | @@ -133,6 +136,7 @@ class UpdateView(braces_mixins.LoginRequiredMixin, braces_mixins.StaffuserRequir | ||
133 | def get_context_data (self, **kwargs): | 136 | def get_context_data (self, **kwargs): |
134 | context = super(UpdateView, self).get_context_data(**kwargs) | 137 | context = super(UpdateView, self).get_context_data(**kwargs) |
135 | context['title'] = _("Update User") | 138 | context['title'] = _("Update User") |
139 | + context['settings_menu_active'] = "settings_menu_active" | ||
136 | 140 | ||
137 | return context | 141 | return context |
138 | 142 | ||
@@ -192,6 +196,7 @@ class DeleteView(braces_mixins.LoginRequiredMixin, generic.DeleteView): | @@ -192,6 +196,7 @@ class DeleteView(braces_mixins.LoginRequiredMixin, generic.DeleteView): | ||
192 | if email is None: | 196 | if email is None: |
193 | template = 'users/delete_account.html' | 197 | template = 'users/delete_account.html' |
194 | else: | 198 | else: |
199 | + context['settings_menu_active'] = "settings_menu_active" | ||
195 | template = 'users/delete.html' | 200 | template = 'users/delete.html' |
196 | 201 | ||
197 | return self.response_class(request = self.request, template = template, context = context, using = self.template_engine, **response_kwargs) | 202 | return self.response_class(request = self.request, template = template, context = context, using = self.template_engine, **response_kwargs) |