Files
Disco/Disco.Web/Views/Shared/_JobTableRender.cshtml
T
Gary Sharp ab553a05cb Update: FontAwesome Pass 2
Removal of bitmap icons, replacing with vector based icons from
FontAwesome. Includes other UI style changes.
2013-12-25 17:49:30 +11:00

87 lines
4.1 KiB
Plaintext

@model Disco.Models.BI.Job.JobTableModel
@{
Html.BundleDeferred("~/ClientScripts/Modules/Disco-DataTableHelpers");
}
<div class="jobTable">
@if (Model != null && Model.Items.Count() > 0)
{
<table class="jobTable@(Model.IsSmallTable ? " smallTable" : string.Empty)@(Model.HideClosedJobs ? " hideStatusClosed" : string.Empty)@(Model.EnablePaging ? " enablePaging" : string.Empty)@(Model.EnableFilter ? " enableFilter" : string.Empty)">
<thead>
<tr>
@if (Model.ShowId)
{ <th class="id">Ref
</th> }
@if (Model.ShowStatus)
{ <th class="status">Status
</th> }
@if (Model.ShowDates)
{ <th class="dates">When
</th> }
@if (Model.ShowType)
{ <th class="type">Type
</th> }
@if (Model.ShowDevice)
{<th class="device">Device
</th> }
@if (Model.ShowUser)
{ <th class="user">User
</th> }
@if (Model.ShowTechnician)
{ <th class="technician">Technician
</th> }
@if (Model.ShowLocation)
{ <th class="location">Location
</th> }
</tr>
</thead>
<tbody>
@foreach (var item in Model.Items)
{<tr data-id="@(item.Id)" data-status="@(Model.ShowStatus ? item.StatusId : null)">
@if (Model.ShowId)
{<td class="id">
@if (Authorization.Has(Claims.Job.Show))
{@Html.ActionLink(item.Id.ToString(), MVC.Job.Show(item.Id))}
else
{@item.Id.ToString()}</td>}
@if (Model.ShowStatus)
{<td class="status"><i class="fa fa-square jobStatus @(item.StatusId)"></i>&nbsp;@item.StatusDescription</td>}
@if (Model.ShowDates)
{<td class="dates">@if (item.ClosedDate.HasValue) {@CommonHelpers.FriendlyDate(item.ClosedDate.Value)}else{@CommonHelpers.FriendlyDate(item.OpenedDate)}</td>}
@if (Model.ShowType)
{<td class="type"><span title="@item.TypeDescription">@item.TypeId</span></td>}
@if (Model.ShowDevice)
{<td class="device">
@if (item.DeviceSerialNumber != null)
{
if (Authorization.Has(Claims.Device.Show))
{@Html.ActionLink(item.DeviceSerialNumber, MVC.Device.Show(item.DeviceSerialNumber), new { Title = item.DeviceModelDescription })}
else
{<span title="@item.DeviceModelDescription">@item.DeviceSerialNumber</span>}
}
else
{<span class="smallMessage">N/A</span>}</td>}
@if (Model.ShowUser)
{<td class="user">
@if (item.UserId != null)
{
if (Authorization.Has(Claims.User.Show))
{@Html.ActionLink(string.Format("{0} ({1})", item.UserDisplayName, item.UserId), MVC.User.Show(item.UserId))}
else
{@(string.Format("{0} ({1})", item.UserDisplayName, item.UserId))}
}
else
{<span class="smallMessage">N/A</span>}</td>}
@if (Model.ShowTechnician)
{<td class="technician"><span title="@item.OpenedTechUserDisplayName">@item.OpenedTechUserId</span></td>}
@if (Model.ShowLocation)
{<td class="technician"><span>@(item.Location ?? "Unknown")</span></td>}
</tr>}
</tbody>
</table>
}
else
{
<span class="smallMessage">No Jobs Found</span>
}
</div>