Commit 9a603ad60d357b043712d70ee57e487894381326
1 parent
8e6c7d43
Exists in
master
and in
5 other branches
modifying index course #205
Showing
1 changed file
with
87 additions
and
64 deletions
Show diff stats
courses/templates/course/index.html
@@ -11,76 +11,99 @@ | @@ -11,76 +11,99 @@ | ||
11 | {% endblock %} | 11 | {% endblock %} |
12 | 12 | ||
13 | {% block sidebar %} | 13 | {% block sidebar %} |
14 | - {{block.super}} | 14 | + <div class="panel panel-primary"> |
15 | + <div class="panel-heading"> | ||
16 | + <h4>Menu</h4> | ||
17 | + </div> | ||
18 | + <div class="panel-body"> | ||
19 | + <ul class="nav nav-pills nav-stacked"> | ||
20 | + <li><a href="{% url 'app:index' %}">{% trans 'Home' %}</a></li> | ||
21 | + <li><a href="{% url 'users:profile' %}">{% trans 'Profile' %}</a></li> | ||
22 | + {% if user|has_role:'student' or not user.is_staff %} | ||
23 | + <li><a href="{% url 'course:manage' %}">{% trans 'My courses' %}</a></li> | ||
24 | + <li><a href="{% url 'core:guest' %}">{% trans 'All Courses' %}</a></li> | ||
25 | + {% endif %} | ||
26 | + {% if user|has_role:'system_admin' %} | ||
27 | + <li> <a href="{% url 'users:manage' %}">{% trans 'Manage Users' %}</a></li> | ||
28 | + {% endif %} | ||
29 | + {% if user|has_role:'system_admin' or user|has_role:'professor' %} | ||
30 | + <li> | ||
31 | + <a href="#courses_list" class="accordion" data-toggle="collapse">{% trans 'Manage Courses' %}</a> | ||
32 | + <div id="courses_list" class="collapse"> | ||
33 | + <ul class="nav nav-pill nav-stacked accordion_list"> | ||
34 | + {% for course in courses_list %} | ||
35 | + <li><a href="{% url 'course:view' course.slug %}">{{ course }}</a></li> | ||
36 | + {% endfor %} | ||
37 | + </ul> | ||
38 | + </div> | ||
39 | + </li> | ||
40 | + {% endif %} | ||
41 | + </ul> | ||
42 | + </div> | ||
43 | + </div> | ||
44 | + | ||
45 | + {% if user|has_role:'professor' or user|has_role:'system_admin' %} | ||
46 | + | ||
47 | + <div class="panel panel-primary"> | ||
48 | + <div class="panel-heading"> | ||
49 | + <h3 class="panel-title">Category</h3> | ||
50 | + </div> | ||
51 | + <div class="panel-body"> | ||
52 | + <ul class="nav nav-pills nav-stacked"> | ||
53 | + <li><a href="{% url 'course:create_cat' %}">Create Category</a></li> | ||
54 | + <li><a href="{% url 'course:manage_cat' %}">List Category</a></li> | ||
55 | + </ul> | ||
56 | + </div> | ||
57 | + </div> | ||
58 | + {% endif %} | ||
15 | {% endblock %} | 59 | {% endblock %} |
16 | 60 | ||
17 | {% block content %} | 61 | {% block content %} |
18 | - {% if messages %} | ||
19 | - {% for message in messages %} | ||
20 | - <div class="alert alert-success alert-dismissible" role="alert"> | ||
21 | - <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
22 | - <span aria-hidden="true">×</span> | ||
23 | - </button> | ||
24 | - <p>{{ message }}</p> | ||
25 | - </div> | ||
26 | - {% endfor %} | ||
27 | - {% endif %} | 62 | + {% if messages %} |
63 | + {% for message in messages %} | ||
64 | + <div class="alert alert-success alert-dismissible" role="alert"> | ||
65 | + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> | ||
66 | + <span aria-hidden="true">×</span> | ||
67 | + </button> | ||
68 | + <p>{{ message }}</p> | ||
69 | + </div> | ||
70 | + {% endfor %} | ||
71 | + {% endif %} | ||
28 | 72 | ||
29 | -<div class="col-md-12"> | ||
30 | - <form id="searchform" action="{% url 'course:manage' %}" method="get" accept-charset="utf-8"> | ||
31 | - <div class="input-group"> | ||
32 | - <div class="form-group is-empty"> | ||
33 | - <input type="search" class="form-control" placeholder="Search Courses" name="q" id="searchbox"></div> | ||
34 | - <span class="input-group-btn input-group-sm"> | ||
35 | - <button type="button" class="btn btn-fab btn-fab-mini"> | ||
36 | - <i class="material-icons">{% trans 'search' %}</i> | ||
37 | - </button> | ||
38 | - </span> | ||
39 | - </div> | ||
40 | - </form> | 73 | +<div class="col-md-12 cards-content"> |
74 | + <form id="searchform" action="{% url 'course:manage' %}" method="get" accept-charset="utf-8"> | ||
75 | + <div class="input-group"> | ||
76 | + <div class="form-group is-empty"> | ||
77 | + <input type="search" class="form-control" placeholder="Search Courses" name="q" id="searchbox"></div> | ||
78 | + <span class="input-group-btn input-group-sm"> | ||
79 | + <button type="button" class="btn btn-fab btn-fab-mini"> | ||
80 | + <i class="material-icons">search</i> | ||
81 | + </button> | ||
82 | + </span> | ||
83 | + </div> | ||
84 | + </form> | ||
41 | </div> | 85 | </div> |
42 | - | 86 | + |
43 | 87 | ||
44 | </fieldset> | 88 | </fieldset> |
45 | - <div class="col-md-12"> | ||
46 | - {% if courses|length > 0 %} | ||
47 | - {% if request.GET.category == 'all' or none or request.GET.category == '' %} | ||
48 | - {% for course in list_courses %} | ||
49 | - {% include "course/course_card.html" %} | ||
50 | - {% endfor %} | ||
51 | - {% else %} | ||
52 | - {% for course in courses_category %} | ||
53 | - {% if course.category.name == request.GET.category %} | ||
54 | - <!-- Put your content here! --> | ||
55 | - {% include "course/course_card.html" %} | ||
56 | - {% endif %} | ||
57 | - {% endfor %} | ||
58 | - {% endif %} | ||
59 | - {% else %} | ||
60 | - {% trans 'No courses found' %} | ||
61 | - {% endif %} | ||
62 | - </div> | ||
63 | - <div class="col-md-12"> | ||
64 | - <nav aria-label="Page navigation"> | ||
65 | - <ul class="pagination"> | ||
66 | - {% if page_obj.has_previous %} | ||
67 | - <li> | ||
68 | - <a href="?page={{ page_obj.previous_page_number }}"><span><<</span></a> | ||
69 | - </li> | ||
70 | - {% endif %} | ||
71 | - {% for page_number in paginator.page_range %} | ||
72 | - <li{% if page_obj.number == page_number %} class="active"{% endif %}> | ||
73 | - <a href="?page={{ page_number }}">{{ page_number }}</a> | ||
74 | - </li> | ||
75 | - {% endfor %} | ||
76 | - {% if page_obj.has_next %} | ||
77 | - <li> | ||
78 | - <a href="?page={{ page_obj.next_page_number }}"><span>>></span></a> | ||
79 | - </li> | ||
80 | - {% endif %} | ||
81 | - </ul> | ||
82 | - </nav> | ||
83 | - </div> | 89 | + <div class="col-md-12 cards-content"> |
90 | + {% if courses|length > 0 %} | ||
91 | + {% if request.GET.category == 'all' or none or request.GET.category == '' %} | ||
92 | + {% for course in list_courses %} | ||
93 | + {% include "course/course_card.html" %} | ||
94 | + {% endfor %} | ||
95 | + {% else %} | ||
96 | + {% for course in courses_category %} | ||
97 | + {% if course.category.name == request.GET.category %} | ||
98 | + <!-- Put your content here! --> | ||
99 | + {% include "course/course_card.html" %} | ||
100 | + {% endif %} | ||
101 | + {% endfor %} | ||
102 | + {% endif %} | ||
103 | + {% else %} | ||
104 | + {% trans 'No courses found' %} | ||
105 | + {% endif %} | ||
106 | + </div> | ||
84 | 107 | ||
85 | - <script type="text/javascript" src="{% static 'js/course.js' %}"></script> | 108 | + <script type="text/javascript" src="{% static 'js/course.js' %}"></script> |
86 | {% endblock %} | 109 | {% endblock %} |