From d2c631ae208e6c8723424b1a42c2e9baa6c9e115 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Fri, 16 Jul 2021 09:52:54 +0200 Subject: [PATCH] prepare thirdparty index template --- .../Resources/public/sass/thirdparty.scss | 10 +- .../views/ThirdParty/index.html.twig | 149 +++++++++++------- .../translations/messages.fr.yml | 5 +- 3 files changed, 105 insertions(+), 59 deletions(-) diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/sass/thirdparty.scss b/src/Bundle/ChillThirdPartyBundle/Resources/public/sass/thirdparty.scss index 952b011ec..c4194a20e 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/public/sass/thirdparty.scss +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/sass/thirdparty.scss @@ -48,4 +48,12 @@ div.chill_contact { content: '\f095'; } } -} \ No newline at end of file +} +div.thirdparty-list { + label.counter { + float: right; + span { + font-weight: bold; + } + } +} diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdParty/index.html.twig b/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdParty/index.html.twig index c741dd6c9..12f4560c2 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdParty/index.html.twig +++ b/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdParty/index.html.twig @@ -3,64 +3,101 @@ {% block title 'List of third parties'|trans %} {% block content %} -
-

{{ 'List of third parties'|trans }}

- - {% if third_parties|length == 0 %} -

{{ 'No third parties'|trans }}

- {% else %} - - - - - - - - - - - - - {% for tp in third_parties %} - - - - {% set types = [] %} - {% for t in tp.type %} - {% set types = types|merge( [ ('chill_3party.key_label.'~t)|trans ] ) %} - {% endfor %} - - - - {% endfor %} - -
{{ 'Name'|trans }}{{ 'Category'|trans }} 
{{ (tp.active ? '' : '')|raw }}{{ tp.name }}{{ types|join(', ') }} -
    - {% if is_granted('CHILL_3PARTY_3PARTY_UPDATE', tp) %} -
  • - -
  • - {% endif %} - {% if is_granted('CHILL_3PARTY_3PARTY_SHOW', tp) %} -
  • - -
  • - {% endif %} -
-
+
+
+
- {% if third_parties|length < pagination.getTotalItems %} - {{ chill_pagination(pagination) }} - {% endif %} +

{{ 'List of third parties'|trans }}

- {% endif %} + {% if third_parties|length == 0 %} +

{{ 'No third parties'|trans }}

+ {% else %} - {% if is_granted('CHILL_3PARTY_3PARTY_CREATE') %} -
+
+
+
+ + + + + + + + + + + + + + + {% for tp in third_parties %} + + + + {% set types = [] %} + {% for t in tp.type %} + {% set types = types|merge( [ ('chill_3party.key_label.'~t)|trans ] ) %} + {% endfor %} + + + + + {% endfor %} + +
{{ 'Name'|trans }} + + {{ 'Category'|trans }} + + {{ 'Address'|trans }} + +
{{ (tp.active ? '' : '')|raw }}{{ tp.name }}{{ types|join(', ') }} + {{ tp.address|chill_entity_render_box({'multiline': false, 'with_valid_from': false}) }} + +
    + {% if is_granted('CHILL_3PARTY_3PARTY_UPDATE', tp) %} +
  • + +
  • + {% endif %} + {% if is_granted('CHILL_3PARTY_3PARTY_SHOW', tp) %} +
  • + +
  • + {% endif %} +
+
+ + {% if third_parties|length < pagination.getTotalItems %} + {{ chill_pagination(pagination, 'long') }} + {% endif %} + + {% endif %} + + + +
+
{% endblock %} diff --git a/src/Bundle/ChillThirdPartyBundle/translations/messages.fr.yml b/src/Bundle/ChillThirdPartyBundle/translations/messages.fr.yml index 5ca560f88..808c37d19 100644 --- a/src/Bundle/ChillThirdPartyBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillThirdPartyBundle/translations/messages.fr.yml @@ -1,5 +1,6 @@ Third party: Tiers Third parties: Tiers +third parties: tiers name: Nom telephone: Téléphone adress: Adresse @@ -11,7 +12,7 @@ thirdparty.No_phonenumber: Aucun numéro de téléphone thirdparty.No_email: Aucun email thirdparty.No_comment: Aucun commentaire -New third party: Nouveau tiers +New third party: Ajouter un nouveau tiers Show third party %name%: Tiers "%name%" Create third party: Créer un tiers Update third party %name%: Mettre à jour "%name%" @@ -28,4 +29,4 @@ No third parties: Aucun tiers # ROLES CHILL_3PARTY_3PARTY_CREATE: Ajouter un Tiers CHILL_3PARTY_3PARTY_SHOW: Voir un Tiers -CHILL_3PARTY_3PARTY_UPDATE: Modifier un Tiers \ No newline at end of file +CHILL_3PARTY_3PARTY_UPDATE: Modifier un Tiers