Settings-Seiten mit Authorize-Attribut versehen
This commit is contained in:
parent
e03653de58
commit
fde6d87905
@ -1,9 +1,11 @@
|
||||
@page "/settings/quizzes/edit"
|
||||
@page "/settings/quizzes/edit/{id}"
|
||||
@using FWLAZ_Web.Data
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@inject IDbContextFactory<LocalDbContext> DbFactory;
|
||||
@inject NavigationManager nav;
|
||||
@attribute [Authorize]
|
||||
<h3>QuizEdit</h3>
|
||||
|
||||
<div class="d-flex gap-3">
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
@page "/settings/quizzes/questions/{id}"
|
||||
@using FWLAZ_Web.Data
|
||||
@using FWLAZ_Web.Objects
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using Microsoft.EntityFrameworkCore;
|
||||
@inject IDbContextFactory<LocalDbContext> DbFactory;
|
||||
@inject NavigationManager nav;
|
||||
@attribute [Authorize]
|
||||
|
||||
|
||||
<h1>Questions for '@SelectedItem.Name'</h1>
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
@page "/settings/quizzes"
|
||||
@using FWLAZ_Web.Data
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@inject IDbContextFactory<LocalDbContext> DbFactory ;
|
||||
@attribute [Authorize]
|
||||
|
||||
<h3>Quizzes</h3>
|
||||
|
||||
@ -25,7 +27,7 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<ModalComponent @ref="modal">
|
||||
<ModalDialog @ref="modal">
|
||||
<Title>Löschen bestätigen</Title>
|
||||
<Body>
|
||||
Willst du das Quiz wirklich löschen?
|
||||
@ -34,11 +36,11 @@
|
||||
<button class="btn btn-danger" @onclick="DeleteItem">Ja</button>
|
||||
<button class="btn btn-primary" @onclick="CloseDialog">Nein</button>
|
||||
</Footer>
|
||||
</ModalComponent>
|
||||
</ModalDialog>
|
||||
|
||||
@code {
|
||||
private LocalDbContext? DataContext;
|
||||
private ModalComponent modal = null!;
|
||||
private ModalDialog modal = null!;
|
||||
private Quiz? SelectedItem;
|
||||
|
||||
private List<Quiz> QuizList { get; set; } = new();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user