libregamingspaces/spaces.html

46 lines
1.2 KiB
HTML
Raw Normal View History

2022-04-17 17:56:33 +02:00
<%!
def mxc2url(mxc):
serverName = mxc.split('/')[2]
mediaId = mxc.split('/')[3]
return "https://matrix.org/_matrix/media/v3/download/" + serverName + "/" + mediaId
%>
2022-01-15 14:40:52 +01:00
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="main.css">
</head>
<body>
<%def name="render(room)">
2022-04-17 17:56:33 +02:00
<table>
2022-01-15 14:40:52 +01:00
<tbody>
<tr>
2022-04-17 17:56:33 +02:00
% if 'avatar_url' in room:
2022-04-17 23:16:18 +02:00
<td><img class="avatar roomAvatar" src=${mxc2url(room['avatar_url'])}>
2022-04-17 17:56:33 +02:00
% endif
2022-04-17 23:16:18 +02:00
% if 'room_id' in room:
<a href="https://view.matrix.org/room/${room['room_id']}">
% if 'name' in room:
<div> ${room['name']} </div>
% endif
</a>
% endif
</td>
</tr>
% if 'children' in room:
% for subroom in room['children']:
<tr><td>${render(subroom)}</td></tr>
% endfor
2022-01-15 14:40:52 +01:00
% endif
2022-04-17 23:16:18 +02:00
2022-01-15 14:40:52 +01:00
</tbody>
2022-04-17 17:56:33 +02:00
</table>
2022-01-15 14:40:52 +01:00
</%def>
${render(s)}
</body>
</html>