Skip to content

Commit

Permalink
Reinstate shared user defined show and add data attributes link when …
Browse files Browse the repository at this point in the history
…applicable
  • Loading branch information
mbeckman committed Jan 22, 2015
1 parent fdb9111 commit a051827
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 27 deletions.
33 changes: 11 additions & 22 deletions app/views/data_attributes/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,19 @@
</div>
<% end %>

<p><strong><%= @data_attribute.attribute_subject.class.name %>
:</strong> <%= object_tag(@data_attribute.attribute_subject) -%> </p>

<%= f.hidden_field :type, value: 'InternalAttribute' %>
<div class="field">
<%= f.label :type %>
<br>
<%= f.text_field :type %>
</div>
<div class="field">
<%= f.label :attribute_subject_id %>
<br>
<%= f.number_field :attribute_subject_id %>
</div>
<div class="field">
<%= f.label :attribute_subject_type %>
<br>
<%= f.text_field :attribute_subject_type %>
</div>
<div class="field">
<%= f.label :controlled_vocabulary_term_id %>
<br>
<%= f.number_field :controlled_vocabulary_term_id %>
</div>
<div class="field">
<%= f.label :import_predicate %>
<%= f.label 'Import predicate' %>
<br>
<%= f.text_field :import_predicate %>
<%= render :partial => 'workbench/elements/forms/ajax_select',
:locals => {:controller => 'controlled_vocabulary_terms',
:object => 'data_attribute',
:method => 'controlled_vocabulary_term_id',
:tag_id => 'controlled_vocabulary_term_id_for_data_attribute',
:display => object_tag(@data_attribute.controlled_vocabulary_term_id)} %>
</div>
<div class="field">
<%= f.label :value %>
Expand Down
3 changes: 3 additions & 0 deletions app/views/data_attributes/new.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<h3> New data attribute for: </h3>
<%= render partial: 'form' -%>

13 changes: 8 additions & 5 deletions app/views/shared/shared_data/user_defined/_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: '/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 a051827

Please sign in to comment.