{% extends "AevitasLevisBundle:Backend:root.html.twig" %}

{% block breadcrumb %}
<ul class="breadcrumb">
    <li><a class="glyphicons home" href="/backend"><i></i> BACKEND</a></li>
    <li class="divider"></li>
    <li>Group List</li>
</ul>
{% endblock %}

{% block content %}
                {% for flashMessage in app.session.flashbag.get('notice') %}
<div class="alert alert-faded">
    <button type="button" class="close" data-dismiss="alert">×</button>
                        {{ flashMessage }}
</div>
<div class="separator line bottom"></div>
                {% endfor %}
<div class="control-group">
    <a href="{{ path('backend_customer_code_create') }}"><span class="btn btn-large color-4">Add new customer codes</span></a>
</div>
<div class="separator"></div>
<table aria-describedby="DataTables_Table_0_info" id="DataTables_Table_0" class="dynamicTable table table-striped table-bordered table-condensed dataTable">
    <thead>
        <tr role="row" style="color:#0F0">
            <th aria-label="Browser: activate to sort column ascending" style="width: 300px;" colspan="1" rowspan="1" aria-controls="DataTables_Table_0" tabindex="0" role="columnheader" class="sorting">Store</th>
            <th aria-label="Platform(s): activate to sort column ascending" style="width: 200px;" colspan="1" rowspan="1" aria-controls="DataTables_Table_0" tabindex="0" role="columnheader" class="sorting">Prefix</th>
            <th aria-label="Eng. vers.: activate to sort column ascending" colspan="1" rowspan="1" aria-controls="DataTables_Table_0" tabindex="0" role="columnheader" class="sorting">Start</th>
            <th aria-label="Eng. vers.: activate to sort column ascending" colspan="1" rowspan="1" aria-controls="DataTables_Table_0" tabindex="0" role="columnheader" class="sorting">End</th>
            <th aria-label="Eng. vers.: activate to sort column ascending" colspan="1" rowspan="1" aria-controls="DataTables_Table_0" tabindex="0" role="columnheader" class="sorting">Used</th>
            <th aria-label="Rendering eng.: activate to sort column descending" aria-sort="ascending" style="width: 60px;" colspan="1" rowspan="1" aria-controls="DataTables_Table_0" tabindex="0" role="columnheader" class="sorting_asc"></th>
    </thead>

    <tbody aria-relevant="all" aria-live="polite" role="alert">
            {% for code in codes %}
            <tr class="gradeA odd">
                <td class=" ">{{ code.store.name }}</td>
                <td class=" ">{{ code.prefix }}</td>
                <td class=" ">{{ code.start }}</td>
                <td class=" ">{{ code.end }}</td>
                <td class=" ">{{ code.getUsed }}</td>
                <td>
                    <a href="{{ path('backend_customer_code_download',{'id':code.id}) }}" class="glyphicons no-js create"><i></i>Download</a>
                    <br/><a href="{{ path('backend_customer_code_edit',{'id':code.id}) }}" class="glyphicons no-js edit"><i></i>Edit</a>
                    <br/><a href="javascript:if(confirm('Are you sure want to delete this row?')){window.location='{{ path('backend_customer_code_delete',{'id':code.id}) }}'}" class="glyphicons no-js delete"><i></i>delete</a>
                </td>
            </tr>
            {% endfor %}
    </tbody>
</table>

{% endblock %}

{% block javascript %}

{% endblock %}