diff --git a/public/css/default.css b/public/css/default.css index 11a1baf..684c1ac 100644 --- a/public/css/default.css +++ b/public/css/default.css @@ -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 main > ul > li { margin: 8px 0; + word-wrap: break-word; } footer diff --git a/src/Controller/RoomController.php b/src/Controller/RoomController.php index c678e59..94e3acc 100644 --- a/src/Controller/RoomController.php +++ b/src/Controller/RoomController.php @@ -53,24 +53,27 @@ 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, - 'request' => $request + 'posts' => $posts, + 'request' => $request ] ); } diff --git a/templates/default/room/index.html.twig b/templates/default/room/index.html.twig index 95ee2b7..739fe41 100644 --- a/templates/default/room/index.html.twig +++ b/templates/default/room/index.html.twig @@ -10,6 +10,15 @@ ) ) }} + {% if posts %} +