From 406f0f8fda1feb94275a92090988813274666adf Mon Sep 17 00:00:00 2001
From: koromerzhin <308012+koromerzhin@users.noreply.github.com>
Date: Fri, 22 Oct 2021 13:17:32 +0200
Subject: [PATCH] feat(admin): datatable with order
---
.../admin/attachment/index.html.twig | 40 +++++--
apps/templates/admin/bookmark/index.html.twig | 28 +++--
apps/templates/admin/category/index.html.twig | 15 ++-
apps/templates/admin/edito/index.html.twig | 29 +++--
apps/templates/admin/geocode/index.html.twig | 103 +++++++++++-------
apps/templates/admin/libelle/index.html.twig | 16 ++-
apps/templates/admin/macro.html.twig | 17 +++
.../admin/note_interne/index.html.twig | 34 ++++--
apps/templates/admin/post/index.html.twig | 33 ++++--
apps/templates/admin/template/index.html.twig | 16 ++-
.../admin/user/adresse_user/index.html.twig | 44 ++++++--
.../admin/user/email_user/index.html.twig | 29 +++--
.../admin/user/groupe/index.html.twig | 20 +++-
apps/templates/admin/user/index.html.twig | 45 ++++++--
.../admin/user/lien_user/index.html.twig | 20 +++-
.../admin/user/phone_user/index.html.twig | 45 ++++++--
16 files changed, 383 insertions(+), 151 deletions(-)
diff --git a/apps/templates/admin/attachment/index.html.twig b/apps/templates/admin/attachment/index.html.twig
index 1d8b10c76..ae11b057a 100644
--- a/apps/templates/admin/attachment/index.html.twig
+++ b/apps/templates/admin/attachment/index.html.twig
@@ -3,16 +3,34 @@
{% embed "admin/table.html.twig" %}
{% import "admin/macro.html.twig" as macro_admin %}
{% block thead %}
-
- {{ 'attachment.name'|trans({}, 'admin.messages') }} |
- {{ 'attachment.mimetype'|trans({}, 'admin.messages') }} |
- {{ 'attachment.size'|trans({}, 'admin.messages') }} |
- {{ 'attachment.dimensions'|trans({}, 'admin.messages') }} |
- {{ 'attachment.download'|trans({}, 'admin.messages') }} |
- {{ 'attachment.state'|trans({}, 'admin.messages') }} |
- {{ 'attachment.workflow'|trans({}, 'admin.messages') }} |
- |
-
+ {% set theads = [
+ {
+ 'field': 'a.name',
+ 'name': 'attachment.name'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.mimeType',
+ 'name': 'attachment.mimetype'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.size',
+ 'name': 'attachment.size'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'attachment.dimensions'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'attachment.download'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.state',
+ 'name': 'attachment.state'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'attachment.workflow'|trans({}, 'admin.messages')
+ }
+ ] %}
+ {{ macro_admin.thead(theads, pagination, true) }}
{% endblock %}
{% block tbody %}
{% for entity in pagination %}
@@ -21,7 +39,7 @@
{{ entity.mimeType }} |
{{ entity.size }} |
{{ entity.dimensions|json_encode }} |
- {{ 'attachment.seefile'|trans({}, 'admin.messages') }} |
+ {% if entity.name != '' %}{{ 'attachment.seefile'|trans({}, 'admin.messages') }}{% endif %} |
{% for state in workflow_marked_places(entity) %}
{{ state }}
diff --git a/apps/templates/admin/bookmark/index.html.twig b/apps/templates/admin/bookmark/index.html.twig
index 64bb634af..be6fccee7 100644
--- a/apps/templates/admin/bookmark/index.html.twig
+++ b/apps/templates/admin/bookmark/index.html.twig
@@ -3,14 +3,26 @@
{% embed "admin/table.html.twig" %}
{% import "admin/macro.html.twig" as macro_admin %}
{% block thead %}
- |
- {{ 'bookmark.name'|trans({}, 'admin.messages') }} |
- {{ 'bookmark.user'|trans({}, 'admin.messages') }} |
- {{ 'bookmark.category'|trans({}, 'admin.messages') }} |
- {{ 'workflow.state'|trans({}, 'admin.messages') }} |
- {{ 'bookmark.workflow'|trans({}, 'admin.messages') }} |
- |
-
+ {% set theads = [
+ {
+ 'field': 'a.name',
+ 'name': 'bookmark.name'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'bookmark.user'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'bookmark.category'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.state',
+ 'name': 'workflow.state'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'bookmark.workflow'|trans({}, 'admin.messages')
+ }
+ ] %}
+ {{ macro_admin.thead(theads, pagination, true) }}
{% endblock %}
{% block tbody %}
{% for entity in pagination %}
diff --git a/apps/templates/admin/category/index.html.twig b/apps/templates/admin/category/index.html.twig
index f2edf50a2..299ded3f8 100644
--- a/apps/templates/admin/category/index.html.twig
+++ b/apps/templates/admin/category/index.html.twig
@@ -2,13 +2,18 @@
{% extends 'admin/category/layout.html.twig' %}
{% block body %}
{% embed "admin/table.html.twig" %}
+ {% import "admin/macro.html.twig" as macro_admin %}
{% import "admin/category/macro.html.twig" as macro_post %}
{% block thead %}
-
- {{ 'post.category.name'|trans({}, 'admin.messages') }} |
- {{ 'post.category.slug'|trans({}, 'admin.messages') }} |
- |
-
+ {% set theads = [
+ {
+ 'name': 'post.category.name'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'post.category.slug'|trans({}, 'admin.messages')
+ }
+ ] %}
+ {{ macro_admin.thead(theads, pagination, true) }}
{% endblock %}
{% block tbody %}
{{ macro_post.show(pagination, 0, actions) }}
diff --git a/apps/templates/admin/edito/index.html.twig b/apps/templates/admin/edito/index.html.twig
index 7a69926e0..9d81af97e 100644
--- a/apps/templates/admin/edito/index.html.twig
+++ b/apps/templates/admin/edito/index.html.twig
@@ -3,14 +3,27 @@
{% embed "admin/table.html.twig" %}
{% import "admin/macro.html.twig" as macro_admin %}
{% block thead %}
-
- {{ 'edito.title'|trans({}, 'admin.messages') }} |
- {{ 'edito.user'|trans({}, 'admin.messages') }} |
- {{ 'edito.published'|trans({}, 'admin.messages') }} |
- {{ 'edito.state'|trans({}, 'admin.messages') }} |
- {{ 'edito.workflow'|trans({}, 'admin.messages') }} |
- |
-
+ {% set theads = [
+ {
+ 'field': 'a.title',
+ 'name': 'edito.title'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'edito.user'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.published',
+ 'name': 'edito.published'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.state',
+ 'name': 'edito.state'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'edito.workflow'|trans({}, 'admin.messages')
+ }
+ ] %}
+ {{ macro_admin.thead(theads, pagination, true) }}
{% endblock %}
{% block tbody %}
{% for entity in pagination %}
diff --git a/apps/templates/admin/geocode/index.html.twig b/apps/templates/admin/geocode/index.html.twig
index 44bade581..24a03201f 100644
--- a/apps/templates/admin/geocode/index.html.twig
+++ b/apps/templates/admin/geocode/index.html.twig
@@ -1,41 +1,68 @@
{% extends 'admin/geocode/layout.html.twig' %}
{% block body %}
- {% embed "admin/table.html.twig" %}
- {% import "admin/macro.html.twig" as macro_admin %}
- {% block thead %}
-
- {{ 'geocode.countrycode'|trans({}, 'admin.messages') }} |
- {{ 'geocode.postalcode'|trans({}, 'admin.messages') }} |
- {{ 'geocode.placename'|trans({}, 'admin.messages') }} |
- {{ 'geocode.statename'|trans({}, 'admin.messages') }} |
- {{ 'geocode.provincename'|trans({}, 'admin.messages') }} |
- {{ 'geocode.communityname'|trans({}, 'admin.messages') }} |
- {{ 'geocode.latitude'|trans({}, 'admin.messages') }} |
- {{ 'geocode.longitude'|trans({}, 'admin.messages') }} |
- {{ 'geocode.accuracy'|trans({}, 'admin.messages') }} |
- {{ 'geocode.actions'|trans({}, 'admin.messages') }} |
-
- {% endblock %}
- {% block tbody %}
- {% for entity in pagination %}
-
-
-
- {{ entity.countryCode|country_name('fr') }}
- |
- {{ entity.postalCode }} |
- {{ entity.placeName }} |
- {{ entity.stateName }} |
- {{ entity.provinceName }} |
- {{ entity.communityName }} |
- {{ entity.latitude }} |
- {{ entity.longitude }} |
- {{ entity.accuracy }} |
-
- {{ macro_admin.actions(entity, actions) }}
- |
-
- {% endfor %}
- {% endblock %}
- {% endembed %}
+ {% embed "admin/table.html.twig" %}
+ {% import "admin/macro.html.twig" as macro_admin %}
+ {% block thead %}
+ {% set theads = [
+ {
+ 'field': 'a.countryCode',
+ 'name': 'geocode.countrycode'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.postalCode',
+ 'name': 'geocode.postalcode'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.placeName',
+ 'name': 'geocode.placename'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.stateName',
+ 'name': 'geocode.statename'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.provinceName',
+ 'name': 'geocode.provincename'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.communityName',
+ 'name': 'geocode.communityname'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.latitude',
+ 'name': 'geocode.latitude'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.longitude',
+ 'name': 'geocode.longitude'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.accuracy',
+ 'name': 'geocode.accuracy'|trans({}, 'admin.messages')
+ },
+ ] %}
+ {{ macro_admin.thead(theads, pagination, true) }}
+ {% endblock %}
+ {% block tbody %}
+ {% for entity in pagination %}
+
+
+
+ {{ entity.countryCode|country_name('fr') }}
+ |
+ {{ entity.postalCode }} |
+ {{ entity.placeName }} |
+ {{ entity.stateName }} |
+ {{ entity.provinceName }} |
+ {{ entity.communityName }} |
+ {{ entity.latitude }} |
+ {{ entity.longitude }} |
+ {{ entity.accuracy }} |
+
+ {{ macro_admin.actions(entity, actions) }}
+ |
+
+ {% endfor %}
+ {% endblock %}
+ {% endembed %}
{% endblock %}
diff --git a/apps/templates/admin/libelle/index.html.twig b/apps/templates/admin/libelle/index.html.twig
index c67702e30..de6df4d3a 100644
--- a/apps/templates/admin/libelle/index.html.twig
+++ b/apps/templates/admin/libelle/index.html.twig
@@ -3,11 +3,17 @@
{% embed "admin/table.html.twig" %}
{% import "admin/macro.html.twig" as macro_admin %}
{% block thead %}
-
- {{ 'post.libelle.name'|trans({}, 'admin.messages') }} |
- {{ 'post.libelle.slug'|trans({}, 'admin.messages') }} |
- |
-
+ {% set theads = [
+ {
+ 'field': 'a.name',
+ 'name': 'post.libelle.name'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.slug',
+ 'name': 'post.libelle.slug'|trans({}, 'admin.messages')
+ }
+ ] %}
+ {{ macro_admin.thead(theads, pagination, true) }}
{% endblock %}
{% block tbody %}
{% for entity in pagination %}
diff --git a/apps/templates/admin/macro.html.twig b/apps/templates/admin/macro.html.twig
index eb32c2f6b..bff069d10 100644
--- a/apps/templates/admin/macro.html.twig
+++ b/apps/templates/admin/macro.html.twig
@@ -1,3 +1,20 @@
+{% macro thead(theads, pagination, actions) %}
+
+ {% for thead in theads %}
+
+ {% if thead.field is defined %}
+ {{ knp_pagination_sortable(pagination, thead.name, thead.field) }}
+ {% elseif thead.name is defined %}
+ {{ thead.name }}
+ {% endif %}
+ |
+ {% endfor %}
+ {% if actions == true %}
+ |
+ {% endif %}
+
+{% endmacro %}
+
{% macro form_img(entity, field, name, url) %}
{% set file = attachment(field) %}
{% set state = guard_route(url) %}
diff --git a/apps/templates/admin/note_interne/index.html.twig b/apps/templates/admin/note_interne/index.html.twig
index 21a2d8e3b..24eee9408 100644
--- a/apps/templates/admin/note_interne/index.html.twig
+++ b/apps/templates/admin/note_interne/index.html.twig
@@ -3,15 +3,31 @@
{% embed "admin/table.html.twig" %}
{% import "admin/macro.html.twig" as macro_admin %}
{% block thead %}
-
- {{ 'noteinterne.title'|trans({}, 'admin.messages') }} |
- {{ 'noteinterne.date_debut'|trans({}, 'admin.messages') }} |
- {{ 'noteinterne.date_fin'|trans({}, 'admin.messages') }} |
- {{ 'noteinterne.user'|trans({}, 'admin.messages') }} |
- {{ 'workflow.state'|trans({}, 'admin.messages') }} |
- {{ 'noteinterne.workflow'|trans({}, 'admin.messages') }} |
- |
-
+ {% set theads = [
+ {
+ 'field': 'a.title',
+ 'name': 'noteinterne.title'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.dateDebut',
+ 'name': 'noteinterne.date_debut'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.dateFin',
+ 'name': 'noteinterne.date_fin'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'noteinterne.user'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.state',
+ 'name': 'workflow.state'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'noteinterne.workflow'|trans({}, 'admin.messages')
+ }
+ ] %}
+ {{ macro_admin.thead(theads, pagination, true) }}
{% endblock %}
{% block tbody %}
{% for entity in pagination %}
diff --git a/apps/templates/admin/post/index.html.twig b/apps/templates/admin/post/index.html.twig
index 18edda6d7..ca3c3b121 100644
--- a/apps/templates/admin/post/index.html.twig
+++ b/apps/templates/admin/post/index.html.twig
@@ -3,15 +3,30 @@
{% embed "admin/table.html.twig" %}
{% import "admin/macro.html.twig" as macro_admin %}
{% block thead %}
-
- {{ 'post.title'|trans({}, 'admin.messages') }} |
- {{ 'post.user'|trans({}, 'admin.messages') }} |
- {{ 'post.category'|trans({}, 'admin.messages') }} |
- {{ 'post.published'|trans({}, 'admin.messages') }} |
- {{ 'workflow.state'|trans({}, 'admin.messages') }} |
- {{ 'post.workflow'|trans({}, 'admin.messages') }} |
- |
-
+ {% set theads = [
+ {
+ 'field': 'a.title',
+ 'name': 'post.title'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'post.user'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'post.category'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.published',
+ 'name': 'post.published'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.state',
+ 'name': 'workflow.state'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'post.workflow'|trans({}, 'admin.messages')
+ }
+ ] %}
+ {{ macro_admin.thead(theads, pagination, true) }}
{% endblock %}
{% block tbody %}
{% for entity in pagination %}
diff --git a/apps/templates/admin/template/index.html.twig b/apps/templates/admin/template/index.html.twig
index decbf8cb2..018ec0a4f 100644
--- a/apps/templates/admin/template/index.html.twig
+++ b/apps/templates/admin/template/index.html.twig
@@ -3,11 +3,17 @@
{% embed "admin/table.html.twig" %}
{% import "admin/macro.html.twig" as macro_admin %}
{% block thead %}
-
- {{ 'template.name'|trans({}, 'admin.messages') }} |
- {{ 'template.code'|trans({}, 'admin.messages') }} |
- |
-
+ {% set theads = [
+ {
+ 'field': 'a.name',
+ 'name': 'template.name'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.code',
+ 'name': 'template.code'|trans({}, 'admin.messages')
+ }
+ ] %}
+ {{ macro_admin.thead(theads, pagination, true) }}
{% endblock %}
{% block tbody %}
{% for entity in pagination %}
diff --git a/apps/templates/admin/user/adresse_user/index.html.twig b/apps/templates/admin/user/adresse_user/index.html.twig
index 8d8e24a01..58e44b7f4 100644
--- a/apps/templates/admin/user/adresse_user/index.html.twig
+++ b/apps/templates/admin/user/adresse_user/index.html.twig
@@ -3,17 +3,39 @@
{% embed "admin/table.html.twig" %}
{% import "admin/macro.html.twig" as macro_admin %}
{% block thead %}
-
- {{ 'user.address.rue'|trans({}, 'admin.messages') }} |
- {{ 'user.address.country'|trans({}, 'admin.messages') }} |
- {{ 'user.address.zipcode'|trans({}, 'admin.messages') }} |
- {{ 'user.address.ville'|trans({}, 'admin.messages') }} |
- {{ 'user.address.gps'|trans({}, 'admin.messages') }} |
- {{ 'user.address.type'|trans({}, 'admin.messages') }} |
- {{ 'user.address.pmr'|trans({}, 'admin.messages') }} |
- {{ 'user.address.user'|trans({}, 'admin.messages') }} |
- |
-
+ {% set theads = [
+ {
+ 'field': 'a.rue',
+ 'name': 'user.address.rue'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.country',
+ 'name': 'user.address.country'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.zipcode',
+ 'name': 'user.address.zipcode'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.ville',
+ 'name': 'user.address.ville'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'user.address.gps'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.type',
+ 'name': 'user.address.type'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.pmr',
+ 'name': 'user.address.pmr'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'user.address.user'|trans({}, 'admin.messages')
+ }
+ ] %}
+ {{ macro_admin.thead(theads, pagination, true) }}
{% endblock %}
{% block tbody %}
{% for entity in pagination %}
diff --git a/apps/templates/admin/user/email_user/index.html.twig b/apps/templates/admin/user/email_user/index.html.twig
index 296bfd639..66d963287 100644
--- a/apps/templates/admin/user/email_user/index.html.twig
+++ b/apps/templates/admin/user/email_user/index.html.twig
@@ -3,14 +3,27 @@
{% embed "admin/table.html.twig" %}
{% import "admin/macro.html.twig" as macro_admin %}
{% block thead %}
-
- {{ 'user.email.adresse'|trans({}, 'admin.messages') }} |
- {{ 'user.email.principal'|trans({}, 'admin.messages') }} |
- {{ 'user.email.user'|trans({}, 'admin.messages') }} |
- {{ 'workflow.state'|trans({}, 'admin.messages') }} |
- {{ 'user.email.workflow'|trans({}, 'admin.messages') }} |
- |
-
+ {% set theads = [
+ {
+ 'field': 'a.adresse',
+ 'name': 'user.email.adresse'|trans({}, 'admin.messages'),
+ },
+ {
+ 'field': 'a.principal',
+ 'name': 'user.email.principal'|trans({}, 'admin.messages'),
+ },
+ {
+ 'name': 'user.email.user'|trans({}, 'admin.messages'),
+ },
+ {
+ 'field': 'a.state',
+ 'name': 'workflow.state'|trans({}, 'admin.messages'),
+ },
+ {
+ 'name': 'user.email.workflow'|trans({}, 'admin.messages'),
+ }
+ ] %}
+ {{ macro_admin.thead(theads, pagination, true) }}
{% endblock %}
{% block tbody %}
{% for entity in pagination %}
diff --git a/apps/templates/admin/user/groupe/index.html.twig b/apps/templates/admin/user/groupe/index.html.twig
index b23c446bb..c266848ee 100644
--- a/apps/templates/admin/user/groupe/index.html.twig
+++ b/apps/templates/admin/user/groupe/index.html.twig
@@ -3,12 +3,20 @@
{% embed "admin/table.html.twig" %}
{% import "admin/macro.html.twig" as macro_admin %}
{% block thead %}
-
- {{ 'user.groupe.name'|trans({}, 'admin.messages') }} |
- {{ 'user.groupe.code'|trans({}, 'admin.messages') }} |
- {{ 'user.groupe.users'|trans({}, 'admin.messages') }} |
- |
-
+ {% set theads = [
+ {
+ 'field': 'a.name',
+ 'name': 'user.groupe.name'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.code',
+ 'name': 'user.groupe.code'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'user.groupe.users'|trans({}, 'admin.messages')
+ }
+ ] %}
+ {{ macro_admin.thead(theads, pagination, true) }}
{% endblock %}
{% block tbody %}
{% for entity in pagination %}
diff --git a/apps/templates/admin/user/index.html.twig b/apps/templates/admin/user/index.html.twig
index ed62711b1..94c72fc3a 100644
--- a/apps/templates/admin/user/index.html.twig
+++ b/apps/templates/admin/user/index.html.twig
@@ -3,18 +3,39 @@
{% embed "admin/table.html.twig" %}
{% import "admin/macro.html.twig" as macro_admin %}
{% block thead %}
-
- {{ 'user.username'|trans({}, 'admin.messages') }} |
- {{ 'user.groupe'|trans({}, 'admin.messages') }} |
- {{ 'user.email'|trans({}, 'admin.messages') }} |
- {{ 'user.addresss'|trans({}, 'admin.messages') }} |
- {{ 'user.links'|trans({}, 'admin.messages') }} |
- {{ 'user.emails'|trans({}, 'admin.messages') }} |
- {{ 'user.phones'|trans({}, 'admin.messages') }} |
- {{ 'workflow.state'|trans({}, 'admin.messages') }} |
- {{ 'user.workflow'|trans({}, 'admin.messages') }} |
- |
-
+ {% set theads = [
+ {
+ 'field': 'a.username',
+ 'name': 'user.username'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'user.groupe'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.email',
+ 'name': 'user.email'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'user.addresss'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'user.links'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'user.emails'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'user.phones'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.state',
+ 'name': 'workflow.state'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'user.workflow'|trans({}, 'admin.messages')
+ }
+ ] %}
+ {{ macro_admin.thead(theads, pagination, true) }}
{% endblock %}
{% block tbody %}
{% for entity in pagination %}
diff --git a/apps/templates/admin/user/lien_user/index.html.twig b/apps/templates/admin/user/lien_user/index.html.twig
index aa4f9f1bb..47e343778 100644
--- a/apps/templates/admin/user/lien_user/index.html.twig
+++ b/apps/templates/admin/user/lien_user/index.html.twig
@@ -3,12 +3,20 @@
{% embed "admin/table.html.twig" %}
{% import "admin/macro.html.twig" as macro_admin %}
{% block thead %}
-
- {{ 'user.link.name'|trans({}, 'admin.messages') }} |
- {{ 'user.link.adresse'|trans({}, 'admin.messages') }} |
- {{ 'user.link.user'|trans({}, 'admin.messages') }} |
- |
-
+ {% set theads = [
+ {
+ 'field': 'a.name',
+ 'name': 'user.link.name'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.adresse',
+ 'name': 'user.link.adresse'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'user.link.user'|trans({}, 'admin.messages')
+ }
+ ] %}
+ {{ macro_admin.thead(theads, pagination, true) }}
{% endblock %}
{% block tbody %}
{% for entity in pagination %}
diff --git a/apps/templates/admin/user/phone_user/index.html.twig b/apps/templates/admin/user/phone_user/index.html.twig
index d4af8b396..24a6c3cee 100644
--- a/apps/templates/admin/user/phone_user/index.html.twig
+++ b/apps/templates/admin/user/phone_user/index.html.twig
@@ -3,16 +3,38 @@
{% embed "admin/table.html.twig" %}
{% import "admin/macro.html.twig" as macro_admin %}
{% block thead %}
-
- {{ 'user.phone.numero'|trans({}, 'admin.messages') }} |
- {{ 'user.phone.country'|trans({}, 'admin.messages') }} |
- {{ 'user.phone.verif'|trans({}, 'admin.messages') }} |
- {{ 'user.phone.type'|trans({}, 'admin.messages') }} |
- {{ 'user.phone.principal'|trans({}, 'admin.messages') }} |
- {{ 'workflow.state'|trans({}, 'admin.messages') }} |
- {{ 'user.phone.workflow'|trans({}, 'admin.messages') }} |
- |
-
+ {% set theads = [
+ {
+ 'field': 'a.numero',
+ 'name': 'user.phone.numero'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.country',
+ 'name': 'user.phone.country'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'user.phone.verif'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.type',
+ 'name': 'user.phone.type'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.principal',
+ 'name': 'user.phone.principal'|trans({}, 'admin.messages')
+ },
+ {
+ 'field': 'a.state',
+ 'name': 'workflow.state'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'user.phone.workflow'|trans({}, 'admin.messages')
+ },
+ {
+ 'name': 'user.phone.user'|trans({}, 'admin.messages')
+ }
+ ] %}
+ {{ macro_admin.thead(theads, pagination, true) }}
{% endblock %}
{% block tbody %}
{% for entity in pagination %}
@@ -35,6 +57,9 @@
{{ macro_admin.workflow(entity, actions) }}
+ |
+
+ {{ entity.refuser.username }}
|
{{ macro_admin.actions(entity, actions) }}
|