Skip to content
Snippets Groups Projects
Commit 56ced145 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

refactor

parent 29eedda8
No related branches found
No related tags found
No related merge requests found
......@@ -26,8 +26,8 @@ class Licenses::CreativeCommons
end
def label
@label ||= attribution ? 'CC0 1.0 Universal'
: label_with_attribution
@label ||= attribution ? label_with_attribution
: 'CC0 1.0 Universal'
end
def to_s
......@@ -35,16 +35,8 @@ class Licenses::CreativeCommons
end
def icons
@icons = ['cc']
if !attribution
@icons << 'zero'
else
@icons << 'by'
@icons << 'nc' if !commercial_use
@icons << 'nd' if !derivatives
@icons << 'sa' if derivatives && !sharing
end
@icons
@icons ||= attribution ? icons_with_attribution
: icons_without_attribution
end
protected
......@@ -66,4 +58,16 @@ class Licenses::CreativeCommons
label
end
def icons_with_attribution
icons = ['cc', 'by']
icons << 'nc' if !commercial_use
icons << 'nd' if !derivatives
icons << 'sa' if derivatives && !sharing
icons
end
def icons_without_attribution
['cc', 'zero']
end
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment