Commit 44f65db09893e672ba8fc21907cd16323fbacc61
1 parent
6f42052f
Exists in
master
and in
5 other branches
Adding action menu to answer [Issue: #73]
Showing
3 changed files
with
33 additions
and
5 deletions
Show diff stats
forum/templates/forum_list.html
1 | -{% load i18n %} | |
1 | +{% load i18n permission_tags %} | |
2 | 2 | |
3 | 3 | {% if foruns|length > 0 %} |
4 | 4 | {% for forum in foruns %} |
5 | - <a class="forum_collapse" role="button" href="javascript: showPosts('{% url 'forum:posts' %}', '{{ forum.slug }}')" aria-expanded="false"> | |
5 | + <a class="forum_collapse" role="button" href="javascript: showPosts('{% url 'forum:posts' %}', '{{ forum.slug }}')" aria-expanded="true"> | |
6 | 6 | <div class="page-header"> |
7 | - <h1 id="timeline">{{ forum }}</h1> | |
7 | + <!-- {% if user|has_role:'system_admin' or user|has_role:'professor' and user == forum.topic.owner %} | |
8 | + <div class="pull-right"> | |
9 | + <div class="btn-group icon-more-horiz"> | |
10 | + <button class="btn btn-default btn-xs dropdown-toggle" type="button" onclick="$('#dropdown{{ forum.slug }}').dropdown('toggle');" data-toggle="dropdown"> | |
11 | + <i class="material-icons">more_horiz</i> | |
12 | + </button> | |
13 | + <ul class="dropdown-menu" id="dropdown{{ forum.slug }}"> | |
14 | + <li><a href="javascript:void(0)"><i class="material-icons">create</i> Edit</a></li> | |
15 | + <li><a href="javascript:void(0)"><i class="material-icons">delete_sweep</i> Remove</a></li> | |
16 | + </ul> | |
17 | + </div> | |
18 | + </div> | |
19 | + {% endif %} --> | |
20 | + <h1 id="timeline"> | |
21 | + {{ forum }} | |
22 | + </h1> | |
8 | 23 | <b>{% trans 'Description' %}: </b>{{ forum.description }}<p> |
9 | 24 | <b>{% trans 'Created in' %}: </b>{{ forum.create_date }} |
10 | 25 | </div> | ... | ... |
forum/templates/post_answer_list.html
1 | -{% load i18n %} | |
1 | +{% load i18n permission_tags %} | |
2 | 2 | |
3 | 3 | {% if answers|length > 0 %} |
4 | 4 | <ul class="timeline post"> |
... | ... | @@ -10,6 +10,19 @@ |
10 | 10 | <img class="img-responsive img-rounded" src="{{ answer.user.image_url }}" /> |
11 | 11 | </div> |
12 | 12 | <div class="col-xs-10 col-sm-10 col-md-10"> |
13 | + {% if user|has_role:'system_admin' or user|has_role:'professor' and user == forum.topic.owner %} | |
14 | + <div class="pull-right"> | |
15 | + <div class="btn-group icon-more-horiz"> | |
16 | + <a class="btn btn-default btn-xs dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | |
17 | + <i class="material-icons">more_horiz</i> | |
18 | + </a> | |
19 | + <ul class="dropdown-menu" aria-labelledby="dropdownMenu1"> | |
20 | + <li><a href="javascript:void(0)"><i class="material-icons">create</i> Edit</a></li> | |
21 | + <li><a href="javascript:void(0)"><i class="material-icons">delete_sweep</i> Remove</a></li> | |
22 | + </ul> | |
23 | + </div> | |
24 | + </div> | |
25 | + {% endif %} | |
13 | 26 | <div class="timeline-heading"> |
14 | 27 | <h3> {{ answer.user }}</h3> |
15 | 28 | </div> | ... | ... |
forum/templates/post_list.html