From 0627366b2fb38e0786d8ec225601d90c023a058b Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 8 Sep 2014 11:17:44 -0700 Subject: Sort the public room list by display name. --- webclient/home/home.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webclient/home/home.html') diff --git a/webclient/home/home.html b/webclient/home/home.html index 7240e79f86..e3a49bb142 100644 --- a/webclient/home/home.html +++ b/webclient/home/home.html @@ -24,7 +24,7 @@

Public rooms

-
+
{{ room.room_display_name }}
-- cgit 1.4.1 From de727f854a81c0a5610d82c4e173c13831836e9e Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 8 Sep 2014 11:33:12 -0700 Subject: Make #matrix public rooms bold to make them stand out from the other public rooms. Ideally this would be metadata in /publicRooms to say something like 'featured channel', but for now, just make it a client side check. --- webclient/app.css | 4 ++++ webclient/home/home.html | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'webclient/home/home.html') diff --git a/webclient/app.css b/webclient/app.css index 7698cb4fda..0c6ae9b668 100755 --- a/webclient/app.css +++ b/webclient/app.css @@ -269,6 +269,10 @@ a:active { color: #000; } background-color: #faa; } +.roomHighlight { + font-weight: bold; +} + /*** Participant list ***/ #usersTableWrapper { diff --git a/webclient/home/home.html b/webclient/home/home.html index e3a49bb142..12b3c7f14e 100644 --- a/webclient/home/home.html +++ b/webclient/home/home.html @@ -26,7 +26,10 @@
-- cgit 1.4.1 From 76fe7d4eba334cee8b5c18ac26da709106dff1a2 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 8 Sep 2014 12:11:36 -0700 Subject: Added num_joined_users key to /publicRooms for each room. Show this information in the webclient. --- synapse/handlers/room.py | 6 ++++++ webclient/app.css | 4 ++++ webclient/home/home.html | 5 ++++- webclient/recents/recents.html | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) (limited to 'webclient/home/home.html') diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py index a0d0f2af16..310cb46fe7 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py @@ -593,6 +593,12 @@ class RoomListHandler(BaseHandler): @defer.inlineCallbacks def get_public_room_list(self): chunk = yield self.store.get_rooms(is_public=True) + for room in chunk: + joined_members = yield self.store.get_room_members( + room_id=room["room_id"], + membership=Membership.JOIN + ) + room["num_joined_members"] = len(joined_members) # FIXME (erikj): START is no longer a valid value defer.returnValue({"start": "START", "end": "END", "chunk": chunk}) diff --git a/webclient/app.css b/webclient/app.css index 0c6ae9b668..b438cf0405 100755 --- a/webclient/app.css +++ b/webclient/app.css @@ -273,6 +273,10 @@ a:active { color: #000; } font-weight: bold; } +.publicRoomEntry { + margin-bottom: 5px; +} + /*** Participant list ***/ #usersTableWrapper { diff --git a/webclient/home/home.html b/webclient/home/home.html index 12b3c7f14e..cf6771814c 100644 --- a/webclient/home/home.html +++ b/webclient/home/home.html @@ -25,11 +25,14 @@

Public rooms

-
+
{{ room.room_display_name }} +
+ {{ room.num_joined_members }} {{ room.num_joined_members == 1 ? 'user' : 'users' }} +

