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
amadeus/templates/base.html
... | ... | @@ -92,8 +92,7 @@ |
92 | 92 | </div> |
93 | 93 | <ul class="nav navbar-nav navbar-right notifications"> |
94 | 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 | 96 | <a href="#" data-toggle="dropdown"><i class="fa fa-cog" aria-hidden="true"></i></a> |
98 | 97 | <ul class="dropdown-menu pull-right" role="menu"> |
99 | 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 | 59 | |
60 | 60 | categories = self.get_queryset().order_by('name') |
61 | 61 | context['categories'] = categories |
62 | + context['settings_menu_active'] = "settings_menu_active" | |
62 | 63 | |
63 | 64 | return context |
64 | 65 | |
... | ... | @@ -106,6 +107,7 @@ class CreateCategory(views.SuperuserRequiredMixin, HasRoleMixin, LogMixin, Creat |
106 | 107 | |
107 | 108 | if 'categories' in self.request.META.get('HTTP_REFERER'): |
108 | 109 | context['template_extends'] = 'categories/list.html' |
110 | + context['settings_menu_active'] = "settings_menu_active" | |
109 | 111 | else: |
110 | 112 | context['template_extends'] = 'subjects/list.html' |
111 | 113 | |
... | ... | @@ -193,6 +195,7 @@ class UpdateCategory(LogMixin, UpdateView): |
193 | 195 | |
194 | 196 | if 'categories' in self.request.META.get('HTTP_REFERER'): |
195 | 197 | context['template_extends'] = 'categories/list.html' |
198 | + context['settings_menu_active'] = "settings_menu_active" | |
196 | 199 | else: |
197 | 200 | context['template_extends'] = 'subjects/list.html' |
198 | 201 | ... | ... |
users/models.py
... | ... | @@ -61,15 +61,3 @@ class User(AbstractBaseUser, PermissionsMixin): |
61 | 61 | return _('Yes') |
62 | 62 | |
63 | 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 | 43 | def get_context_data (self, **kwargs): |
44 | 44 | context = super(UsersListView, self).get_context_data(**kwargs) |
45 | 45 | context['title'] = _('Manage Users') |
46 | + context['settings_menu_active'] = "settings_menu_active" | |
46 | 47 | |
47 | 48 | return context |
48 | 49 | |
... | ... | @@ -73,6 +74,7 @@ class SearchView(braces_mixins.LoginRequiredMixin, braces_mixins.StaffuserRequir |
73 | 74 | context = super(SearchView, self).get_context_data(**kwargs) |
74 | 75 | context['title'] = _('Search Users') |
75 | 76 | context['search'] = self.request.GET.get('search') |
77 | + context['settings_menu_active'] = "settings_menu_active" | |
76 | 78 | |
77 | 79 | return context |
78 | 80 | |
... | ... | @@ -97,6 +99,7 @@ class CreateView(braces_mixins.LoginRequiredMixin, braces_mixins.StaffuserRequir |
97 | 99 | def get_context_data (self, **kwargs): |
98 | 100 | context = super(CreateView, self).get_context_data(**kwargs) |
99 | 101 | context['title'] = _("Add User") |
102 | + context['settings_menu_active'] = "settings_menu_active" | |
100 | 103 | |
101 | 104 | return context |
102 | 105 | |
... | ... | @@ -133,6 +136,7 @@ class UpdateView(braces_mixins.LoginRequiredMixin, braces_mixins.StaffuserRequir |
133 | 136 | def get_context_data (self, **kwargs): |
134 | 137 | context = super(UpdateView, self).get_context_data(**kwargs) |
135 | 138 | context['title'] = _("Update User") |
139 | + context['settings_menu_active'] = "settings_menu_active" | |
136 | 140 | |
137 | 141 | return context |
138 | 142 | |
... | ... | @@ -192,6 +196,7 @@ class DeleteView(braces_mixins.LoginRequiredMixin, generic.DeleteView): |
192 | 196 | if email is None: |
193 | 197 | template = 'users/delete_account.html' |
194 | 198 | else: |
199 | + context['settings_menu_active'] = "settings_menu_active" | |
195 | 200 | template = 'users/delete.html' |
196 | 201 | |
197 | 202 | return self.response_class(request = self.request, template = template, context = context, using = self.template_engine, **response_kwargs) | ... | ... |