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

<%= render 'manifestations/title', manifestation: manifestation -%>
<%= form_for :agents, url: agents_path(manifestation_id: manifestation.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 can? :update, manifestation -%> <%= render 'page/add' %> <%- end -%> <%= submit_tag t('page.search') -%> <%= link_to t('page.back_to_index'), agents_path(manifestation_id: manifestation.id) -%>

<%- end -%>
<%- @agents.each do |agent| -%> "> <%- end -%>
<%= t('activerecord.attributes.agent.full_name') -%> <%= t('activerecord.models.produce_type') -%> <%= t('activerecord.models.agent_type') -%>
<%= link_to agent.full_name, agent -%> <%= manifestation.produced(agent).produce_type.display_name.localize if params[:mode] != 'add' and manifestation.produced(agent).try(:produce_type) -%> <%= agent.agent_type.display_name.localize -%> <%- if can? :delete, agent -%> <%- if params[:mode] == 'add' -%> <%= link_to t('page.add'), new_produce_path(manifestation_id: manifestation.id, agent_id: agent.id) unless manifestation.publishers.include?(agent) -%> <%- else -%> <%= link_to t('page.edit'), edit_produce_path(manifestation.produced(agent)) -%> <%= link_to t('page.destroy'), produce_path(manifestation.produced(agent), manifestation_id: manifestation.id), data: {confirm: t('page.are_you_sure')}, method: :delete -%> <%- end -%> <%- end -%>
<%= paginate(@agents) -%>