diff --git a/templates/auth/login.html.tera b/templates/auth/login.html.tera index f16fe0c..86bc354 100644 --- a/templates/auth/login.html.tera +++ b/templates/auth/login.html.tera @@ -14,10 +14,10 @@ <input type="hidden" name="remember" value="true"> <div class="-space-y-px rounded-md shadow-sm"> <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> - {{ 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> diff --git a/templates/auth/set-pw.html.tera b/templates/auth/set-pw.html.tera index 1670f97..93d5582 100644 --- a/templates/auth/set-pw.html.tera +++ b/templates/auth/set-pw.html.tera @@ -9,10 +9,10 @@ <input type="hidden" name="userid" value="{{ userid }}" /> <div class="-space-y-px rounded-md shadow-sm"> <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> - {{ 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> diff --git a/templates/includes/macros.html.tera b/templates/includes/macros.html.tera index d3757b5..99f8b63 100644 --- a/templates/includes/macros.html.tera +++ b/templates/includes/macros.html.tera @@ -24,9 +24,11 @@ <div class="h-8"></div> {% endmacro header %} -{% macro input(label, name, type, required=false, class='rounded-md', value='', min='') %} - <label for="{{ name }}" class="sr-only">{{ label }}</label> - <input id="{{ name }}" name="{{ name }}" type="{{ type }}" {% if required %} required {% endif %} value="{{ value }}" class="input {{ class }}" placeholder="{{ label }}" {% if min %} min="{{ min }}" {% endif %}> +{% macro input(label, name, type, required=false, class='rounded-md', value='', min='', hide_label=false) %} +<div> + <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 %} {% macro checkbox(label, name, id='', checked=false) %}