Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
1c13c72a53 | |||
e5d955370a | |||
939b42a90d | |||
16cfe54fed |
@ -11,9 +11,9 @@
|
||||
<h3>Anmeldung zum Event</h3>
|
||||
|
||||
<p>Willst du am Event (@_name) teilnehmen?</p>
|
||||
<span>@_eventDate - @_location</span>
|
||||
<span class="mb-6">@_eventDate.ToLocalTime() - @_location</span>
|
||||
<div>
|
||||
<p>@_description</p>
|
||||
@((MarkupString)_description)
|
||||
</div>
|
||||
|
||||
@if (PageState.User != null) {
|
||||
@ -23,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>
|
||||
@ -63,11 +63,6 @@
|
||||
private DateTime _eventDate;
|
||||
private string _location;
|
||||
|
||||
private string _createdby;
|
||||
private DateTime _createdon;
|
||||
private string _modifiedby;
|
||||
private DateTime _modifiedon;
|
||||
|
||||
private Response _response;
|
||||
private bool? Status;
|
||||
|
||||
@ -112,12 +107,8 @@
|
||||
{
|
||||
_name = currentEvent.Name;
|
||||
_description = currentEvent.Description;
|
||||
_eventDate = currentEvent.EventDate.ToLocalTime();
|
||||
_eventDate = currentEvent.EventDate;
|
||||
_location = currentEvent.Location;
|
||||
_createdby = currentEvent.CreatedBy;
|
||||
_createdon = currentEvent.CreatedOn.ToLocalTime();
|
||||
_modifiedby = currentEvent.ModifiedBy;
|
||||
_modifiedon = currentEvent.ModifiedOn.ToLocalTime();
|
||||
}
|
||||
|
||||
if(rsvp != null)
|
||||
|
@ -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
|
||||
@ -17,22 +18,21 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-1 align-items-center">
|
||||
<Label Class="col-sm-3" For="description" HelpText="Enter a description" ResourceKey="Description">Description: </Label>
|
||||
<Label Class="col-sm-3" For="location" HelpText="Enter a Location" ResourceKey="Location">Location: </Label>
|
||||
<div class="col-sm-9">
|
||||
<input id="description" class="form-control" @bind="@_description" required />
|
||||
<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 />
|
||||
<!--<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="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 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>
|
||||
@ -56,13 +56,15 @@
|
||||
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;
|
||||
private DateTime _eventDate = DateTime.Now;
|
||||
private string _location;
|
||||
|
||||
private string _createdby;
|
||||
@ -105,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")
|
||||
@ -112,7 +118,7 @@
|
||||
Event EventRegistration = new Event();
|
||||
EventRegistration.ModuleId = ModuleState.ModuleId;
|
||||
EventRegistration.Name = _name;
|
||||
EventRegistration.Description = _description;
|
||||
EventRegistration.Description = content;
|
||||
EventRegistration.EventDate = _eventDate.ToUniversalTime();
|
||||
EventRegistration.Location = _location;
|
||||
EventRegistration = await EventRegistrationService.AddEventAsync(EventRegistration);
|
||||
@ -122,7 +128,7 @@
|
||||
{
|
||||
Event EventRegistration = await EventRegistrationService.GetEventAsync(_id, ModuleState.ModuleId);
|
||||
EventRegistration.Name = _name;
|
||||
EventRegistration.Description = _description;
|
||||
EventRegistration.Description = content;
|
||||
EventRegistration.EventDate = _eventDate.ToUniversalTime();
|
||||
EventRegistration.Location = _location;
|
||||
await EventRegistrationService.UpdateEventAsync(EventRegistration);
|
||||
|
@ -24,13 +24,16 @@ else
|
||||
<th style="width: 1px;"> </th>
|
||||
<th style="width: 1px;"> </th>
|
||||
<th>@Localizer["Name"]</th>
|
||||
<th>@Localizer["Date"]</th>
|
||||
<th>@Localizer["Locataion"]</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><ActionDialog 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>@context.EventDate.ToLocalTime()</td>
|
||||
<td>@context.Location</td>
|
||||
<td><ActionLink Action="Details" Parameters="@($"id=" + context.EventId.ToString())" ResourceKey="Details"/></td>
|
||||
</Row>
|
||||
</Pager>
|
||||
@ -80,15 +83,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";
|
||||
}
|
||||
}
|
@ -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>
|
@ -1 +1,8 @@
|
||||
/* Module Custom Styles */
|
||||
.mb-6 {
|
||||
margin-bottom: 6rem;
|
||||
}
|
||||
|
||||
.mt-3 {
|
||||
margin-top: 3rem;
|
||||
}
|
Reference in New Issue
Block a user