Commit 44f65db09893e672ba8fc21907cd16323fbacc61

Authored by Zambom
1 parent 6f42052f

Adding action menu to answer [Issue: #73]

forum/templates/forum_list.html
1 -{% load i18n %} 1 +{% load i18n permission_tags %}
2 2
3 {% if foruns|length > 0 %} 3 {% if foruns|length > 0 %}
4 {% for forum in foruns %} 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 <div class="page-header"> 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 <b>{% trans 'Description' %}: </b>{{ forum.description }}<p> 23 <b>{% trans 'Description' %}: </b>{{ forum.description }}<p>
9 <b>{% trans 'Created in' %}: </b>{{ forum.create_date }} 24 <b>{% trans 'Created in' %}: </b>{{ forum.create_date }}
10 </div> 25 </div>
forum/templates/post_answer_list.html
1 -{% load i18n %} 1 +{% load i18n permission_tags %}
2 2
3 {% if answers|length > 0 %} 3 {% if answers|length > 0 %}
4 <ul class="timeline post"> 4 <ul class="timeline post">
@@ -10,6 +10,19 @@ @@ -10,6 +10,19 @@
10 <img class="img-responsive img-rounded" src="{{ answer.user.image_url }}" /> 10 <img class="img-responsive img-rounded" src="{{ answer.user.image_url }}" />
11 </div> 11 </div>
12 <div class="col-xs-10 col-sm-10 col-md-10"> 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 <div class="timeline-heading"> 26 <div class="timeline-heading">
14 <h3> {{ answer.user }}</h3> 27 <h3> {{ answer.user }}</h3>
15 </div> 28 </div>
forum/templates/post_list.html
1 -{% load i18n %} 1 +{% load i18n permission_tags %}
2 2
3 {% if posts|length > 0 %} 3 {% if posts|length > 0 %}
4 <ul class="timeline post"> 4 <ul class="timeline post">