139 lines
5.3 KiB
Plaintext
139 lines
5.3 KiB
Plaintext
@using SZUAbsolventenverein.Module.BlackBoard.Services
|
|
@using SZUAbsolventenverein.Module.BlackBoard.Models
|
|
@using Interfaces
|
|
|
|
@namespace SZUAbsolventenverein.Module.BlackBoard
|
|
@inherits ModuleBase
|
|
@inject IBlackBoardService BlackBoardService
|
|
@inject NavigationManager NavigationManager
|
|
@inject IStringLocalizer<Details> Localizer
|
|
@inject IReportUI ReportingComponent
|
|
|
|
@if (_item == null)
|
|
{
|
|
<p><em>Loading...</em></p>
|
|
}
|
|
else
|
|
{
|
|
<div class="row g-0">
|
|
<div class="col-lg-5 position-relative d-flex align-items-center justify-content-center p-4" style="min-height: 400px;">
|
|
@if (_item.ImageID > 0)
|
|
{
|
|
<div class="bb-detail-image-bg" style="background-image: url('@ImageUrl(_item.ImageID, 800, 600)');"></div>
|
|
<img src="@ImageUrl(_item.ImageID, 800, 600)" class="img-fluid rounded-3 shadow position-relative" style="max-height: 450px; z-index: 1; border: 8px solid white; object-fit: cover;" alt="@_item.Name">
|
|
}
|
|
else
|
|
{
|
|
<div class="text-muted position-relative" style="z-index: 1;">
|
|
<span style="font-size: 8rem; opacity: 0.2;">📋</span>
|
|
</div>
|
|
}
|
|
</div>
|
|
<div class="col-lg-7">
|
|
<div class="card-body p-4 p-md-5">
|
|
<div class="mb-4">
|
|
<h1 class="display-4 fw-bold text-dark mb-0">@_item.Name</h1>
|
|
</div>
|
|
|
|
<hr class="my-4" style="width: 100px; height: 3px; background-color: var(--primary); opacity: 1;">
|
|
|
|
<div class="bb-description-section mb-5">
|
|
<h5 class="text-uppercase fw-bold text-muted mb-3" style="letter-spacing: 1px; font-size: 0.9rem;">Beschreibung</h5>
|
|
<div class="lead text-dark mb-4" style="line-height: 1.7; font-size: 1.1rem;">
|
|
@((MarkupString)(_item.Description ?? ""))
|
|
</div>
|
|
</div>
|
|
|
|
<div class="bb-detail-audit mb-4">
|
|
<AuditInfo CreatedBy="@_item.CreatedBy" CreatedOn="@_item.CreatedOn" ModifiedBy="@_item.ModifiedBy" ModifiedOn="@_item.ModifiedOn"></AuditInfo>
|
|
</div>
|
|
|
|
<div class="d-flex flex-wrap gap-3 mt-5">
|
|
<NavLink class="btn btn-outline-secondary btn-lg px-4" href="@NavigateUrl()">
|
|
<i class="oi oi-arrow-left me-2"></i> Zurück
|
|
</NavLink>
|
|
|
|
<div class="ms-auto d-flex gap-2">
|
|
<ActionLink Action="Edit" Parameters="@("id=" + _item.BlackBoardId.ToString())" Class="btn btn-primary btn-lg px-4" Security="SecurityAccessLevel.Edit" Text="Bearbeiten" ResourceKey="Edit" />
|
|
|
|
<ActionDialog Header="Delete BlackBoard" Message="@Localizer["Message.DeleteConfirm"]" Action="Delete" Security="SecurityAccessLevel.Edit" Class="btn btn-danger btn-lg px-4" ConfirmClass="absolute" OnClick="@(async () => await DeleteEntry())" ResourceKey="Delete" Id="@_item.BlackBoardId.ToString()" />
|
|
|
|
@if (ReportingComponent != null)
|
|
{
|
|
<DynamicComponent Type="@ReportingComponent.ReportType" Parameters="@_parameters" />
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
|
|
<style>
|
|
.bb-detail-image-bg {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background-size: cover;
|
|
background-position: center;
|
|
filter: blur(30px) brightness(1.1);
|
|
opacity: 0.15;
|
|
z-index: 0;
|
|
}
|
|
.bb-details .card {
|
|
background: #ffffff;
|
|
}
|
|
.bb-details .breadcrumb-item a {
|
|
text-decoration: none;
|
|
color: var(--primary);
|
|
}
|
|
</style>
|
|
|
|
@code {
|
|
public override string Actions => "Details";
|
|
|
|
public override List<Resource> Resources => [
|
|
new Stylesheet("_content/SZUAbsolventenverein.Module.BlackBoard/Module.css")
|
|
];
|
|
|
|
private BlackBoard _item;
|
|
private int _id;
|
|
private Dictionary<string, object> _parameters = new Dictionary<string, object>();
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
try
|
|
{
|
|
_id = Int32.Parse(PageState.QueryString["id"]);
|
|
_item = await BlackBoardService.GetBlackBoardAsync(_id, ModuleState.ModuleId);
|
|
|
|
if (_item != null && ReportingComponent != null)
|
|
{
|
|
_parameters = ReportingComponent.ConstructParameterList(_item, RenderModeBoundary);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
await logger.LogError(ex, "Error Loading BlackBoard {BlackBoardId} {Error}", _id, ex.Message);
|
|
AddModuleMessage(Localizer["Message.LoadError"], MessageType.Error);
|
|
}
|
|
}
|
|
|
|
private async Task DeleteEntry()
|
|
{
|
|
try
|
|
{
|
|
await BlackBoardService.DeleteBlackBoardAsync(_item.BlackBoardId, ModuleState.ModuleId);
|
|
await logger.LogInformation("BlackBoard Deleted {BlackBoard}", _item);
|
|
NavigationManager.NavigateTo(NavigateUrl());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
await logger.LogError(ex, "Error Deleting BlackBoard {Error}", ex.Message);
|
|
AddModuleMessage(Localizer["Message.DeleteError"], MessageType.Error);
|
|
}
|
|
}
|
|
}
|