From bd3b419de03995ca233c4331a29c5b8b4dd801fb Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 30 Nov 2020 21:15:47 -0500 Subject: [PATCH] Updates all styles save for the tooltip and tracker, which are forthcoming. I just really wanted to commit all these changes. --- WebHostLib/__init__.py | 8 +-- WebHostLib/check.py | 2 +- WebHostLib/generate.py | 6 +-- WebHostLib/static/assets/check.js | 9 ++++ WebHostLib/static/assets/generate.js | 4 +- .../static/assets/{uploads.js => hostGame.js} | 6 +-- WebHostLib/static/assets/player-settings.js | 6 +-- WebHostLib/static/assets/styleController.js | 3 ++ .../assets/{view_seed.js => viewSeed.js} | 0 .../static/styles/{uploads.css => check.css} | 8 +-- WebHostLib/static/styles/checkResult.css | 11 ++++ WebHostLib/static/styles/cloudHeader.css | 1 + WebHostLib/static/styles/generate.css | 21 ++++++++ WebHostLib/static/styles/globalStyles.css | 18 +++++-- WebHostLib/static/styles/hostGame.css | 25 +++++++++ WebHostLib/static/styles/hostRoom.css | 26 ++++++++++ WebHostLib/static/styles/host_room.css | 5 -- .../{grassFooter.css => islandFooter.css} | 9 ++-- WebHostLib/static/styles/player-settings.css | 52 ++++++++++++------- WebHostLib/static/styles/tablepage.css | 4 +- WebHostLib/static/styles/tutorial.css | 25 ++++++++- WebHostLib/static/styles/viewSeed.css | 26 ++++++++++ WebHostLib/static/styles/view_seed.css | 9 ---- WebHostLib/templates/check.html | 21 +++++--- WebHostLib/templates/checkResult.html | 19 +++++++ WebHostLib/templates/checkresult.html | 12 ----- WebHostLib/templates/generate.html | 20 +++---- .../templates/{uploads.html => hostGame.html} | 32 ++++++------ .../{host_room.html => hostRoom.html} | 7 +-- .../{grassFooter.html => islandFooter.html} | 1 + WebHostLib/templates/macros.html | 4 +- WebHostLib/templates/pageWrapper.html | 3 +- WebHostLib/templates/playerSettings.html | 7 +-- WebHostLib/templates/tutorial.html | 1 + WebHostLib/templates/viewSeed.html | 8 +-- WebHostLib/templates/waitSeed.html | 2 +- WebHostLib/tracker.py | 2 +- WebHostLib/upload.py | 8 +-- 38 files changed, 300 insertions(+), 131 deletions(-) create mode 100644 WebHostLib/static/assets/check.js rename WebHostLib/static/assets/{uploads.js => hostGame.js} (64%) create mode 100644 WebHostLib/static/assets/styleController.js rename WebHostLib/static/assets/{view_seed.js => viewSeed.js} (100%) rename WebHostLib/static/styles/{uploads.css => check.css} (79%) create mode 100644 WebHostLib/static/styles/checkResult.css create mode 100644 WebHostLib/static/styles/generate.css create mode 100644 WebHostLib/static/styles/hostGame.css create mode 100644 WebHostLib/static/styles/hostRoom.css delete mode 100644 WebHostLib/static/styles/host_room.css rename WebHostLib/static/styles/{grassFooter.css => islandFooter.css} (76%) create mode 100644 WebHostLib/static/styles/viewSeed.css delete mode 100644 WebHostLib/static/styles/view_seed.css create mode 100644 WebHostLib/templates/checkResult.html delete mode 100644 WebHostLib/templates/checkresult.html rename WebHostLib/templates/{uploads.html => hostGame.html} (61%) rename WebHostLib/templates/{host_room.html => hostRoom.html} (86%) rename WebHostLib/templates/{grassFooter.html => islandFooter.html} (73%) diff --git a/WebHostLib/__init__.py b/WebHostLib/__init__.py index 5409e98feb..8b6f10dded 100644 --- a/WebHostLib/__init__.py +++ b/WebHostLib/__init__.py @@ -88,7 +88,7 @@ def player_settings(): @app.route('/seed/') -def view_seed(seed: UUID): +def viewSeed(seed: UUID): seed = Seed.get(id=seed) if not seed: abort(404) @@ -103,7 +103,7 @@ def new_room(seed: UUID): abort(404) room = Room(seed=seed, owner=session["_id"], tracker=uuid4()) commit() - return redirect(url_for("host_room", room=room.id)) + return redirect(url_for("hostRoom", room=room.id)) def _read_log(path: str): @@ -122,7 +122,7 @@ def display_log(room: UUID): @app.route('/hosted/', methods=['GET', 'POST']) -def host_room(room: UUID): +def hostRoom(room: UUID): room = Room.get(id=room) if room is None: return abort(404) @@ -135,7 +135,7 @@ def host_room(room: UUID): with db_session: room.last_activity = datetime.utcnow() # will trigger a spinup, if it's not already running - return render_template("host_room.html", room=room) + return render_template("hostRoom.html", room=room) @app.route('/favicon.ico') diff --git a/WebHostLib/check.py b/WebHostLib/check.py index 377a9f5854..a6aaa85cb9 100644 --- a/WebHostLib/check.py +++ b/WebHostLib/check.py @@ -29,7 +29,7 @@ def mysterycheck(): flash(options) else: results, _ = roll_options(options) - return render_template("checkresult.html", results=results) + return render_template("checkResult.html", results=results) return render_template("check.html") diff --git a/WebHostLib/generate.py b/WebHostLib/generate.py index d92e66a2f0..b26e2c7be5 100644 --- a/WebHostLib/generate.py +++ b/WebHostLib/generate.py @@ -31,7 +31,7 @@ def generate(race=False): else: results, gen_options = roll_options(options) if any(type(result) == str for result in results.values()): - return render_template("checkresult.html", results=results) + return render_template("checkResult.html", results=results) elif len(gen_options) > app.config["MAX_ROLL"]: flash(f"Sorry, generating of multiworlds is limited to {app.config['MAX_ROLL']} players for now. " f"If you have a larger group, please generate it yourself and upload it.") @@ -47,7 +47,7 @@ def generate(race=False): else: seed_id = gen_game({name: vars(options) for name, options in gen_options.items()}, race=race, owner=session["_id"].int) - return redirect(url_for("view_seed", seed=seed_id)) + return redirect(url_for("viewSeed", seed=seed_id)) return render_template("generate.html", race=race) @@ -156,7 +156,7 @@ def wait_seed(seed: UUID): seed_id = seed seed = Seed.get(id=seed_id) if seed: - return redirect(url_for("view_seed", seed=seed_id)) + return redirect(url_for("viewSeed", seed=seed_id)) generation = Generation.get(id=seed_id) if not generation: diff --git a/WebHostLib/static/assets/check.js b/WebHostLib/static/assets/check.js new file mode 100644 index 0000000000..91f54c0591 --- /dev/null +++ b/WebHostLib/static/assets/check.js @@ -0,0 +1,9 @@ +window.addEventListener('load', () => { + document.getElementById('check-button').addEventListener('click', () => { + document.getElementById('file-input').click(); + }); + + document.getElementById('file-input').addEventListener('change', () => { + document.getElementById('check-form').submit(); + }); +}); diff --git a/WebHostLib/static/assets/generate.js b/WebHostLib/static/assets/generate.js index 189d46af60..4e2251f681 100644 --- a/WebHostLib/static/assets/generate.js +++ b/WebHostLib/static/assets/generate.js @@ -1,9 +1,9 @@ window.addEventListener('load', () => { - document.getElementById('upload-button').addEventListener('click', () => { + document.getElementById('generate-game-button').addEventListener('click', () => { document.getElementById('file-input').click(); }); document.getElementById('file-input').addEventListener('change', () => { - document.getElementById('upload-form').submit(); + document.getElementById('generate-game-form').submit(); }); }); diff --git a/WebHostLib/static/assets/uploads.js b/WebHostLib/static/assets/hostGame.js similarity index 64% rename from WebHostLib/static/assets/uploads.js rename to WebHostLib/static/assets/hostGame.js index 14a63d4448..32f10d9e7f 100644 --- a/WebHostLib/static/assets/uploads.js +++ b/WebHostLib/static/assets/hostGame.js @@ -1,13 +1,13 @@ window.addEventListener('load', () => { - document.getElementById('upload-button').addEventListener('click', () => { + document.getElementById('host-game-button').addEventListener('click', () => { document.getElementById('file-input').click(); }); document.getElementById('file-input').addEventListener('change', () => { - document.getElementById('upload-form').submit(); + document.getElementById('host-game-form').submit(); }); - $("#uploads-table").DataTable({ + $("#host-game-table").DataTable({ "paging": false, "ordering": true, "order": [[ 3, "desc" ]], diff --git a/WebHostLib/static/assets/player-settings.js b/WebHostLib/static/assets/player-settings.js index 753edeb89f..4886b5503b 100644 --- a/WebHostLib/static/assets/player-settings.js +++ b/WebHostLib/static/assets/player-settings.js @@ -1,7 +1,7 @@ let spriteData = null; window.addEventListener('load', () => { - const gameSettings = document.getElementById('game-settings'); + const gameSettings = document.getElementById('player-settings'); Promise.all([fetchPlayerSettingsYaml(), fetchPlayerSettingsJson(), fetchSpriteData()]).then((results) => { // Load YAML into object const sourceData = jsyaml.safeLoad(results[0], { json: true }); @@ -175,7 +175,7 @@ const buildUI = (settings) => { } Object.keys(settingTypes).forEach((settingTypeKey) => { - const sectionHeader = document.createElement('h1'); + const sectionHeader = document.createElement('h2'); sectionHeader.innerText = settingTypes[settingTypeKey]; settingsWrapper.appendChild(sectionHeader); @@ -200,7 +200,7 @@ const buildUI = (settings) => { }); // Build sprite options - const spriteOptionsHeader = document.createElement('h1'); + const spriteOptionsHeader = document.createElement('h2'); spriteOptionsHeader.innerText = 'Sprite Options'; settingsWrapper.appendChild(spriteOptionsHeader); diff --git a/WebHostLib/static/assets/styleController.js b/WebHostLib/static/assets/styleController.js new file mode 100644 index 0000000000..120d281d7a --- /dev/null +++ b/WebHostLib/static/assets/styleController.js @@ -0,0 +1,3 @@ +window.addEventListener('load', () => { + // Animate the water by swapping out background images every few seconds, maybe? +}); diff --git a/WebHostLib/static/assets/view_seed.js b/WebHostLib/static/assets/viewSeed.js similarity index 100% rename from WebHostLib/static/assets/view_seed.js rename to WebHostLib/static/assets/viewSeed.js diff --git a/WebHostLib/static/styles/uploads.css b/WebHostLib/static/styles/check.css similarity index 79% rename from WebHostLib/static/styles/uploads.css rename to WebHostLib/static/styles/check.css index 50647975f8..39671d870a 100644 --- a/WebHostLib/static/styles/uploads.css +++ b/WebHostLib/static/styles/check.css @@ -1,22 +1,22 @@ -#uploads-wrapper{ +#check-wrapper{ display: flex; flex-direction: row; justify-content: center; flex-wrap: wrap; } -#uploads{ +#check{ width: 620px; height: 280px; text-align: center; } -#uploads-form-wrapper{ +#check-form-wrapper{ width: 100%; text-align: center; margin-bottom: 1rem; } -#upload-form{ +#check-form{ display: none; } diff --git a/WebHostLib/static/styles/checkResult.css b/WebHostLib/static/styles/checkResult.css new file mode 100644 index 0000000000..bd5a1f1fd1 --- /dev/null +++ b/WebHostLib/static/styles/checkResult.css @@ -0,0 +1,11 @@ +#check-result-wrapper{ + display: flex; + flex-direction: row; + justify-content: center; + flex-wrap: wrap; +} + +#check-result{ + width: 540px; + text-align: center; +} diff --git a/WebHostLib/static/styles/cloudHeader.css b/WebHostLib/static/styles/cloudHeader.css index 12de40f665..4e3c2dc1cc 100644 --- a/WebHostLib/static/styles/cloudHeader.css +++ b/WebHostLib/static/styles/cloudHeader.css @@ -12,6 +12,7 @@ font-family: HyliaSerif, sans-serif; padding: 10px; line-height: 2rem; + z-index: 9999; } #cloud-header #site-title img{ diff --git a/WebHostLib/static/styles/generate.css b/WebHostLib/static/styles/generate.css new file mode 100644 index 0000000000..a0d0e53089 --- /dev/null +++ b/WebHostLib/static/styles/generate.css @@ -0,0 +1,21 @@ +#generate-game-wrapper{ + display: flex; + flex-direction: row; + justify-content: center; + flex-wrap: wrap; +} + +#generate-game{ + width: 660px; + text-align: center; +} + +#generate-game-form-wrapper{ + width: 100%; + text-align: center; + margin-bottom: 1rem; +} + +#generate-game-form{ + display: none; +} diff --git a/WebHostLib/static/styles/globalStyles.css b/WebHostLib/static/styles/globalStyles.css index e2d512d413..e60e41f2d2 100644 --- a/WebHostLib/static/styles/globalStyles.css +++ b/WebHostLib/static/styles/globalStyles.css @@ -12,7 +12,6 @@ html{ body{ margin: 0; - padding-bottom: 62px; } button{ @@ -21,13 +20,24 @@ button{ border-radius: 4px; } -h1, h2, h3{ +h1, h2, h3, h4, h5, h6{ font-family: HyliaSerif, sans-serif; - font-size: 3rem; font-weight: normal; margin: 0; } +h1{ font-size: 3rem; } +h2{ font-size: 2rem; } +h3{ font-size: 1.75rem; } +h4{ + font-size: 1.5rem; + margin-bottom:0.5rem; +} +h5, h6{ + font-size: 1.25rem; + margin-bottom: 0.5rem; +} + .grass-island{ background: url('../static/backgrounds/cliffs/grass/cliff-top-left-corner.png') top left no-repeat, @@ -49,7 +59,7 @@ h1, h2, h3{ 20px 140px, /* bottom */ 140px 20px, /* left */ 140px 20px, /* right */ - 100px auto; /* center */ + 140px 140px; /* center */ min-width: 280px; min-height: 280px; diff --git a/WebHostLib/static/styles/hostGame.css b/WebHostLib/static/styles/hostGame.css new file mode 100644 index 0000000000..29e28689eb --- /dev/null +++ b/WebHostLib/static/styles/hostGame.css @@ -0,0 +1,25 @@ +#host-game-wrapper{ + display: flex; + flex-direction: row; + justify-content: center; + flex-wrap: wrap; +} + +#host-game{ + width: 620px; + text-align: center; +} + +#host-game.wider{ + width: 980px; +} + +#host-game-form-wrapper{ + width: 100%; + text-align: center; + margin-bottom: 1rem; +} + +#host-game-form{ + display: none; +} diff --git a/WebHostLib/static/styles/hostRoom.css b/WebHostLib/static/styles/hostRoom.css new file mode 100644 index 0000000000..7723ad27df --- /dev/null +++ b/WebHostLib/static/styles/hostRoom.css @@ -0,0 +1,26 @@ +html{ + background-image: url('../static/backgrounds/dirt/dirt-0005-large.png'); + background-repeat: repeat; + background-size: 900px 900px; +} + +#host-room{ + width: calc(100% - 5rem); + margin-left: auto; + margin-right: auto; + background-color: rgba(0, 0, 0, 0.15); + border-radius: 8px; + padding: 1rem; + color: #ffe993; +} + +#host-room a{ + color: #ffffff; +} + +#host-room input[type=text]{ + width: 500px; + min-width: 370px; + padding: 0.125rem; + height: 1.5rem; +} diff --git a/WebHostLib/static/styles/host_room.css b/WebHostLib/static/styles/host_room.css deleted file mode 100644 index 12993f7a13..0000000000 --- a/WebHostLib/static/styles/host_room.css +++ /dev/null @@ -1,5 +0,0 @@ -#host-room input[type=text]{ - width: calc(100% - 6px); - padding: 0.125rem; - height: 1.5rem; -} diff --git a/WebHostLib/static/styles/grassFooter.css b/WebHostLib/static/styles/islandFooter.css similarity index 76% rename from WebHostLib/static/styles/grassFooter.css rename to WebHostLib/static/styles/islandFooter.css index 5b37af4284..0ed9622363 100644 --- a/WebHostLib/static/styles/grassFooter.css +++ b/WebHostLib/static/styles/islandFooter.css @@ -3,12 +3,11 @@ display: flex; flex-direction: column; justify-content: flex-end; - width: 100%; - height: 62px; - margin-top: 2rem; + width: calc(100% - 0.5rem); + height: 66px; padding-left: 0.5rem; line-height: 30px; - position: fixed; - left: 0; + position: absolute; bottom: 0; + left: 0; } diff --git a/WebHostLib/static/styles/player-settings.css b/WebHostLib/static/styles/player-settings.css index 47e9b8abd6..edcec21482 100644 --- a/WebHostLib/static/styles/player-settings.css +++ b/WebHostLib/static/styles/player-settings.css @@ -1,87 +1,99 @@ -#game-settings{ - margin-left: auto; - margin-right: auto; +html{ + background-image: url('../static/backgrounds/dirt/dirt-0005-large.png'); + background-repeat: repeat; + background-size: 900px 900px; } -#game-settings code{ - background-color: #dbe1bc; +#player-settings{ + width: 60rem; + margin-left: auto; + margin-right: auto; + background-color: rgba(0, 0, 0, 0.15); + border-radius: 8px; + padding: 1rem; + color: #ffe993; +} + +#player-settings code{ + background-color: #d9cd8e; border-radius: 4px; padding-left: 0.25rem; padding-right: 0.25rem; + color: #000000; } -#game-settings .instructions{ +#player-settings .instructions{ text-align: left; } -#game-settings #settings-wrapper .setting-wrapper{ +#player-settings #settings-wrapper .setting-wrapper{ display: flex; flex-direction: column; justify-content: flex-start; width: 100%; } -#game-settings #settings-wrapper .setting-wrapper .title-span{ +#player-settings #settings-wrapper .setting-wrapper .title-span{ font-weight: bold; } -#game-settings #settings-wrapper{ +#player-settings #settings-wrapper{ margin-top: 1.5rem; } -#game-settings #settings-wrapper #sprite-picker{ +#player-settings #settings-wrapper #sprite-picker{ margin-bottom: 2rem; } -#game-settings #settings-wrapper #sprite-picker #sprite-picker-sprites{ +#player-settings #settings-wrapper #sprite-picker #sprite-picker-sprites{ display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; } -#game-settings #settings-wrapper #sprite-picker .sprite-img-wrapper{ +#player-settings #settings-wrapper #sprite-picker .sprite-img-wrapper{ cursor: pointer; margin: 10px; } /* Center tooltip text for sprite images */ -#game-settings #settings-wrapper #sprite-picker .sprite-img-wrapper::after{ +#player-settings #settings-wrapper #sprite-picker .sprite-img-wrapper::after{ text-align: center; } -#game-settings #settings-wrapper #sprite-picker .sprite-img-wrapper img{ +#player-settings #settings-wrapper #sprite-picker .sprite-img-wrapper img{ width: 32px; height: 48px; } -#game-settings table.option-set{ +#player-settings table.option-set{ width: 100%; margin-bottom: 1.5rem; } -#game-settings table.option-set td.option-name{ +#player-settings table.option-set td.option-name{ width: 150px; font-weight: bold; font-size: 1rem; line-height: 2rem; } -#game-settings table.option-set td.option-name .delete-button{ +#player-settings table.option-set td.option-name .delete-button{ cursor: pointer; } -#game-settings table.option-set td.option-value{ +#player-settings table.option-set td.option-value{ line-height: 2rem; } -#game-settings table.option-set td.option-value input[type=range]{ +#player-settings table.option-set td.option-value input[type=range]{ width: 90%; min-width: 300px; vertical-align: middle; } -#game-settings #game-settings-button-row{ +#player-settings #player-settings-button-row{ display: flex; flex-direction: row; justify-content: space-between; diff --git a/WebHostLib/static/styles/tablepage.css b/WebHostLib/static/styles/tablepage.css index da81621ce1..87d683da2c 100644 --- a/WebHostLib/static/styles/tablepage.css +++ b/WebHostLib/static/styles/tablepage.css @@ -19,7 +19,7 @@ table.dataTable thead .sorting, table.dataTable thead .sorting_asc, table.dataTa } table.dataTable thead{ - background-color: #b0a77d; + /* background-color: #b0a77d; */ } table.dataTable thead tr th{ @@ -32,5 +32,5 @@ table.dataTable tbody tr{ } table.dataTable tbody tr:hover{ - background-color: #e2eabb; + /* background-color: #e2eabb; */ } diff --git a/WebHostLib/static/styles/tutorial.css b/WebHostLib/static/styles/tutorial.css index dd7b6a5186..4014630337 100644 --- a/WebHostLib/static/styles/tutorial.css +++ b/WebHostLib/static/styles/tutorial.css @@ -1,6 +1,21 @@ +html{ + background-image: url('../static/backgrounds/dirt/dirt-0005-large.png'); + background-repeat: repeat; + background-size: 900px 900px; +} + #tutorial-wrapper{ + width: 70rem; margin-left: auto; margin-right: auto; + background-color: rgba(0, 0, 0, 0.15); + border-radius: 8px; + padding: 1rem; + color: #ffe993; +} + +#tutorial-wrapper a{ + color: #ffffff; } #tutorial-wrapper h1{ @@ -9,6 +24,7 @@ border-bottom: 1px solid #9f916a; cursor: pointer; width: 100%; + margin-bottom: 0.5rem; } #tutorial-wrapper h2{ @@ -17,6 +33,7 @@ border-bottom: 1px solid #9f916a; cursor: pointer; width: 100%; + margin-bottom: 0.5rem; } #tutorial-wrapper h3{ @@ -25,12 +42,14 @@ text-align: left; cursor: pointer; width: 100%; + margin-bottom: 0.5rem; } #tutorial-wrapper h4{ font-size: 1.5rem; font-weight: normal; cursor: pointer; + margin-bottom: 0.5rem; } #tutorial-wrapper h5{ @@ -64,16 +83,18 @@ #tutorial-wrapper pre{ padding: 0.5rem 0.25rem; - background-color: #dce2bd; + background-color: #d9cd8e; border: 1px solid #9f916a; border-radius: 6px; + color: #000000; } #tutorial-wrapper code{ - background-color: #dce2bd; + background-color: #d9cd8e; border-radius: 4px; padding-left: 0.25rem; padding-right: 0.25rem; + color: #000000; } #tutorial-wrapper #tutorial-video-container{ diff --git a/WebHostLib/static/styles/viewSeed.css b/WebHostLib/static/styles/viewSeed.css new file mode 100644 index 0000000000..a870771fe4 --- /dev/null +++ b/WebHostLib/static/styles/viewSeed.css @@ -0,0 +1,26 @@ +#view-seed-wrapper{ + display: flex; + flex-direction: row; + justify-content: center; + flex-wrap: wrap; +} + +#view-seed-wrapper table td{ + vertical-align: top; +} + +#view-seed{ + width: 620px; + min-height: 360px; + text-align: center; +} + +#view-seed h3{ + margin-bottom: 0.5rem; +} + +#view-seed table{ + text-align: left; + margin-left: auto; + margin-right: auto; +} diff --git a/WebHostLib/static/styles/view_seed.css b/WebHostLib/static/styles/view_seed.css deleted file mode 100644 index 418817b2f4..0000000000 --- a/WebHostLib/static/styles/view_seed.css +++ /dev/null @@ -1,9 +0,0 @@ -#view-seed-wrapper{ - display: flex; - flex-direction: row; - justify-content: center; -} - -#view-seed-wrapper table td{ - vertical-align: top; -} diff --git a/WebHostLib/templates/check.html b/WebHostLib/templates/check.html index 4e627f0ff5..13dc13ba9e 100644 --- a/WebHostLib/templates/check.html +++ b/WebHostLib/templates/check.html @@ -3,21 +3,26 @@ {% block head %} {{ super() }} Mystery Check Result - - + + {% endblock %} {% block body %} -
-
+ {% include 'cloudHeader.html' %} +
+

