Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jump hoops registration #283

Merged
merged 3 commits into from Apr 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/jump-hoops/coffee/controller/personalPage.coffee
Expand Up @@ -19,25 +19,24 @@ angular.module 'ahaLuminateControllers'
$scope.challengeId = null
$scope.challengeName = null
$scope.challengeCompleted = 0

ZuriService.getZooStudent frId+'/'+$scope.participantId,
ZuriService.getZooStudent frId + '/' + $scope.participantId,
success: (response) ->
$scope.challengeId = response.data.challenges.current
$scope.challengeName = response.data.challenges.text
$scope.challengeCompleted = response.data.challenges.completed

error: (response) ->
$scope.challengeName = null
$scope.challengeId = null
$scope.challengeCompleted = 0



TeamraiserCompanyService.getCompanies 'company_id=' + $scope.companyId,
success: (response) ->
coordinatorId = response.getCompaniesResponse?.company.coordinatorId
eventId = response.getCompaniesResponse?.company.eventId
$rootScope.numTeams = response.getCompaniesResponse.company.teamCount

TeamraiserCompanyService.getCoordinatorQuestion coordinatorId, eventId
.then (response) ->
$scope.eventDate = response.data.coordinator.event_date
Expand Down Expand Up @@ -70,7 +69,7 @@ angular.module 'ahaLuminateControllers'
if not $scope.$$phase
$scope.$apply()
, 500

TeamraiserParticipantService.getParticipants 'fr_id=' + $scope.frId + '&first_name=' + encodeURIComponent('%%') + '&last_name=' + encodeURIComponent('%') + '&list_filter_column=reg.cons_id&list_filter_text=' + $scope.participantId,
error: ->
setParticipantProgress()
Expand All @@ -80,7 +79,7 @@ angular.module 'ahaLuminateControllers'
setParticipantProgress()
else
setParticipantProgress Number(participantInfo.amountRaised), Number(participantInfo.goal)

$scope.personalDonors =
page: 1
$defaultResponsivePersonalDonors = angular.element '.js--personal-donors .team-honor-list-row'
Expand Down
25 changes: 24 additions & 1 deletion src/jump-hoops/coffee/controller/trpc-dashboardView.coffee
Expand Up @@ -5,11 +5,34 @@ angular.module 'trPcControllers'
'$timeout'
'$filter'
'$uibModal'
'ZuriService'
'NgPcTeamraiserRegistrationService'
'NgPcTeamraiserProgressService'
'NgPcTeamraiserTeamService'
'NgPcTeamraiserCompanyService'
'NgPcTeamraiserShortcutURLService'
($rootScope, $scope, $timeout, $filter, $uibModal, NgPcTeamraiserRegistrationService, NgPcTeamraiserProgressService, NgPcTeamraiserTeamService, NgPcTeamraiserCompanyService, NgPcTeamraiserShortcutURLService) ->
($rootScope, $scope, $timeout, $filter, $uibModal, ZuriService, NgPcTeamraiserRegistrationService, NgPcTeamraiserProgressService, NgPcTeamraiserTeamService, NgPcTeamraiserCompanyService, NgPcTeamraiserShortcutURLService) ->
$scope.dashboardPromises = []

$scope.personalChallenge = {}
ZuriService.getZooStudent $scope.frId + '/' + $scope.consId,
error: ->
# TODO
success: (response) ->
personalChallenges = response.data.challenges
if personalChallenges
$scope.personalChallenge.id = personalChallenges.current
$scope.personalChallenge.name = personalChallenges.text
$scope.personalChallenge.completed = personalChallenges.completed

if $scope.participantRegistration.teamId and $scope.participantRegistration.teamId isnt '-1'
captainsMessagePromise = NgPcTeamraiserTeamService.getCaptainsMessage()
.then (response) ->
teamCaptainsMessage = response.data.getCaptainsMessageResponse
if teamCaptainsMessage
$scope.teamCaptainsMessage = teamCaptainsMessage
if not angular.isString $scope.teamCaptainsMessage.message
delete $scope.teamCaptainsMessage.message
response
$scope.dashboardPromises.push captainsMessagePromise
]
20 changes: 15 additions & 5 deletions src/jump-hoops/coffee/service/zuri.coffee
Expand Up @@ -5,47 +5,57 @@ angular.module 'ahaLuminateApp'
'$sce'
($rootScope, $http, $sce) ->
getZooStudent: (requestData, callback) ->
url = 'http://hearttools.heart.org/aha_ym18/api/student/' + requestData + '?key=6Mwqh5dFV39HLDq7'
url = '//hearttools.heart.org/aha_ym18/api/student/' + requestData + '?key=6Mwqh5dFV39HLDq7'
urlSCE = $sce.trustAsResourceUrl url
$http.jsonp(urlSCE, jsonpCallbackParam: 'callback').then (response) ->
if response.data.success is false
callback.error response
else
callback.success response
, (response) ->
callback.error response

getZooSchool: (requestData, callback) ->
url = 'http://hearttools.heart.org/aha_ym18/api/program/school/' + requestData + '?key=6Mwqh5dFV39HLDq7'
url = '//hearttools.heart.org/aha_ym18/api/program/school/' + requestData + '?key=6Mwqh5dFV39HLDq7'
urlSCE = $sce.trustAsResourceUrl url
$http.jsonp(urlSCE, jsonpCallbackParam: 'callback').then (response) ->
if response.data.success is false
callback.error response
else
callback.success response
, (response) ->
callback.error response

