{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}

{% block title %}{{ 'admin.motive.list.title'|trans }}{% endblock title %}

{% block admin_content %}

    <h1>{{ 'admin.motive.list.title'|trans }}</h1>

	<table class="records_list table table-bordered border-dark">
		<thead>
			<tr>
				<th>{{ 'Label'|trans }}</th>
				<th>{{ 'Active'|trans }}</th>
                <th>{{ 'emergency?'|trans }}</th>
                <th>{{ 'Ordering'|trans }}</th>
                <th>{{ 'Supplementary comments'|trans }}</th>
                <th>&nbsp;</th>
			</tr>
		</thead>
		<tbody>
			{% for entity in entities %}
				<tr>
					<td>{{ entity.label|localize_translatable_string }}</td>
					<td style="text-align:center;">
						{%- if entity.isActive -%}
							<i class="fa fa-check-square-o"></i>
						{%- else -%}
							<i class="fa fa-square-o"></i>
						{%- endif -%}
					</td>
                    <td style="text-align:center;">
                        {%- if entity.makeTicketEmergency -%}
                            {{ entity.makeTicketEmergency.value|trans }}
                        {%- else -%}
                            -
                        {%- endif -%}
                    </td>
                    <td style="text-align:center;">
                        {{ entity.ordering }}
                    </td>
                    <td style="text-align:center;">
                        {{ entity.supplementaryComments|length }}
                    </td>
                    <td>
						<ul class="record_actions">
							<li>
								<a href="{{ path('chill_crud_motive_view', { 'id': entity.id }) }}" class="btn btn-show" title="{{ 'show'|trans }}"></a>
							</li>
							<li>
								<a href="{{ path('chill_crud_motive_edit', { 'id': entity.id }) }}" class="btn btn-edit" title="{{ 'edit'|trans }}"></a>
							</li>
						</ul>
					</td>
				</tr>
			{% endfor %}
		</tbody>
	</table>

    {{ chill_pagination(paginator) }}

	<ul class="record_actions sticky-form-buttons">
		<li>
			<a href="{{ path('chill_crud_motive_new') }}" class="btn btn-create">
				{{ 'admin.motive.new.title'|trans }}
			</a>
		</li>
	</ul>
{% endblock %}
