Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 5090795

Browse files
1 parent 115ee74 commit 5090795

File tree

2 files changed

+51
-38
lines changed

2 files changed

+51
-38
lines changed

src/js/app/challenge-details/index.html

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,12 @@
1111
<div class="container rightSplit grid-3-3">
1212

1313
<div class="leftColumn">
14-
<div ng-if="!CD.isDesign">
15-
<div ng-repeat="button in CD.buttons track by $index">
16-
<a class="btn btnAction {{button.classes}}" target="_blank" ng-href="{{button.href || 'javascript:void(0);'}}" ng-click="button.onClick()">
17-
<span>{{$index + 1}}</span>
18-
<strong>{{button.text}}</strong>
19-
</a>
20-
</div>
14+
<div ng-repeat="button in CD.buttons track by $index">
15+
<a class="btn btnAction {{button.classes}}" target="_blank" ng-href="{{button.href || 'javascript:void(0);'}}" ng-click="button.onClick()">
16+
<span>{{$index + 1}}</span>
17+
<strong>{{button.text}}</strong>
18+
</a>
2119
</div>
22-
<a ng-show="CD.isDesign" ng-click="CD.challenge.allowToUnregister?CD.unregisterFromChallenge():CD.registerToChallenge()" ng-class="{disabled:!CD.challenge.allowToUnregister && (CD.challenge.registrationDisabled || !CD.callComplete), disabledNOT:!CD.challenge.registrationDisabled, unregister: CD.challenge.allowToUnregister}" class="btn btnAction challengeRegisterBtn" href="javascript:;">
23-
<span>1</span>
24-
<strong ng-hide="CD.isRegistered">
25-
Register For This Challenge
26-
</strong>
27-
<strong ng-show="CD.isRegistered">
28-
Unregister From This Challenge
29-
</strong>
30-
</a>
31-
<a ng-show="CD.isDesign" ng-class="{disabled:CD.challenge.submissionDisabled || !CD.callComplete, disabledNOT:!CD.challenge.submissionDisabled}" class="btn btnAction" target="_blank"
32-
ng-href="/challenges/{{CD.challenge.challengeId}}/submit/file">
33-
<span>2</span> <strong>Submit Your Entries</strong>
34-
</a>
35-
<a ng-show="CD.isDesign" ng-class="{disabled:CD.challenge.submissionDisabled || !CD.callComplete, disabledNOT:!CD.challenge.submissionDisabled}" class="btn btnAction" target="_blank"
36-
ng-href="//studio.{{CD.domain}}/?module=ViewSubmission&ct={{CD.challenge.challengeId}}">
37-
<span>3</span> <strong>View Your Submission</strong>
38-
</a>
39-
<a ng-show="!CD.isDesign && CD.isPeerReviewed" ng-class="{disabled:CD.challenge.peerReviewDisabled || !CD.callComplete, disabledNOT:!CD.challenge.peerReviewDisabled}" class="btn btnAction" ng-href="/challenges/{{CD.challenge.challengeId}}/reviews/" target="_blank">
40-
<span>3</span><strong>Review This Challenge</strong>
41-
</a>
4220
</div>
4321

4422
<div class="middleColumn member-program-path" ng-show="CD.isPeerReviewed && CD.phaseProgram">

src/js/app/challenge-details/js/controllers/challenge-details-controller.js

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -562,17 +562,7 @@
562562

563563
function initButtons(vm) {
564564
vm.buttons = [];
565-
if (vm.challenge.currentPhaseName === 'Appeals' && vm.hasSubmitted) {
566-
vm.buttons.push(newButton({
567-
text: 'View Scorecard',
568-
href: '//' + vm.reviewAppURL + '/actions/ViewProjectDetails?pid=' + vm.challenge.challengeId,
569-
}));
570-
vm.buttons.push(newButton({
571-
text: 'Complete Appeals',
572-
href: '//' + vm.reviewAppURL + '/actions/EarlyAppeals?pid=' + vm.challenge.challengeId,
573-
classes: 'unregister'
574-
}));
575-
} else {
565+
if (vm.isDesign) {
576566
if (vm.challenge.allowToUnregister) {
577567
vm.buttons.push(newButton({
578568
classes: 'challengeRegisterBtn unregister',
@@ -591,6 +581,51 @@
591581
classes: (vm.challenge.submissionDisabled ? 'disabled ' : 'disabledNOT'),
592582
text: 'Submit Your Entries'
593583
}));
584+
vm.buttons.push(newButton({
585+
href: '//studio.' + vm.domain + '/?module=ViewSubmission&ct=' + vm.challenge.challengeId,
586+
text: 'View Your Submission',
587+
classes: (vm.challenge.submissionDisabled ? 'disabled ' : 'disabledNOT'),
588+
}))
589+
} else {
590+
if (vm.challenge.currentPhaseName === 'Appeals') {
591+
vm.buttons.push(newButton({
592+
text: 'View Scorecard',
593+
href: '//' + vm.reviewAppURL + '/actions/ViewProjectDetails?pid=' + vm.challenge.challengeId,
594+
}));
595+
if (vm.hasSubmitted) {
596+
vm.buttons.push(newButton({
597+
text: 'Complete Appeals',
598+
href: '//' + vm.reviewAppURL + '/actions/EarlyAppeals?pid=' + vm.challenge.challengeId,
599+
classes: 'unregister'
600+
}));
601+
}
602+
} else {
603+
if (vm.challenge.allowToUnregister) {
604+
vm.buttons.push(newButton({
605+
classes: 'challengeRegisterBtn unregister',
606+
onClick: vm.unregisterFromChallenge,
607+
text: 'Unregister From This Challenge'
608+
}));
609+
} else {
610+
vm.buttons.push(newButton({
611+
classes: 'challengeRegisterBtn ' + (vm.challenge.registrationDisabled ? 'disabled ' : 'disabledNOT'),
612+
onClick: vm.registerToChallenge,
613+
text: 'Register For This Challenge'
614+
}));
615+
}
616+
vm.buttons.push(newButton({
617+
href: '/challenge-details/' + vm.challenge.challengeId + '/submit/?type=develop',
618+
classes: (vm.challenge.submissionDisabled ? 'disabled ' : 'disabledNOT'),
619+
text: 'Submit Your Entries'
620+
}));
621+
if (!vm.challenge.peerReviewDisabled) {
622+
vm.buttons.push(newButton({
623+
href: '/challenges/' + vm.challenge.challengeId + '/reviews/',
624+
classes: (vm.challenge.peerReviewDisabled ? 'disabled ' : 'disabledNOT'),
625+
text: 'Review This Challenge'
626+
}));
627+
}
628+
}
594629
}
595630
}
596631

0 commit comments

Comments
 (0)