Upload Yaml

-

This page checks a .yaml file for you, to be used as options for a mystery multiworld. You can also upload a .zip with multiple YAMLs.

-
-
+

+ This page checks a .yaml file for you, to be used as options for a mystery multiworld. + You can also upload a .zip with multiple YAMLs. +

+
+ - +
+ {% include 'islandFooter.html' %} {% endblock %} diff --git a/WebHostLib/templates/checkResult.html b/WebHostLib/templates/checkResult.html new file mode 100644 index 0000000000..b1b3582ac6 --- /dev/null +++ b/WebHostLib/templates/checkResult.html @@ -0,0 +1,19 @@ +{% extends 'pageWrapper.html' %} + +{% block head %} + {{ super() }} + Upload Mystery YAML + +{% endblock %} + +{% block body %} + {% include 'cloudHeader.html' %} +
+
+ {% for filename, resulttext in results.items() %} + {{ filename }}: {{ "Looks ok" if resulttext == True else resulttext }}
+ {% endfor %} +
+
+ {% include 'islandFooter.html' %} +{% endblock %} diff --git a/WebHostLib/templates/checkresult.html b/WebHostLib/templates/checkresult.html deleted file mode 100644 index 60ec48de8b..0000000000 --- a/WebHostLib/templates/checkresult.html +++ /dev/null @@ -1,12 +0,0 @@ -{% extends 'pageWrapper.html' %} - -{% block head %} - {{ super() }} - Upload Mystery YAML -{% endblock %} - -{% block body %} - {% for filename, resulttext in results.items() %} - {{ filename }}: {{ "Looks ok" if resulttext == True else resulttext }}
- {% endfor %} -{% endblock %} diff --git a/WebHostLib/templates/generate.html b/WebHostLib/templates/generate.html index fee8d42f50..fbee6e417f 100644 --- a/WebHostLib/templates/generate.html +++ b/WebHostLib/templates/generate.html @@ -3,18 +3,19 @@ {% block head %} {{ super() }} Generate Game - + {% endblock %} {% block body %} -
-
-

