17 lines
2.1 KiB
HTML
17 lines
2.1 KiB
HTML
{% extends 'base.html' %}{% block content %}
|
|
<h1>{% if category %}{{ t('categories.edit') }}{% else %}{{ t('categories.create') }}{% endif %}</h1>
|
|
<form method="post" enctype="multipart/form-data">
|
|
<label>{{ t('common.name') }}<input name="name" value="{{category.name if category else ''}}" required></label>
|
|
<label>{{ t('common.description') }}<textarea name="description">{{category.description if category and category.description else ''}}</textarea></label>
|
|
<label>{{ t('categories.image') }}<input type="file" name="image" accept="image/*"></label>
|
|
<h2>{{ t('categories.fields_title') }}</h2>
|
|
<p class="muted">Labels, descriptions, data types and read-only settings are managed centrally under Settings → Fields.</p>
|
|
<table class="data-table"><thead><tr><th>{{ t('common.active') }}</th><th>{{ t('categories.database_field') }}</th><th>{{ t('categories.display_name') }}</th><th>{{ t('categories.required') }}</th><th>{{ t('categories.in_list') }}</th><th>{{ t('categories.readonly') }}</th></tr></thead><tbody>
|
|
{% for definition in definitions %}{% set cfg=selected_fields.get(definition.field_name) %}
|
|
<tr><td><input class="checkbox" type="checkbox" name="active_{{definition.id}}" {% if (cfg and cfg.active) or definition.field_name == 'name' %}checked{% endif %}{% if definition.field_name == 'name' %} disabled{% endif %}></td>
|
|
<td><code>{{definition.field_name}}</code></td><td><strong>{{ t(definition.translation_key, definition.label) }}</strong>{% if definition.description %}<div class="muted">{{definition.description}}</div>{% endif %}</td>
|
|
<td><input class="checkbox" type="checkbox" name="required_{{definition.id}}" {% if (cfg and cfg.required) or definition.field_name == 'name' %}checked{% endif %}{% if definition.readonly or definition.field_name == 'name' %} disabled{% endif %}></td>
|
|
<td><input class="checkbox" type="checkbox" name="list_{{definition.id}}" {% if (cfg and cfg.show_in_list) or definition.field_name == 'name' %}checked{% endif %}></td>
|
|
<td>{{ t('common.yes') if definition.readonly else t('common.no') }}</td></tr>{% endfor %}</tbody></table>
|
|
<button>💾 {{ t('common.save') }}</button></form>{% endblock %}
|