|
573 | 573 |
|
574 | 574 | function initButtons(vm) {
|
575 | 575 | vm.buttons = [];
|
576 |
| - if (vm.challenge.currentPhaseName === 'Appeals' && vm.hasSubmitted) { |
577 |
| - vm.buttons.push(newButton({ |
578 |
| - text: 'View Scorecard', |
579 |
| - href: '//' + vm.reviewAppURL + '/actions/ViewProjectDetails?pid=' + vm.challenge.challengeId, |
580 |
| - })); |
581 |
| - vm.buttons.push(newButton({ |
582 |
| - text: 'Complete Appeals', |
583 |
| - href: '//' + vm.reviewAppURL + '/actions/EarlyAppeals?pid=' + vm.challenge.challengeId, |
584 |
| - classes: 'unregister' |
585 |
| - })); |
586 |
| - } else { |
| 576 | + if (vm.isDesign) { |
587 | 577 | if (vm.challenge.allowToUnregister) {
|
588 | 578 | vm.buttons.push(newButton({
|
589 | 579 | classes: 'challengeRegisterBtn unregister',
|
|
602 | 592 | classes: (vm.challenge.submissionDisabled ? 'disabled ' : 'disabledNOT'),
|
603 | 593 | text: 'Submit Your Entries'
|
604 | 594 | }));
|
| 595 | + vm.buttons.push(newButton({ |
| 596 | + href: '//studio.' + vm.domain + '/?module=ViewSubmission&ct=' + vm.challenge.challengeId, |
| 597 | + text: 'View Your Submission', |
| 598 | + classes: (vm.challenge.submissionDisabled ? 'disabled ' : 'disabledNOT'), |
| 599 | + })) |
| 600 | + } else { |
| 601 | + if (vm.challenge.currentPhaseName === 'Appeals') { |
| 602 | + vm.buttons.push(newButton({ |
| 603 | + text: 'View Scorecard', |
| 604 | + href: '//' + vm.reviewAppURL + '/actions/ViewProjectDetails?pid=' + vm.challenge.challengeId, |
| 605 | + })); |
| 606 | + if (vm.hasSubmitted) { |
| 607 | + vm.buttons.push(newButton({ |
| 608 | + text: 'Complete Appeals', |
| 609 | + href: '//' + vm.reviewAppURL + '/actions/EarlyAppeals?pid=' + vm.challenge.challengeId, |
| 610 | + classes: 'unregister' |
| 611 | + })); |
| 612 | + } |
| 613 | + } else { |
| 614 | + if (vm.challenge.allowToUnregister) { |
| 615 | + vm.buttons.push(newButton({ |
| 616 | + classes: 'challengeRegisterBtn unregister', |
| 617 | + onClick: vm.unregisterFromChallenge, |
| 618 | + text: 'Unregister From This Challenge' |
| 619 | + })); |
| 620 | + } else { |
| 621 | + vm.buttons.push(newButton({ |
| 622 | + classes: 'challengeRegisterBtn ' + (vm.challenge.registrationDisabled ? 'disabled ' : 'disabledNOT'), |
| 623 | + onClick: vm.registerToChallenge, |
| 624 | + text: 'Register For This Challenge' |
| 625 | + })); |
| 626 | + } |
| 627 | + vm.buttons.push(newButton({ |
| 628 | + href: '/challenge-details/' + vm.challenge.challengeId + '/submit/?type=develop', |
| 629 | + classes: (vm.challenge.submissionDisabled ? 'disabled ' : 'disabledNOT'), |
| 630 | + text: 'Submit Your Entries' |
| 631 | + })); |
| 632 | + if (!vm.challenge.peerReviewDisabled) { |
| 633 | + vm.buttons.push(newButton({ |
| 634 | + href: '/challenges/' + vm.challenge.challengeId + '/reviews/', |
| 635 | + classes: (vm.challenge.peerReviewDisabled ? 'disabled ' : 'disabledNOT'), |
| 636 | + text: 'Review This Challenge' |
| 637 | + })); |
| 638 | + } |
| 639 | + } |
605 | 640 | }
|
606 | 641 | }
|
607 | 642 |
|
|
0 commit comments