Source

django-admintools-bootstrap / admintools_bootstrap / templates / admin / base.html

{% load theming_tags admintools_bootstrap static %}
<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE }}" xml:lang="{{ LANGUAGE_CODE }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
<head>
<title>{% block title %}{% endblock %}</title>
{% block extrastyle %}{% endblock %}
<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{% block stylesheet_ie %}{% load adminmedia %}{% admin_media_prefix %}css/ie.css{% endblock %}" /><![endif]-->
{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% admin_media_prefix %}css/rtl.css{% endblock %}" />{% endif %}
{#{% render_theming_css %}#}
<script type="text/javascript">window.__admin_media_prefix__ = "{% filter escapejs %}{% admin_media_prefix %}{% endfilter %}";</script>
{% block extrahead %}{% endblock %}


<script type="text/javascript" src="{% static "admin/js/jquery.js" %}"></script>
<script type="text/javascript" src="{% static "admintools_bootstrap/chosen/chosen.jquery.js" %}"></script>
<script type="text/javascript" src="{% static "admintools_bootstrap/js/jquery-ui-1.8.16.custom.min.js" %}"></script>
<script type="text/javascript" src="{% static "admintools_bootstrap/bootstrap/js/bootstrap-dropdown.js" %}"></script>
<script type="text/javascript" src="{% static "admintools_bootstrap/bootstrap/js/bootstrap-alert.js" %}"></script>
<script type="text/javascript" src="{% static "admintools_bootstrap/bootstrap/js/bootstrap-tooltip.js" %}"></script>

{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}

<script type="text/javascript">
$(function(){

  var django_dismimssPopup = window.dismissAddAnotherPopup;

  window.dismissAddAnotherPopup = function(win, newId, newRepr) {
    var name = windowname_to_id(win.name);
    var elem = document.getElementById(name);
    django_dismimssPopup(win, newId, newRepr);
    $(elem).removeClass('chzn-done');
    $('#' + name + '_chzn').remove();
    $(elem).chosen();
  }

  // menu search

  var nav_menu = $('#navigation-menu');
  var menu_map = [];
  var menu_url_map = {};
  var search_results = $('#menu_search ul');
  var menu_search_visible = false;

  $('#navigation-menu a').not('.dropdown-toggle').each(function(i, a) {
      var line = [a.text.toLowerCase().replace(/^\s+|\s+$/g, ''), a.href];
      menu_map[i] = line;
      menu_url_map[a.href] = a.text.replace(/^\s+|\s+$/g, '');
  });

  $('#menu_search input').keyup(function(e){
    var code = (e.keyCode ? e.keyCode : e.which);
    if (code == 40) {
      // down arrow key
      $('#menu_search ul li a:first').focus();
      return;
    }
    var inp = $(this).val().toLowerCase();
    if (inp == '') { search_results.html(''); return; }
    var results = "";
    var highlight_re = new RegExp('(' + inp + ')', 'ig');
    var cnt = 0;
    var unique_map = {};
    $(menu_map).each(function(i, e){
      if ((-1 != e[0].indexOf(inp)) && (cnt < 10)) {
        if (unique_map[e[1]]) { return; }
        var txt = menu_url_map[e[1]].replace(highlight_re, '<span class="highlight">$1</span>');
        results = results + '<li><a href="' + e[1] + '">' + txt + '</a></li>';
        unique_map[e[1]] = true;
        cnt ++;
      }
    });
    search_results.html(results);
  });

  $('#menu_search ul li a').live('keydown', function(e){
    var code = (e.keyCode ? e.keyCode : e.which);
    if (code == 40) {
      e.preventDefault();
      $(this).parent().next().children('a').focus();
    }
    if (code == 38) {
      e.preventDefault();
      $(this).parent().prev().children('a').focus();
    }
  });

  $('#menu_search ul li a').live('mouseover', function(e){
    $(this).focus();
  });

  $('#menu-search-toggle').click(function(e){
    e.preventDefault();
    menu_search_visible = ! menu_search_visible;
    $('#menu_search').toggle(menu_search_visible);
    if (menu_search_visible) {
      $(this).twipsy('hide');
      $('#menu_search input').focus();
    } 
  });

  $('fieldset label').addClass('control-label');

	$('select[multiple]').chosen();

});
</script>
</head>
{% load i18n %}

<body class="{% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}">

<!-- Container -->
<div id="container" class="container-fluid{% if is_popup %} container-popup{% endif %}">
    {% if not is_popup %}
    <!-- Header -->
    <div id="header" class="navbar navbar-fixed-top" data-dropdown="dropdown">
      <div class="navbar-inner">
      <div class="container-fluid">
        {% block branding %}{% endblock %}
        {% block nav-global %}{% endblock %}
        {% block search %}{% endblock %}
        {% if user.is_active and user.is_staff %}
        <ul class="nav pull-right">
          {% comment %}
            <li id="menu-search-container">
              <a href="#" id="menu-search-toggle" class="top-icon" title="{% trans "Menu Search" %}" rel="popover" data-placement="below"><span class="ui-icon ui-icon-search"></span></a>
              <div id="menu_search">
                <input type="text" placeholder="{% trans "Search in menu" %}"/>
                <ul></ul>
              </div>
            </li>
          {% endcomment %}
            {% atb_site_link %}
            <li class="dropdown">
              <a class="dropdown-toggle" href="#" data-toggle="dropdown">
                <i class="icon-user icon-white"></i>
                {% filter force_escape %}{% firstof user.first_name user.username %}{% endfilter %}
                <b class="caret"></b>
              </a>
              <ul class="dropdown-menu">
              {% block userlinks %}
                  {% url django-admindocs-docroot as docsroot %}
                  {% if docsroot %}
                      <li><a href="{{ docsroot }}">{% trans 'Documentation' %}</a></li>
                  {% endif %}
                  {% url admin:password_change as password_change_url %}
                  <li>
                    {% if password_change_url %}
                        <a href="{{ password_change_url }}">
                    {% else %}
                        <a href="{{ root_path }}password_change/">
                    {% endif %}
                    <i class="icon-lock"></i> 
                    {% trans 'Change password' %}</a>
                  </li>
                  {% url admin:logout as logout_url %}
                  <li>
                    {% if logout_url %}
                        <a href="{{ logout_url }}">
                    {% else %}
                        <a href="{{ root_path }}logout/">
                    {% endif %}
                    <i class="icon-off"></i> 
                    {% trans 'Log out' %}</a>
                  </li>
              {% endblock %}
              </ul>
            </li>
        </ul>
        {% endif %}
      </div>
      </div>
    </div>
    <!-- END Header -->
      {% breadcrumbs %}
      {% block breadcrumbs %}
        /|{% trans "Home" %}
        {% if title %}{{ title }}{% endif %}
      {% endblock %}
      {% endbreadcrumbs %}
    {% endif %}

    <div class="main-container">
        {% block messages %}
          {% if messages %}
              {% for message in messages %}
                <div class="alert alert-{{ message.tags }}" data-alert="alert"><a class="close" href="#">&times;</a>{{ message }}</div>
              {% endfor %}
          {% endif %}
        {% endblock %}

      <!-- Content -->
      <div id="content" class="{% block coltype %}container-fluid{% endblock %}">
          {% block pretitle %}{% endblock %}
          {% block content_title %}
            {% if title %}
              <h3 class="well page-top">
                {% block object-tools %}{% endblock %}
                {{ title }}
              </h3>
            {% endif %}
          {% endblock %}
          {% block content %}
          {{ content }}
          {% endblock %}
          {% block sidebar %}{% endblock %}
          <br class="clear" />
      </div>
      <!-- END Content -->

      {% block footer %}<div id="footer"></div>{% endblock %}
    </div>
</div>
<!-- END Container -->

</body>
</html>