Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix url path and styles #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 53 additions & 50 deletions adminlte3_theme/templates/admin/change_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,60 +59,60 @@ <h2>{{title}}</h2>
<div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">
<div class="row p-2">

{% block search %}{% search_form cl %}{% endblock %}
<!-- -->
{% block object-tools %}
<div class="col-md-{% if cl.has_filters %}4{% else %}4{% endif %}">
{% if cl.has_filters %}
<span class="float-sm-right">
<a href="#"
class="btn btn-success btn-sm text-light ml-2" data-toggle="collapse" data-target="#changelist-filter" aria-expanded="false" aria-controls="changelist-filter">
<i class="fas fa-filter"></i>
{% trans 'Filter' %}
</a>
</span>
{% endif %}
{% block object-tools-items %}
{% if has_add_permission %}
<span class="float-sm-right">
{% url cl.opts|admin_urlname:'add' as add_url %}
<a href="{% add_preserved_filters add_url is_popup to_field %}"
class="btn btn-primary btn-sm text-light">
<i class="fas fa-plus"></i>
{% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}
{% block search %}{% search_form cl %}{% endblock %}
<!-- -->
{% block object-tools %}
<div class=" d-flex flex-row-reverse just col-md-{% if cl.has_filters %}4{% else %}4{% endif %}">
{% if cl.has_filters %}
<span class="float-sm-right">
<a href="#"
class="btn btn-success btn-sm text-light ml-2 mr-1" data-toggle="collapse" data-target="#changelist-filter" aria-expanded="false" aria-controls="changelist-filter">
<i class="fas fa-filter"></i>
{% trans 'Filter' %}
</a>
</span>
{% endif %}
{% endif %}
{% block object-tools-items %}
{% if has_add_permission %}
<span class="float-sm-right">
{% url cl.opts|admin_urlname:'add' as add_url %}
<a href="{% add_preserved_filters add_url is_popup to_field %}"
class="btn btn-primary btn-sm text-light">
<i class="fas fa-plus"></i>
{% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}
</a>
</span>
{% endif %}
{% endblock %}
</div>
{% endblock %}

<form class="mt-2 col-md-12" 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 %}
{% if action_form and actions_on_top and cl.show_admin_actions %}{% admin_actions %}{% endif %}
{% result_list cl %}
{% if action_form and actions_on_bottom and cl.show_admin_actions %}{% admin_actions %}{% endif %}
{% endblock %}
</div>
{% endblock %}

</div>
<!-- -->
{% block date_hierarchy %}{% date_hierarchy cl %}{% endblock %}

{% block filters %}
{% if cl.has_filters %}
<div id="changelist-filter" class="collapse" >
<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 %}
{% if action_form and actions_on_top and cl.show_admin_actions %}{% admin_actions %}{% endif %}
{% result_list cl %}
{% if action_form and actions_on_bottom and cl.show_admin_actions %}{% admin_actions %}{% endif %}
{% block pagination %}{% pagination cl %}{% endblock %}
</form>

<!-- -->
{% block date_hierarchy %}{% date_hierarchy cl %}{% endblock %}

{% block filters %}
{% if cl.has_filters %}
<div id="changelist-filter" class="collapse mt-5" >
<h2>{% trans 'Filter' %}</h2>
{% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %}
</div>
{% endif %}
{% endblock %}
{% block pagination %}{% pagination cl %}{% endblock %}
</form>
</div>
</div>
</div>
{% endblock %}
Expand Down Expand Up @@ -158,6 +158,9 @@ <h2>{% trans 'Filter' %}</h2>
// so no data yet
}

$('.actions').children('.button').attr('class', 'btn btn-sm btn-primary')
$('.actions').children('select').attr('class', 'form-control')

});

</script>
Expand Down
2 changes: 1 addition & 1 deletion django_adminlte3/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"""
from django.contrib import admin
from django.urls import path
from django.conf.urls import url, include
from django.urls import re_path as url, include # Fix to upgrade django version > 3.0
from django.views.generic.base import TemplateView

urlpatterns = [
Expand Down