Add sticky action button option. (#110)

* Add sticky action button option.

* Add sticky_pagination field. Handle top submit row. Update Admin section

* Add sticky-pagination styles. Fix trailing whitespace issue in models.

* Update sticky pagination max-width
This commit is contained in:
Amir Ajorloo
2021-02-03 12:56:07 +03:30
committed by GitHub
parent fdbacba4bb
commit d1cda34a52
5 changed files with 79 additions and 1 deletions
@@ -52,7 +52,8 @@ https://github.com/fabiocaccamo/django-admin-interface
{% include "admin_interface/related-modal.html" %}
{% endblock %}
{% block bodyclass %}admin-interface flat-theme {% get_admin_interface_theme as theme %}{% if theme.name %}{{ theme.name|slugify }}-theme{% endif %}{% endblock %}
{% block bodyclass %}admin-interface flat-theme {% get_admin_interface_theme as theme %}{% if theme.name %}{{
theme.name|slugify }}-theme{% endif %}{% if theme.form_submit_sticky %} sticky-submit {% endif %}{% if theme.form_pagination_sticky %} sticky-pagination {% endif %}{% endblock %}
{% block branding %}
{% get_admin_interface_theme as theme %}
@@ -412,6 +412,25 @@ body.admin-interface .paginator a.showall:visited {
max-width: 100%;
}
.admin-interface.sticky-submit.change-form:not(.popup) #main > #nav-sidebar + .content,
.admin-interface.sticky-pagination.change-list:not(.popup) #main > #nav-sidebar + .content {
padding-bottom: 4rem;
}
.admin-interface.sticky-submit.change-form:not(.popup) #main > #nav-sidebar + .content form fieldset + .submit-row,
.admin-interface.sticky-pagination.change-list:not(.popup) #main > #nav-sidebar + .content form .results + .paginator {
width: 100%;
max-width: calc(100% - 28px);
bottom: 0;
right: 0;
margin-bottom: 0;
position: fixed;
}
.admin-interface.sticky-pagination.change-list:not(.popup) #main > #nav-sidebar + .content form .results + .paginator {
max-width: calc(100% - 20px);
}
/* hide nav-sidebar below 1280px to prevent horizontal overflow issues */
@media (max-width:1279px) {
.admin-interface #nav-sidebar,
@@ -449,6 +468,17 @@ body.admin-interface .paginator a.showall:visited {
.admin-interface.change-form:not(.popup) #main.shifted > #nav-sidebar + .content {
max-width: calc(100% - 360px);
}
.admin-interface.sticky-submit.change-form:not(.popup) #main.shifted > #nav-sidebar + .content form fieldset + .submit-row,
.admin-interface.sticky-pagination.change-list:not(.popup) #main.shifted > #nav-sidebar + .content form .results + .paginator {
max-width: calc(100% - 388px);
right: 0;
bottom: 0;
}
.admin-interface.sticky-pagination.change-list:not(.popup) #main.shifted > #nav-sidebar + .content form .results + .paginator {
max-width: calc(100% - 380px);
}
}
/* fixed related widget and select2 */
@@ -537,4 +567,14 @@ body.admin-interface .paginator a.showall:visited {
.admin-interface .aligned .form-row .file-upload input[type="file"] {
margin-top: 5px;
}
.admin-interface.sticky-submit.change-form:not(.popup) #main > #nav-sidebar + .content,
.admin-interface.sticky-pagination.change-form:not(.popup) #main > #nav-sidebar + .content {
padding-bottom: 12rem;
}
.admin-interface.sticky-submit.change-form:not(.popup) #main > #nav-sidebar + .content .submit-row,
.admin-interface.sticky-pagination.change-list:not(.popup) #main > #nav-sidebar + .content form .results + .paginator {
max-width: calc(100% - 20px);
}
}