<%= t('page.listing', model: t('activerecord.models.agent')) -%>

[P] <%= link_to agent.full_name, agent -%>

<%= form_for :agents, url: agents_path(agent_id: agent.id), html: {method: 'get'} do -%>

<%= label_tag :search_form_top, t('page.search_term') -%>: <%= search_field_tag 'query', h(@query), {id: 'search_form_top', class: 'search_form', placeholder: t('page.search_term')} -%> <%- if policy(agent).update? -%> <%= render 'page/add' %> <%- end -%> <%= submit_tag t('page.search') -%>

<%- end -%>
<%- @agents.each do |agent| -%> "> <%- end -%>
<%= t('activerecord.attributes.agent.full_name') -%> <%= t('activerecord.models.agent_type') -%> <%= t('activerecord.attributes.agent.date_of_birth') -%>
<%= link_to agent.full_name, agent -%>
<%= agent.full_name_transcription -%>
<%= agent.agent_type.display_name -%> <%=l agent.date_of_birth if agent.date_of_birth -%> <%- if policy(agent).destroy? -%> <%= link_to t('page.edit'), edit_agent_path(agent) -%> <% end %> <%- if policy(agent).destroy? -%> <%- if params[:mode] == "add" -%> <%= link_to t('page.add'), new_agent_relationship_path(agent_id: agent.id, child_id: agent.id) unless agent.derived_agents.include?(agent) or agent == agent -%> <%- else -%> <%- agent_relationship = agent.to_agents.where(child_id: agent.id).first -%> <%= link_to t('page.destroy'), agent_relationship, data: {confirm: t('page.are_you_sure')}, method: :delete if agent_relationship -%> <%- end -%> <%- end -%>
<%= paginate(@agents) -%>