{% load i18n %}
<div class="panel panel-default">
  <div class="panel-heading">
    <span class="btn btn-default btn-xs infobtn pull-right" data-container="body" title="{% trans "Start VMs for a group." %}">
      <i class="fa fa-info-circle"></i>
    </span>
    <h3 class="no-margin"><i class="fa fa-file-text-o"></i> {% trans "Exams" %}
    </h3>
  </div>
  <div class="list-group" id="exam-list-view">
    <div id="dashboard-exam-list">
      {% for exam in exams %}
      <a href="{% url "dashboard.views.exam-detail" pk=exam.pk %}" class="list-group-item
        {% if forloop.last and exams|length < 5 %} list-exam-item-last{% endif %}">
        <span class="index-exam-list-name">
          <i class="fa"></i> {{ exam.name }}
        </span>
        <div class="clearfix"></div>
      </a>
      {% empty %}
        <div class="list-group-item">
          <div class="alert alert-warning" style="margin: 10px;">
            <p>
              {% trans "You don't have any exams prepared." %}
            </p>
          </div>
        </div>
      {% endfor %}
    </div>
    <div class="list-group-item list-group-footer">
      <div class="row">
        <div class="col-xs-5 col-sm-6">
          <form action="{% url "dashboard.views.exam-list" %}" method="GET" id="dashboard-exam-search-form">
            <div class="input-group input-group-sm">
              <input name="s" type="text" class="form-control" placeholder="{% trans "Search..." %}" />
              <div class="input-group-btn">
                <button type="submit" class="btn btn-primary"><i class="fa fa-search"></i></button>
              </div>
            </div>
          </form>
        </div>
        <div class="col-xs-7 col-sm-6 text-right">
          <a href="{% url "dashboard.views.exam-list" %}" class="btn btn-primary btn-xs">
            <i class="fa fa-chevron-circle-right"></i>
            {% if more_exams > 0 %}
              <strong>{{ more_exams }}</strong>  more
            {% else %}
              {% trans "list" %}
            {% endif %}
          </a>
          {% if perms.exam.create_exam %}
          <a href="{% url "dashboard.views.exam-create" %}" class="btn btn-success btn-xs exam-create">
            <i class="fa fa-plus-circle"></i> {% trans "new" %}
          </a>
          {% endif %}
        </div>
      </div>
    </div>
  </div>
</div>
