{% extends "base.html" %}
{% block title %}{{ module.name }} &ndash; {{ project }}{% endblock title %}
{% block body %}
  {% import 'macros.html' as macros %}
  <div class="row">
    <h1>{{ module.name }} 
    <small>{% if module.obj == 'submodule' %}Submodule{% else %}Module{% endif %}</small>
    {% if module.meta['deprecated'] and module.meta['deprecated'].lower() == 'true' %}
	 <span class="label label-danger depwarn">Deprecated</span>
    {% endif %}
    </h1>
	 {{ macros.info_bar(module.name,module.meta,project_url,module.hierarchy) }}    
  </div>
  
  <div class="row">
    <div class="col-lg-3">
    {{ macros.sidebar(project,module) }}
    </div>
    
    <div class="col-lg-9" id='text'>
    {% if module.obj == 'submodule' %}{{ macros.ancestry(module) }}{% endif %}
    {{ macros.use_list(module) }}
    {{ module.usesgraph }}
    {% if module.descendants|length > 0 %}{{ macros.descendants(module) }}{% endif %}
    {{ module.doc }}
    {% if module.doc and not module.usedbygraph %}<br>{% endif %}
    {% if module.usedbygraph %}
    <h3>Used By</h3>
    {{ module.usedbygraph }}
    <br>
    {% endif %}

    {% if module.variables|length > 0 %}
    <section>
    <h2>Variables</h2>
    {{ macros.var_list(module.variables,permission=True) }}
    </section>
    <br>
    {% endif %}
    
    {% if module.enums|length > 0 %}
    <section>
    <h2>Enumerations</h2>
    {% for enum in module.enums %}
      {{ macros.enum_entry(enum) }}
    {% endfor %}
    </section>
    <br>
    {% endif %}
    
    {% if module.interfaces|length > 0 %}
    <section>
	 <h2>Interfaces</h2>
	 {% for intr in module.interfaces %}
	   {{ macros.interface(intr) }}
    {% endfor %}
    </section>
	<br>
    {% endif %}

    {% if module.absinterfaces|length > 0 %}
    <section>
     <h2>Abstract Interfaces</h2>
	 {% for intr in module.absinterfaces %}
	   {{ macros.absinterface(intr) }}
    {% endfor %}
    </section>
	<br>
    {% endif %}
    
    {% if module.types|length > 0 %}
    <section>
     <h2>Derived Types</h2>
	 {% for type in module.types %}
	   {{ macros.type_summary(type) }}
     {% endfor %}
    </section>
	<br>
    {% endif %}
    
    {% if module.functions|length > 0 %} 
    <section>
    <h2>Functions</h2>
    {% for proc in module.functions %}
    {{ macros.proc_entry(proc) }}
    {% endfor %}
    </section>
    <br>
    {% endif %}

    {% if module.subroutines|length > 0 %}
    <section>
    <h2>Subroutines</h2>
    {% for proc in module.subroutines %}
    {{ macros.proc_entry(proc) }}
    {% endfor %}
    </section>    
    <br>
    {% endif %}
    
    {% if  module.obj == 'submodule' %}
    
        {% if module.modfunctions|length > 0 %} 
        <section>
        <h2>Module Functions</h2>
        {% for proc in module.modfunctions %}
        {{ macros.proc_entry(proc) }}
        {% endfor %}
        </section>
        <br>
        {% endif %}

        {% if module.modsubroutines|length > 0 %}
        <section>
        <h2>Module Subroutines</h2>
        {% for proc in module.modsubroutines %}
        {{ macros.proc_entry(proc) }}
        {% endfor %}
        </section>
        <br>
        {% endif %}

        {% if module.modprocedures|length > 0 %}
        <section>
        <h2>Module Procedures</h2>
        {% for proc in module.modprocedures %}
        {{ macros.proc_entry(proc) }}
        {% endfor %}
        </section>    
        {% endif %}
    
    {% endif %}
    </div>
  </div>
{% endblock body %}
