{% extends "base.html" %}
{% block title %}{{ program.name }} &ndash; {{ project }}{% endblock title %}
{% block body %}
  {% import 'macros.html' as macros %}
  <div class="row">
    <h1>{{ program.name }} 
    <small>Program</small>
    {% if program.meta['deprecated'] and program.meta['deprecated'].lower() == 'true' %}
	 <span class="label label-danger depwarn">Deprecated</span>
    {% endif %}
    </h1>
	 {{ macros.info_bar(program.name,program.meta,project_url,program.hierarchy) }}    
  </div>
  
  <div class="row">
    <div class="col-lg-3">
    {{ macros.sidebar(project,program) }}
    </div>
    
    <div class="col-lg-9" id='text'>
    {{ macros.use_list(program) }}
    {{ program.usesgraph }}
    {% if program.usesgraph %}<br><br>{% endif %}
    {{ program.doc }}
    {% if program.callsgraph %}
     <h3>Calls</h3>
     {{ program.callsgraph }}
     {% endif %}
    {% if program.doc or program.callsgraph %}<br>{% endif %}

    {% if program.variables|length > 0 %}
    <section>
    <h2>Variables</h2>
    {{ macros.var_list(program.variables) }}
    </section>
    <br>
    {% endif %}
    
    {% if program.enums|length > 0 %}
    <section>
    <h2>Enumerations</h2>
    {% for enum in program.enums %}
      {{ macros.enum_entry(enum) }}
    {% endfor %}
    </section>
    <br>
    {% endif %}
    
    {% if program.interfaces|length > 0 %}
    <section>
	 <h2>Interfaces</h2>
	 {% for intr in program.interfaces %}
	   {{ macros.interface(intr) }}
    {% endfor %}
    </section>
	 <br>
    {% endif %}
    
    {% if program.absinterfaces|length > 0 %}
    <section>
	 <h2>Abstract Interfaces</h2>
	 {% for intr in program.absinterfaces %}
	   {{ macros.absinterface(intr) }}
    {% endfor %}
    </section>
	 <br>
    {% endif %}

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


    {% if program.subroutines|length > 0 %}
    <section>
    <h2>Subroutines</h2>
    {% for proc in program.subroutines %}
    {{ macros.proc_entry(proc) }}
    {% endfor %}
    </section>    
    {% endif %}
    
    {% if program.src %}
    <section>
    <h2 id="src">Source Code</h2>
    {{ program.src }}
    </section>
    {% endif %}
    
    </div>
  </div>
{% endblock body %}
