1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #27728 -- Allowed overriding admin templatetags templates.

This commit is contained in:
Raffaele Salmaso
2017-01-12 17:06:00 +01:00
committed by Carlton Gibson
parent 6e52e2554d
commit 5cc28dc752
23 changed files with 336 additions and 27 deletions

View File

@@ -0,0 +1,6 @@
{% extends "admin/actions.html" %}
{% load i18n %}
{% block actions-submit %}
<button type="submit" class="button override-actions" title="{% trans "Run the selected action" %}" name="index" value="{{ action_index|default:0 }}">{% trans "Go" %}</button>
{% endblock %}

View File

@@ -0,0 +1,7 @@
{% extends "admin/change_form_object_tools.html" %}
{% load i18n admin_urls %}
{% block object-tools-items %}
<li><a href="#" id="change-form-export" class="override-change_form_object_tools change-form-object-tools-item">{% trans "Export" %}</a></li>
{{ block.super }}
{% endblock %}

View File

@@ -0,0 +1,7 @@
{% extends "admin/change_list_object_tools.html" %}
{% load i18n admin_urls %}
{% block object-tools-items %}
<li><a href="#" id="change-list-export" class="override-change_list_object_tools change-list-object-tools-item">{% trans "Export" %}</a></li>
{{ block.super }}
{% endblock %}

View File

@@ -0,0 +1,38 @@
{% load i18n static %}
{% if result_hidden_fields %}
<div class="hiddenfields">{# DIV for HTML validation #}
{% for item in result_hidden_fields %}{{ item }}{% endfor %}
</div>
{% endif %}
{% if results %}
<div class="results override-change_list_results">
<table id="result_list">
<thead>
<tr>
{% for header in result_headers %}
<th scope="col" {{ header.class_attrib }}>
{% if header.sortable %}
{% if header.sort_priority > 0 %}
<div class="sortoptions">
<a class="sortremove" href="{{ header.url_remove }}" title="{% trans "Remove from sorting" %}"></a>
{% if num_sorted_fields > 1 %}<span class="sortpriority" title="{% blocktrans with priority_number=header.sort_priority %}Sorting priority: {{ priority_number }}{% endblocktrans %}">{{ header.sort_priority }}</span>{% endif %}
<a href="{{ header.url_toggle }}" class="toggle {% if header.ascending %}ascending{% else %}descending{% endif %}" title="{% trans "Toggle sorting" %}"></a>
</div>
{% endif %}
{% endif %}
<div class="text">{% if header.sortable %}<a href="{{ header.url_primary }}">{{ header.text|capfirst }}</a>{% else %}<span>{{ header.text|capfirst }}</span>{% endif %}</div>
<div class="clear"></div>
</th>{% endfor %}
</tr>
</thead>
<tbody>
{% for result in results %}
{% if result.form.non_field_errors %}
<tr><td colspan="{{ result|length }}">{{ result.form.non_field_errors }}</td></tr>
{% endif %}
<tr class="{% cycle 'row1' 'row2' %}">{% for item in result %}{{ item }}{% endfor %}</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}

View File

@@ -0,0 +1,9 @@
{% extends "admin/date_hierarchy.html" %}
{% load i18n %}
{% block date-hierarchy-choices %}
<select id="date-selector" class="override-date_hierarchy">{% for choice in choices %}
<option{% if choice.link %} value="{{ choice.link }}"{% endif %}>{{ choice.title }}</option>
{% endfor %}</select>
<button id="date-selected">{% trans "Go" %}</button>
{% endblock %}

View File

@@ -0,0 +1,12 @@
{% load admin_list %}
{% load i18n %}
<p class="paginator override-pagination">
{% if pagination_required %}
{% for i in page_range %}
{% paginator_number cl i %}
{% endfor %}
{% endif %}
{{ cl.result_count }} {% if cl.result_count == 1 %}{{ cl.opts.verbose_name }}{% else %}{{ cl.opts.verbose_name_plural }}{% endif %}
{% if show_all_url %}&nbsp;&nbsp;<a href="{{ show_all_url }}" class="showall">{% trans 'Show all' %}</a>{% endif %}
{% if cl.formset and cl.result_count %}<input type="submit" name="_save" class="default" value="{% trans 'Save' %}"/>{% endif %}
</p>

View File

@@ -0,0 +1,7 @@
{% load l10n static %}
<script type="text/javascript"
id="django-admin-prepopulated-fields-constants"
class="override-prepopulated_fields_js"
src="{% static "admin/js/prepopulate_init.js" %}"
data-prepopulated-fields="{{ prepopulated_fields_json }}">
</script>

View File

@@ -0,0 +1,16 @@
{% load i18n static %}
{% if cl.search_fields %}
<div id="toolbar" class="override-search_form"><form id="changelist-search" method="get">
<div><!-- DIV needed for valid HTML -->
<label for="searchbar"><img src="{% static "admin/img/search.svg" %}" alt="Search" /></label>
<input type="text" size="40" name="{{ search_var }}" value="{{ cl.query }}" id="searchbar" autofocus />
<input type="submit" value="{% trans 'Search' %}" />
{% if show_result_count %}
<span class="small quiet">{% blocktrans count counter=cl.result_count %}{{ counter }} result{% plural %}{{ counter }} results{% endblocktrans %} (<a href="?{% if cl.is_popup %}_popup=1{% endif %}">{% if cl.show_full_result_count %}{% blocktrans with full_result_count=cl.full_result_count %}{{ full_result_count }} total{% endblocktrans %}{% else %}{% trans "Show all" %}{% endif %}</a>)</span>
{% endif %}
{% for pair in cl.params.items %}
{% if pair.0 != search_var %}<input type="hidden" name="{{ pair.0 }}" value="{{ pair.1 }}"/>{% endif %}
{% endfor %}
</div>
</form></div>
{% endif %}

View File

@@ -0,0 +1,7 @@
{% extends "admin/submit_line.html" %}
{% load i18n admin_urls %}
{% block submit-row %}
{% if show_publish %}<input type="submit" value="{% trans 'Publish' %}" class="default" name="_publish" />{% endif %}
{{ block.super }}
{% endblock %}