Titel und Kurzbeschreibung hinzugefügt
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
else if (_applications.Count == 0)
|
else if (_applications.Count == 0)
|
||||||
{
|
{
|
||||||
<div class="alert alert-warning">
|
<div class="alert alert-warning">
|
||||||
Keine genehmigten Anträge gefunden.
|
Keine Anträge gefunden.
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -27,12 +27,16 @@
|
|||||||
<div class="col-md-4 mb-3">
|
<div class="col-md-4 mb-3">
|
||||||
<div class="card h-100">
|
<div class="card h-100">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title">Ingenieur-Antrag</h5>
|
<h5 class="card-title">@(string.IsNullOrEmpty(app.Title) ? "Ingenieur-Antrag" : app.Title)</h5>
|
||||||
<h6 class="card-subtitle mb-2 text-muted">Benutzer ID: @app.UserId</h6>
|
<h6 class="card-subtitle mb-2 text-muted">Benutzer ID: @app.UserId</h6>
|
||||||
<p class="card-text">
|
@if (!string.IsNullOrEmpty(app.ShortDescription))
|
||||||
<strong>Datei:</strong> @app.FileId<br/>
|
{
|
||||||
<strong>Status:</strong> <span class="badge bg-success">Veröffentlicht</span><br/>
|
<p class="card-text">@app.ShortDescription</p>
|
||||||
<strong>Datum:</strong> @(app.ApprovedOn?.ToShortDateString() ?? app.CreatedOn.ToShortDateString())
|
}
|
||||||
|
<p class="card-text text-muted">
|
||||||
|
<small>
|
||||||
|
<strong>Datum:</strong> @(app.ApprovedOn?.ToShortDateString() ?? app.CreatedOn.ToShortDateString())
|
||||||
|
</small>
|
||||||
</p>
|
</p>
|
||||||
<div class="d-flex gap-2">
|
<div class="d-flex gap-2">
|
||||||
<button class="btn btn-primary btn-sm" @onclick="@(async () => ShowDetail(app))">PDF ansehen</button>
|
<button class="btn btn-primary btn-sm" @onclick="@(async () => ShowDetail(app))">PDF ansehen</button>
|
||||||
|
|||||||
@@ -22,6 +22,16 @@
|
|||||||
<div class="card p-3">
|
<div class="card p-3">
|
||||||
<p>Bitte laden Sie Ihren Ingenieur-Antrag als PDF-Datei hoch.</p>
|
<p>Bitte laden Sie Ihren Ingenieur-Antrag als PDF-Datei hoch.</p>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="title" class="form-label">Titel</label>
|
||||||
|
<input id="title" type="text" class="form-control" @bind="_existingApp.Title" maxlength="256"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="description" class="form-label">Kurzbeschreibung</label>
|
||||||
|
<textarea id="description" class="form-control" rows="3" @bind="_existingApp.ShortDescription" placeholder="Kurze Beschreibung Ihres Ingenieur-Antrags..."></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
@* <div class="mb-3">
|
@* <div class="mb-3">
|
||||||
<label for="pdfUpload" class="form-label">Antrags-PDF</label>
|
<label for="pdfUpload" class="form-label">Antrags-PDF</label>
|
||||||
<InputFile OnChange="@LoadFiles" class="form-control" accept=".pdf"/>
|
<InputFile OnChange="@LoadFiles" class="form-control" accept=".pdf"/>
|
||||||
@@ -49,6 +59,18 @@ else
|
|||||||
<p>
|
<p>
|
||||||
<strong>Status:</strong> <span class="badge bg-success">Veröffentlicht</span>
|
<strong>Status:</strong> <span class="badge bg-success">Veröffentlicht</span>
|
||||||
</p>
|
</p>
|
||||||
|
@if (!string.IsNullOrEmpty(_existingApp.Title))
|
||||||
|
{
|
||||||
|
<p>
|
||||||
|
<strong>Titel:</strong> @_existingApp.Title
|
||||||
|
</p>
|
||||||
|
}
|
||||||
|
@if (!string.IsNullOrEmpty(_existingApp.ShortDescription))
|
||||||
|
{
|
||||||
|
<p>
|
||||||
|
<strong>Kurzbeschreibung:</strong> @_existingApp.ShortDescription
|
||||||
|
</p>
|
||||||
|
}
|
||||||
<p>
|
<p>
|
||||||
<strong>Datum:</strong> @_existingApp.CreatedOn.ToShortDateString()
|
<strong>Datum:</strong> @_existingApp.CreatedOn.ToShortDateString()
|
||||||
</p>
|
</p>
|
||||||
@@ -104,8 +126,10 @@ else
|
|||||||
{
|
{
|
||||||
ApplicationId = _existingApp?.ApplicationId ?? 0,
|
ApplicationId = _existingApp?.ApplicationId ?? 0,
|
||||||
ModuleId = ModuleState.ModuleId,
|
ModuleId = ModuleState.ModuleId,
|
||||||
UserId = PageState.User.UserId, // Ensure UserID is set
|
UserId = PageState.User.UserId,
|
||||||
FileId = _existingApp.FileId,
|
FileId = _existingApp.FileId,
|
||||||
|
Title = _existingApp.Title,
|
||||||
|
ShortDescription = _existingApp.ShortDescription,
|
||||||
Status = "Published", // Auto-publish
|
Status = "Published", // Auto-publish
|
||||||
SubmittedOn = DateTime.UtcNow,
|
SubmittedOn = DateTime.UtcNow,
|
||||||
ApprovedOn = DateTime.UtcNow, // Auto-approved
|
ApprovedOn = DateTime.UtcNow, // Auto-approved
|
||||||
|
|||||||
@@ -9,10 +9,12 @@ namespace SZUAbsolventenverein.Module.PremiumArea
|
|||||||
public ModuleDefinition ModuleDefinition => new ModuleDefinition
|
public ModuleDefinition ModuleDefinition => new ModuleDefinition
|
||||||
{
|
{
|
||||||
Name = "PremiumArea",
|
Name = "PremiumArea",
|
||||||
Description = "This module adds a premium member system to Octane. Users receive premium status after completing a payment. Premium members get access to exclusive features and content.",
|
Description =
|
||||||
Version = "1.0.2",
|
"This module adds a premium member system to Octane. Users receive premium status after completing a payment. Premium members get access to exclusive features and content.",
|
||||||
ServerManagerType = "SZUAbsolventenverein.Module.PremiumArea.Manager.PremiumAreaManager, SZUAbsolventenverein.Module.PremiumArea.Server.Oqtane",
|
Version = "1.0.3",
|
||||||
ReleaseVersions = "1.0.0,1.0.1,1.0.2",
|
ServerManagerType =
|
||||||
|
"SZUAbsolventenverein.Module.PremiumArea.Manager.PremiumAreaManager, SZUAbsolventenverein.Module.PremiumArea.Server.Oqtane",
|
||||||
|
ReleaseVersions = "1.0.0,1.0.1,1.0.2,1.0.3",
|
||||||
Dependencies = "SZUAbsolventenverein.Module.PremiumArea.Shared.Oqtane",
|
Dependencies = "SZUAbsolventenverein.Module.PremiumArea.Shared.Oqtane",
|
||||||
PackageName = "SZUAbsolventenverein.Module.PremiumArea",
|
PackageName = "SZUAbsolventenverein.Module.PremiumArea",
|
||||||
// Hier definieren Sie, WELCHE Permissions verfügbar sind
|
// Hier definieren Sie, WELCHE Permissions verfügbar sind
|
||||||
|
|||||||
32
Server/Migrations/01000003_AddTitleAndDescription.cs
Normal file
32
Server/Migrations/01000003_AddTitleAndDescription.cs
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Oqtane.Databases.Interfaces;
|
||||||
|
using Oqtane.Migrations;
|
||||||
|
using SZUAbsolventenverein.Module.PremiumArea.Migrations.EntityBuilders;
|
||||||
|
using SZUAbsolventenverein.Module.PremiumArea.Repository;
|
||||||
|
|
||||||
|
namespace SZUAbsolventenverein.Module.PremiumArea.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(PremiumAreaContext))]
|
||||||
|
[Migration("SZUAbsolventenverein.Module.PremiumArea.01.00.00.03")]
|
||||||
|
public class AddTitleAndDescription : MultiDatabaseMigration
|
||||||
|
{
|
||||||
|
public AddTitleAndDescription(IDatabase database) : base(database)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
var table = new EngineerApplicationEntityBuilder(migrationBuilder, ActiveDatabase);
|
||||||
|
table.AddStringColumn("Title", 256, true);
|
||||||
|
table.AddMaxStringColumn("ShortDescription", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
var table = new EngineerApplicationEntityBuilder(migrationBuilder, ActiveDatabase);
|
||||||
|
table.DropColumn("Title");
|
||||||
|
table.DropColumn("ShortDescription");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,10 +11,16 @@ namespace SZUAbsolventenverein.Module.PremiumArea.Migrations.EntityBuilders
|
|||||||
public class EngineerApplicationEntityBuilder : AuditableBaseEntityBuilder<EngineerApplicationEntityBuilder>
|
public class EngineerApplicationEntityBuilder : AuditableBaseEntityBuilder<EngineerApplicationEntityBuilder>
|
||||||
{
|
{
|
||||||
private const string _entityTableName = "SZUAbsolventenvereinEngineerApplications";
|
private const string _entityTableName = "SZUAbsolventenvereinEngineerApplications";
|
||||||
private readonly PrimaryKey<EngineerApplicationEntityBuilder> _primaryKey = new("PK_SZUAbsolventenvereinEngineerApplications", x => x.ApplicationId);
|
|
||||||
private readonly ForeignKey<EngineerApplicationEntityBuilder> _moduleForeignKey = new("FK_SZUAbsolventenvereinEngineerApplications_Module", x => x.ModuleId, "Module", "ModuleId", ReferentialAction.Cascade);
|
|
||||||
|
|
||||||
public EngineerApplicationEntityBuilder(MigrationBuilder migrationBuilder, IDatabase database) : base(migrationBuilder, database)
|
private readonly PrimaryKey<EngineerApplicationEntityBuilder> _primaryKey =
|
||||||
|
new("PK_SZUAbsolventenvereinEngineerApplications", x => x.ApplicationId);
|
||||||
|
|
||||||
|
private readonly ForeignKey<EngineerApplicationEntityBuilder> _moduleForeignKey =
|
||||||
|
new("FK_SZUAbsolventenvereinEngineerApplications_Module", x => x.ModuleId, "Module", "ModuleId",
|
||||||
|
ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
public EngineerApplicationEntityBuilder(MigrationBuilder migrationBuilder, IDatabase database) : base(
|
||||||
|
migrationBuilder, database)
|
||||||
{
|
{
|
||||||
EntityTableName = _entityTableName;
|
EntityTableName = _entityTableName;
|
||||||
PrimaryKey = _primaryKey;
|
PrimaryKey = _primaryKey;
|
||||||
@@ -27,6 +33,8 @@ namespace SZUAbsolventenverein.Module.PremiumArea.Migrations.EntityBuilders
|
|||||||
UserId = AddIntegerColumn(table, "UserId");
|
UserId = AddIntegerColumn(table, "UserId");
|
||||||
ModuleId = AddIntegerColumn(table, "ModuleId");
|
ModuleId = AddIntegerColumn(table, "ModuleId");
|
||||||
FileId = AddIntegerColumn(table, "FileId", true);
|
FileId = AddIntegerColumn(table, "FileId", true);
|
||||||
|
Title = AddStringColumn(table, "Title", 256, true);
|
||||||
|
ShortDescription = AddMaxStringColumn(table, "ShortDescription", true);
|
||||||
PdfFileName = AddStringColumn(table, "PdfFileName", 256);
|
PdfFileName = AddStringColumn(table, "PdfFileName", 256);
|
||||||
Status = AddStringColumn(table, "Status", 50);
|
Status = AddStringColumn(table, "Status", 50);
|
||||||
AdminReviewedBy = AddIntegerColumn(table, "AdminReviewedBy", true);
|
AdminReviewedBy = AddIntegerColumn(table, "AdminReviewedBy", true);
|
||||||
@@ -42,11 +50,12 @@ namespace SZUAbsolventenverein.Module.PremiumArea.Migrations.EntityBuilders
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public OperationBuilder<AddColumnOperation> ApplicationId { get; set; }
|
public OperationBuilder<AddColumnOperation> ApplicationId { get; set; }
|
||||||
public OperationBuilder<AddColumnOperation> UserId { get; set; }
|
public OperationBuilder<AddColumnOperation> UserId { get; set; }
|
||||||
public OperationBuilder<AddColumnOperation> ModuleId { get; set; }
|
public OperationBuilder<AddColumnOperation> ModuleId { get; set; }
|
||||||
public OperationBuilder<AddColumnOperation> FileId { get; set; }
|
public OperationBuilder<AddColumnOperation> FileId { get; set; }
|
||||||
|
public OperationBuilder<AddColumnOperation> Title { get; set; }
|
||||||
|
public OperationBuilder<AddColumnOperation> ShortDescription { get; set; }
|
||||||
public OperationBuilder<AddColumnOperation> PdfFileName { get; set; }
|
public OperationBuilder<AddColumnOperation> PdfFileName { get; set; }
|
||||||
public OperationBuilder<AddColumnOperation> Status { get; set; }
|
public OperationBuilder<AddColumnOperation> Status { get; set; }
|
||||||
public OperationBuilder<AddColumnOperation> AdminReviewedBy { get; set; }
|
public OperationBuilder<AddColumnOperation> AdminReviewedBy { get; set; }
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ namespace SZUAbsolventenverein.Module.PremiumArea.Repository
|
|||||||
if (existing != null)
|
if (existing != null)
|
||||||
{
|
{
|
||||||
existing.FileId = EngineerApplication.FileId;
|
existing.FileId = EngineerApplication.FileId;
|
||||||
|
existing.Title = EngineerApplication.Title;
|
||||||
|
existing.ShortDescription = EngineerApplication.ShortDescription;
|
||||||
existing.Status = EngineerApplication.Status;
|
existing.Status = EngineerApplication.Status;
|
||||||
existing.SubmittedOn = EngineerApplication.SubmittedOn;
|
existing.SubmittedOn = EngineerApplication.SubmittedOn;
|
||||||
existing.ApprovedOn = EngineerApplication.ApprovedOn;
|
existing.ApprovedOn = EngineerApplication.ApprovedOn;
|
||||||
|
|||||||
@@ -12,16 +12,8 @@ namespace SZUAbsolventenverein.Module.PremiumArea.Models
|
|||||||
public int UserId { get; set; }
|
public int UserId { get; set; }
|
||||||
public int ModuleId { get; set; } // Context context
|
public int ModuleId { get; set; } // Context context
|
||||||
public int FileId { get; set; }
|
public int FileId { get; set; }
|
||||||
public string PdfFileName { get; set; } = "antrag.pdf"; // Legacy-Spalte, DB ist NOT NULL
|
[StringLength(256)] public string Title { get; set; }
|
||||||
|
public string ShortDescription { get; set; }
|
||||||
// Legacy-Spalten: existieren noch in der DB (Migration lief nicht)
|
|
||||||
public bool IsReported { get; set; } = false;
|
|
||||||
public string ReportReason { get; set; }
|
|
||||||
public int ReportCount { get; set; } = 0;
|
|
||||||
public int? AdminReviewedBy { get; set; }
|
|
||||||
public DateTime? AdminReviewedAt { get; set; }
|
|
||||||
|
|
||||||
public string AdminNote { get; set; } = ""; // DB ist NOT NULL
|
|
||||||
|
|
||||||
// Status: "Draft", "Submitted", "Approved", "Rejected"
|
// Status: "Draft", "Submitted", "Approved", "Rejected"
|
||||||
[StringLength(50)] public string Status { get; set; }
|
[StringLength(50)] public string Status { get; set; }
|
||||||
|
|||||||
Reference in New Issue
Block a user