mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2025-01-11 02:34:28 +00:00
Overwrite admin templates (4)
This commit is contained in:
parent
46cb6dddb3
commit
231497d16b
3 changed files with 155 additions and 0 deletions
27
static/admin/css/changelists.css
Normal file
27
static/admin/css/changelists.css
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
/* Keep hidden fields hidden, can be removed with Bootstrap 4 */
|
||||||
|
.hiddenfields {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Checkbox column should be small */
|
||||||
|
#result_list .action-checkbox-column,
|
||||||
|
#result_list .action-checkbox {
|
||||||
|
width: 40px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* For sortable columns */
|
||||||
|
.sortable .text {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sortoptions {
|
||||||
|
float: right;
|
||||||
|
font-size: 12px;
|
||||||
|
position: relative;
|
||||||
|
top: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sortoptions .sortpriority {
|
||||||
|
display: none;
|
||||||
|
}
|
89
templates/admin/change_list.html
Normal file
89
templates/admin/change_list.html
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
{# Please keep this template in sync with django/contrib/admin one #}
|
||||||
|
{% extends "admin/base_site.html" %}
|
||||||
|
{% load i18n admin_urls static admin_list %}
|
||||||
|
|
||||||
|
{% block extrastyle %}
|
||||||
|
{{ block.super }}
|
||||||
|
<link rel="stylesheet" type="text/css" href="{% static "admin/css/changelists.css" %}" />
|
||||||
|
{% if cl.formset %}
|
||||||
|
<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />
|
||||||
|
{% endif %}
|
||||||
|
{% if cl.formset or action_form %}
|
||||||
|
<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
|
||||||
|
{% endif %}
|
||||||
|
{{ media.css }}
|
||||||
|
{% if not actions_on_top and not actions_on_bottom %}
|
||||||
|
<style>
|
||||||
|
#changelist table thead th:first-child {width: inherit}
|
||||||
|
</style>
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block extrahead %}
|
||||||
|
{{ block.super }}
|
||||||
|
{{ media.js }}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} change-list{% endblock %}
|
||||||
|
|
||||||
|
{% if not is_popup %}
|
||||||
|
{% block breadcrumbs %}
|
||||||
|
<ol class="breadcrumb"><li class="home">
|
||||||
|
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||||
|
</li><li><a href="{% url 'admin:app_list' app_label=cl.opts.app_label %}">{{ cl.opts.app_config.verbose_name }}</a>
|
||||||
|
</li><li class="active">{{ cl.opts.verbose_name_plural|capfirst }}
|
||||||
|
</li></ol>
|
||||||
|
{% endblock %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% block coltype %}flex{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div id="content-main">
|
||||||
|
{% block object-tools %}
|
||||||
|
<ul class="object-tools list-inline">
|
||||||
|
{% block object-tools-items %}
|
||||||
|
{% if has_add_permission %}
|
||||||
|
<li>
|
||||||
|
{% url cl.opts|admin_urlname:'add' as add_url %}
|
||||||
|
<a href="{% add_preserved_filters add_url is_popup to_field %}" class="addlink btn btn-success btn-sm">
|
||||||
|
<span class="glyphicon glyphicon-plus"></span> {% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
</ul>
|
||||||
|
{% endblock %}
|
||||||
|
{% if cl.formset.errors %}
|
||||||
|
<div class="errornote alert alert-warning">
|
||||||
|
{% if cl.formset.total_error_count == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}
|
||||||
|
{{ cl.formset.non_form_errors }}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">
|
||||||
|
{% block search %}{% search_form cl %}{% endblock %}
|
||||||
|
{% block date_hierarchy %}{% date_hierarchy cl %}{% endblock %}
|
||||||
|
|
||||||
|
{% block filters %}
|
||||||
|
{% if cl.has_filters %}
|
||||||
|
<div id="changelist-filter">
|
||||||
|
<h2>{% trans 'Filter' %}</h2>
|
||||||
|
{% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
<form id="changelist-form" method="post"{% if cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %} novalidate>{% csrf_token %}
|
||||||
|
{% if cl.formset %}
|
||||||
|
<div>{{ cl.formset.management_form }}</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% block result_list %}
|
||||||
|
{% result_list cl %}
|
||||||
|
{% if action_form and cl.show_admin_actions %}{% admin_actions %}{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
{% block pagination %}{% pagination cl %}{% endblock %}
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
39
templates/admin/change_list_results.html
Normal file
39
templates/admin/change_list_results.html
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
{# Please keep this template in sync with django/contrib/admin one #}
|
||||||
|
{% 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 table-responsive">
|
||||||
|
<table id="result_list" class="table table-striped table-bordered">
|
||||||
|
<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" %}"><span class="glyphicon glyphicon-remove"></span></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" %}"><span class="glyphicon glyphicon-chevron-{% if header.ascending %}down{% else %}up{% endif %}"></span></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 %}
|
Loading…
Reference in a new issue