From 4bb5cf2b6e524b504777d9ca82b0f4e198cf6f23 Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 29 Jan 2023 13:49:51 -0500 Subject: [PATCH 1/5] merge views for new agents module --- frontend/views/agents/_form.html.erb | 132 +++++++++-- frontend/views/agents/_form_required.html.erb | 69 ++++-- frontend/views/agents/show.html.erb | 216 ++++++++++++------ 3 files changed, 315 insertions(+), 102 deletions(-) diff --git a/frontend/views/agents/_form.html.erb b/frontend/views/agents/_form.html.erb index 0e6ccb5..df7d64a 100644 --- a/frontend/views/agents/_form.html.erb +++ b/frontend/views/agents/_form.html.erb @@ -1,13 +1,24 @@ <%= render_aspace_partial :partial => "shared/form_messages", :locals => {:object => @agent, :form => form} %> - <%= render_aspace_partial :partial => "agents/contact_details", :locals => {:form => form} %> +<% if !full_mode? && has_agent_subrecords?(@agent) %> +
This agent has data that is only editable in Full mode. To enable it, ask your administrator to enable Full Mode on this instance and grant you Full Mode permission.
+<% end %> +
-
-

- <%= I18n.t("agent._frontend.section.basic_information") %> +
+

+ <% tooltip = I18n.t("section_headings.basic_information_tooltip") %> + + <%= I18n.t("agent._frontend.section.basic_information") %> + <%= link_to_help :topic => "#{@agent.agent_type}_basic_information" %>

+ + <%= render_plugin_partials("top_of_basic_information_#{@agent.agent_type}", + :form => form, + :record => @agent) %> +
@@ -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" %> +
+

+ <% tooltip = I18n.t("section_headings.record_control_information_tooltip") %> + + <%= I18n.t("agent._frontend.section.record_control_information") %> + +

+ + <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "agent_record_identifiers", :section_id => "#{@agent.agent_type}_agent_record_identifier", :template => "agent_record_identifiers", help_topic: "agent_record_identifiers", :invisible => false, :lightmode_toggle => false, :section_class => "agent_agent_record_identifiers"} %> + + <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "agent_record_controls", :section_id => "#{@agent.agent_type}_agent_record_control", :template => "agent_record_control", help_topic: "agent_record_controls", :cardinality => :zero_to_one, :list_limited_to_one => true, :invisible => !full_mode?, :lightmode_toggle => true, :section_class => "agent_agent_record_control"} %> + + <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "agent_other_agency_codes", :section_id => "#{@agent.agent_type}_agent_other_agency_codes", :template => "agent_other_agency_codes", help_topic: "agent_other_agency_codes", :invisible => !full_mode?, :lightmode_toggle => true, :section_class => 'agent_agent_other_agency_codes'} %> + + <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "agent_conventions_declarations", :section_id => "#{@agent.agent_type}_agent_conventions_declaration", :template => "agent_conventions_declaration", help_topic: "agent_conventions_declarations", :invisible => !full_mode?, :lightmode_toggle => true, :section_class => "agent_agent_conventions_declarations"} %> + + <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "metadata_rights_declarations", :section_id => "#{@agent.agent_type}_metadata_rights_declaration", help_topic: "metadata_rights_declaration", :invisible => !full_mode?, :lightmode_toggle => true, :section_class => "agent_metadata_rights_declarations"} %> + + <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "agent_maintenance_histories", :section_id => "#{@agent.agent_type}_agent_maintenance_history", :template => "agent_maintenance_histories", help_topic: "agent_maintenance_histories", :invisible => !full_mode?, :lightmode_toggle => true, :section_class => "agent_agent_maintenance_histories"} %> + + <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "agent_sources", :section_id => "#{@agent.agent_type}_agent_sources", :template => "agent_sources", help_topic: "agent_sources", :invisible => !full_mode?, :lightmode_toggle => true, :section_class => "agent_agent_sources" } %> + + <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "agent_alternate_sets", :section_id => "#{@agent.agent_type}_agent_alternate_set", :template => "agent_alternate_set", help_topic: "agent_alternate_sets", :invisible => !full_mode?, :lightmode_toggle => true, :section_class => "agent_agent_alternate_sets"} %> +
+ <% end %> + +
+

