{% extends "/__admin_templates/base.html" %} {% block content %}

{{ db_nice_name }}

{{ title }}

{% if can_create %} {% endif %}
{% if all_data and len(all_data["items"])>0 and columns %}
{# columns can be strings or objects with .key and optional .label #} {% for col in columns %} {% if col not in model.exclude_from_table() %} {% set col_key = (col.key if col is not string and col.key is defined else col) %} {% if model.form_labels_map().get(col.key if col is not string and col.key is defined else col) %} {% else %} {% set col_label = ( col.label if col is not string and col.label is defined else (col_key | replace('_',' ') | title) ) %} {% endif %} {% endif %} {% endfor %} {% for row in all_data["items"] %} {% for col in columns %} {% set col_key = (col.key if col is not string and col.key is defined else col) %} {% if col_key not in model.exclude_from_table() %} {% set value = attribute(row, col_key) %} {% endif %} {% endfor %} {% endfor %}
Actions{{ model.form_labels_map().get(col_key) }}{{ col_label }}
{% if can_update %} {% endif %} {% if can_delete %} {% endif %} {% if not can_update and not can_delete %} No actions available {% endif %} {% if value is boolean %} {{ "Yes" if value else "No" }} {% elif value is none %} {% else %} {{ value }} {% endif %}
{% else %}
No data available.
{% endif %}
{% if all_data["pages"] > 1 %}
{% endif %} {% if can_delete %}

Are you sure you wish to delete the record?

{% endif %} {% if can_create %}
{% for field_id, field in model_form.items() %} {% if field_id not in model.exclude_from_create_form() %}
{% if model.form_labels_map().get(field_id) %} {% else %} {{ field.label(class="form-label") | safe }} {% endif %} {% if field.type == "BooleanField" %} {{ field(class="form-check-input dashboard-input") }} {% elif field.type == "TagsField" %} {{ field(class="dashboard-input") }} {% elif field.type == "TextAreaField" %} {{ field(class="form-control dashboard-input") }} {% elif field.type == "SelectField" %} {{ field(class="form-select dashboard-input") }} {% elif field.type == "DateField" %} {% elif field.type == "DateTimeField" %} {% else %} {{ field(class="form-control mb-2 dashboard-input") }} {% endif %}
{% endif %} {% endfor %}
{% endif %}
{% for field_id, field in model_form.items() %} {% if field_id not in model.exclude_from_update_form() %}
{% if model.form_labels_map().get(field_id) %} {% else %} {{ field.label(class="form-label") | safe }} {% endif %} {% if field.type == "BooleanField" %} {{ field(class="form-check-input dashboard-input") }} {% elif field.type == "TagsField" %} {{ field(class="dashboard-input") }} {% elif field.type == "TextAreaField" %} {{ field(class="form-control dashboard-input") }} {% elif field.type == "SelectField" %} {{ field(class="form-select dashboard-input") }} {% elif field.type == "DateField" %} {% elif field.type == "DateTimeField" %} {% else %} {{ field(class="form-control mb-2 dashboard-input") }} {% endif %}
{% endif %} {% endfor %}
{% endblock %}