diff --git a/app/templates/home_professor.html b/app/templates/home_professor.html
index 1e57693..2bd893f 100644
--- a/app/templates/home_professor.html
+++ b/app/templates/home_professor.html
@@ -6,7 +6,7 @@
+
+{{block.super}}
+
+
+
+
+
{% trans 'Subjects' %}
+
+
+
+
+
+
{% endblock %}
{% block content %}
-
+
+
+
Subjects
+ {% for subject in subjects %}
+
+
+
Subject 1
+
+
+ Dummy Info
+
+
+ {% endfor %}
+
+
+
{% endblock %}
+
+{% block rightbar %}
+{% endblock rightbar %}
diff --git a/courses/views.py b/courses/views.py
index 7b8b1cd..1303442 100644
--- a/courses/views.py
+++ b/courses/views.py
@@ -81,6 +81,14 @@ class View(LoginRequiredMixin, generic.DetailView):
context_object_name = 'course'
template_name = 'course/view.html'
+ def get_context_data(self, **kwargs):
+ context = super(View, self).get_context_data(**kwargs)
+ course = get_object_or_404(Course, slug = self.kwargs.get('slug'))
+ subjects = Subject.objects.filter(Q(visible=True) | Q(professors__in=[self.request.user]) | Q(course = course))
+ context['subjects'] = subjects
+
+ return context
+
class DeleteView(LoginRequiredMixin, HasRoleMixin, generic.DeleteView):
allowed_roles = ['professor', 'system_admin']
--
libgit2 0.21.2