Skip to content

Commit

Permalink
Recovering towards shared views for project data.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeckman committed Jan 21, 2015
1 parent 7007dc5 commit f10999c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
3 changes: 2 additions & 1 deletion app/helpers/data_attributes_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions app/helpers/notes_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 9 additions & 6 deletions app/views/shared/data/_show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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) -%>
<ul>
<% values.each do |v| -%>
<%= content_tag :li, object_tag(v) -%>
<% end %>
</ul>
<% end %>
</div>
</div>

Expand Down

0 comments on commit f10999c

Please sign in to comment.