New: Working RTE and Card Style View on the index Page
This commit is contained in:
@@ -8,9 +8,9 @@
|
||||
@inject IBlackBoardService BlackBoardService
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IStringLocalizer<Edit> Localizer
|
||||
@inject IReportUI ReportingComponent // TODO
|
||||
@inject IReportUI ReportingComponent
|
||||
|
||||
<form @ref="form" class="@(validated ? " was-validated" : "needs-validation" )" novalidate>
|
||||
<form @ref="form" class="@(validated ? " was-validated" : "needs-validation")" novalidate>
|
||||
<div class="container">
|
||||
<div class="row mb-1 align-items-center">
|
||||
<Label Class="col-sm-3" For="name" HelpText="Enter a name" ResourceKey="Name">Name: </Label>
|
||||
@@ -19,14 +19,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-1 align-items-center">
|
||||
<Label Class="col-sm-3" For="description" HelpText="Enter a description" ResourceKey="Description">Beschreibung: </Label>
|
||||
<Label Class="col-sm-3" For="image" HelpText="Enter a description" ResourceKey="Description">Beschreibung: </Label>
|
||||
<div class="col-sm-9">
|
||||
<FileManager AnonymizeUploadFilenames="true" UploadMultiple="false" ShowSuccess="true" FileId="@_blackBoard.ImageID" OnSelectFile="@OnFileSelected"/>
|
||||
<FileManager AnonymizeUploadFilenames="true" id="image" UploadMultiple="false" ShowSuccess="true" FileId="@_blackBoard.ImageID" OnSelectFile="@OnFileSelected"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-1 align-items-center">
|
||||
<Label Class="" For="description" HelpText="Enter a description" ResourceKey="Description">Beschreibung: </Label>
|
||||
<RichTextEditor @ref="RichTextEditorHtml" @Content="@_blackBoard.Name" Placeholder="Enter a description: "/>
|
||||
<RichTextEditor @ref="RichTextEditorHtml" Content="@_blackBoard.Description" id="description" Placeholder="Enter a description: "/>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn btn-success" @onclick="Save">@Localizer["Save"]</button>
|
||||
@@ -40,7 +40,7 @@
|
||||
<br/><br/>
|
||||
@if (PageState.Action == "Edit")
|
||||
{
|
||||
<AuditInfo CreatedBy="@_createdby" CreatedOn="@_createdon" ModifiedBy="@_modifiedby" ModifiedOn="@_modifiedon"></AuditInfo>
|
||||
<AuditInfo CreatedBy="@_blackBoard.CreatedBy" CreatedOn="@_blackBoard.CreatedOn" ModifiedBy="@_blackBoard.ModifiedBy" ModifiedOn="@_blackBoard.ModifiedOn"></AuditInfo>
|
||||
}
|
||||
</form>
|
||||
|
||||
@@ -53,20 +53,13 @@
|
||||
|
||||
public override string Title => "Manage BlackBoard";
|
||||
|
||||
public override List<Resource> Resources => new List<Resource>()
|
||||
{
|
||||
new Stylesheet("_content/SZUAbsolventenverein.Module.BlackBoard/Module.css")
|
||||
};
|
||||
public override List<Resource> Resources => [new Stylesheet("_content/SZUAbsolventenverein.Module.BlackBoard/Module.css")];
|
||||
|
||||
private RichTextEditor RichTextEditorHtml;
|
||||
private ElementReference form;
|
||||
private bool validated = false;
|
||||
private bool validated;
|
||||
|
||||
private int _id;
|
||||
private string _createdby;
|
||||
private DateTime _createdon;
|
||||
private string _modifiedby;
|
||||
private DateTime _modifiedon;
|
||||
|
||||
// TODO
|
||||
private BlackBoard _blackBoard = new BlackBoard();
|
||||
@@ -82,13 +75,8 @@
|
||||
_blackBoard = await BlackBoardService.GetBlackBoardAsync(_id, ModuleState.ModuleId);
|
||||
if (_blackBoard != null)
|
||||
{
|
||||
_createdby = _blackBoard.CreatedBy;
|
||||
_createdon = _blackBoard.CreatedOn;
|
||||
_modifiedby = _blackBoard.ModifiedBy;
|
||||
_modifiedon = _blackBoard.ModifiedOn;
|
||||
_parameters = ReportingComponent.ConstructParameterList(_blackBoard, RenderModeBoundary);
|
||||
}
|
||||
|
||||
_parameters = ReportingComponent.ConstructParameterList(_blackBoard, RenderModeBoundary);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -113,6 +101,7 @@
|
||||
var interop = new Oqtane.UI.Interop(JSRuntime);
|
||||
if (await interop.FormValid(form))
|
||||
{
|
||||
_blackBoard.Description = await RichTextEditorHtml.GetHtml();
|
||||
if (PageState.Action == "Add")
|
||||
{
|
||||
_blackBoard.ModuleId = ModuleState.ModuleId;
|
||||
@@ -138,4 +127,5 @@
|
||||
AddModuleMessage(Localizer["Message.SaveError"], MessageType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user