+ <% tooltip = I18n.t("section_headings.identity_information_tooltip") %> + + <%= I18n.t("agent._frontend.section.identity_information") %> + +

+ + <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "agent_identifiers", :section_id => "#{@agent.agent_type}_agent_identifier", :template => "agent_identifiers", help_topic: "agent_identifiers", :invisible => false, :lightmode_toggle => false, :section_class => "agent_agent_identifiers"} %> + + <%= 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", :invisible => false, :lightmode_toggle => false, :section_class => "agent_names"} %>
- <%= 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"} %> +
+

+ <% tooltip = I18n.t("section_headings.description_information_tooltip") %> + + <%= I18n.t("agent._frontend.section.description_information") %> + +

+ + + <%= 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 => "structured_date_label_existence", :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", :invisible => false, :lightmode_toggle => false, :section_class => "agent_dates_of_existence"} %> + + + <% if @agent.agent_type.to_s == "agent_person" %> + <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "agent_genders", :section_id => "#{@agent.agent_type}_agent_gender", :template => "agent_gender", help_topic: "agent_genders", :invisible => !full_mode?, :lightmode_toggle => true, :section_class => "agent_agent_genders"} %> + <% end %> + + <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "agent_places", :section_id => "#{@agent.agent_type}_agent_place", :template => "agent_place", help_topic: "agent_place", :invisible => !full_mode?, :lightmode_toggle => true, :section_class => "agent_agent_places"} %> + + <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "agent_occupations", :section_id => "#{@agent.agent_type}_agent_occupation", :template => "agent_occupation", help_topic: "agent_occupation", :invisible => !full_mode?, :lightmode_toggle => true, :section_class => "agent_agent_occupation"} %> + + <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "agent_functions", :section_id => "#{@agent.agent_type}_agent_function", :template => "agent_function", help_topic: "agent_function", :invisible => !full_mode?, :lightmode_toggle => true, :section_class => "agent_agent_function"} %> + + <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "agent_topics", :section_id => "#{@agent.agent_type}_agent_topic", :template => "agent_topic", help_topic: "agent_topic", :invisible => !full_mode?, :lightmode_toggle => true, :section_class => "agent_agent_topics"} %> + + <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "used_languages", :section_id => "#{@agent.agent_type}_used_language", :template => "used_language", :invisible => !full_mode?, :lightmode_toggle => true, :help_topic => "agent_used_language", :section_class => "agent_agent_used_languages"} %> + <% if user_can?('view_agent_contact_record') %> - <%= 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", :template => "agent_contact", :help_topic => "#{@agent.agent_type}_contact_details"} %> + <%= 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", :template => "agent_contact", :help_topic => "#{@agent.agent_type}_contact_details", :invisible => false, :lightmode_toggle => false, :section_class => "agent_agent_contacts"} %> + <% else %> + <%= form.hidden_input "restricted_properties[]", 'agent_contacts' %> + <% 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", :show_apply_note_order_action => false} %> + + <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "external_documents", :section_id => "#{@agent.agent_type}_external_documents", :help_topic => "agent_external_documents", :invisible => false, :lightmode_toggle => false, :section_class => "agent_external_documents"} %> +
+ + + <% unless @agent.agent_type.to_s == "agent_software" %> +
+

+ <% tooltip = I18n.t("section_headings.relation_information_tooltip") %> + + <%= I18n.t("agent._frontend.section.relation_information") %> + +

