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

19
src/Controller/RoomController.php

@ -53,23 +53,26 @@ class RoomController extends AbstractController @@ -53,23 +53,26 @@ class RoomController extends AbstractController
$this->getParameter('app.kevacoin.password')
);
// Get room messages
$messages = [];
// Get room posts
$posts = [];
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 $this->render(
'default/room/index.html.twig',
[
'room' =>
[
'namespace' => $request->get('namespace')
],
'messages' => $messages,
'posts' => $posts,
'request' => $request
]
);

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

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

Loading…
Cancel
Save