From 2f626d798286b96b86f1bdc8883ef146482b4710 Mon Sep 17 00:00:00 2001 From: Rampoina Date: Sun, 17 Apr 2022 17:56:33 +0200 Subject: [PATCH] Add avatars and urls --- main.css | 10 ++++++++++ script.py | 9 +++++++++ spaces.html | 28 +++++++++++++++++++--------- 3 files changed, 38 insertions(+), 9 deletions(-) diff --git a/main.css b/main.css index ba74b15..8eb1873 100644 --- a/main.css +++ b/main.css @@ -1,4 +1,11 @@ /* Theming taken from https://github.com/vector-im/riot-web/blob/cf5cf02529f95a094d88051c12fdb87a03d87335/src/skins/vector/css/themes/_base.scss */ +tbody { + margin-left: 2em; +} +tr { + margin-left: 2em; +} + body { color: #454545; background-color: #ffffff; @@ -81,6 +88,9 @@ table#timeline { table#timeline tr { vertical-align: top; } +tr { + margin-left: 2em; +} td.rightAlign { text-align: right; min-width: 120px; diff --git a/script.py b/script.py index f1be722..09df7df 100644 --- a/script.py +++ b/script.py @@ -3,8 +3,17 @@ import json import itertools import argparse + +def mxc2url(mxc): + serverName = mxc.split('/')[2] + mediaId = mxc.split('/')[3] + return "https://matrix.org/_matrix/media/v3/download/" + serverName + "/" + mediaId + appTemplate = Template(filename='./spaces.html') f = open('libregamingspaces.json') spaces=json.load(f) print(appTemplate.render(s=spaces)) + + + diff --git a/spaces.html b/spaces.html index 7ededde..118b0b3 100644 --- a/spaces.html +++ b/spaces.html @@ -1,3 +1,9 @@ +<%! + def mxc2url(mxc): + serverName = mxc.split('/')[2] + mediaId = mxc.split('/')[3] + return "https://matrix.org/_matrix/media/v3/download/" + serverName + "/" + mediaId +%> @@ -5,29 +11,33 @@ <%def name="render(space)"> - +
% for room in space: + % if 'avatar_url' in room: + + % endif % if 'room_type' in room and room['room_type'] == "m.space": - + + % else: % if 'room_id' in room: - +
${room['name']}
% endif - - + % endif + % endif - % endfor +
Subspace: ${room['name']} - ${render(room['children_state'])} +
Subspace: ${room['name']}
${render(room['children_state'])}
- + + % if 'name' in room: -
${room['name']}
${render(s)}