klein0r/affiliate-dashboard

View on GitHub
src/AffiliateDashboardBundle/Resources/views/Sale/index.html.twig

Summary

Maintainability
Test Coverage
{% extends 'base.html.twig' %}

{% block body %}
    <div class="page-header">
        <h1>{{ pagination.getTotalItemCount }} {% trans %}Sales{% endtrans %}</h1>
    </div>

    <table class="table table-hover table-condensed">
        <thead>
            <tr>
                <th>{% trans %}Asin{% endtrans %}</th>
                <th>{% trans %}Date{% endtrans %}</th>
                <th>{% trans %}Rate{% endtrans %}</th>
                <th>{% trans %}Qty{% endtrans %}</th>
                <th>{% trans %}Revenue{% endtrans %}</th>
                <th>{% trans %}Earnings{% endtrans %}</th>
                <th>{% trans %}Tag{% endtrans %}</th>
                <th>{% trans %}Title{% endtrans %}</th>
                <th>{% trans %}Actions{% endtrans %}</th>
            </tr>
        </thead>
        <tbody>
        {% for sale in pagination %}
            <tr class="{% if (sale.earnings > 0) %}success{% else %}danger{% endif %}">
                <td><a href="http://www.amazon.de/gp/product/{{ sale.asin }}" target="_blank">{{ sale.asin }}</a></td>
                <td>{% if sale.date %}{{ sale.date|localizeddate('medium', 'none') }}{% endif %}</td>
                <td>{{ sale.rate|localizednumber }}%</td>
                <td>{{ sale.qty|localizednumber }}</td>
                <td>{{ sale.revenue|localizedcurrency('EUR') }}</td>
                <td>{{ sale.earnings|localizedcurrency('EUR') }}</td>
                <td>{{ sale.affiliateTag.name }}</td>
                <td>{{ sale.title }}</td>
                <td>
                    <a class="btn btn-primary btn-sm" href="{{ path('sale_show', { 'id': sale.id }) }}">{% trans %}show{% endtrans %}</a>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

    <div class="navigation">
        {{ knp_pagination_render(pagination) }}
    </div>
{% endblock %}