]> littlesong.place Git - littlesongplace.git/commitdiff
Initial swap-shop work swap-shop
authorChris Fulljames <christianfulljames@gmail.com>
Sat, 16 Aug 2025 18:04:37 +0000 (14:04 -0400)
committerChris Fulljames <christianfulljames@gmail.com>
Sat, 16 Aug 2025 18:04:37 +0000 (14:04 -0400)
src/littlesongplace/swap_shop.py [new file with mode: 0644]
src/littlesongplace/templates/swap-shop.html [new file with mode: 0644]

diff --git a/src/littlesongplace/swap_shop.py b/src/littlesongplace/swap_shop.py
new file mode 100644 (file)
index 0000000..937ddd5
--- /dev/null
@@ -0,0 +1,23 @@
+from flask import abort, Blueprint, g, redirect, render_template, request, session, url_for
+
+bp = Blueprint("swap-shop", __name__, url_prefix="/swap-shop")
+
+@bp.get("/")
+def view():
+    participants = []
+    recipient = None
+    return render_template("swap-shop.html", participants=participants)
+
+@bp.post("/enter")
+def enter():
+    session["swap-shop-name"] = request.form["name"]
+    return redirect(url_for(view))
+
+@bp.get("/start")
+def start():
+    return redirect(url_for(view))
+
+@bp.post("/clear")
+def clear():
+    return redirect(url_for(view))
+
diff --git a/src/littlesongplace/templates/swap-shop.html b/src/littlesongplace/templates/swap-shop.html
new file mode 100644 (file)
index 0000000..62961fc
--- /dev/null
@@ -0,0 +1,38 @@
+{% extends "base.html" %}
+
+{% block title %}About{% endblock %}
+
+{% block body -%}
+
+<h1>the swap shop</h1>
+
+<p>Welcome to the Swap Shop: a collaborative mode for SaucelessOne's MMiaH.</p>
+<p>It works much like &qt;Secret Santa&qt;:</p>
+<ol>
+    <li>Join the event by entering your PSN name below.</li>
+    <li>When the event starts, you will be given another name from the list</li>
+    <li>Start making a song</li>
+    <li>At the 30 minute mark, release the song as public, and send it to your assigned recipient</li>
+    <li>You should also receive a song from a different person on the list.  It's a surprise!</li>
+    <li>Spend another 30 minutes remixing the song you received</li>
+    <li>Release the finished song as public and send it to Sauceless</li>
+</ol>
+
+<h2>Join</h2>
+{% if "swap-shop-name" in session %}
+<p>Joined as {{ session["swap-shop-name"] }}</p>
+{% else %}
+<form method="post" action="/swap-shop/enter">
+    <label>Name: <input type="text" name="name"></label>
+    <input type="submit" value="Join">
+</form>
+{% endif %}
+
+<h2>Participants</h2>
+<ul>
+    {%- for name in participants %}
+    <li>{{ name }}</li>
+    {% endfor -%}
+</ul>
+
+{%- endblock %}