libregamingspaces/spaces.html

46 lines
1.3 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:
<td><img class="avatar roomAvatar" src=${mxc2url(room['avatar_url'])}></td>
% endif
% if 'children' in room:
<td><div>${room['name']} </div></td>
2022-04-17 17:56:33 +02:00
</tr>
% for subroom in room['children']:
<tr><td>${render(subroom)}</td></tr>
% endfor
2022-01-15 14:40:52 +01:00
% else:
% if 'room_id' in room:
2022-04-17 17:56:33 +02:00
<td><a href="https://view.matrix.org/room/${room['room_id']}">
2022-01-15 14:40:52 +01:00
% if 'name' in room:
2022-04-17 17:56:33 +02:00
<div> ${room['name']} </div>
2022-01-15 14:40:52 +01:00
% endif
2022-04-17 17:56:33 +02:00
</a> </td>
2022-01-15 14:40:52 +01:00
% endif
2022-04-17 17:56:33 +02:00
</tr>
2022-01-15 14:40:52 +01:00
% endif
</tbody>
2022-04-17 17:56:33 +02:00
</table>
2022-01-15 14:40:52 +01:00
</%def>
${render(s)}
</body>
</html>