1 Commits

Author SHA1 Message Date
Penry 1ac9fb7e81 Fixed Workflow Syntax 2026-06-07 21:20:26 +02:00
26 changed files with 205 additions and 619 deletions
@@ -54,7 +54,7 @@
private HttpContext HttpContext { get; set; } = default!;
[SupplyParameterFromForm]
private InputModel Input { get; set; } = null!;
private InputModel Input { get; set; } = new();
[SupplyParameterFromQuery]
private string? RemoteError { get; set; }
@@ -94,8 +94,6 @@
// the login page if we get here some other way.
RedirectManager.RedirectTo("Account/Login");
}
Input ??= new InputModel();
}
private async Task OnLoginCallbackAsync()
@@ -35,7 +35,7 @@
@code {
[SupplyParameterFromForm]
private InputModel Input { get; set; } = null!;
private InputModel Input { get; set; } = new();
private async Task OnValidSubmitAsync()
{
@@ -31,7 +31,7 @@
@* MudTextFields zwingend mit Name-Attribut für SSR *@
<MudTextField @bind-Value="Input.Username"
For="@(() => Input.Username)"
name="Input.Username"
Name="Input.Username"
Label="Username"
Variant="Variant.Outlined"
Margin="Margin.Dense"
@@ -40,7 +40,7 @@
<MudTextField @bind-Value="Input.Password"
For="@(() => Input.Password)"
name="Input.Password"
Name="Input.Password"
Label="Password"
InputType="InputType.Password"
Variant="Variant.Outlined"
@@ -75,7 +75,7 @@
private HttpContext HttpContext { get; set; } = default!;
[SupplyParameterFromForm]
private InputModel Input { get; set; } = null!;
private InputModel Input { get; set; } = new();
[SupplyParameterFromQuery]
private string? ReturnUrl { get; set; }
@@ -87,8 +87,6 @@
// Clear the existing external cookie to ensure a clean login process
await HttpContext.SignOutAsync(IdentityConstants.ExternalScheme);
}
Input ??= new InputModel();
}
public async Task LoginUser()
@@ -49,7 +49,7 @@
private ApplicationUser user = default!;
[SupplyParameterFromForm]
private InputModel Input { get; set; } = null!;
private InputModel Input { get; set; } = new();
[SupplyParameterFromQuery]
private string? ReturnUrl { get; set; }
@@ -62,8 +62,6 @@
// Ensure the user has gone through the username & password screen first
user = await SignInManager.GetTwoFactorAuthenticationUserAsync() ??
throw new InvalidOperationException("Unable to load two-factor authentication user.");
Input ??= new InputModel();
}
private async Task OnValidSubmitAsync()
@@ -38,7 +38,7 @@
private ApplicationUser user = default!;
[SupplyParameterFromForm]
private InputModel Input { get; set; } = null!;
private InputModel Input { get; set; } = new();
[SupplyParameterFromQuery]
private string? ReturnUrl { get; set; }
@@ -48,8 +48,6 @@
// Ensure the user has gone through the username & password screen first
user = await SignInManager.GetTwoFactorAuthenticationUserAsync() ??
throw new InvalidOperationException("Unable to load two-factor authentication user.");
Input ??= new InputModel();
}
private async Task OnValidSubmitAsync()
@@ -1,4 +1,4 @@
@page "/Account/ChangePassword"
@page "/Account/Manage/ChangePassword"
@using System.ComponentModel.DataAnnotations
@using Microsoft.AspNetCore.Identity
@@ -9,81 +9,67 @@
@inject IdentityUserAccessor UserAccessor
@inject IdentityRedirectManager RedirectManager
@inject ILogger<ChangePassword> Logger
@inject ISnackbar Snackbar
<PageTitle>Change password</PageTitle>
<MudText Typo="Typo.h6">Change password</MudText>
<EditForm Model="Input" FormName="change-password" OnValidSubmit="OnValidSubmitAsync" method="post">
<MudTextField
T="string"
name="Input.OldPassword"
Label="OldPassword"
@bind-Value="Input.OldPassword"
For="@(() => Input.OldPassword)"
InputType="InputType.Password"
Required="true"
Variant="Variant.Outlined"
ShrinkLabel="true"/>
<MudTextField
T="string"
name="Input.NewPassword"
Label="New password"
@bind-Value="Input.NewPassword"
For="@(() => Input.NewPassword)"
InputType="InputType.Password"
Required="true"
Variant="Variant.Outlined"
ShrinkLabel="true"/>
<MudTextField
T="string"
name="Input.ConfirmPassword"
Label="Confirm password"
@bind-Value="Input.ConfirmPassword"
For="@(() => Input.ConfirmPassword)"
InputType="InputType.Password"
Required="true"
Variant="Variant.Outlined"
ShrinkLabel="true"/>
<MudButton ButtonType="ButtonType.Submit" Variant="Variant.Filled" Color="Color.Primary">Change password</MudButton>
</EditForm>
<h3>Change password</h3>
<StatusMessage Message="@message" />
<div class="row">
<div class="col-xl-6">
<EditForm Model="Input" FormName="change-password" OnValidSubmit="OnValidSubmitAsync" method="post">
<DataAnnotationsValidator />
<ValidationSummary class="text-danger" role="alert" />
<div class="form-floating mb-3">
<InputText type="password" @bind-Value="Input.OldPassword" id="Input.OldPassword" class="form-control" autocomplete="current-password" aria-required="true" placeholder="Enter the old password" />
<label for="Input.OldPassword" class="form-label">Old password</label>
<ValidationMessage For="() => Input.OldPassword" class="text-danger" />
</div>
<div class="form-floating mb-3">
<InputText type="password" @bind-Value="Input.NewPassword" id="Input.NewPassword" class="form-control" autocomplete="new-password" aria-required="true" placeholder="Enter the new password" />
<label for="Input.NewPassword" class="form-label">New password</label>
<ValidationMessage For="() => Input.NewPassword" class="text-danger" />
</div>
<div class="form-floating mb-3">
<InputText type="password" @bind-Value="Input.ConfirmPassword" id="Input.ConfirmPassword" class="form-control" autocomplete="new-password" aria-required="true" placeholder="Enter the new password" />
<label for="Input.ConfirmPassword" class="form-label">Confirm password</label>
<ValidationMessage For="() => Input.ConfirmPassword" class="text-danger" />
</div>
<button type="submit" class="w-100 btn btn-lg btn-primary">Update password</button>
</EditForm>
</div>
</div>
@code {
private ApplicationUser _user = null!;
private bool _hasPassword;
private string? message;
private ApplicationUser user = default!;
private bool hasPassword;
[CascadingParameter]
private HttpContext HttpContext { get; set; } = null!;
private HttpContext HttpContext { get; set; } = default!;
[SupplyParameterFromForm]
private InputModel Input { get; set; } = null!;
private InputModel Input { get; set; } = new();
protected override async Task OnInitializedAsync()
{
_user = await UserAccessor.GetRequiredUserAsync(HttpContext);
_hasPassword = await UserManager.HasPasswordAsync(_user);
if (!_hasPassword)
user = await UserAccessor.GetRequiredUserAsync(HttpContext);
hasPassword = await UserManager.HasPasswordAsync(user);
if (!hasPassword)
{
RedirectManager.RedirectTo("Account/Manage/SetPassword");
}
Input ??= new InputModel();
}
private async Task OnValidSubmitAsync()
{
var changePasswordResult = await UserManager.ChangePasswordAsync(_user, Input.OldPassword, Input.NewPassword);
var changePasswordResult = await UserManager.ChangePasswordAsync(user, Input.OldPassword, Input.NewPassword);
if (!changePasswordResult.Succeeded)
{
message = $"Error: {string.Join(",", changePasswordResult.Errors.Select(error => error.Description))}";
return;
}
await SignInManager.RefreshSignInAsync(_user);
await SignInManager.RefreshSignInAsync(user);
Logger.LogInformation("User changed their password successfully.");
RedirectManager.RedirectToCurrentPageWithStatus("Your password has been changed", HttpContext);
@@ -47,15 +47,13 @@
private HttpContext HttpContext { get; set; } = default!;
[SupplyParameterFromForm]
private InputModel Input { get; set; } = null!;
private InputModel Input { get; set; } = new();
protected override async Task OnInitializedAsync()
{
Input ??= new();
user = await UserAccessor.GetRequiredUserAsync(HttpContext);
requirePassword = await UserManager.HasPasswordAsync(user);
Input ??= new InputModel();
}
private async Task OnValidSubmitAsync()
@@ -63,7 +63,7 @@
private HttpContext HttpContext { get; set; } = default!;
[SupplyParameterFromForm(FormName = "change-email")]
private InputModel Input { get; set; } = null!;
private InputModel Input { get; set; } = new();
protected override async Task OnInitializedAsync()
{
@@ -72,7 +72,6 @@
isEmailConfirmed = await UserManager.IsEmailConfirmedAsync(user);
Input.NewEmail ??= email;
Input ??= new InputModel();
}
private async Task OnValidSubmitAsync()
@@ -79,7 +79,7 @@ else
private HttpContext HttpContext { get; set; } = default!;
[SupplyParameterFromForm]
private InputModel Input { get; set; } = null!;
private InputModel Input { get; set; } = new();
protected override async Task OnInitializedAsync()
{
@@ -11,14 +11,27 @@
<PageTitle>Profile</PageTitle>
<MudText Typo="Typo.h6">Profile</MudText>
<h3>Profile</h3>
<StatusMessage />
<MudContainer Class="pa-0 ma-0">
<MudTextField Value="@username" Variant="Variant.Outlined" Label="Username"/>
</MudContainer>
<div class="row">
<div class="col-xl-6">
<EditForm Model="Input" FormName="profile" OnValidSubmit="OnValidSubmitAsync" method="post">
<DataAnnotationsValidator />
<ValidationSummary class="text-danger" role="alert" />
<div class="form-floating mb-3">
<input type="text" value="@username" id="username" class="form-control" placeholder="Choose your username." disabled />
<label for="username" class="form-label">Username</label>
</div>
<!--<div class="form-floating mb-3">
<InputText @bind-Value="Input.PhoneNumber" id="Input.PhoneNumber" class="form-control" placeholder="Enter your phone number" />
<label for="Input.PhoneNumber" class="form-label">Phone number</label>
<ValidationMessage For="() => Input.PhoneNumber" class="text-danger" />
</div>
<button type="submit" class="w-100 btn btn-lg btn-primary">Save</button>-->
</EditForm>
</div>
</div>
@code {
private ApplicationUser user = default!;
@@ -29,7 +42,7 @@
private HttpContext HttpContext { get; set; } = default!;
[SupplyParameterFromForm]
private InputModel Input { get; set; } = null!;
private InputModel Input { get; set; } = new();
protected override async Task OnInitializedAsync()
{
@@ -45,7 +45,7 @@
private HttpContext HttpContext { get; set; } = default!;
[SupplyParameterFromForm]
private InputModel Input { get; set; } = null!;
private InputModel Input { get; set; } = new();
protected override async Task OnInitializedAsync()
{
@@ -59,7 +59,7 @@
private IEnumerable<IdentityError>? identityErrors;
[SupplyParameterFromForm]
private InputModel Input { get; set; } = null!;
private InputModel Input { get; set; } = new();
[SupplyParameterFromQuery]
private string? ReturnUrl { get; set; }
@@ -37,7 +37,7 @@
private string? message;
[SupplyParameterFromForm]
private InputModel Input { get; set; } = null!;
private InputModel Input { get; set; } = new();
private async Task OnValidSubmitAsync()
{
@@ -46,7 +46,7 @@
private IEnumerable<IdentityError>? identityErrors;
[SupplyParameterFromForm]
private InputModel Input { get; set; } = null!;
private InputModel Input { get; set; } = new();
[SupplyParameterFromQuery]
private string? Code { get; set; }
@@ -1,18 +1,17 @@
@inherits LayoutComponentBase
@layout CouchLog.Components.Layout.MainLayout
<MudText Typo="Typo.h2">Manage your account</MudText>
<h1>Manage your account</h1>
<MudContainer MaxWidth="MaxWidth.False" Class="pa-4">
<MudText Typo="Typo.h4">Change your account settings</MudText>
<hr/>
<MudGrid>
<MudItem xs="12" md="3" lg="2">
<ManageNavMenu/>
</MudItem>
<MudItem xs="12" md="9" lg="10">
<div>
<h2>Change your account settings</h2>
<hr />
<div class="row">
<div class="col-lg-3">
<ManageNavMenu />
</div>
<div class="col-lg-9">
@Body
</MudItem>
</MudGrid>
</MudContainer>
</div>
</div>
</div>
@@ -3,41 +3,33 @@
@inject SignInManager<ApplicationUser> SignInManager
<MudNavMenu>
<MudNavLink Href="Account/Manage"
Icon="@Icons.Material.Filled.ManageAccounts">
Manage
</MudNavLink>
<ul class="nav nav-pills flex-column">
<li class="nav-item">
<NavLink class="nav-link" href="Account/Manage" Match="NavLinkMatch.All">Profile</NavLink>
</li>
<!--
<MudNavLink Href="Account/Manage/Email"
Icon="@Icons.Material.Filled.Email">
Email
</MudNavLink>
<li class="nav-item">
<NavLink class="nav-link" href="Account/Manage/Email">Email</NavLink>
</li>
-->
<MudNavLink Href="Account/ChangePassword"
Icon="@Icons.Material.Filled.Password">
Password
</MudNavLink>
<li class="nav-item">
<NavLink class="nav-link" href="Account/Manage/ChangePassword">Password</NavLink>
</li>
@if (hasExternalLogins)
{
<MudNavLink Href="Account/Manage/ExternalLogins"
Icon="@Icons.Material.Filled.Login">
External logins
</MudNavLink>
<li class="nav-item">
<NavLink class="nav-link" href="Account/Manage/ExternalLogins">External logins</NavLink>
</li>
}
<!--
<MudNavLink Href="Account/Manage/TwoFactorAuthentication"
Icon="@Icons.Material.Filled.FactCheck">
Two-factor authentication
</MudNavLink>
<li class="nav-item">
<NavLink class="nav-link" href="Account/Manage/TwoFactorAuthentication">Two-factor authentication</NavLink>
</li>
-->
<!--
<MudNavLink Href="Account/Manage/PersonalData"
Icon="@Icons.Material.Filled.DataObject">
Personal data
</MudNavLink>
-->
</MudNavMenu>
<li class="nav-item">
<NavLink class="nav-link" href="Account/Manage/PersonalData">Personal data</NavLink>
</li>
</ul>
@code {
private bool hasExternalLogins;
@@ -17,11 +17,11 @@
Color="Color.Primary" />
</EditForm>
@*<MudText>Version: @_version</MudText>*@
<MudText>Version: @_version</MudText>
@code {
private AccountsSettings _accountsSettings = null!;
//private readonly string _version = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion?.Split('+')[0];
private AccountsSettings? _accountsSettings;
private readonly string _version = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion?.Split('+')[0];
protected override async Task OnInitializedAsync()
{
@@ -1,16 +1,11 @@
@using CouchLog.Data
<MudCard>
<MudPaper Elevation="0" Style="position: relative;" @onmouseenter="@(() => _showEditOverlay = true)" @onmouseleave="@(() => _showEditOverlay = false)">
<MudCardMedia Image="@($"{GlobalEntity.PicturePath}?v={DateTime.Now.Ticks}")" Height="400" Style="object-fit: contain;"/>
<MudOverlay Visible="@_showEditOverlay" DarkBackground="true" Absolute="true">
<MudIconButton Icon="@Icons.Material.Rounded.Edit" Color="Color.Primary" OnClick="@(()=> OnEdit.InvokeAsync(GlobalEntity))" />
</MudOverlay>
<MudPaper Elevation="0">
<MudCardMedia Image="@GlobalEntity.PicturePath" Height="400" Style="object-fit: contain;"/>
</MudPaper>
<MudCardContent>
<MudTooltip Text="@GlobalEntity.Title">
<MudText Typo="Typo.h5" Style="display: block; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">@GlobalEntity.Title</MudText>
</MudTooltip>
<MudText Typo="Typo.h5">@GlobalEntity.Title</MudText>
</MudCardContent>
<MudCardActions>
<MudTooltip Text="Add to shared List">
@@ -39,7 +34,4 @@
[Parameter] public EventCallback<GlobalEntity> OnAddToPrivate { get; set; }
[Parameter] public EventCallback<GlobalEntity> OnAddToShared { get; set; }
[Parameter] public EventCallback<GlobalEntity> OnEdit { get; set; }
private bool _showEditOverlay;
}
@@ -1,9 +1,10 @@
@using CouchLog.Data
@using Microsoft.EntityFrameworkCore
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Identity
@using System.ComponentModel.DataAnnotations
@inject ApplicationDbContext CouchLogDb
@inject ApplicationDbContext CouchLogDB
@inject UserManager<ApplicationUser> UserManager
@inject AuthenticationStateProvider AuthenticationStateProvider
@inject NavigationManager NavigationManager
@@ -22,10 +23,10 @@
</TitleContent>
<DialogContent>
<EditForm EditContext="_editContext" OnSubmit="HandleSubmit" id="New-Global-Entity-Form">
<EditForm EditContext="_editContext" OnSubmit="HandleSubmit">
<DataAnnotationsValidator />
<MudStack Row="true" Spacing="3" AlignItems="AlignItems.Start" Style="min-height: 400px;" Breakpoint="Breakpoint.SmAndDown">
<MudStack Row="true" Spacing="3" AlignItems="AlignItems.Start" Style="min-height: 400px;">
<!--<editor-fold desc="Picture-Upload">-->
<MudPaper Class="pa-0" Elevation="0" Width="280px" MinWidth="280px">
@if (!string.IsNullOrWhiteSpace(_imagePreview))
@@ -43,12 +44,13 @@
Accept="image/*"
InputClass="null"
Class="mud-file-upload-dragarea">
<SelectedTemplate Context="selectedTemplateContext"/>
<SelectedTemplate Context="SelectedTemplateContext"/>
</MudFileUpload>
}
</MudPaper>
<!--</editor-fold>-->
<MudPaper Class="flex-grow-1" Elevation="0" MinWidth="200px">
<MudPaper Class="flex-grow-1" Elevation="0">
<MudStack Spacing="3">
<MudTextField @bind-Value="_form.Title"
@@ -77,18 +79,10 @@
}
</MudSelect>
<MudCheckBox @bind-Value="_isPrivate" Label="Is Private" Color="Color.Primary" />
</MudStack>
</MudPaper>
</MudStack>
</EditForm>
</DialogContent>
<DialogActions>
<MudButton OnClick="Cancel" Variant="Variant.Filled" Color="Color.Error" Disabled="_isSaving" Class="mt-3">Cancel</MudButton>
<MudButton ButtonType="ButtonType.Submit" Variant="Variant.Filled" Color="Color.Success" Disabled="_isSaving" Class="mt-3" form="New-Global-Entity-Form">
<MudButton ButtonType="ButtonType.Submit" Variant="Variant.Filled" Color="Color.Success" Disabled="_isSaving" Class="mt-3">
@if (_isSaving)
{
<MudProgressCircular Indeterminate="true" Size="Size.Small" Class="mr-2"/>
<MudProgressCircular Indeterminate="true" Size="Size.Small" Class="mr-2" />
<span>Saving...</span>
}
else
@@ -96,6 +90,14 @@
<span>Create Global Entity</span>
}
</MudButton>
</MudStack>
</MudPaper>
</MudStack>
</EditForm>
</DialogContent>
<DialogActions>
<MudButton OnClick="Cancel" Variant="Variant.Text" Disabled="_isSaving">Cancel</MudButton>
</DialogActions>
</MudDialog>
@@ -118,9 +120,6 @@
//Picture
private IBrowserFile? _pictureFile;
private string _pictureBase64 = null!;
private string? _pictureContentType;
private string? _pictureExtension;
private class GlobalEntityFormModel
{
@@ -143,8 +142,8 @@
return;
}
_mediaTypes = await CouchLogDb.MediaType.OrderBy(t => t.Id).ToListAsync();
_genres = await CouchLogDb.Genres.OrderBy(t => t.Id).ToListAsync();
_mediaTypes = await CouchLogDB.MediaType.OrderBy(t => t.Id).ToListAsync();
_genres = await CouchLogDB.Genres.OrderBy(t => t.Id).ToListAsync();
if (_mediaTypes.Count > 0)
_selectedMediaTypeId = _mediaTypes.First().Id;
@@ -166,11 +165,8 @@
using var ms = new MemoryStream();
await stream.CopyToAsync(ms);
_pictureContentType = _pictureFile.ContentType;
_pictureExtension = Path.GetExtension(_pictureFile.Name);
_pictureBase64 = Convert.ToBase64String(ms.ToArray());
_imagePreview = $"data:{_pictureFile.ContentType};base64,{_pictureBase64}";
var base64 = Convert.ToBase64String(ms.ToArray());
_imagePreview = $"data:{_pictureFile.ContentType};base64,{base64}";
}
private void Cancel() => MudDialog.Cancel();
@@ -195,10 +191,13 @@
try
{
string fileName = $"{Guid.NewGuid()}{_pictureExtension}";
string fileName = $"{Guid.NewGuid()}{Path.GetExtension(_pictureFile.Name)}";
string picturePath = Path.Combine("wwwroot", "Pictures", fileName);
await File.WriteAllBytesAsync(picturePath, Convert.FromBase64String(_pictureBase64));
await using (var fs = File.Create(picturePath))
{
await _pictureFile.OpenReadStream(maxAllowedSize: 10_000_000).CopyToAsync(fs);
}
var entity = new GlobalEntity
{
@@ -210,19 +209,19 @@
IsPrivate = _isPrivate
};
CouchLogDb.Add(entity);
await CouchLogDb.SaveChangesAsync();
CouchLogDB.Add(entity);
await CouchLogDB.SaveChangesAsync();
foreach (int genreId in _selectedGenreIds)
{
CouchLogDb.Add(new LinkTableGlobalGenre
CouchLogDB.Add(new LinkTableGlobalGenre
{
GenreId = genreId,
GlobalEntityId = entity.Id
});
}
await CouchLogDb.SaveChangesAsync();
await CouchLogDB.SaveChangesAsync();
Snackbar.Add("Global Entity created!", Severity.Success);
MudDialog.Close(DialogResult.Ok(entity));
File diff suppressed because one or more lines are too long
@@ -78,12 +78,11 @@
<MudGrid Spacing="6" Justify="Justify.Center">
@foreach (var globalEntity in VisibleGlobalEntities)
{
<MudItem xs="12" sm="6" md="4" lg="3" xl="2" Style="min-width: 0;">
<MudItem xs="12" sm="6" md="4" lg="3" xl="2">
<GlobalEntityCard GlobalEntity="globalEntity"
UserPrivateEntityIds="_userPrivateEntityIds"
OnAddToPrivate="AddGlobalEntityToPrivateList"
OnAddToShared="AddGlobalEntityToSharedList"
OnEdit="OpenEditGlobalEntityDialog"/>
OnAddToShared="AddGlobalEntityToSharedList"/>
</MudItem>
}
</MudGrid>
@@ -152,7 +151,7 @@
private async Task OnNewEntity(GlobalEntity entity)
{
_globalEntities.Insert(0, entity);
_globalEntities.Add(entity);
await RefreshPage();
}
@@ -167,44 +166,6 @@
}
}
private async Task OpenEditGlobalEntityDialog(GlobalEntity globalEntity)
{
var parameters = new DialogParameters<EditGlobalEntityDialog>
{
{ x => x.GlobalEntity, globalEntity },
{ x => x.AppUser, _appUser}
};
var dialog = await DialogService.ShowAsync<EditGlobalEntityDialog>("Edit Global Entity", parameters);
var result = await dialog.Result;
if (!result!.Canceled && result.Data is ValueTuple<GlobalEntity, bool> data)
{
if (data.Item2)
{
CouchLogDb.GlobalEntities.Remove(data.Item1);
await CouchLogDb.SaveChangesAsync();
_globalEntities.RemoveAll(x => x.Id == data.Item1.Id);
if (_currentPage > TotalPages)
_currentPage = Math.Max(1, TotalPages);
StateHasChanged();
}
if (!data.Item2)
{
int index = _globalEntities.FindIndex(x => x.Id == data.Item1.Id);
if (index >= 0)
{
_globalEntities[index] = data.Item1;
}
StateHasChanged();
}
}
}
public async Task AddGlobalEntityToPrivateList(GlobalEntity globalEntity)
{
if(_appUser is null) { Snackbar.Add("Not logged in!", Severity.Error); return;}
@@ -6,7 +6,7 @@
<!--<editor-fold desc="Poster-Image">-->
<MudItem xs="4">
<MudImage
Src="@($"{PrivateEntity.GlobalEntity.PicturePath}?v={DateTime.Now.Ticks}")"
Src="@PrivateEntity.GlobalEntity.PicturePath"
Alt=""
ObjectFit="ObjectFit.Cover"
Style="width: 100%; height: 100%; min-height: 180px; border-radius: 4px 0 0 4px;" />
@@ -17,9 +17,7 @@
<MudStack Class="pa-3" Spacing="2">
<!--<editor-fold desc="Options">-->
<MudStack Row="true" AlignItems="AlignItems.Center" Justify="Justify.SpaceBetween">
<MudTooltip Text="@PrivateEntity.GlobalEntity.Title">
<MudText Typo="Typo.h6" Style="display: block; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">@PrivateEntity.GlobalEntity.Title</MudText>
</MudTooltip>
<MudText Typo="Typo.h6">@PrivateEntity.GlobalEntity.Title</MudText>
<MudMenu Icon="@Icons.Material.Filled.MoreVert" Color="Color.Default" Dense="true">
<MudMenuItem>Edit</MudMenuItem>
<MudMenuItem OnClick="@(() => OnRemove.InvokeAsync())">Remove</MudMenuItem>
@@ -42,8 +40,6 @@
</MudSelect>
<!--</editor-fold>-->
<!-- @if (PrivateEntity.GlobalEntity.MediaType.Name == "Series" || PrivateEntity.GlobalEntity.MediaType.Name == "Anime") -->
<!--{-->
<!--<editor-fold desc="Dropdown-Season">-->
<MudSelect
T="int?"
@@ -51,8 +47,7 @@
ValueChanged="@(newSeason => OnSeasonChange.InvokeAsync(newSeason))"
Dense="true"
Variant="Variant.Outlined"
Label=""
Class="@(PrivateEntity.GlobalEntity.MediaType.Name == "Series" ? "" : "invisible")">
Label="">
@{
int? currentSeason = PrivateEntity.Season ?? 1;
int? startOffsetSeason = currentSeason > 1 ? -1 : 0;
@@ -72,8 +67,7 @@
ValueChanged="@(newEpisode => OnEpisodeChange.InvokeAsync(newEpisode))"
Dense="true"
Variant="Variant.Outlined"
Label=""
Class="@(PrivateEntity.GlobalEntity.MediaType.Name == "Series" ? "" : "invisible")">
Label="">
@{
int? currentEpisode = PrivateEntity.Episode ?? 1;
int? startOffsetEpisode = currentEpisode > 1 ? -1 : 0;
@@ -85,7 +79,6 @@
}
</MudSelect>
<!--</editor-fold>-->
<!--}-->
<!--<editor-fold desc="Details Button">-->
<MudStack Row="true" Justify="Justify.FlexEnd">
@@ -132,7 +132,7 @@
//Filter
private string? _searchString;
private bool _showFilters;
//private bool _showAlreadyAddedEntities = false;
private bool _showAlreadyAddedEntities = false;
private IEnumerable<PrivateEntity> FiltertGlobalEntities => _privateEntities.Where(entity =>
(string.IsNullOrWhiteSpace(_searchString) || entity.GlobalEntity.Title.Contains(_searchString, StringComparison.OrdinalIgnoreCase)) //Search bar
);
+14 -13
View File
@@ -9,8 +9,6 @@
<PackAsTool>True</PackAsTool>
<Version>0.1.0-nightly.10</Version>
<Authors>Penry</Authors>
<IsPackable>false</IsPackable>
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
</PropertyGroup>
<ItemGroup>
@@ -62,23 +60,26 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.QuickGrid" Version="10.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="10.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="10.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="10.0.9" />
<PackageReference Include="Microsoft.Build" Version="18.7.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.9">
<PackageReference Include="Microsoft.AspNetCore.Components.QuickGrid" Version="10.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="10.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="10.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="10.0.1" />
<PackageReference Include="Microsoft.Build" Version="18.0.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Features" Version="5.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="5.0.0" />
<PackageReference Include="Microsoft.DotNet.Scaffolding.Shared" Version="10.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.9">
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="MudBlazor" Version="9.6.0" />
<PackageReference Include="MudBlazor" Version="9.5.0" />
</ItemGroup>
<ItemGroup>
@@ -4,7 +4,8 @@ using System.Diagnostics.CodeAnalysis;
namespace CouchLog.Data
{
public class GlobalEntity
[method: SetsRequiredMembers]
public class GlobalEntity()
{
[Key]
public int Id { get; set; }
Binary file not shown.

After

Width:  |  Height:  |  Size: 410 KiB