Files
centurion_erp/app/templates/content/section.html.j2
Jon 3f117f9d83 feat(base): create detail view templates
purpose is to aid in the development of a detail form

#22 #24 #226
2024-08-14 00:02:25 +09:30

94 lines
1.8 KiB
Django/Jinja

{% load json %}
{% load markdown %}
{% for section in tab.sections %}
{% if forloop.first %}
<h3>{{ tab.name }}</h3>
{% else %}
<hr />
<h3>{{ section.name }}</h3>
{% endif %}
<div style="align-items:flex-start; align-content: center; display: flexbox; width: 100%">
{% if section.layout == 'single' %}
{% for section_field in section.fields %}
{% for field in form %}
{% if field.name in section_field %}
{% include 'content/field.html.j2' %}
{% endif %}
{% endfor %}
{% endfor %}
{% elif section.layout == 'double' %}
{% if section.left %}
<div style="display: inline; width: 40%; margin: 30px;">
{% for section_field in section.left %}
{% for field in form %}
{% if field.name in section_field %}
{% include 'content/field.html.j2' %}
{% endif %}
{% endfor %}
{% endfor %}
</div>
{% endif %}
{% if section.right %}
<div style="display: inline; width: 40%; margin: 30px; text-align: left;">
{% for section_field in section.right %}
{% for field in form %}
{% if field.name in section_field %}
{% include 'content/field.html.j2' %}
{% endif %}
{% endfor %}
{% endfor %}
</div>
{% endif %}
{% endif %}
{% if forloop.first %}
{% if tab.edit_url %}
<div style="display:block;">
<input type="button" value="Edit" onclick="window.location='{{ tab.edit_url }}';">
</div>
{% endif %}
{% endif %}
</div>
{% endfor %}