Compare commits
16 Commits
fad59d9311
...
net10.0-sl
| Author | SHA1 | Date | |
|---|---|---|---|
| 0a3890e411 | |||
| e22d360425 | |||
| 1c32640c78 | |||
| cb1c94f43c | |||
| bbcc755b82 | |||
| 9b1ea5ada1 | |||
| 9eca4dd779 | |||
| ce68c5eb1d | |||
| 1359aee2b1 | |||
| 7929f0bed6 | |||
| f86287783c | |||
| 669cc79678 | |||
| 7694fc1e08 | |||
| 835795f526 | |||
| e12e4c5325 | |||
| 2ed210e20f |
@@ -1,38 +1,41 @@
|
||||
@using Oqtane.Modules.Controls
|
||||
@using Oqtane
|
||||
@using Oqtane.Modules.Controls
|
||||
@using Oqtane.Themes.Controls
|
||||
@using SZUAbsolventenverein.Module.EventRegistration.Services
|
||||
@using SZUAbsolventenverein.Module.EventRegistration.Models
|
||||
@using System.Text.RegularExpressions
|
||||
|
||||
@namespace SZUAbsolventenverein.Module.EventRegistration
|
||||
@inherits ModuleBase
|
||||
@inject IEventRegistrationService EventRegistrationService
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IStringLocalizer<Edit> Localizer
|
||||
@inject IStringLocalizer<SharedResources> SharedLocalizer
|
||||
@inject IUserService UserService
|
||||
@inject IProfileService ProfileService
|
||||
@inject ISettingService SettingService
|
||||
|
||||
<h3>Anmeldung zum Event</h3>
|
||||
|
||||
<p>Willst du am Event (@_name) teilnehmen?</p>
|
||||
<span class="mb-6">@_eventDate.ToLocalTime() - @_location</span>
|
||||
<div>
|
||||
@((MarkupString)_description)
|
||||
@((MarkupString) _description)
|
||||
</div>
|
||||
|
||||
@if (PageState.User != null) {
|
||||
|
||||
|
||||
@if (Status != null)
|
||||
{
|
||||
<p class="mt-2"><strong>Status: </strong>
|
||||
@if (Status == true)
|
||||
{
|
||||
<span class ="fontsizeInf">@Localizer["Zugesagt"]</span>
|
||||
|
||||
<br />
|
||||
<button class="btn btn-danger" @onclick="Absage">@Localizer["Absagen"]</button>
|
||||
<span class ="fontsizeInf">@Localizer["Zugesagt"]</span><br />
|
||||
<p><button class="btn btn-danger" @onclick="Absage">@Localizer["Absagen"]</button></p>
|
||||
} else
|
||||
{
|
||||
<span class="fontsizeInf"> @Localizer["Abgesagt"]</span>
|
||||
|
||||
<br class="mt-2" />
|
||||
<button class="btn btn-success" @onclick="Zusage">@Localizer["Zusagen"]</button>
|
||||
<span class="fontsizeInf"> @Localizer["Abgesagt"]</span><br />
|
||||
<p><button class="btn btn-success" @onclick="Zusage">@Localizer["Zusagen"]</button></p>
|
||||
}
|
||||
</p>
|
||||
} else {
|
||||
@@ -44,11 +47,10 @@
|
||||
} else
|
||||
{
|
||||
<p class="mt-3">Um dich für dieses Event zu registrieren, muss man sich zuerst anmelden.</p>
|
||||
<Login />
|
||||
@* @if(PageState.Site.AllowRegistration)
|
||||
{
|
||||
<Register />
|
||||
} *@
|
||||
<div class="gap-2">
|
||||
<Login />
|
||||
<UserProfile ShowRegister="true" />
|
||||
</div>
|
||||
}
|
||||
|
||||
@code {
|
||||
@@ -75,22 +77,34 @@
|
||||
private Response _response;
|
||||
private bool? Status;
|
||||
|
||||
private List<Profile> _profiles = new List<Profile>();
|
||||
private Dictionary<string, string> _settings;
|
||||
|
||||
private async Task SendResponse(bool response)
|
||||
{
|
||||
if(_response == null)
|
||||
{
|
||||
_response = new Response();
|
||||
_response.EventRegistrationId = _id;
|
||||
_response.OwnerId = PageState.User.UserId;
|
||||
_response.ModuleId = ModuleState.ModuleId;
|
||||
_response.ResponseType = response;
|
||||
_response = await EventRegistrationService.AddResponseAsync(_response);
|
||||
if(ValidateProfiles()) {
|
||||
if(_response == null)
|
||||
{
|
||||
_response = new Response();
|
||||
_response.EventRegistrationId = _id;
|
||||
_response.OwnerId = PageState.User.UserId;
|
||||
_response.ModuleId = ModuleState.ModuleId;
|
||||
_response.ResponseType = response;
|
||||
_response = await EventRegistrationService.AddResponseAsync(_response);
|
||||
} else
|
||||
{
|
||||
_response.ResponseType = response;
|
||||
_response = await EventRegistrationService.UpdateResponseAsync(_response);
|
||||
}
|
||||
if(_response != null) Status = _response.ResponseType;
|
||||
} else
|
||||
{
|
||||
_response.ResponseType = response;
|
||||
_response = await EventRegistrationService.UpdateResponseAsync(_response);
|
||||
var currentPathAndQuery = new Uri(NavigationManager.Uri).PathAndQuery;
|
||||
var encodedReturnUrl = Uri.EscapeDataString(currentPathAndQuery);
|
||||
var link = $"/profile?tab=Profile&returnurl={encodedReturnUrl}";
|
||||
|
||||
AddModuleMessage(string.Format(SharedLocalizer["ProfileRequired"], $"Vervollständige hier dein Profil mit deinem Jahrgang und deiner Fachrichtung: <a href=\"{link}\">Link zum Profil</a>"), MessageType.Warning);
|
||||
}
|
||||
if(_response != null) Status = _response.ResponseType;
|
||||
}
|
||||
|
||||
private async void Zusage()
|
||||
@@ -107,6 +121,15 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
if(PageState.User != null) {
|
||||
_profiles = await ProfileService.GetProfilesAsync(PageState.Site.SiteId);
|
||||
var user = await UserService.GetUserAsync(PageState.User.UserId, PageState.Site.SiteId);
|
||||
if (user != null)
|
||||
{
|
||||
_settings = user.Settings;
|
||||
}
|
||||
}
|
||||
|
||||
_id = Int32.Parse(PageState.QueryString["id"]);
|
||||
|
||||
Event currentEvent;
|
||||
@@ -132,4 +155,46 @@
|
||||
AddModuleMessage(Localizer["Message.LoadError"], MessageType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private bool ValidateProfiles()
|
||||
{
|
||||
foreach (Profile profile in _profiles)
|
||||
{
|
||||
var value = GetProfileValue(profile.Name, string.Empty);
|
||||
if (string.IsNullOrEmpty(value) && !string.IsNullOrEmpty(profile.DefaultValue))
|
||||
{
|
||||
_settings = SettingService.SetSetting(_settings, profile.Name, profile.DefaultValue);
|
||||
}
|
||||
if (!profile.IsPrivate || UserSecurity.IsAuthorized(PageState.User, RoleNames.Admin))
|
||||
{
|
||||
if (profile.IsRequired && string.IsNullOrEmpty(value))
|
||||
{
|
||||
AddModuleMessage(string.Format(SharedLocalizer["ProfileRequired"], profile.Title), MessageType.Warning);
|
||||
return false;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(profile.Validation))
|
||||
{
|
||||
Regex regex = new Regex(profile.Validation);
|
||||
bool valid = regex.Match(value).Success;
|
||||
if (!valid)
|
||||
{
|
||||
AddModuleMessage(string.Format(SharedLocalizer["ProfileInvalid"], profile.Title), MessageType.Warning);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private string GetProfileValue(string SettingName, string DefaultValue)
|
||||
{
|
||||
string value = SettingService.GetSetting(_settings, SettingName, DefaultValue);
|
||||
if (value.Contains("]"))
|
||||
{
|
||||
value = value.Substring(value.IndexOf("]") + 1);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,9 +9,9 @@ namespace SZUAbsolventenverein.Module.EventRegistration
|
||||
{
|
||||
Name = "EventRegistration",
|
||||
Description = "A module to manage registration for events",
|
||||
Version = "1.0.14",
|
||||
Version = "1.0.17",
|
||||
ServerManagerType = "SZUAbsolventenverein.Module.EventRegistration.Manager.EventRegistrationManager, SZUAbsolventenverein.Module.EventRegistration.Server.Oqtane",
|
||||
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",
|
||||
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,1.0.15,1.0.16,1.0.17",
|
||||
Dependencies = "SZUAbsolventenverein.Module.EventRegistration.Shared.Oqtane",
|
||||
PackageName = "SZUAbsolventenverein.Module.EventRegistration"
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<Version>1.0.0</Version>
|
||||
<Authors>SZUAbsolventenverein</Authors>
|
||||
<Company>SZUAbsolventenverein</Company>
|
||||
@@ -13,11 +13,11 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<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" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="10.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Localization" Version="10.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.1" />
|
||||
<PackageReference Include="System.Net.Http.Json" Version="10.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -25,8 +25,8 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Oqtane.Client"><HintPath>..\..\oqtane.framework\Oqtane.Server\bin\Debug\net9.0\Oqtane.Client.dll</HintPath></Reference>
|
||||
<Reference Include="Oqtane.Shared"><HintPath>..\..\oqtane.framework\Oqtane.Server\bin\Debug\net9.0\Oqtane.Shared.dll</HintPath></Reference>
|
||||
<Reference Include="Oqtane.Client"><HintPath>..\..\oqtane.framework\Oqtane.Server\bin\Debug\net10.0\Oqtane.Client.dll</HintPath></Reference>
|
||||
<Reference Include="Oqtane.Shared"><HintPath>..\..\oqtane.framework\Oqtane.Server\bin\Debug\net10.0\Oqtane.Shared.dll</HintPath></Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
|
||||
<AccelerateBuildsInVisualStudio>false</AccelerateBuildsInVisualStudio>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>$projectname$</id>
|
||||
<version>1.0.14</version>
|
||||
<version>1.0.17</version>
|
||||
<authors>SZUAbsolventenverein</authors>
|
||||
<owners>SZUAbsolventenverein</owners>
|
||||
<title>EventRegistration</title>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
TargetFramework=$1
|
||||
ProjectName=$2
|
||||
|
||||
"..\..\oqtane.framework\oqtane.package\nuget.exe" pack %ProjectName%.nuspec -Properties targetframework=%TargetFramework%;projectname=%ProjectName%
|
||||
cp -f "*.nupkg" "..\..\oqtane.framework\Oqtane.Server\Packages\"
|
||||
find . -name *.nupkg -delete
|
||||
dotnet run --project ../../fixProps/FixProps/FixProps.csproj
|
||||
dotnet pack $ProjectName.nuspec "/p:targetframework=${TargetFramework};ProjectName=${ProjectName}"
|
||||
cp -f *.nupkg ../../oqtane.framework/Oqtane.Server/Packages/
|
||||
@@ -1,46 +0,0 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.13.35828.75 d17.13
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oqtane.Server", "..\oqtane.framework\Oqtane.Server\Oqtane.Server.csproj", "{3AB6FCC9-EFEB-4C0E-A2CF-8103914C5196}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SZUAbsolventenverein.Module.EventRegistration.Client", "Client\SZUAbsolventenverein.Module.EventRegistration.Client.csproj", "{AA8E58A1-CD09-4208-BF66-A8BB341FD669}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SZUAbsolventenverein.Module.EventRegistration.Server", "Server\SZUAbsolventenverein.Module.EventRegistration.Server.csproj", "{04B05448-788F-433D-92C0-FED35122D45A}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SZUAbsolventenverein.Module.EventRegistration.Shared", "Shared\SZUAbsolventenverein.Module.EventRegistration.Shared.csproj", "{18D73F73-D7BE-4388-85BA-FBD9AC96FCA2}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SZUAbsolventenverein.Module.EventRegistration.Package", "Package\SZUAbsolventenverein.Module.EventRegistration.Package.csproj", "{C5CE512D-CBB7-4545-AF0F-9B6591A0C3A7}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{3AB6FCC9-EFEB-4C0E-A2CF-8103914C5196}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3AB6FCC9-EFEB-4C0E-A2CF-8103914C5196}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{AA8E58A1-CD09-4208-BF66-A8BB341FD669}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{AA8E58A1-CD09-4208-BF66-A8BB341FD669}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{AA8E58A1-CD09-4208-BF66-A8BB341FD669}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{AA8E58A1-CD09-4208-BF66-A8BB341FD669}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{04B05448-788F-433D-92C0-FED35122D45A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{04B05448-788F-433D-92C0-FED35122D45A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{04B05448-788F-433D-92C0-FED35122D45A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{04B05448-788F-433D-92C0-FED35122D45A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{18D73F73-D7BE-4388-85BA-FBD9AC96FCA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{18D73F73-D7BE-4388-85BA-FBD9AC96FCA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{18D73F73-D7BE-4388-85BA-FBD9AC96FCA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{18D73F73-D7BE-4388-85BA-FBD9AC96FCA2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C5CE512D-CBB7-4545-AF0F-9B6591A0C3A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C5CE512D-CBB7-4545-AF0F-9B6591A0C3A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C5CE512D-CBB7-4545-AF0F-9B6591A0C3A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C5CE512D-CBB7-4545-AF0F-9B6591A0C3A7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {1D016F15-46FE-4726-8DFD-2E4FD4DC7668}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
9
SZUAbsolventenverein.Module.EventRegistration.slnx
Normal file
9
SZUAbsolventenverein.Module.EventRegistration.slnx
Normal file
@@ -0,0 +1,9 @@
|
||||
<Solution>
|
||||
<Project Path="../oqtane.framework/Oqtane.Server/Oqtane.Server.csproj">
|
||||
<Build Project="false" />
|
||||
</Project>
|
||||
<Project Path="Client/SZUAbsolventenverein.Module.EventRegistration.Client.csproj" />
|
||||
<Project Path="Package/SZUAbsolventenverein.Module.EventRegistration.Package.csproj" />
|
||||
<Project Path="Server/SZUAbsolventenverein.Module.EventRegistration.Server.csproj" />
|
||||
<Project Path="Shared/SZUAbsolventenverein.Module.EventRegistration.Shared.csproj" />
|
||||
</Solution>
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
|
||||
<Version>1.0.0</Version>
|
||||
<Product>SZUAbsolventenverein.Module.EventRegistration</Product>
|
||||
@@ -19,10 +19,10 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<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" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="10.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="10.0.1" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Localization" Version="10.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -30,7 +30,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Oqtane.Server"><HintPath>..\..\oqtane.framework\Oqtane.Server\bin\Debug\net9.0\Oqtane.Server.dll</HintPath></Reference>
|
||||
<Reference Include="Oqtane.Shared"><HintPath>..\..\oqtane.framework\Oqtane.Server\bin\Debug\net9.0\Oqtane.Shared.dll</HintPath></Reference>
|
||||
<Reference Include="Oqtane.Server"><HintPath>..\..\oqtane.framework\Oqtane.Server\bin\Debug\net10.0\Oqtane.Server.dll</HintPath></Reference>
|
||||
<Reference Include="Oqtane.Shared"><HintPath>..\..\oqtane.framework\Oqtane.Server\bin\Debug\net10.0\Oqtane.Shared.dll</HintPath></Reference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
@media (hover: hover) and (pointer: fine) {
|
||||
.event-card:hover {
|
||||
border-color: #66ccff;
|
||||
transform: translateY(-4px);
|
||||
|
||||
box-shadow: 0 6px 14px rgba(0,0,0,.5);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<Version>1.0.0</Version>
|
||||
<Product>SZUAbsolventenverein.Module.EventRegistration</Product>
|
||||
<Authors>SZUAbsolventenverein</Authors>
|
||||
@@ -16,7 +16,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Oqtane.Shared"><HintPath>..\..\oqtane.framework\Oqtane.Server\bin\Debug\net9.0\Oqtane.Shared.dll</HintPath></Reference>
|
||||
<Reference Include="Oqtane.Shared"><HintPath>..\..\oqtane.framework\Oqtane.Server\bin\Debug\net10.0\Oqtane.Shared.dll</HintPath></Reference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user