Commit 59db94e72eaf9f3f05cc67ff32bb92fbb837568e
1 parent
08f400b5
Exists in
master
and in
5 other branches
puting new template view file in student's dashboard
Showing
4 changed files
with
121 additions
and
1 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,110 @@ |
| 1 | +{% extends 'subject/index.html' %} | |
| 2 | + | |
| 3 | +{% load static i18n permission_tags widget_tweaks %} | |
| 4 | + | |
| 5 | +{% block breadcrumbs %} | |
| 6 | + | |
| 7 | + <ol class="breadcrumb"> | |
| 8 | + <li><a href="">{% trans 'Home' %}</a></li> | |
| 9 | + <li><a href="">{{ subject }}</a></li> | |
| 10 | + <li class="active">{% trans 'Manage Topic' %}</li> | |
| 11 | + <li class="active">{{ topic.name }}</li> | |
| 12 | + </ol> | |
| 13 | +{% endblock %} | |
| 14 | + | |
| 15 | + | |
| 16 | +{% block content %} | |
| 17 | + | |
| 18 | +<div class="col-md-12"> | |
| 19 | + <div><div class="well"> | |
| 20 | + <div class="row"> | |
| 21 | + <div class="col-md-offset-2 col-md-9"> | |
| 22 | + <h2 class="resource_inline"><b>Book 1</b></h2> | |
| 23 | + </div> | |
| 24 | + <div class="col-md-offset-2 col-md-8"> | |
| 25 | + <a href="{{ file.file_url }}">{{ file.url }}</a> | |
| 26 | + </div> | |
| 27 | + </div> | |
| 28 | +</div></div> | |
| 29 | + <div><div class="well"> | |
| 30 | + <div class="row"> | |
| 31 | + <div class="list-group"> | |
| 32 | + <div class="list-group-item"> | |
| 33 | + <div class="form-group is-empty"> | |
| 34 | + <div class="row"> | |
| 35 | + <div class="col-md-1"> | |
| 36 | + <span class="input-group-btn"> | |
| 37 | + <button type="button" class="btn btn-fab btn-fab-mini"> | |
| 38 | + <i class="material-icons">send</i> | |
| 39 | + </button> | |
| 40 | + </span> | |
| 41 | + </div> | |
| 42 | + <div class="col-md-10"> | |
| 43 | + <input type="text" id="addon3a" class="form-control" placeholder="Add Comment"> | |
| 44 | + </div> | |
| 45 | + </div> | |
| 46 | + </div> | |
| 47 | + </div> | |
| 48 | + </div> | |
| 49 | + </div> | |
| 50 | +</div> | |
| 51 | +<div class="well timeLine"> | |
| 52 | + <div class="row"> | |
| 53 | + <div class="col-xs-2 col-md-1"> | |
| 54 | + <img class="imgTimeLine" src="http://localhost:8080/assets/img/images/team-avatar-2.jpg"> | |
| 55 | + </div> | |
| 56 | + <div class="col-xs-10 col-md-11"> | |
| 57 | + <i class="fa fa-flag-o" aria-hidden="true"></i> | |
| 58 | + <a href="#"><h4 class="resource_inline"><b>Beltrano Camargo</b></h4></a> | |
| 59 | + <p class="timePost"><i>Há 11 horas</i></p> | |
| 60 | + <!--ListComents --> | |
| 61 | + <div class="list-group"> | |
| 62 | + <div class="list-group-item"> | |
| 63 | + <div class="row-picture"> | |
| 64 | + <img class="circle" src="http://localhost:8080/assets/img/images/team-avatar-1.jpg" alt="icon"> | |
| 65 | + </div> | |
| 66 | + <div class="row-content"> | |
| 67 | + <h4 class="list-group-item-heading">Sicrano da Silva</h4> | |
| 68 | + <div class="least-content">11 horas</div> | |
| 69 | + | |
| 70 | + <p class="list-group-item-text">Quais capítulos devo estudar?</p> | |
| 71 | + </div> | |
| 72 | + </div> | |
| 73 | + <div class="list-group-separator"></div> | |
| 74 | + <div class="list-group-item"> | |
| 75 | + <div class="row-picture"> | |
| 76 | + <img class="circle" src="http://localhost:8080/assets/img/images/team-avatar-2.jpg" alt="icon"> | |
| 77 | + </div> | |
| 78 | + <div class="row-content"> | |
| 79 | + <h4 class="list-group-item-heading">Beltrano Camargo</h4> | |
| 80 | + <div class="least-content">11 horas</div> | |
| 81 | + | |
| 82 | + <p class="list-group-item-text">capítulos 5 e 6</p> | |
| 83 | + </div> | |
| 84 | + </div> | |
| 85 | + <div class="list-group-separator"></div> | |
| 86 | + <div class="list-group"> | |
| 87 | + <div class="list-group-item"> | |
| 88 | + <div class="form-group is-empty"> | |
| 89 | + <div class="row"> | |
| 90 | + <div class="col-md-1 col-md-offset-1"> | |
| 91 | + <span class="input-group-btn"> | |
| 92 | + <button type="button" class="btn btn-fab btn-fab-mini"> | |
| 93 | + <i class="material-icons">send</i> | |
| 94 | + </button> | |
| 95 | + </span> | |
| 96 | + </div> | |
| 97 | + <div class="col-md-10"> | |
| 98 | + <input type="text" id="addon3a" class="form-control" placeholder="Add Comment"> | |
| 99 | + </div> | |
| 100 | + </div> | |
| 101 | + </div> | |
| 102 | + </div> | |
| 103 | + </div> | |
| 104 | + </div> | |
| 105 | + <!-- endListComents --> | |
| 106 | + </div> | |
| 107 | + </div> | |
| 108 | +</div></div> | |
| 109 | + </div> | |
| 110 | +{% endblock %} | |
| 0 | 111 | \ No newline at end of file | ... | ... |
courses/templates/topic/list_file.html
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | <div id="list-topic{{ topic.id }}-files"> |
| 4 | 4 | {% for file in files %} |
| 5 | - <li id="file_{{ file.slug }}"><i class="material-icons">{{ file.file_type.icon }}</i> <a href="{{ file.file_url.url }}" target="_blank">{{ file.name }}</a></li> | |
| 5 | + <li id="file_{{ file.slug }}"><i class="material-icons">{{ file.file_type.icon }}</i> <a href="{% url 'course:file_material_view' file.slug %}" target="_blank">{{ file.name }}</a></li> | |
| 6 | 6 | {% endfor %} |
| 7 | 7 | </div> |
| 8 | 8 | ... | ... |
courses/urls.py
| ... | ... | @@ -28,6 +28,7 @@ urlpatterns = [ |
| 28 | 28 | url(r'^exam/', include('exam.urls', namespace = 'exam')), |
| 29 | 29 | url(r'^files/', include('files.urls', namespace = 'file')), |
| 30 | 30 | url(r'^upload-material/$', views.UploadMaterialView.as_view(), name='upload_material'), |
| 31 | + url(r'^subjects/file-material-view/(?P<slug>[\w_-]+)/$', views.FileMaterialView.as_view(), name='file_material_view'), | |
| 31 | 32 | url(r'^links/',include('links.urls',namespace = 'links')), |
| 32 | 33 | url(r'^(?P<slug>[\w_-]+)/', include([ |
| 33 | 34 | url(r'^$', views.CourseView.as_view(), name='view'), | ... | ... |
courses/views.py
| ... | ... | @@ -712,3 +712,12 @@ class IndexSubjectCategoryView(LoginRequiredMixin, generic.ListView): |
| 712 | 712 | context = super(IndexSubjectCategoryView, self).get_context_data(**kwargs) |
| 713 | 713 | context['subject_categories'] = SubjectCategory.objects.all() |
| 714 | 714 | return context |
| 715 | + | |
| 716 | +class FileMaterialView(LoginRequiredMixin, generic.DetailView): | |
| 717 | + | |
| 718 | + allowed_roles = ['professor', 'system_admin', 'student'] | |
| 719 | + login_url = reverse_lazy("core:home") | |
| 720 | + redirect_field_name = 'next' | |
| 721 | + model = Material | |
| 722 | + context_object_name = 'file' | |
| 723 | + template_name = 'topic/file_material_view.html' | |
| 715 | 724 | \ No newline at end of file | ... | ... |