summaryrefslogtreecommitdiff
path: root/docs/docsite/_themes/sphinx_rtd_theme/ansible_banner.html
blob: 1a2b998f2293e5a6b32e395fe9130283cd0e9244 (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
<!--- Based on sphinx versionwarning extension. Extension currently only works on READTHEDOCS -->
  <script>
    startsWith = function(str, needle) {
      return str.slice(0, needle.length) == needle
    }
    // Create a banner if we're not on the official docs site
    if (location.host == "docs.testing.ansible.com") {
      document.write('<div id="testing_banner_id" class="admonition important">');
      document.write('<p>This is the testing site for Ansible Documentation. Unless you are reviewing pre-production changes, please visit the <a href="https://docs.ansible.com/ansible/latest/">official documentation website</a>.</p> <p></p>');
      document.write('</div>');
    }
    {% if (not READTHEDOCS) and (available_versions is defined) %}
      // Create a banner
      current_url_path = window.location.pathname;
      if (startsWith(current_url_path, "/ansible/latest/") || startsWith(current_url_path, "/ansible/{{ latest_version }}/")) {
        document.write('<div id="banner_id" class="admonition caution">');
        document.write('<p>You are reading the latest community version of the Ansible documentation. Red Hat subscribers, select <b>2.9</b> in the version selection to the left for the most recent Red Hat release.</p>');
        document.write('</div>');

      } else if (startsWith(current_url_path, "/ansible/2.9/")) {
        document.write('<div id="banner_id" class="admonition caution">');
        document.write('<p>You are reading the latest Red Hat released version of the Ansible documentation. Community users can use this, or select any version in version selection to the left, including <b>latest</b> for the most recent community version.</p>');
        document.write('</div>');
      } else if (startsWith(current_url_path, "/ansible/devel/")) {
        /* temp banner to advertise survey
        document.write('<div id="banner_id" class="admonition important">');
        document.write('<br><p>Please take our <a href="https://www.surveymonkey.co.uk/r/B9V3CDY">Docs survey</a> before December 31 to help us improve Ansible documentation.</p><br>');
        document.write('</div>'); */

        document.write('<div id="banner_id" class="admonition caution">');
        document.write('<p>You are reading the <b>devel</b> version of the Ansible documentation - this version is not guaranteed stable. Use the version selection to the left if you want the latest stable released version.</p>');
        document.write('</div>');

      } else {
        document.write('<div id="banner_id" class="admonition caution">');
        document.write('<p>You are reading an older version of the Ansible documentation. Use the version selection to the left if you want the latest stable released version.</p>');
        document.write('</div>');
      }
    {% endif %}
  </script>