diff --git a/polylan_submitter/market/views.py b/polylan_submitter/market/views.py index 765d7b9..5744326 100644 --- a/polylan_submitter/market/views.py +++ b/polylan_submitter/market/views.py @@ -7,5 +7,5 @@ from events.models import Event @login_required def market_home(request: HttpRequest, event_path: str): - event = get_object_or_404(Event, path=event_path) - return render(request, "market.html", {"event": event}) + get_object_or_404(Event, path=event_path) + return render(request, "app.html", {"bootstrap": {}}) diff --git a/polylan_submitter/package.json b/polylan_submitter/package.json index 4170d55..a6a3bd6 100644 --- a/polylan_submitter/package.json +++ b/polylan_submitter/package.json @@ -20,7 +20,8 @@ "tailwindcss": "^4.1.16", "tesseract.js": "^5.1.1", "vue": "^3.5.22", - "vue-i18n": "^11.4.12" + "vue-i18n": "^11.4.12", + "vue-router": "4" }, "devDependencies": { "@hey-api/openapi-ts": "^0.97.2", diff --git a/polylan_submitter/pnpm-lock.yaml b/polylan_submitter/pnpm-lock.yaml index d24910f..753f0fa 100644 --- a/polylan_submitter/pnpm-lock.yaml +++ b/polylan_submitter/pnpm-lock.yaml @@ -38,6 +38,9 @@ importers: vue-i18n: specifier: ^11.4.12 version: 11.4.12(vue@3.5.22(typescript@5.9.3)) + vue-router: + specifier: '4' + version: 4.6.4(vue@3.5.22(typescript@5.9.3)) devDependencies: '@hey-api/openapi-ts': specifier: ^0.97.2 @@ -1075,6 +1078,11 @@ packages: peerDependencies: vue: ^3.0.0 + vue-router@4.6.4: + resolution: {integrity: sha512-Hz9q5sa33Yhduglwz6g9skT8OBPii+4bFn88w6J+J4MfEo4KRRpmiNG/hHHkdbRFlLBOqxN8y8gf2Fb0MTUgVg==} + peerDependencies: + vue: ^3.5.0 + vue-tsc@3.1.2: resolution: {integrity: sha512-3fd4DY0rFczs5f+VB3OhcLU83V6+3Puj2yLBe0Ak65k7ERk+STVNKaOAi0EBo6Lc15UiJB6LzU6Mxy4+h/pKew==} hasBin: true @@ -1962,6 +1970,11 @@ snapshots: '@vue/devtools-api': 6.6.4 vue: 3.5.22(typescript@5.9.3) + vue-router@4.6.4(vue@3.5.22(typescript@5.9.3)): + dependencies: + '@vue/devtools-api': 6.6.4 + vue: 3.5.22(typescript@5.9.3) + vue-tsc@3.1.2(typescript@5.9.3): dependencies: '@volar/typescript': 2.4.23 diff --git a/polylan_submitter/polylan_submitter/urls.py b/polylan_submitter/polylan_submitter/urls.py index 69dda8d..3ee8be4 100644 --- a/polylan_submitter/polylan_submitter/urls.py +++ b/polylan_submitter/polylan_submitter/urls.py @@ -43,14 +43,15 @@ def home(request: HttpRequest): @login_required def event_home(request: HttpRequest, event_path: str): - event = get_object_or_404(Event, path=event_path) + get_object_or_404(Event, path=event_path) return render( request, - "home.html", + "app.html", { - "event": event, - "market_enabled": settings.MARKET_ENABLED, + "bootstrap": { + "marketEnabled": settings.MARKET_ENABLED, + }, }, ) @@ -61,15 +62,17 @@ def opus_magnum_home(request: HttpRequest, event_path: str): from opus_magnum.models import SteamCollection event = get_object_or_404(Event, path=event_path) + collection = SteamCollection.objects.filter(is_active=True, event=event).last() return render( request, - "opus-magnum.html", + "app.html", { - "event": event, - "collection": SteamCollection.objects.filter( - is_active=True, event=event - ).last(), + "bootstrap": { + "collectionTitle": collection.title if collection else "", + "collectionUrl": collection.url if collection else "", + "collectionDescription": collection.description if collection else "", + }, }, ) @@ -77,8 +80,8 @@ def opus_magnum_home(request: HttpRequest, event_path: str): @login_required @require_game_enabled(NOITA_APP_ID) def noita_home(request: HttpRequest, event_path: str): - event = get_object_or_404(Event, path=event_path) - return render(request, "noita.html", {"event": event}) + get_object_or_404(Event, path=event_path) + return render(request, "app.html", {"bootstrap": {}}) urlpatterns = [ diff --git a/polylan_submitter/src/App.vue b/polylan_submitter/src/App.vue new file mode 100644 index 0000000..a3a2384 --- /dev/null +++ b/polylan_submitter/src/App.vue @@ -0,0 +1,23 @@ + + + diff --git a/polylan_submitter/src/Home.vue b/polylan_submitter/src/Home.vue index 648b609..58d52ef 100644 --- a/polylan_submitter/src/Home.vue +++ b/polylan_submitter/src/Home.vue @@ -59,7 +59,7 @@ onMounted(async () => {