Commit b11f30bf27c896bd56492960843e5a7db70ffaf4
1 parent
51bc7743
Exists in
master
and in
3 other branches
Adjusting subjects breadcrumbs
Showing
2 changed files
with
12 additions
and
2 deletions
Show diff stats
subjects/templates/subjects/list.html
... | ... | @@ -9,7 +9,11 @@ |
9 | 9 | |
10 | 10 | {% block breadcrumbs %} |
11 | 11 | {{ block.super }} |
12 | - {% breadcrumb "Subjects" 'categories:index' %} | |
12 | + {% if all %} | |
13 | + {% breadcrumb "All Subjects" 'subjects:index' %} | |
14 | + {% else %} | |
15 | + {% breadcrumb "My Subjects" 'subjects:index' %} | |
16 | + {% endif %} | |
13 | 17 | {% endblock %} |
14 | 18 | |
15 | 19 | {% block content %} | ... | ... |
subjects/views.py
... | ... | @@ -94,7 +94,13 @@ class IndexView(LoginRequiredMixin, ListView): |
94 | 94 | def get_context_data(self, **kwargs): |
95 | 95 | context = super(IndexView, self).get_context_data(**kwargs) |
96 | 96 | if self.request.user.is_staff: |
97 | - categories = self.get_queryset().order_by('name').filter(visible=True) | |
97 | + categories = self.get_queryset().order_by('name').filter(visible=True) | |
98 | + | |
99 | + context['all'] = False | |
100 | + | |
101 | + if self.kwargs.get('option'): | |
102 | + context['all'] = True | |
103 | + | |
98 | 104 | else: |
99 | 105 | if self.kwargs.get('option'): |
100 | 106 | categories = self.get_queryset().order_by('name').filter(visible=True) | ... | ... |