{% load staticfiles %}

<!DOCTYPE html>
<html>
<head>
    <title>Imperial Painter</title>
    <link rel="stylesheet" href="{% static "styles/layout.css" %}">
    <link rel="stylesheet" href="{% static "styles/custom.css" %}">
</head>

<body>
    <table class="spoiler">
        <tr>
            {% for object in object_list %}
                <td id="card-{{ forloop.counter }}" class="card-cell">
                    {% include 'painter/card_wrapper.html' %}
                </td>

                {% if forloop.counter|divisibleby:3 %}
                    </tr>
                    {% if forloop.counter|divisibleby:9 %}
                        </table>
                        <div class="page-break"></div>
                        <table class="spoiler">
                    {% endif %}
                    <tr>
                {% endif %}
            {% endfor %}
        </tr>
    </table>
</body>
</html>

{% load staticfiles %}

<!DOCTYPE html>
<html>
<head>
    <title>Imperial Painter</title>
    <link rel="stylesheet" href="{% static "styles/layout.css" %}">
    <link rel="stylesheet" href="{% static "styles/custom.css" %}">
</head>

<body>
    <table class="spoiler">
        <tr>
            {% cycle False False True as linebreak silent %}
            {% cycle False False True as pagebreak silent %}

            {% for object in object_list %}
                {% cycle linebreak %}

                {% with object.data.quantity|default:1 as quantity %}
                    {% with '1'|rjust:quantity as num_copies %}
                        {% for i in num_copies %}
                            <td class="card-cell">
                                {% include 'painter/card_wrapper.html' %}
                            </td>
                        {% endfor %}
                    {% endwith %}
                {% endwith %}

                {% if linebreak %}
                    </tr>
                    {% if pagebreak %}
                        </table>
                        <div class="page-break"></div>
                        <table class="spoiler">
                    {% endif %}
                    <tr>

                    {% cycle pagebreak %}
                {% endif %}
            {% endfor %}
        </tr>
    </table>
</body>
</html>

Implement quantity purely in the template.
Implement quantity purely in the template.
