{% extends "base.html" %}
{% block title %}{{ dtype.name }} &ndash; {{ project }} {% endblock title %}
{% block body %}
  {% import 'macros.html' as macros %}
  <div class="row">
    <h1>{{ dtype.name }}
    <small>Derived Type</small>
    {% if dtype.meta['deprecated'] and dtype.meta['deprecated'].lower() == 'true' %}
	 <span class="label label-danger depwarn">Deprecated</span>
    {% endif %}
    </h1>
	 {{ macros.info_bar(dtype.name,dtype.meta,project_url,dtype.hierarchy) }}    
  </div>
  
  <div class="row">
    <div class="col-lg-3">
    {{ macros.sidebar(project,dtype) }}
    </div>
    
    <div class="col-lg-9" id='text'>
    <h2>type{% if dtype.parobj == 'module' %}, {{ dtype.permission }}{% endif %}{% for attr in dtype.attributes%}, {{ attr }}{% endfor %}{% if dtype.extends %}, extends({{ dtype.extends }}){% endif %} :: {{ dtype.name }}{% if dtype.sequence%}<br>sequence{% endif %}</h2>
    {% if dtype.inhergraph %}
    {{ dtype.inhergraph }}
    <br><br>
    {% endif %}
    {{ dtype.doc }}
    {% if dtype.doc and not dtype.inherbygraph %}<br>{% endif %}
    {% if dtype.inherbygraph %}
    <h3>Inherited By</h3>
    {{ dtype.inherbygraph }}
    {% endif %}
    {% if dtype.variables|length > 0 %}
    <section>
    <h2>Components</h2>
    {{ macros.var_list(dtype.variables,permission=True) }}
    </section>
    <br>
    {% endif %}
    
    {% if dtype.constructor %}
	 <section>
	 <h2>Constructor</h2>
	   {% if dtype.constructor.obj == "interface" %}
	   {{ macros.interface(dtype.constructor) }}
	   {% elif dtype.constructor.obj == "subroutine" or dtype.constructor.obj == "function" %}
		  {% set obj = dtype.constructor %}
	     <div class="panel panel-default">
  		  <div class="panel-heading codesum"><span class="anchor" id="{{ obj.anchor }}"></span><h3>{{ macros.proc_line(obj) }}</h3></div>
	       <div class="panel-body">
          {{ macros.proc_summary(obj,False) }}
          </div>
        </div>
	   {% endif %}
	 </section>
	 <br>
    {% endif %}
    
    {% if dtype.finalprocs|length > 0 %}
    <section>
    <h2>Finalization Procedures</h2>
	   {% for proc in dtype.finalprocs %}
         {{ macros.final(proc) }}
       {% endfor %}  
    </section>
    <br>
    {% endif %}
    
    {% if dtype.boundprocs|length > 0 %} 
    <section>
    <h2>Type-Bound Procedures</h2>
    {% for bp in dtype.boundprocs %}
	   {{ macros.bound_info(bp) }}
    {% endfor %}
    </section>
    {% endif %}
    
    {% if dtype.src %}
    <section>
    <h2><span class="anchor" id="src"></span>Source Code</h2>
    {{ dtype.src }}
    </section>
    {% endif %}
    
    </div>
  </div>
{% endblock body %}
