diff --git a/src/Bundle/ChillMainBundle/Controller/NewsItemHistoryController.php b/src/Bundle/ChillMainBundle/Controller/NewsItemHistoryController.php
index d92cd3a6f..8c645828b 100644
--- a/src/Bundle/ChillMainBundle/Controller/NewsItemHistoryController.php
+++ b/src/Bundle/ChillMainBundle/Controller/NewsItemHistoryController.php
@@ -46,6 +46,21 @@ class NewsItemHistoryController extends AbstractController
]);
}
+ /**
+ * @Route("/{_locale}/news-items/{id}", name="chill_main_single_news_item")
+ */
+ public function showSingleItem(int $id, Request $request): Response
+ {
+ $newsItem = $this->newsItemRepository->findOneBy(['id' => $id]);
+
+ return $this->render(
+ '@ChillMain/NewsItem/show.html.twig',
+ [
+ 'entity' => $newsItem,
+ ]
+ );
+ }
+
private function buildFilterOrder($includeFilterByUser = true, $includeMissionType = false): FilterOrderHelper
{
$filterBuilder = $this->filterOrderHelperFactory
diff --git a/src/Bundle/ChillMainBundle/Resources/views/NewsItem/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/NewsItem/index.html.twig
index 307073496..4eb02945b 100644
--- a/src/Bundle/ChillMainBundle/Resources/views/NewsItem/index.html.twig
+++ b/src/Bundle/ChillMainBundle/Resources/views/NewsItem/index.html.twig
@@ -4,8 +4,8 @@
{% embed '@ChillMain/CRUD/_index.html.twig' %}
{% block table_entities_thead_tr %}
{{ 'Title'|trans }} |
- {{ 'dashboard.news.startDate'|trans }} |
- {{ 'dashboard.news.endDate'|trans }} |
+ {{ 'news.startDate'|trans }} |
+ {{ 'news.endDate'|trans }} |
{% endblock %}
{% block table_entities_tbody %}
{% for entity in entities %}
@@ -15,7 +15,7 @@
{% if entity.endDate is not null %}
{{ entity.endDate|date }} |
{% else %}
- {{ 'dashboard.news.noDate'|trans }} |
+ {{ 'news.noDate'|trans }} |
{% endif %}
diff --git a/src/Bundle/ChillMainBundle/Resources/views/NewsItem/news_items_history.html.twig b/src/Bundle/ChillMainBundle/Resources/views/NewsItem/news_items_history.html.twig
index fe5c70828..e462c3302 100644
--- a/src/Bundle/ChillMainBundle/Resources/views/NewsItem/news_items_history.html.twig
+++ b/src/Bundle/ChillMainBundle/Resources/views/NewsItem/news_items_history.html.twig
@@ -1,18 +1,18 @@
{% extends "@ChillMain/layout.html.twig" %}
{% block title %}
- {{ 'news_history.title'|trans }}
+ {{ 'news.title'|trans }}
{% endblock title %}
{% block content %}
- {{ 'news_history.title'|trans }}
+ {{ 'news.title'|trans }}
{{ filter_order|chill_render_filter_order_helper }}
{% if entities|length == 0 %}
- {{ "news_history.no_data"|trans }}
+ {{ "news.no_data"|trans }}
{% else %}
@@ -39,17 +39,20 @@
- {% apply markdown_to_html %}
- {{ entity.content }}
- {% endapply %}
+{# #}
+ {{ entity.content|u.truncate(350, '…', false)|chill_markdown_to_html }}
+{# {% if entity.content|length > 350 %}#}
+{# {{ 'news.read_more'|trans }}#}
+{# {% endif %}#}
+{# #}
+
-{# #}
-{# #}
-{# - #}
-{# #}
-{#
#}
-{# #}
-{# #}
diff --git a/src/Bundle/ChillMainBundle/Resources/views/NewsItem/show.html.twig b/src/Bundle/ChillMainBundle/Resources/views/NewsItem/show.html.twig
new file mode 100644
index 000000000..b86408183
--- /dev/null
+++ b/src/Bundle/ChillMainBundle/Resources/views/NewsItem/show.html.twig
@@ -0,0 +1,21 @@
+{% extends '@ChillMain/layout.html.twig' %}
+
+{% block title 'news.show_details'|trans %}
+
+{% block content %}
+ {{ entity.title }}
+
+
+
+
+ {{ entity.startDate|format_date('long') }}
+ {% if entity.endDate is not null %}
+ - {{ entity.endDate|format_date('long') }}
+ {% endif %}
+
+
+
+ {{ entity.content|chill_markdown_to_html }}
+
+
+{% endblock %}
diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml
index 98933f614..5d500f48e 100644
--- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml
+++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml
@@ -75,7 +75,6 @@ Comment: Commentaire
Comments: Commentaires
Pinned comment: Commentaire épinglé
Any comment: Aucun commentaire
-Read more: Lire la suite
(more...): (suite...)
# comment embeddable
@@ -683,13 +682,14 @@ admin:
news: Actualités
description: Configuration du tableau de bord
-dashboard:
- news:
- noDate: Pas de date de fin
- startDate: Date de début
- endDate: Date de fin
-news_history:
+news:
+ noDate: Pas de date de fin
+ startDate: Date de début
+ endDate: Date de fin
title: Historique des actualités
menu: Actualités
no_data: Aucune actualité
+ read_more: Lire la suite
+
+
|