From 59db94e72eaf9f3f05cc67ff32bb92fbb837568e Mon Sep 17 00:00:00 2001 From: Matheus Lins Date: Mon, 31 Oct 2016 13:49:37 -0300 Subject: [PATCH] puting new template view file in student's dashboard --- courses/templates/topic/file_material_view.html | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ courses/templates/topic/list_file.html | 2 +- courses/urls.py | 1 + courses/views.py | 9 +++++++++ 4 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 courses/templates/topic/file_material_view.html diff --git a/courses/templates/topic/file_material_view.html b/courses/templates/topic/file_material_view.html new file mode 100644 index 0000000..c1d0253 --- /dev/null +++ b/courses/templates/topic/file_material_view.html @@ -0,0 +1,110 @@ +{% extends 'subject/index.html' %} + +{% load static i18n permission_tags widget_tweaks %} + +{% block breadcrumbs %} + + +{% endblock %} + + +{% block content %} + +
+
+
+
+

Book 1

+
+ +
+
+
+
+
+
+
+
+
+ + + +
+
+ +
+
+
+
+
+
+
+
+
+
+ +
+
+ +

Beltrano Camargo

+

Há 11 horas

+ +
+
+
+ icon +
+
+

Sicrano da Silva

+
11 horas
+ +

Quais capítulos devo estudar?

+
+
+
+
+
+ icon +
+
+

Beltrano Camargo

+
11 horas
+ +

capítulos 5 e 6

+
+
+
+
+
+
+
+
+ + + +
+
+ +
+
+
+
+
+
+ +
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/courses/templates/topic/list_file.html b/courses/templates/topic/list_file.html index b4a97dd..cd0dd17 100644 --- a/courses/templates/topic/list_file.html +++ b/courses/templates/topic/list_file.html @@ -2,7 +2,7 @@
{% for file in files %} -
  • {{ file.file_type.icon }} {{ file.name }}
  • +
  • {{ file.file_type.icon }} {{ file.name }}
  • {% endfor %}
    diff --git a/courses/urls.py b/courses/urls.py index 522b0f0..2ddc8a7 100644 --- a/courses/urls.py +++ b/courses/urls.py @@ -28,6 +28,7 @@ urlpatterns = [ url(r'^exam/', include('exam.urls', namespace = 'exam')), url(r'^files/', include('files.urls', namespace = 'file')), url(r'^upload-material/$', views.UploadMaterialView.as_view(), name='upload_material'), + url(r'^subjects/file-material-view/(?P[\w_-]+)/$', views.FileMaterialView.as_view(), name='file_material_view'), url(r'^links/',include('links.urls',namespace = 'links')), url(r'^(?P[\w_-]+)/', include([ url(r'^$', views.CourseView.as_view(), name='view'), diff --git a/courses/views.py b/courses/views.py index 1a1fff9..7cd9979 100644 --- a/courses/views.py +++ b/courses/views.py @@ -712,3 +712,12 @@ class IndexSubjectCategoryView(LoginRequiredMixin, generic.ListView): context = super(IndexSubjectCategoryView, self).get_context_data(**kwargs) context['subject_categories'] = SubjectCategory.objects.all() return context + +class FileMaterialView(LoginRequiredMixin, generic.DetailView): + + allowed_roles = ['professor', 'system_admin', 'student'] + login_url = reverse_lazy("core:home") + redirect_field_name = 'next' + model = Material + context_object_name = 'file' + template_name = 'topic/file_material_view.html' \ No newline at end of file -- libgit2 0.21.2