change_list.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. {% extends "admin/base_site.html" %}
  2. {% load i18n admin_static admin_list %}
  3. {% load url from future %}
  4. {% load admin_urls %}
  5. {% block extrastyle %}
  6. {{ block.super }}
  7. <link rel="stylesheet" type="text/css" href="{% static "admin/css/changelists.css" %}" />
  8. {% if cl.formset %}
  9. <link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />
  10. {% endif %}
  11. {% if cl.formset or action_form %}
  12. {% url 'admin:jsi18n' as jsi18nurl %}
  13. <script type="text/javascript" src="{{ jsi18nurl|default:'../../jsi18n/' }}"></script>
  14. {% endif %}
  15. {{ media.css }}
  16. {% if not actions_on_top and not actions_on_bottom %}
  17. <style>
  18. #changelist table thead th:first-child {width: inherit}
  19. </style>
  20. {% endif %}
  21. {% endblock %}
  22. {% block extrahead %}
  23. {{ block.super }}
  24. {{ media.js }}
  25. {% if action_form %}{% if actions_on_top or actions_on_bottom %}
  26. <script type="text/javascript">
  27. (function($) {
  28. $(document).ready(function($) {
  29. $("tr input.action-select").actions();
  30. });
  31. })(django.jQuery);
  32. </script>
  33. {% endif %}{% endif %}
  34. {% endblock %}
  35. {% block bodyclass %}change-list{% endblock %}
  36. {% if not is_popup %}
  37. {% block breadcrumbs %}
  38. <div class="breadcrumbs">
  39. <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
  40. &rsaquo; <a href="{% url 'admin:app_list' app_label=cl.opts.app_label %}">{{ app_label|capfirst|escape }}</a>
  41. &rsaquo; {{ cl.opts.verbose_name_plural|capfirst }}
  42. </div>
  43. {% endblock %}
  44. {% endif %}
  45. {% block coltype %}flex{% endblock %}
  46. {% block content %}
  47. <div id="content-main">
  48. {% block object-tools %}
  49. {% if has_add_permission %}
  50. <ul class="object-tools">
  51. {% block object-tools-items %}
  52. <li>
  53. <a href="{% url cl.opts|admin_urlname:'add' %}{% if is_popup %}?_popup=1{% endif %}" class="addlink">
  54. {% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}
  55. </a>
  56. </li>
  57. {% endblock %}
  58. </ul>
  59. {% endif %}
  60. {% endblock %}
  61. {% if cl.formset.errors %}
  62. <p class="errornote">
  63. {% blocktrans count cl.formset.errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
  64. </p>
  65. {{ cl.formset.non_form_errors }}
  66. {% endif %}
  67. <div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">
  68. {% block search %}{% search_form cl %}{% endblock %}
  69. {% block date_hierarchy %}{% date_hierarchy cl %}{% endblock %}
  70. {% block filters %}
  71. {% if cl.has_filters %}
  72. <div id="changelist-filter">
  73. <h2>{% trans 'Filter' %}</h2>
  74. {% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %}
  75. </div>
  76. {% endif %}
  77. {% endblock %}
  78. <form id="changelist-form" action="" method="post"{% if cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %}>{% csrf_token %}
  79. {% if cl.formset %}
  80. <div>{{ cl.formset.management_form }}</div>
  81. {% endif %}
  82. {% block result_list %}
  83. {% if action_form and actions_on_top and cl.full_result_count %}{% admin_actions %}{% endif %}
  84. {% result_list cl %}
  85. {% if action_form and actions_on_bottom and cl.full_result_count %}{% admin_actions %}{% endif %}
  86. {% endblock %}
  87. {% block pagination %}{% pagination cl %}{% endblock %}
  88. </form>
  89. </div>
  90. </div>
  91. {% endblock %}