mirror of
https://github.com/kevachat/webapp.git
synced 2025-01-11 15:28:03 +00:00
complete rss feature
This commit is contained in:
parent
8094de23a4
commit
18554be677
@ -116,6 +116,11 @@ main ul li > span > svg
|
||||
float: right;
|
||||
}
|
||||
|
||||
main > sup > a > svg
|
||||
{
|
||||
fill: #ee784e;
|
||||
}
|
||||
|
||||
footer
|
||||
{
|
||||
/*backdrop-filter: blur(100px);*/
|
||||
|
@ -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
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,11 @@
|
||||
<a href="{{ path('room_namespace', { namespace : namespace }) }}">{{ name }}</a>
|
||||
{% endif %}
|
||||
</h2>
|
||||
<sup>
|
||||
<a href="{{ path('room_namespace', { namespace : namespace, feed : 'rss' }) }}" title="{{ 'RSS' | trans }}"><svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 16 16">
|
||||
<path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm1.5 2.5c5.523 0 10 4.477 10 10a1 1 0 1 1-2 0 8 8 0 0 0-8-8 1 1 0 0 1 0-2m0 4a6 6 0 0 1 6 6 1 1 0 1 1-2 0 4 4 0 0 0-4-4 1 1 0 0 1 0-2m.5 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"/>
|
||||
</svg></a>
|
||||
</sup>
|
||||
{% set i = i + 1 %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
@ -6,8 +6,8 @@
|
||||
<link>{{ url('room_namespace', { namespace : request.get('namespace') }) }}</link>
|
||||
{% for post in feed %}
|
||||
<item>
|
||||
<title>{{ post.user }}</title>
|
||||
<author>#{{ post.user }}</author>
|
||||
<title>@{{ post.user }}</title>
|
||||
<author>@{{ post.user }}</author>
|
||||
<pubDate>{{ post.timestamp | date('D, d M Y h:i:s O') }}</pubDate>
|
||||
<guid>{{ url('room_namespace', { namespace : request.get('namespace') }) }}#{{ post.id }}</guid>
|
||||
<link>{{ url('room_namespace', { namespace : request.get('namespace') }) }}#{{ post.id }}</link>
|
||||
|
Loading…
Reference in New Issue
Block a user