Skip to content

Commit 95b41da

Browse files
committed
auto password hash and add help_text in inputs
1 parent 064ecee commit 95b41da

File tree

7 files changed

+37
-1
lines changed

7 files changed

+37
-1
lines changed

fastapi_admin/templates/widgets/inputs/input.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,9 @@
22
<label class="form-label">{{ label }}</label>
33
<input {% if not null %}required{% endif %} type="{{ input_type }}" class="form-control" name="{{ name }}"
44
placeholder="{{ placeholder }}" {% if disabled %}disabled{% endif %} value="{{ value }}">
5+
{% if help_text %}
6+
<small class="form-hint">
7+
{{ help_text }}
8+
</small>
9+
{% endif %}
510
</div>

fastapi_admin/templates/widgets/inputs/json.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jsoneditor@9.4.0/dist/jsoneditor.min.css">
33
<div class="form-label">{{ label }}</div>
44
<div id="{{ name }}" class="form-group mb-3"></div>
5+
{% if help_text %}
6+
<small class="form-hint">
7+
{{ help_text }}
8+
</small>
9+
{% endif %}
510
<input {% if not null %}required{% endif %} type="text" name="{{ name }}" value='{{ value|safe }}' hidden>
611
<style>
712
.jsoneditor {

fastapi_admin/templates/widgets/inputs/many_to_many.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
<div class="form-label">{{ label }}</div>
44
<select multiple class="form-select" name="{{ name }}" id="{{ id }}">
55
</select>
6+
{% if help_text %}
7+
<small class="form-hint">
8+
{{ help_text }}
9+
</small>
10+
{% endif %}
611
</div>
712
<script>
813
new Choices(el = document.getElementById('{{ id }}'), {

fastapi_admin/templates/widgets/inputs/radio.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,9 @@
88
<span class="form-check-label">{{ option[0] }}</span>
99
</label>
1010
{% endfor %}
11+
{% if help_text %}
12+
<small class="form-hint">
13+
{{ help_text }}
14+
</small>
15+
{% endif %}
1116
</div>

fastapi_admin/templates/widgets/inputs/select.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,9 @@
1010
</select>
1111
</div>
1212
{% include "components/select.html" %}
13+
{% if help_text %}
14+
<small class="form-hint">
15+
{{ help_text }}
16+
</small>
17+
{% endif %}
1318
{% endwith %}

fastapi_admin/templates/widgets/inputs/switch.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,10 @@
66
{% endif %} {% if disabled %}
77
disabled
88
{% endif %} >
9+
{% if help_text %}
10+
<small class="form-hint">
11+
{{ help_text }}
12+
</small>
13+
{% endif %}
914
</label>
1015
</div>
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
<div class="form-group mb-3">
22
<label class="form-label">{{ label }}</label>
3-
<textarea {% if not null %}required{% endif %} class="form-control" name="{{ name }}" placeholder="{{ placeholder }}"
3+
<textarea {% if not null %}required{% endif %} class="form-control" name="{{ name }}"
4+
placeholder="{{ placeholder }}"
45
{% if disabled %}disabled{% endif %}>
56
{{ value }}
67
</textarea>
8+
{% if help_text %}
9+
<small class="form-hint">
10+
{{ help_text }}
11+
</small>
12+
{% endif %}
713
</div>

0 commit comments

Comments
 (0)