self-host license badges
18
core/cc.py
|
@ -41,23 +41,23 @@ class CCLicense():
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def badge(license):
|
def badge(license):
|
||||||
if license == 'PD-US':
|
if license == 'PD-US':
|
||||||
return 'https://i.creativecommons.org/p/mark/1.0/88x31.png'
|
return '/static/images/pdmark.png'
|
||||||
elif license == 'CC0':
|
elif license == 'CC0':
|
||||||
return 'https://i.creativecommons.org/p/zero/1.0/88x31.png'
|
return '/static/images/cc0.png'
|
||||||
elif license == 'CC BY':
|
elif license == 'CC BY':
|
||||||
return 'https://i.creativecommons.org/l/by/3.0/88x31.png'
|
return '/static/images/ccby.png'
|
||||||
elif license == 'CC BY-NC-ND':
|
elif license == 'CC BY-NC-ND':
|
||||||
return 'https://i.creativecommons.org/l/by-nc-nd/3.0/88x31.png'
|
return '/static/images/ccbyncnd.png'
|
||||||
elif license == 'CC BY-NC-SA':
|
elif license == 'CC BY-NC-SA':
|
||||||
return 'https://i.creativecommons.org/l/by-nc-sa/3.0/88x31.png'
|
return '/static/images/ccbyncsa.png'
|
||||||
elif license == 'CC BY-NC':
|
elif license == 'CC BY-NC':
|
||||||
return 'https://i.creativecommons.org/l/by-nc/3.0/88x31.png'
|
return '/static/images/ccbync.png'
|
||||||
elif license == 'CC BY-SA':
|
elif license == 'CC BY-SA':
|
||||||
return 'https://i.creativecommons.org/l/by-sa/3.0/88x31.png'
|
return '/static/images/ccbysa.png'
|
||||||
elif license == 'CC BY-ND':
|
elif license == 'CC BY-ND':
|
||||||
return 'https://i.creativecommons.org/l/by-nd/3.0/88x31.png'
|
return '/static/images/ccbynd.png'
|
||||||
elif license == 'GFDL':
|
elif license == 'GFDL':
|
||||||
return 'https://www.gnu.org/graphics/gfdl-logo-tiny.png'
|
return '/static/images/gdfl.png'
|
||||||
else:
|
else:
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|
|
@ -486,7 +486,7 @@ class CampaignTests(TestCase):
|
||||||
c.license = 'CC BY-NC'
|
c.license = 'CC BY-NC'
|
||||||
c.save()
|
c.save()
|
||||||
self.assertEqual(c.license_url, 'http://creativecommons.org/licenses/by-nc/3.0/')
|
self.assertEqual(c.license_url, 'http://creativecommons.org/licenses/by-nc/3.0/')
|
||||||
self.assertEqual(c.license_badge, 'https://i.creativecommons.org/l/by-nc/3.0/88x31.png')
|
self.assertEqual(c.license_badge, '/static/images/ccbync.png')
|
||||||
|
|
||||||
def test_campaign_status(self):
|
def test_campaign_status(self):
|
||||||
|
|
||||||
|
|
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 5.3 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.0 KiB |