Fix help text horizontal alignment when using `show-fieldsets-as-tabs` / `show-inlines-as-tabs` theme options. #317
parent
f96acafd11
commit
3a37860af5
|
|
@ -1,3 +1,4 @@
|
|||
/* fix form submit buttons alignemnt and ordering */
|
||||
@media (min-width: 768px) {
|
||||
.admin-interface .submit-row {
|
||||
flex-direction: row-reverse;
|
||||
|
|
@ -17,3 +18,17 @@
|
|||
margin-right: auto;
|
||||
}
|
||||
}
|
||||
/* endfix */
|
||||
|
||||
/* fix help-text horizontal alignment when using show-fieldsets-as-tabs / show-inlines-as-tabs options - #317 */
|
||||
.admin-interface.show-fieldsets-as-tabs fieldset > .form-row .help,
|
||||
.admin-interface.show-inlines-as-tabs .inline-related > fieldset .help {
|
||||
margin-left: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
.admin-interface.show-fieldsets-as-tabs fieldset > .form-row div:has(.related-widget-wrapper .selector) + .help,
|
||||
.admin-interface.show-inlines-as-tabs .inline-related > fieldset div:has(.related-widget-wrapper .selector) + .help {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
/* endfix */
|
||||
|
|
|
|||
|
|
@ -147,6 +147,13 @@ admin-interface
|
|||
{% if theme.form_pagination_sticky %} sticky-pagination {% endif %}
|
||||
{% if theme.list_filter_highlight %} list-filter-highlight {% endif %}
|
||||
{% if theme.list_filter_sticky %} list-filter-sticky {% endif %}
|
||||
|
||||
{% admin_interface_use_changeform_tabs adminform inline_admin_formsets as admin_interface_use_changeform_tabs %}
|
||||
{% if admin_interface_use_changeform_tabs %}
|
||||
{% if theme.show_fieldsets_as_tabs %} show-fieldsets-as-tabs {% endif %}
|
||||
{% if theme.show_inlines_as_tabs %} show-inlines-as-tabs {% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if theme.collapsible_stacked_inlines %} collapsible-stacked-inlines
|
||||
{% if theme.collapsible_stacked_inlines_collapsed %} collapsible-stacked-inlines-collapsed {% endif %}
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -171,8 +171,12 @@ def admin_interface_date_hierarchy_removal_link(changelist, date_field_name):
|
|||
@register.simple_tag()
|
||||
def admin_interface_use_changeform_tabs(adminform, inline_forms):
|
||||
theme = get_admin_interface_theme()
|
||||
has_fieldset_tabs = theme.show_fieldsets_as_tabs and len(adminform.fieldsets) > 1
|
||||
has_inline_tabs = theme.show_inlines_as_tabs and len(inline_forms) > 0
|
||||
has_fieldset_tabs = (
|
||||
theme.show_fieldsets_as_tabs and adminform and len(adminform.fieldsets) > 1
|
||||
)
|
||||
has_inline_tabs = (
|
||||
theme.show_inlines_as_tabs and inline_forms and len(inline_forms) > 0
|
||||
)
|
||||
has_tabs = has_fieldset_tabs or has_inline_tabs
|
||||
return has_tabs
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue