summaryrefslogtreecommitdiffstats
path: root/askbot/conf/license.py
blob: d538d2cb5329e44cc0f4efb09f538854c4c514b0 (plain)
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
"""settings that allow changing of the license
clause used in askbot instances"""
from askbot import const
from askbot.conf.settings_wrapper import settings
from askbot.conf.super_groups import CONTENT_AND_UI
from askbot.deps import livesettings
from askbot.skins import utils as skin_utils
from django.utils.translation import ugettext_lazy as _
from django.conf import settings as django_settings

LICENSE_SETTINGS = livesettings.ConfigurationGroup(
                        'LICENSE_SETTINGS',
                        _('Content License'),
                        super_group = CONTENT_AND_UI
                    )

settings.register(
    livesettings.BooleanValue(
        LICENSE_SETTINGS,
        'USE_LICENSE',
        description = _('Show license clause in the site footer'),
        default = True
    )
)

settings.register(
    livesettings.StringValue(
        LICENSE_SETTINGS,
        'LICENSE_ACRONYM',
        description = _('Short name for the license'),
        default = 'cc-by-sa'
    )
)

settings.register(
    livesettings.StringValue(
        LICENSE_SETTINGS,
        'LICENSE_TITLE',
        description = _('Full name of the license'),
        default = _('Creative Commons Attribution Share Alike 3.0'),
    )
)

settings.register(
    livesettings.BooleanValue(
        LICENSE_SETTINGS,
        'LICENSE_USE_URL',
        description = _('Add link to the license page'),
        default = True
    )
)

settings.register(
    livesettings.URLValue(
        LICENSE_SETTINGS,
        'LICENSE_URL',
        description = _('License homepage'),
        help_text = _(
            'URL of the official page with all the license legal clauses'
        ),
        default = const.DEPENDENCY_URLS['cc-by-sa']
    )
)

settings.register(
    livesettings.BooleanValue(
        LICENSE_SETTINGS,
        'LICENSE_USE_LOGO',
        description = _('Use license logo'),
        default = True
    )
)

settings.register(
    livesettings.ImageValue(
        LICENSE_SETTINGS,
        'LICENSE_LOGO_URL',
        description = _('License logo image'),
        default = '/images/cc-by-sa.png',
        url_resolver = skin_utils.get_media_url
    )
)