Class: Sufia::Forms::WorkForm
- Inherits:
-
CurationConcerns::Forms::WorkForm
- Object
- CurationConcerns::Forms::WorkForm
- Sufia::Forms::WorkForm
- Includes:
- HydraEditor::Form::Permissions
- Defined in:
- app/forms/sufia/forms/work_form.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#agreement_accepted ⇒ Object
readonly
Returns the value of attribute agreement_accepted.
Class Method Summary collapse
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(model, current_ability) ⇒ WorkForm
constructor
A new instance of WorkForm.
-
#primary_terms ⇒ Object
Fields that are automatically drawn on the page above the fold.
-
#secondary_terms ⇒ Object
Fields that are automatically drawn on the page below the fold.
Constructor Details
#initialize(model, current_ability) ⇒ WorkForm
Returns a new instance of WorkForm.
15 16 17 18 |
# File 'app/forms/sufia/forms/work_form.rb', line 15 def initialize(model, current_ability) @agreement_accepted = !model.new_record? super end |
Instance Attribute Details
#agreement_accepted ⇒ Object (readonly)
Returns the value of attribute agreement_accepted.
10 11 12 |
# File 'app/forms/sufia/forms/work_form.rb', line 10 def agreement_accepted @agreement_accepted end |
Class Method Details
.build_permitted_params ⇒ Object
45 46 47 |
# File 'app/forms/sufia/forms/work_form.rb', line 45 def self.build_permitted_params super + [:on_behalf_of, { collection_ids: [] }] end |
.multiple?(term) ⇒ Boolean
40 41 42 43 |
# File 'app/forms/sufia/forms/work_form.rb', line 40 def self.multiple?(term) return true if [:rights, :collection_ids].include? term super end |
Instance Method Details
#[](key) ⇒ Object
20 21 22 23 |
# File 'app/forms/sufia/forms/work_form.rb', line 20 def [](key) return model.in_collection_ids if key == :collection_ids super end |
#primary_terms ⇒ Object
Fields that are automatically drawn on the page above the fold
26 27 28 |
# File 'app/forms/sufia/forms/work_form.rb', line 26 def primary_terms required_fields end |
#secondary_terms ⇒ Object
Fields that are automatically drawn on the page below the fold
31 32 33 34 35 36 37 38 |
# File 'app/forms/sufia/forms/work_form.rb', line 31 def secondary_terms terms - primary_terms - [:files, :visibility_during_embargo, :embargo_release_date, :visibility_after_embargo, :visibility_during_lease, :lease_expiration_date, :visibility_after_lease, :visibility, :thumbnail_id, :representative_id, :ordered_member_ids, :collection_ids] end |