{% extends "base.html" %}
{% from 'bootstrap4/form.html' import render_form, render_field %}

{% block app_content %}
    <br>
    <h1> {{ title }} </h1>
    {% if display == 'list'  %}
    <br><br>
      <table class="table table-striped">
         <tr>
             <th> Name </th>
         </tr>
         {% for dict_item in mdb %}
         {% for key, value in dict_item.items() %}
         <tr> <td> <a href="{{url_for( 'main.entities', entities=subtype, id=key) }}">{{ value }}</a> </td> </tr>
         {% endfor %}
         {% endfor %}
       </table>
       <br><br>
    {% endif %}

    {% if display == 'list-by-model'  %}
    <br><br>
      <table class="table table-striped">
         <tr>
             <th> Name </th>
         </tr>
         {% for dict_item in mdb %}
         {% for key, value in dict_item.items() %}
         <tr> <td> <a href="{{url_for( 'main.entities', entities=subtype, id=key ) }}">{{ value }}</a> </td> </tr>
         {% endfor %}
         {% endfor %}
       </table>
       <br><br>
    {% endif %}

    {% if display == 'model'  %}
    <br><br>
      <table class="table table-striped">
         <tr>
             <th> Name </th>
         </tr>
         {% for item in mdb %}
         <tr> <td> <a href="{{url_for( 'main.entities', entities=subtype, name=item ) }}">{{ item }}</a> </td> </tr>
         {% endfor %}
       </table>
       <br><br>
    {% endif %}

{% endblock %}
