@using MineTec.ProManager.Web.Models.Common.Modals
@model MineTec.ProManager.Web.Models.Roles.RoleListViewModel
@{
    Layout = null;
}
<div class="modal fade" id="RoleCreateModal" tabindex="-1" role="dialog" aria-labelledby="RoleCreateModalLabel" data-backdrop="static">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            @await Html.PartialAsync("~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(L("CreateNewRole")))
            <form name="roleCreateForm" role="form" class="form-horizontal">
                <div class="modal-body">
                    <div class="form-group row required">
                        <label class="col-md-3 col-form-label" for="rolename">@L("RoleName")</label>
                        <div class="col-md-9">
                            <input id="rolename" type="text" name="Name" class="form-control" required maxlength="32" minlength="2">
                        </div>
                    </div>
                    <div class="form-group row required">
                        <label class="col-md-3 col-form-label" for="displayname">@L("DisplayName")</label>
                        <div class="col-md-9">
                            <input id="displayname" type="text" name="DisplayName" class="form-control" required maxlength="32" minlength="2">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-md-3 col-form-label" for="role-description">@L("RoleDescription")</label>
                        <div class="col-md-9">
                            <textarea id="role-description" name="Description" class="form-control"></textarea>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-md-3 col-form-label">@L("Permissions")</label>
                        <div class="col-md-9">
                            <div class="row">
                                @foreach (var permission in Model.Permissions)
                                {
                                    <div class="col-md-6">
                                        <input type="checkbox" name="permission" value="@permission.Name" id="permission-@permission.Name" checked="checked" />
                                        <label for="permission-@permission.Name">@permission.DisplayName</label>
                                    </div>
                                }
                            </div>
                        </div>
                    </div>
                </div>
                @await Html.PartialAsync("~/Views/Shared/Modals/_ModalFooterWithSaveAndCancel.cshtml")
            </form>
        </div>
    </div>
</div>
