{%- extends "base.html" %}

{% import "bootstrap/utils.html" as utils %}

{% block content %}
  <div class="container">
    {%- with messages = get_flashed_messages(with_categories=True) %}
    {%- if messages %}
      <div class="row">
        <div class="col-md-12">
          {{utils.flashed_messages(messages)}}
        </div>
      </div>
    {%- endif %}
    {%- endwith %}

    {%- for load in loads %}
      <div class="panel {{ 'panel-success' if load.load > 0 else 'panel-danger' }}">
        <div class="panel-heading">
          <div class="pull-right">{{ load.load }}</div>
          Teaching load: {{ load.name }}
        </div>

        <div class="panel-body">
          <table class="table table-striped">
            <thead>
              <tr>
                <th>Instructor</th>
                <th>Start</th>
                <th>End</th>
                <th>Validated</th>
              </tr>
            </thead>
            <tbody>
              {%- for l in load.with_load %}
                <tr>
                  <td>{{ l.instructor.name }}</td>
                  <td>{{ l.start }}</td>
                  <td>{{ l.end }}</td>
                  <td>{{ l.validated }}</td>
                </tr>
              {%- endfor %}
            </tbody>
          </table>
        </div>
      </div>
    {%- endfor %}
  </div>
{%- endblock %}

{%- extends "base.html" %}

{% import "bootstrap/utils.html" as utils %}

{% block content %}
  <div class="container">
    {%- with messages = get_flashed_messages(with_categories=True) %}
    {%- if messages %}
      <div class="row">
        <div class="col-md-12">
          {{utils.flashed_messages(messages)}}
        </div>
      </div>
    {%- endif %}
    {%- endwith %}

    <h2 class="page-header">Teaching loads</h2>

    {%- for load in loads %}
      <div class="col-md-6">
        <div class="panel {{ 'panel-success' if load.load > 0 else 'panel-danger' }}">
          <div class="panel-heading">
            <div class="pull-right">{{ load.load }}</div>
            {{ load.name }}
          </div>

          <div class="panel-body">
            <table class="table table-striped">
              <thead>
                <tr>
                  <th>Instructor</th>
                  <th>Start</th>
                  <th>End</th>
                  <th>Val</th>
                </tr>
              </thead>
              <tbody>
                {%- for l in load.with_load %}
                  <tr>
                    <td>{{ l.instructor.name }}</td>
                    <td>{{ l.start }}</td>
                    <td>{{ l.end }}</td>
                    <td>{{ l.validated }}</td>
                  </tr>
                {%- endfor %}
              </tbody>
            </table>
          </div>
        </div>
      </div>
    {%- endfor %}
  </div>
{%- endblock %}

Improve display of teaching loads.
Improve display of teaching loads.

Let more than one load fit in each row.