Switched to net9 and finished event workflow
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<link rel="stylesheet" href="@Assets["app.css"]"/>
|
||||
<link rel="stylesheet" href="@Assets["SpotiParty.Web.styles.css"]"/>
|
||||
<ImportMap/>
|
||||
<link rel="icon" type="image/png" href="favicon.png"/>
|
||||
<link rel="icon" href="favicon.ico"/>
|
||||
<HeadOutlet/>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
@using SpotiParty.Web.Components.Components
|
||||
@rendermode InteractiveServer
|
||||
|
||||
<PageTitle>SpotiParty</PageTitle>
|
||||
|
||||
<header>
|
||||
<h1>🎵 SpotiParty</h1>
|
||||
<h1>@(_event?.Name ?? " ")</h1>
|
||||
<p>Suche ein Lied und füge es zur Warteschlange hinzu</p>
|
||||
</header>
|
||||
|
||||
@@ -27,7 +29,7 @@
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<p>SpotiParty © @_currentYear</p>
|
||||
<p><a href="https://git.leon-hoppe.de/leon.hoppe/spotiparty" target="_blank">SpotiParty</a> © @_currentYear</p>
|
||||
</footer>
|
||||
|
||||
<dialog class="confirm-dialog" style="display: @(_selectedTrack is null ? "none" : "block")">
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using SpotifyAPI.Web;
|
||||
using SpotiParty.Web.Models;
|
||||
using SpotiParty.Web.Services;
|
||||
|
||||
namespace SpotiParty.Web.Components.Pages;
|
||||
@@ -9,6 +10,8 @@ public partial class EnqueuePage(AuthorizationHandler authHandler, NavigationMan
|
||||
|
||||
[Parameter]
|
||||
public string EventId { get; set; } = string.Empty;
|
||||
|
||||
private Event? _event;
|
||||
|
||||
private readonly int _currentYear = DateTime.Now.Year;
|
||||
private SpotifyClient _client = null!;
|
||||
@@ -28,22 +31,24 @@ public partial class EnqueuePage(AuthorizationHandler authHandler, NavigationMan
|
||||
return;
|
||||
}
|
||||
|
||||
var eventEntry = await context.Events
|
||||
_event = await context.Events
|
||||
.Include(e => e.Host)
|
||||
.FirstOrDefaultAsync(e => e.Id == guid);
|
||||
|
||||
if (eventEntry is null) {
|
||||
navigator.NavigateTo("/", forceLoad: true);
|
||||
return;
|
||||
}
|
||||
|
||||
var now = DateTime.Now;
|
||||
if (eventEntry.Start > now || eventEntry.End < now) {
|
||||
if (_event is null) {
|
||||
navigator.NavigateTo("/", forceLoad: true);
|
||||
return;
|
||||
}
|
||||
|
||||
var client = await authHandler.ConfigureClient(eventEntry.Host.UserId);
|
||||
StateHasChanged();
|
||||
|
||||
var now = DateTime.Now;
|
||||
if (_event.Start > now || _event.End < now) {
|
||||
navigator.NavigateTo("/", forceLoad: true);
|
||||
return;
|
||||
}
|
||||
|
||||
var client = await authHandler.ConfigureClient(_event.Host.UserId);
|
||||
|
||||
if (client is null) {
|
||||
navigator.NavigateTo("/", forceLoad: true);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
header h1 {
|
||||
margin: 0;
|
||||
font-size: 2rem;
|
||||
height: 2rem;
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
@@ -63,6 +64,10 @@ footer {
|
||||
text-align: center;
|
||||
padding: 0.5rem;
|
||||
background: var(--color-primary);
|
||||
|
||||
a {
|
||||
color: var(--color-text);
|
||||
}
|
||||
}
|
||||
|
||||
.confirm-dialog {
|
||||
|
||||
6
SpotiParty.Web/Components/Pages/HomePage.razor
Normal file
6
SpotiParty.Web/Components/Pages/HomePage.razor
Normal file
@@ -0,0 +1,6 @@
|
||||
@page "/"
|
||||
<h3>HomePage</h3>
|
||||
|
||||
@code {
|
||||
|
||||
}
|
||||
1
SpotiParty.Web/Components/Pages/HomePage.razor.css
Normal file
1
SpotiParty.Web/Components/Pages/HomePage.razor.css
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
protected override void OnInitialized() {
|
||||
base.OnInitialized();
|
||||
Navigator.NavigateTo("/login", forceLoad: true);
|
||||
Navigator.NavigateTo("/", forceLoad: true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Router AppAssembly="typeof(Program).Assembly" NotFoundPage="typeof(Pages.NotFound)">
|
||||
<Router AppAssembly="typeof(Program).Assembly">
|
||||
<Found Context="routeData">
|
||||
<RouteView RouteData="routeData"/>
|
||||
<FocusOnNavigate RouteData="routeData" Selector="h1"/>
|
||||
|
||||
Reference in New Issue
Block a user