diff --git a/webclient/recents/recents.html b/webclient/recents/recents.html index b903412815..efc5c39689 100644 --- a/webclient/recents/recents.html +++ b/webclient/recents/recents.html @@ -9,7 +9,7 @@ {{ room.room_id | mRoomName }} - {{ room.numUsersInRoom }} users + {{ room.numUsersInRoom }} {{ room.numUsersInRoom == 1 ? 'user' : 'users' }} {{ (room.lastMsg.ts) | date:'MMM d HH:mm' }} -- cgit 1.4.1 From e0954f3b365c3f9f99ab8d91fc18ff933d836e72 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 8 Sep 2014 12:15:20 -0700 Subject: Better checks are better. --- webclient/home/home.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webclient/home/home.html') diff --git a/webclient/home/home.html b/webclient/home/home.html index cf6771814c..f3abd76a05 100644 --- a/webclient/home/home.html +++ b/webclient/home/home.html @@ -30,7 +30,7 @@ ng-class="room.room_display_name.toLowerCase().indexOf('#matrix:') === 0 ? 'roomHighlight' : ''"> {{ room.room_display_name }} -
+
{{ room.num_joined_members }} {{ room.num_joined_members == 1 ? 'user' : 'users' }}
-- cgit 1.4.1 From 054fad5360a925635fc392e5e6fa853f9b034e39 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 8 Sep 2014 13:28:55 -0700 Subject: Float right the num users, apply room highlight to user count. --- webclient/app.css | 5 +++++ webclient/home/home.html | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'webclient/home/home.html') diff --git a/webclient/app.css b/webclient/app.css index b438cf0405..19fae632ff 100755 --- a/webclient/app.css +++ b/webclient/app.css @@ -274,9 +274,14 @@ a:active { color: #000; } } .publicRoomEntry { + max-width: 480px; margin-bottom: 5px; } +.publicRoomJoinedUsers { + float: right; +} + /*** Participant list ***/ #usersTableWrapper { diff --git a/webclient/home/home.html b/webclient/home/home.html index f3abd76a05..6d599e6849 100644 --- a/webclient/home/home.html +++ b/webclient/home/home.html @@ -30,7 +30,8 @@ ng-class="room.room_display_name.toLowerCase().indexOf('#matrix:') === 0 ? 'roomHighlight' : ''"> {{ room.room_display_name }} -
+
{{ room.num_joined_members }} {{ room.num_joined_members == 1 ? 'user' : 'users' }}
-- cgit 1.4.1 From df50a6823fdc60cdb7cb3a6497b1067cca63fc33 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 8 Sep 2014 17:14:58 -0700 Subject: Display public room topics if they exist on the public room list. --- webclient/app.css | 7 +++++++ webclient/home/home.html | 3 +++ 2 files changed, 10 insertions(+) (limited to 'webclient/home/home.html') diff --git a/webclient/app.css b/webclient/app.css index 7c367df421..ab3d815e00 100755 --- a/webclient/app.css +++ b/webclient/app.css @@ -276,6 +276,13 @@ a:active { color: #000; } float: right; } +.publicRoomTopic { + color: #888; + font-size: 12px; + padding-right: 5px; + float: right; +} + #roomName { font-size: 16px; text-align: right; diff --git a/webclient/home/home.html b/webclient/home/home.html index 6d599e6849..023ae1a40c 100644 --- a/webclient/home/home.html +++ b/webclient/home/home.html @@ -34,6 +34,9 @@ ng-show="room.num_joined_members"> {{ room.num_joined_members }} {{ room.num_joined_members == 1 ? 'user' : 'users' }}
+
+ {{ room.topic }} +

-- cgit 1.4.1 From a2cd942a951d1f8cba4fda1b38ec29171253ab03 Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Fri, 12 Sep 2014 16:46:20 +0200 Subject: Fixed public room name and users count alignement Put data into a table to ease layout and manage long strings --- webclient/app.css | 32 ++++++++++++++++++++++---------- webclient/home/home.html | 39 ++++++++++++++++++++++++--------------- 2 files changed, 46 insertions(+), 25 deletions(-) (limited to 'webclient/home/home.html') diff --git a/webclient/app.css b/webclient/app.css index 1b918f59e2..a277bd2a59 100755 --- a/webclient/app.css +++ b/webclient/app.css @@ -268,26 +268,38 @@ a:active { color: #000; } font-weight: bold; } -.publicRoomEntry { +.publicTable { max-width: 480px; - margin-bottom: 5px; - border-bottom: 1px #ddd solid; + width: 100%; + border-collapse: collapse; +} +.publicTable tr { + width: 100%; +} +.publicTable td { + vertical-align: text-top; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.publicRoomEntry { + max-width: 430px; } .publicRoomJoinedUsers { - float: right; + width: 5em; + text-align: right; + font-size: 12px; + color: #888; } .publicRoomTopic { color: #888; font-size: 12px; - padding-right: 5px; - width: 15em; - float: right; - text-align: right; overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; + padding-bottom: 5px; + border-bottom: 1px #ddd solid; } #roomName { diff --git a/webclient/home/home.html b/webclient/home/home.html index 023ae1a40c..5a1e18e1de 100644 --- a/webclient/home/home.html +++ b/webclient/home/home.html @@ -24,21 +24,30 @@

Public rooms

-
-
- - {{ room.room_display_name }} - -
- {{ room.num_joined_members }} {{ room.num_joined_members == 1 ? 'user' : 'users' }} -
-
- {{ room.topic }} -
-
-
+ + + + + + + + + + +
+ + {{ room.room_display_name }} + + +
+ {{ room.num_joined_members }} {{ room.num_joined_members == 1 ? 'user' : 'users' }} +
+
+ {{ room.topic }} +

-- cgit 1.4.1