mirror of
https://github.com/GCMatters/hermes.git
synced 2026-02-04 05:30:13 +01:00
Dodawanie/Usuwanie
Dodawanie/Usuwanie (nie chce tu przeklinać)
This commit is contained in:
@@ -1,8 +1,49 @@
|
||||
@{
|
||||
@model List<WebApp.Entities.Event>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Home Page";
|
||||
}
|
||||
|
||||
<div class="text-center">
|
||||
<h1 class="display-4">Welcome</h1>
|
||||
<p>Learn about <a href="https://learn.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
|
||||
<a href="/Events/Create" class="btn btn-success">Create New Event</a>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<h2 class="mt-4">Lista wydarzeń</h2>
|
||||
|
||||
@if (Model.Any())
|
||||
{
|
||||
<table class="table table-bordered table-striped mt-3">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nazwa</th>
|
||||
<th>Miejsce</th>
|
||||
<th>Data</th>
|
||||
<th>Akcje</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>@item.Name</td>
|
||||
<td>@item.Place</td>
|
||||
<td>@item.Date.ToString("yyyy-MM-dd HH:mm")</td>
|
||||
<td>
|
||||
<form asp-action="Delete" asp-controller="Events" method="post" style="display:inline;">
|
||||
<input type="hidden" name="id" value="@item.Id" />
|
||||
<button type="submit" class="btn btn-danger" onclick="return confirm('Na pewno chcesz usunąć to wydarzenie?')">Usuń</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
else
|
||||
{
|
||||
<p class="mt-3">Brak wydarzeń do wyświetlenia.</p>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user