forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent_licenses.rb
83 lines (79 loc) · 2.49 KB
/
content_licenses.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#
# Copyright (C) 2014 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
module ContentLicenses
def self.included(base)
base.extend ContentLicenses::ClassMethods
end
LICENSES = ActiveSupport::OrderedHash[
'private',
{
:readable_license =>
-> { I18n.t('#cc.private', 'Private (Copyrighted)') },
:license_url => "http://en.wikipedia.org/wiki/Copyright"
},
'public_domain',
{
:readable_license =>
-> { I18n.t('#cc.public_domain', 'Public Domain') },
:license_url => "http://en.wikipedia.org/wiki/Public_domain"
},
'cc_by',
{
:readable_license =>
-> { I18n.t('#cc.by', 'CC Attribution') },
:license_url => "http://creativecommons.org/licenses/by/4.0"
},
'cc_by_sa',
{
:readable_license =>
-> { I18n.t('#cc.by_sa', 'CC Attribution Share Alike') },
:license_url => "http://creativecommons.org/licenses/by-sa/4.0"
},
'cc_by_nc',
{
:readable_license =>
-> { I18n.t('#cc.by_nc', 'CC Attribution Non-Commercial') },
:license_url => "http://creativecommons.org/licenses/by-nc/4.0"
},
'cc_by_nc_sa',
{
:readable_license =>
-> { I18n.t('#cc.by_nc_sa', 'CC Attribution Non-Commercial Share Alike')},
:license_url => "http://creativecommons.org/licenses/by-nc-sa/4.0"
},
'cc_by_nd',
{
:readable_license =>
-> { I18n.t('#cc.by_nd', 'CC Attribution No Derivatives') },
:license_url => "http://creativecommons.org/licenses/by-nd/4.0"
},
'cc_by_nc_nd',
{
:readable_license =>
-> { I18n.t('#cc.by_nc_nd', 'CC Attribution Non-Commercial No Derivatives') },
:license_url => "http://creativecommons.org/licenses/by-nc-nd/4.0/"
}
].freeze
module ClassMethods
def licenses
ContentLicenses::LICENSES
end
def public_license?(license)
license != 'private'
end
end
end