Merge branch 'feature/input-labels' into 'main'

show input labels in default case

See merge request PhilippHofer/rot!8
This commit is contained in:
PhilippHofer 2023-04-28 19:47:00 +00:00
commit 2730687d97
3 changed files with 9 additions and 7 deletions

View File

@ -14,10 +14,10 @@
<input type="hidden" name="remember" value="true"> <input type="hidden" name="remember" value="true">
<div class="-space-y-px rounded-md shadow-sm"> <div class="-space-y-px rounded-md shadow-sm">
<div> <div>
{{ macros::input(label='Name', name='name', type='input', required=true, class='rounded-t-md') }} {{ macros::input(label='Name', name='name', type='input', required=true, class='rounded-t-md',hide_label=true) }}
</div> </div>
<div> <div>
{{ macros::input(label='Passwort', name='password', type='password', class='rounded-b-md') }} {{ macros::input(label='Passwort', name='password', type='password', class='rounded-b-md',hide_label=true) }}
</div> </div>
</div> </div>

View File

@ -9,10 +9,10 @@
<input type="hidden" name="userid" value="{{ userid }}" /> <input type="hidden" name="userid" value="{{ userid }}" />
<div class="-space-y-px rounded-md shadow-sm"> <div class="-space-y-px rounded-md shadow-sm">
<div> <div>
{{ macros::input(label='Passwort', name='password', type='password', required=true, class='rounded-t-md') }} {{ macros::input(label='Passwort', name='password', type='password', required=true, class='rounded-t-md',hide_label=true) }}
</div> </div>
<div> <div>
{{ macros::input(label='Passwort bestätigen', name='password_confirm', type='password', required=true, class='rounded-b-md') }} {{ macros::input(label='Passwort bestätigen', name='password_confirm', type='password', required=true, class='rounded-b-md',hide_label=true) }}
</div> </div>
</div> </div>

View File

@ -24,9 +24,11 @@
<div class="h-8"></div> <div class="h-8"></div>
{% endmacro header %} {% endmacro header %}
{% macro input(label, name, type, required=false, class='rounded-md', value='', min='') %} {% macro input(label, name, type, required=false, class='rounded-md', value='', min='', hide_label=false) %}
<label for="{{ name }}" class="sr-only">{{ label }}</label> <div>
<input id="{{ name }}" name="{{ name }}" type="{{ type }}" {% if required %} required {% endif %} value="{{ value }}" class="input {{ class }}" placeholder="{{ label }}" {% if min %} min="{{ min }}" {% endif %}> <label for="{{ name }}" class="{% if hide_label %} sr-only {% else %} small text-gray-600 {% endif %}">{{ label }}</label>
<input id="{{ name }}" name="{{ name }}" type="{{ type }}" {% if required %} required {% endif %} value="{{ value }}" class="input {{ class }}" placeholder="{% if hide_label %}{{ label }}{% endif %}" {% if min %} min="{{ min }}" {% endif %}>
</div>
{% endmacro input %} {% endmacro input %}
{% macro checkbox(label, name, id='', checked=false) %} {% macro checkbox(label, name, id='', checked=false) %}