libregamingspaces/spaces.html

72 lines
2.5 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 23:16:18 +02:00
2022-04-18 00:09:18 +02:00
<div class="room">
2022-04-18 00:19:31 +02:00
% if room['name'] != "TOP":
% if room['name'].startswith('Libre Gaming'):
<details open><summary>
% elif room['name'] != "TOP" and room['name'] != "Libre Gaming" and 'children' in room:
2022-04-18 00:19:31 +02:00
<details><summary>
% endif
2022-04-18 00:09:18 +02:00
<div class="info">
2022-04-18 01:01:00 +02:00
% if room['name'] != "TOP" and room['name'] != "Libre Gaming" and 'children' in room:
<div class="arrow-right"></div>
% endif
2022-04-18 00:09:18 +02:00
% if 'avatar_url' in room:
<img class="avatar roomAvatar" src=${mxc2url(room['avatar_url'])}>
2022-04-18 01:10:44 +02:00
% else:
2022-06-11 20:07:50 +02:00
<div class="avatar roomAvatar"></div>
2022-04-18 01:10:44 +02:00
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 'canonical_alias' in room:
<a href="https://matrix.to/#/${room['canonical_alias']}">
% elif 'children' not in room and room['world_readable']:
2022-04-18 00:09:18 +02:00
<a href="https://view.matrix.org/room/${room['room_id']}">
% endif
% if 'name' in room:
<div> ${room['name']} </div>
% endif
</a>
% if 'topic' in room:
<p class="topic"> ${room['topic']} </p>
% endif
2022-04-18 00:09:18 +02:00
% endif
</div>
2022-04-18 01:01:00 +02:00
% if room['name'] != "TOP" and room['name'] != "Libre Gaming" and 'children' in room:
2022-04-18 00:19:31 +02:00
</summary>
% endif
% endif
2022-04-17 23:16:18 +02:00
% if 'children' in room:
% for subroom in room['children']:
2022-04-18 00:09:18 +02:00
${render(subroom)}
% endfor
2022-04-18 00:19:31 +02:00
% if room['name'] != "TOP" and room['name'] != "Libre Gaming":
2022-04-18 00:09:18 +02:00
</details>
2022-04-18 00:19:31 +02:00
% endif
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>