{% load account_tags %}
{% user_display user as user_display %}

{% if user.is_authenticated %}
<div class="actions-topic">
  <div class="btn-group">
    <a class="btn dropdown-toggle btn-inverse" data-toggle="dropdown" href="#">
      {{ _('Actions') }}
      <span class="caret"></span>
    </a>
    <ul class="dropdown-menu">
      {% if es_moderador %}
      {% if not mytopic.closed  %}<li><a href="{% url app_forum-topic-action mytopic.slug 'close' %}"><i class="icon-remove-circle"></i> {{ _('Close Topic') }}</a></li>{% endif %}
      {% if mytopic.closed %}<li><a href="{% url app_forum-topic-action mytopic.slug 'open' %}" ><i class="icon-ok-circle"></i> {{ _('Open Topic') }}</a></li>{% endif %}
      {% if not mytopic.sticky %}<li><a href="{% url app_forum-topic-action mytopic.slug 'sticky' %}"><i class="icon-arrow-up"></i> {{ _('Sticky Topic') }}</a></li>{% endif %}
      {% if mytopic.sticky %}<li><a href="{% url app_forum-topic-action mytopic.slug 'unsticky' %}"><i class="icon-arrow-down"></i> {{ _('Unsticky Topic') }}</a></li>{% endif %}
      <li><a href="{% url app_forum-topic-delete mytopic.slug %}" data-toggle="modal" data-target="#deleteTopic"><i class="icon-minus"></i> {{ _('Delete Topic') }}</a></li>
      {% endif %}
      {% if user.is_authenticated and not mytopic.closed %}
      <li><a href="{% url app_forum-post-add mytopic.slug %}"><i class="icon-file"></i> {{ _('New reply') }}</a></li>
      {% endif %}
    </ul>
  </div>
</div>
{% endif %}

  <!-- Delete Topic -->
  <div class="modal hide fade" id="deleteTopic">
    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal">×</button>
      <h3>{{ _('Delete a entire topic') }}</h3>
    </div>
    <div class="modal-body">
      <p>{{ _('You are about to delete a entire topic with all posts inside, this procedure is irreversible') }}</p>
      <p>{{ _('Do you want to proceed?') }}</p>
    </div>
    <div class="modal-footer">
      <a href="javascript:$('#modal-from-dom').modal('hide')" class="btn secondary" data-dismiss="modal">{{ _('No') }}</a>
      <a href="{% url app_forum-topic-delete mytopic.slug %}" class="btn btn-danger">{{ _('Yes') }}</a>
    </div>
  </div>
  <!-- Delete Topic -->
