{% extends "base.html" %}
{% load static %}
{% load i18n %}
{% load forum_permission_tags %}

{% block title %}{{ MACHINA_FORUM_NAME|default:"Forum" }} &mdash; {% block sub_title %}{% endblock sub_title %}{% endblock title %}

{% block css %}
{{ block.super }}
<link rel="stylesheet" href="{% static 'css/machina.board_theme.vendor.min.css' %}" />
<link rel="stylesheet" href="{% static 'css/machina.board_theme.min.css' %}" />
{% endblock css %}

{% block forum_body %}

  {# commented out because it's not in the designs #}
{#{% block header %}#}
{#<nav class="navbar navbar-expand-lg navbar-dark bg-primary">#}
{#  <a class="navbar-brand" href="{% url 'forum:index' %}">{% block brand %}{{ MACHINA_FORUM_NAME|default:"My forum" }}{% endblock %}</a>#}
{#  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">#}
{#    <span class="navbar-toggler-icon"></span>#}
{#  </button>#}
{#  <div class="collapse navbar-collapse" id="navbarSupportedContent">#}
{#    {% block header_collapse %}#}
{#    <form class="my-2 ml-3 form-inline my-lg-0" role="search" action="{% url 'forum_search:search' %}">#}
{#      <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search" name="q">#}
{#      <button class="my-2 btn btn-outline-light my-sm-0" type="submit">{% trans "Search" %}</button>#}
{#    </form>#}
{#    <div class="mr-auto navbar-nav">#}
{#      <a class="nav-item nav-link" href="{% url 'forum_search:search' %}">{% trans "Advanced search" %}</a>#}
{#    </div>#}
{#    {% endblock header_collapse %}#}
{#  </div>#}
{#</nav>#}
{#{% endblock header %}#}

<div class="container my-5" id="main_container">
  <div class="flex w-full">
    <div class="pl-11 w-1/2">
      {% block breadcrumb %}{% include "partials/breadcrumb.html" %}{% endblock breadcrumb %}
    </div>
    <div class="pr-11 w-1/2 text-right controls-link-wrapper">
      {% spaceless %}
      {% if not request.user.is_anonymous %}
        <a href="{% url 'forum_member:user_subscriptions' %}" class="text-sm uppercase"><img src="{% static 'img/icons/icon_subscription.svg' %}" class="inline mr-2" />{% trans "Subscriptions" %}</a>
        <a href="{% url 'forum_member:user_posts' request.user.id %}" class="ml-11 text-sm uppercase"><img src="{% static 'img/icons/icon_my_posts.svg' %}" class="inline mr-2" />{% trans "View my posts" %}</a>
      {% endif %}
      {% get_permission 'can_access_moderation_queue' request.user as can_access_moderation_queue %}
      {% if can_access_moderation_queue %}
        <a href="{% url 'forum_moderation:queue' %}" class="ml-11 text-sm uppercase"><img src="{% static 'img/icons/icon_gavel.svg' %}" class="inline mr-2" />{% trans "Moderation queue" %}</a>
      {% endif %}
      {% endspaceless %}
    </div>
  </div>
</div>
{% endblock forum_body %}

{% block footer_js %}
{{ block.super }}
<script src="{% static 'js/machina.packages.min.js' %}" type="text/javascript" charset="utf-8"></script>
<script src="{% static 'js/machina.min.js' %}" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
  $(function() {
    machina.init();
    {% block onbodyload %}{% endblock onbodyload %}
  });
</script>
{% endblock footer_js %}
