From eda0ad794d78dc8995cd795fa6a9e25ea67289bb Mon Sep 17 00:00:00 2001 From: Florian Edlmayer Date: Thu, 19 Feb 2026 14:41:35 +0100 Subject: [PATCH] =?UTF-8?q?Titel=20und=20Kurzbeschreibung=20hinzugef=C3=BC?= =?UTF-8?q?gt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApplicationList.razor | 16 ++++++---- .../Apply.razor | 26 ++++++++++++++- .../ModuleInfo.cs | 10 +++--- .../01000003_AddTitleAndDescription.cs | 32 +++++++++++++++++++ .../EngineerApplicationEntityBuilder.cs | 17 +++++++--- .../EngineerApplicationRepository.cs | 2 ++ Shared/Models/EngineerApplication.cs | 12 ++----- 7 files changed, 90 insertions(+), 25 deletions(-) create mode 100644 Server/Migrations/01000003_AddTitleAndDescription.cs diff --git a/Client/Modules/SZUAbsolventenverein.Module.PremiumArea/ApplicationList.razor b/Client/Modules/SZUAbsolventenverein.Module.PremiumArea/ApplicationList.razor index 3b60774..f84af89 100644 --- a/Client/Modules/SZUAbsolventenverein.Module.PremiumArea/ApplicationList.razor +++ b/Client/Modules/SZUAbsolventenverein.Module.PremiumArea/ApplicationList.razor @@ -16,7 +16,7 @@ else if (_applications.Count == 0) {
- Keine genehmigten Anträge gefunden. + Keine Anträge gefunden.
} else @@ -27,12 +27,16 @@
-
Ingenieur-Antrag
+
@(string.IsNullOrEmpty(app.Title) ? "Ingenieur-Antrag" : app.Title)
Benutzer ID: @app.UserId
-

- Datei: @app.FileId
- Status: Veröffentlicht
- Datum: @(app.ApprovedOn?.ToShortDateString() ?? app.CreatedOn.ToShortDateString()) + @if (!string.IsNullOrEmpty(app.ShortDescription)) + { +

@app.ShortDescription

+ } +

+ + Datum: @(app.ApprovedOn?.ToShortDateString() ?? app.CreatedOn.ToShortDateString()) +

diff --git a/Client/Modules/SZUAbsolventenverein.Module.PremiumArea/Apply.razor b/Client/Modules/SZUAbsolventenverein.Module.PremiumArea/Apply.razor index 0cf7796..c183ea6 100644 --- a/Client/Modules/SZUAbsolventenverein.Module.PremiumArea/Apply.razor +++ b/Client/Modules/SZUAbsolventenverein.Module.PremiumArea/Apply.razor @@ -22,6 +22,16 @@

Bitte laden Sie Ihren Ingenieur-Antrag als PDF-Datei hoch.

+
+ + +
+ +
+ + +
+ @*
@@ -49,6 +59,18 @@ else

Status: Veröffentlicht

+ @if (!string.IsNullOrEmpty(_existingApp.Title)) + { +

+ Titel: @_existingApp.Title +

+ } + @if (!string.IsNullOrEmpty(_existingApp.ShortDescription)) + { +

+ Kurzbeschreibung: @_existingApp.ShortDescription +

+ }

Datum: @_existingApp.CreatedOn.ToShortDateString()

