{% extends "layout.html" %}

{% block content_header %}
  {{ build_breadcrumbs([
    { 'name': _('Tenants'), 'link': url_for('.TenantView:index'), 'icon': 'building' }
  ]) }}
{% endblock %}

{% block content %}
  <section class="content">
    {% call build_list_containers(_('Tenants'), 'building') %}
      {% call build_list_table() %}
        {% call build_list_table_headers(get=url_for('.TenantView:get', id=''), delete=url_for('.TenantView:delete', id='')) %}
          <th>{{ _('Name') }}</th>
          <th>{{ _('Identifier') }}</th>
        {% endcall %}
        {% call(tenant) build_list_table_rows(resource_list['items']) %}
          <td>{{ tenant.name }}</td>
          <td>{{ tenant.slug }}</td>
        {% endcall %}
      {% endcall %}
    {% endcall %}

    {% call build_hidden_add_containers(_('Add Tenant')) %}
      {% call build_form() %}
        {% call add_default_fields(form=form, submit_value=_('Add')) %}
          {{ render_field(form.name) }}
          {{ render_field(form.slug) }}
        {% endcall %}
      {% endcall %}
    {% endcall %}
  </section>
{% endblock %}
