87 lines
4.0 KiB
Plaintext
87 lines
4.0 KiB
Plaintext
@using EnVisage.Code.HtmlHelpers
|
|
@using EnVisage.Code
|
|
@using Microsoft.AspNet.Identity
|
|
@model EnVisage.Models.TeamboardModel
|
|
|
|
@{
|
|
var team = Model.Teams.FirstOrDefault();
|
|
}
|
|
|
|
<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="#panelTeam" class="collapsed">
|
|
<i class="panel-title-icon fa fa-users"></i>Team Resources
|
|
</a>
|
|
</span>
|
|
</div>
|
|
<div id="panelTeam" class="panel-collapse collapse">
|
|
<div class="panel-body padding-sm">
|
|
@if (SecurityManager.CheckSecurityObjectPermission(Areas.Resources, AccessLevel.Write))
|
|
{
|
|
<a class="btn btn-primary" style="margin-bottom: 10px;" href='@Url.Action("Edit", "PeopleResource", new { resourceId = Guid.Empty, teamId = team.Id })'>Add People Resource</a>
|
|
}
|
|
<div class="table-light table-responsive very-big-table messages-list">
|
|
@if (team.PeopleResources.Any())
|
|
{
|
|
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered resourceTable"
|
|
id="resourceTbl_@Model.Id">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Active Employee</th>
|
|
<th>Start Date</th>
|
|
<th>End Date</th>
|
|
<th>Expenditure Category </th> @* SA. ENV-756 *@
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var resource in team.PeopleResources.OrderBy(x => x.FirstName))
|
|
{
|
|
<tr>
|
|
<td><a href="@Url.Action("Details", "PeopleResource", new { resourceId = resource.Id, teamId = team.Id })">@(resource.FirstName + " " + resource.LastName)</a></td>
|
|
<td>@(resource.IsActiveEmployee ? "Active" : "Inactive")</td>
|
|
<td>@resource.StartDate.ToShortDateString()</td>
|
|
<td>@(resource.EndDate != Model.CalendarMaxDate ? resource.EndDate.ToShortDateString() : "")</td>
|
|
<td>@resource.ExpenditureCategory.GetView().ExpCategoryWithCcName</td> @* SA. ENV-756. ENV-839 *@
|
|
<td>
|
|
@if (SecurityManager.CheckSecurityObjectPermission(Areas.Resources, AccessLevel.Write))
|
|
{
|
|
<a id="aERes_@resource.Id" onclick="return CheckLock(this.id, 'PeopleResource', '@resource.Id');" href="@Url.Action("Edit", "PeopleResource", new { resourceId = resource.Id, teamId = team.Id })" data-placement="left" class="btn btn-primary popover-warning popover-dark"><i class="fa fa-pencil"></i> Edit</a>
|
|
<a id="aDRes_@resource.Id" onclick="return CheckLock(this.id, 'PeopleResource', '@resource.Id');" href="@Url.Action("Delete", "PeopleResource", new { resourceId = resource.Id, teamId = team.Id })" data-placement="left" class="btn btn-danger popover-warning popover-dark"><i class="fa fa-trash-o"></i> Delete</a>
|
|
}
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
<tfoot>
|
|
|
|
</tfoot>
|
|
</table>
|
|
}
|
|
else
|
|
{
|
|
<span>No resources in the team.</span>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|