{% extends "layout.html" %}

{% block content_header %}
  {{ build_breadcrumbs([
    { 'name': _('Provisioning / Registrars'), 'link': url_for('.ConfigRegistrarView:index'), 'icon': 'file-o' }
  ]) }}
{% endblock %}

{% block content %}
  <section class="content">
    {% call build_list_containers(_('Registrars'), 'file-o') %}
      {% call build_list_table() %}
        {% call build_list_table_headers(
          get=url_for('.ConfigRegistrarView:get', id=''),
          delete=url_for('.ConfigRegistrarView:delete', id='')
        ) %}
          <th>{{ _('Name') }}</th>
          <th>{{ _('Registrar main') }}</th>
          <th>{{ _('Proxy main') }}</th>
        {% endcall %}
        {% call(config_registrar) build_list_table_rows(resource_list['items']) %}
          <td>{{ config_registrar.name }} ( {{ config_registrar.id }} )</td>
          <td>{{ config_registrar.main_host }}</td>
          <td>{{ config_registrar.proxy_main_host }}</td>
        {% endcall %}
      {% endcall %}
    {% endcall %}

    {% call build_hidden_add_containers(_('Add registrar')) %}
      {% call build_form() %}
        {% call add_default_fields(form=form, submit_value=_('Add')) %}
          {{ render_field(form.name) }}
          {{ render_field(form.main_host) }}
          {{ render_field(form.backup_host) }}
          {{ render_field(form.proxy_main_host) }}
          {{ render_field(form.proxy_backup_host) }}
        {% endcall %}
      {% endcall %}
    {% endcall %}
  </section>
{% endblock %}
