Buttons on forms and lists made sticky to top/btn

This commit is contained in:
Pieter Lambrecht 2023-01-12 11:45:22 +01:00
parent 8d9e151030
commit bbb3dd180d
7 changed files with 44 additions and 5 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -174,6 +174,7 @@ span.profile-button .dropdown-menu {
margin-top: 0.5rem;
box-shadow: $box-shadow;
transition: opacity 0.2s ease-in-out;
z-index: 1005;
&:not(.show) {
pointer-events: none;
@ -1039,3 +1040,38 @@ html {
}
}
}
.sticky-bottom-content-p0 {
background-color: $tab-content-bg;
bottom: 0.05em;
z-index: 900;
}
.sticky-bottom-content-p1 {
background-color: $tab-content-bg;
bottom: 1.8em;
z-index: 900;
}
.sticky-bottom-table-p0 {
background-color: var(--nbx-select-content-bg);
bottom: 0.05em;
z-index: 900;
}
.sticky-bottom-table-p1 {
background-color: var(--nbx-select-content-bg);
bottom: 1.8em;
z-index: 900;
}
.sticky-top-table-p0 {
background-color: var(--nbx-select-content-bg);
top: 3.5em;
z-index: 900;
}
.sticky-top-table-p1 {
background-color: var(--nbx-select-content-bg);
top: 5.3em;
z-index: 900;
}

View File

@ -98,8 +98,7 @@ Context:
{% endif %}
{% endblock form %}
<div class="text-end my-3">
<div class="text-end my-3 position-sticky sticky-bottom-content-p0">
{% block buttons %}
{% if object.pk %}
<button type="submit" name="_update" class="btn btn-primary">

View File

@ -116,7 +116,7 @@ Context:
</div>
{# Form buttons #}
<div class="noprint bulk-buttons">
<div class="noprint bulk-buttons position-sticky sticky-bottom-content-p0">
<div class="bulk-button-group">
{% block bulk_buttons %}
{% if 'bulk_edit' in actions %}

View File

@ -4,10 +4,14 @@
{% with preferences|get_key:"pagination.placement" as paginator_placement %}
{% if paginator_placement == 'top' or paginator_placement == 'both' %}
<div class="position-sticky sticky-top-table-p0">
{% include 'inc/paginator_htmx.html' with paginator=table.paginator page=table.page %}
</div>
{% endif %}
{% render_table table 'inc/table_htmx.html' %}
{% if paginator_placement != 'top' %}
<div class="position-sticky sticky-bottom-table-p1">
{% include 'inc/paginator_htmx.html' with paginator=table.paginator page=table.page %}
</div>
{% endif %}
{% endwith %}