+ + <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "agent_resources", :section_id => "#{@agent.agent_type}_agent_resource", :template => "agent_resource", help_topic: "agent_external_resources", :invisible => !full_mode?, :lightmode_toggle => true, :section_class => "agent_agent_resources"} %> + + <%= render_aspace_partial :partial => "related_agents/form", :locals => {:form => form} %> + + <%= render_aspace_partial :partial => "shared/subrecord_form", :locals => {:form => form, :name => "external_ids", :hidden => true} %> +
<% 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) %> -

+ \ No newline at end of file diff --git a/frontend/views/agents/_form_required.html.erb b/frontend/views/agents/_form_required.html.erb index 49aca28..1a064d7 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} %> -

@@ -11,11 +7,9 @@
- <%= form.hidden_input "agent_type", @agent.agent_type %> <%= I18n.t("agent.agent_type.#{@agent.agent_type}") %>
- <% if user_can?("administer_system") %> <%= form.label_and_textfield "vendor_code" %> <% else %> @@ -26,14 +20,59 @@ <% 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_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) %> -
+ \ No newline at end of file diff --git a/frontend/views/agents/show.html.erb b/frontend/views/agents/show.html.erb index c0dd132..bb186c4 100644 --- a/frontend/views/agents/show.html.erb +++ b/frontend/views/agents/show.html.erb @@ -16,112 +16,180 @@

<%= I18n.t("agent._frontend.section.basic_information") %>

+ <%= render_plugin_partials("top_of_basic_information_#{@agent.agent_type}", + :form => readonly, + :record => @agent) %> +
<%= I18n.t("agent.agent_type.#{@agent.agent_type}") %>
<%= render_aspace_partial :partial => "shared/public_url", :locals => {:form_object => readonly} if AppConfig[:use_human_readable_urls] %> + + <% if @agent.has_key?("is_user") %> + <%= readonly.label_and_textfield "is_user", { :field_opts => { :readonly => true } } %> + <% end %> <%= readonly.label_and_boolean "publish" %> <%= readonly.label_and_textfield "vendor_code" %> + <%= render_plugin_partials("basic_information_#{@agent.agent_type}", + :form => readonly, + :record => @agent) %> + <%= display_audit_info(@agent) %>
+ <% 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? %> +
+

+ <%= I18n.t("agent._frontend.section.record_control_information") %> +

- <% if @agent.dates_of_existence.length > 0 %> - <%= render_aspace_partial :partial => "dates/show", :locals => { :dates => @agent.dates_of_existence, :section_title => I18n.t("agent.dates_of_existence"), :section_id => "dates_of_existence", :context => readonly } %> - <% end %> + <% if @agent.agent_record_identifiers.length > 0 %> + <%= render_aspace_partial :partial => "agent_record_identifiers/show", :locals => { :agent_record_identifiers => @agent.agent_record_identifiers, :section_id => "#{@agent.agent_type}_agent_record_identifier" } %> + <% end %> -
-

<%= I18n.t("agent_name._plural") %>

-
- <% @agent.names.each_with_index do | name, index | %> -
-
- -
-
- <%= read_only_view(name.to_hash) %> - <% if name['use_dates'].length > 0 %> - <%= render_aspace_partial :partial => "dates/show", :locals => { :dates => name['use_dates'], :section_id => "name_use_dates", :section_title => I18n.t("agent_name.use_dates"), :context => readonly } %> - <% end %> -
-
+ <% if @agent.agent_record_controls.length > 0 %> + <%= render_aspace_partial :partial => "agent_record_controls/show", :locals => { :agent_record_controls => @agent.agent_record_controls, :section_id => "#{@agent.agent_type}_agent_record_control" } %> <% end %> -
-
+ <% if @agent.agent_other_agency_codes.length > 0 %> + <%= render_aspace_partial :partial => "agent_other_agency_codes/show", :locals => { :agent_other_agency_codes => @agent.agent_other_agency_codes, :section_id => "#{@agent.agent_type}_agent_other_agency_codes" } %> + <% end %> - <% if @agent.agent_contacts.length > 0 && user_can?('view_agent_contact_record') %> - <%= render_aspace_partial :partial => "agents/contact_details" %> - -
-

