diff --git a/core/templates/guest.html b/core/templates/guest.html index 05edf31..173e210 100644 --- a/core/templates/guest.html +++ b/core/templates/guest.html @@ -1,186 +1,168 @@ -{% extends 'base.html' %} + +{% load static i18n %} {% load i18n custom_filters %} -{% block breadcrumbs %} -
-
-
-
-
- - - -
-
-
- -
-
- Todos - {% for category_course in categorys_courses %} - {{category_course.name}} - {% endfor %} -
-
- -{% endblock %} - - -{% block content %} - - {% for course in courses %} -
-
-

- {{course.name}} - {% if user|show_course_subscribe:course %} - - {% endif %} -

-
- -
-

Course Name: {{course.name}}

-

Begining: {{course.init_date}}

-

End: {{course.end_date}}

-

Professor: {{course.professors.name}}

-

- Description: - - {{course.content}} - -

-
-
- {% endfor %} -{% endblock %} - - - -{% comment %} - - - + + + {{ title }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {% block style %} + {% endblock %} + {% block javascript %} + {% endblock %} + + + {% block nav %} + + {% endblock %} +
+
+ +
+ {% block sidebar %} + + {% endblock %} + +
+
+ {% block breadcrumbs %} +
+
+
+
+
+ + + +
+
+
- -
- {% 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}} - -

- 'View Course
-
-
-
+
+
+ Todos + {% for category in categories %} + {{category.name}} + {% endfor %}
- {% endfor %} - {% else %} - {% for course in courses_category %} - {% if course.category.name == request.GET.category %} - -
-
+ + {% endblock %} + {% block render_breadcrumbs %}{% endblock %} +
+
+
+ {% block content %} + {% for course in courses %}
- -
-
-

Course Name: {{course.name}}

-

Duration (in semesters): 09

-

Coordinator: {{course.professors}}

-

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

- View Course
-
-
+ + +
+

Course Name: {{course.name}}

+

Begining: {{course.init_date}}

+

End: {{course.end_date}}

+

Professor: {{course.professors.name}}

+

+ Description: + + {{course.content}} + +

+
-
-
- {% endif %} - {% endfor %} - {% endif %} - {% else %} - No courses found - {% endif %} -
-
-
- -
-{% endcomment %} + + + {% block script_file %} + + {% endblock script_file %} + + + \ No newline at end of file diff --git a/core/views.py b/core/views.py index fd5c64a..a2b3343 100644 --- a/core/views.py +++ b/core/views.py @@ -116,6 +116,7 @@ def getNotifications(request): def guest (request): context = { - 'courses': Course.objects.filter(public=True) + 'courses': Course.objects.filter(public=True), + 'categories': CourseCategory.objects.all(), } return render(request, 'guest.html', context) \ No newline at end of file diff --git a/courses/models.py b/courses/models.py index 60ed374..31a3298 100644 --- a/courses/models.py +++ b/courses/models.py @@ -6,6 +6,8 @@ from users.models import User from core.models import Resource, MimeType from s3direct.fields import S3DirectField +from django.core.urlresolvers import reverse + class CourseCategory(models.Model): name = models.CharField(_('Name'), max_length = 100, unique = True) @@ -57,6 +59,9 @@ class Course(models.Model): def __str__(self): return self.name + def get_absolute_url (self): + return reverse('course:view', kwargs={'slug': self.slug}) + def show_subscribe(self): today = datetime.date.today() -- libgit2 0.21.2