Skip to content

Commit

Permalink
set old licenses to inactive and add refs to new licenses (#1517)
Browse files Browse the repository at this point in the history
* set old licenses to inactive and add refs to new licenses

* getting rid of duplicate entries; making titles easier to read

* making text more consistent

* correcting spelling

* fixing cc0 term to make existing tests happy

* Expand public domain CC terms

* Rubocopped
  • Loading branch information
Chris Syversen authored and mjgiarlo committed Sep 5, 2017
1 parent 67173f9 commit 9928dcb
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 16 deletions.
38 changes: 28 additions & 10 deletions lib/generators/hyrax/templates/config/authorities/licenses.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,46 @@
terms:
- id: http://creativecommons.org/licenses/by/3.0/us/
term: Attribution 3.0 United States
active: true
active: false
- id: http://creativecommons.org/licenses/by-sa/3.0/us/
term: Attribution-ShareAlike 3.0 United States
active: true
active: false
- id: http://creativecommons.org/licenses/by-nc/3.0/us/
term: Attribution-NonCommercial 3.0 United States
active: true
active: false
- id: http://creativecommons.org/licenses/by-nd/3.0/us/
term: Attribution-NoDerivs 3.0 United States
active: true
active: false
- id: http://creativecommons.org/licenses/by-nc-nd/3.0/us/
term: Attribution-NonCommercial-NoDerivs 3.0 United States
active: true
active: false
- id: http://creativecommons.org/licenses/by-nc-sa/3.0/us/
term: Attribution-NonCommercial-ShareAlike 3.0 United States
active: false
- id: http://www.europeana.eu/portal/rights/rr-r.html
term: All rights reserved
active: false
- id: https://creativecommons.org/licenses/by/4.0/
term: Creative Commons BY Attribution 4.0 International
active: true
- id: http://creativecommons.org/publicdomain/mark/1.0/
term: Public Domain Mark 1.0
- id: https://creativecommons.org/licenses/by-sa/4.0/
term: Creative Commons BY-SA Attribution-ShareAlike 4.0 International
active: true
- id: https://creativecommons.org/licenses/by-nd/4.0/
term: Creative Commons BY-ND Attribution-NoDerivatives 4.0 International
active: true
- id: https://creativecommons.org/licenses/by-nc/4.0/
term: Creative Commons BY-NC Attribution-NonCommercial 4.0 International
active: true
- id: https://creativecommons.org/licenses/by-nc-nd/4.0/
term: Creative Commons BY-NC-ND Attribution-NonCommercial-NoDerivs 4.0 International
active: true
- id: https://creativecommons.org/licenses/by-nc-sa/4.0/
term: Creative Commons BY-NC-SA Attribution-NonCommercial-ShareAlike 4.0 International
active: true
- id: http://creativecommons.org/publicdomain/zero/1.0/
term: CC0 1.0 Universal
term: Creative Commons CC0 1.0 Universal
active: true
- id: http://www.europeana.eu/portal/rights/rr-r.html
term: All rights reserved
- id: http://creativecommons.org/publicdomain/mark/1.0/
term: Creative Commons Public Domain Mark 1.0
active: true
6 changes: 4 additions & 2 deletions spec/helpers/blacklight_helper_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# coding: utf-8

RSpec.describe BlacklightHelper, type: :helper do
let(:blacklight_config) { CatalogController.blacklight_config }
let(:attributes) do
Expand Down Expand Up @@ -49,8 +51,8 @@ def search_action_path(stuff)
let(:field_name) { 'rights_tesim' }

it do
is_expected.to eq "<a href=\"http://creativecommons.org/publicdomain/zero/1.0/\">CC0 1.0 Universal</a>, " \
"<a href=\"http://creativecommons.org/publicdomain/mark/1.0/\">Public Domain Mark 1.0</a>, " \
is_expected.to eq "<a href=\"http://creativecommons.org/publicdomain/zero/1.0/\">Creative Commons CC0 1.0 Universal</a>, " \
"<a href=\"http://creativecommons.org/publicdomain/mark/1.0/\">Creative Commons Public Domain Mark 1.0</a>, " \
"and <a href=\"http://www.europeana.eu/portal/rights/rr-r.html\">All rights reserved</a>"
end
end
Expand Down
8 changes: 4 additions & 4 deletions spec/helpers/hyrax_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -321,16 +321,16 @@ def new_state
it "maps the url to a link with a label" do
expect(helper.license_links(
value: ["http://creativecommons.org/publicdomain/zero/1.0/"]
)).to eq("<a href=\"http://creativecommons.org/publicdomain/zero/1.0/\">CC0 1.0 Universal</a>")
)).to eq("<a href=\"http://creativecommons.org/publicdomain/zero/1.0/\">Creative Commons CC0 1.0 Universal</a>")
end

it "converts multiple rights statements to a sentence" do
it "converts multiple licenses to a sentence" do
expect(helper.license_links(
value: ["http://creativecommons.org/publicdomain/zero/1.0/",
"http://creativecommons.org/publicdomain/mark/1.0/",
"http://www.europeana.eu/portal/rights/rr-r.html"]
)).to eq("<a href=\"http://creativecommons.org/publicdomain/zero/1.0/\">CC0 1.0 Universal</a>, " \
"<a href=\"http://creativecommons.org/publicdomain/mark/1.0/\">Public Domain Mark 1.0</a>, " \
)).to eq("<a href=\"http://creativecommons.org/publicdomain/zero/1.0/\">Creative Commons CC0 1.0 Universal</a>, " \
"<a href=\"http://creativecommons.org/publicdomain/mark/1.0/\">Creative Commons Public Domain Mark 1.0</a>, " \
"and <a href=\"http://www.europeana.eu/portal/rights/rr-r.html\">All rights reserved</a>")
end
end
Expand Down

0 comments on commit 9928dcb

Please sign in to comment.