{% extends "base.html" %}

{% block app_content %}
    <br>
    <h1> {{ title }}</h1>
    {% if display == 'detail'  %}
    <div class="float-right">
      <a href="{{url_for( 'main.entities', entities=subtype, id=mdb.id, format='json' ) }}" class="btn btn-outline-primary btn-sm"> Export JSON </a>
    </div>
    <br><br>
    <div>
      <h3> Details </h3>
      <div id="termDetail" name="termDetail" style="margin:20px; padding:20x">
      <table class="table-striped">
         <tr>
            <th style="width:300px"> Term Value </th> 
            <td style="width:300px"> <a href="{{url_for( 'main.entities', entities=subtype, id=mdb.id ) }}"> {{mdb.value}} </a>        </td>
       </tr>
         <tr>
             <th> Id </th> <td>{{mdb.id}} </td>
        </tr>
       <tr>
        <th> Origin Id </th> <td>{{mdb.origin_id}} </td>
   </tr>
   <tr>
       <th> Origin Definition </th> <td>{{mdb.origin_definition}} </td>
  </tr>
      </table>
      </div>
    </div>
{% block edit_functions %}
{% endblock edit_functions %}
    <br><br>
    <div>
        {% if mdb.has_origin %}
        <h3> Origin  </h3>
        <div id="valuesetDetail" name="valuesetDetail" style="margin:20px; padding:20x">

            <table  class="table-striped">
                <tr> <th style="width:300px"> Origin Name  </th>  
		<td style="width:300px">
		  <a href="{{url_for( 'main.entities', entities='origins',id=mdb.has_origin.id ) }}"> {{ mdb.has_origin.name }}</a> </td>
                </tr>
                <tr> 
                    <th>  Id </th>  
                    <td> {{ mdb.has_origin.id }} </td>
                </tr>
            </table>
            <br>
            </div>
        {% endif %}
    </div>

    {% endif %}
{% endblock %}
