Add border to rest of the tab space (#215)

* add border to rest of the tab space

* All tabs should be False

* slugify div ids

* bottom padding for horizontal

* do not show solo tabs

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* use properties over attribute

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* rename id to class

* scrollbar shenanigans

* rename tag

* wip : button weirdness in safari

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: vaz <vmohan@lenbox.io>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Vasanth
2022-11-30 15:33:59 +01:00
committed by GitHub
parent a76de04a8b
commit 07dcb77b88
5 changed files with 41 additions and 9 deletions
@@ -6,8 +6,9 @@
{% get_admin_interface_setting "show_fieldsets_as_tabs" as show_fieldsets_as_tabs %}
{% get_admin_interface_setting "show_inlines_as_tabs" as show_inlines_as_tabs %}
{% admin_interface_use_changeform_tabs adminform inline_admin_formsets as admin_interface_use_changeform_tabs %}
{% if not show_fieldsets_as_tabs and not show_inlines_as_tabs %}
{% if not admin_interface_use_changeform_tabs %}
{{block.super}}
@@ -17,7 +18,7 @@
{% if show_fieldsets_as_tabs %}
{% for fieldset in adminform %}
<button type="button" class="tabbed-changeform-tablinks {{ forloop.counter0|default:"active" }}" onclick="openTab(event, '{{fieldset.name}}')">
<button type="button" class="tabbed-changeform-tablinks {{ forloop.counter0|default:"active" }}" onclick="openTab(event, 'tab-{{fieldset.name|slugify}}')">
{{ fieldset.name|default_if_none:opts.verbose_name|capfirst}}
</button>
{% endfor %}
@@ -29,16 +30,18 @@
{% if show_inlines_as_tabs %}
{% for inline_admin_formset in inline_admin_formsets %}
<button type="button" class="tabbed-changeform-tablinks" onclick="openTab(event, '{{inline_admin_formset.opts.verbose_name_plural|capfirst}}')">
<button type="button" class="tabbed-changeform-tablinks" onclick="openTab(event, 'tab-{{inline_admin_formset.opts.verbose_name_plural|slugify}}')">
{{inline_admin_formset.opts.verbose_name_plural|capfirst}}
</button>
{% endfor %}
{% endif %}
<div class="tabbed-changeform-tabs-remaining-space"></div>
</div>
{% if show_fieldsets_as_tabs %}
{% for fieldset in adminform %}
<div id="{{fieldset.name}}" class="tabbed-changeform-tabcontent {{ forloop.counter0|default:"active" }}">
<div id="tab-{{fieldset.name|slugify}}" class="tabbed-changeform-tabcontent {{ forloop.counter0|default:"active" }}">
{% include "admin/includes/headerless_fieldset.html" %}
</div>
{% endfor %}
@@ -51,7 +54,7 @@
{% endif %}
{% for inline_admin_formset in inline_admin_formsets %}
<div id="{{inline_admin_formset.opts.verbose_name_plural|capfirst}}" class="tabbed-changeform-tabcontent">
<div id="tab-{{inline_admin_formset.opts.verbose_name_plural|slugify}}" class="tabbed-changeform-tabcontent">
{% get_admin_interface_inline_template inline_admin_formset.opts.template as inline_template %}
{% include inline_template %}
</div>