fix room list

This commit is contained in:
ghost 2023-12-05 05:16:06 +02:00
parent 666dd91a3e
commit 21f47db55b
4 changed files with 58 additions and 3 deletions

View File

@ -64,6 +64,14 @@ main
display: block;
}
main > h1
{
font-size: 14px;
font-weight: normal;
margin: 16px 0;
padding: 0 4px;
}
main > form > input[type="text"]
{
box-sizing: border-box;
@ -71,6 +79,18 @@ main > form > input[type="text"]
width: 100%;
}
main > ul
{
margin-bottom: 16px;
margin-left: 16px;
margin-top: 16px;
}
main > ul > li
{
margin: 8px 0;
}
footer
{
display: block;

View File

@ -48,16 +48,29 @@ class ModuleController extends AbstractController
$this->getParameter('app.kevacoin.password')
);
$name = null;
$list = [];
foreach ((array) $client->kevaListNamespaces() as $value)
{
if ($value['namespaceId'] == $request->get('namespace'))
{
$name = $value['displayName'];
}
$list[$value['namespaceId']] = $value['displayName'];
}
asort($list);
return $this->render(
'default/module/room.html.twig',
[
'room' => $request->get('room'),
'room' => [
'name' => $name,
'namespace' => $request->get('namespace')
],
'list' => $list
]
);

View File

@ -65,6 +65,10 @@ class RoomController extends AbstractController
return $this->render(
'default/room/index.html.twig',
[
'room' =>
[
'namespace' => $request->get('namespace')
],
'messages' => $messages,
'request' => $request
]

View File

@ -1,3 +1,21 @@
<form name="room" action="{{ path('room_index') }}" method="get">
<input type="text" name="room" value="{{ room }}" placeholder="{{ 'join room by kevacoin namespace...' | trans }}" />
</form>
<input type="text" name="namespace" value="{{ room.namespace }}" placeholder="{{ 'join room by kevacoin namespace...' | trans }}" />
</form>
{% if room.name %}
<h1>{{ room.name }}</h1>
{% endif %}
{# @TODO
{% if list %}
<ul>
{% for namespace, name in list %}
<li>
{% if room.namespace == namespace %}
{{ name }}
{% else %}
<a href="{{ namespace }}">{{ name }}</a>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
#}