actix-admin/templates/show.html

31 lines
1.0 KiB
HTML
Raw Normal View History

2022-09-06 10:21:07 +02:00
{% extends "base.html" %}
{% block content %}
{% for model_field in view_model.fields -%}
<div class="columns">
<div class="column">
<p class="title is-5">{{ model_field.field_name | split(pat="_") | join(sep=" ") | title }}</p>
<p>
{% if model_field.field_type == "Checkbox" %}
<td>{{ model.values | get(key=model_field.field_name) | get_icon | safe }}</td>
2022-12-29 19:56:20 +01:00
{% elif model_field.field_type == "FileUpload" %}
2023-01-11 20:30:33 +01:00
<td><a href="file/{{ view_model.primary_key }}/{{ model_field.field_name }}">{{ model.values | get(key=model_field.field_name) }}</a></td>
2022-09-06 10:21:07 +02:00
{% else %}
<td>{{ model.values | get(key=model_field.field_name) }}</td>
{% endif %}
</p>
</div>
</div>
{%- endfor %}
<div class="columns">
<div class="column">
<div class="field is-grouped">
<div class="control">
2022-12-29 19:56:20 +01:00
<a class="button is-link is-light" href="{{ base_path }}/list">Back</a>
2022-09-06 10:21:07 +02:00
</div>
</div>
</div>
</div>
{% endblock content %}