{% extends "app_home/base_print.html" %}
{% load static %}
{% load i18n %}


{% block title %}
<h2>
    <i class="fa {{ schema.icon }}"></i>
    &nbsp; {{ schema.displayname }} : {{ instance.displayname|default:instance.keyname }}
</h2>
<small class="text-muted">{{ instance.id }} </small>
<hr>
{% endblock %}


{% block content %}

<table class="table table-bordered table-sm">

        <tr class="table-success"><td colspan="2">
            <strong>{{ schema.displayname }} / {{ instance.keyname }}</strong></td></tr>

        {% if schema.keyname_mode == "edit" %}
        <tr><td class="table-light" width="30%">{{ schema.keyname_label }}</td>
        <td>{{ instance.keyname }}</td></tr>
        {% endif %}
        
        <tr><td class="table-light" width="30%">{{ schema.displayname_label }}</td>
        <td>{{ instance.displayname }}</td></tr>

        <tr><td class="table-light" width="30%">{% translate 'Is Enabled' %}</td>
        <td>{% if instance.is_enabled %}<i class="fa fa-check"></i>{% endif %}
        </td></tr>

</table>

<hr>

{% for page,pageitems in instance.PAGES.items %}
<table class="table table-bordered table-sm">
    <tr class="table-primary">
        <td colspan="2">
            <strong>{{page}}</strong>
        </td>
    </tr>
    {%  for order,orderitems in pageitems.items %}{% for item in orderitems %}<tr>
    <td class="table-light" width="30%">
        {{ item.displayname }}
    </td>
    <td>
        {% include 'app_data/fields/_datapoint_print.html' %}
    </td>
    </tr>{% endfor %}{% endfor %}
</table>
{%  endfor %}

{% endblock %}