getZooTeam: (requestData, callback) ->
url = 'http://hearttools.heart.org/aha_ym18/api/program/team/' + requestData + '?key=6Mwqh5dFV39HLDq7'
url = '//hearttools.heart.org/aha_ym18/api/program/team/' + requestData + '?key=6Mwqh5dFV39HLDq7'
urlSCE = $sce.trustAsResourceUrl url
$http.jsonp(urlSCE, jsonpCallbackParam: 'callback').then (response) ->
if response.data.success is false
callback.error response
else
callback.success response
, (response) ->
callback.error response

getZooProgram: (callback) ->
url = 'http://hearttools.heart.org/aha_ym18/api/program?key=6Mwqh5dFV39HLDq7'
url = '//hearttools.heart.org/aha_ym18/api/program?key=6Mwqh5dFV39HLDq7'
urlSCE = $sce.trustAsResourceUrl url
$http.jsonp(urlSCE, jsonpCallbackParam: 'callback').then (response) ->
if response.data.success is false
callback.error response
else
callback.success response
, (response) ->
callback.error response

getZooTest: (callback) ->
url = 'http://hearttools.heart.org/aha_ym18/api/program/event/1163033?key=6Mwqh5dFV39HLDq7'
url = '//hearttools.heart.org/aha_ym18/api/program/event/1163033?key=6Mwqh5dFV39HLDq7'
urlSCE = $sce.trustAsResourceUrl url
$http.jsonp(urlSCE, jsonpCallbackParam: 'callback').then (response) ->
if response.data.success is false
callback.error response
else
callback.success response
, (response) ->
callback.error response
]
81 changes: 62 additions & 19 deletions src/jump-hoops/html/participant-center/view/dashboard.html
Expand Up @@ -13,6 +13,9 @@ <h3 class="h5">
Progress
</h3>
</div>
<a class="btn btn-primary" ng-href="Donation2?df_id={{eventInfo.donationFormId}}&amp;FR_ID={{frId}}&amp;PROXY_TYPE=20&amp;PROXY_ID={{consId}}">
Donate to Personal Page
</a>
</div>
</div>
<div class="col-sm-6">
Expand Down Expand Up @@ -42,41 +45,64 @@ <h2 class="h3">
<div class="row">
<div class="col-sm-6">
<div class="">
<h3 class="h5">
My Donors
</h3>
<div class="">
<div class="">
<h3 class="h5">
My Donors
</h3>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="">
<h3 class="h5">
My Page
</h3>
<div class="">
<div class="">
<h3 class="h5">
My Page
</h3>
<p>
Personalize your fundraising page to share your heart-healthy journey. Students who personalize their page raise more money!
</p>
<a class="btn btn-primary" ng-href="TR?fr_id={{frId}}&amp;pg=personal&amp;px={{consId}}">
View and Edit Your Page
</a>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="">
<h3 class="h5">
Daily Heart-Healthy Challenge
</h3>
<div class="">
<div class="">
<h3 class="h5">
Daily Heart-Healthy Challenge
</h3>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="">
<h3 class="h5">
My Virtual World
</h3>
<div class="">
<div class="">
<h3 class="h5">
My Virtual World
</h3>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="ym-pc-dashboard-captains-message-section">
<section class="ym-pc-dashboard-captains-message-section" ng-if="teamCaptainsMessage.message && teamCaptainsMessage.message != ''" ng-cloak>
<div class="ym-pc-dashboard-section-header">
<h2 class="h5">
Note From Your Teacher
</h2>
<div ng-bind-html="teamCaptainsMessage.message"></div>
</div>
</section>
<section class="ym-pc-dashboard-spread-section">
Expand All @@ -85,12 +111,29 @@ <h2 class="h3">
Spread the Word
</h2>
</div>
<div class="row">
<div class="col-sm-4">
</div>
<div class="col-sm-4">
</div>
<div class="col-sm-4">
<div class="ym-pc-dashboard-spread-options">
<div class="row">
<div class="col-sm-4">
<div class="ym-pc-dashboard-section-header">
<h3 class="h5">
Download Mobile App
</h3>
</div>
</div>
<div class="col-sm-4">
<div class="ym-pc-dashboard-section-header">
<h3 class="h5">
Facebook Fundraising
</h3>
</div>
</div>
<div class="col-sm-4">
<div class="ym-pc-dashboard-section-header">
<h3 class="h5">
Email Signature
</h3>
</div>
</div>
</div>
</div>
</section>
Expand Down
14 changes: 13 additions & 1 deletion src/jump-hoops/sass/participant.scss
Expand Up @@ -13,7 +13,7 @@
background: $event-secondary-medium;
padding: 24px 20px;
margin: 0 0 30px;

.ym-pc-dashboard-section-header {
color: $event-secondary;
}
Expand All @@ -31,10 +31,22 @@

.ym-pc-dashboard-captains-message-section {
background-color: $event-accent;
text-align: center;
padding: 24px 172px;
margin: 0 0 24px;

.ym-pc-dashboard-section-header {
color: #ffffff;
}
}

.ym-pc-dashboard-spread-options {
text-align: center;

.ym-pc-dashboard-section-header {
h5,
.h5 {
color: $event-secondary;
}
}
}