This repository has been archived by the owner on Jan 17, 2024. It is now read-only.
forked from 18F/dol-whd-14c
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #163 from AppliedIS/feature-adminworksites
admin views for worksites section
- Loading branch information
Showing
10 changed files
with
268 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
...tion14c.Web/src/modules/components/sectionAdminWorkSites/adminWorkSiteDetailTemplate.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<div class="admin-page"> | ||
<h1>Work Sites & 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 & 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 & Employees</button> | ||
</div> | ||
</div> | ||
</div> |
6 changes: 6 additions & 0 deletions
6
DOL.WHD.Section14c.Web/src/modules/components/sectionAdminWorkSites/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}; |
36 changes: 36 additions & 0 deletions
36
...on14c.Web/src/modules/components/sectionAdminWorkSites/sectionAdminWorkSitesController.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
}); | ||
}; |
24 changes: 24 additions & 0 deletions
24
...ion14c.Web/src/modules/components/sectionAdminWorkSites/sectionAdminWorkSitesDirective.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: '=' | ||
} | ||
}; | ||
}); | ||
} |
34 changes: 34 additions & 0 deletions
34
...on14c.Web/src/modules/components/sectionAdminWorkSites/sectionAdminWorkSitesTemplate.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<div class="admin-page"> | ||
<h1>Work Sites & 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,10 @@ | |
max-width: none; | ||
} | ||
} | ||
|
||
.form-spaced-div { | ||
margin-top: 40px; | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.