mirror of https://github.com/abpframework/abp.git
5 changed files with 89 additions and 0 deletions
@ -0,0 +1,37 @@ |
|||
@page |
|||
@using Microsoft.Extensions.Localization |
|||
@using Volo.Abp.Identity.Web.Localization.Resources.AbpIdentity |
|||
@model Volo.Abp.Identity.Web.Pages.Identity.Roles.EditModalModel |
|||
@inject IStringLocalizer<IdentityResource> L |
|||
@{ |
|||
Layout = null; |
|||
} |
|||
|
|||
<form method="post" asp-page="/Identity/Roles/EditModal"> |
|||
|
|||
<abp-modal> |
|||
|
|||
<abp-modal-header title="@L["Edit"]"></abp-modal-header> |
|||
|
|||
<abp-modal-body> |
|||
|
|||
<div class="tab-pane active" id="EditUser_UserInfoTab" role="tabpanel"> |
|||
|
|||
<input asp-for="RoleInfo.Id" /> |
|||
|
|||
<div class="form-group"> |
|||
<label asp-for="RoleInfo.Name"></label> |
|||
<input asp-for="RoleInfo.Name" class="form-control" /> |
|||
<span asp-validation-for="RoleInfo.Name" class="text-danger"></span> |
|||
</div> |
|||
</div> |
|||
|
|||
<div asp-validation-summary="All" class="text-danger"></div> |
|||
|
|||
</abp-modal-body> |
|||
|
|||
<abp-modal-footer></abp-modal-footer> |
|||
|
|||
</abp-modal> |
|||
|
|||
</form> |
|||
@ -0,0 +1,29 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.RazorPages; |
|||
|
|||
namespace Volo.Abp.Identity.Web.Pages.Identity.Roles |
|||
{ |
|||
public class EditModalModel : AbpPageModel |
|||
{ |
|||
[BindProperty] |
|||
public RoleInfoModel RoleInfo { get; set; } |
|||
|
|||
private readonly IIdentityRoleAppService _identityRoleAppService; |
|||
|
|||
public EditModalModel(IIdentityRoleAppService identityRoleAppService) |
|||
{ |
|||
_identityRoleAppService = identityRoleAppService; |
|||
} |
|||
|
|||
public async Task OnGetAsync(Guid id) |
|||
{ |
|||
var role = await _identityRoleAppService.GetAsync(id); |
|||
RoleInfo = ObjectMapper.Map<IdentityRoleDto, RoleInfoModel>(role); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
|
|||
namespace Volo.Abp.Identity.Web.Pages.Identity.Roles |
|||
{ |
|||
public class RoleInfoModel |
|||
{ |
|||
[HiddenInput] |
|||
public Guid Id { get; set; } |
|||
|
|||
[Required] |
|||
[StringLength(IdentityRoleConsts.MaxNameLength)] |
|||
[Display(Name = "RoleName")] |
|||
public string Name { get; set; } |
|||
} |
|||
} |
|||
Loading…
Reference in new issue