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/index.html.tera

51 lines
1.0 KiB

{% extends "layout" %}
{% import "form_macros" as form %}
{% block title -%}
Form
{%- endblock title %}
{% block content -%}
<form action="/add" method="POST" class="Form">
<div class="Row indented">
<h1>New Record</h1>
</div>
{%- for field in fields %}
<!-- {{ field.key }} -->
<div class="Row">
{%- if field.kind == "string" -%}
{{ form::text(field=field) }}
{%- elif field.kind == "text" -%}
{{ form::longtext(field=field) }}
{%- elif field.kind == "number" -%}
{{ form::number(field=field) }}
{%- elif field.kind == "bool" -%}
{{ form::checkbox(field=field) }}
{%- elif field.kind == "select" -%}
{{ form::select(field=field) }}
{%- elif field.kind == "free_select" -%}
{{ form::free_select(field=field) }}
{%- elif field.kind == "tags" -%}
{{ form::tags(field=field) }}
{%- elif field.kind == "free_tags" -%}
{{ form::free_tags(field=field) }}
{%- else -%}
{{ field.key }}
{%- endif -%}
</div>
{%- endfor %}
<div class="Row indented">
<button type="submit">Add</button>
</div>
</form>
{%- endblock content %}