diff --git a/courses/templates/category/index.html b/courses/templates/category/index.html
index b7a8a55..ee6540c 100644
--- a/courses/templates/category/index.html
+++ b/courses/templates/category/index.html
@@ -80,11 +80,10 @@
{{ category }} |
{{ category.slug }} |
-
-
-
-
- |
+
+
+
+
{% endfor %}
{% else %}
diff --git a/courses/templates/course/index.html b/courses/templates/course/index.html
index e4f9710..4cf2a74 100644
--- a/courses/templates/course/index.html
+++ b/courses/templates/course/index.html
@@ -41,6 +41,21 @@
+
+ {% if user|has_role:'professor' or user|has_role:'system_admin' %}
+
+
+ {% endif %}
{% endblock %}
{% block content %}
@@ -92,7 +107,7 @@
diff --git a/courses/templates/course/view.html b/courses/templates/course/view.html
index 9311e66..34d9105 100644
--- a/courses/templates/course/view.html
+++ b/courses/templates/course/view.html
@@ -49,7 +49,6 @@
{% endif %}
-
{% endblock %}
{% block content %}
diff --git a/courses/views.py b/courses/views.py
index 16d6253..b5a6340 100644
--- a/courses/views.py
+++ b/courses/views.py
@@ -34,9 +34,12 @@ class IndexView(LoginRequiredMixin, NotificationMixin, generic.ListView):
context = super(IndexView, self).get_context_data(**kwargs)
list_courses = None
categorys_courses = None
- if has_role(self.request.user,'professor') or has_role(self.request.user,'system_admin'):
+ if has_role(self.request.user,'professor'):
list_courses = Course.objects.filter(Q(professors = True)|Q(professors__name = self.request.user.name)).order_by('name')
categorys_courses = CourseCategory.objects.filter(course_category__professors__name = self.request.user.name).distinct()
+ elif has_role(self.request.user,'system_admin'):
+ list_courses = queryset.order_by('name')
+ categorys_courses = CourseCategory.objects.all()
else:
list_courses = Course.objects.filter(Q(students = True)|Q(students__name = self.request.user.name)).order_by('name')
categorys_courses = CourseCategory.objects.filter(course_category__students__name = self.request.user.name).distinct()
--
libgit2 0.21.2