Move datepicker language js inclusion outside compress

The datapicker language support works by including a different
js file based on the language of the user.  This will not
work if the js is included at compress time becuase only 1
language can be included.

Additionally cleaning up the logic in case the locale
isn't set (as is the case at compression time) to prevent
an improper path from being build.

Change-Id: I953dde0e7ee4a876376faf28c6f0bb859a3dc6b6
Closes-Bug: #1373430
This commit is contained in:
Doug Fish 2014-09-24 11:11:12 -05:00
parent 4124320b53
commit a058578720
1 changed files with 5 additions and 3 deletions

View File

@ -32,9 +32,6 @@
<script src="{{ STATIC_URL }}bootstrap/js/bootstrap.js" type="text/javascript" charset="utf-8"></script>
<script src='{{ STATIC_URL }}horizon/lib/bootstrap_datepicker/bootstrap-datepicker.js' type='text/javascript' charset='utf-8'></script>
{% ifnotequal DATEPICKER_LOCALE 'en' %}
<script src='{{ STATIC_URL }}horizon/lib/bootstrap_datepicker/locales/bootstrap-datepicker.{{ DATEPICKER_LOCALE }}.js' type='text/javascript' charset='utf-8'></script>
{% endifnotequal %}
<script src="{{ STATIC_URL }}horizon/lib/hogan.js" type="text/javascript" charset='utf-8'></script>
@ -68,6 +65,11 @@
{% comment %} Client-side Templates (These should *not* be inside the "compress" tag.) {% endcomment %}
{% include "horizon/client_side/templates.html" %}
{% comment %}Locale sensitive js needs to be included outisde the "compress" tag{% endcomment %}
{% if DATEPICKER_LOCALE and DATEPICKER_LOCALE != 'en' %}
<script src='{{ STATIC_URL }}horizon/lib/bootstrap_datepicker/locales/bootstrap-datepicker.{{ DATEPICKER_LOCALE }}.js' type='text/javascript' charset='utf-8'></script>
{% endif %}
{% comment %}Go!{% endcomment %}
<script type='text/javascript' charset='utf-8'>
// Call init on DOM ready.