<%= I18n.t("agent_contact._plural") %>

-
- <% @agent.agent_contacts.each_with_index do | contact, index | %> -
-
- -
-
- <%= readonly_context :agent_contact, contact do |readonly_contact| %> - <%= readonly_contact.emit_template("agent_contact") %> - <% end %> -
-
- <% end %> -
-
+ <% if @agent.agent_conventions_declarations.length > 0 %> + <%= render_aspace_partial :partial => "agent_conventions_declarations/show", :locals => { :agent_conventions_declarations => @agent.agent_conventions_declarations, :section_id => "#{@agent.agent_type}_agent_conventions_declaration" } %> + <% end %> - <% end %> + <% if @agent.metadata_rights_declarations.length > 0 %> + <%= render_aspace_partial :partial => "metadata_rights_declarations/show", :locals => { :metadata_rights_declarations => @agent.metadata_rights_declarations, :section_id => "#{@agent.agent_type}_metadata_rights_declaration" } %> + <% end %> - <% if @agent.notes.length > 0 %> - <%= render_aspace_partial :partial => "notes/show", :locals => { :notes => @agent.notes, :context => readonly, :section_id => "#{@agent.agent_type}_notes" } %> - <% end %> + <% if @agent.agent_maintenance_histories.length > 0 %> + <%= render_aspace_partial :partial => "agent_maintenance_histories/show", :locals => { :agent_maintenance_histories => @agent.agent_maintenance_histories, :section_id => "#{@agent.agent_type}_agent_maintenance_history" } %> + <% end %> - <% if !@agent['related_agents'].blank? %> - <%= render_aspace_partial :partial => "related_agents/show", :locals => { :related_agents => @agent.related_agents, :context => readonly } %> - <% end %> + <% if @agent.agent_sources.length > 0 %> + <%= render_aspace_partial :partial => "agent_sources/show", :locals => { :agent_sources => @agent.agent_sources, :section_id => "#{@agent.agent_type}_agent_sources" } %> + <% end %> + + <% if @agent.agent_alternate_sets.length > 0 %> + <%= render_aspace_partial :partial => "agent_alternate_sets/show", :locals => { :agent_alternate_sets => @agent.agent_alternate_sets, :section_id => "#{@agent.agent_type}_agent_alternate_set" } %> + <% end %> - <% if @agent.external_documents.length > 0 %> - <%= render_aspace_partial :partial => "external_documents/show", :locals => { :external_documents => @agent.external_documents, :section_id => "#{@agent.agent_type}_external_documents" } %> +
<% end %> - <%= show_plugins_for(@agent, readonly) %> +
+

+ <%= I18n.t("agent._frontend.section.identity_information") %> +

+ + <% if @agent.agent_identifiers.length > 0 %> + <%= render_aspace_partial :partial => "agent_identifiers/show", :locals => { :agent_identifiers => @agent.agent_identifiers, :section_id => "#{@agent.agent_type}_agent_identifier" } %> + <% end %> + + <%= render_aspace_partial :partial => "agent_names/show", :locals => { :agent => @agent} %> + +
+ + <% 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? %> +
+

+ <%= I18n.t("agent._frontend.section.description_information") %> +

