2021-07-03 12:19:53 +00:00
|
|
|
@page "/calendars/{id:int}"
|
|
|
|
@inject Data.CalendarService _calendarService
|
|
|
|
|
2021-07-04 11:38:52 +00:00
|
|
|
<a href="/">
|
|
|
|
<span class="oi oi-arrow-left"></span> Back
|
|
|
|
</a>
|
|
|
|
|
2021-07-03 12:19:53 +00:00
|
|
|
@if (_calendar == null || _events == null)
|
|
|
|
{
|
|
|
|
<p>
|
|
|
|
<em>Loading...</em>
|
|
|
|
</p>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<h1>Calendar "@_calendar.Name"</h1>
|
2021-07-04 11:39:11 +00:00
|
|
|
@foreach (var @event in _events)
|
2021-07-03 12:19:53 +00:00
|
|
|
{
|
|
|
|
<div class="event">
|
2021-07-04 11:39:11 +00:00
|
|
|
<a href="/calendars/@Id/events/@(@event.Uid)">
|
|
|
|
<h2>@(@event.Summary)</h2>
|
2021-07-03 12:19:53 +00:00
|
|
|
</a>
|
|
|
|
|
2021-07-04 11:39:11 +00:00
|
|
|
@if (@event.DtStart != null)
|
|
|
|
{
|
|
|
|
<div>
|
|
|
|
<strong>Start:</strong> @(@event.DtStart)
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
|
2021-07-04 12:36:21 +00:00
|
|
|
@if (@event.CalculatedEnd != null)
|
2021-07-04 11:39:11 +00:00
|
|
|
{
|
|
|
|
<div>
|
2021-07-04 12:36:21 +00:00
|
|
|
<strong>End:</strong> @(@event.CalculatedEnd)
|
2021-07-04 11:39:11 +00:00
|
|
|
</div>
|
|
|
|
}
|
|
|
|
|
|
|
|
<div class="event-description-short">@(@event.Description)</div>
|
2021-07-03 12:19:53 +00:00
|
|
|
</div>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@code
|
|
|
|
{
|
|
|
|
[Parameter]
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
|
|
private Data.Calendar _calendar;
|
|
|
|
private List<Data.Event> _events;
|
|
|
|
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
|
|
{
|
|
|
|
_calendar = await Data.CalendarService.GetCalendarById(Id);
|
|
|
|
_events = await _calendar.GetEvents();
|
|
|
|
}
|
|
|
|
}
|