mirror of
https://github.com/kevachat/webapp.git
synced 2025-01-10 23:08:14 +00:00
update room list menu
This commit is contained in:
parent
dc4e9d61c2
commit
ed126c5fb0
@ -64,13 +64,11 @@ main
|
||||
display: block;
|
||||
}
|
||||
|
||||
main > h1
|
||||
main > h2
|
||||
{
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
margin: 16px 0;
|
||||
padding: 0 4px;
|
||||
text-align: right;
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
margin: 16px 4px;
|
||||
}
|
||||
|
||||
main > form > input[type="text"]
|
||||
|
@ -60,14 +60,21 @@ class ModuleController extends AbstractController
|
||||
|
||||
$list = [];
|
||||
|
||||
$rooms = explode('|', $this->getParameter('app.kevacoin.room.namespaces'));
|
||||
|
||||
foreach ((array) $client->kevaListNamespaces() as $value)
|
||||
{
|
||||
// Get current room namespace (could be third-party)
|
||||
if ($value['namespaceId'] == $request->get('namespace'))
|
||||
{
|
||||
$name = $value['displayName'];
|
||||
}
|
||||
|
||||
$list[$value['namespaceId']] = $value['displayName'];
|
||||
// Check namespace enabled as room in settings
|
||||
if (in_array($value['namespaceId'], $rooms))
|
||||
{
|
||||
$list[$value['namespaceId']] = $value['displayName'];
|
||||
}
|
||||
}
|
||||
|
||||
asort($list);
|
||||
|
@ -1,10 +1,24 @@
|
||||
<form name="room" action="{{ path('room_index') }}" method="get">
|
||||
<input type="text" name="namespace" value="{{ room.namespace }}" placeholder="{{ 'join room by kevacoin namespace...' | trans }}" />
|
||||
</form>
|
||||
{% if list %}
|
||||
{% set i = 0 %}
|
||||
{% for namespace, name in list %}
|
||||
{% if i %}•{% endif %}
|
||||
<h2>
|
||||
{% if room.namespace == namespace %}
|
||||
{{ name }}
|
||||
{% else %}
|
||||
<a href="{{ namespace }}">{{ name }}</a>
|
||||
{% endif %}
|
||||
</h2>
|
||||
{% set i = i + 1 %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{# @TODO alternative implementation draft
|
||||
{% if room.name %}
|
||||
<h1>{{ room.name }}</h1>
|
||||
{% endif %}
|
||||
{# @TODO
|
||||
{% if list %}
|
||||
<ul>
|
||||
{% for namespace, name in list %}
|
||||
|
Loading…
Reference in New Issue
Block a user