Commit 4bf6bfcb3bd1649968aeb3dd45f171288def9cb6
1 parent
17f52102
Exists in
master
and in
3 other branches
fixed accordeon and added subscribe and access buttons, still has to add it's functionality
Showing
2 changed files
with
9 additions
and
3 deletions
Show diff stats
subjects/templates/subjects/list.html
@@ -92,7 +92,7 @@ | @@ -92,7 +92,7 @@ | ||
92 | {% if user in category.coordinators.all %} | 92 | {% if user in category.coordinators.all %} |
93 | <a href="{% url 'subjects:create' category.slug %}"><button class="create-subject-btn"> {% trans "create new subject" %} </button></a> | 93 | <a href="{% url 'subjects:create' category.slug %}"><button class="create-subject-btn"> {% trans "create new subject" %} </button></a> |
94 | {% endif %} | 94 | {% endif %} |
95 | - <div class="panel-group" id="subject-accordion" role="tablist" aria-multiselectable="true"> | 95 | + <div class="panel-group" id="subject-accordion" role="tablist" aria-multiselectable="true"> |
96 | {% for subject in category.subjects %} | 96 | {% for subject in category.subjects %} |
97 | {% include "subjects/subject_card.html" %} | 97 | {% include "subjects/subject_card.html" %} |
98 | {% endfor %} | 98 | {% endfor %} |
@@ -100,6 +100,8 @@ | @@ -100,6 +100,8 @@ | ||
100 | 100 | ||
101 | 101 | ||
102 | </div> | 102 | </div> |
103 | + | ||
104 | + | ||
103 | 105 | ||
104 | 106 | ||
105 | {% comment %} | 107 | {% comment %} |
subjects/templates/subjects/subject_card.html
@@ -49,8 +49,12 @@ | @@ -49,8 +49,12 @@ | ||
49 | <p>{{subject.description_brief|safe}}</p> | 49 | <p>{{subject.description_brief|safe}}</p> |
50 | 50 | ||
51 | 51 | ||
52 | - | ||
53 | - | 52 | + {% if request.user in subject.students.all %} |
53 | + <a href="{% url 'categories:create' %}"><button class="access-subject"> {% trans "Access Subject" %}</button></a> | ||
54 | + {% else %} | ||
55 | + <a href="{% url 'categories:create' %}"><button class="subscribe-subject"> {% trans "Subscribe to Subject" %}</button></a> | ||
56 | + {% endif %} | ||
57 | + | ||
54 | </div> | 58 | </div> |
55 | 59 | ||
56 | </div> | 60 | </div> |
57 | \ No newline at end of file | 61 | \ No newline at end of file |