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>
|
2022-04-17 22:28:37 +02:00
|
|
|
<%def name="render(room)">
|
2022-04-17 23:16:18 +02:00
|
|
|
|
2022-04-18 00:09:18 +02:00
|
|
|
<div class="room">
|
|
|
|
<div class="info">
|
|
|
|
% if 'avatar_url' in room:
|
|
|
|
<img class="avatar roomAvatar" src=${mxc2url(room['avatar_url'])}>
|
2022-04-17 23:16:18 +02:00
|
|
|
% endif
|
2022-04-18 00:09:18 +02:00
|
|
|
|
2022-04-17 23:16:18 +02:00
|
|
|
|
2022-04-18 00:09:18 +02:00
|
|
|
% if 'room_id' in room:
|
|
|
|
% if 'children' not in room:
|
|
|
|
<a href="https://view.matrix.org/room/${room['room_id']}">
|
|
|
|
% endif
|
|
|
|
|
|
|
|
% if 'name' in room:
|
|
|
|
<div> ${room['name']} </div>
|
|
|
|
% endif
|
|
|
|
|
|
|
|
</a>
|
|
|
|
% endif
|
|
|
|
</div>
|
2022-04-17 23:16:18 +02:00
|
|
|
|
2022-04-17 22:28:37 +02:00
|
|
|
% if 'children' in room:
|
2022-04-18 00:09:18 +02:00
|
|
|
<details>
|
2022-04-17 22:28:37 +02:00
|
|
|
% for subroom in room['children']:
|
2022-04-18 00:09:18 +02:00
|
|
|
${render(subroom)}
|
2022-04-17 22:28:37 +02:00
|
|
|
% endfor
|
2022-04-18 00:09:18 +02:00
|
|
|
</details>
|
2022-01-15 14:40:52 +01:00
|
|
|
% endif
|
2022-04-18 00:09:18 +02:00
|
|
|
</div>
|
2022-04-17 23:16:18 +02:00
|
|
|
|
2022-01-15 14:40:52 +01:00
|
|
|
</%def>
|
|
|
|
|
|
|
|
${render(s)}
|
|
|
|
</body>
|
|
|
|
</html>
|