Upload YAML(s){% if race %} (Race Mode){% endif %}

+ {% include 'cloudHeader.html' %} +
+
+

Generate Game{% if race %} (Race Mode){% endif %}

This page accepts a yaml file containing generator options. - You can find a documented example at playerSettings.yaml. + You can find a documented example at + playerSettings.yaml. This file can be saved as .yaml, edited to your liking and then supplied to the generator. You can also upload a .zip with multiple YAMLs. A proper menu is in the works. @@ -31,12 +32,13 @@ href="https://github.com/Berserker66/MultiWorld-Utilities/releases">Client to create a rom file. In-Browser patching will come.

-
-
+
+ - +
+ {% include 'islandFooter.html' %} {% endblock %} diff --git a/WebHostLib/templates/uploads.html b/WebHostLib/templates/hostGame.html similarity index 61% rename from WebHostLib/templates/uploads.html rename to WebHostLib/templates/hostGame.html index 598f4c57d2..5566e12535 100644 --- a/WebHostLib/templates/uploads.html +++ b/WebHostLib/templates/hostGame.html @@ -3,44 +3,44 @@ {% block head %} {{ super() }} Upload Multidata - - + + {% endblock %} {% block body %} {% include 'cloudHeader.html' %} -
-
-

Upload Multidata

