From f31dfec9861ff02c2f84988e9e5bbf603b9d2b5f Mon Sep 17 00:00:00 2001 From: fbormann Date: Sun, 23 Oct 2016 18:06:02 -0300 Subject: [PATCH] fixed minor issues found and added a new sub-template for optimizing organization --- app/templates/home_teacher_student_content.html | 1 - courses/templates/course/course_card.html | 44 ++++++++++++++++++++++++++++++++++++++++++++ courses/templates/course/index.html | 43 +------------------------------------------ courses/templates/course/view.html | 2 +- courses/views.py | 1 - poll/views.py | 2 +- 6 files changed, 47 insertions(+), 46 deletions(-) create mode 100644 courses/templates/course/course_card.html diff --git a/app/templates/home_teacher_student_content.html b/app/templates/home_teacher_student_content.html index 9e1b810..3652822 100644 --- a/app/templates/home_teacher_student_content.html +++ b/app/templates/home_teacher_student_content.html @@ -10,7 +10,6 @@
-

{{ notification.actor.username }}

{{notification.message}} em : {{ notification.action_resource.resource.name }}

{{ notification.datetime|timesince }} {% trans "ago" %}

diff --git a/courses/templates/course/course_card.html b/courses/templates/course/course_card.html new file mode 100644 index 0000000..b238337 --- /dev/null +++ b/courses/templates/course/course_card.html @@ -0,0 +1,44 @@ +{% load static i18n permission_tags %} +{% load django_bootstrap_breadcrumbs %} + +
+
+
+ +
+
+

Course Name: {{course.name}}

+

Coordinator: {{course.professors.all.0}}

+

+ Description: + + {{course.description}} + +

+ {% trans 'View Course' %}
+
+
+
+
+
\ No newline at end of file diff --git a/courses/templates/course/index.html b/courses/templates/course/index.html index e4f9710..e81a57f 100644 --- a/courses/templates/course/index.html +++ b/courses/templates/course/index.html @@ -75,48 +75,7 @@ {% if courses|length > 0 %} {% if request.GET.category == 'all' or none or request.GET.category == '' %} {% for course in list_courses %} -
-
-
- -
-
-

Course Name: {{course.name}}

-

Duration (in semesters): 09

-

Coordinator: {{course.professors}}

-

- Description: - - {{course.description}} - -

- {% trans 'View Course' %}
-
-
-
-
-
+ {% include "course/course_card.html" %} {% endfor %} {% else %} {% for course in courses_category %} diff --git a/courses/templates/course/view.html b/courses/templates/course/view.html index 998afcb..31bf2f1 100644 --- a/courses/templates/course/view.html +++ b/courses/templates/course/view.html @@ -43,7 +43,7 @@
diff --git a/courses/views.py b/courses/views.py index 051b25e..e6531ec 100644 --- a/courses/views.py +++ b/courses/views.py @@ -42,7 +42,6 @@ class IndexView(LoginRequiredMixin, NotificationMixin, generic.ListView): categorys_courses = CourseCategory.objects.filter(course_category__students__name = self.request.user.name).distinct() courses_category = Course.objects.filter(category__name = self.request.GET.get('category')) - none = None q = self.request.GET.get('category', None) if q is None: diff --git a/poll/views.py b/poll/views.py index 715d4b3..85f479e 100644 --- a/poll/views.py +++ b/poll/views.py @@ -73,7 +73,7 @@ class CreatePoll(LoginRequiredMixin,HasRoleMixin, NotificationMixin,generic.Crea self.object.name = str(self.object) self.object.save() - super(CreatePoll, self).createNotification(message="create a Poll "+ self.object.name, actor=self.request.user, + super(CreatePoll, self).createNotification(message="created a Poll "+ self.object.name, actor=self.request.user, resource_name=self.object.name, resource_link= reverse('course:poll:view_poll', args=[self.object.slug]), users=self.object.topic.subject.students.all()) for key in self.request.POST: -- libgit2 0.21.2