Flat file database editor and browser with web interface
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
rocket-inv/templates/form_macros.html.tera

67 lines
1.5 KiB

{% macro text(field) %}
<label for="field-{{field.key}}">
{{field.label}}
</label>
<input id="field-{{field.key}}"
name="{{field.key}}"
type="text"
value="{{field.value}}">
{% endmacro %}
{% macro longtext(field) %}
<label for="field-{{field.key}}">
{{field.label}}
</label>
<textarea id="field-{{field.key}}" name="{{field.key}}">{{field.value}}</textarea>
{% endmacro %}
{% macro free_select(field) %}
<label for="field-{{field.key}}">
{{field.label}}
</label>
<input id="field-{{field.key}}"
name="{{field.key}}"
type="text"
list="suggestions-{{field.key}}"
value="{{field.value}}">
<datalist id="suggestions-{{field.key}}">
{% for option in field.options %}
<option value="{{option}}">
{% endfor %}
</datalist>
{% endmacro %}
{% macro number(field) %}
<label for="field-{{field.key}}">
{{field.label}}
</label>
<input id="field-{{field.key}}"
name="{{field.key}}"
type="number"
value="{{field.value}}"
step="{{field.step}}"
min="{{field.min}}"
max="{{field.max}}">
{% endmacro %}
{% macro checkbox(field) %}
<label for="field-{{field.key}}">
{{field.label}}
</label>
<input id="field-{{field.key}}"
name="{{field.key}}"
type="checkbox"
{% if field.checked %}checked{% endif %}>
{% endmacro %}
{% macro select(field) %}
<label for="field-{{field.key}}">
{{field.label}}
</label>
<select id="field-{{field.key}}" name="{{field.key}}">
{% for option in field.options %}
<option value="{{option}}">{{option}}</option>
{% endfor %}
</select>
{% endmacro %}