Skip to content

Commit

Permalink
Split up the representative from the thumbnail partial for easier ove…
Browse files Browse the repository at this point in the history
…rride of one or the other
  • Loading branch information
jcoyne committed Oct 28, 2015
1 parent f7da04f commit 79b0b54
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 27 deletions.
2 changes: 1 addition & 1 deletion app/views/collections/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<%= render 'form_descriptive_fields', curation_concern: @collection, f: f %>
<%= render 'form_permission', f: f %>
<%= render "curation_concerns/base/form_representative_image", f: f %>
<%= render "curation_concerns/base/form_media", f: f %>

<div class="row">
<div class="col-md-12 form-actions">
Expand Down
4 changes: 4 additions & 0 deletions app/views/curation_concerns/base/_form_media.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<% if f.object.persisted? && f.object.member_ids.present? %>
<%= render 'form_representative', f: f %>
<%= render 'form_thumbnail', f: f %>
<% end %>
12 changes: 12 additions & 0 deletions app/views/curation_concerns/base/_form_representative.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div class="row">
<div class="col-md-12">
<fieldset id="representative-media">
<legend>
Representative Media
</legend>
<p>Select the file with media that represents this <%= f.object.human_readable_type %>.</p>
<%= f.select :representative_id, @form.select_files, {}, { class: 'form-control' } %>
</fieldset>
</div>
</div>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= render "form_files_and_links", f: f %>
<%= render "form_representative_image", f: f %>
<%= render "form_media", f: f %>

<div class="row with-headroom">
<div class="col-md-12">
Expand Down
12 changes: 12 additions & 0 deletions app/views/curation_concerns/base/_form_thumbnail.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div class="row">
<div class="col-md-12">
<fieldset id="representative-image">
<legend>
Thumbnail
</legend>
<p>Select the file to be used as the thumbnail for this <%= f.object.human_readable_type %>.</p>
<%= f.select :thumbnail_id, @form.select_files, {}, { class: 'form-control' } %>
</fieldset>
</div>
</div>

0 comments on commit 79b0b54

Please sign in to comment.