From 014af24d2d21929ca09c3d3555333b520e5603d8 Mon Sep 17 00:00:00 2001 From: Garret Wassermann Date: Fri, 5 Aug 2016 00:38:17 -0400 Subject: [PATCH] Added a HELPDESK_USE_CDN setting, off by default, to select between using public CDNs as before, and an up-to-date static copy --- helpdesk/settings.py | 3 +++ helpdesk/templates/helpdesk/base.html | 7 +++++-- helpdesk/templates/helpdesk/public_base.html | 7 +++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/helpdesk/settings.py b/helpdesk/settings.py index c7993e65..27cbfd59 100644 --- a/helpdesk/settings.py +++ b/helpdesk/settings.py @@ -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) diff --git a/helpdesk/templates/helpdesk/base.html b/helpdesk/templates/helpdesk/base.html index b3145bce..5a0b9fc4 100644 --- a/helpdesk/templates/helpdesk/base.html +++ b/helpdesk/templates/helpdesk/base.html @@ -16,10 +16,13 @@ - - + {% if helpdesk_settings.HELPDESK_USE_CDN %} + + + {% else %} + {% endif %} diff --git a/helpdesk/templates/helpdesk/public_base.html b/helpdesk/templates/helpdesk/public_base.html index 6005d570..5e64306d 100644 --- a/helpdesk/templates/helpdesk/public_base.html +++ b/helpdesk/templates/helpdesk/public_base.html @@ -7,12 +7,15 @@ {% block helpdesk_title %}{% trans "Helpdesk" %}{% endblock %} - - +{% if helpdesk_settings.HELPDESK_USE_CDN %} + + +{% else %} +{% endif %} {% block helpdesk_head %}{% endblock %}