+
+
+

Host Game

To host a game, you need to upload a .multidata file or a .zip file created by the multiworld generator.

-
-
+
+ - +
{% if rooms %} -

Your Rooms:

- +

Your Rooms:

+
- - + + {% for room in rooms %} - - + @@ -49,11 +49,9 @@ {% endfor %}
Seed Room PlayersCreatedLast ActivityCreated (UTC)Last Activity (UTC)
{{ room.seed.id|suuid }} + {{ room.seed.id|suuid }} {{ room.id|suuid }}{{ room.id|suuid }} {{ room.seed.multidata.names[0]|length }} Total: {{ room.seed.multidata.names[0]|join(", ")|truncate(256, False, " ...") }} {{ room.creation_time.strftime("%Y-%m-%d %H:%M") }}
- {% else %} -

No rooms owned by you were found. Upload a file to get started.

{% endif %}
- {% include 'grassFooter.html' %} + {% include 'islandFooter.html' %} {% endblock %} diff --git a/WebHostLib/templates/host_room.html b/WebHostLib/templates/hostRoom.html similarity index 86% rename from WebHostLib/templates/host_room.html rename to WebHostLib/templates/hostRoom.html index 28d991241b..9e11ab32e0 100644 --- a/WebHostLib/templates/host_room.html +++ b/WebHostLib/templates/hostRoom.html @@ -2,17 +2,18 @@ {% import "macros.html" as macros %} {% block head %} Multiworld {{ room.id|suuid }} - + {% endblock %} {% block body %} + {% include 'cloudHeader.html' %}
{% if room.owner == session["_id"] %} - Room created from Seed #{{ room.seed.id|suuid }} + Room created from Seed #{{ room.seed.id|suuid }}
{% endif %} {% if room.tracker %} - This room has a Multiworld Tracker enabled. + This room has a Multiworld Tracker enabled.
{% endif %} This room will be closed after {{ room.timeout//60//60 }} hours of inactivity. Should you wish to continue diff --git a/WebHostLib/templates/grassFooter.html b/WebHostLib/templates/islandFooter.html similarity index 73% rename from WebHostLib/templates/grassFooter.html rename to WebHostLib/templates/islandFooter.html index d5212b0752..d10c3d1c9f 100644 --- a/WebHostLib/templates/grassFooter.html +++ b/WebHostLib/templates/islandFooter.html @@ -1,4 +1,5 @@ {% block footer %} +
Copyright 2020 APPlaceHolder
diff --git a/WebHostLib/templates/macros.html b/WebHostLib/templates/macros.html index aaf9fa4698..bf5dbcca20 100644 --- a/WebHostLib/templates/macros.html +++ b/WebHostLib/templates/macros.html @@ -1,7 +1,7 @@ {% macro list_rooms(rooms) -%} @@ -15,4 +15,4 @@ {% endfor %} {% endif %} -{%- endmacro -%} \ No newline at end of file +{%- endmacro -%} diff --git a/WebHostLib/templates/pageWrapper.html b/WebHostLib/templates/pageWrapper.html index 815cbb1690..d8fa34085c 100644 --- a/WebHostLib/templates/pageWrapper.html +++ b/WebHostLib/templates/pageWrapper.html @@ -6,7 +6,8 @@ - + + {% block head %} Multiworld diff --git a/WebHostLib/templates/playerSettings.html b/WebHostLib/templates/playerSettings.html index 9bb74e5f1b..731bd1ffad 100644 --- a/WebHostLib/templates/playerSettings.html +++ b/WebHostLib/templates/playerSettings.html @@ -8,8 +8,9 @@ {% endblock %} {% block body %} -
-

Player Settings

+ {% include 'cloudHeader.html' %} +
+

Player Settings

This page is used to configure your player settings. You have three presets you can control, which you can access using the dropdown menu below. These settings will be usable when generating a @@ -61,7 +62,7 @@
-
+
diff --git a/WebHostLib/templates/tutorial.html b/WebHostLib/templates/tutorial.html index 58a17fcba9..2ba788dd35 100644 --- a/WebHostLib/templates/tutorial.html +++ b/WebHostLib/templates/tutorial.html @@ -1,6 +1,7 @@ {% extends 'pageWrapper.html' %} {% block head %} + {% include 'cloudHeader.html' %} Setup Tutorial + + {% endblock %} {% block body %} + {% include 'cloudHeader.html' %}
-
+

Seed Info

{% if not seed.multidata and not seed.spoiler %}

@@ -82,4 +83,5 @@

+ {% include 'islandFooter.html' %} {% endblock %} diff --git a/WebHostLib/templates/waitSeed.html b/WebHostLib/templates/waitSeed.html index 51994a7465..e9b5e961cd 100644 --- a/WebHostLib/templates/waitSeed.html +++ b/WebHostLib/templates/waitSeed.html @@ -4,7 +4,7 @@ {% block head %} Multiworld Seed {{ seed_id|suuid }} (generating...) - + {% endblock %} {% block body %} diff --git a/WebHostLib/tracker.py b/WebHostLib/tracker.py index fadc2c8e51..e068cf157d 100644 --- a/WebHostLib/tracker.py +++ b/WebHostLib/tracker.py @@ -305,7 +305,7 @@ def get_static_room_data(room: Room): @app.route('/tracker/') @cache.memoize(timeout=30) # update every 30 seconds -def get_tracker(tracker: UUID): +def getTracker(tracker: UUID): room = Room.get(tracker=tracker) if not room: abort(404) diff --git a/WebHostLib/upload.py b/WebHostLib/upload.py index 229e03cb31..9313c285f6 100644 --- a/WebHostLib/upload.py +++ b/WebHostLib/upload.py @@ -55,7 +55,7 @@ def uploads(): for patch in patches: patch.seed = seed - return redirect(url_for("view_seed", seed=seed.id)) + return redirect(url_for("viewSeed", seed=seed.id)) else: flash("No multidata was found in the zip file, which is required.") else: @@ -66,12 +66,12 @@ def uploads(): else: seed = Seed(multidata=multidata, owner=session["_id"]) commit() # place into DB and generate ids - return redirect(url_for("view_seed", seed=seed.id)) + return redirect(url_for("viewSeed", seed=seed.id)) else: flash("Not recognized file format. Awaiting a .multidata file.") rooms = select(room for room in Room if room.owner == session["_id"]) - return render_template("uploads.html", rooms=rooms) + return render_template("hostGame.html", rooms=rooms) def allowed_file(filename): - return filename.endswith(('multidata', ".zip")) \ No newline at end of file + return filename.endswith(('multidata', ".zip"))