

{% extends 'admin/base.html' %}

{% load i18n widget_tweaks %}


{% block title %}
    {% trans 'Services' %} | {% now 'd.m.Y' %}
{% endblock %}


{% block content %}

    {{ block.super }}

    <style>
        .category-header {
            background-color: #333333 !important;
            color: #fff !important;
            font-size: 18px !important;
        }

        @media print {
            td.category-header {
                background-color: #333333 !important;
                color: #fff !important;
                font-size: 18px !important;
            }
        }
    </style>

    <h4 class="pull-left">
        {% trans 'Services' %}
        <small>
            {% now 'd.m.Y' %}
        </small>
    </h4>

    <button class="btn btn-primary pull-right print-btn" onClick="window.print();">
        {% trans 'Print' %}
    </button>

    <div class="clearfix"></div>

    <table class="table table-bordered table-condensed">
        {% for category in request.services.get_categories %}
            <tr>
                <td class="category-header" colspan="3">{{ category.name }}</td>
            </tr>
            {% for item in category.items.all %}
                <tr>
                    <td>{{ item.code }}</td>
                    <td>{{ item.name }}</td>
                    <td>{% trans 'from' %} {{ item.price }} грн</td>
                </tr>
            {% endfor %}
        {% endfor %}
    </table>
{% endblock %}
