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

View File

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

View File

@ -3,7 +3,10 @@
{% block title 'Create third party'|trans %}
{% 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>
{{ form_start(form) }}
@ -30,5 +33,8 @@
</ul>
{{ form_end(form) }}
</div>
</div>
</div>
{% endblock %}

View File

@ -7,10 +7,16 @@
{% block title title_ %}
{% 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>
{{ 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>
<dl class="chill_view_data">
@ -43,11 +49,17 @@
</dd>
<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>
<ul class="record_actions">
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a class="btn btn-cancel" href="{{ chill_return_path_or('chill_3party_3party_index') }}">
{{ 'Cancel'|trans }}
@ -64,4 +76,6 @@
</ul>
</div>
</div>
</div>
{% endblock %}

View File

@ -3,13 +3,19 @@
{% block title 'Update third party %name%'|trans({ '%name%': thirdParty.name }) %}
{% 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>
{{ '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>
{{ form_start(form) }}
{{ form_row(form.name) }}
{{ form_row(form.type) }}
@ -22,16 +28,19 @@
{{ form_row(form.comment) }}
<ul class="record_actions">
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a class="btn btn-cancel" href="{{ chill_path_forward_return_path('chill_3party_3party_index') }}">
{{ 'Back to the list'|trans }}
</a>
<li>
{{ form_row(form.submit, {'label': 'Update', 'attr': {'class': 'btn btn-update' }}) }}
{{ form_widget(form.submit, {'label': 'Update', 'attr': {'class': 'btn btn-update' }}) }}
</li>
</ul>
{{ form_end(form) }}
</div>
</div>
</div>
{% endblock %}

View File

@ -19,8 +19,12 @@ Update third party %name%: Mettre à jour "%name%"
List of third parties: Liste des tiers
Third party updated: Le tiers a été mis à jour
Third party created: Le tiers a été créé
Active, shown to users: Actif, visible par les utilisateurs
Inactive, not shown to users: Inactif, invisible par les utilisateurs
Active, shown to users: Actif, visible pour 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