-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creative Commons License in main fields when adding a new work (#1525)
* add 'license' to primary_terms * Test
- Loading branch information
1 parent
a93a8f3
commit 6579a09
Showing
8 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module Hyrax | ||
module FormTerms | ||
include Hyrax::Forms | ||
# overrides Hyrax::Forms::WorkForm | ||
# to display 'license' in the 'base-terms' div on the user dashboard "Add New Work" description | ||
# by getting iterated over in hyrax/app/views/hyrax/base/_form_metadata.html.erb | ||
def primary_terms | ||
super + [:license] | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,6 @@ | |
expect(subject['rendering_ids']).to eq [file_set.id] | ||
end | ||
end | ||
|
||
include_examples("work_form") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,6 @@ | |
expect(subject['extent']).to eq ['extent'] | ||
end | ||
end | ||
|
||
include_examples("work_form") | ||
end |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
RSpec.shared_examples "work_form" do | ||
describe ".primary_terms" do | ||
it 'includes the license field' do | ||
expect(form.primary_terms).to include(:license) | ||
end | ||
end | ||
end |