From 5a90174869ff86df898d949daa75981d3584af35 Mon Sep 17 00:00:00 2001 From: Brandon Cornejo Date: Sun, 29 Nov 2020 12:05:21 -0600 Subject: [PATCH] Quest manager updates, add continental worldmaps --- acks/quest/quest_manager.py | 9 +++++++-- acks/quest/templates/quest_detail.html | 24 +++++++++++++++--------- acks/templates/worldmap.html | 4 ++-- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/acks/quest/quest_manager.py b/acks/quest/quest_manager.py index ac6e730..5c37e32 100644 --- a/acks/quest/quest_manager.py +++ b/acks/quest/quest_manager.py @@ -4,7 +4,7 @@ from zipfile import ZipFile FS_ROOT = '/srv/www/atr0phy.net/acks/quests' URL_ROOT = 'https://atr0phy.net/acks/quests' -IMG_EXTENSIONS = ('png', 'jpg', 'jpeg') +ASSET_EXTENSIONS = ('png', 'jpg', 'jpeg', 'dungeondraft_map', 'wonderdraft_map', 'wxx') def load_quests(): quest_list = {} @@ -50,13 +50,18 @@ def get_quest_details(level, quest_name): def urlify(path): return {'display': path.name, 'url': path.as_posix().replace(FS_ROOT, URL_ROOT)} + def read_coordinates(path): + return path.read_text() + for e in fs.iterdir(): - if e.name.endswith(IMG_EXTENSIONS): + if e.name.endswith(ASSET_EXTENSIONS): quest['assets'].append(urlify(e)) elif e.name == 'info.html': quest['info'] = urlify(e) elif e.name == 'tsv.txt': quest['tsv'] = urlify(e) + elif e.name == 'coordinates.txt': + quest['coords'] = read_coordinates(e) print("Quest: {}".format(quest)) return quest diff --git a/acks/quest/templates/quest_detail.html b/acks/quest/templates/quest_detail.html index 09d54ad..5ae67e4 100644 --- a/acks/quest/templates/quest_detail.html +++ b/acks/quest/templates/quest_detail.html @@ -19,16 +19,13 @@ {% endif %} Download + {% if quest['coords'] %} +
+
Coordinates:
+
{{ quest['coords'] }}
+
+ {% endif %} {% endif %} diff --git a/acks/templates/worldmap.html b/acks/templates/worldmap.html index ac4ef38..81ca605 100644 --- a/acks/templates/worldmap.html +++ b/acks/templates/worldmap.html @@ -15,8 +15,8 @@ {% endblock %}