{% extends "layout.html" %}

{% block content_header %}
  {{ build_breadcrumbs([
    { 'name': _('Agents'), 'link': url_for('.AgentView:index'), 'icon': 'users' }
  ]) }}
{% endblock %}

{% block content %}
  <section class="content">
    {% call build_list_containers(_('Agent'), 'users') %}
      {% call build_list_table() %}
        {% call build_list_table_headers(get=url_for('.AgentView:get', id=''), delete=url_for('.AgentView:delete', id='')) %}
          <th>{{ _('Agent Number') }}</th>
          <th>{{ _('Firstname') }}</th>
          <th>{{ _('Lastname') }}</th>
        {% endcall %}
        {% call(agent) build_list_table_rows(resource_list['items']) %}
          <td>{{ agent.number }}</td>
          <td>{{ agent.firstname }}</td>
          <td>{{ agent.lastname }}</td>
        {% endcall %}
      {% endcall %}
    {% endcall %}

    {% call build_hidden_add_containers(_('Add Agent')) %}
      {% call build_form() %}
        {% call add_default_fields(form=form, submit_value=_('Add')) %}
          {{ render_field(form.number) }}
          {{ render_field(form.firstname) }}
          {{ render_field(form.lastname) }}
        {% endcall %}
      {% endcall %}
    {% endcall %}
  </section>
{% endblock %}
