Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

117 lines (110 sloc) 4.633 kB
@using Shoelace.Views.Extensions
@using Shoelace.Models.Extensions
@model Shoelace.Models.UserListModel
@{
ViewBag.Title = "UserList";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div id="cntnrUserList">
<div class="block">
<div class="navbar navbar-inner block-header">
<div class="muted pull-left">Users</div>
<div class="pull-right">
</div>
</div>
<div class="block-content collapse in">
<table class="table table-striped">
<thead>
<tr>
<th>Username</th>
<th>First Name</th>
<th>Last Name</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody data-bind="foreach: users">
<tr>
<td data-bind="text: userName"></td>
<td data-bind="text: firstName"></td>
<td data-bind="text: lastName"></td>
<td>
<a class="btn btn-primary pull-right" data-toggle="modal" href="#mdUserPermissions"
data-bind="click: $parent.showUserPermissions">
Permissions
</a>
</td>
<td>
<!-- ko if: $parent.logedInUserName().toLowerCase() != userName().toLowerCase() -->
<a class="btn btn-danger pull-right" data-toggle="modal" href="#mdConfirmDelete"
data-bind="click: $parent.confirmDelete">
<i class="icon-remove icon-white"></i>
Delete
</a>
<!-- /ko -->
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--DELETE MODAL-->
<div id="mdConfirmDelete" class="modal hide">
<input id="hdDeleteUserId" type="hidden" />
<div class="modal-header">
<button data-dismiss="modal" class="close" type="button" data-bind="click: cancel">×</button>
<h3>Confirm Delete</h3>
</div>
<div class="modal-body">
<p>Are you sure you want to delete this user?</p>
</div>
<div class="modal-footer">
<a data-dismiss="modal" class="btn btn-primary" href="#" data-bind="click: performDelete">Confirm</a>
<a data-dismiss="modal" class="btn" href="#" data-bind="click: cancel">Cancel</a>
</div>
</div>
<!--PERMISSIONS MODAL-->
<div id="mdUserPermissions" class="modal hide">
<input id="hdPermissionsUserId" type="hidden" />
<div class="modal-header">
<button data-dismiss="modal" class="close" type="button" data-bind="click: cancel">×</button>
<h3>Edit Permissions</h3>
</div>
<div class="modal-body">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Permission</th>
<th></th>
</tr>
</thead>
@*<pre data-bind="text: ko.toJSON(users, null, 2)"></pre>
<pre data-bind="text: JSON.stringify(ko.toJS(selectedUser().userRoles()), null, 2)"></pre>
<pre data-bind="text: JSON.stringify(ko.toJS(selectedUser), null, 2)"></pre>*@
<tbody data-bind="foreach: selectedUser().userRoles">
<tr>
<td>
<span class="label" data-bind="text: $data.roleDisplayName"></span>
</td>
<td>
<!--TODO: Figure out how to update bindings -->
<input type="checkbox" data-bind="checked: $data.isMember"/>
</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<a data-dismiss="modal" class="btn btn-primary" href="#" data-bind="click: saveUserPermissions">Save</a>
<a data-dismiss="modal" class="btn" href="#" data-bind="click: cancel">Cancel</a>
</div>
</div>
</div>
@Html.PartialResource(@<script src="@Url.Content("~/Scripts/app/Views/Account/userlist.viewmodel.js")" type="text/javascript"></script>, "js")
@Html.PartialResource(
@<script type="text/javascript">
$(function () {
var viewModelObj = APP.userListViewModel(ko.mapping.fromJS(@Html.Raw(Model.ToJson())));
ko.applyBindings(viewModelObj, document.getElementById("cntnrUserList"));
});
</script>, "js")
Jump to Line
Something went wrong with that request. Please try again.