Compare commits
	
		
			19 Commits
		
	
	
		
			2909640f94
			...
			kh-test
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 45f203a8d4 | |||
| bdf4563e0d | |||
| 97cf2a0b83 | |||
| 7ca97bcb9b | |||
| 1c13c72a53 | |||
| e5d955370a | |||
| 939b42a90d | |||
| 16cfe54fed | |||
| f92c163e2c | |||
| 106851fe94 | |||
| 5f4794e42f | |||
| 91f1121736 | |||
| 396e531b56 | |||
| 29c93baa6d | |||
| 4f7e846661 | |||
| f63681bce5 | |||
| f280e49d96 | |||
| 527f9aadc6 | |||
| 287b932444 | 
| @ -11,6 +11,10 @@ | ||||
| <h3>Anmeldung zum Event</h3> | ||||
|  | ||||
| <p>Willst du am Event (@_name) teilnehmen?</p> | ||||
| <span class="mb-6">@_eventDate.ToLocalTime() - @_location</span> | ||||
| <div> | ||||
|     @((MarkupString)_description) | ||||
| </div> | ||||
|  | ||||
| @if (PageState.User != null) { | ||||
|  | ||||
| @ -19,11 +23,11 @@ | ||||
|         <p class="mt-3"><strong>Status:</strong>  | ||||
|             @if (Status == true) | ||||
|             { | ||||
|                 @Localizer["Zusage"] | ||||
|                 @Localizer["Zusage"]<br /> | ||||
|                 <button class="btn btn-danger" @onclick="Absage">@Localizer["Absagen"]</button> | ||||
|             } else | ||||
|             { | ||||
|                 @Localizer["Absage"] | ||||
|                 @Localizer["Absage"]<br /> | ||||
|                 <button class="btn btn-success" @onclick="Zusage">@Localizer["Zusagen"]</button> | ||||
|             } | ||||
|         </p> | ||||
| @ -35,7 +39,12 @@ | ||||
|     } | ||||
| } else | ||||
| { | ||||
|     <p class="mt-3">Um dich für dieses Event zu registrieren, muss man sich zuerst anmelden.</p> <Login /> | ||||
|     <p class="mt-3">Um dich für dieses Event zu registrieren, muss man sich zuerst anmelden.</p> | ||||
|     <Login /> | ||||
|     @* @if(PageState.Site.AllowRegistration) | ||||
|     { | ||||
|         <Register /> | ||||
|     } *@ | ||||
| } | ||||
|  | ||||
| @code { | ||||
| @ -50,15 +59,14 @@ | ||||
|         new Resource { ResourceType = ResourceType.Stylesheet, Url = ModulePath() + "Module.css" } | ||||
|     }; | ||||
|  | ||||
|     private ElementReference form; | ||||
|     private bool validated = false; | ||||
|     // private ElementReference form; | ||||
|     // private bool validated = false; | ||||
|  | ||||
|     private int _id; | ||||
|     private string _name; | ||||
|     private string _createdby; | ||||
|     private DateTime _createdon; | ||||
|     private string _modifiedby; | ||||
|     private DateTime _modifiedon; | ||||
|     private string _description; | ||||
|     private DateTime _eventDate; | ||||
|     private string _location; | ||||
|  | ||||
|     private Response _response; | ||||
|     private bool? Status; | ||||
| @ -103,10 +111,9 @@ | ||||
|             if (currentEvent != null) | ||||
|             { | ||||
|                 _name = currentEvent.Name; | ||||
|                 _createdby = currentEvent.CreatedBy; | ||||
|                 _createdon = currentEvent.CreatedOn; | ||||
|                 _modifiedby = currentEvent.ModifiedBy; | ||||
|                 _modifiedon = currentEvent.ModifiedOn; | ||||
|                 _description = currentEvent.Description; | ||||
|                 _eventDate = currentEvent.EventDate; | ||||
|                 _location = currentEvent.Location; | ||||
|             } | ||||
|  | ||||
|             if(rsvp != null) | ||||
| @ -121,41 +128,4 @@ | ||||
|             AddModuleMessage(Localizer["Message.LoadError"], MessageType.Error); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private async Task Save() | ||||
|     { | ||||
|         try | ||||
|         { | ||||
|             validated = true; | ||||
|             var interop = new Oqtane.UI.Interop(JSRuntime); | ||||
|             if (await interop.FormValid(form)) | ||||
|             { | ||||
|                 if (PageState.Action == "Add") | ||||
|                 { | ||||
|                     Event EventRegistration = new Event(); | ||||
|                     EventRegistration.ModuleId = ModuleState.ModuleId; | ||||
|                     EventRegistration.Name = _name; | ||||
|                     EventRegistration = await EventRegistrationService.AddEventAsync(EventRegistration); | ||||
|                     await logger.LogInformation("EventRegistration Added {EventRegistration}", EventRegistration); | ||||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     Event EventRegistration = await EventRegistrationService.GetEventAsync(_id, ModuleState.ModuleId); | ||||
|                     EventRegistration.Name = _name; | ||||
|                     await EventRegistrationService.UpdateEventAsync(EventRegistration); | ||||
|                     await logger.LogInformation("EventRegistration Updated {EventRegistration}", EventRegistration); | ||||
|                 } | ||||
|                 NavigationManager.NavigateTo(NavigateUrl()); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 AddModuleMessage(Localizer["Message.SaveValidation"], MessageType.Warning); | ||||
|             } | ||||
|         } | ||||
|         catch (Exception ex) | ||||
|         { | ||||
|             await logger.LogError(ex, "Error Saving EventRegistration {Error}", ex.Message); | ||||
|             AddModuleMessage(Localizer["Message.SaveError"], MessageType.Error); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -1,6 +1,7 @@ | ||||
| @using Oqtane.Modules.Controls | ||||
| @using SZUAbsolventenverein.Module.EventRegistration.Services | ||||
| @using SZUAbsolventenverein.Module.EventRegistration.Models | ||||
| @using Microsoft.AspNetCore.Components.Forms | ||||
|  | ||||
| @namespace SZUAbsolventenverein.Module.EventRegistration | ||||
| @inherits ModuleBase | ||||
| @ -16,13 +17,30 @@ | ||||
|                 <input id="name" class="form-control" @bind="@_name" required /> | ||||
|             </div> | ||||
|         </div> | ||||
|         <div class="row mb-1 align-items-center"> | ||||
|             <Label Class="col-sm-3" For="location" HelpText="Enter a Location" ResourceKey="Location">Location: </Label> | ||||
|             <div class="col-sm-9"> | ||||
|                 <input id="location" class="form-control" @bind="@_location" required /> | ||||
|             </div> | ||||
|         </div> | ||||
|         <div class="row mb-1 align-items-center"> | ||||
|             <Label Class="col-sm-3" For="eventdate" HelpText="Enter a Date" ResourceKey="EventDate">EventDate: </Label> | ||||
|             <div class="col-sm-9"> | ||||
|                 <!--<input id="eventdate" class="form-control" @bind="@_eventDate" required />--> | ||||
|                 <InputDate id="eventdate" class="form-control" @bind-Value="@_eventDate" Type="InputDateType.DateTimeLocal" /> | ||||
|             </div> | ||||
|         </div> | ||||
|         <div class="mb-1 align-items-center"> | ||||
|             <Label Class="" For="description" HelpText="Enter a description" ResourceKey="Description">Description: </Label> | ||||
|             <RichTextEditor @ref="@RichTextEditorHtml" Content="@_description" Placeholder="Enter a description"/> | ||||
|         </div> | ||||
|     </div> | ||||
|     <button type="button" class="btn btn-success" @onclick="Save">@Localizer["Save"]</button> | ||||
|     <NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink> | ||||
|     <br /><br /> | ||||
|     @if (PageState.Action == "Edit") | ||||
|     { | ||||
|     <AuditInfo CreatedBy="@_createdby" CreatedOn="@_createdon" ModifiedBy="@_modifiedby" ModifiedOn="@_modifiedon"></AuditInfo> | ||||
|         <AuditInfo CreatedBy="@_createdby" CreatedOn="@_createdon" ModifiedBy="@_modifiedby" ModifiedOn="@_modifiedon"></AuditInfo> | ||||
|     } | ||||
| </form> | ||||
|  | ||||
| @ -38,11 +56,17 @@ | ||||
|         new Resource { ResourceType = ResourceType.Stylesheet, Url = ModulePath() + "Module.css" } | ||||
|     }; | ||||
|  | ||||
|      | ||||
|     private RichTextEditor RichTextEditorHtml; | ||||
|     private ElementReference form; | ||||
|     private bool validated = false; | ||||
|  | ||||
|     private int _id; | ||||
|     private string _name; | ||||
|     private string _description; | ||||
|     private DateTime _eventDate = DateTime.Now; | ||||
|     private string _location; | ||||
|  | ||||
|     private string _createdby; | ||||
|     private DateTime _createdon; | ||||
|     private string _modifiedby; | ||||
| @ -59,6 +83,10 @@ | ||||
|                 if (EventRegistration != null) | ||||
|                 { | ||||
|                     _name = EventRegistration.Name; | ||||
|                     _description = EventRegistration.Description; | ||||
|                     _eventDate = EventRegistration.EventDate.ToLocalTime(); | ||||
|                     _location = EventRegistration.Location; | ||||
|  | ||||
|                     _createdby = EventRegistration.CreatedBy; | ||||
|                     _createdon = EventRegistration.CreatedOn; | ||||
|                     _modifiedby = EventRegistration.ModifiedBy; | ||||
| @ -79,6 +107,10 @@ | ||||
|         { | ||||
|             validated = true; | ||||
|             var interop = new Oqtane.UI.Interop(JSRuntime); | ||||
|  | ||||
|             string content = await RichTextEditorHtml.GetHtml(); | ||||
| 		    content = Utilities.FormatContent(content, PageState.Alias, "save"); | ||||
|  | ||||
|             if (await interop.FormValid(form)) | ||||
|             { | ||||
|                 if (PageState.Action == "Add") | ||||
| @ -86,6 +118,9 @@ | ||||
|                     Event EventRegistration = new Event(); | ||||
|                     EventRegistration.ModuleId = ModuleState.ModuleId; | ||||
|                     EventRegistration.Name = _name; | ||||
|                     EventRegistration.Description = content; | ||||
|                     EventRegistration.EventDate = _eventDate.ToUniversalTime(); | ||||
|                     EventRegistration.Location = _location; | ||||
|                     EventRegistration = await EventRegistrationService.AddEventAsync(EventRegistration); | ||||
|                     await logger.LogInformation("EventRegistration Added {EventRegistration}", EventRegistration); | ||||
|                 } | ||||
| @ -93,6 +128,9 @@ | ||||
|                 { | ||||
|                     Event EventRegistration = await EventRegistrationService.GetEventAsync(_id, ModuleState.ModuleId); | ||||
|                     EventRegistration.Name = _name; | ||||
|                     EventRegistration.Description = content; | ||||
|                     EventRegistration.EventDate = _eventDate.ToUniversalTime(); | ||||
|                     EventRegistration.Location = _location; | ||||
|                     await EventRegistrationService.UpdateEventAsync(EventRegistration); | ||||
|                     await logger.LogInformation("EventRegistration Updated {EventRegistration}", EventRegistration); | ||||
|                 } | ||||
|  | ||||
| @ -16,24 +16,38 @@ else | ||||
|     <ActionLink Action="Add" Security="SecurityAccessLevel.Edit" Text="Add Event" ResourceKey="Add" /> | ||||
|     <br /> | ||||
|     <br /> | ||||
|     <p>@Status</p> | ||||
|     @if (@_EventRegistrations.Count != 0) | ||||
|     { | ||||
|         <Pager Items="@_EventRegistrations"> | ||||
|             <Header> | ||||
|                 <th style="width: 1px;"> </th> | ||||
|                 <th style="width: 1px;"> </th> | ||||
|                 <th>@Localizer["Name"]</th> | ||||
|                 <th style="width: 1px;"> </th> | ||||
|             </Header> | ||||
|             <Row> | ||||
|                 <td><ActionLink Action="Edit" Parameters="@($"id=" + context.EventId.ToString())" ResourceKey="Edit"  /></td> | ||||
|                 <td><ActionDialog Header="Delete EventRegistration" Message="Are You Sure You Wish To Delete This EventRegistration?" Action="Delete" Security="SecurityAccessLevel.Edit" Class="btn btn-danger" OnClick="@(async () => await Delete(context))" ResourceKey="Delete"  Id="@context.EventId.ToString()" /></td> | ||||
|                 <td>@context.Name</td> | ||||
|  | ||||
|                 <td><ActionLink Action="Details" Parameters="@($"id=" + context.EventId.ToString())"  ResourceKey="Details"/></td> | ||||
|             </Row> | ||||
|         </Pager> | ||||
|         <div class="event-list"> | ||||
|             <div class="event-list"> | ||||
|                 @foreach (var context in _EventRegistrations) | ||||
|                 { | ||||
|                     <div class="event-card"> | ||||
|                         <h3>@context.Name</h3> | ||||
|                         <p><strong>@Localizer["Date"]:</strong> @context.EventDate.ToLocalTime()</p> | ||||
|                         <p><strong>@Localizer["Location"]:</strong> @context.Location</p> | ||||
|  | ||||
|                         <div class="event-actions"> | ||||
|                             <ActionLink Action="Edit" | ||||
|                                         Parameters="@($"id={context.EventId}")" | ||||
|                                         ResourceKey="Edit" /> | ||||
|  | ||||
|                             <ActionDialog Action="Delete" | ||||
|                                           Security="SecurityAccessLevel.Edit" | ||||
|                                           Class="btn btn-danger" | ||||
|                                           OnClick="@(async () => await Delete(context))" | ||||
|                                           ResourceKey="Delete" | ||||
|                                           Id="@context.EventId.ToString()" /> | ||||
|  | ||||
|                             <ActionLink Action="Details" | ||||
|                                         Parameters="@($"id={context.EventId}")" | ||||
|                                         ResourceKey="Details" /> | ||||
|                         </div> | ||||
|                     </div> | ||||
|                 } | ||||
|             </div> | ||||
|         </div> | ||||
|     } | ||||
|     else | ||||
|     { | ||||
| @ -42,8 +56,6 @@ else | ||||
| } | ||||
|  | ||||
| @code { | ||||
|     private string Status; | ||||
|  | ||||
|     public override List<Resource> Resources => new List<Resource>() | ||||
|     { | ||||
|         new Resource { ResourceType = ResourceType.Stylesheet, Url = ModulePath() + "Module.css" }, | ||||
| @ -80,15 +92,4 @@ else | ||||
|             AddModuleMessage(Localizer["Message.DeleteError"], MessageType.Error); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private async Task Accept(Event eventRegistration) | ||||
|     { | ||||
|         Status = ("EventRegistration Accepted " + eventRegistration.Name); | ||||
|         await logger.LogInformation("EventRegistration Accepted {EventRegistration}", eventRegistration); | ||||
|     } | ||||
|  | ||||
|     private void Reject() | ||||
|     { | ||||
|         Status = "EventRegistration Rejected 1"; | ||||
|     } | ||||
| } | ||||
| @ -9,9 +9,9 @@ namespace SZUAbsolventenverein.Module.EventRegistration | ||||
|         { | ||||
|             Name = "EventRegistration", | ||||
|             Description = "A module to manage registration for events", | ||||
|             Version = "1.0.0", | ||||
|             Version = "1.0.14", | ||||
|             ServerManagerType = "SZUAbsolventenverein.Module.EventRegistration.Manager.EventRegistrationManager, SZUAbsolventenverein.Module.EventRegistration.Server.Oqtane", | ||||
|             ReleaseVersions = "1.0.0", | ||||
|             ReleaseVersions = "1.0.0,1.0.1,1.0.2,1.0.3,1.0.4,1.0.5,1.0.6,1.0.7,1.0.8,1.0.9,1.0.10,1.0.11,1.0.12,1.0.13,1.0.14", | ||||
|             Dependencies = "SZUAbsolventenverein.Module.EventRegistration.Shared.Oqtane", | ||||
|             PackageName = "SZUAbsolventenverein.Module.EventRegistration"  | ||||
|         }; | ||||
|  | ||||
| @ -127,10 +127,10 @@ | ||||
|     <value>Delete</value> | ||||
|   </data> | ||||
|   <data name="Delete.Header" xml:space="preserve"> | ||||
|     <value>Delete Event</value> | ||||
|     <value>Delete</value> | ||||
|   </data> | ||||
|   <data name="Delete.Message" xml:space="preserve"> | ||||
|     <value>Are You Sure You Wish To Delete This Event?</value> | ||||
|     <value>Are You Sure You Wish To Delete This Event? If you delete an event, all existing registrations will be deleted as well.</value> | ||||
|   </data> | ||||
|   <data name="Message.DisplayNone" xml:space="preserve"> | ||||
|     <value>No Events To Display</value> | ||||
| @ -142,6 +142,15 @@ | ||||
|     <value>Error Deleting Event</value> | ||||
|   </data> | ||||
|   <data name="Details.Text" xml:space="preserve"> | ||||
|     <value>Reject</value> | ||||
|     <value>Details</value> | ||||
|   </data> | ||||
|   <data name="Name" xml:space="preserve"> | ||||
|     <value>Name</value> | ||||
|   </data> | ||||
|   <data name="Date" xml:space="preserve"> | ||||
|     <value>Date</value> | ||||
|   </data> | ||||
|   <data name="Location" xml:space="preserve"> | ||||
|     <value>Location</value> | ||||
|   </data> | ||||
| </root> | ||||
| @ -13,11 +13,11 @@ | ||||
|   </PropertyGroup> | ||||
|  | ||||
|   <ItemGroup> | ||||
|     <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.3" /> | ||||
|     <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="9.0.3" /> | ||||
|     <PackageReference Include="Microsoft.Extensions.Localization" Version="9.0.3" /> | ||||
|     <PackageReference Include="Microsoft.Extensions.Http" Version="9.0.3" /> | ||||
|     <PackageReference Include="System.Net.Http.Json" Version="9.0.3" /> | ||||
|     <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.8" /> | ||||
|     <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="9.0.8" /> | ||||
|     <PackageReference Include="Microsoft.Extensions.Localization" Version="9.0.8" /> | ||||
|     <PackageReference Include="Microsoft.Extensions.Http" Version="9.0.8" /> | ||||
|     <PackageReference Include="System.Net.Http.Json" Version="9.0.8" /> | ||||
|   </ItemGroup> | ||||
|  | ||||
|   <ItemGroup> | ||||
|  | ||||
| @ -1,5 +1,6 @@ | ||||
| using Microsoft.Extensions.DependencyInjection; | ||||
| using Oqtane.Services; | ||||
| using System.Linq; | ||||
| using SZUAbsolventenverein.Module.EventRegistration.Services; | ||||
|  | ||||
| namespace SZUAbsolventenverein.Module.EventRegistration.Startup | ||||
| @ -8,7 +9,10 @@ namespace SZUAbsolventenverein.Module.EventRegistration.Startup | ||||
|     { | ||||
|         public void ConfigureServices(IServiceCollection services) | ||||
|         { | ||||
|             services.AddScoped<IEventRegistrationService, EventRegistrationService>(); | ||||
|             if (!services.Any(s => s.ServiceType == typeof(IEventRegistrationService))) | ||||
|             { | ||||
|                 services.AddScoped<IEventRegistrationService, EventRegistrationService>(); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -2,7 +2,7 @@ | ||||
| <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> | ||||
|     <metadata> | ||||
|         <id>$projectname$</id> | ||||
|         <version>1.0.0</version> | ||||
|         <version>1.0.14</version> | ||||
|         <authors>SZUAbsolventenverein</authors> | ||||
|         <owners>SZUAbsolventenverein</owners> | ||||
|         <title>EventRegistration</title> | ||||
| @ -16,7 +16,7 @@ | ||||
|         <releaseNotes></releaseNotes> | ||||
|         <summary></summary> | ||||
|         <dependencies> | ||||
|             <dependency id="Oqtane.Framework" version="6.1.1" /> | ||||
|             <dependency id="Oqtane.Framework" version="6.2.0" /> | ||||
|         </dependencies> | ||||
|     </metadata> | ||||
|     <files> | ||||
|  | ||||
| @ -40,10 +40,19 @@ namespace SZUAbsolventenverein.Module.EventRegistration.Manager | ||||
|         { | ||||
|             // TODO: Export event Responses as well. | ||||
|             string content = ""; | ||||
|             List<Models.Event> EventRegistrations = _EventRepository.GetEvents(module.ModuleId).ToList(); | ||||
|             if (EventRegistrations != null) | ||||
|             List<object> exportData = new List<object>(); | ||||
|             foreach (var events in _EventRepository.GetEvents(module.ModuleId)) | ||||
|             { | ||||
|                 content = JsonSerializer.Serialize(EventRegistrations); | ||||
|                 var responses = _ResponseRepository.GetResponses(events.EventId, module.ModuleId); | ||||
|                 exportData.Add(new | ||||
|                 { | ||||
|                     Event = events, | ||||
|                     Responses = responses.ToList() | ||||
|                 }); | ||||
|             }; | ||||
|             if (exportData != null) | ||||
|             { | ||||
|                 content = JsonSerializer.Serialize(exportData); | ||||
|             } | ||||
|             return content; | ||||
|         } | ||||
|  | ||||
| @ -26,10 +26,10 @@ namespace SZUAbsolventenverein.Module.EventRegistration.Migrations | ||||
|  | ||||
|         protected override void Down(MigrationBuilder migrationBuilder) | ||||
|         { | ||||
|             var entityBuilder = new EventEntityBuilder(migrationBuilder, ActiveDatabase); | ||||
|             entityBuilder.Drop(); | ||||
|             var entityBuilder2 = new EventResponseEntityBuilder(migrationBuilder, ActiveDatabase); | ||||
|             entityBuilder2.Drop(); | ||||
|             var responseEB = new EventResponseEntityBuilder(migrationBuilder, ActiveDatabase); | ||||
|             responseEB.Drop(); | ||||
|             var eventEB = new EventEntityBuilder(migrationBuilder, ActiveDatabase); | ||||
|             eventEB.Drop(); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
							
								
								
									
										35
									
								
								Server/Migrations/01000005_AddDescriptionDateTimeLocation.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								Server/Migrations/01000005_AddDescriptionDateTimeLocation.cs
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,35 @@ | ||||
| using Microsoft.EntityFrameworkCore.Infrastructure; | ||||
| using Microsoft.EntityFrameworkCore.Migrations; | ||||
| using Oqtane.Databases.Interfaces; | ||||
| using Oqtane.Migrations; | ||||
| using System; | ||||
| using SZUAbsolventenverein.Module.EventRegistration.Migrations.EntityBuilders; | ||||
| using SZUAbsolventenverein.Module.EventRegistration.Repository; | ||||
|  | ||||
| namespace SZUAbsolventenverein.Module.EventRegistration.Migrations | ||||
| { | ||||
|     [DbContext(typeof(EventRegistrationContext))] | ||||
|     [Migration("SZUAbsolventenverein.Module.EventRegistration.01.00.00.05")] | ||||
|     public class AddDescriptionDateTimeLocation : MultiDatabaseMigration | ||||
|     { | ||||
|         public AddDescriptionDateTimeLocation(IDatabase database) : base(database) | ||||
|         { | ||||
|         } | ||||
|  | ||||
|         protected override void Up(MigrationBuilder migrationBuilder) | ||||
|         { | ||||
|             var entityBuilder = new EventEntityBuilder(migrationBuilder, ActiveDatabase); | ||||
|             entityBuilder.AddMaxStringColumn("Description", false, true, ""); // Contents for RichTextEditor | ||||
|             entityBuilder.AddDateTimeColumn("EventDate", false, new DateTime()); // DateTime for the event | ||||
|             entityBuilder.AddStringColumn("Location", 100, false, true, ""); // Location of the event | ||||
|         } | ||||
|  | ||||
|         protected override void Down(MigrationBuilder migrationBuilder) | ||||
|         { | ||||
|             var entityBuilder = new EventEntityBuilder(migrationBuilder, ActiveDatabase); | ||||
|             entityBuilder.DropColumn("Description"); // RichTextEditor | ||||
|             entityBuilder.DropColumn("EventDate"); // DateTime | ||||
|             entityBuilder.DropColumn("Location"); // Location 0 | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -19,10 +19,10 @@ | ||||
|   </ItemGroup> | ||||
|  | ||||
|   <ItemGroup> | ||||
|     <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="9.0.3" /> | ||||
|     <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.3" /> | ||||
|     <PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.3" /> | ||||
|     <PackageReference Include="Microsoft.Extensions.Localization" Version="9.0.3" /> | ||||
|     <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="9.0.8" /> | ||||
|     <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.8" /> | ||||
|     <PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.8" /> | ||||
|     <PackageReference Include="Microsoft.Extensions.Localization" Version="9.0.8" /> | ||||
|   </ItemGroup> | ||||
|  | ||||
|   <ItemGroup> | ||||
|  | ||||
| @ -6,6 +6,7 @@ using Oqtane.Enums; | ||||
| using Oqtane.Extensions; | ||||
| using Oqtane.Infrastructure; | ||||
| using Oqtane.Models; | ||||
| using Oqtane.Repository; | ||||
| using Oqtane.Security; | ||||
| using Oqtane.Shared; | ||||
| using SZUAbsolventenverein.Module.EventRegistration.Models; | ||||
| @ -17,15 +18,19 @@ namespace SZUAbsolventenverein.Module.EventRegistration.Services | ||||
|     { | ||||
|         private readonly IEventRepository _EventRepository; | ||||
|         private readonly IResponseRepository _ResponseRepository; | ||||
|         private readonly INotificationRepository _NotificationRepository; | ||||
|         private readonly IUserRepository _UserRepository; | ||||
|         private readonly IUserPermissions _userPermissions; | ||||
|         private readonly ILogManager _logger; | ||||
|         private readonly IHttpContextAccessor _accessor; | ||||
|         private readonly Alias _alias; | ||||
|  | ||||
|         public ServerEventRegistrationService(IEventRepository EventRepository, IResponseRepository ResponseRepository, IUserPermissions userPermissions, ITenantManager tenantManager, ILogManager logger, IHttpContextAccessor accessor) | ||||
|         public ServerEventRegistrationService(IEventRepository EventRepository, IResponseRepository ResponseRepository, INotificationRepository NotificationRepository, IUserRepository UserRepository, IUserPermissions userPermissions, ITenantManager tenantManager, ILogManager logger, IHttpContextAccessor accessor) | ||||
|         { | ||||
|             _EventRepository = EventRepository; | ||||
|             _ResponseRepository = ResponseRepository; | ||||
|             _NotificationRepository = NotificationRepository; | ||||
|             _UserRepository = UserRepository; | ||||
|             _userPermissions = userPermissions; | ||||
|             _logger = logger; | ||||
|             _accessor = accessor; | ||||
| @ -52,6 +57,12 @@ namespace SZUAbsolventenverein.Module.EventRegistration.Services | ||||
|             if (_userPermissions.IsAuthorized(_accessor.HttpContext.User, _alias.SiteId, EntityNames.Module, Response.ModuleId, PermissionNames.View)) | ||||
|             { | ||||
|                 Response = _ResponseRepository.AddResponse(Response); | ||||
|  | ||||
|                 Event currentEvent = _EventRepository.GetEvent(Response.EventRegistrationId); | ||||
|                 string subject = Response.ResponseType ? $"Du bist erfolgreich für '{currentEvent.Name}' Registriert worden." : $"Du hast erfolgreich für '{currentEvent.Name}' abgesagt."; | ||||
|                 string body = "Hier kann man die Infos des Events hineinpacken (HTML ist erlaubt)"; | ||||
|                 SendEventResponseNotification(subject, body); | ||||
|  | ||||
|                 _logger.Log(LogLevel.Information, this, LogFunction.Create, "EventRegistration Added {NewEvent}", Response); | ||||
|             } | ||||
|             else | ||||
| @ -68,6 +79,12 @@ namespace SZUAbsolventenverein.Module.EventRegistration.Services | ||||
|             if (_userPermissions.IsAuthorized(_accessor.HttpContext.User, _alias.SiteId, EntityNames.Module, Response.ModuleId, PermissionNames.View)) | ||||
|             { | ||||
|                 Response = _ResponseRepository.UpdateResponse(Response); | ||||
|  | ||||
|                 Event currentEvent = _EventRepository.GetEvent(Response.EventRegistrationId); | ||||
|                 string subject = Response.ResponseType ? $"Du bist erfolgreich für '{currentEvent.Name}' Registriert worden." : $"Du hast erfolgreich für '{currentEvent.Name}' abgesagt."; | ||||
|                 string body = "Hier kann man die Infos des Events hineinpacken (HTML ist erlaubt)"; | ||||
|                 SendEventResponseNotification(subject, body); | ||||
|                  | ||||
|                 _logger.Log(LogLevel.Information, this, LogFunction.Create, "EventRegistration Added {NewEvent}", Response); | ||||
|             } | ||||
|             else | ||||
| @ -211,7 +228,11 @@ namespace SZUAbsolventenverein.Module.EventRegistration.Services | ||||
|  | ||||
|         }*/ | ||||
|  | ||||
|  | ||||
|  | ||||
|         private void SendEventResponseNotification(string subject, string body) | ||||
|         { | ||||
|             User user = _UserRepository.GetUser(_accessor.HttpContext.User.UserId()); | ||||
|             Notification notification = new Notification(_alias.SiteId, user, subject, body); | ||||
|             _NotificationRepository.AddNotification(notification); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -1 +1,46 @@ | ||||
| /* Module Custom Styles */ | ||||
| /* Module Custom Styles */ | ||||
| .mb-6 { | ||||
|     margin-bottom: 6rem; | ||||
| } | ||||
|  | ||||
| .mt-3 { | ||||
|     margin-top: 3rem; | ||||
| } | ||||
| .event-list { | ||||
|     display: flex; | ||||
|     flex-wrap: wrap; | ||||
|     gap: 1.5rem; | ||||
|     justify-content: center; | ||||
| } | ||||
|  | ||||
| .event-card { | ||||
|     /*background-color: var(--bs-gray-dark); */ | ||||
|     border: 2px solid rgb(var(--bs-primary-rgb)); /* Umrandung */ | ||||
|     border-radius: 12px; | ||||
|     box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); | ||||
|     padding: 1.5rem; | ||||
|     width: 280px; | ||||
|    /* color: #ddd; */ | ||||
|     transition: all 0.3s ease; | ||||
| } | ||||
|  | ||||
|     .event-card:hover { | ||||
|         border-color: #66ccff; /* Heller beim Hover */ | ||||
|         transform: translateY(-4px); | ||||
|         box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5); | ||||
|     } | ||||
|  | ||||
|     .event-card h3 { | ||||
|         margin-top: 0; | ||||
|         margin-bottom: 0.5rem; | ||||
|     } | ||||
|  | ||||
|     .event-card p { | ||||
|         margin: 0.2rem 0; | ||||
|     } | ||||
|  | ||||
| .event-actions { | ||||
|     margin-top: 1rem; | ||||
|     display: flex; | ||||
|     justify-content: space-between; | ||||
| } | ||||
| @ -13,6 +13,10 @@ namespace SZUAbsolventenverein.Module.EventRegistration.Models | ||||
|         public int ModuleId { get; set; } | ||||
|         public string Name { get; set; } | ||||
|  | ||||
|         public string Description { get; set; } | ||||
|         public DateTime EventDate { get; set; } | ||||
|         public string Location { get; set; } | ||||
|  | ||||
|         public string CreatedBy { get; set; } | ||||
|         public DateTime CreatedOn { get; set; } | ||||
|         public string ModifiedBy { get; set; } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	