F2 avanzada
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
@using Microsoft.AspNetCore.Identity
|
||||
@model IdentityRole
|
||||
|
||||
@{
|
||||
@@ -8,6 +9,23 @@
|
||||
|
||||
<p>¿Está seguro que desea deshabilitar este rol? Esto afectará a los usuarios con este rol.</p>
|
||||
|
||||
<form asp-action="DisableConfirmed" method="post">
|
||||
<input type="hidden" name="id" value="@Model.Id" />
|
||||
@Html.AntiForgeryToken()
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-warning">Deshabilitar rol</button>
|
||||
<a asp-action="Index" class="btn btn-secondary">Cancelar</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Deshabilitar rol";
|
||||
}
|
||||
|
||||
<h1>Deshabilitar rol: @Model.Name</h1>
|
||||
|
||||
<p>¿Está seguro que desea deshabilitar este rol? Esto afectará a los usuarios con este rol.</p>
|
||||
|
||||
<form asp-action="DisableConfirmed" method="post">
|
||||
<input type="hidden" name="id" value="@Model.Id" />
|
||||
@Html.AntiForgeryToken()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@using Microsoft.AspNetCore.Identity
|
||||
@model IdentityRole
|
||||
|
||||
@{
|
||||
@@ -19,6 +20,29 @@
|
||||
</div>
|
||||
</form>
|
||||
|
||||
section scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Editar rol";
|
||||
}
|
||||
|
||||
<h1>Editar rol: @Model.Name</h1>
|
||||
|
||||
<form asp-action="Edit">
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div class="form-group">
|
||||
<label asp-for="Name" class="control-label"></label>
|
||||
<input asp-for="Name" class="form-control" />
|
||||
<span asp-validation-for="Name" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Guardar cambios" class="btn btn-primary" />
|
||||
<a asp-action="Index" class="btn btn-secondary">Cancelar</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
section scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
@@ -2,7 +2,30 @@
|
||||
@model IEnumerable<IdentityRole>
|
||||
|
||||
<h1>Roles</h1>
|
||||
<p><a asp-action="Create" class="btn btn-primary">Crear nuevo rol</a></p>
|
||||
|
||||
<!-- Modal de creación -->
|
||||
<div class="modal fade" id="createModal" tabindex="-1" aria-labelledby="createModalLabel" 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="createModalLabel">Crear nuevo rol</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input name="roleName" class="form-control" placeholder="Nombre del rol" required />
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancelar</button>
|
||||
<button type="submit" class="btn btn-primary">Guardar cambios</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p><a href="#" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#createModal">Crear nuevo rol</a></p>
|
||||
<table class="table">
|
||||
<thead><tr><th>Nombre</th><th>Acciones</th></tr></thead>
|
||||
<tbody>
|
||||
@@ -13,19 +36,19 @@
|
||||
<td>
|
||||
<a href="#" class="btn btn-info btn-sm" data-bs-toggle="modal" data-bs-target="#editModal-@role.Id">Editar</a>
|
||||
|
||||
<!-- Modal de edición -->
|
||||
<!-- Modal de edición -->
|
||||
<div class="modal fade" id="editModal-@role.Id" tabindex="-1" aria-labelledby="editModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form asp-action="Edit" method="post">
|
||||
<input type="hidden" name="id" value="@role.Id" />
|
||||
@HttpContext.RequestServices.GetService typeof(Antiforgery.IAntiforgery)
|
||||
@Html.AntiForgeryToken()
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="editModalLabel">Editar rol: @role.Name</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input asp-for="Name" class="form-control" placeholder="Nuevo nombre del rol" />
|
||||
<input name="Name" value="@role.Name" class="form-control" placeholder="Nuevo nombre del rol" />
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cerrar</button>
|
||||
|
||||
Reference in New Issue
Block a user