This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <TemplateColumn Title="Acciones" Class="border-2 px-6 py-4 text-center"> | |
| <div class="flex items-center justify-center space-x-2"> | |
| <button @onclick="() => EditNote(context.Id)" | |
| class="p-2 text-indigo-600 hover:text-indigo-900 rounded-full hover:bg-indigo-50"> | |
| <svg class="w-4 h-4" fill="currentColor" viewBox="0 0 16 16"> | |
| <path | |
| d="M12.854.146a.5.5 0 0 0-.707 0L10.5 1.793 14.207 5.5l1.647-1.646a.5.5 0 0 0 0-.708l-3-3zm.646 6.061L9.793 2.5 3.293 9H3.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.207l6.5-6.5zm-7.468 7.468A.5.5 0 0 1 6 13.5V13h-.5a.5.5 0 0 1-.5-.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.5-.5V10h-.5a.499.499 0 0 1-.175-.032l-.179.178a.5.5 0 0 0-.11.168l-2 5a.5.5 0 0 0 .65.65l5-2a.5.5 0 0 0 .168-.11l.178-.178z" /> | |
| </svg> | |
| </button> | |
| <button @onclick="() => TogglePublishNote(context.Id)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @page "/note-overview" | |
| @using TechNotes.Application.Notes | |
| @rendermode @(new InteractiveWebAssemblyRenderMode(false)) | |
| @inject HttpClient Http | |
| @inject NavigationManager NavigationManager | |
| <PageTitle>Mis notas</PageTitle> | |
| <h2 class="text-5xl font-bold text-center mb-3">Mis notas</h2> | |
| @if (notes == null) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| ============= | |
| 🏆 Ejercicio | |
| ============= | |
| */ | |
| // 1. Agregar el siguiente método a la interfaz IUserService: | |
| // | |
| // - RemoveRoleFromUserAsync | |
| // → Recibe un userId y un roleName, | |
| // y elimina el rol del usuario indicado de forma asíncrona. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @if (ShowModal) | |
| { | |
| <div class="fixed inset-0 z-50 flex items-center justify-center bg-black/40"> | |
| <div class="relative w-full max-w-lg sm:max-w-xl bg-white rounded-xl shadow-xl p-4 sm:p-5"> | |
| <!-- Boton de cerrar esquina superior derecha --> | |
| <button @onclick="CloseModal" | |
| class="absolute top-3 right-3 inline-flex items-center justify-center w-8 h-8 rounded-full text-gray-500 hover:text-gray-700 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-blue-500"> | |
| <svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor"> | |
| <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" /> | |
| </svg> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <TemplateColumn Title="Administrar" Class="border-2 px-4 py-3 text-center"> | |
| <div class="flex justify-center"> | |
| <button | |
| class="rounded-md inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-all duration-200 shadow-sm hover:shadow-md" | |
| @onclick="() => OpenModal(context.Id, context.UserName)"> | |
| <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> | |
| <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" | |
| d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <AuthorizeView Roles="Admin" Context="adminContext"> | |
| <Authorized> | |
| <li class="flex"> | |
| <a rel="noopener noreferrer" href="/user-overview" | |
| class="flex items-center px-4 -mb-1 border-b-2 dark:border- hover:dark:text-violet-600 hover:dark:border-violet-600 transition-colors"> | |
| <svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" | |
| viewBox="0 0 24 24"> | |
| <path stroke-linecap="round" stroke-linejoin="round" | |
| stroke-width="2" | |
| d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- 🔍 Consulta para obtener la lista de usuarios junto con los roles que tienen asignados | |
| -- Esta consulta realiza un JOIN entre las tablas de usuarios, roles y asignaciones (AspNetUserRoles) | |
| SELECT [UserId], -- ID del usuario | |
| [UserName], -- Nombre de usuario | |
| [RoleId], -- ID del rol asignado | |
| [Name] AS RoleName -- Nombre legible del rol | |
| FROM [TechNotesDb].[dbo].[AspNetUserRoles] ur | |
| JOIN [TechNotesDb].[dbo].[AspNetUsers] u ON ur.UserId = u.Id | |
| JOIN [TechNotesDb].[dbo].[AspNetRoles] r ON ur.RoleId = r.Id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <button type="submit" | |
| class="block w-full rounded-lg bg-indigo-600 px-5 py-3 text-sm font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring focus:ring-indigo-300 active:bg-indigo-800 transition-colors"> | |
| Inicio de sesión | |
| </button> | |
| </EditForm> | |
| <!-- Divisor --> | |
| <div class="mt-6 mb-6"> | |
| <div class="relative"> | |
| <div class="absolute inset-0 flex items-center"> |
NewerOlder
