@@ -18,6 +29,10 @@
<%= render_aspace_partial :partial => "shared/slug", :locals => {:form => form, :record_type => @agent} if AppConfig[:use_human_readable_urls] %>
+ <% if @agent.has_key?("is_user") %>
+ <%= form.label_and_textfield "is_user", { :field_opts => { :readonly => true } } %>
+ <% end %>
+
<%= form.label_and_boolean "publish", {}, user_prefs["publish"] %>
<% if user_can?("administer_system") %>
@@ -28,18 +43,109 @@
<%= form.label_and_readonly "vendor_code" %>
<% end %>
<% end %>
+
+ <%= render_plugin_partials("basic_information_#{@agent.agent_type}",
+ :form => form,
+ :record => @agent) %>
+
+
+
+
+ <% unless @agent.agent_type.to_s == "agent_software" %>
+
+ <% end %>
+
+
- <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "dates_of_existence", :section_id => "#{@agent.agent_type}_dates_of_existence", :template_erb => "dates/template", :template => "existence_date", :heading_text => I18n.t("agent._frontend.section.dates_of_existence"), :template_overrides => {"date_label" => "agents/date_labels"}, :help_topic => "#{@agent.agent_type}_dates_of_existence"} %>
- <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "names", :section_id => "#{@agent.agent_type}_names", :template_erb => "agents/name_forms/#{@agent.agent_type}", :template => "name_#{@agent.agent_type.to_s.gsub("agent_","")}", :help_topic => "#{@agent.agent_type}_names"} %>
+
+
+
+ <% unless @agent.agent_type.to_s == "agent_software" %>
+
<% end %>
- <%= render_aspace_partial :partial => "notes/form", :locals => {:form => form, :all_note_types => note_types_for(form['jsonmodel_type']), :section_id => "#{@agent.agent_type}_notes"} %>
- <%= render_aspace_partial :partial => "related_agents/form", :locals => {:form => form} %>
- <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "external_documents", :section_id => "#{@agent.agent_type}_external_documents", :help_topic => "#{@agent.agent_type}_external_documents"} %>
- <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "external_ids", :hidden => true} %>
-<%= form_plugins_for("agent", form) %>
+ <%= form_plugins_for("agent", form) %>
diff --git a/frontend/views/agents/_form_required.html.erb b/frontend/views/agents/_form_required.html.erb
index 49aca28..0c5ed7d 100644
--- a/frontend/views/agents/_form_required.html.erb
+++ b/frontend/views/agents/_form_required.html.erb
@@ -1,7 +1,3 @@
-<%= render_aspace_partial :partial => "shared/form_messages", :locals => {:object => @agent, :form => form} %>
-
-<%= render_aspace_partial :partial => "agents/contact_details", :locals => {:form => form} %>
-
- <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "dates_of_existence", :section_id => "#{@agent.agent_type}_dates_of_existence", :template_erb => "dates/template_required", :template => "existence_date", :heading_text => I18n.t("agent._frontend.section.dates_of_existence"), :help_topic => "#{@agent.agent_type}_dates_of_existence"} %>
- <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "names", :section_id => "#{@agent.agent_type}_names", :template_erb => "agents/name_forms/#{@agent.agent_type}_required", :template => "name_#{@agent.agent_type.to_s.gsub("agent_","")}", :help_topic => "#{@agent.agent_type}_names"} %>
- <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "agent_contacts", :section_id => "#{@agent.agent_type}_contact_details", :template_erb => "agents/contact_details_required", :template => "agent_contact", :help_topic => "#{@agent.agent_type}_contact_details"} %>
- <%= render_aspace_partial :partial => "notes/form_required", :locals => {:form => form, :all_note_types => note_types_for(form['jsonmodel_type']), :section_id => "#{@agent.agent_type}_notes"} %>
- <%= render_aspace_partial :partial => "related_agents/form_required", :locals => {:form => form} %>
- <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "external_documents", :section_id => "#{@agent.agent_type}_external_documents", :template_erb => "external_documents/template_required", :help_topic => "#{@agent.agent_type}_external_documents"} %>
- <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "external_ids", :hidden => true} %>
+ <%= render_aspace_partial :partial => "shared/required_subrecord_form", :locals => {form: form, name: "agent_record_identifiers", help_topic: "agent_record_identifiers", type: :agent_record_identifier, field_names: ["record_identifier", "source", "identifier_type"]} %>
+
+ <%= render_aspace_partial :partial => "shared/required_subrecord_form", :locals => {form: form, name: "agent_record_controls", help_topic: "agent_record_controls", type: :agent_record_control, field_names: ["maintenance_status", "publication_status", "maintenance_agency", "agency_name", "maintenance_agency_note", "language", "script", "language_note", "romanization", "government_agency_type", "reference_evaluation", "name_type", "level_of_detail", "modified_record", "cataloging_source"] } %>
+
+ <%= render_aspace_partial :partial => "shared/required_subrecord_form", :locals => {form: form, name: "agent_other_agency_codes", help_topic: "agent_other_agency_codes", type: :agent_other_agency_codes, field_names: ["maintenance_agency", "agency_code_type"] } %>
+
+ <%= render_aspace_partial :partial => "shared/required_subrecord_form", :locals => {form: form, name: "agent_conventions_declarations", help_topic: "agent_conventions_declarations", type: :agent_conventions_declaration, field_names: ["name_rule", "citation", "descriptive_note", "file_uri", "file_version_xlink_actuate_attribute", "file_version_xlink_show_attribute", "xlink_title_attribute", "xlink_role_attribute", "xlink_arcrole_attribute", "last_verified_date"]} %>
+
+ <%= render_aspace_partial :partial => "shared/required_subrecord_form", :locals => {form: form, name: "metadata_rights_declarations", help_topic: "metadata_rights_declarations", type: :metadata_rights_declaration, field_names: ["license", "descriptive_note", "file_uri", "file_version_xlink_actuate_attribute", "file_version_xlink_show_attribute", "xlink_title_attribute", "xlink_role_attribute", "xlink_arcrole_attribute", "last_verified_date"]} %>
+
+ <%= render_aspace_partial :partial => "shared/required_subrecord_form", :locals => {form: form, name: "agent_maintenance_histories", help_topic: "agent_maintenance_histories", type: :agent_maintenance_history, field_names: ["maintenance_event_type", "event_date", "agent", "maintenance_agent_type", "descriptive_note"] } %>
+
+ <%= render_aspace_partial :partial => "shared/required_subrecord_form", :locals => {form: form, name: "agent_sources", help_topic: "agent_sources", type: "agent_sources", field_names: ["source_entry", "descriptive_note", "file_uri", "file_version_xlink_actuate_attribute", "file_version_xlink_show_attribute", "xlink_title_attribute", "xlink_role_attribute", "xlink_arcrole_attribute", "last_verified_date"]} %>
+
+ <%= render_aspace_partial :partial => "shared/required_subrecord_form", :locals => {form: form, name: "agent_alternate_sets", help_topic: "agent_alternate_sets", type: "agent_alternate_set", field_names: ["set_component", "descriptive_note", "file_uri", "file_version_xlink_actuate_attribute", "file_version_xlink_show_attribute", "xlink_title_attribute", "xlink_role_attribute", "xlink_arcrole_attribute", "last_verified_date"]} %>
+
+ <%= render_aspace_partial :partial => "shared/required_subrecord_form", :locals => {form: form, name: "agent_identifiers", help_topic: "agent_identifiers", type: "agent_identifier", field_names: ["entity_identifier", "identifier_type"]} %>
+
+ <%
+ name_type = @agent.agent_type.to_s.sub('agent', 'name')
+ name_fields = ["authority_id", "source", "rules"]
+ name_fields += case name_type
+ when 'name_person'
+ ["name_order", "prefix", "title", "primary_name", "rest_of_name", "suffix", "fuller_form", "number", "dates", "language", "script", "transliteration", "qualifier"]
+ when 'name_corporate_entity'
+ ["primary_name", "subordinate_name_1", "subordinate_name_2", "number", "dates", "location", "language", "script", "transliteration", "qualifier"]
+ when 'name_family'
+ ["prefix", "family_name", "dates", "family_type", "location", "language", "script", "transliteration", "qualifier"]
+ when 'name_software'
+ ["software_name", "version", "manufacturer", "dates", "language", "script", "transliteration", "qualifier"]
+ else
+ []
+ end
+ %>
+
+ <%= render_aspace_partial :partial => "shared/required_subrecord_form", :locals => {form: form, name: "names", help_topic: "#{@agent.agent_type}_names", type: name_type.intern, field_names: name_fields, section_id: "#{@agent.agent_type}_names" } %>
+
+ <%= render_aspace_partial :partial => "shared/required_subrecord_form", :locals => {form: form, name: "dates_of_existence", :heading_text => I18n.t("agent._frontend.section.dates_of_existence"), :help_topic => "#{@agent.agent_type}_dates_of_existence", type: :structured_date_label, i18n_type: :structured_date_label_common_fields, field_names: ["date_label", "date_type_structured", "date_certainty", "date_era", "date_calendar"], section_id: "#{@agent.agent_type}_dates_of_existence" } %>
+
+ <% if @agent.agent_type.to_s == "agent_person" %>
+ <%= render_aspace_partial :partial => "shared/required_subrecord_form", :locals => {form: form, name: "agent_genders", help_topic: "agent_genders", :property => "agent_genders", type: "agent_gender", field_names: ["gender"]} %>
+ <% end %>
+
+ <%= render_aspace_partial :partial => "shared/required_subrecord_form", :locals => {form: form, name: "agent_places", help_topic: "agent_places", :property => "agent_places", type: "agent_place", field_names: ["place_role"]} %>
+
+ <%= render_aspace_partial :partial => "shared/required_subrecord_form", :locals => {form: form, name: "used_languages", help_topic: "used_languages", type: "used_language", field_names: ["language", "script"] } %>
+
+ <%= render_aspace_partial :partial => "shared/required_subrecord_form", :locals => {form: form, name: "agent_contacts", help_topic: "#{@agent.agent_type}_contact_details", type: :agent_contact, field_names: ["name", "salutation", "address_1", "address_2", "address_3", "city", "region", "country", "post_code", "email", "note"], section_id: "#{@agent.agent_type}_contact_details" } %>
+
+ <%= render_aspace_partial :partial => "shared/required_subrecord_form", :locals => {form: form, name: "external_documents", help_topic: "#{@agent.agent_type}_external_documents", type: :external_document, field_names: ["title", "location"], section_id: "#{@agent.agent_type}_external_documents" } %>
+
+ <%= render_aspace_partial :partial => "shared/required_subrecord_form", :locals => {form: form, name: "agent_resources", help_topic: "agent_resources", type: :agent_resource, field_names: ["linked_agent_role", "linked_resource", "linked_resource_description", "file_uri", "file_version_xlink_actuate_attribute", "file_version_xlink_show_attribute", "xlink_title_attribute", "xlink_role_attribute", "xlink_arcrole_attribute", "last_verified_date"] } %>
-<%= form_plugins_for("agent", form) %>
+ <%= form_plugins_for("agent", form) %>
diff --git a/frontend/views/agents/show.html.erb b/frontend/views/agents/show.html.erb
index c0dd132..c6b784d 100644
--- a/frontend/views/agents/show.html.erb
+++ b/frontend/views/agents/show.html.erb
@@ -16,111 +16,179 @@
+ <% if ![:agent_record_identifiers, :agent_record_controls, :agent_other_agency_codes, :agent_conventions_declarations, :agent_maintenance_histories, :agent_sources, :agent_alternate_sets, :metadata_rights_declarations].map {|k| @agent[k]}.flatten.compact.blank? %>
+
<% end %>
- <%= show_plugins_for(@agent, readonly) %>
+
+
+ <% if ![:dates_of_existence, :agent_genders, :agent_places, :agent_occupations, :agent_functions, :agent_topics, :used_languages, :agent_contacts, :notes, :external_documents].map {|k| @agent[k]}.flatten.compact.blank? %>
+
+ <% end %>
- <%= render_aspace_partial :partial => "search/embedded", :locals => { :extra_columns => [ "event_type"], :record => @agent, :filter_term => {"linked_record_uris" => @agent.uri}.to_json, :heading_text => I18n.t("event._plural")} %>
+ <% if ![:agent_resources, :related_agents].map {|k| @agent[k]}.flatten.compact.blank? %>
+
+ <% end %>
+
+ <%= render_aspace_partial :partial => "search/embedded", :locals => {
+ :filter_term => {"agent_uris" => @agent.uri}.to_json,
+ :section_id => "linked_agents",
+ :heading_text => I18n.t("agent._frontend.section.search_embedded")
+ } %>
+
+ <%= render_aspace_partial :partial => "search/embedded", :locals => {
+ :filter_term => {"rights_statement_agent_uris" => @agent.uri}.to_json,
+ :section_id => "linked_via_rights_statements",
+ :heading_text => I18n.t("agent._frontend.section.linked_via_rights_statement")
+ } %>
+
+ <%= render_aspace_partial :partial => "search/embedded", :locals => {
+ :record => @agent,
+ :filter_term => {"linked_record_uris" => @agent.uri}.to_json,
+ :section_id => "events",
+ :heading_text => I18n.t("event._plural")
+ } %>
+
+ <% if @agent.agent_type == 'agent_person' %>
+ <%= render_aspace_partial :partial => "assessments/embedded", :locals => { :record => @agent, :filter_term => {"assessment_surveyor_uris" => @agent.uri}.to_json, :heading_text => I18n.t("assessment._frontend.linked_records.linked_via_assessment_surveyed_by"), :section_id => 'linked_assessments_surveyed_by'} %>
+
+ <%= render_aspace_partial :partial => "assessments/embedded", :locals => { :record => @agent, :filter_term => {"assessment_reviewer_uris" => @agent.uri}.to_json, :heading_text => I18n.t("assessment._frontend.linked_records.linked_via_assessment_reviewer"), :section_id => 'linked_assessments_reviewer'} %>
+ <% end %>
+
+ <%= show_plugins_for(@agent, readonly) %>
<% end %>