{% if page %}
<ul class="nav nav-tabs hidden-print">

  {#
    Left Tabs
  #}
  <li class="nav-main-left-tab active">
    <a href="#revision-body" data-toggle="tab">
      <i class="icon-control-play"></i> View
    </a>
  </li>

  {% if !isTrashPage() %}
  <li class="nav-main-left-tab nav-tab-edit">
    <a {% if user %}href="#edit" data-toggle="tab"{% endif %} class="edit-button {% if not user %}edit-button-disabled{% endif %}">
      <i class="icon-note"></i> {{ t('Edit') }}
    </a>
  </li>
  {% if isHackmdSetup() %}
  <li class="nav-main-left-tab nav-tab-hackmd">
    <a {% if user %}href="#hackmd" data-toggle="tab"{% endif %} class="{% if not user %}edit-button-disabled{% endif %}">
      <i class="fa fa-file-text-o"></i> {{ t('HackMD') }}
    </a>
  </li>
  {% endif %}
  {% endif %}

  {#
    Right Tabs
  #}
  {% if !isTrashPage() %}
    {% if page.isPortal() %}
    <li class="nav-main-right-tab dropdown pull-right">
      <a class="dropdown-toggle {% if not user %}dropdown-disabled{% endif %}" {% if user %}data-toggle="dropdown" href="#"{% endif %}>
        <i class="icon-options-vertical"></i>
      </a>
      <ul class="dropdown-menu">
        <li><a href="#" data-target="#create-template" data-toggle="modal"><i class="icon-fw icon-magic-wand"></i> {{ t('template.option_label.create/edit') }}</a></li>
        {% if ('/' !== path) %}
        <li class="divider"></li>
        <li><a href="#" data-target="#unportalize" data-toggle="modal"><i class="fa fa-share"></i> {{ t('Unportalize') }}</a></li>
        {% endif %}
      </ul>
    </li>
    {% else %}
    <li class="nav-main-right-tab dropdown pull-right">
      <a class="dropdown-toggle {% if not user %}dropdown-disabled{% endif %}" {% if user %}data-toggle="dropdown" href="#"{% endif %}>
        <i class="icon-options-vertical"></i>
      </a>
      <ul class="dropdown-menu">
        <li><a href="#" data-target="#renamePage" data-toggle="modal"><i class="icon-fw icon-action-redo"></i> {{ t('Move') }}</a></li>
        <li><a href="#" data-target="#duplicatePage" data-toggle="modal"><i class="icon-fw icon-docs"></i> {{ t('Duplicate') }}</a></li>
        <li class="divider"></li>
        <li><a href="#" data-target="#create-template" data-toggle="modal"><i class="icon-fw icon-magic-wand"></i> {{ t('template.option_label.create/edit') }}</a></li>
        {% if isDeletablePage() %}
        <li class="divider"></li>
        <li><a href="#" data-target="#deletePage" data-toggle="modal"><i class="icon-fw icon-fire text-danger"></i> {{ t('Delete') }}</a></li>
        {% endif %}
      </ul>
    </li>
    {% endif %}
  {% endif %}

  <li class="nav-main-right-tab pull-right">
    <a href="#revision-history" data-toggle="tab">
      <i class="icon-layers"></i><span class="hidden-xs"> {{ t('History') }}</span>
    </a>
  </li>
  {% if not page.isPortal() %}
    <li class="nav-main-right-tab pull-right">
      <a href="?presentation=1" class="toggle-presentation">
        <i class="icon-film"></i><span class="hidden-xs"> {{ t('Presentation Mode') }}</span>
      </a>
    </li>
  {% endif %}

</ul>

{% else %} {# for creating portal #}

<ul class="nav nav-tabs nav-tabs-create-portal hidden-print">

  <li class="nav-main-left-tab">
    <a id="portal-form-close" data-toggle="tab" href="#cancel-creating-portal">
      <i class="icon-action-undo"></i> {{ t('Cancel') }}
    </a>
  </li>

  <li class="nav-main-left-tab">
    <a {% if user %}href="#edit" data-toggle="tab"{% endif %} class="edit-button {% if not user %}edit-button-disabled{% endif %}">
      <i class="icon-note"></i> {{ t('Create') }}
    </a>
  </li>

{% endif %}

</ul>
