From: Chris Fulljames Date: Sat, 16 Aug 2025 18:04:37 +0000 (-0400) Subject: Initial swap-shop work X-Git-Url: https://littlesong.place/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fswap-shop;p=littlesongplace.git Initial swap-shop work --- diff --git a/src/littlesongplace/swap_shop.py b/src/littlesongplace/swap_shop.py new file mode 100644 index 0000000..937ddd5 --- /dev/null +++ b/src/littlesongplace/swap_shop.py @@ -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 index 0000000..62961fc --- /dev/null +++ b/src/littlesongplace/templates/swap-shop.html @@ -0,0 +1,38 @@ +{% extends "base.html" %} + +{% block title %}About{% endblock %} + +{% block body -%} + +

the swap shop

+ +

Welcome to the Swap Shop: a collaborative mode for SaucelessOne's MMiaH.

+

It works much like &qt;Secret Santa&qt;:

+
    +
  1. Join the event by entering your PSN name below.
  2. +
  3. When the event starts, you will be given another name from the list
  4. +
  5. Start making a song
  6. +
  7. At the 30 minute mark, release the song as public, and send it to your assigned recipient
  8. +
  9. You should also receive a song from a different person on the list. It's a surprise!
  10. +
  11. Spend another 30 minutes remixing the song you received
  12. +
  13. Release the finished song as public and send it to Sauceless
  14. +
+ +

Join

+{% if "swap-shop-name" in session %} +

Joined as {{ session["swap-shop-name"] }}

+{% else %} +
+ + +
+{% endif %} + +

Participants

+ + +{%- endblock %}