diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php index 8b61ae4f1..aa025bdfe 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -563,7 +563,8 @@ class ChillMainExtension extends Extension implements 'template' => '@ChillMain/NewsItem/new.html.twig', ], 'view' => [ - 'role' => '', + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillMain/NewsItem/view_admin.html.twig' ], 'edit' => [ 'role' => 'ROLE_ADMIN', diff --git a/src/Bundle/ChillMainBundle/Resources/views/NewsItem/_list.html.twig b/src/Bundle/ChillMainBundle/Resources/views/NewsItem/_list.html.twig new file mode 100644 index 000000000..11ca95995 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/NewsItem/_list.html.twig @@ -0,0 +1,30 @@ +
+
+

+ {{ entity.title }} +

+
+
+

+ {% if entity.startDate %} + {{ entity.startDate|format_date('long') }} + {% endif %} + {% if entity.endDate %} + - {{ entity.endDate|format_date('long') }} + {% endif %} +

+
+
+
+ {{ entity.content|u.truncate(350, '… [' ~ ('news.read_more'|trans) ~ '](' ~ chill_path_add_return_path('chill_main_single_news_item', { 'id': entity.id } ) ~ ')', false)|chill_markdown_to_html }} +
+
+
+ +
+
+ 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..ed11908ec --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/NewsItem/_show.html.twig @@ -0,0 +1,13 @@ +
+
+

+ {{ entity.startDate|format_date('long') }} + {% if entity.endDate is not null %} + - {{ entity.endDate|format_date('long') }} + {% endif %} +

+
+
+ {{ entity.content|chill_markdown_to_html }} +
+
diff --git a/src/Bundle/ChillMainBundle/Resources/views/NewsItem/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/NewsItem/index.html.twig index 3e5d08cee..4ac053e7f 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/NewsItem/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/NewsItem/index.html.twig @@ -19,6 +19,9 @@ {% endif %}