first draft layout logbook

This commit is contained in:
2023-07-30 13:42:33 +02:00
parent e49279afef
commit 039df224a6
4 changed files with 64 additions and 47 deletions

View File

@ -42,24 +42,24 @@
<div class="h-8"></div>
{% endmacro header %}
{% macro input(label, name, type, required=false, class='rounded-md', value='', min='', hide_label=false, id='', autofocus=false) %}
<div>
{% macro input(label, name, type, required=false, class='rounded-md', value='', min='', hide_label=false, id='', autofocus=false, wrapper_class='') %}
<div class="{{wrapper_class}}">
<label for="{{ name }}" class="{% if hide_label %} sr-only {% else %} small text-gray-600 {% endif %}">{{ label }}</label>
<input {% if id %} id="{{ id }}" {% else %} id="{{ name }}" {% endif %} name="{{ name }}" type="{{ type }}" {% if required %} required {% endif %} value="{{ value }}" class="input {{ class }}" placeholder="{% if hide_label %}{{ label }}{% endif %}" {% if min %} min="{{ min }}" {% endif %}{% if autofocus %}autofocus {% endif %}>
</div>
{% endmacro input %}
{% macro checkbox(label, name, id='', checked=false) %}
<label for="{{ name }}{{ id }}" class="flex items-center cursor-pointer hover:text-gray-900">
{% macro checkbox(label, name, id='', checked=false, class='') %}
<label for="{{ name }}{{ id }}" class="flex items-center cursor-pointer hover:text-gray-900 {{ class }}">
<input type="checkbox" id="{{ name }}{{ id }}" name="{{ name }}" {% if checked %} checked {% endif %} class="h-4 w-4 accent-primary-600 mr-2"/> {{ label }}
</label>
{% endmacro checkbox %}
{% macro select(data, select_name='trip_type', default='', selected_id='', display='', extras='') %}
{% macro select(data, select_name='trip_type', default='', selected_id='', display='', extras='', class='') %}
{% if display == '' %}
{% set display = ["name"] %}
{% endif %}
<select name="{{ select_name }}" id="{{ select_name }}" class="input rounded-md h-10">
<select name="{{ select_name }}" id="{{ select_name }}" class="input rounded-md h-10 {{ class }}">
{% if default %}
<option selected value>{{ default }}</option>
{% endif %}