{% load i18n %}
{% if urlpath %}
<div id="article-breadcrumbs">

<ul class="breadcrumb pull-left">
  {% for ancestor in urlpath.cached_ancestors %}
    <li><a href="{% url 'wiki:get' path=ancestor.path %}">{{ ancestor.article.current_revision.title|truncatechars:25 }}</a></li>
  {% endfor %}
  <li class="active">{{ article.current_revision.title|truncatechars:25 }}</li>
</ul>
<div class="pull-left" style="margin-left: 10px;">
  <div class="btn-group">
    <a class="btn btn-info dropdown-toggle" data-toggle="dropdown" href="#" style="padding: 7px;" title="{% trans "Sub-articles for" %} {{ article.current_revision.title }}">
      <span class="fa fa-sitemap"></span>
      <span class="caret"></span>
    </a>
    <ul class="dropdown-menu">
      {% for child in children_slice %}
        <li>
          <a href="{% url 'wiki:get' path=child.path %}">
            {{ child.article.current_revision.title }}
          </a>
        </li>
        {% empty %}
        <li><a href="#"><em>{% trans "No sub-articles" %}</em></a></li>
      {% endfor %}
      {% if children_slice_more %}
      <li><a href="#"><em>{% trans "...and more" %}</em></a></li>
      {% endif %}
      <li class="divider"></li>
      <li>
        <a href="{% url 'wiki:dir' path=urlpath.path %}">{% trans "Browse articles in this level" %} &raquo;</a>
      </li>
    </ul>
  </div>
</div>
<div class="pull-left" style="margin-left: 10px;">
  <div class="btn-group">
    <a class="btn btn-info dropdown-toggle" data-toggle="dropdown" href="#" style="padding: 7px;" title="{% trans "Sub-articles for" %} {{ article.current_revision.title }}">
      <span class="fa fa-file"></span>
      <span class="caret"></span>
    </a>
    <ul class="dropdown-menu">
      <li>
        {% if urlpath.parent %}
        <a href="{% url 'wiki:create' path=urlpath.parent.path %}" style="padding: 7px;">
          <span class="fa fa-arrow-right"></span>
          {% trans "New article next to" %} {{ article.current_revision.title }}
        </a>
        {% endif %}
        <a href="{% url 'wiki:create' path=urlpath.path %}" style="padding: 7px;">
          <span class="fa fa-arrow-down"></span>
          {% trans "New article below" %} {{ article.current_revision.title }}
        </a>
      </li>
    </ul>
  </div>
</div>

{% if user.is_superuser %}
  <div class="pull-left" style="margin-left: 10px;">
    <div class="btn-group">
      <a class="btn btn-info dropdown-toggle" data-toggle="dropdown" href="#" style="padding: 7px;" title="{% trans "Sub-articles for" %} {{ article.current_revision.title }}">
        <span class="fa fa-cogs"></span>
        <span class="caret"></span>
      </a>
      <ul class="dropdown-menu">
        {% if user.is_superuser %}
          <li>
            <a href="{% url 'wiki:deleted_list' %}">
              <i class="fa fa-trash-o"></i>
              {% trans "Deleted articles" %}
            </a>
          </li>
        {% endif %}
      </ul>
    </div>
  </div>
{% endif %}
<div style="clear: both"></div>
</div>
{% endif %}
