From 07f5c76a52fdfe878c0512d2584f6dddeca1fa45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Gremaud?= Date: Sat, 9 May 2026 23:56:10 +0200 Subject: [PATCH] opus-magnum split --- polylan_submitter/polylan_submitter/urls.py | 22 ++++++++++++++++++- polylan_submitter/src/Home.vue | 5 +++++ polylan_submitter/src/home.ts | 9 ++++++++ .../templates/{index.html => base.html} | 10 +++++---- polylan_submitter/templates/home.html | 13 +++++++++++ polylan_submitter/templates/opus-magnum.html | 13 +++++++++++ 6 files changed, 67 insertions(+), 5 deletions(-) create mode 100644 polylan_submitter/src/Home.vue create mode 100644 polylan_submitter/src/home.ts rename polylan_submitter/templates/{index.html => base.html} (50%) create mode 100644 polylan_submitter/templates/home.html create mode 100644 polylan_submitter/templates/opus-magnum.html diff --git a/polylan_submitter/polylan_submitter/urls.py b/polylan_submitter/polylan_submitter/urls.py index d4e7c9d..e011412 100644 --- a/polylan_submitter/polylan_submitter/urls.py +++ b/polylan_submitter/polylan_submitter/urls.py @@ -32,18 +32,38 @@ def home(request: HttpRequest): return render( request, - "index.html", + "home.html", { "collection": SteamCollection.objects.filter(is_active=True).last(), }, ) +@login_required +def opus_magnum_home(request: HttpRequest): + from submissions.models import SteamCollection + + return render( + request, + "opus-magnum.html", + { + "collection": SteamCollection.objects.filter(is_active=True).last(), + }, + ) + + +@login_required +def noita_home(request: HttpRequest): + return render(request, "noita.html", {}) + + urlpatterns = [ path("admin/", admin.site.urls), path("cas/login/", SimpleCASLoginView.as_view(), name="cas_ng_login"), path("cas/logout/", SimpleCASLogoutView.as_view(), name="cas_ng_logout"), path("api/", api.urls), + path("opus-magnum", opus_magnum_home, name="opus-magnum.home"), + path("noita", noita_home, name="noita.home"), path("", home, name="home"), ] diff --git a/polylan_submitter/src/Home.vue b/polylan_submitter/src/Home.vue new file mode 100644 index 0000000..dd302d7 --- /dev/null +++ b/polylan_submitter/src/Home.vue @@ -0,0 +1,5 @@ + + + diff --git a/polylan_submitter/src/home.ts b/polylan_submitter/src/home.ts new file mode 100644 index 0000000..b23b06b --- /dev/null +++ b/polylan_submitter/src/home.ts @@ -0,0 +1,9 @@ +import { createApp } from 'vue' +import Home from '@/Home.vue' +import '@/style.css' + +// const app = createApp(App) +const selector = "#app" +const mountData = document.querySelector(selector) +const app = createApp(Home, { ...mountData?.dataset }) +app.mount(selector) diff --git a/polylan_submitter/templates/index.html b/polylan_submitter/templates/base.html similarity index 50% rename from polylan_submitter/templates/index.html rename to polylan_submitter/templates/base.html index dc98040..7c734f8 100644 --- a/polylan_submitter/templates/index.html +++ b/polylan_submitter/templates/base.html @@ -5,11 +5,13 @@ - Opus Magnum Puzzle Submitter - {% vite_hmr_client %} - {% vite_asset 'src/main.ts' %} + {% block title %}{% endblock %} + {% if debug %}{% vite_hmr_client %}{% endif %} + {% block head %} + {% endblock %} -
+ {% block content %} + {% endblock %} diff --git a/polylan_submitter/templates/home.html b/polylan_submitter/templates/home.html new file mode 100644 index 0000000..65e5fc4 --- /dev/null +++ b/polylan_submitter/templates/home.html @@ -0,0 +1,13 @@ +{% extends "base.html" %} + +{% load django_vite %} + +{% block title %}Opus Magnum Puzzle Submitter{% endblock %} + +{% block head %} + {% vite_asset 'src/home.ts' %} +{% endblock %} + +{% block content %} +
+{% endblock %} diff --git a/polylan_submitter/templates/opus-magnum.html b/polylan_submitter/templates/opus-magnum.html new file mode 100644 index 0000000..604170e --- /dev/null +++ b/polylan_submitter/templates/opus-magnum.html @@ -0,0 +1,13 @@ +{% extends "base.html" %} + +{% load django_vite %} + +{% block title %}Opus Magnum Puzzle Submitter{% endblock %} + +{% block head %} + {% vite_asset 'src/main.ts' %} +{% endblock %} + +{% block content %} +
+{% endblock %}