Commit 5309b7f9039eba1f22c0c6ee1da63bd27f6befab
1 parent
13dc217d
Exists in
master
and in
5 other branches
colapse category #189
Showing
2 changed files
with
34 additions
and
12 deletions
Show diff stats
courses/templates/course/index.html
@@ -44,18 +44,41 @@ | @@ -44,18 +44,41 @@ | ||
44 | </div> | 44 | </div> |
45 | 45 | ||
46 | {% if user|has_role:'professor' or user|has_role:'system_admin' %} | 46 | {% if user|has_role:'professor' or user|has_role:'system_admin' %} |
47 | - <div class="panel panel-primary"> | ||
48 | - <div class="panel-heading"> | ||
49 | - <h3 class="panel-title">{% trans 'Category' %}</h3> | 47 | + <div class="panel panel-primary"> |
48 | + <div class="panel-heading"> | ||
49 | + <h3 class="panel-title">{% trans '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' %}">{% trans 'Create Category' %}</a></li> | ||
54 | + <li><a href="{% url 'course:manage_cat' %}">{% trans 'List Category' %}</a></li> | ||
55 | + </ul> | ||
56 | + </div> | ||
50 | </div> | 57 | </div> |
51 | - <div class="panel-body"> | ||
52 | - <ul class="nav nav-pills nav-stacked"> | ||
53 | - <li><a href="{% url 'course:create_cat' %}">{% trans 'Create Category' %}</a></li> | ||
54 | - <li><a href="{% url 'course:manage_cat' %}">{% trans 'List Category' %}</a></li> | ||
55 | - </ul> | 58 | + {% endif %} |
59 | + <div class="panel-group" id="accordion"> | ||
60 | + <div class="panel panel-primary"> | ||
61 | + <div class="panel-heading"> | ||
62 | + <h4 class="panel-title"> | ||
63 | + <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne"> | ||
64 | + </span>{% trans 'Categorys' %}</a> | ||
65 | + </h4> | ||
66 | + </div> | ||
67 | + <div id="collapseOne" class="panel-collapse collapse in"> | ||
68 | + <div class="panel-body"> | ||
69 | + <table class="table"> | ||
70 | + {% for category in categorys_courses %} | ||
71 | + <tr> | ||
72 | + <td> | ||
73 | + <a href="?category={{category.name}}">{{category.name}}</a> | ||
74 | + </td> | ||
75 | + </tr> | ||
76 | + {% endfor %} | ||
77 | + </table> | ||
78 | + </div> | ||
79 | + </div> | ||
80 | + </div> | ||
56 | </div> | 81 | </div> |
57 | - </div> | ||
58 | - {% endif %} | ||
59 | 82 | ||
60 | {% endblock %} | 83 | {% endblock %} |
61 | 84 | ||
@@ -85,7 +108,6 @@ | @@ -85,7 +108,6 @@ | ||
85 | </form> | 108 | </form> |
86 | </div> | 109 | </div> |
87 | 110 | ||
88 | - | ||
89 | </fieldset> | 111 | </fieldset> |
90 | <div class="col-md-12 cards-content"> | 112 | <div class="col-md-12 cards-content"> |
91 | {% if courses|length > 0 %} | 113 | {% if courses|length > 0 %} |
courses/views.py
@@ -31,7 +31,7 @@ class IndexView(LoginRequiredMixin, NotificationMixin, generic.ListView): | @@ -31,7 +31,7 @@ class IndexView(LoginRequiredMixin, NotificationMixin, generic.ListView): | ||
31 | queryset = Course.objects.all() | 31 | queryset = Course.objects.all() |
32 | template_name = 'course/index.html' | 32 | template_name = 'course/index.html' |
33 | context_object_name = 'courses' | 33 | context_object_name = 'courses' |
34 | - paginate_by = 2 | 34 | + paginate_by = 10 |
35 | aparece = True | 35 | aparece = True |
36 | 36 | ||
37 | 37 |