Added a HELPDESK_USE_CDN setting, off by default, to select between using public CDNs as before, and an up-to-date static copy

This commit is contained in:
Garret Wassermann 2016-08-05 00:38:17 -04:00
parent d9480c9cf0
commit 014af24d2d
3 changed files with 13 additions and 4 deletions

View File

@ -34,6 +34,9 @@ HELPDESK_KB_ENABLED = getattr(settings, 'HELPDESK_KB_ENABLED', True)
# show extended navigation by default, to all users, irrespective of staff status?
HELPDESK_NAVIGATION_ENABLED = getattr(settings, 'HELPDESK_NAVIGATION_ENABLED', False)
# use public CDNs to serve jquery and other javascript by default? otherwise, use built-in static copy
HELPDESK_USE_CDN = getattr(settings, 'HELPDESK_USE_CDN', False)
# show dropdown list of languages that ticket comments can be translated into?
HELPDESK_TRANSLATE_TICKET_COMMENTS = getattr(settings, 'HELPDESK_TRANSLATE_TICKET_COMMENTS', False)

View File

@ -16,10 +16,13 @@
<!--link rel='stylesheet' href='{% static "helpdesk/helpdesk-print.css" %}' type='text/css' media="print" /-->
<!--link rel='stylesheet' href='{% static "helpdesk/jquery-smoothness-theme/jquery-ui-1.8.9.custom.css" %}' type='text/css' /-->
<!--<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.js"></script>-->
<!--<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css" rel="stylesheet">-->
{% if helpdesk_settings.HELPDESK_USE_CDN %}
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.js"></script>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css" rel="stylesheet">
{% else %}
<script src="{% static 'helpdesk/bootstrap/bootstrap-3.3.7.min.js' %}" type='text/javascript'></script>
<link href="{% static 'helpdesk/bootstrap/bootstrap-3.3.7.min.css' %}" rel="stylesheet">
{% endif %}
<link rel='alternate' href='{% url 'helpdesk_rss_user' user.get_username %}' type='application/rss+xml' title='{% trans "My Open Tickets" %}' />
<link rel='alternate' href='{% url 'helpdesk_rss_activity' %}' type='application/rss+xml' title='{% trans "All Recent Activity" %}' />
<link rel='alternate' href='{% url 'helpdesk_rss_unassigned' %}' type='application/rss+xml' title='{% trans "Unassigned Tickets" %}' />

View File

@ -7,12 +7,15 @@
<head>
<title>{% block helpdesk_title %}{% trans "Helpdesk" %}{% endblock %}</title>
<!--<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>-->
<!--<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.js"></script>-->
<!--<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css" rel="stylesheet">-->
<script src="{% static 'helpdesk/jquery-1.12.4.min.js' %}" type='text/javascript'></script>
<script src='{% static "helpdesk/jquery-ui-1.12.0.min.js" %}' type='text/javascript' language='javascript'></script>
{% if helpdesk_settings.HELPDESK_USE_CDN %}
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.js"></script>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css" rel="stylesheet">
{% else %}
<script src="{% static 'helpdesk/bootstrap/bootstrap-3.3.7.min.js' %}" type='text/javascript'></script>
<link href="{% static 'helpdesk/bootstrap/bootstrap-3.3.7.min.css' %}" rel="stylesheet">
{% endif %}
<link rel='stylesheet' href='{% static "helpdesk/helpdesk-extend.css" %}' type='text/css' />
{% block helpdesk_head %}{% endblock %}
</head>