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

{% block admin_content %}
	{% embed '@ChillMain/CRUD/_index.html.twig' %}
        {% block table_entities_thead_tr %}
			<th>{{ 'Title'|trans }}</th>
			<th>{{ 'Available for users'|trans }}</th>
			<th>{{ 'Editable by users'|trans }}</th>
			<th>{{ 'Address required'|trans }}</th>
			<th>{{ 'Contact data'|trans }}</th>
			<th>{{ 'Active'|trans }}</th>
			<th>{{ 'Default for'|trans }}</th>
        {% endblock %}
        {% block table_entities_tbody %}
			{% for entity in entities %}
				<tr>
                    <td>{{ entity.title | localize_translatable_string }}</td>
					<td style="text-align:center;">
						{%- if entity.availableForUsers -%}
							<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.editableByUsers -%}
							<i class="fa fa-check-square-o"></i>
						{%- else -%}
							<i class="fa fa-square-o"></i>
						{%- endif -%}
					</td>
					<td>{{ entity.addressRequired|trans }}</td>
					<td>{{ entity.contactData|trans }}</td>
					<td style="text-align:center;">
						{%- if entity.active -%}
							<i class="fa fa-check-square-o"></i>
						{%- else -%}
							<i class="fa fa-square-o"></i>
						{%- endif -%}
					</td>
					<td>{{ entity.defaultFor|trans }}</td>
					<td>
						<ul class="record_actions">
							<li>
								<a href="{{ path('chill_crud_main_location_type_edit', { 'id': entity.id }) }}" class="btn btn-edit" title="{{ 'edit'|trans }}"></a>
							</li>
						</ul>
					</td>
				</tr>
			{% endfor %}
     {% endblock %}

        {% block actions_before %}
            <li class='cancel'>
                <a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
            </li>
        {% endblock %}
    {% endembed %}
{% endblock %}