Browse Source

draft post list features

main
ghost 1 year ago
parent
commit
26a90a3ae0
  1. 2
      public/css/default.css
  2. 19
      src/Controller/RoomController.php
  3. 9
      templates/default/room/index.html.twig

2
public/css/default.css

@ -70,6 +70,7 @@ main > h1
font-weight: normal; font-weight: normal;
margin: 16px 0; margin: 16px 0;
padding: 0 4px; padding: 0 4px;
text-align: right;
} }
main > form > input[type="text"] main > form > input[type="text"]
@ -89,6 +90,7 @@ main > ul
main > ul > li main > ul > li
{ {
margin: 8px 0; margin: 8px 0;
word-wrap: break-word;
} }
footer footer

19
src/Controller/RoomController.php

@ -53,23 +53,26 @@ class RoomController extends AbstractController
$this->getParameter('app.kevacoin.password') $this->getParameter('app.kevacoin.password')
); );
// Get room messages // Get room posts
$messages = []; $posts = [];
foreach ((array) $client->kevaFilter($request->get('namespace')) as $message) foreach ((array) $client->kevaFilter($request->get('namespace')) as $message)
{ {
$messages[] = $message; $posts[] =
[
'key' => $message['key'],
'value' => $message['value'],
'height' => $message['height'],
'vout' => $message['vout'],
'txid' => $message['txid'],
];
} }
// Return result // Return result
return $this->render( return $this->render(
'default/room/index.html.twig', 'default/room/index.html.twig',
[ [
'room' => 'posts' => $posts,
[
'namespace' => $request->get('namespace')
],
'messages' => $messages,
'request' => $request 'request' => $request
] ]
); );

9
templates/default/room/index.html.twig

@ -10,6 +10,15 @@
) )
) )
}} }}
{% if posts %}
<ul>
{% for post in posts %}
<li>
{{ post.value }}
</li>
{% endfor %}
</ul>
{% endif %}
{% endblock %} {% endblock %}
{% block footer_content %} {% block footer_content %}
{{ {{

Loading…
Cancel
Save