Skip to content

Commit

Permalink
Merge pull request #356 from chiragchhita/jump-hoops-registration
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
noahcooper committed Apr 21, 2017
2 parents 92c90f7 + 865cb54 commit c0dfbfd
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 15 deletions.
38 changes: 36 additions & 2 deletions src/jump-hoops/coffee/controller/trpc-reportsView.coffee
Expand Up @@ -3,12 +3,13 @@ angular.module 'trPcControllers'
'$scope'
'$filter'
'NgPcTeamraiserGiftService'
($scope, $filter, NgPcTeamraiserGiftService) ->
'NgPcTeamraiserReportsService'
($scope, $filter, NgPcTeamraiserGiftService, NgPcTeamraiserReportsService) ->
$scope.reportPromises = []

$scope.activeReportTab = if $scope.participantRegistration.companyInformation.isCompanyCoordinator is 'true' then 0 else 1

$scope.participantGifts =
$scope.participantGifts =
sortColumn: 'date_recorded'
sortAscending: false
page: 1
Expand Down Expand Up @@ -38,4 +39,37 @@ angular.module 'trPcControllers'
response
$scope.reportPromises.push personalGiftsPromise
$scope.getGifts()

if $scope.participantRegistration.companyInformation.isCompanyCoordinator is 'true'
$scope.schoolDetailStudents = {}
schoolDetailReportPromise = NgPcTeamraiserReportsService.getSchoolDetailReport()
.then (response) ->
if response.data.errorResponse
$scope.schoolDetailStudents.students = []
else
reportHtml = response.data.getSchoolDetailReport.report
$reportTable = angular.element('<div>' + reportHtml + '</div>').find 'table'
if $reportTable.length is 0
$scope.schoolDetailStudents.students = []
else
$reportTableRows = $reportTable.find 'tr'
if $reportTableRows.length is 0
$scope.schoolDetailStudents.students = []
else
schoolDetailStudents = []
angular.forEach $reportTableRows, (reportTableRow) ->
$reportTableRow = angular.element reportTableRow
schoolDetailStudents.push
firstName: jQuery.trim $reportTableRow.find('td').eq(8).text()
lastName: jQuery.trim $reportTableRow.find('td').eq(9).text()
amount: Number jQuery.trim($reportTableRow.find('td').eq(10).text())
amountFormatted: $filter('currency') jQuery.trim($reportTableRow.find('td').eq(10).text()), '$', 0
ecardsSent: Number jQuery.trim($reportTableRow.find('td').eq(13).text())
emailsSent: Number jQuery.trim($reportTableRow.find('td').eq(12).text())
tshirtSize: jQuery.trim $reportTableRow.find('td').eq(14).text()
teacherName: jQuery.trim $reportTableRow.find('td').eq(6).text()
challenge: jQuery.trim($reportTableRow.find('td').eq(15).text()).replace('1. ', '').replace('2. ', '').replace('3. ', '').replace '4. ', ''
$scope.schoolDetailStudents.students = schoolDetailStudents
response
$scope.reportPromises.push schoolDetailReportPromise
]
12 changes: 12 additions & 0 deletions src/jump-hoops/coffee/service/trpc-teamraiserReports.coffee
@@ -0,0 +1,12 @@
angular.module 'trPcApp'
.factory 'NgPcTeamraiserReportsService', [
'$rootScope'
'$http'
($rootScope, $http) ->
getSchoolDetailReport: ->
$http
method: 'GET'
url: 'SPageServer?pagename=getJumpHoopsSchoolDetailReport&pgwrap=n&fr_id=' + $rootScope.frId + '&response_format=json'
.then (response) ->
response
]
2 changes: 1 addition & 1 deletion src/jump-hoops/coffee/service/zuri.coffee
Expand Up @@ -8,7 +8,7 @@ angular.module 'ahaLuminateApp'
url = '//hearttools.heart.org/aha_ym18/visitlink_record.php?ecard_linktrack=' + requestData
urlSCE = $sce.trustAsResourceUrl url
$http
method: 'POST',
method: 'POST'
url: urlSCE

getChallenges: (requestData, callback) ->
Expand Down
15 changes: 7 additions & 8 deletions src/jump-hoops/html/page-wrapper/head-meta-tags.html
@@ -1,12 +1,11 @@
[[?
[[xjump_hoops_participant_centerx::x[[S334]]x::T::]]
[[?x26xpersonalx::x[[S4]]x[[S334:pg]]x::T::]]
[[?x26xteamx::x[[S4]]x[[S334:pg]]x::T::]]
[[?x26xcompanyx::x[[S4]]x[[S334:pg]]x::T::]]
::T::
<meta name="robots" content="noindex, nofollow">
::
]]
[[xjump_hoops_participant_centerx::x[[S334:pagename]]x::T::]]
[[?x26x::x[[S4]]x::
[[?xpersonalxteamxcompanyx::x[[S334:pg]]x::T::]]
::]]
::T::
<meta name="robots" content="noindex, nofollow">
::]]

<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">

Expand Down
77 changes: 77 additions & 0 deletions src/jump-hoops/html/participant-center/view/reports.html
Expand Up @@ -7,6 +7,83 @@ <h2 class="h5">
School Detail Report
</h2>
</div>
<div ng-if="schoolDetailStudents.students && schoolDetailStudents.students.length == 0" ng-cloak>
No students to display.
</div>
<div ng-if="schoolDetailStudents.students && schoolDetailStudents.students.length > 0" ng-cloak>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>
<a>
<strong>Name</strong>
</a>
</th>
<th>
<a>
<strong>Amount</strong>
</a>
</th>
<th>
<a>
<strong>Ecards</strong>
</a>
</th>
<th>
<a>
<strong>Emails</strong>
</a>
</th>
<th>
<a>
<strong>T-shirt</strong>
</a>
</th>
<th>
<a>
<strong>Teacher</strong>
</a>
</th>
<th>
<div class="text-right">
<a>
<strong>Challenge</strong>
</a>
</div>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="schoolDetailStudent in schoolDetailStudents.students">
<td>
<span ng-bind-html="schoolDetailStudent.firstName"></span> <span ng-bind-html="schoolDetailStudent.lastName"></span>
</td>
<td>
{{schoolDetailStudent.amountFormatted}}
</td>
<td>
{{schoolDetailStudent.ecardsSent}}
</td>
<td>
{{schoolDetailStudent.emailsSent}}
</td>
<td>
<span ng-bind-html="schoolDetailStudent.tshirtSize"></span>
</td>
<td>
<span ng-bind-html="schoolDetailStudent.teacherName"></span>
</td>
<td>
<div class="text-right">
<span ng-bind-html="schoolDetailStudent.challenge"></span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</uib-tab>
<uib-tab index="1" heading="Donors">
<div class="ym-pc-report-header">
Expand Down
8 changes: 4 additions & 4 deletions src/youth-markets/sass/participant.scss
Expand Up @@ -862,10 +862,10 @@ main > .container {
}
}

.ym-pc-reports-lists > .table {
thead {
tr {
th {
.ym-pc-reports-lists .table {
> thead {
> tr {
> th {
a {
&,
&:link,
Expand Down

0 comments on commit c0dfbfd

Please sign in to comment.