{% extends "layout.html" %}

{% block content_header %}
  {{ build_breadcrumbs(current_breadcrumbs + [
    { 'name': _('Directory'), 'link': url_for('.DirdSourceView:index'), 'icon': 'address-book' }
  ]) }}
{% endblock %}

{% block content %}
  <section class="content">
    {% call build_list_containers(_('Directory'), 'address-book') %}
      {% call build_list_table() %}
        {% call build_list_table_headers(get=url_for('.DirdSourceView:get', backend='', id=''), delete=url_for('.DirdSourceView:delete', backend='', id='')) %}
          <th>{{ _('Name') }}</th>
          <th>{{ _('Backend') }}</th>
        {% endcall %}
        {% call(source) build_list_table_rows(resource_list['items']) %}
          <td>{{ source.name }}</td>
          <td>{{ source.backend }}</td>
        {% endcall %}
      {% endcall %}
    {% endcall %}

    {% call build_hidden_add_containers(_('Add Directory Source')) %}
      {% for backend in backend_list['items'] %}
       <a class="btn btn-block btn-default" href="{{ url_for('.DirdSourceView:new', backend=backend['name']) }}">
         {{ backend['name'] }}
       </a>
      {% endfor %}
    {% endcall %}
  </section>
{% endblock %}
