various improvements on 3party

This commit is contained in:
2021-10-07 17:28:33 +02:00
parent 7ea2c36c5e
commit ca3ced0308
20 changed files with 464 additions and 305 deletions

View File

@@ -1,3 +1,6 @@
{% if form.civility is defined %}
{{ form_row(form.civility) }}
{% endif %}
@@ -19,6 +22,9 @@
{{ form_row(form.telephone) }}
{{ form_row(form.email) }}
<h2>{{ 'Contacts'|trans }}</h2>
{{ form_widget(form.children) }}
<div class="mb-3 row">
{{ form_label(form.address) }}
{{ form_widget(form.address) }}

View File

@@ -0,0 +1,35 @@
{% block _third_party_children_entry_widget %}
<div class="container">
<div class="row">
<div class="form-group col-md-3 mb-3">
{{ form_widget(form.civility) }}
{{ form_errors(form.civility) }}
{{ form_label(form.civility) }}
</div>
<div class="form-group col-md-5 mb-3">
{{ form_widget(form.name) }}
{{ form_errors(form.name) }}
{{ form_label(form.name) }}
</div>
<div class="form-group col-md-4 mb-3">
{{ form_widget(form.profession) }}
{{ form_errors(form.profession) }}
{{ form_label(form.profession) }}
</div>
</div>
<div class="row">
<div class="form-group col-md-6 mb-3">
{{ form_widget(form.telephone) }}
{{ form_errors(form.telephone) }}
{{ form_label(form.telephone) }}
</div>
<div class="form-group col-md-6 mb-3">
{{ form_widget(form.email) }}
{{ form_errors(form.email) }}
{{ form_label(form.email) }}
</div>
</div>
</div>
{% endblock %}

View File

@@ -57,7 +57,10 @@
{% for tp in third_parties %}
<tr>
<th>{{ (tp.active ? '<i class="fa fa-check chill-green">' : '<i class="fa fa-times chill-red">')|raw }}</th>
<td>{{ tp.name }}</td>
<td>
{{ tp.name }}
{% if tp.isChild %}<span class="badge bg-info">{{ 'Contact'|trans }}</span>{% endif %}
</td>
{% set types = [] %}
{% for t in tp.types %}
{% set types = types|merge( [ ('chill_3party.key_label.'~t)|trans ] ) %}
@@ -77,12 +80,14 @@
<ul class="record_actions">
{% if is_granted('CHILL_3PARTY_3PARTY_UPDATE', tp) %}
<li>
<a href="{{ chill_path_add_return_path('chill_crud_3party_3party_edit', { 'id': tp.id }) }}" class="btn btn-sm btn-update"></a>
<a href="{{ chill_path_add_return_path('chill_crud_3party_3party_edit',
{ 'id': (tp.isParent ? tp.id : tp.parent.id) }) }}" class="btn btn-sm btn-update"></a>
</li>
{% endif %}
{% if is_granted('CHILL_3PARTY_3PARTY_SHOW', tp) %}
<li>
<a href="{{ chill_path_add_return_path('chill_crud_3party_3party_view', { 'id': tp.id }) }}" class="btn btn-sm btn-show"></a>
<a href="{{ chill_path_add_return_path('chill_crud_3party_3party_view',
{ 'id': (tp.isParent ? tp.id : tp.parent.id) }) }}" class="btn btn-sm btn-show"></a>
</li>
{% endif %}
</ul>

View File

@@ -1,6 +1,7 @@
{% extends "@ChillMain/layout.html.twig" %}
{% set thirdParty = entity %}
{% form_theme form '@ChillThirdParty/ThirdParty/_form_thirdparty_children.html.twig' %}
{% block title 'Create third party'|trans %}

View File

@@ -1,6 +1,7 @@
{% extends "@ChillMain/layout.html.twig" %}
{% set thirdParty = entity %}
{% form_theme form '@ChillThirdParty/ThirdParty/_form_thirdparty_children.html.twig' %}
{% block title 'Update third party %name%'|trans({ '%name%': thirdParty.name }) %}