diff --git a/src/Controller/EntryController.php b/src/Controller/EntryController.php index da121c16befca3e443cf1e7228a48b84bab7f937..90d0e04a561a3584230ece2a91915000e713074c 100644 --- a/src/Controller/EntryController.php +++ b/src/Controller/EntryController.php @@ -30,7 +30,6 @@ class EntryController extends AppBaseController return $this->render('entry/show.html.twig', array( 'entry' => $entry, - 'wiktionnaryLexicon' => false, )); } diff --git a/src/Controller/WiktionnaryController.php b/src/Controller/WiktionnaryController.php index 78a856308399fb65f8132f5ef46cd82434800c35..c04f9c5e423e91dd49ac407940d009941e370e58 100644 --- a/src/Controller/WiktionnaryController.php +++ b/src/Controller/WiktionnaryController.php @@ -22,6 +22,8 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; class WiktionnaryController extends AppBaseController { /** + * PAS UTILISÉ + * * @Route("/{id}/show", name="app_wiktionnary_show", requirements={"id" = "\d+"}) */ public function show(LabelManager $labelManager, Request $request, Entry $entry) diff --git a/src/Entity/Label.php b/src/Entity/Label.php index e3ae077e474ce9622b16084c7b737c9596fd025e..cadacbc6a12db65cbb4f9e27879f8047c0ef9a26 100644 --- a/src/Entity/Label.php +++ b/src/Entity/Label.php @@ -30,6 +30,12 @@ class Label self::LABEL_CATEGORY_MILESTONE => self::LABEL_CATEGORY_MILESTONE, ]; + const COMMON_LABEL_LIST_CATEGORIES = [ + self::LABEL_CATEGORY_INSTITUTIONAL => self::LABEL_CATEGORY_INSTITUTIONAL, + self::LABEL_CATEGORY_GENERAL => self::LABEL_CATEGORY_GENERAL, + self::LABEL_CATEGORY_MILESTONE => self::LABEL_CATEGORY_MILESTONE, + ]; + const REQUIREMENTS_LABEL_CATEGORY = self::LABEL_CATEGORY_INSTITUTIONAL .'|'. self::LABEL_CATEGORY_MORPHOLOGICAL .'|'. diff --git a/src/Repository/LabelRepository.php b/src/Repository/LabelRepository.php index 9d731f82d4d9dce85cbb2f09cd770384d78059de..880cd20ba4efb669e8680c2a61d9d0c7e7088cf5 100644 --- a/src/Repository/LabelRepository.php +++ b/src/Repository/LabelRepository.php @@ -115,10 +115,12 @@ class LabelRepository extends ServiceEntityRepository $qb = $this->createQueryBuilder('l') ->andWhere('l.master != :personal OR l.user = :user') ->andWhere('l.category != :milestone OR l.user = :user') + ->andWhere('l.category IN (:commonLabelCategories)') ->setParameter('milestone', Label::LABEL_CATEGORY_MILESTONE) ->setParameter('personal', Label::MASTER_PERSONAL) + ->setParameter('commonLabelCategories', Label::COMMON_LABEL_LIST_CATEGORIES) ->setParameter('user', $user) - ->orderBy('l.createdAt', 'DESC') + ->orderBy('l.updatedAt', 'DESC') ; return $qb; diff --git a/templates/entry/_entryAttributes.html.twig b/templates/entry/_entryAttributes.html.twig index 8edfe82c5a942f1c58d55a7daa9735c6252ccaf4..28f6ae85fdd242d6856a41b6f94560d960b3a924 100644 --- a/templates/entry/_entryAttributes.html.twig +++ b/templates/entry/_entryAttributes.html.twig @@ -1 +1 @@ -<h3>{{ entry }}</h3> \ No newline at end of file +{{ dump(entry.attributes) }} \ No newline at end of file diff --git a/templates/entry/show.html.twig b/templates/entry/show.html.twig index 9fb7e70596d544dc5aee9623bf32f9ca9caef53c..71ffa1fb14cd118a9a1863fc42642885c2570dcf 100644 --- a/templates/entry/show.html.twig +++ b/templates/entry/show.html.twig @@ -19,7 +19,7 @@ </h1> {% else %} <h1> - {% if not wiktionnaryLexicon %} + {% if not entry.lexicon.zero %} <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 }} @@ -35,12 +35,13 @@ {% if not entry.lexicon.newWords %} {% include "entry/_lexiconsTabs.html.twig" %} - <div id="tabContent" class="{{ wiktionnaryLexicon ? 'tab-wiktionnary' }}"> + <div id="tabContent" class="{{ entry.lexicon.zero ? 'tab-wiktionnary' }}"> <div class="row"> <div class="col-sm-6"> {% include "entry/_entryLabels.html.twig" %} + {% include "entry/_entryAttributes.html.twig" %} </div> </div> diff --git a/templates/home.html.twig b/templates/home.html.twig index 7128250d1a0d2ea8fd40d683332afb437a71676f..7bfce711a2a96c590baa91dd4ba7dcc1670724fe 100644 --- a/templates/home.html.twig +++ b/templates/home.html.twig @@ -83,6 +83,9 @@ <h1 class="mt-5">{{ "Mot du jour"|trans }}</h1> <div class="card mt-3"> <div class="card-body bg-pink"> + <a href="{{ path('app_entry_show', {id: entry.id}) }}"> + <h3>{{ entry }}</h3> + </a> {% include "entry/_entryAttributes.html.twig" %} </div> </div> diff --git a/templates/label/_labelBadge.html.twig b/templates/label/_labelBadge.html.twig index 31a2744f8f5e226912089bd143b792828194fb90..a70ab0ecf44f74844346f773bf9748bbfbf9fde8 100644 --- a/templates/label/_labelBadge.html.twig +++ b/templates/label/_labelBadge.html.twig @@ -1,5 +1,5 @@ <div class="badge rounded-pill {{ label.isMilestone ? 'badge-milestone'}} position-relative text-black {{ label|labelClass }}" style="margin-right: 5px;" - title="{{ label.description }}"> + title="{{ label.description }}. Updated: {{ label.updatedAt|date('d/m/Y') }}"> {{ label }} {% if label.isMilestone %}<br>{{ label.getMilestone|date('d/m/Y') }}{% endif %} {% if showHeadwordsCounter|default(false) %}