{% extends 'base.html' %}

{% block content %}

<div class="row">
  {% for exercise in object_list %}
    <div class="col-md-4">

      <div class="alert alert-info exercise-box" style="{% if exercise.image %}background-image: url({{ exercise.image.url }});{% endif %}">
        <h2>{{ exercise.name }}</h2>

        <div class="description">
          <p>
            {% if exercise.description %}
              {{ exercise.description|truncatechars:50 }}
            {% else %}
            This exercise doesn't have a description yet!
            {% endif %}
          </p>
        </div>

        <table class="table">
          <tr>
            <td>In plans</td>
            <td class="text-xs-right">{{ exercise.plan_set.count }}</td>
          </tr>
          <tr>
            <td>Records</td>
            <td class="text-xs-right">{{ exercise.record_count }}</td>
          </tr>
        </table>

        <h3><a class="btn btn-primary" href="{% url 'admin:exercise_plan_change' exercise.pk %}" target="_blank">Edit</a></h3>

      </div>

    </div>
  {% endfor %}
</div>

{% endblock %}

{% extends 'base.html' %}

{% block content %}

<div class="row">
  {% for exercise in object_list %}
    <div class="col-md-4">

      <div class="alert alert-info exercise-box" style="{% if exercise.image %}background-size: 100%; background-image: url({{ exercise.image.url }});{% endif %}">
        <h2>{{ exercise.name }}</h2>

        <div class="description">
          <p>
            {% if exercise.description %}
              {{ exercise.description|truncatechars:50 }}
            {% else %}
            This exercise doesn't have a description yet!
            {% endif %}
          </p>
        </div>

        <table class="table">
          <tr>
            <td>In plans</td>
            <td class="text-xs-right">{{ exercise.plan_set.count }}</td>
          </tr>
          <tr>
            <td>Records</td>
            <td class="text-xs-right">{{ exercise.record_count }}</td>
          </tr>
        </table>

        <h3><a class="btn btn-primary" href="{% url 'admin:exercise_plan_change' exercise.pk %}" target="_blank">Edit</a></h3>

      </div>

    </div>
  {% endfor %}
</div>

{% endblock %}

Scale backgrounds on exercise list to fit
Scale backgrounds on exercise list to fit
