<% if user_can?('update_agent_record') %>
<% if !['edit', 'update'].include?(controller.action_name) %>
<%= link_to I18n.t("actions.edit"), {:controller => :agents, :action => :edit, :id => @agent.id, :agent_type => @agent.agent_type}, :class => "btn btn-sm btn-primary" %>
<% end %> <% if ['new', 'create', 'edit', 'update'].include?(controller.action_name) %>
<% end %> <% if ['edit', 'update'].include?(controller.action_name) %>
<%= link_to I18n.t("actions.revert"), {:controller => :agents, :action => :edit, :id => @agent.id}, :class => "btn btn-sm btn-default" %> <%= I18n.t("actions.toolbar_disabled_message") %>
<% end %>
<% if user_can?('update_event_record') %> <%= render_aspace_partial :partial => "shared/event_dropdown", :locals => {:record => @agent} %> <% end %>
<%= link_to I18n.t("actions.export_eac"), {:controller => :exports, :action => :download_eac, :id => @agent.id, :type => @agent.agent_type}, :class => "btn btn-sm btn-default" %>
<% if @agent.publish %>
<%= link_to I18n.t("actions.view_published"), File.join(AppConfig[:public_proxy_url], @agent.uri).to_s, :target => "_blank", :class => "btn btn-sm btn-default" %>
<% end %> <% if user_can?('merge_agent_record') %> <%= render_aspace_partial :partial => "shared/merge_dropdown", :locals => {:record => @agent, :extra_params => {:agent_type => @agent.agent_type}, :controller => :agents, :confirmation_title => I18n.t("actions.merge_confirm_title"), :confirmation_msg => I18n.t("actions.merge_agent_confirm_message", :source => @agent.title)} %> <% end %> <% if user_can?('delete_agent_record') %>
<%= button_delete_action url_for(:controller => :agents, :action => :delete, :id => @agent.id) %>
<% end %>
<% end %>