Add sticky action button option.
parent
ed25f0fdde
commit
41e50e358a
|
|
@ -121,6 +121,10 @@ class ThemeAdmin(admin.ModelAdmin):
|
||||||
'classes': ('wide', ),
|
'classes': ('wide', ),
|
||||||
'fields': ('recent_actions_visible', )
|
'fields': ('recent_actions_visible', )
|
||||||
}),
|
}),
|
||||||
|
(_('Action Buttons'), {
|
||||||
|
'classes': ('wide', ),
|
||||||
|
'fields': ('action_buttons_sticky', )
|
||||||
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
save_on_top = True
|
save_on_top = True
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
# Generated by Django 3.1.5 on 2021-01-22 11:04
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('admin_interface', '0018_theme_list_filter_sticky'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='theme',
|
||||||
|
name='action_buttons_sticky',
|
||||||
|
field=models.BooleanField(default=False, verbose_name='sticky position'),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
@ -299,6 +299,10 @@ class Theme(models.Model):
|
||||||
default=True,
|
default=True,
|
||||||
verbose_name=_('visible'))
|
verbose_name=_('visible'))
|
||||||
|
|
||||||
|
action_buttons_sticky = models.BooleanField(
|
||||||
|
default=False,
|
||||||
|
verbose_name=_('sticky position'))
|
||||||
|
|
||||||
def set_active(self):
|
def set_active(self):
|
||||||
self.active = True
|
self.active = True
|
||||||
self.save()
|
self.save()
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ https://github.com/fabiocaccamo/django-admin-interface
|
||||||
{% include "admin_interface/related-modal.html" %}
|
{% include "admin_interface/related-modal.html" %}
|
||||||
{% endblock %}
|
{% 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.action_buttons_sticky %} sticky-action-buttons {% endif %}{% endblock %}
|
||||||
|
|
||||||
{% block branding %}
|
{% block branding %}
|
||||||
{% get_admin_interface_theme as theme %}
|
{% get_admin_interface_theme as theme %}
|
||||||
|
|
|
||||||
|
|
@ -412,6 +412,19 @@ body.admin-interface .paginator a.showall:visited {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.admin-interface.sticky-action-buttons.change-form:not(.popup) #main > #nav-sidebar + .content {
|
||||||
|
padding-bottom: 4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-interface.sticky-action-buttons.change-form:not(.popup) #main > #nav-sidebar + .content .submit-row {
|
||||||
|
width: 100%;
|
||||||
|
max-width: calc(100% - 28px);
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
position: fixed;
|
||||||
|
}
|
||||||
|
|
||||||
/* hide nav-sidebar below 1280px to prevent horizontal overflow issues */
|
/* hide nav-sidebar below 1280px to prevent horizontal overflow issues */
|
||||||
@media (max-width:1279px) {
|
@media (max-width:1279px) {
|
||||||
.admin-interface #nav-sidebar,
|
.admin-interface #nav-sidebar,
|
||||||
|
|
@ -449,6 +462,12 @@ body.admin-interface .paginator a.showall:visited {
|
||||||
.admin-interface.change-form:not(.popup) #main.shifted > #nav-sidebar + .content {
|
.admin-interface.change-form:not(.popup) #main.shifted > #nav-sidebar + .content {
|
||||||
max-width: calc(100% - 360px);
|
max-width: calc(100% - 360px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.admin-interface.sticky-action-buttons.change-form:not(.popup) #main.shifted > #nav-sidebar + .content .submit-row {
|
||||||
|
max-width: calc(100% - 388px);
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fixed related widget and select2 */
|
/* fixed related widget and select2 */
|
||||||
|
|
@ -537,4 +556,12 @@ body.admin-interface .paginator a.showall:visited {
|
||||||
.admin-interface .aligned .form-row .file-upload input[type="file"] {
|
.admin-interface .aligned .form-row .file-upload input[type="file"] {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.admin-interface.sticky-action-buttons.change-form:not(.popup) #main > #nav-sidebar + .content {
|
||||||
|
padding-bottom: 12rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-interface.sticky-action-buttons.change-form:not(.popup) #main > #nav-sidebar + .content .submit-row {
|
||||||
|
max-width: calc(100% - 20px);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue