Combine layouts
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
@using MileageTraker.Web.Utility
|
||||
@model IEnumerable<MileageTraker.Web.Models.User>
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Users";
|
||||
var grid = new WebGrid(Model, rowsPerPage: 45);
|
||||
}
|
||||
|
||||
<h2 id="user-title">@ViewBag.Title</h2>
|
||||
|
||||
<div class="btn-toolbar pull-left">
|
||||
@Html.ActionLink("Add new User", "Create", null, new{@class="btn"})
|
||||
|
||||
</div>
|
||||
|
||||
<div id="users-online">Users online now: <span class="badge badge-info">@Membership.GetNumberOfUsersOnline()</span></div>
|
||||
|
||||
@grid.GetHtml(columns:
|
||||
grid.Columns(
|
||||
grid.Column("Username", format:
|
||||
@<text>@Html.Encode(item.Username)
|
||||
@if (item.LastActivityDate > CustomExtensions.UserOnlineThreshold()) {
|
||||
<span class='label label-info'>Online</span>
|
||||
}
|
||||
@if (item.IsLockedOut) {
|
||||
<span class='label label-warning' title="@string.Format("Locked out on {0:d}", item.LastLockoutDate)">Locked Out</span>
|
||||
}</text> ),
|
||||
grid.Column("FirstName", "First Name"),
|
||||
grid.Column("LastName", "Last Name"),
|
||||
grid.Column("Roles", format: item =>
|
||||
string.Join(", ", Roles.Provider.GetRolesForUser(item.Username) )),
|
||||
grid.Column(format:
|
||||
@<div class='btn-group'>
|
||||
@Html.ActionLink("Edit", "Edit", new { id = item.UserId }, new { @class = "btn btn-mini" })
|
||||
@Html.ActionLink("Details", "Details", new { id = item.UserId }, new { @class = "btn btn-mini" })
|
||||
</div>)
|
||||
),
|
||||
htmlAttributes: new { @class = "table table-striped table-bordered table-hover table-condensed"},
|
||||
numericLinksCount: 20
|
||||
)
|
||||
Reference in New Issue
Block a user