Update object list view

This commit is contained in:
Jeremy Stretch 2023-12-29 19:24:49 -05:00
parent ecb6347c02
commit 0a03a7ed74
4 changed files with 30 additions and 32 deletions

View File

@ -115,7 +115,7 @@ Blocks:
<div class="page-wrapper"> <div class="page-wrapper">
{# Page header #} {# Page header #}
<div class="page-header d-print-none"> <div class="page-header mt-2 d-print-none">
<div class="container-xl"> <div class="container-xl">
{% if config.BANNER_TOP %} {% if config.BANNER_TOP %}
@ -139,17 +139,18 @@ Blocks:
{% endif %} {% endif %}
{% block header %} {% block header %}
<div class="title-container px-3 pb-3"> <div class="row align-items-center">
{# Title #} {# Title #}
<div id="content-title"> <div class="col">
{# Center-align title in object-edit views #} <h2 class="page-title">{% block title %}{% endblock title %}</h2>
<h1 class="h2 w-100">{% block title %}{% endblock title %}</h1>
{% block subtitle %}{% endblock %} {% block subtitle %}{% endblock %}
</div> </div>
{# Controls #} {# Controls #}
{% block controls %}{% endblock controls %} <div class="col-auto ms-auto d-print-none">
{% block controls %}{% endblock controls %}
</div>
</div> </div>
{% endblock header %} {% endblock header %}
@ -161,10 +162,9 @@ Blocks:
<div class="page-body"> <div class="page-body">
<div class="container-xl"> <div class="container-xl">
{% block tabs %}{% endblock %} {% block tabs %}{% endblock %}
{# TODO: Remove content-wrapper block #}
{% block content-wrapper %} {% block content-wrapper %}
<div class="px-3">
{% block content %}{% endblock %} {% block content %}{% endblock %}
</div>
{% endblock %} {% endblock %}
{# Bottom banner #} {# Bottom banner #}
{% if config.BANNER_BOTTOM %} {% if config.BANNER_BOTTOM %}

View File

@ -24,29 +24,27 @@ Context:
{% block title %}{{ model|meta:"verbose_name_plural"|bettertitle }}{% endblock %} {% block title %}{{ model|meta:"verbose_name_plural"|bettertitle }}{% endblock %}
{% block controls %} {% block controls %}
<div class="controls"> <div class="btn-list">
<div class="control-group"> {% plugin_list_buttons model %}
{% plugin_list_buttons model %} {% block extra_controls %}{% endblock %}
{% block extra_controls %}{% endblock %} {% if 'add' in actions %}
{% if 'add' in actions %} {% add_button model %}
{% add_button model %} {% endif %}
{% endif %} {% if 'import' in actions %}
{% if 'import' in actions %} {% import_button model %}
{% import_button model %} {% endif %}
{% endif %} {% if 'export' in actions %}
{% if 'export' in actions %} {% export_button model %}
{% export_button model %} {% endif %}
{% endif %}
</div>
</div> </div>
{% endblock controls %} {% endblock controls %}
{% block tabs %} {% block tabs %}
<ul class="nav nav-tabs px-3"> <ul class="nav nav-tabs page-header-tabs px-3 mb-2" role="tablist">
<li class="nav-item" role="presentation"> <li class="nav-item" role="presentation">
<button class="nav-link active" id="object-list-tab" data-bs-toggle="tab" data-bs-target="#object-list" type="button" role="tab" aria-controls="edit-form" aria-selected="true"> <a class="nav-link active" id="object-list-tab" data-bs-toggle="tab" data-bs-target="#object-list" type="button" role="tab" aria-controls="edit-form" aria-selected="true">
{% trans "Results" %} {% badge table.page.paginator.count %} {% trans "Results" %} {% badge table.page.paginator.count %}
</button> </a>
</li> </li>
{% if filter_form %} {% if filter_form %}
<li class="nav-item" role="presentation"> <li class="nav-item" role="presentation">
@ -77,7 +75,7 @@ Context:
{% csrf_token %} {% csrf_token %}
{# "Select all" form #} {# "Select all" form #}
{% if table.paginator.num_pages > 1 %} {% if table.paginator.num_pages > 1 %}
<div id="select-all-box" class="d-none card noprint"> <div id="select-all-box" class="d-none card d-print-none">
<div class="form col-md-12"> <div class="form col-md-12">
<div class="card-body"> <div class="card-body">
<div class="float-end"> <div class="float-end">
@ -112,13 +110,13 @@ Context:
{% endif %} {% endif %}
<div class="card"> <div class="card">
<div class="card-body htmx-container table-responsive" id="object_list"> <div class="card-body htmx-container table-responsive p-1" id="object_list">
{% include 'htmx/table.html' %} {% include 'htmx/table.html' %}
</div> </div>
</div> </div>
{# Form buttons #} {# Form buttons #}
<div class="noprint bulk-buttons"> <div class="bulk-buttons mt-2 d-print-none">
<div class="bulk-button-group"> <div class="bulk-button-group">
{% block bulk_buttons %} {% block bulk_buttons %}
{% if 'bulk_edit' in actions %} {% if 'bulk_edit' in actions %}

View File

@ -3,7 +3,7 @@
<div class="row mb-3"> <div class="row mb-3">
<div class="col-auto table-controls noprint"> <div class="col-auto table-controls noprint">
<div class="input-group input-group-sm me-2 quicksearch hide-last-child"> <div class="input-group me-2 quicksearch hide-last-child">
<input type="search" results="5" name="q" id="quicksearch" class="form-control" placeholder="Quick search" <input type="search" results="5" name="q" id="quicksearch" class="form-control" placeholder="Quick search"
hx-get="{{ request.full_path }}" hx-target="#object_list" hx-trigger="keyup changed delay:500ms, search" /> hx-get="{{ request.full_path }}" hx-target="#object_list" hx-trigger="keyup changed delay:500ms, search" />
<button class="btn bg-transparent" type="button" id="quicksearch_clear"><i class="mdi mdi-close-circle"></i></button> <button class="btn bg-transparent" type="button" id="quicksearch_clear"><i class="mdi mdi-close-circle"></i></button>
@ -12,9 +12,9 @@
</div> </div>
<div class="col-auto ms-auto table-controls noprint"> <div class="col-auto ms-auto table-controls noprint">
{% if request.user.is_authenticated and table_modal %} {% if request.user.is_authenticated and table_modal %}
<div class="table-configure input-group input-group-sm"> <div class="table-configure input-group">
<button type="button" data-bs-toggle="modal" title="{% trans "Configure Table" %}" data-bs-target="#{{ table_modal }}" <button type="button" data-bs-toggle="modal" title="{% trans "Configure Table" %}" data-bs-target="#{{ table_modal }}"
class="btn btn-sm btn-outline-dark"> class="btn">
<i class="mdi mdi-cog"></i> {% trans "Configure Table" %} <i class="mdi mdi-cog"></i> {% trans "Configure Table" %}
</button> </button>
</div> </div>

View File

@ -1 +1 @@
{% if value or show_empty %}<span class="badge bg-{{ bg_color }}">{{ value }}</span>{% endif %} {% if value or show_empty %}<span class="badge text-bg-{{ bg_color }}">{{ value }}</span>{% endif %}