Commit 1fa68bbde899b56e2371ff5ab18ecad230b83587
1 parent
29f01fe5
Exists in
master
and in
5 other branches
added support for teachers and admins for courses #201
Showing
3 changed files
with
18 additions
and
21 deletions
Show diff stats
core/static/css/base/amadeus.css
... | ... | @@ -420,6 +420,14 @@ ul, li { |
420 | 420 | .course, .subject, .topic{ padding-top: 0px; padding-bottom: 0px; } |
421 | 421 | .course-detail{padding-top: 10px; padding-bottom: 10px;} |
422 | 422 | |
423 | +.course-card{ | |
424 | + margin-bottom: 0.4% !important; | |
425 | +} | |
426 | + | |
427 | +.course-card-group{ | |
428 | + margin-bottom: 1%; | |
429 | +} | |
430 | + | |
423 | 431 | .category-course-link{ |
424 | 432 | font-size: 24px; |
425 | 433 | color: black !important; | ... | ... |
courses/templates/course/course_card.html
courses/templates/course/index.html
... | ... | @@ -111,17 +111,20 @@ |
111 | 111 | </fieldset> |
112 | 112 | <div class="col-md-12 cards-content"> |
113 | 113 | {% for category in categorys_courses %} |
114 | - <div class="panel-group"> | |
114 | + <div class="panel-group course-card-group"> | |
115 | 115 | <div class="panel panel-default"> |
116 | 116 | <div class="panel-heading"> |
117 | - <h4 class="panel-title"> | |
118 | - <a class="category-course-link" data-toggle="collapse" href="#{{category.slug}}">{{category.name}}</a> | |
119 | - </h4> | |
120 | - | |
117 | + <div class="row"> | |
118 | + <div class="col-md-12"> | |
119 | + <h4 class="panel-title"> | |
120 | + <a class="category-course-link" data-toggle="collapse" href="#{{category.slug}}">{{category.name}}</a> | |
121 | + </h4> | |
122 | + </div> | |
123 | + </div> | |
121 | 124 | </div> |
122 | 125 | <div id="{{category.slug}}" class="panel-collapse collapse"> |
123 | 126 | {% for course in category.course_category.all %} |
124 | - {% if user in course.students.all %} | |
127 | + {% if user in course.students.all or user in course.professors.all or user|has_role:'system_admin' %} | |
125 | 128 | {% include "course/course_card.html" %} |
126 | 129 | {% endif %} |
127 | 130 | {% endfor %} |
... | ... | @@ -131,20 +134,6 @@ |
131 | 134 | |
132 | 135 | |
133 | 136 | {% endfor %} |
134 | - <!--{% if courses|length > 0 %} | |
135 | - {% if request.GET.category == '' or aparece or request.GET.q == '' %} | |
136 | - {% for course in list_courses %} | |
137 | - {% include "course/course_card.html" %} | |
138 | - {% endfor %} | |
139 | - {% endif %} | |
140 | - {% if request.GET.category or request.GET.q %} | |
141 | - {% for course in courses %} | |
142 | - {% include "course/course_card.html" %} | |
143 | - {% endfor %} | |
144 | - {% endif %} | |
145 | - {% else %} | |
146 | - {% trans 'No courses found' %} | |
147 | - {% endif %}--> | |
148 | 137 | </div> |
149 | 138 | <div class="col-md-12"> |
150 | 139 | <nav aria-label="Page navigation"> | ... | ... |