From 18554be67744ca97598c6220bb299f0423bfcd85 Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 6 Dec 2023 10:02:02 +0200 Subject: [PATCH] complete rss feature --- public/css/default.css | 5 +++++ src/Controller/RoomController.php | 12 ++++++++++-- templates/default/module/room.html.twig | 5 +++++ templates/default/room/index.rss.twig | 4 ++-- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/public/css/default.css b/public/css/default.css index 76fca60..597dce7 100644 --- a/public/css/default.css +++ b/public/css/default.css @@ -116,6 +116,11 @@ main ul li > span > svg float: right; } +main > sup > a > svg +{ + fill: #ee784e; +} + footer { /*backdrop-filter: blur(100px);*/ diff --git a/src/Controller/RoomController.php b/src/Controller/RoomController.php index 23a39e4..4ff80c1 100644 --- a/src/Controller/RoomController.php +++ b/src/Controller/RoomController.php @@ -166,15 +166,23 @@ class RoomController extends AbstractController ); // RSS - if ('RSS' === $request->get('feed')) + if ('rss' === $request->get('feed')) { + $response = new Response(); + + $response->headers->set( + 'Content-Type', + 'text/xml' + ); + return $this->render( 'default/room/index.rss.twig', [ 'name' => $name, 'feed' => $feed, 'request' => $request - ] + ], + $response ); } diff --git a/templates/default/module/room.html.twig b/templates/default/module/room.html.twig index 3c64fb4..b0c5ac9 100644 --- a/templates/default/module/room.html.twig +++ b/templates/default/module/room.html.twig @@ -12,6 +12,11 @@ {{ name }} {% endif %} + + + + + {% set i = i + 1 %} {% endfor %} {% endif %} diff --git a/templates/default/room/index.rss.twig b/templates/default/room/index.rss.twig index 7ad3002..4ff3b9a 100644 --- a/templates/default/room/index.rss.twig +++ b/templates/default/room/index.rss.twig @@ -6,8 +6,8 @@ {{ url('room_namespace', { namespace : request.get('namespace') }) }} {% for post in feed %} - {{ post.user }} - #{{ post.user }} + @{{ post.user }} + @{{ post.user }} {{ post.timestamp | date('D, d M Y h:i:s O') }} {{ url('room_namespace', { namespace : request.get('namespace') }) }}#{{ post.id }} {{ url('room_namespace', { namespace : request.get('namespace') }) }}#{{ post.id }}