+ + <% if @agent.dates_of_existence.length > 0 %> + <%= render_aspace_partial :partial => "structured_dates/show", :locals => { :dates => @agent.dates_of_existence, :section_title => I18n.t("agent.dates_of_existence"), :section_id => "#{@agent.agent_type}_dates_of_existence"} %> + <% end %> + + <% if @agent_type == :agent_person && @agent.agent_genders.length > 0 %> + <%= render_aspace_partial :partial => "agent_genders/show", :locals => { :agent_genders => @agent.agent_genders, :section_id => "#{@agent.agent_type}_agent_gender", :context => readonly } %> + <% end %> + + <% if @agent.agent_places.length > 0 %> + <%= render_aspace_partial :partial => "agent_places/show", :locals => { :agent_places => @agent.agent_places, :section_id => "#{@agent.agent_type}_agent_place", :context => readonly } %> + <% end %> + + <% if @agent.agent_occupations.length > 0 %> + <%= render_aspace_partial :partial => "agent_occupations/show", :locals => { :agent_occupations => @agent.agent_occupations, :section_id => "#{@agent.agent_type}_agent_occupation", :context => readonly } %> + <% end %> + + <% if @agent.agent_functions.length > 0 %> + <%= render_aspace_partial :partial => "agent_functions/show", :locals => { :agent_functions => @agent.agent_functions, :section_id => "#{@agent.agent_type}_agent_function", :context => readonly } %> + <% end %> + + <% if @agent.agent_topics.length > 0 %> + <%= render_aspace_partial :partial => "agent_topics/show", :locals => { :agent_topics => @agent.agent_topics, :section_id => "#{@agent.agent_type}_agent_topic", :context => readonly } %> + <% end %> + + <% if @agent.used_languages.length > 0 %> + <%= render_aspace_partial :partial => "used_languages/show", :locals => { :used_languages => @agent.used_languages, :section_id => "#{@agent.agent_type}_used_language", :context => readonly } %> + <% end %> + + <% if @agent.agent_contacts.length > 0 && user_can?('view_agent_contact_record') %> + <%= render_aspace_partial :partial => "agent_contact_details/show", :locals => { :agent_contacts => @agent.agent_contacts, :section_id => "#{@agent.agent_type}_contact_details", :context => readonly } %> + <% end %> + <% if @agent.notes.length > 0 %> + <%= render_aspace_partial :partial => "notes/show", :locals => { :notes => @agent.notes, :context => readonly, :section_id => "#{@agent.agent_type}_notes" } %> + <% end %> - <%= render_aspace_partial :partial => "search/embedded", :locals => {:filter_term => {"agents" => @agent.title}.to_json, :heading_text => I18n.t("agent._frontend.section.search_embedded")} %> + <% if @agent.external_documents.length > 0 %> + <%= render_aspace_partial :partial => "external_documents/show", :locals => { :external_documents => @agent.external_documents, :section_id => "#{@agent.agent_type}_external_documents" } %> + <% end %> - <%= render_aspace_partial :partial => "search/embedded", :locals => {:filter_term => {"rights_statement_agent_uris" => @agent.uri}.to_json, :heading_text => I18n.t("agent._frontend.section.linked_via_rights_statement")} %> +
+ <% 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? %> +
+

+ <%= I18n.t("agent._frontend.section.relation_information") %> +

