Skip to content

Commit 23d8714

Browse files
authored
fix: switch help text (#444)
1 parent 12f41c3 commit 23d8714

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

src/unfold/static/unfold/css/styles.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/unfold/templates/admin/includes/fieldset.html

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,18 @@ <h2 class="bg-gray-100 border border-transparent font-semibold mb-6 px-4 py-3 ro
1919
{% for field in line %}
2020
<div class="flex group {% if field.errors %}errors {% endif %}{% if not line.fields|length == 1 %}lg:max-w-xs w-full {% endif %}{% if not forloop.parentloop.last %} mb-6 {% else %} mb-3{% endif %} {% if row %}flex-row items-center{% else %}flex-col{% endif %}">
2121
{% if field.is_checkbox %}
22-
<div class="flex flex-row items-center">
23-
{{ field.field }}{{ field.label_tag }}
22+
<div class="flex flex-row">
23+
{{ field.field }}
24+
25+
<div class="flex flex-col">
26+
{{ field.label_tag }}
27+
28+
{% if field.field.help_text %}
29+
<div class="ml-2 -mt-1">
30+
{% include "unfold/helpers/help_text.html" with help_text=field.field.help_text %}
31+
</div>
32+
{% endif %}
33+
</div>
2434
</div>
2535
{% else %}
2636
<div class="{% if row %} w-48{% endif %}">
@@ -40,7 +50,7 @@ <h2 class="bg-gray-100 border border-transparent font-semibold mb-6 px-4 py-3 ro
4050
</span>
4151
{% endif %}
4252

43-
{% if field.field.help_text %}
53+
{% if field.field.help_text and not field.is_checkbox %}
4454
{% include "unfold/helpers/help_text.html" with help_text=field.field.help_text %}
4555
{% endif %}
4656
</div>

src/unfold/templates/unfold/helpers/display_header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<span class="flex gap-4 items-center">
22
{% if value.3 and value.3.path %}
3-
<span class="bg-center bg-cover bg-white flex font-medium justify-center overflow-hidden dark:bg-gray-900 dark:border-gray-700 {% if value.3.squared %}rounded-sm{% else %}rounded-full{% endif %}{% if not value.3.borderless %} border{% endif %}{% if not value.3.width or not value.3.height %}h-8 max-w-8 min-w-8{% endif %}">
3+
<span class="bg-center bg-cover bg-white flex font-medium justify-center overflow-hidden dark:bg-gray-900 dark:border-gray-700 {% if value.3.squared %}rounded-sm{% else %}rounded-full{% endif %}{% if not value.3.borderless %} border{% endif %}{% if not value.3.width or not value.3.height %} h-8 max-w-8 min-w-8{% endif %}">
44
<img loading="lazy" src="{{ value.3.path }}" class="object-cover" {% if value.3.width %}width="{{ value.3.width }}"{% endif %} {% if value.3.height %}height="{{ value.3.height }}"{% endif %}/>
55
</span>
66
{% elif value.2 %}

0 commit comments

Comments
 (0)