diff --git a/public/assets/images/library.jpg b/public/assets/images/library.jpg new file mode 100644 index 0000000000000000000000000000000000000000..926fcfdb74d0a8f33c762e7d129539140fc5c01b Binary files /dev/null and b/public/assets/images/library.jpg differ diff --git a/public/assets/images/library.png b/public/assets/images/library.png new file mode 100644 index 0000000000000000000000000000000000000000..4b3b13543b8b1abb4eb9ebc5ebc99fb1a61ff1d6 Binary files /dev/null and b/public/assets/images/library.png differ diff --git a/src/Controller/HeadwordController.php b/src/Controller/HeadwordController.php index 008df894642e3d56cc536f84bdbbf979706b1a46..01bccbe52bacfc8343cf9d668005b4bc84206747 100644 --- a/src/Controller/HeadwordController.php +++ b/src/Controller/HeadwordController.php @@ -64,7 +64,7 @@ class HeadwordController extends AppBaseController $headword = $this->newHeadword($word, $this->getLanguage()); $this->createEntryInNewWordsLexicon($headword); - $this->addFlash('success', sprintf("Le mot « %s » a été ajouté à l'Agora des nouveaux mots.", $word)); + $this->addFlash('success', sprintf("Le mot « %s » a été ajouté à l'Agora Des Néologismes.", $word)); return $this->render("closeModalAndReload.html.twig"); } diff --git a/src/Controller/IndexController.php b/src/Controller/IndexController.php index 2f8165f1d129d81a79e283f22b8ed0e8a20aed30..03eebcd03422297b19844a5e094e71bf231cb22c 100644 --- a/src/Controller/IndexController.php +++ b/src/Controller/IndexController.php @@ -14,27 +14,14 @@ use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Serializer\SerializerAwareInterface; use Symfony\Component\Serializer\SerializerInterface; -class IndexController extends AbstractController +class IndexController extends AppBaseController { - /** - * @var ManagerRegistry - */ - private $doctrine; - - public function __construct(ManagerRegistry $doctrine) - { - $this->doctrine = $doctrine; - } - /** * @Route("/", name="app_index") */ public function index(WiktionaryManager $wiktionaryManager): Response { - $baseEntrySchema = json_decode(file_get_contents(__DIR__ . "/../JsonSchema/baseEntrySchema.json"), true); - $baseEntrySchema['Headword'] = 'rr'; - - return $this->render('index/index.html.twig', []); + return $this->render('home.html.twig', []); } /** diff --git a/src/Controller/LabelController.php b/src/Controller/LabelController.php index d56b89c342881ed6c655a922e099415eec7193dc..e60c9e4718e1b7ffd6397c504297e13dfdd275f6 100644 --- a/src/Controller/LabelController.php +++ b/src/Controller/LabelController.php @@ -295,7 +295,7 @@ class LabelController extends AppBaseController return $this->render('closeModalAndReload.html.twig'); } else { $displayForceValidation = true; - $this->addFlash('warning', sprintf("Le mot «%s» n'existe ni dans Balex ni dans le wiktionnaire. Voulez-vous le proposer dans l'Agora des nouveaux mots ?", $word)); + $this->addFlash('warning', sprintf("Le mot «%s» n'existe ni dans Balex ni dans le wiktionnaire. Voulez-vous le proposer dans l'Agora Des Néologismes ?", $word)); } } } diff --git a/src/Controller/LexiconController.php b/src/Controller/LexiconController.php index 07f334d12ad2b694bce9b9c0ae99b2c076a56074..7b11e81fdbc14f02fa92830e1e0917036b77225f 100644 --- a/src/Controller/LexiconController.php +++ b/src/Controller/LexiconController.php @@ -78,6 +78,32 @@ class LexiconController extends AppBaseController 'sortingOrder' => $sortingOrder, ]); } + /** + * @Route("/new-words/{id}", name="app_lexicon_new_words", methods={"GET"}) + */ + public function showNewWordsLexicon(ManagerRegistry $doctrine, Request $request, Lexicon $lexicon): Response + { + $em = $doctrine->getManager(); + $sortingColumn = null; + $sortingOrder = null; + $this->getSortingParameters($request, $sortingColumn, $sortingOrder, 'lexicon_new_words_show'); + + $form = $this->createForm(SearchStringType::class,null, array('method' => 'GET')); + $form->handleRequest($request); + $filter = $form->getData(); + + $filter['lexicon'] = $lexicon; + + $entries = $em->getRepository(Entry::class)->filter($filter, 'createdAt', 'DESC'); + + return $this->render('lexicon/showNewWords.html.twig', [ + 'entries' => $entries, + 'lexicon' => $lexicon, + 'form' => $form->createView(), + 'sortingColumn' => $sortingColumn, + 'sortingOrder' => $sortingOrder, + ]); + } /** * @Route("/{id}/choose-label-for-selection/{category}", name="app_lexicon_choose_label") diff --git a/src/Entity/Lexicon.php b/src/Entity/Lexicon.php index 1dac381f74155db9b8d9553e3f243d778060b311..725549bb6cb1f370334916a9b9bf40afeb4488d2 100644 --- a/src/Entity/Lexicon.php +++ b/src/Entity/Lexicon.php @@ -149,7 +149,7 @@ class Lexicon public function getMaster() { if ($this->getUser() && ! $this->getGroup()) return Label::MASTER_PERSONAL; - if ($this->getGroup() && $this->getUser()) return Label::MASTER_GROUP; + if ($this->getGroup() && ! $this->getUser()) return Label::MASTER_GROUP; throw new \LogicException("Cannot determine lexicon masters type"); } diff --git a/src/Manager/LabelManager.php b/src/Manager/LabelManager.php index 8bd80c14ff066eb7804879abc4615c782c418356..0052ac8b80dbda253c6c78d6e8e0fb4d0effc9b3 100644 --- a/src/Manager/LabelManager.php +++ b/src/Manager/LabelManager.php @@ -49,6 +49,12 @@ class LabelManager ) > 0; } + // Retourne les 5 derniers labels visibles par un user classés par date de création DESC + public function getLastLabels(User $user) + { + return $this->doctrine->getRepository(Label::class)->getLastVisiblesByUser($user); + } + // Retourne les labels visibles dans un lexique pour un user (pour une catégorie si renseignée) public function getVisibleLabels(Lexicon $lexicon, User $user, $category = null) { diff --git a/src/Manager/LexiconManager.php b/src/Manager/LexiconManager.php index e18653596e8a21240faa91f3189c2e7719912702..c816da9c7431fe40d831f75dab321cff0f09de12 100644 --- a/src/Manager/LexiconManager.php +++ b/src/Manager/LexiconManager.php @@ -7,11 +7,13 @@ use App\Entity\Label; use App\Entity\Lexicon; use App\Entity\User; use App\Languages\LanguagesIso; +use Doctrine\Common\Collections\Criteria; use Doctrine\Persistence\ManagerRegistry; use JsonSchema\Validator; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Security\Core\Security; use Symfony\Component\Serializer\SerializerAwareInterface; use Symfony\Component\Serializer\SerializerInterface; @@ -22,9 +24,15 @@ class LexiconManager */ protected $doctrine; - public function __construct(ManagerRegistry $doctrine) + /** + * @var Security + */ + private $security; + + public function __construct(ManagerRegistry $doctrine, Security $security) { $this->doctrine = $doctrine; + $this->security = $security; } /** @@ -40,8 +48,45 @@ class LexiconManager * @param $language * @return Lexicon|null */ - public function getNewWordsLexicon($language) + public function getNewWordsLexicon($language = null) { + $language = $language ? : $this->security->getUser()->getFirstStudiedLanguage(); + return $this->doctrine->getRepository(Lexicon::class)->findOneBy(['language' => $language, 'category' => Lexicon::TYPE_NEW_WORDS]); } + + /** + * @param $language + * @return integer + */ + public function getNewWordsNb($language = null) + { + $newWordsLexicon = $this->getNewWordsLexicon($language); + + return $this->doctrine->getRepository(Entry::class)->count([ + 'lexicon' => $newWordsLexicon + ]); + } + + /** + * @param Lexicon $lexicon + * @return integer + */ + public function getEntriesNb(Lexicon $lexicon) + { + return $this->doctrine->getRepository(Entry::class)->count([ + 'lexicon' => $lexicon + ]); + } + + /** + * @param $language + * @return integer + */ + public function getLastNewWords($language = null) + { + $newWordsLexicon = $this->getNewWordsLexicon($language); + + return $this->doctrine->getRepository(Entry::class)->getLastEntries($newWordsLexicon); + } } diff --git a/src/Repository/EntryRepository.php b/src/Repository/EntryRepository.php index c9fdff613779c07bfd6f6db896aec0b536989f23..2d2cef69c2917e551e2c86c48c89f52a9f5a69a2 100644 --- a/src/Repository/EntryRepository.php +++ b/src/Repository/EntryRepository.php @@ -3,6 +3,7 @@ namespace App\Repository; use App\Entity\Entry; +use App\Entity\Lexicon; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\ORM\QueryBuilder; use Doctrine\Persistence\ManagerRegistry; @@ -91,6 +92,20 @@ class EntryRepository extends ServiceEntityRepository } } + /** + * @return Entry[] + */ + public function getLastEntries(Lexicon $lexicon): array + { + return $this->createQueryBuilder('e') + ->andWhere('e.lexicon = :lexicon') + ->setParameter('lexicon', $lexicon) + ->setMaxResults(5) + ->getQuery() + ->getResult() + ; + } + /** * @return Entry[] Returns an array of Entry objects */ diff --git a/src/Repository/LabelRepository.php b/src/Repository/LabelRepository.php index d1f91b93ddd0d7fdbbdb1559c3f0beb6720f9800..4bcd25dbd0acc4d21e52cb533a145217c97fe54c 100644 --- a/src/Repository/LabelRepository.php +++ b/src/Repository/LabelRepository.php @@ -6,6 +6,7 @@ use App\Entity\Label; use App\Entity\Lexicon; use App\Entity\User; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; +use Doctrine\ORM\QueryBuilder; use Doctrine\Persistence\ManagerRegistry; /** @@ -103,6 +104,34 @@ class LabelRepository extends ServiceEntityRepository ; } + /** + * @param User $user + * @return QueryBuilder + */ + public function queryVisiblesByUser(User $user) + { + $qb = $this->createQueryBuilder('l') + ->andWhere('l.master != :personal OR l.user = :user') + ->setParameter('personal', Label::MASTER_PERSONAL) + ->setParameter('user', $user) + ->orderBy('l.createdAt', 'DESC') + ; + + return $qb; + } + + /** + * @return Label[] Returns an array of Label objects + */ + public function getLastVisiblesByUser(User $user): array + { + return $this->queryVisiblesByUser($user) + ->setMaxResults(5) + ->getQuery() + ->getResult() + ; + } + // public function findOneBySomeField($value): ?Label // { // return $this->createQueryBuilder('l') diff --git a/templates/entry/_lexiconsTabs.html.twig b/templates/entry/_lexiconsTabs.html.twig new file mode 100644 index 0000000000000000000000000000000000000000..e83979d9026381058f086566e3ae80a167ced057 --- /dev/null +++ b/templates/entry/_lexiconsTabs.html.twig @@ -0,0 +1,41 @@ +<ul class="nav nav-tabs mt-3"> + {% for lexicon in app.user.myLexicons %} + {% set entryWithSameHeadwordInThisLexicon = lexicon.getEntryForHeadword(entry.headword) %} + + <li class="nav-item dropdown"> + <a class="nav-link {{ lexicon == entry.lexicon ? 'active' }} {{ entryWithSameHeadwordInThisLexicon ? 'tab-pink' : 'tab-grey' }} dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">{{ lexicon }}</a> + <ul class="dropdown-menu"> + {% if entryWithSameHeadwordInThisLexicon %} + {% if lexicon != entry.lexicon %} + <li><a class="dropdown-item" href="{{ path('app_entry_show', {id: entryWithSameHeadwordInThisLexicon.id}) }}">{{ "Voir l'entrée dans ce lexique"|trans }}</a></li> + {% endif %} + {% set backUrl = (lexicon == entry.lexicon ? path('app_lexicon_show', {id: entry.lexicon.id}) : path('app_entry_show', {id: entry.id})) %} + <li><a class="dropdown-item" href="#" + data-href="{{ path('app_entry_delete', {id: entryWithSameHeadwordInThisLexicon.id, backUrl: backUrl}) }}" + data-confirm="{{ "Confirmer la suppression ?"|trans }}" data-bs-toggle="modal" data-bs-target="#confirm-dialog"> + {{ "Supprimer l'entrée dans ce lexique"|trans }} + </a></li> + {% endif %} + {% if lexicon != entry.lexicon %} + {% if entryWithSameHeadwordInThisLexicon %} + <li><a class="dropdown-item" href="#" data-href="{{ path('app_entry_copy', {id: entry.id, lexiconId: lexicon.id}) }}" + data-confirm="{{ "Confirmer la copie ? Une entrée similaire existe déjà dans le lexique que vous avez sélectionné. Si vous copiez celle-ci, le contenu de l'autre sera perdue"|trans }}" data-bs-toggle="modal" data-bs-target="#confirm-dialog"> + {{ "Copier l'entrée dans ce lexique"|trans }} + </a></li> + {% else %} + <li><a class="dropdown-item" href="{{ path('app_entry_copy', {id: entry.id, lexiconId: lexicon.id}) }}">{{ "Copier l'entrée dans ce lexique"|trans }}</a></li> + {% endif %} + {% endif %} + </ul> + </li> + + {% endfor %} + + {% if not entry.lexicon.isNewWords %} + {% set zeroLexicon = lexicon_manager.zeroLexicon(entry.language) %} + {% set entryZero = zeroLexicon.getEntryForHeadword(entry.headword) %} + <li class="nav-item"> + <a class="nav-link {{ zeroLexicon == entry.lexicon ? 'active' }} tab-dark-pink" href="{{ path('app_entry_show', {id: entryZero.id}) }}">{{ "Wiktionnaire"|trans }}</a> + </li> + {% endif %} +</ul> \ No newline at end of file diff --git a/templates/entry/show.html.twig b/templates/entry/show.html.twig index a3fcf6e27e1a62df0abdb6dad69b46311b13e18c..9307b96a0a5a8335be04ee1ff643dcada7d48da1 100644 --- a/templates/entry/show.html.twig +++ b/templates/entry/show.html.twig @@ -10,70 +10,36 @@ <div class="col-md-12"> <h1 class=""> - {% if not wiktionnaryLexicon %} - <a href="{{ path('app_lexicon_show', {id: entry.lexicon.id}) }}" class="btn btn-dark"><i class="bi bi-arrow-90deg-left"></i></a> + {% if entry.lexicon.newWords %} + <a href="{{ path('app_lexicon_new_words', {id: entry.lexicon.id}) }}" class="btn btn-dark"><i class="bi bi-arrow-90deg-left"></i></a> + {% else %} + {% if not wiktionnaryLexicon %} + <a href="{{ path('app_lexicon_show', {id: entry.lexicon.id}) }}" class="btn btn-dark"><i class="bi bi-arrow-90deg-left"></i></a> + {% endif %} + {{ entry|capitalize }} + + {% set known = entry.headword.knownByUser(app.user) %} + <a title="{{ known ? 'Mot-vedette connu. Cliquer pour modifier'|trans : 'Mot-vedette non connu. Cliquer pour modifier'|trans }}" href="#" + class="ajax-link" data-method="GET" data-url="{{ path('app_headword_toggle_known', {id: entry.headword.id, userId: app.user.id, lexiconId: entry.lexicon.id}) }}"> + {% if known %}<i class="fa fa-circle text-success"></i>{% else %}<i class="fa fa-circle text-warning"></i>{% endif %} + </a> {% endif %} - {{ entry|capitalize }} - - {% set known = entry.headword.knownByUser(app.user) %} - <a title="{{ known ? 'Mot-vedette connu. Cliquer pour modifier'|trans : 'Mot-vedette non connu. Cliquer pour modifier'|trans }}" href="#" - class="ajax-link" data-method="GET" data-url="{{ path('app_headword_toggle_known', {id: entry.headword.id, userId: app.user.id, lexiconId: entry.lexicon.id}) }}"> - {% if known %}<i class="fa fa-circle text-success"></i>{% else %}<i class="fa fa-circle text-warning"></i>{% endif %} - </a> </h1> - <ul class="nav nav-tabs mt-3"> - {% for lexicon in app.user.myLexicons %} - {% set entryWithSameHeadwordInThisLexicon = lexicon.getEntryForHeadword(entry.headword) %} - - <li class="nav-item dropdown"> - <a class="nav-link {{ lexicon == entry.lexicon ? 'active' }} {{ entryWithSameHeadwordInThisLexicon ? 'tab-pink' : 'tab-grey' }} dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">{{ lexicon }}</a> - <ul class="dropdown-menu"> - {% if entryWithSameHeadwordInThisLexicon %} - {% if lexicon != entry.lexicon %} - <li><a class="dropdown-item" href="{{ path('app_entry_show', {id: entryWithSameHeadwordInThisLexicon.id}) }}">{{ "Voir l'entrée dans ce lexique"|trans }}</a></li> - {% endif %} - {% set backUrl = (lexicon == entry.lexicon ? path('app_lexicon_show', {id: entry.lexicon.id}) : path('app_entry_show', {id: entry.id})) %} - <li><a class="dropdown-item" href="#" - data-href="{{ path('app_entry_delete', {id: entryWithSameHeadwordInThisLexicon.id, backUrl: backUrl}) }}" - data-confirm="{{ "Confirmer la suppression ?"|trans }}" data-bs-toggle="modal" data-bs-target="#confirm-dialog"> - {{ "Supprimer l'entrée dans ce lexique"|trans }} - </a></li> - {% endif %} - {% if lexicon != entry.lexicon %} - {% if entryWithSameHeadwordInThisLexicon %} - <li><a class="dropdown-item" href="#" data-href="{{ path('app_entry_copy', {id: entry.id, lexiconId: lexicon.id}) }}" - data-confirm="{{ "Confirmer la copie ? Une entrée similaire existe déjà dans le lexique que vous avez sélectionné. Si vous copiez celle-ci, le contenu de l'autre sera perdue"|trans }}" data-bs-toggle="modal" data-bs-target="#confirm-dialog"> - {{ "Copier l'entrée dans ce lexique"|trans }} - </a></li> - {% else %} - <li><a class="dropdown-item" href="{{ path('app_entry_copy', {id: entry.id, lexiconId: lexicon.id}) }}">{{ "Copier l'entrée dans ce lexique"|trans }}</a></li> - {% endif %} - {% endif %} - </ul> - </li> + {% if not entry.lexicon.newWords %} + {% include "entry/_lexiconsTabs.html.twig" %} - {% endfor %} - - {% if not entry.lexicon.isNewWords %} - {% set zeroLexicon = lexicon_manager.zeroLexicon(entry.language) %} - {% set entryZero = zeroLexicon.getEntryForHeadword(entry.headword) %} - <li class="nav-item"> - <a class="nav-link {{ zeroLexicon == entry.lexicon ? 'active' }} tab-dark-pink" href="{{ path('app_entry_show', {id: entryZero.id}) }}">{{ "Wiktionnaire"|trans }}</a> - </li> - {% endif %} - </ul> + <div id="tabContent" class="{{ wiktionnaryLexicon ? 'tab-wiktionnary' }}"> - <div id="tabContent" class="{{ wiktionnaryLexicon ? 'tab-wiktionnary' }}"> - - <div class="row"> - <div class="col-sm-6"> - {% include "entry/_entryLabels.html.twig" %} + <div class="row"> + <div class="col-sm-6"> + {% include "entry/_entryLabels.html.twig" %} + </div> </div> - </div> - </div> + </div> + {% endif %} </div> </div> diff --git a/templates/home.html.twig b/templates/home.html.twig new file mode 100644 index 0000000000000000000000000000000000000000..ff0755c6f8c5b88ab465ff66111376b14ec2726b --- /dev/null +++ b/templates/home.html.twig @@ -0,0 +1,84 @@ +{% extends 'base.html.twig' %} +{% block container %}container-fluid{% endblock %} + +{% block title %}{{ "Accueil"|trans }}{% endblock %} + +{% block body %} + + <div class="row m-2 mb-5"> + <div class="col-md-12"> + + <div class="d-inline-block text-center" id="appLinksZone"> + <i class="fa fa-gamepad fa-4x"></i> + <br>MagicWorld + </div> + + <div class="row align-items-start"> + + <div class="col mt-5"> + + <h1>{{ "Mes lexiques"|trans }}</h1> + <div class="card mt-3"> + <div class="card-header"> + <div class="card-title pt-2 d-flex justify-content-between align-items-start"> + <a href="{{ path('app_lexicon_show', {id: app.user.lexicon.id}) }}">{{ app.user.lexicon|badge }} {{ "Lexique personnel"|trans }}</a> + <span>{{ lexicon_manager.entriesNb(app.user.lexicon) }}</span> + </div> + </div> + <div class="card-body d-flex justify-content-between align-items-start"> + {% for lexicon in app.user.myLexicons %} + {% if lexicon.masterGroup %} + <a href="{{ path('app_lexicon_show', {id: app.user.lexicon.id}) }}">{{ lexicon|badge }} {{ "Lexique du groupe"|trans }} « {{ lexicon }} »</a> + <span>{{ lexicon_manager.entriesNb(lexicon) }}</span> + {% endif %} + {% endfor %} + </div> + </div> + + <h1>{{ "Labels récents"|trans }}</h1> + <div class="card mt-3"> + <div class="card-body d-flex justify-content-between align-items-end"> + <span> + {% for label in label_manager.lastLabels(app.user) %} + <p> + <a href="{{ path('app_label_show', {id: label.id}) }}">{% include "label/_labelBadge.html.twig" %}</a> + </p> + {% endfor %} + </span> + <h3><a href="{{ path('app_label_index') }}">Voir tous</a></h3> + </div> + </div> + + <h1>{{ "Agora Des Néologismes"|trans }}</h1> + {% set newWordsLexicon = lexicon_manager.newWordsLexicon %} + <div class="card mt-3"> + <div class="card-body d-flex justify-content-between align-items-end"> + <span> + <p> + <i><strong>{{ lexicon_manager.newWordsNb }} propositions en cours :</strong></i> + </p> + {% for entry in lexicon_manager.lastNewWords %} + <p> + <a href="{{ path('app_entry_show', {id: entry.id}) }}">{{ entry }}</a> + </p> + {% endfor %} + </span> + <h3><a href="{{ path('app_lexicon_new_words', {id: newWordsLexicon.id}) }}">Voir tous</a></h3> + </div> + </div> + + </div> + + <div class="col"> + One of three columns + </div> + <div class="col"> + One of three columns + </div> + </div> + + + </div> + </div> + +{% endblock %} diff --git a/templates/lexicon/show.html.twig b/templates/lexicon/show.html.twig index 9e1f5c240468c7be76f6b14300924155870acee4..d9f1452531e774c5f9f7e436389d73c484ff609b 100644 --- a/templates/lexicon/show.html.twig +++ b/templates/lexicon/show.html.twig @@ -2,7 +2,7 @@ {% import 'macros.html.twig' as macros %} {% block container %}container-fluid{% endblock %} -{% block title %}{{ "Lexique"|trans }} {{ lexicon.id }}{% endblock %} +{% block title %}{{ "Lexique"|trans }} {{ lexicon|capitalize }}{% endblock %} {% block body %} diff --git a/templates/lexicon/showNewWords.html.twig b/templates/lexicon/showNewWords.html.twig new file mode 100644 index 0000000000000000000000000000000000000000..c11f2cd8158f35f62c4a0d19ed8a9b26e53e762b --- /dev/null +++ b/templates/lexicon/showNewWords.html.twig @@ -0,0 +1,82 @@ +{% extends 'base.html.twig' %} +{% import 'macros.html.twig' as macros %} +{% block container %}container-fluid{% endblock %} + +{% block title %}{{ "Agora Des Néologismes"|trans }}{% endblock %} + +{% block body %} + + <div class="row justify-content-center m-lg-5 m-sm-3"> + <div class="col-md-12"> + <h1 class=""> + {{ lexicon|badgeXl }} {{ "Agora Des Néologismes"|trans }} + </h1> + + <div class="row mt-4"> + <div class="col-sm-3"> + {{ form_start(form) }} + <div class="d-flex justify-content-between"> + {{ form_widget(form.searchString) }} + <button type="submit" title="{{ "Filtrer"|trans }}" class="btn btn-block btn-dark" style="margin-left: 10px"> + <i class="fa fa-search"></i> + </button> + <a href="{{ path('app_lexicon_show', {id: lexicon.id}) }}" title="{{ "Réinitialiser"|trans }}" class="btn btn-block btn-light" style="margin-left: 10px"> + <i class="fa fa-times"></i> + </a> + </div> + {{ form_end(form) }} + </div> + </div> + + <div class="row mt-4"> + <div class="col-md-12"> + +{# <form name="entries_selection" id="entriesSelection" action="{{ path('app_lexicon_process_selected_entries', {id: lexicon.id}) }}" method="post" novalidate="novalidate" autocomplete="off">#} + + <table class="table table-bordered"> + <thead> + <tr> + + <th class=""> + {{ macros.sorting_column_with_filter("Mot-vedette"|trans, 'value', _context, {id: lexicon.id}) }} + </th> + <th> + {{ macros.sorting_column_with_filter("Date de création"|trans, 'value', _context, {id: lexicon.id}) }} + </th> + <th> + {{ macros.sorting_column_with_filter("Auteur"|trans, 'value', _context, {id: lexicon.id}) }} + </th> + <th></th> + </tr> + </thead> + <tbody> + {% for entry in entries %} + {# @var entry \App\Entity\Entry #} + <tr> + <td>{{ entry }}</td> + <td>{{ entry.createdAt|date('d/m/Y') }}</td> + <td>{{ entry.createdBy }}</td> + <td> +{# {% for pos, definition in entry.formattedDefinitions %}#} +{# <a class="text-decoration-none" data-bs-toggle="collapse" href="#def-{{ entry.id }}-{{ loop.index }}" role="button" aria-expanded="false" aria-controls="collapseExample">#} +{# <span class="badge bg-definition text-black"><i class="bi-caret-right-fill"></i> {{ pos }}</span>#} +{# </a>#} +{# <div class="collapse" id="def-{{ entry.id }}-{{ loop.index }}">#} +{# <div class="card card-body card-definition">#} +{# {{ definition }}#} +{# </div>#} +{# </div>#} +{# {% endfor %}#} + </td> + </tr> + {% endfor %} + </tbody> + </table> + + </div> + </div> + + </div> + </div> + +{% endblock %} \ No newline at end of file