Class: Hyrax::Forms::PcdmCollectionForm
- Inherits:
-
Valkyrie::ChangeSet
- Object
- Valkyrie::ChangeSet
- Hyrax::Forms::PcdmCollectionForm
- Defined in:
- app/forms/hyrax/forms/pcdm_collection_form.rb
Overview
Class Method Summary collapse
- .model_class ⇒ Object
-
.required_fields ⇒ Array<Symbol>
List of required field names as symbols.
Instance Method Summary collapse
-
#display_additional_fields? ⇒ Boolean
Whether there are terms to display 'below-the-fold'.
-
#primary_terms ⇒ Array<Symbol>
Terms for display 'above-the-fold', or in the most prominent form real estate.
-
#secondary_terms ⇒ Array<Symbol>
Terms for display 'below-the-fold'.
Class Method Details
.model_class ⇒ Object
25 26 27 |
# File 'app/forms/hyrax/forms/pcdm_collection_form.rb', line 25 def model_class Hyrax::PcdmCollection end |
.required_fields ⇒ Array<Symbol>
Returns list of required field names as symbols.
31 32 33 34 35 |
# File 'app/forms/hyrax/forms/pcdm_collection_form.rb', line 31 def required_fields definitions .select { |_, definition| definition[:required] } .keys.map(&:to_sym) end |
Instance Method Details
#display_additional_fields? ⇒ Boolean
Returns whether there are terms to display 'below-the-fold'.
57 58 59 |
# File 'app/forms/hyrax/forms/pcdm_collection_form.rb', line 57 def display_additional_fields? secondary_terms.any? end |
#primary_terms ⇒ Array<Symbol>
Returns terms for display 'above-the-fold', or in the most prominent form real estate.
41 42 43 44 45 |
# File 'app/forms/hyrax/forms/pcdm_collection_form.rb', line 41 def primary_terms _form_field_definitions .select { |_, definition| definition[:primary] } .keys.map(&:to_sym) end |
#secondary_terms ⇒ Array<Symbol>
Returns terms for display 'below-the-fold'.
49 50 51 52 53 |
# File 'app/forms/hyrax/forms/pcdm_collection_form.rb', line 49 def secondary_terms _form_field_definitions .select { |_, definition| definition[:display] && !definition[:primary] } .keys.map(&:to_sym) end |