adapt thirdparty templates

This commit is contained in:
Mathieu Jaumotte 2021-07-16 17:01:32 +02:00
parent 1e626d573f
commit 25b00296ca
6 changed files with 157 additions and 122 deletions

View File

@ -2,6 +2,7 @@
namespace Chill\ThirdPartyBundle\Form; namespace Chill\ThirdPartyBundle\Form;
use Chill\MainBundle\Form\Type\ChillTextareaType;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
@ -69,7 +70,7 @@ class ThirdPartyType extends AbstractType
->add('email', EmailType::class, [ ->add('email', EmailType::class, [
'required' => false 'required' => false
]) ])
->add('comment', TextareaType::class, [ ->add('comment', ChillTextareaType::class, [
'required' => false 'required' => false
]) ])
->add('type', ChoiceType::class, [ ->add('type', ChoiceType::class, [

View File

@ -15,6 +15,7 @@
<nav class="filter-actions border border-secondary my-4 p-3"> <nav class="filter-actions border border-secondary my-4 p-3">
filter nav filter nav
{{ dump() }}
</nav> </nav>
</div> </div>

View File

@ -3,7 +3,10 @@
{% block title 'Create third party'|trans %} {% block title 'Create third party'|trans %}
{% block content %} {% block content %}
<div class="col-10 centered"> <div class="thirdparty-new my-5">
<div class="row justify-content-center">
<div class="col-md-10 col-xxl">
<h1>{{ 'Create third party'|trans }}</h1> <h1>{{ 'Create third party'|trans }}</h1>
{{ form_start(form) }} {{ form_start(form) }}
@ -30,5 +33,8 @@
</ul> </ul>
{{ form_end(form) }} {{ form_end(form) }}
</div>
</div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -7,10 +7,16 @@
{% block title title_ %} {% block title title_ %}
{% block content %} {% block content %}
<div class="col-10 centered"> <div class="thirdparty-show my-5">
<div class="row justify-content-center">
<div class="col-md-10 col-xxl">
<h1> <h1>
{{ title_ }} {{ title_ }}
<span class="chill__box {{ thirdParty.active ? 'green' : 'red' }}">{{ (thirdParty.active ? 'Active, shown to users' : 'Inactive, not shown to users')|trans }}</span> <span class="badge bg-{{ thirdParty.active ? 'success' : 'danger' }}"
title="{{ (thirdParty.active ? 'shown to users' : 'not shown to users')|trans }}">
{{ (thirdParty.active ? 'Active' : 'Inactive')|trans }}
</span>
</h1> </h1>
<dl class="chill_view_data"> <dl class="chill_view_data">
@ -43,11 +49,17 @@
</dd> </dd>
<dt>{{ 'Comment'|trans }}</dt> <dt>{{ 'Comment'|trans }}</dt>
<dd>{{ thirdParty.comment|chill_print_or_message("thirdparty.No_comment") }}</dd> <dd>
{% if thirdParty.comment is not empty %}
<blockquote class="chill-user-quote">
{{ thirdParty.comment|chill_markdown_to_html }}
</blockquote>
{% endif %}
</dd>
</dl> </dl>
<ul class="record_actions"> <ul class="record_actions sticky-form-buttons">
<li class="cancel"> <li class="cancel">
<a class="btn btn-cancel" href="{{ chill_return_path_or('chill_3party_3party_index') }}"> <a class="btn btn-cancel" href="{{ chill_return_path_or('chill_3party_3party_index') }}">
{{ 'Cancel'|trans }} {{ 'Cancel'|trans }}
@ -63,5 +75,7 @@
{% endif %} {% endif %}
</ul> </ul>
</div>
</div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -3,13 +3,19 @@
{% block title 'Update third party %name%'|trans({ '%name%': thirdParty.name }) %} {% block title 'Update third party %name%'|trans({ '%name%': thirdParty.name }) %}
{% block content %} {% block content %}
<div class="col-10 centered"> <div class="thirdparty-edit my-5">
<div class="row justify-content-center">
<div class="col-md-10 col-xxl">
<h1> <h1>
{{ 'Update third party %name%'|trans({ '%name%': thirdParty.name }) }} {{ 'Update third party %name%'|trans({ '%name%': thirdParty.name }) }}
<span class="chill__box {{ thirdParty.active ? 'green' : 'red' }}">{{ (thirdParty.active ? 'Active, shown to users' : 'Inactive, not shown to users')|trans }}</span> <span class="badge bg-{{ thirdParty.active ? 'success' : 'danger' }}"
title="{{ (thirdParty.active ? 'shown to users' : 'not shown to users')|trans }}">
{{ (thirdParty.active ? 'Active' : 'Inactive')|trans }}
</span>
</h1> </h1>
{{ form_start(form) }} {{ form_start(form) }}
{{ form_row(form.name) }} {{ form_row(form.name) }}
{{ form_row(form.type) }} {{ form_row(form.type) }}
@ -22,16 +28,19 @@
{{ form_row(form.comment) }} {{ form_row(form.comment) }}
<ul class="record_actions"> <ul class="record_actions sticky-form-buttons">
<li class="cancel"> <li class="cancel">
<a class="btn btn-cancel" href="{{ chill_path_forward_return_path('chill_3party_3party_index') }}"> <a class="btn btn-cancel" href="{{ chill_path_forward_return_path('chill_3party_3party_index') }}">
{{ 'Back to the list'|trans }} {{ 'Back to the list'|trans }}
</a> </a>
<li> <li>
{{ form_row(form.submit, {'label': 'Update', 'attr': {'class': 'btn btn-update' }}) }} {{ form_widget(form.submit, {'label': 'Update', 'attr': {'class': 'btn btn-update' }}) }}
</li> </li>
</ul> </ul>
{{ form_end(form) }} {{ form_end(form) }}
</div>
</div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -19,8 +19,12 @@ Update third party %name%: Mettre à jour "%name%"
List of third parties: Liste des tiers List of third parties: Liste des tiers
Third party updated: Le tiers a été mis à jour Third party updated: Le tiers a été mis à jour
Third party created: Le tiers a été créé Third party created: Le tiers a été créé
Active, shown to users: Actif, visible par les utilisateurs Active, shown to users: Actif, visible pour les utilisateurs
Inactive, not shown to users: Inactif, invisible par les utilisateurs Active: Actif
shown to users: visible pour les utilisateurs
Inactive, not shown to users: Inactif, invisible pour les utilisateurs
Inactive: Inactif
not shown to users: invisible pour les utilisateurs
The party is visible in those centers: Le tiers est visible dans ces centres The party is visible in those centers: Le tiers est visible dans ces centres