{% extends 'admin/layout.html.twig' %}

{% set script_controller = 'navigation/index' %}

{% set menu = 'admin_'~type~'_navigation' %}
{% set types = {top:'admin.setting.navigation.top'|trans, foot:'admin.setting.navigation.foot'|trans, friendlyLink:'admin.setting.navigation.friendlyLink'|trans} %}

{% block page_buttons %} 
    <button class="btn btn-success btn-sm pull-right" id="add-navigation-btn" data-toggle="modal" data-target="#modal" data-url="{{ path('admin_navigation_create', {type: type}) }}">
        {% if types[type] == 'admin.setting.navigation.friendlyLink'|trans %}
            {{'admin.setting.navigation.add_type_btn'|trans({'%types[type]%': types[type] })}}
        {% else %}
            {{'admin.setting.navigation.add_type_nav_btn'|trans({'%types[type]%': types[type] })}}
        {% endif %}
    </button>
{% endblock %}

{% block main %}

{% if type == 'foot' %}
{% set url = path('admin_block', {category:'theme'}) %}
<div class="alert alert-info"><i class="glyphicon glyphicon-info-sign"></i> {{ 'admin.setting.navigation.foot.tips'|trans({'%url%': url })|raw }}</div>
{% elseif type == 'friendlyLink' %}
{% set url = path('admin_setting_theme') %}
<div class="alert alert-info"><i class="glyphicon glyphicon-info-sign"></i>{{ 'admin.setting.navigation.friendlyLink.tips'|trans({'%url%': url})|raw }}
</div>
{% endif %}

<table id="navigation-table" class="table table-striped table-hover navigation-table sortable-list">
  <thead>
    <tr>
      <th width="50%">{{'admin.setting.navigation.name'|trans}}</th>
      <th width="10%">{{'admin.setting.navigation.new_windows'|trans}}</th>
      <th width="10%">{{'admin.setting.navigation.status'|trans}}</th>  
      <th width="30%">{{'admin.setting.navigation.operation'|trans}}</th>
    </tr>
  </thead>
    
  {% include 'admin/navigation/tbody.html.twig' %}
</table>
    
<div class="alert alert-info">
  {{ 'admin.setting.navigation.tips'|trans|raw }}
</div>

{% endblock %}
