Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #163 from AppliedIS/feature-adminworksites
Browse files Browse the repository at this point in the history
admin views for worksites section
  • Loading branch information
jefferey committed Nov 21, 2016
2 parents 07e58fd + 22813ad commit c097945
Show file tree
Hide file tree
Showing 10 changed files with 268 additions and 80 deletions.
2 changes: 1 addition & 1 deletion DOL.WHD.Section14c.Web/src/modules/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ app.config(function($routeProvider, $compileProvider) {
access: ROUTE_ADMIN
})
.when('/admin/:app_id/section/:section_id', {
template: function(params){ return '<admin-review appid=' + params.app_id + '><section-admin-' + params.section_id + '></section-admin-' + params.section_id + '></admin-review>'; },
template: function(params){ return '<admin-review appid=' + params.app_id + '><section-admin-' + params.section_id + ' item-id=' + (params.item_id || "") + '></section-admin-' + params.section_id + '></admin-review>'; },
reloadOnSearch: false,
access: ROUTE_ADMIN
})
Expand Down
1 change: 1 addition & 0 deletions DOL.WHD.Section14c.Web/src/modules/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = function(ngModule) {
require('./sectionAdminEmployer')(ngModule);
require('./sectionAdminWageData')(ngModule);
require('./sectionAdminWioa')(ngModule);
require('./sectionAdminWorkSites')(ngModule);
require('./sectionAppInfo')(ngModule);
require('./sectionAssurances')(ngModule);
require('./sectionEmployer')(ngModule);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<div class="admin-page">
<h1>Work Sites &amp; Employees</h1>

<div class="form-tabbed-section">
<div class="form-tab {{ vm.activeTab === 1 ? 'active' : '' }}" ng-click="vm.setActiveTab(1)"><div class="circle">1</div> Work Site</div>
<div class="form-tab {{ vm.activeTab === 2 ? 'active' : '' }}" ng-click="vm.setActiveTab(2)"><div class="circle">2</div> Employees</div>
</div>

<div class="form-spaced-div" ng-show="vm.activeTab === 1">
<answer-field answer="$parent.appData.workSites[itemId - 1].workSiteType.display">
What type of establishment is this?
</answer-field>

<answer-field answer="$parent.appData.workSites[itemId - 1].name">
Name of Establishment / Work Site
</answer-field>

<answer-field answer="$parent.appData.workSites[itemId - 1].address" address-field="true">
Address of Establishment / Work Site
</answer-field>

<answer-field answer="$parent.appData.workSites[itemId - 1].sca">
Is Service Contract Act (SCA)-covered work performed at this establishment / work site?
</answer-field>

<answer-field answer="$parent.appData.workSites[itemId - 1].federalContractWorkPerformed">
Is work performed at this establishment / work site pursuant to a Federal contract for services or concessions?
</answer-field>

<answer-field answer="$parent.appData.workSites[itemId - 1].numEmployees">
Total number of employees who were employed at this establishment/work site at any time during the most recently completed fiscal quarter and received subminimum wages:
</answer-field>
<div class="form-footer-controls">
<button class="blue-button" ng-click="vm.viewAllWorkSites()">View All Work Sites &amp; Employees</button>
<button class="green-button pull-right" ng-click="vm.setActiveTab(2)">View Employees</button>
</div>
</div>

<div class="form-spaced-div" ng-show="vm.activeTab === 2">
<div class="usa-content">You indicated this Establishment / Work Site employed {{ $parent.appData.workSites[itemId - 1].numEmployees ? $parent.appData.workSites[itemId - 1].numEmployees : 0 }} employees in the most recently completed fiscal quarter.</div>
<table class="usa-table-borderless expandable-table" ng-show="$parent.appData.workSites[itemId - 1].employees.length">
<thead>
<tr>
<td></td>
<th scope="col">Name</th>
<th scope="col">Disability</th>
<th scope="col">Work Performed</th>
</tr>
</thead>
<tbody>
<tr class="expanding-row {{ $index % 2 !== 0 ? 'greyed' : ''}}" ng-repeat-start="employee in $parent.appData.workSites[itemId - 1].employees">
<td><a href="" ng-click="vm.siteRowClicked($event)"><div class="arrow-expander"></div></a></td>
<th scope="row">{{ employee.name }}</th>
<td>{{ employee.primaryDisability.display }}</td>
<td>{{ employee.workType }}</td>
</tr>
<tr class="expanded-row {{ $index % 2 !== 0 ? 'greyed' : ''}}" ng-repeat-end>
<td></td>
<td colspan="3">
<div class="subtable">
<div>Number of Jobs<div>{{ employee.numJobs}}</div></div>
<div>Average Hours per Week<div>{{ employee.avgWeeklyHours}}</div></div>
<div>Average Earnings per Hours<div>${{ employee.avgHourlyEarnings}}</div></div>
<div>Prevailing Wage Rate<div>${{ employee.prevailingWage}}</div></div>
<div>Productivity Measure<div>{{ employee.productivityMeasure}}</div></div>
<div>Commensurate Wage Rate<div>${{ employee.commensurateWageRate}}</div></div>
<div>Total Hours Worked<div>{{ employee.totalHours}}</div></div>
<div>Work at Other Site?<div>{{ employee.workAtOtherSite ? "Yes" : "No" }}</div></div>
</div>
</td>
</tr>
</tbody>
</table>

<div class="form-footer-controls">
<button class="green-button nomargin" ng-click="vm.setActiveTab(1)">View Work Site</button>
<button class="blue-button pull-right" ng-click="vm.viewAllWorkSites()">View All Work Sites &amp; Employees</button>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict';

module.exports = function(ngModule) {
require('./sectionAdminWorkSitesController')(ngModule);
require('./sectionAdminWorkSitesDirective')(ngModule);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
'use strict';

module.exports = function(ngModule) {
ngModule.controller('sectionAdminWorkSitesController', function($location, $route, $scope) {
'ngInject';
'use strict';

var vm = this;
vm.activeTab = 1;

this.siteRowClicked = (e) => {
let row = $(e.target).closest('.expanding-row');
row.toggleClass("expanded");
row.next().toggleClass("show");
};

this.viewWorkSite = (index) => {
$location.search('item_id', index + 1);
$route.reload(); // manually reload the route since reloadOnSearch is false
};

this.viewAllWorkSites = () => {
$location.search('item_id', null);
$location.search('t', null);
$route.reload(); // manually reload the route since reloadOnSearch is false
};

this.setActiveTab = function(tab) {
if (tab < 1 || tab > 2) {
return;
}

vm.activeTab = tab;
}
});
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use strict';

module.exports = function(ngModule) {
ngModule.directive('sectionAdminWorkSites', function() {

'use strict';

return {
restrict: 'EA',
//template: require('./sectionAdminWorkSitesTemplate.html'),
template: function(elem, attr) {
if(attr.itemId) {
return require('./adminWorkSiteDetailTemplate.html')
}
return require('./sectionAdminWorkSitesTemplate.html');
},
controller: 'sectionAdminWorkSitesController',
controllerAs: 'vm',
scope: {
itemId: '='
}
};
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<div class="admin-page">
<h1>Work Sites &amp; Employees</h1>

<answer-field answer="$parent.appData.totalNumWorkSites">
What is the total number of establishments and work sites to be covered by this certificate?
</answer-field>

<table class="usa-table-borderless expandable-table">
<thead>
<tr>
<td></td>
<th scope="col">Work Site Name</th>
<th scope="col">Number of Workers</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<tr class="expanding-row {{ $index % 2 !== 0 ? 'greyed' : ''}}" ng-repeat-start="site in $parent.appData.workSites">
<td><a href="" ng-click="vm.siteRowClicked($event)"><div class="arrow-expander"></div></a></td>
<th scope="row">{{ site.name }}</th>
<td>{{ site.numEmployees }}</td>
<td><button class="blue-button" ng-click="vm.viewWorkSite($index)">View</button></td>
</tr>
<tr class="expanded-row {{ $index % 2 !== 0 ? 'greyed' : ''}}" ng-repeat-end>
<td></td>
<td colspan="3">
<div ng-repeat="employee in site.employees">
{{ employee.name }}
</div>
</td>
</tr>
</tbody>
</table>
</div>
4 changes: 4 additions & 0 deletions DOL.WHD.Section14c.Web/src/styles/admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
max-width: none;
}
}

.form-spaced-div {
margin-top: 40px;
}
}

}
Loading

0 comments on commit c097945

Please sign in to comment.