Skip to content
Snippets Groups Projects
Commit bd58cced authored by Pierre Fleutot's avatar Pierre Fleutot
Browse files

Fix visibilité labels. Fix page entrée du lexique Zéro

parent 8d91b84f
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,6 @@ class EntryController extends AppBaseController
return $this->render('entry/show.html.twig', array(
'entry' => $entry,
'wiktionnaryLexicon' => false,
));
}
......
......@@ -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)
......
......@@ -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 .'|'.
......
......@@ -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;
......
<h3>{{ entry }}</h3>
\ No newline at end of file
{{ dump(entry.attributes) }}
\ No newline at end of file
......@@ -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>
......
......@@ -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>
......
<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) %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment