Commit a143d808302ec73c9cc6a54245a04e8bee39d5f2
1 parent
279160e9
Exists in
master
and in
3 other branches
Adjusts
Showing
7 changed files
with
34 additions
and
26 deletions
Show diff stats
amadeus/static/css/base/amadeus.css
... | ... | @@ -37,6 +37,10 @@ |
37 | 37 | color: white; |
38 | 38 | } |
39 | 39 | |
40 | +#sidebar-menu > .subjects_menu_active { | |
41 | + background-color: #00695C; | |
42 | +} | |
43 | + | |
40 | 44 | #sidebar-menu > .item:hover{ |
41 | 45 | background-color: #00695C; |
42 | 46 | } |
... | ... | @@ -109,23 +113,25 @@ |
109 | 113 | } |
110 | 114 | |
111 | 115 | #core-subjects-options-div{ |
112 | - width: 100%; | |
116 | + width: 100%; | |
113 | 117 | margin-bottom: 2%; |
114 | 118 | height: 30px; |
115 | 119 | } |
116 | 120 | |
117 | 121 | .core-subjects-options li{ |
118 | - float:left; | |
119 | - padding: 10px; | |
120 | - background-color: #FFFFFF; | |
121 | - margin: 1px; | |
122 | - | |
122 | + float:left; | |
123 | + padding: 10px; | |
124 | + background-color: #FFFFFF; | |
125 | + margin: 1px; | |
123 | 126 | border-bottom: 10px; |
124 | 127 | border-bottom-style: solid; |
128 | + border-bottom-color: #D2D2D2; | |
129 | + color: #A0A0A0; | |
125 | 130 | } |
126 | 131 | |
127 | 132 | .core-subjects-options li.active{ |
128 | - border-bottom-color: green; | |
133 | + color: inherit; | |
134 | + border-bottom-color: green; | |
129 | 135 | } |
130 | 136 | |
131 | 137 | #delete-category-footer{ | ... | ... |
amadeus/templates/base.html
... | ... | @@ -142,7 +142,7 @@ |
142 | 142 | <div id="sidebar-menu-div" class="col-xs-1 col-sm-1 col-md-1 col-lg-1 col-xl-1"> |
143 | 143 | {% block sidebar %} |
144 | 144 | <ul id="sidebar-menu"> |
145 | - <li class="item" id="subjects-link" data-toggle="tooltip" data-placement="right" title="{% trans "Subjects" %}"> | |
145 | + <li class="item {{ subjects_menu_active }}" id="subjects-link" data-toggle="tooltip" data-placement="right" title="{% trans "Subjects" %}"> | |
146 | 146 | <a href="{% url 'subjects:index' %}"> |
147 | 147 | <i class="fa fa-graduation-cap" aria-hidden="true"></i> |
148 | 148 | </a> | ... | ... |
categories/templates/categories/home.html
categories/templates/categories/list.html
categories/views.py
... | ... | @@ -110,6 +110,7 @@ class CreateCategory(views.SuperuserRequiredMixin, HasRoleMixin, LogMixin, Creat |
110 | 110 | context['settings_menu_active'] = "settings_menu_active" |
111 | 111 | else: |
112 | 112 | context['template_extends'] = 'subjects/list.html' |
113 | + context['subjects_menu_active'] = 'subjects_menu_active'; | |
113 | 114 | |
114 | 115 | return context |
115 | 116 | |
... | ... | @@ -198,6 +199,7 @@ class UpdateCategory(LogMixin, UpdateView): |
198 | 199 | context['settings_menu_active'] = "settings_menu_active" |
199 | 200 | else: |
200 | 201 | context['template_extends'] = 'subjects/list.html' |
202 | + context['subjects_menu_active'] = 'subjects_menu_active'; | |
201 | 203 | |
202 | 204 | return context |
203 | 205 | ... | ... |
subjects/templates/subjects/list.html
1 | -{% extends 'base.html' %} | |
1 | +{% extends 'categories/home.html' %} | |
2 | 2 | |
3 | 3 | {% load static i18n permission_tags %} |
4 | 4 | {% load django_bootstrap_breadcrumbs %} |
... | ... | @@ -28,10 +28,10 @@ |
28 | 28 | <ul class="core-subjects-options"> |
29 | 29 | {% if all %} |
30 | 30 | <a href="{% url 'subjects:index' %}"><li >{% trans "My subjects" %}</li></a> |
31 | - <a href="{% url 'subjects:index' 'all' %}" ><li class="active">{% trans "all subjects" %}</li></a> | |
31 | + <a href="{% url 'subjects:index' 'all' %}" ><li class="active">{% trans "All subjects" %}</li></a> | |
32 | 32 | {% else %} |
33 | 33 | <a href="{% url 'subjects:index' %}"><li class="active">{% trans "My subjects" %}</li></a> |
34 | - <a href="{% url 'subjects:index' 'all' %}" ><li>{% trans "all subjects" %}</li></a> | |
34 | + <a href="{% url 'subjects:index' 'all' %}" ><li>{% trans "All subjects" %}</li></a> | |
35 | 35 | {% endif %} |
36 | 36 | |
37 | 37 | </ul> | ... | ... |
subjects/views.py
... | ... | @@ -81,7 +81,7 @@ class IndexView(LoginRequiredMixin, ListView): |
81 | 81 | else: |
82 | 82 | context['page_template'] = "categories/home_teacher_student.html" |
83 | 83 | |
84 | - context['title'] = _('Categories') | |
84 | + | |
85 | 85 | |
86 | 86 | if self.request.is_ajax(): |
87 | 87 | if self.request.user.is_staff: |
... | ... | @@ -93,34 +93,31 @@ class IndexView(LoginRequiredMixin, ListView): |
93 | 93 | |
94 | 94 | def get_context_data(self, **kwargs): |
95 | 95 | context = super(IndexView, self).get_context_data(**kwargs) |
96 | - if self.request.user.is_staff: | |
97 | - categories = self.get_queryset().order_by('name').filter(visible=True) | |
98 | 96 | |
99 | - context['all'] = False | |
97 | + context['all'] = False | |
98 | + context['title'] = _('My Subjects') | |
100 | 99 | |
101 | - if self.kwargs.get('option'): | |
102 | - context['all'] = True | |
100 | + if self.kwargs.get('option'): | |
101 | + context['all'] = True | |
102 | + context['title'] = _('All Subjects') | |
103 | 103 | |
104 | + if self.request.user.is_staff: | |
105 | + categories = self.get_queryset().order_by('name').filter(visible=True) | |
104 | 106 | else: |
105 | 107 | if self.kwargs.get('option'): |
106 | 108 | categories = self.get_queryset().order_by('name').filter(visible=True) |
107 | - context['all'] = True | |
108 | 109 | for category in categories: |
109 | 110 | category.subjects = Subject.objects.filter(category= category) |
110 | 111 | else: |
111 | - context['all'] = False | |
112 | 112 | categories = self.get_queryset().filter(visible=True) |
113 | 113 | for category in categories: |
114 | 114 | category.subjects = Subject.objects.filter(category= category) |
115 | 115 | |
116 | 116 | categories = [category for category in categories if category.subjects.count() > 0 or self.request.user in category.coordinators.all()] |
117 | 117 | #So I remove all categories that doesn't have the possibility for the user to be on |
118 | - | |
119 | - | |
120 | - | |
121 | - | |
122 | 118 | |
123 | 119 | context['categories'] = categories |
120 | + context['subjects_menu_active'] = 'subjects_menu_active'; | |
124 | 121 | |
125 | 122 | return context |
126 | 123 | |
... | ... | @@ -142,8 +139,11 @@ class SubjectCreateView(CreateView): |
142 | 139 | def get_context_data(self, **kwargs): |
143 | 140 | context = super(SubjectCreateView, self).get_context_data(**kwargs) |
144 | 141 | context['slug'] = self.kwargs['slug'] |
145 | - context['template_extends'] = 'categories/list.html' | |
142 | + context['template_extends'] = 'subjects/list.html' | |
143 | + context['subjects_menu_active'] = 'subjects_menu_active'; | |
144 | + | |
146 | 145 | return context |
146 | + | |
147 | 147 | def form_valid(self, form): |
148 | 148 | |
149 | 149 | self.object = form.save() | ... | ... |