Skip to content

Commit

Permalink
Starts to align the Collections form with the Works form, but still l…
Browse files Browse the repository at this point in the history
…ooking for the HTML that renders the input groups.
  • Loading branch information
mtribone committed May 23, 2016
1 parent 39c11f8 commit 5d2a9ee
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
4 changes: 4 additions & 0 deletions app/assets/stylesheets/sufia/_collections.scss
Expand Up @@ -82,3 +82,7 @@ form.per_page {
.presenter-title {
padding-left: 20px;
}

.required {
color: $required-color;
}
3 changes: 2 additions & 1 deletion app/assets/stylesheets/sufia/_settings.scss
Expand Up @@ -18,8 +18,9 @@ $icon-background-color-hover: $classic-white !default;
$icon-border-color-hover: $gray-base !default;
$icon-font-color-hover: $gray-base !default;

// Collection Icon
// Collection
$collection-icon-search-lg: 8em !default;
$required-color: $vermilion !default;

// File Show Page
$file-show-term-color: $gray-dark !default;
Expand Down
10 changes: 8 additions & 2 deletions app/forms/sufia/forms/collection_form.rb
@@ -1,8 +1,14 @@
module Sufia::Forms
class CollectionForm < CurationConcerns::Forms::CollectionEditForm
self.required_fields = [:title]

# Fields that are required for Collections
def primary_terms
required_fields
end

def rendered_terms
[:title,
:creator,
[:creator,
:contributor,
:description,
:keyword,
Expand Down
14 changes: 10 additions & 4 deletions app/views/collections/_form.html.erb
@@ -1,10 +1,16 @@
<%= simple_form_for @form, html: { class: 'editor' } do |f| %>
<div id="descriptions_display">
<h2 class="non lower">Descriptions <small class="pull-right"><span class="error">*</span> indicates required fields</small> </h2>
<% f.object.rendered_terms.each do |term| %>
<%= render_edit_field_partial term, f: f %>
<% end %>
<h2>Descriptions</h2>
<p class="required">* indicates required fields</p>
</div>
<div class="base-terms">
<% f.object.primary_terms.each do |term| %>
<%= render_edit_field_partial(term, f: f) %>
<% end %>
<% f.object.rendered_terms.each do |term| %>
<%= render_edit_field_partial term, f: f %>
<% end %>
</div>
<%= hidden_field_tag :type, params[:type] %>
<% if params[:batch_document_ids].present? %>
<% params[:batch_document_ids].each do |batch_item| %>
Expand Down

0 comments on commit 5d2a9ee

Please sign in to comment.