generated from egmont11/ASP.Net-Core-MVC-Template
84 lines
3.3 KiB
Plaintext
84 lines
3.3 KiB
Plaintext
@model List<StuzkovakWeb.Entities.InviteEntity>
|
|
@{
|
|
ViewData["Title"] = "Invite Management";
|
|
}
|
|
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
<h1>Pozvánky</h1>
|
|
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#createInviteModal">
|
|
+ Nová pozvánka
|
|
</button>
|
|
</div>
|
|
|
|
@if (TempData["SuccessMessage"] != null)
|
|
{
|
|
<div class="alert alert-success">@TempData["SuccessMessage"]</div>
|
|
}
|
|
|
|
<table class="table table-striped table-hover">
|
|
<thead class="table-dark">
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>Učitel</th>
|
|
<th>Potvrzení</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var invite in Model)
|
|
{
|
|
<tr>
|
|
<td>@invite.Id</td>
|
|
<td>@invite.TeacherName</td>
|
|
<td>@{
|
|
if (invite.IsAccepted == true)
|
|
{
|
|
<span class="badge bg-success">Ano</span>
|
|
}
|
|
else if (invite.IsAccepted == false)
|
|
{
|
|
<span class="badge bg-danger">Ne</span>
|
|
}
|
|
}</td>
|
|
<td class="d-flex gap-1">
|
|
<a asp-action="Details" asp-route-id="@invite.Id" class="btn btn-sm btn-outline-primary">Details</a>
|
|
<form asp-action="Delete" asp-route-id="@invite.Id" method="post"
|
|
onsubmit="return confirm('Opravdu smazat tuto pozvánku?');">
|
|
@Html.AntiForgeryToken()
|
|
<button type="submit" class="btn btn-sm btn-outline-danger">Smazat</button>
|
|
</form>
|
|
<a
|
|
asp-area="" asp-controller="Home" asp-action="Index" asp-route-id="@invite.Id"
|
|
class="btn btn-sm btn-outline-secondary">
|
|
Ukázka
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
|
|
<!-- Create Invite Modal -->
|
|
<div class="modal fade" id="createInviteModal" tabindex="-1" aria-labelledby="createInviteModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<form asp-action="Create" method="post">
|
|
@Html.AntiForgeryToken()
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="createInviteModalLabel">Nová pozvánka</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="mb-3">
|
|
<label for="teacherName" class="form-label">Jméno učitele</label>
|
|
<input type="text" class="form-control" id="teacherName" name="teacherName" required autofocus />
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Zrušit</button>
|
|
<button type="submit" class="btn btn-primary">Vytvořit</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div> |