summaryrefslogtreecommitdiff
path: root/openstack_dashboard/templates/horizon/_conf.html
blob: 631825fb1a5148b7a5a4b306af04280c27f5105e (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
{% load compress %}
{% load datepicker_locale from horizon %}

{% datepicker_locale as DATEPICKER_LOCALE %}

{% comment %} Compress 3rd-party (jquery, angular, etc) and top-level Horizon JS. {% endcomment %}
{% compress js %}
{% for file in HORIZON_CONFIG.xstatic_lib_files %}
    <script src='{{ STATIC_URL }}{{ file }}'></script>
{% endfor %}
<script src='{{ STATIC_URL }}horizon/js/horizon.js' type='text/javascript' charset='utf-8'></script>
{% endcompress %}

<script type='text/javascript' charset='utf-8'>
  (function (global) {
    'use strict';

    // make translation info available on client
    horizon.languageCode = '{{ LANGUAGE_CODE }}';
    horizon.languageBidi = '{{ LANGUAGE_BIDI }}';
    horizon.datepickerLocale = '{{ DATEPICKER_LOCALE }}';

    /* Load angular modules extensions list before we include angular/horizon.js */
    global.horizonPlugInModules = {{ HORIZON_CONFIG.angular_modules|default:"[]"|safe }};

    /* Storage for backend configuration variables which the frontend
     * should be aware of.
     */
    var conf = horizon.conf;
    conf.static_url = "{{ STATIC_URL }}";
    conf.ajax = {
      queue_limit: {{ HORIZON_CONFIG.ajax_queue_limit|default:"null" }}
    };
    conf.auto_fade_alerts = {
      delay: {{ HORIZON_CONFIG.auto_fade_alerts.delay|default:"3000" }},
      fade_duration: {{ HORIZON_CONFIG.auto_fade_alerts.fade_duration|default:"1500" }},
      types: {{ HORIZON_CONFIG.auto_fade_alerts.types|default:"[]"|safe }}
    };
    conf.disable_password_reveal =
      {{ HORIZON_CONFIG.disable_password_reveal|yesno:"true,false" }};

  })(this);
</script>