Skip to content

Commit 5df0ee8

Browse files
authored
fix: template layout without constance config (#1522)
1 parent 83233b0 commit 5df0ee8

File tree

2 files changed

+31
-29
lines changed

2 files changed

+31
-29
lines changed

src/unfold/contrib/constance/templates/admin/constance/change_list.html

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,30 @@
2222
{{ field }}
2323
{% endfor %}
2424

25-
{% if fieldsets %}
26-
<div class="border border-base-200 rounded-default overflow-x-auto simplebar-horizontal-scrollbar-top dark:border-base-800" data-simplebar data-simplebar-auto-hide="false">
27-
<table class="w-full border-collapse">
25+
<div class="border border-base-200 rounded-default overflow-x-auto simplebar-horizontal-scrollbar-top dark:border-base-800" data-simplebar data-simplebar-auto-hide="false">
26+
<table class="w-full border-collapse">
27+
{% if fieldsets %}
2828
{% for fieldset in fieldsets %}
2929
{% with config_values=fieldset.config_values %}
3030
{% include "admin/constance/includes/results_list.html" %}
3131
{% endwith %}
3232
{% endfor %}
33+
{% else %}
34+
{% include "admin/constance/includes/results_list.html" %}
35+
{% endif %}
3336

34-
<tfoot>
35-
<tr>
36-
<td class="border-t border-base-200 px-3 py-2 dark:border-base-800" colspan="100%">
37-
<div class="flex justify-end">
38-
{% trans "Save" as title %}
39-
{% include "unfold/helpers/submit.html" with title=title %}
40-
</div>
41-
</td>
42-
</tr>
43-
</tfoot>
44-
</table>
45-
</div>
46-
{% else %}
47-
{% include "admin/constance/includes/results_list.html" %}
48-
{% endif %}
37+
<tfoot>
38+
<tr>
39+
<td class="border-t border-base-200 px-3 py-2 dark:border-base-800" colspan="100%">
40+
<div class="flex justify-end">
41+
{% trans "Save" as title %}
42+
{% include "unfold/helpers/submit.html" with title=title %}
43+
</div>
44+
</td>
45+
</tr>
46+
</tfoot>
47+
</table>
48+
</div>
4949
</form>
5050
</div>
5151
</div>

src/unfold/contrib/constance/templates/admin/constance/includes/results_list.html

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
{% load admin_list static i18n %}
22

33
<tbody {% if fieldset.collapse %} x-data="{ rowsOpen: false }" {% endif %}>
4-
<tr {% if fieldset.collapse %} x-on:click="rowsOpen = !rowsOpen" {% endif %} class="{% if fieldset.collapse %}cursor-pointer{% endif %}">
5-
<th class="bg-base-50 border-t border-base-200 font-semibold px-3 py-2 text-left text-font-important-light dark:text-font-important-dark dark:border-base-800 dark:bg-white/[.04] {% if forloop.first %}border-t-0{% endif %}" colspan="100%">
6-
{{ fieldset.title }}
4+
{% if fieldset.title %}
5+
<tr {% if fieldset.collapse %} x-on:click="rowsOpen = !rowsOpen" {% endif %} class="{% if fieldset.collapse %}cursor-pointer{% endif %}">
6+
<th class="bg-base-50 border-t border-base-200 font-semibold px-3 py-2 text-left text-font-important-light dark:text-font-important-dark dark:border-base-800 dark:bg-white/[.04] {% if forloop.first %}border-t-0{% endif %}" colspan="100%">
7+
{{ fieldset.title }}
78

8-
{% if fieldset.collapse %}
9-
<span class="material-symbols-outlined float-right select-none transition-all" title="{% trans "Collapse" %}" x-bind:class="rowsOpen ? 'rotate-180' : ''">
10-
expand_more
11-
</span>
12-
{% endif %}
13-
</th>
14-
</tr>
9+
{% if fieldset.collapse %}
10+
<span class="material-symbols-outlined float-right select-none transition-all" title="{% trans "Collapse" %}" x-bind:class="rowsOpen ? 'rotate-180' : ''">
11+
expand_more
12+
</span>
13+
{% endif %}
14+
</th>
15+
</tr>
16+
{% endif %}
1517

16-
<tr class="border-t border-base-200 dark:border-base-800 *:font-semibold *:px-3 *:py-2 *:text-left *:text-font-important-light dark:*:text-font-important-dark" {% if fieldset.collapse %}x-show="rowsOpen"{% endif %}>
18+
<tr class="{% if fieldset.title %}border-t{% endif %} border-base-200 dark:border-base-800 *:font-semibold *:px-3 *:py-2 *:text-left *:text-font-important-light dark:*:text-font-important-dark" {% if fieldset.collapse %}x-show="rowsOpen"{% endif %}>
1719
<th>{% trans "Name" %}</th>
1820
<th>{% trans "Value" %}</th>
1921
<th>{% trans "Default" %}</th>

0 commit comments

Comments
 (0)