{% load utils i18n %}
<html>
<head>
    <title>{% block title %}Account service report{% endblock %}</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    {% block head %}{% endblock %}
    <style type="text/css">
        body {
            max-width: 670px;
            margin: 20 auto !important;
            float: none !important;
            font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;
            font-size: 12px;
            color: #444;
        }
        #date {
            float: right;
            color: rgb(102, 102, 102);
        }
        .account-content {
            margin: 0px 0px 40px 20px;
        }
        .item-title {
            list-style-type: none;
            font-weight: bold;
            color: #666;
        }
        .items-ul {
            padding: 0px;
            margin: 5px 0px 10px 20px;
        }
        .related {
            list-style: disc;
        }
        hr {
            margin-top: -9px;
        }
        a {
            text-decoration: none;
            color: rgb(91, 128, 178);
        }
    </style>
</head>

<body>
<div id="date">{% trans "Service report generated on" %} {{ date | date }}</div>
{% for account, items in accounts %}
    <h3>{{ account.get_full_name }} - <a href="{{ account|admin_url }}">{{ account.username }}</a></h3>
    <hr>
    <div class="account-content">
        {{ account.get_type_display }} {% trans "account registered on" %} {{ account.date_joined | date }}<br>
        <ul class="items-ul">
        {% for opts, related in items %}
            <li class="item-title">{{ opts.verbose_name_plural|capfirst }}</li>
            <ul>
            {% for obj in related %}
                <li class="related"><a href="{{ obj|admin_url }}">{{ obj }}</a>
                    {% if not obj|isactive %} ({% trans "disabled" %}){% endif %}
                    {{ obj.get_description|capfirst }}
                </li>
            {% endfor %}
            </ul>
        {% endfor %}
        </ul>
    </div>
{% endfor %}
</body>
</html>
