2019-06-11 11:49:27 +02:00

62 lines
2.4 KiB
Twig

{% extends "@ChillMain/layout.html.twig" %}
{% block title 'List of third parties'|trans %}
{% block content %}
<div class="grid-10 centered">
<h1>{{ 'List of third parties'|trans }}</h1>
{% if third_parties|length == 0 %}
<p class="chill-no-data-statement">{{ 'No third parties'|trans }}</p>
{% else %}
<table>
<thead>
<tr>
<th>{{ 'Name'|trans }}</th>
<th>{{ 'Active'|trans }}</th>
<th>{{ 'type'|trans }}</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for tp in third_parties %}
<tr>
<td>{{ tp.name }}</td>
<td>{{ (tp.active ? '<i class="fa fa-check-square-o">' : '<i class="fa fa-square-o">')|raw }}</td>
{% set types = [] %}
{% for t in tp.type %}
{% set types = types|merge( [ ('chill_3party.key_label.'~t)|trans ] ) %}
{% endfor %}
<td>{{ types|join(', ') }}</td>
<td>
<ul class="record_actions">
{% if is_granted('CHILL_3PARTY_3PARTY_UPDATE', tp) %}
<li>
<a href="{{ chill_path_add_return_path('chill_3party_3party_update', { 'thirdparty_id': tp.id }) }}" class="sc-button bt-update"></a>
</li>
{% endif %}
{% if is_granted('CHILL_3PARTY_3PARTY_SHOW', tp) %}
<li>
<a href="{{ chill_path_add_return_path('chill_3party_3party_show', { 'thirdparty_id': tp.id }) }}" class="sc-button bt-show"></a>
</li>
{% endif %}
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% if is_granted('CHILL_3PARTY_3PARTY_CREATE') %}
<ul class="record_actions">
<li>
<a href="{{ chill_path_add_return_path('chill_3party_3party_new') }}" class="sc-button bt-create">
{{ "New third party"|trans }}
</a>
{% endif %}
</div>
{% endblock %}