Commit 7a3ee89548e942fe9f46bc6572a5030ab304d06a
1 parent
3d07f4f4
Exists in
master
and in
3 other branches
added header on pdf view and redirect on website link and pdf file are now correct
Showing
4 changed files
with
46 additions
and
24 deletions
Show diff stats
links/views.py
... | ... | @@ -134,7 +134,8 @@ class CreateLinkView(LoginRequiredMixin, LogMixin, generic.edit.CreateView): |
134 | 134 | def get_success_url(self): |
135 | 135 | messages.success(self.request, _('The Link "%s" was added to the Topic "%s" of the virtual environment "%s" successfully!')%(self.object.name, self.object.topic.name, self.object.topic.subject.name)) |
136 | 136 | |
137 | - return reverse_lazy('subjects:view', kwargs = {'slug': self.object.topic.subject.slug}) | |
137 | + return reverse_lazy('subjects:topic_view', kwargs = {'slug': self.object.topic.subject.slug, 'topic_slug': self.object.topic.slug}) | |
138 | + | |
138 | 139 | |
139 | 140 | |
140 | 141 | ... | ... |
pdf_file/templates/pdf_file/view.html
... | ... | @@ -15,16 +15,34 @@ |
15 | 15 | {% block breadcrumbs %} |
16 | 16 | {% clear_breadcrumbs %} |
17 | 17 | {% breadcrumb 'Home' 'subjects:home' %} |
18 | - {% breadcrumb pdf_file.topic.subject.category 'subjects:cat_view' pdf_file.topic.subject.category.slug %} | |
19 | - {% breadcrumb pdf_file.topic.subject 'subjects:view' pdf_file.topic.subject.slug %} | |
20 | - {% breadcrumb pdf_file.topic 'subjects:topic_view' pdf_file.topic.subject.slug pdf_file.topic.slug %} | |
18 | + {% breadcrumb subject.category 'subjects:cat_view' subject.category.slug %} | |
19 | + {% breadcrumb subject 'subjects:view' subject.slug %} | |
20 | + {% breadcrumb pdf_file.topic 'subjects:topic_view' subject.slug pdf_file.topic.slug %} | |
21 | 21 | {% breadcrumb pdf_file 'pdf_file:view' pdf_file.slug %} |
22 | 22 | |
23 | 23 | {% endblock %} |
24 | 24 | |
25 | 25 | |
26 | 26 | {% block content %} |
27 | - | |
27 | + {% if subject.visible %} | |
28 | + <div class="panel panel-info topic-panel"> | |
29 | + <div class="panel-heading"> | |
30 | + {% elif has_subject_permissions %} | |
31 | + <div class="panel panel-info topic-panel-invisible"> | |
32 | + <div class="panel-heading panel-invisible"> | |
33 | + {% endif %} | |
34 | + <div class="row"> | |
35 | + <div class="col-md-12 category-header"> | |
36 | + <h4 class="panel-title" style="margin-top: 10px; margin-bottom: 8px"> | |
37 | + <span>{{ webpage }}</span> | |
38 | + </h4> | |
39 | + | |
40 | + <div class="col-md-5 pull-right category-card-items"> | |
41 | + <a href="" ><i class="fa fa-list" aria-hidden="true"></i></a> | |
42 | + </div> | |
43 | + </div> | |
44 | + </div> | |
45 | + </div> | |
28 | 46 | <object width="100%" height="800px" type="application/pdf" data="{{pdf_file.file.url}}" id="pdf_content"> |
29 | 47 | <p>{% trans "PDF could not be displayed" %}</p> |
30 | 48 | </object> | ... | ... |
pdf_file/views.py
... | ... | @@ -37,6 +37,7 @@ class ViewPDFFile(generic.TemplateView): |
37 | 37 | slug = self.kwargs.get('slug', '') |
38 | 38 | pdf_file = PDFFile.objects.get(slug=slug) |
39 | 39 | context['pdf_file'] = pdf_file |
40 | + context['subject'] = pdf_file.topic.subject | |
40 | 41 | return context |
41 | 42 | |
42 | 43 | |
... | ... | @@ -171,7 +172,7 @@ class PDFFileCreateView(LoginRequiredMixin, LogMixin , generic.CreateView): |
171 | 172 | def get_success_url(self): |
172 | 173 | messages.success(self.request, _('The PDF File "%s" was added to the Topic "%s" of the virtual environment "%s" successfully!')%(self.object.name, self.object.topic.name, self.object.topic.subject.name)) |
173 | 174 | |
174 | - return reverse_lazy('subjects:view', kwargs = {'slug': self.object.topic.subject.slug}) | |
175 | + return reverse_lazy('subjects:topic_view', kwargs = {'slug': self.object.topic.subject.slug, 'topic_slug': self.object.topic.slug}) | |
175 | 176 | |
176 | 177 | |
177 | 178 | class UpdateView(LoginRequiredMixin, LogMixin, generic.UpdateView): | ... | ... |
users/templates/users/login.html
... | ... | @@ -55,7 +55,26 @@ |
55 | 55 | |
56 | 56 | </form> |
57 | 57 | |
58 | - <li class="dropdown language-selector col-lg-10 col-md-10 col-sm-10 col-lg-offset-1 col-md-offset-1 col-sm-offset-1"> | |
58 | + | |
59 | + <div class="row"> | |
60 | + <div class="col-lg-10 col-md-10 col-sm-10 col-lg-offset-1 col-md-offset-1 col-sm-offset-1"> | |
61 | + {% if not deny_register %} | |
62 | + <div class="col-md-6 col-xs-6 col-sm-6 col-lg-6 text-center"> | |
63 | + <button type="submite" class="btn btn-success btn-raised btn-block" form="form-login" style="position: initial;"> {% trans 'Log in' %} </button> | |
64 | + </div> | |
65 | + <div class="col-md-6 col-xs-6 col-sm-6 col-lg-6 text-center"> | |
66 | + <a class="btn btn-default btn-raised btn-block" href="{% url 'users:signup' %}" formaction="#" style="position: initial;">{% trans 'Sign Up' %}</a> | |
67 | + </div> | |
68 | + {% else %} | |
69 | + <div class="col-md-6 col-xs-6 col-sm-6 col-lg-6 col-lg-offset-3 col-md-offset-3 col-sm-offset-3 col-xs-offset-3 text-center"> | |
70 | + <button type="submite" class="btn btn-success btn-raised btn-block" form="form-login" style="position: initial;"> {% trans 'Log in' %} </button> | |
71 | + </div> | |
72 | + {% endif %} | |
73 | + </div> | |
74 | + </div> | |
75 | + <div class="row"> | |
76 | + | |
77 | + <li class="dropdown language-selector pull-right "> | |
59 | 78 | <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-close-others="true"> |
60 | 79 | <img src="{% static "img/brazilicon.png" %}" /> |
61 | 80 | </a> |
... | ... | @@ -74,23 +93,6 @@ |
74 | 93 | </li> |
75 | 94 | </ul> |
76 | 95 | </li> |
77 | - <div class="row"> | |
78 | - <div class="col-lg-10 col-md-10 col-sm-10 col-lg-offset-1 col-md-offset-1 col-sm-offset-1"> | |
79 | - {% if not deny_register %} | |
80 | - <div class="col-md-6 col-xs-6 col-sm-6 col-lg-6 text-center"> | |
81 | - <button type="submite" class="btn btn-success btn-raised btn-block" form="form-login" style="position: initial;"> {% trans 'Log in' %} </button> | |
82 | - </div> | |
83 | - <div class="col-md-6 col-xs-6 col-sm-6 col-lg-6 text-center"> | |
84 | - <a class="btn btn-default btn-raised btn-block" href="{% url 'users:signup' %}" formaction="#" style="position: initial;">{% trans 'Sign Up' %}</a> | |
85 | - </div> | |
86 | - {% else %} | |
87 | - <div class="col-md-6 col-xs-6 col-sm-6 col-lg-6 col-lg-offset-3 col-md-offset-3 col-sm-offset-3 col-xs-offset-3 text-center"> | |
88 | - <button type="submite" class="btn btn-success btn-raised btn-block" form="form-login" style="position: initial;"> {% trans 'Log in' %} </button> | |
89 | - </div> | |
90 | - {% endif %} | |
91 | - </div> | |
92 | - </div> | |
93 | - <div class="row"> | |
94 | 96 | {% if not deny_register %} |
95 | 97 | <div class="col-sm-offset-1 col-md-10 col-lg-10 col-sm-10 col-xs-12"> |
96 | 98 | <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-right forgotPassword"> | ... | ... |