+ + <% if @agent.agent_resources.length > 0 %> + <%= render_aspace_partial :partial => "agent_resources/show", :locals => { :agent_resources => @agent.agent_resources, :section_id => "#{@agent.agent_type}_agent_resource", :context => readonly } %> + <% end %> - <%= 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'} %> + <% if !@agent['related_agents'].blank? %> + <%= render_aspace_partial :partial => "related_agents/show", :locals => { :related_agents => @agent.related_agents, :context => readonly, :section_id => "related_agents" } %> + <% end %> +
+ <% 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 %> - + \ No newline at end of file From f086d450972fe5ec192df5b4e67336567104363a Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 29 Jan 2023 13:52:13 -0500 Subject: [PATCH 2/5] add end of file newlines --- frontend/views/agents/_form.html.erb | 2 +- frontend/views/agents/_form_required.html.erb | 2 +- frontend/views/agents/show.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/views/agents/_form.html.erb b/frontend/views/agents/_form.html.erb index df7d64a..157bc2e 100644 --- a/frontend/views/agents/_form.html.erb +++ b/frontend/views/agents/_form.html.erb @@ -148,4 +148,4 @@ <%= form_plugins_for("agent", form) %> - \ No newline at end of file + diff --git a/frontend/views/agents/_form_required.html.erb b/frontend/views/agents/_form_required.html.erb index 1a064d7..0c5ed7d 100644 --- a/frontend/views/agents/_form_required.html.erb +++ b/frontend/views/agents/_form_required.html.erb @@ -75,4 +75,4 @@ <%= form_plugins_for("agent", form) %> - \ No newline at end of file + diff --git a/frontend/views/agents/show.html.erb b/frontend/views/agents/show.html.erb index bb186c4..c6b784d 100644 --- a/frontend/views/agents/show.html.erb +++ b/frontend/views/agents/show.html.erb @@ -192,4 +192,4 @@ <% end %> - \ No newline at end of file + From 6cf14df2e3efa40e2e26107ba58f7c6726cca73b Mon Sep 17 00:00:00 2001 From: Trip Kirkpatrick Date: Tue, 23 May 2023 13:45:17 -0400 Subject: [PATCH 3/5] =?UTF-8?q?Added=20new=20cost=20center=20per=20Eric=20?= =?UTF-8?q?Friede=20=E2=9E=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/locales/en.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/locales/en.yml b/frontend/locales/en.yml index 647e4dc..995df28 100644 --- a/frontend/locales/en.yml +++ b/frontend/locales/en.yml @@ -251,6 +251,7 @@ en: CC0683: YCAL-DRPR - CC0683 CC0684: GENE - CC0684 CC0685: GENEM-OSB - CC0685 + CC1897: GENAM - CC1897 CC0686: GENAM-WA - CC0686 CC0687: GENM-ENG - CC0687 CC0688: GENM-EUR - CC0688 From 2b1438e842474d67066312a84805fa60728d2064 Mon Sep 17 00:00:00 2001 From: Trip Kirkpatrick Date: Thu, 16 Jun 2022 09:04:41 -0400 Subject: [PATCH 4/5] =?UTF-8?q?Updated=20spend=20categories=20per=20Mike?= =?UTF-8?q?=20Rush=20=F0=9F=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/locales/en.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/locales/en.yml b/frontend/locales/en.yml index 995df28..445f945 100644 --- a/frontend/locales/en.yml +++ b/frontend/locales/en.yml @@ -256,10 +256,10 @@ en: CC0687: GENM-ENG - CC0687 CC0688: GENM-EUR - CC0688 payments_module_spend_category: - SC121: Rare Archives - SC121 - SC120: Rare Graphic Mat - SC120 - SC122: Rare Manuscripts - SC122 - SC670: Rare Maps - SC670 - SC118: Rare Monographs - SC118 - SC669: Rare Serials - SC669 - SC119: Rare Unlisted - SC119 + "351": "Rare Monographs - 351" + "352": "Rare Serials - 352" + "353": "Rare Graphic Mat - 353" + "356": "Rare Archives - 356" + "358": "Rare Maps - 358" + "359": "Rare Manuscripts - 359" + "369": "Rare Unlisted - 369" From 4f58535b7ea4dd907be73860c517246d8117d046 Mon Sep 17 00:00:00 2001 From: Trip Kirkpatrick Date: Fri, 16 Jun 2023 09:24:51 -0400 Subject: [PATCH 5/5] =?UTF-8?q?Corrected=20translation=20added=20in=206cf1?= =?UTF-8?q?4df=20=F0=9F=A4=A6=F0=9F=8F=BB=E2=80=8D=E2=99=82=EF=B8=8F?= =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/locales/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/locales/en.yml b/frontend/locales/en.yml index 445f945..519e5cc 100644 --- a/frontend/locales/en.yml +++ b/frontend/locales/en.yml @@ -251,7 +251,7 @@ en: CC0683: YCAL-DRPR - CC0683 CC0684: GENE - CC0684 CC0685: GENEM-OSB - CC0685 - CC1897: GENAM - CC1897 + CC1897.9: GENAM - CC1897 CC0686: GENAM-WA - CC0686 CC0687: GENM-ENG - CC0687 CC0688: GENM-EUR - CC0688