@@ -104,8 +126,10 @@ else { ApplicationId = _existingApp?.ApplicationId ?? 0, ModuleId = ModuleState.ModuleId, - UserId = PageState.User.UserId, // Ensure UserID is set + UserId = PageState.User.UserId, FileId = _existingApp.FileId, + Title = _existingApp.Title, + ShortDescription = _existingApp.ShortDescription, Status = "Published", // Auto-publish SubmittedOn = DateTime.UtcNow, ApprovedOn = DateTime.UtcNow, // Auto-approved diff --git a/Client/Modules/SZUAbsolventenverein.Module.PremiumArea/ModuleInfo.cs b/Client/Modules/SZUAbsolventenverein.Module.PremiumArea/ModuleInfo.cs index 33f104c..d213092 100644 --- a/Client/Modules/SZUAbsolventenverein.Module.PremiumArea/ModuleInfo.cs +++ b/Client/Modules/SZUAbsolventenverein.Module.PremiumArea/ModuleInfo.cs @@ -9,10 +9,12 @@ namespace SZUAbsolventenverein.Module.PremiumArea public ModuleDefinition ModuleDefinition => new ModuleDefinition { 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.", - Version = "1.0.2", - ServerManagerType = "SZUAbsolventenverein.Module.PremiumArea.Manager.PremiumAreaManager, SZUAbsolventenverein.Module.PremiumArea.Server.Oqtane", - ReleaseVersions = "1.0.0,1.0.1,1.0.2", + 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.", + Version = "1.0.3", + 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", PackageName = "SZUAbsolventenverein.Module.PremiumArea", // Hier definieren Sie, WELCHE Permissions verfügbar sind diff --git a/Server/Migrations/01000003_AddTitleAndDescription.cs b/Server/Migrations/01000003_AddTitleAndDescription.cs new file mode 100644 index 0000000..60b7a0b --- /dev/null +++ b/Server/Migrations/01000003_AddTitleAndDescription.cs @@ -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"); + } + } +} diff --git a/Server/Migrations/EntityBuilders/EngineerApplicationEntityBuilder.cs b/Server/Migrations/EntityBuilders/EngineerApplicationEntityBuilder.cs index de7516d..aa53b6b 100644 --- a/Server/Migrations/EntityBuilders/EngineerApplicationEntityBuilder.cs +++ b/Server/Migrations/EntityBuilders/EngineerApplicationEntityBuilder.cs @@ -11,10 +11,16 @@ namespace SZUAbsolventenverein.Module.PremiumArea.Migrations.EntityBuilders public class EngineerApplicationEntityBuilder : AuditableBaseEntityBuilder { private const string _entityTableName = "SZUAbsolventenvereinEngineerApplications"; - private readonly PrimaryKey _primaryKey = new("PK_SZUAbsolventenvereinEngineerApplications", x => x.ApplicationId); - private readonly ForeignKey _moduleForeignKey = new("FK_SZUAbsolventenvereinEngineerApplications_Module", x => x.ModuleId, "Module", "ModuleId", ReferentialAction.Cascade); - public EngineerApplicationEntityBuilder(MigrationBuilder migrationBuilder, IDatabase database) : base(migrationBuilder, database) + private readonly PrimaryKey _primaryKey = + new("PK_SZUAbsolventenvereinEngineerApplications", x => x.ApplicationId); + + private readonly ForeignKey _moduleForeignKey = + new("FK_SZUAbsolventenvereinEngineerApplications_Module", x => x.ModuleId, "Module", "ModuleId", + ReferentialAction.Cascade); + + public EngineerApplicationEntityBuilder(MigrationBuilder migrationBuilder, IDatabase database) : base( + migrationBuilder, database) { EntityTableName = _entityTableName; PrimaryKey = _primaryKey; @@ -27,6 +33,8 @@ namespace SZUAbsolventenverein.Module.PremiumArea.Migrations.EntityBuilders UserId = AddIntegerColumn(table, "UserId"); ModuleId = AddIntegerColumn(table, "ModuleId"); FileId = AddIntegerColumn(table, "FileId", true); + Title = AddStringColumn(table, "Title", 256, true); + ShortDescription = AddMaxStringColumn(table, "ShortDescription", true); PdfFileName = AddStringColumn(table, "PdfFileName", 256); Status = AddStringColumn(table, "Status", 50); AdminReviewedBy = AddIntegerColumn(table, "AdminReviewedBy", true); @@ -42,11 +50,12 @@ namespace SZUAbsolventenverein.Module.PremiumArea.Migrations.EntityBuilders } - public OperationBuilder ApplicationId { get; set; } public OperationBuilder UserId { get; set; } public OperationBuilder ModuleId { get; set; } public OperationBuilder FileId { get; set; } + public OperationBuilder Title { get; set; } + public OperationBuilder ShortDescription { get; set; } public OperationBuilder PdfFileName { get; set; } public OperationBuilder Status { get; set; } public OperationBuilder AdminReviewedBy { get; set; } diff --git a/Server/Repository/EngineerApplicationRepository.cs b/Server/Repository/EngineerApplicationRepository.cs index e855504..e04847e 100644 --- a/Server/Repository/EngineerApplicationRepository.cs +++ b/Server/Repository/EngineerApplicationRepository.cs @@ -90,6 +90,8 @@ namespace SZUAbsolventenverein.Module.PremiumArea.Repository if (existing != null) { existing.FileId = EngineerApplication.FileId; + existing.Title = EngineerApplication.Title; + existing.ShortDescription = EngineerApplication.ShortDescription; existing.Status = EngineerApplication.Status; existing.SubmittedOn = EngineerApplication.SubmittedOn; existing.ApprovedOn = EngineerApplication.ApprovedOn; diff --git a/Shared/Models/EngineerApplication.cs b/Shared/Models/EngineerApplication.cs index 4d79b73..106274a 100644 --- a/Shared/Models/EngineerApplication.cs +++ b/Shared/Models/EngineerApplication.cs @@ -12,16 +12,8 @@ namespace SZUAbsolventenverein.Module.PremiumArea.Models public int UserId { get; set; } public int ModuleId { get; set; } // Context context public int FileId { get; set; } - public string PdfFileName { get; set; } = "antrag.pdf"; // Legacy-Spalte, DB ist NOT NULL - - // 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 + [StringLength(256)] public string Title { get; set; } + public string ShortDescription { get; set; } // Status: "Draft", "Submitted", "Approved", "Rejected" [StringLength(50)] public string Status { get; set; }