EnVisageOnline/Main/Source/EnVisage/Views/GLAccount/_resourcesList.cshtml

97 lines
3.9 KiB
Plaintext

@using EnVisage.Code.HtmlHelpers
@using EnVisage.Code
@using Microsoft.AspNet.Identity
@model EnVisage.Models.ViewBoardModel
<script type="text/javascript">
init.push(function () {
var tbl = $('.resourceTable').dataTable({
"bPaginate": true,
"bSort": true,
"bFilter": true,
"bInfo": true,
"sScrollY": "",
"sScrollX": "",
"bScrollCollapse": true
});
});
</script>
<div class="panel">
<div class="panel-heading">
<span class="panel-title ui-expander">
<a data-toggle="collapse" data-target="#panelTeams">
<i class="panel-title-icon fa fa-users"></i>Teams
</a>
</span>
</div>
<div id="panelTeams" class="panel-collapse collapse in">
<div class="panel-body padding-sm">
<div class="messages-list">
@if (Model.Teams.Any())
{
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered resourceTable"
id="resourceTbl_">
<thead>
<tr>
<th>Name</th>
<th>Active Employee</th>
<th>Start Date</th>
<th>End Date</th>
<th>Expenditure</th>
@*<th></th>*@
</tr>
</thead>
<tbody>
@foreach (var team in Model.Teams)
{
<tr><td colspan="5"><strong>@team.Name</strong></td></tr>
if (team.PeopleResources.Any())
{
foreach (var resource in team.PeopleResources)
{
<tr>
<td><a href="@Url.Action("Details", "PeopleResource", new { resourceId = resource.Id })">@(resource.FirstName + " " + resource.LastName)</a></td>
<td>@(resource.IsActiveEmployee ? "Active" : "Inactive")</td>
<td>@resource.StartDate.ToShortDateString()</td>
<td>@(!resource.PermanentResource && resource.EndDate.HasValue ? resource.EndDate.Value.ToShortDateString() : "")</td>
@* SA. ENV-756 *@
@if (resource.ExpenditureCategory == null)
{
<td>No expenditure</td>
}
else
{
<td>@resource.ExpenditureCategory.GetView().ExpCategoryWithCcName</td> @* SA. ENV-756. ENV-839 *@
}
@*<td>
@if (SecurityManager.CheckSecurityObjectPermission(Areas.Resources, AccessLevel.Write))
{
<a href="@Url.Action("Edit", "PeopleResource", new { resourceId = resource.Id })" class="btn btn-primary"><i class="fa fa-pencil"></i> Edit</a>
<a href="@Url.Action("Delete", "PeopleResource", new { resourceId = resource.Id })" class="btn btn-danger"><i class="fa fa-trash-o"></i> Delete</a>
}
</td>*@
</tr>
}
}
else
{
<tr><td colspan="5">No resources in the team.</td></tr>
}
}
</tbody>
<tfoot>
</tfoot>
</table>
}
else
{
<span>No teams in the department.</span>
}
</div>
</div>
</div>
</div>