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

Commit 18cf67c

Browse files
authored
Merge pull request #460 from shubhendusaurabh/issue-918
2 parents 0292b65 + 976612c commit 18cf67c

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,7 @@
275275
challengeName = challenge.challengeName;
276276
var reviewScorecardId = challenge.reviewScorecardId;
277277
vm.isDesign = (challengeType === 'design');
278-
vm.allowDownloads = challenge.currentPhaseName === 'Registration' || challenge.currentPhaseName === 'Submission';
279-
278+
vm.allowDownloads = challenge.currentStatus === 'Active' && challenge.currentPhaseRemainingTime > 0;
280279

281280
if ((challenge.currentPhaseName != 'Stalled' && challenge.checkpointSubmissionEndDate && challenge.checkpointSubmissionEndDate != '') || (challenge.checkpoints && challenge.checkpoints.length > 0)) {
282281
ChallengeService
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<h3>Downloads:</h3>
22
<div class="inner">
33
<ul class="downloadDocumentList">
4-
<li ng-if="CD.challenge.Documents && CD.challenge.Documents.length > 0 && CD.allowDownloads && CD.allowDownloads" ng-repeat="document in CD.challenge.Documents">
4+
<li ng-if="CD.challenge.Documents.length && CD.allowDownloads && CD.isRegistered" ng-repeat="document in CD.challenge.Documents">
55
<a ng-href="{{document.url}}">{{document.documentName}}</a>
66
</li>
7-
<li ng-if="CD.challenge.Documents && CD.challenge.Documents.length === 0 && CD.allowDownloads">
8-
<strong>None</strong>
7+
<li ng-if="CD.challenge.Documents.length && CD.allowDownloads && CD.isLoggedIn && !CD.isRegistered">
8+
<strong>Register to Download Files</strong>
99
</li>
10-
<li ng-if="!CD.allowDownloads">
11-
<strong>Downloads are no longer available for this challenge</strong>
10+
<li ng-if="CD.challenge.Documents.length && CD.allowDownloads && !CD.isLoggedIn">
11+
<strong>Log In and Register to Download Files</strong>
1212
</li>
13-
<li ng-if="!CD.challenge.Documents && CD.allowDownloads && CD.isLoggedIn && !CD.isRegistered">
14-
<strong>Register to Download Files (if available)</strong>
13+
<li ng-if="CD.challenge.Documents.length && !CD.allowDownloads">
14+
<strong>Downloads are not available for this challenge</strong>
1515
</li>
16-
<li ng-if="!CD.challenge.Documents && CD.allowDownloads && !CD.isLoggedIn">
17-
<strong>Log In and Register to Download Files <br>(if available)</strong>
16+
<li ng-if="!CD.challenge.Documents.length">
17+
<strong>None</strong>
1818
</li>
1919
</ul>
2020
</div>

0 commit comments

Comments
 (0)