From f10999cdca07c2feef5034b90e2a758041631269 Mon Sep 17 00:00:00 2001 From: mbeckman Date: Wed, 21 Jan 2015 16:50:22 -0600 Subject: [PATCH] Recovering towards shared views for project data. --- app/helpers/data_attributes_helper.rb | 3 ++- app/helpers/notes_helper.rb | 4 ++++ app/views/shared/data/_show.html.erb | 15 +++++++++------ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/app/helpers/data_attributes_helper.rb b/app/helpers/data_attributes_helper.rb index aa99946a86..5b1c267632 100644 --- a/app/helpers/data_attributes_helper.rb +++ b/app/helpers/data_attributes_helper.rb @@ -9,7 +9,8 @@ def add_data_attribute_link(object: object, attribute: nil) def data_attribute_tag(data_attribute) return nil if data_attribute.nil? - "#{data_attribute.cached} (#{data_attribute.type.demodulize.titleize.humanize})" + "#{data_attribute.controlled_vocabulary_term_id} (#{data_attribute.type.demodulize.titleize.humanize})" end + end diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb index 19e1379310..9696811358 100644 --- a/app/helpers/notes_helper.rb +++ b/app/helpers/notes_helper.rb @@ -41,4 +41,8 @@ def destroy_note_link(note) destroy_object_link(note) end + def note_tag(note) + return nil if note.nil? + note.text + end end diff --git a/app/views/shared/data/_show.html.erb b/app/views/shared/data/_show.html.erb index 20243e5b0c..0f741faa99 100644 --- a/app/views/shared/data/_show.html.erb +++ b/app/views/shared/data/_show.html.erb @@ -19,12 +19,15 @@ <%= render object_attributes_partial_path(object.metamorphosize) %> <%= render partial: '/shared/data/show/housekeeping', locals: {object: object} -%> <%= render(partial: '/shared/data/show/soft_validation', locals: {object: object}) if object.class.respond_to?(:soft_validates?) -%> - <%= render(partial: '/alternate_values/object_pane', locals: {object: object}) if object.has_alternate_values? %> - <%= render(partial: '/citations/object_pane', locals: {object: object}) if object.has_citations? %> - <%= render(partial: '/data_attributes/object_pane', locals: {object: object}) %> - <%= render(partial: '/identifiers/object_pane', locals: {object: object}) if object.has_identifiers? %> - <%= render(partial: '/notes/object_pane', locals: {object: object}) if object.has_notes? %> - <%= render(partial: '/tags/object_pane', locals: {object: object}) if object.has_tags? %> + + <% object.annotations_hash.each do |title, values| -%> + <%= content_tag(:h3, title.humanize) -%> + + <% end %>