{% import "macros.html" as macros %}
<div id="js-post-controls-{{ question.pk }}" class="js-question-controls js-post-controls" data-post-id="{{ question.pk }}">
  <span id="js-edit-btn-post-body-{{ question.pk }}"
    class="action-link js-edit with-edit-icon"
  >{% trans %}edit{% endtrans %}</span>
  {{ macros.post_flag_buttons(question) }}
  {% if settings.GROUPS_ENABLED %}
    {% set is_published=(not question.is_private()) %}
    <span
      id="js-post-publish-btn-{{question.pk}}"
      class="action-link {% if is_published %}js-unpublish-post with-bullhorn-icon with-slashed-icon{% else %}js-publish-post with-bullhorn-icon{% endif %}"
      data-post-id={{question.pk}}
    >
      {% if is_published %}
        {% trans %}unpublish{% endtrans %}</a>
      {% else %}
        {% trans %}publish{% endtrans %}</a>
      {% endif %}
    </span>
    {% if request.user.is_anonymous or not request.user.can_publish_group_private_post(question) %}
      <script type="text/javascript">
        document.getElementById("js-post-publish-btn-" + '{{question.pk}}').remove();
      </script>
    {% endif %}
  {% endif %}
  {% if thread.closed %}
    <a id="js-question-close-btn-{{question.id}}"
      class="action-link with-reopen-icon js-post-reopen"
      href="{{ url('reopen',  question.id ) }}"
    >{% trans %}reopen{% endtrans %}</a>
  {% else %}
    <a id="js-question-close-btn-{{question.id}}"
      class="action-link with-close-icon"
      href="{{ url('close',  question.id ) }}"
    >{% trans %}close{% endtrans %}</a>
  {% endif %}
  <a
    id="js-question-merge-btn-{{question.id}}"
    class="action-link js-question-merge-btn with-merge-icon"
  >{% trans %}merge{% endtrans %}</a>
  <a
    id="js-post-delete-btn-{{question.id}}"
    class="action-link js-post-delete-btn with-delete-icon"
    data-post-id="{{question.id}}"
  >{% if question.deleted %}{% trans %}undelete{% endtrans %}{% else %}{% trans %}delete{% endtrans %}{% endif %}</a>
  <script type="text/javascript">
    askbot.functions.renderPostControls('{{question.id}}'{{ ', true' if question.wiki }});
  </script>
</div>
