From: Aaron Williamson Date: Tue, 17 Jan 2012 06:13:55 +0000 (-0500) Subject: Added new files X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0bfb4dc249715a7a9617c23f42d63ff8aabfd2d9;p=mediagoblin.git Added new files --- diff --git a/mediagoblin/templates/mediagoblin/utils/license.html b/mediagoblin/templates/mediagoblin/utils/license.html new file mode 100644 index 00000000..0f7762bc --- /dev/null +++ b/mediagoblin/templates/mediagoblin/utils/license.html @@ -0,0 +1,26 @@ +{# +# GNU MediaGoblin -- federated, autonomous media hosting +# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS. +# +# This program 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, either version 3 of the License, or +# (at your option) any later version. +# +# This program 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 . +#} + +{% block license_content -%} +

License

+ {% if media['license'] %} + {{ media.get_license_data()['abbreviation'] }} + {% else %} + All rights reserved + {% endif %} +{% endblock %} diff --git a/mediagoblin/tools/licenses.py b/mediagoblin/tools/licenses.py new file mode 100644 index 00000000..cb137fa8 --- /dev/null +++ b/mediagoblin/tools/licenses.py @@ -0,0 +1,62 @@ +# GNU MediaGoblin -- federated, autonomous media hosting +# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS. +# +# This program 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, either version 3 of the License, or +# (at your option) any later version. +# +# This program 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 . + +SUPPORTED_LICENSES = { + "": { + "name": "No license specified", + "abbreviation": "All rights reserved" + }, + "http://creativecommons.org/licenses/by/3.0/": { + "name": "Creative Commons Attribution Unported 3.0", + "abbreviation": "CC BY 3.0" + }, + "http://creativecommons.org/licenses/by-sa/3.0": { + "name": "Creative Commons Attribution-ShareAlike Unported 3.0", + "abbreviation": "CC BY-SA 3.0" + }, + "http://creativecommons.org/licenses/by-nd/3.0": { + "name": "Creative Commons Attribution-NoDerivs 3.0 Unported", + "abbreviation": "CC BY-ND 3.0" + }, + "http://creativecommons.org/licenses/by-nc/3.0": { + "name": "Creative Commons Attribution-NonCommercial Unported 3.0", + "abbreviation": "CC BY-NC 3.0" + }, + "http://creativecommons.org/licenses/by-nc-sa/3.0": { + "name": "Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported", + "abbreviation": "CC BY-NC-SA 3.0" + }, + "http://creativecommons.org/licenses/by-nc-nd/3.0": { + "name": "Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported", + "abbreviation": "CC BY-NC-ND 3.0" + }, + "http://creativecommons.org/publicdomain/zero/1.0/": { + "name": "Creative Commons CC0 1.0 Universal", + "abbreviation": "CC0 1.0" + }, + "http://creativecommons.org/publicdomain/mark/1.0/": { + "name": "Public Domain", + "abbreviation": "Public Domain" + }, +} + +def licenses_as_choices(): + license_list = [] + + for uri, data in SUPPORTED_LICENSES.items(): + license_list.append((uri, data["abbreviation"])) + + return license_list