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

Bug Bash 3 #488

Merged
merged 10 commits into from
Mar 29, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/css/challenge-detail-software.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions src/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ <h2>Comment Examples</h2>
],
'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' },
Expand Down
32 changes: 5 additions & 27 deletions src/js/app/challenge-details/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,12 @@
<div class="container rightSplit grid-3-3">

<div class="leftColumn">
<div ng-if="!CD.isDesign">
<div ng-repeat="button in CD.buttons track by $index">
<a class="btn btnAction {{button.classes}}" target="_blank" ng-href="{{button.href || 'javascript:void(0);'}}" ng-click="button.onClick()">
<span>{{$index + 1}}</span>
<strong>{{button.text}}</strong>
</a>
</div>
<div ng-repeat="button in CD.buttons track by $index">
<a class="btn btnAction {{button.classes}}" target="_blank" ng-href="{{button.href || 'javascript:void(0);'}}" ng-click="button.onClick()">
<span>{{$index + 1}}</span>
<strong>{{button.text}}</strong>
</a>
</div>
<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:;">
<span>1</span>
<strong ng-hide="CD.isRegistered">
Register For This Challenge
</strong>
<strong ng-show="CD.isRegistered">
Unregister From This Challenge
</strong>
</a>
<a ng-show="CD.isDesign" ng-class="{disabled:CD.challenge.submissionDisabled || !CD.callComplete, disabledNOT:!CD.challenge.submissionDisabled}" class="btn btnAction" target="_blank"
ng-href="/challenges/{{CD.challenge.challengeId}}/submit/file">
<span>2</span> <strong>Submit Your Entries</strong>
</a>
<a ng-show="CD.isDesign" ng-class="{disabled:CD.challenge.submissionDisabled || !CD.callComplete, disabledNOT:!CD.challenge.submissionDisabled}" class="btn btnAction" target="_blank"
ng-href="//studio.{{CD.domain}}/?module=ViewSubmission&ct={{CD.challenge.challengeId}}">
<span>3</span> <strong>View Your Submission</strong>
</a>
<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">
<span>3</span><strong>Review This Challenge</strong>
</a>
</div>

<div class="middleColumn member-program-path" ng-show="CD.isPeerReviewed && CD.phaseProgram">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
});
}

/**
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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',
Expand All @@ -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'
}));
}
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion wp/wp-content/themes/tcs-responsive/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down