Commit 7aaf5472bbd814f3fdb786cc528abeee7cfcd85c
1 parent
d0c61fce
Exists in
master
and in
3 other branches
Webpages adjusts
Showing
7 changed files
with
27 additions
and
3 deletions
Show diff stats
amadeus/static/css/base/amadeus.css
... | ... | @@ -792,4 +792,12 @@ a.add-row { |
792 | 792 | |
793 | 793 | .resource_list a:hover, .resource_list a:focus { |
794 | 794 | text-decoration: none; |
795 | +} | |
796 | + | |
797 | +.add_resource i { | |
798 | + margin-right: 10px; | |
799 | +} | |
800 | + | |
801 | +.add_resource ul { | |
802 | + width: 100%; | |
795 | 803 | } |
796 | 804 | \ No newline at end of file | ... | ... |
subjects/templates/subjects/view.html
... | ... | @@ -81,5 +81,17 @@ |
81 | 81 | {% if resource_new_page %} |
82 | 82 | window.open("{{ resource_new_page_url }}"); |
83 | 83 | {% endif %} |
84 | + | |
85 | + $(function (){ | |
86 | + var topic_slug = "{{ topic_slug }}" | |
87 | + | |
88 | + if (topic_slug != "") { | |
89 | + $("#" + topic_slug).collapse('show'); | |
90 | + | |
91 | + $('html, body').animate({ | |
92 | + scrollTop: $("#" + topic_slug).parent().offset().top | |
93 | + }, 1000); | |
94 | + } | |
95 | + }); | |
84 | 96 | </script> |
85 | 97 | {% endblock content %} |
86 | 98 | \ No newline at end of file | ... | ... |
subjects/urls.py
... | ... | @@ -10,6 +10,7 @@ urlpatterns = [ |
10 | 10 | url(r'^update/(?P<slug>[\w_-]+)/$', views.SubjectUpdateView.as_view(), name='update'), |
11 | 11 | url(r'^delete/(?P<slug>[\w_-]+)/$', views.SubjectDeleteView.as_view(), name='delete'), |
12 | 12 | url(r'^view/(?P<slug>[\w_-]+)/$', views.SubjectDetailView.as_view(), name='view'), |
13 | + url(r'^view/(?P<slug>[\w_-]+)/(?P<topic_slug>[\w_-]+)/$', views.SubjectDetailView.as_view(), name='topic_view'), | |
13 | 14 | url(r'^subscribe/(?P<slug>[\w_-]+)/$', views.SubjectSubscribeView.as_view(), name='subscribe'), |
14 | 15 | url(r'^search/$', views.SubjectSearchView.as_view(), name='search'), |
15 | 16 | url(r'^search/(?P<option>[\w_-]+)/$', views.SubjectSearchView.as_view(), name='search'), | ... | ... |
subjects/views.py
... | ... | @@ -427,6 +427,9 @@ class SubjectDetailView(LoginRequiredMixin, DetailView): |
427 | 427 | |
428 | 428 | self.request.session['resources'] = None |
429 | 429 | |
430 | + if self.kwargs.get('topic_slug'): | |
431 | + context['topic_slug'] = self.kwargs.get('topic_slug') | |
432 | + | |
430 | 433 | return context |
431 | 434 | |
432 | 435 | ... | ... |
webpage/templates/webpages/create.html
... | ... | @@ -16,7 +16,7 @@ |
16 | 16 | {% block breadcrumbs %} |
17 | 17 | {{ block.super }} |
18 | 18 | |
19 | - {% breadcrumb topic 'subjects:view' topic.subject.slug %} | |
19 | + {% breadcrumb topic 'subjects:topic_view' topic.subject.slug topic.slug %} | |
20 | 20 | |
21 | 21 | {% trans 'Create Webpage' as bread %} |
22 | 22 | {% breadcrumb bread 'webpages:create' topic.slug %} | ... | ... |
webpage/templates/webpages/update.html
... | ... | @@ -16,7 +16,7 @@ |
16 | 16 | {% block breadcrumbs %} |
17 | 17 | {{ block.super }} |
18 | 18 | |
19 | - {% breadcrumb topic 'subjects:view' topic.subject.slug %} | |
19 | + {% breadcrumb topic 'subjects:topic_view' topic.subject.slug topic.slug %} | |
20 | 20 | |
21 | 21 | {% trans 'Edit: ' as bread %} |
22 | 22 | {% with bread|add:webpage.name as bread_slug %} | ... | ... |
webpage/templates/webpages/view.html
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | |
10 | 10 | {% block breadcrumbs %} |
11 | 11 | {{ block.super }} |
12 | - {% breadcrumb topic 'subjects:view' subject.slug %} | |
12 | + {% breadcrumb topic 'subjects:topic_view' subject.slug topic.slug %} | |
13 | 13 | {% breadcrumb webpage 'webpages:view' webpage.slug %} |
14 | 14 | {% endblock %} |
15 | 15 | ... | ... |