diff --git a/src/css/challenge-detail-software.css b/src/css/challenge-detail-software.css index add4a761..fdfc82ac 100644 --- a/src/css/challenge-detail-software.css +++ b/src/css/challenge-detail-software.css @@ -429,6 +429,9 @@ h1.center { padding-right: 20px; } +.challenge-detail .tableWrap pre { + overflow-x: auto; +} .challenge-detail .currentTab-checkpoints .tableWrap, .challenge-detail .currentTab-submissions .tableWrap, .challenge-detail .currentTab-winner .tableWrap { diff --git a/src/footer.html b/src/footer.html index a92cd3a4..50a02505 100644 --- a/src/footer.html +++ b/src/footer.html @@ -249,6 +249,7 @@

Comment Examples

], 'community': [ { 'href': '/community/members/', 'text': 'OVERVIEW', 'icon': '/mf/i/nav/members.svg' }, + { 'href': '/tco', 'text': 'TCO', 'icon': '/mf/i/nav/tco-generic.svg', 'target': '_blank' }, { 'href': '/community/member-programs/', 'text': 'PROGRAMS', 'icon': '/mf/i/nav/programs.svg' }, { 'href': 'https://' + tcconfig.forumsAppURL, 'text': 'FORUMS', 'icon': '/mf/i/nav/forums.svg' }, { 'href': '/community/statistics/', 'text': 'STATISTICS', 'icon': '/mf/i/nav/statistics.svg' }, diff --git a/src/js/app/challenge-details/index.html b/src/js/app/challenge-details/index.html index 6f8ed0cb..1ac0e429 100644 --- a/src/js/app/challenge-details/index.html +++ b/src/js/app/challenge-details/index.html @@ -11,34 +11,12 @@
-
-
- - {{$index + 1}} - {{button.text}} - -
+
+ + {{$index + 1}} + {{button.text}} +
- - 1 - - Register For This Challenge - - - Unregister From This Challenge - - - - 2 Submit Your Entries - - - 3 View Your Submission - - - 3Review This Challenge -
diff --git a/src/js/app/challenge-details/js/controllers/challenge-details-controller.js b/src/js/app/challenge-details/js/controllers/challenge-details-controller.js index c2e0dbe0..0ee826d7 100644 --- a/src/js/app/challenge-details/js/controllers/challenge-details-controller.js +++ b/src/js/app/challenge-details/js/controllers/challenge-details-controller.js @@ -183,18 +183,7 @@ ChallengeService.getChallengeTerms(challengeId).then(function (termsList) { vm.termsList = termsList; }); - ChallengeService - .getUserChallenges(vm.handle, vm.challengeApiParams) - .then(function (challenge) { - if (challenge[0] && challenge[0].result.content.length) { - challenge = challenge[0].result.content[0]; - vm.userRole = challenge.userDetails ? challenge.userDetails.roles : []; - } else { - vm.userRole = []; - } - //Set to test value if defined - vm.userRole = vm.mockUserRole ? vm.mockUserRole : vm.userRole; - }); + getUserRole(); ChallengeService .getChallenge(challengeId) .then(function (challenge) { @@ -213,6 +202,27 @@ .then(function (challenge) { processChallenge(challenge, vm.handle, vm, ChallengeService); }); + getUserRole(); + } + + /** + * + * Updates User Role for the challenge + * @param ChallengeService + */ + function getUserRole() { + ChallengeService + .getUserChallenges(vm.handle, vm.challengeApiParams) + .then(function (challenge) { + if (challenge[0] && challenge[0].result.content.length) { + challenge = challenge[0].result.content[0]; + vm.userRole = challenge.userDetails ? challenge.userDetails.roles : []; + } else { + vm.userRole = []; + } + //Set to test value if defined + vm.userRole = vm.mockUserRole ? vm.mockUserRole : vm.userRole; + }); } /** @@ -396,7 +406,8 @@ } // If is not submited, then enable submission - if (((moment(challenge.submissionEndDate)) > moment()) && regList.indexOf(handle) > -1) { + var challengeSubmissionPhase = _.find(vm.challenge.phases, function(phase) { return phase.type === 'Submission'; }) + if ((challengeSubmissionPhase && challengeSubmissionPhase.status === 'Open') && regList.indexOf(handle) > -1) { vm.challenge.submissionDisabled = false; } @@ -562,17 +573,7 @@ function initButtons(vm) { vm.buttons = []; - if (vm.challenge.currentPhaseName === 'Appeals' && vm.hasSubmitted) { - vm.buttons.push(newButton({ - text: 'View Scorecard', - href: '//' + vm.reviewAppURL + '/actions/ViewProjectDetails?pid=' + vm.challenge.challengeId, - })); - vm.buttons.push(newButton({ - text: 'Complete Appeals', - href: '//' + vm.reviewAppURL + '/actions/EarlyAppeals?pid=' + vm.challenge.challengeId, - classes: 'unregister' - })); - } else { + if (vm.isDesign) { if (vm.challenge.allowToUnregister) { vm.buttons.push(newButton({ classes: 'challengeRegisterBtn unregister', @@ -591,6 +592,51 @@ classes: (vm.challenge.submissionDisabled ? 'disabled ' : 'disabledNOT'), text: 'Submit Your Entries' })); + vm.buttons.push(newButton({ + href: '//studio.' + vm.domain + '/?module=ViewSubmission&ct=' + vm.challenge.challengeId, + text: 'View Your Submission', + classes: (vm.challenge.submissionDisabled ? 'disabled ' : 'disabledNOT'), + })) + } else { + if (vm.challenge.currentPhaseName === 'Appeals') { + vm.buttons.push(newButton({ + text: 'View Scorecard', + href: '//' + vm.reviewAppURL + '/actions/ViewProjectDetails?pid=' + vm.challenge.challengeId, + })); + if (vm.hasSubmitted) { + vm.buttons.push(newButton({ + text: 'Complete Appeals', + href: '//' + vm.reviewAppURL + '/actions/EarlyAppeals?pid=' + vm.challenge.challengeId, + classes: 'unregister' + })); + } + } else { + if (vm.challenge.allowToUnregister) { + vm.buttons.push(newButton({ + classes: 'challengeRegisterBtn unregister', + onClick: vm.unregisterFromChallenge, + text: 'Unregister From This Challenge' + })); + } else { + vm.buttons.push(newButton({ + classes: 'challengeRegisterBtn ' + (vm.challenge.registrationDisabled ? 'disabled ' : 'disabledNOT'), + onClick: vm.registerToChallenge, + text: 'Register For This Challenge' + })); + } + vm.buttons.push(newButton({ + href: '/challenge-details/' + vm.challenge.challengeId + '/submit/?type=develop', + classes: (vm.challenge.submissionDisabled ? 'disabled ' : 'disabledNOT'), + text: 'Submit Your Entries' + })); + if (!vm.challenge.peerReviewDisabled) { + vm.buttons.push(newButton({ + href: '/challenges/' + vm.challenge.challengeId + '/reviews/', + classes: (vm.challenge.peerReviewDisabled ? 'disabled ' : 'disabledNOT'), + text: 'Review This Challenge' + })); + } + } } } diff --git a/wp/wp-content/themes/tcs-responsive/footer.php b/wp/wp-content/themes/tcs-responsive/footer.php index fbb6cb15..03ec7a90 100644 --- a/wp/wp-content/themes/tcs-responsive/footer.php +++ b/wp/wp-content/themes/tcs-responsive/footer.php @@ -268,7 +268,7 @@ function getHashParameterByName(name, source) { ], 'community': [ { 'href': '/community/members/', 'text': 'OVERVIEW', 'icon': '/mf/i/nav/members.svg' }, - { 'href': '/tco', 'text': 'TCO', 'icon': '/mf/i/nav/tco-generic.svg' }, + { 'href': '/tco', 'text': 'TCO', 'icon': '/mf/i/nav/tco-generic.svg' }, { 'href': '/community/member-programs/', 'text': 'PROGRAMS', 'icon': '/mf/i/nav/programs.svg' }, { 'href': 'https://' + tcconfig.forumsAppURL, 'text': 'FORUMS', 'icon': '/mf/i/nav/forums.svg' }, { 'href': '/community/statistics/', 'text': 'STATISTICS', 'icon': '/mf/i/nav/statistics.svg' },