|
| 1 | +{% extends "admin/base_site.html" %} |
| 2 | +{% load i18n admin_urls static admin_list %} |
| 3 | + |
| 4 | +{% block extrastyle %} |
| 5 | +{{ block.super }} |
| 6 | +<link rel="stylesheet" href="{% static 'admin/css/changelists.css'%}"> |
| 7 | +<link rel="stylesheet" href="{% static 'admin/css/forms.css' %}"> |
| 8 | +{% if cl.formset or action_form %} |
| 9 | +<script src="{% url 'admin:jsi18n' %}"></script> |
| 10 | +{% endif %} |
| 11 | +{{ media.css }} |
| 12 | +{% if not actions_on_top and not actions_on_bottom %} |
| 13 | +<style> |
| 14 | + #changelist table thead th:first-child {width: inherit} |
| 15 | + |
| 16 | + |
| 17 | +</style> |
| 18 | +{% endif %} |
| 19 | +{% endblock %} |
| 20 | + |
| 21 | +{% block extrahead %} |
| 22 | +{{ block.super }} |
| 23 | +{{ media.js }} |
| 24 | +<script src="{% static 'admin/js/filters.js' %}" defer></script> |
| 25 | +{% endblock %} |
| 26 | + |
| 27 | +{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} change-list{% endblock %} |
| 28 | + |
| 29 | +{% if not is_popup %} |
| 30 | +{% block breadcrumbs %} |
| 31 | +<div class="breadcrumbs"> |
| 32 | + <a href="{% url 'admin:index' %}">{% translate 'Home' %}</a> |
| 33 | + › <a href="{% url 'admin:app_list' app_label=cl.opts.app_label %}">{{ cl.opts.app_config.verbose_name }}</a> |
| 34 | + › {{ cl.opts.verbose_name_plural|capfirst }} |
| 35 | +</div> |
| 36 | +{% endblock %} |
| 37 | +{% endif %} |
| 38 | + |
| 39 | +{% block coltype %}{% endblock %} |
| 40 | + |
| 41 | +{% block content %} |
| 42 | +<div id="content-main"> |
| 43 | + {% block object-tools %} |
| 44 | + <ul class="object-tools"> |
| 45 | + {% block object-tools-items %} |
| 46 | + {% change_list_object_tools %} |
| 47 | + {% endblock %} |
| 48 | + </ul> |
| 49 | + {% endblock %} |
| 50 | + {% if cl.formset and cl.formset.errors %} |
| 51 | + <p class="errornote"> |
| 52 | + {% blocktranslate count counter=cl.formset.total_error_count %}Please correct the error below.{% plural %}Please |
| 53 | + correct the errors below.{% endblocktranslate %} |
| 54 | + </p> |
| 55 | + {{ cl.formset.non_form_errors }} |
| 56 | + {% endif %} |
| 57 | + <div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist"> |
| 58 | + <div class="changelist-form-container"> |
| 59 | + {% block search %}{% search_form cl %}{% endblock %} |
| 60 | + {% block date_hierarchy %}{% if cl.date_hierarchy %}{% date_hierarchy cl %}{% endif %}{% endblock %} |
| 61 | + |
| 62 | + <form id="changelist-form" method="post" {% if cl.formset and cl.formset.is_multipart %} |
| 63 | + enctype="multipart/form-data" {% endif %} novalidate>{% csrf_token %} |
| 64 | + {% if cl.formset %} |
| 65 | + <div>{{ cl.formset.management_form }}</div> |
| 66 | + {% endif %} |
| 67 | + |
| 68 | + {% block result_list %} |
| 69 | + {% if action_form and actions_on_top and cl.show_admin_actions %}{% admin_actions %}{% endif %} |
| 70 | + {% result_list cl %} |
| 71 | + {% if action_form and actions_on_bottom and cl.show_admin_actions %}{% admin_actions %}{% endif %} |
| 72 | + {% endblock %} |
| 73 | + {% block pagination %}{% pagination cl %}{% endblock %} |
| 74 | + <div class="submit-row" id="mailing_btn"> |
| 75 | + <input type="button" class="mailing-btn" value="Рассылка" onclick="mailing()"/> |
| 76 | + </div> |
| 77 | + <br> |
| 78 | + <script> |
| 79 | + function mailing() { |
| 80 | + window.open("{% url 'admin:all_users_mailing' %}", '_blank').focus() |
| 81 | + } |
| 82 | + window.onload = function() { |
| 83 | + var currentURL = window.location.href; |
| 84 | + currentURL = currentURL.split('/'); |
| 85 | + if (currentURL.at(-2) != "customuser") |
| 86 | + { |
| 87 | + const button = document.getElementById("mailing_btn"); |
| 88 | + button.setAttribute("style", "display:none;"); |
| 89 | + } |
| 90 | + }; |
| 91 | + </script> |
| 92 | + </form> |
| 93 | + </div> |
| 94 | + {% block filters %} |
| 95 | + {% if cl.has_filters %} |
| 96 | + <div id="changelist-filter"> |
| 97 | + <h2>{% translate 'Filter' %}</h2> |
| 98 | + {% if cl.has_active_filters %}<h3 id="changelist-filter-clear"> |
| 99 | + <a href="{{ cl.clear_all_filters_qs }}">✖ {% translate "Clear all filters" %}</a> |
| 100 | + </h3>{% endif %} |
| 101 | + {% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %} |
| 102 | + </div> |
| 103 | + {% endif %} |
| 104 | + {% endblock %} |
| 105 | + </div> |
| 106 | +</div> |
| 107 | +{% endblock %} |
0 commit comments