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

Commit 115ee74

Browse files
authored
Merge pull request #480 from shubhendusaurabh/details-button-refactor
fixed topcoder-archive/appirio_tech-topcoder-app/issues/1040 refactored details page b…
2 parents b950d31 + 861bcb7 commit 115ee74

File tree

3 files changed

+170
-125
lines changed

3 files changed

+170
-125
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@
4848
]);
4949
$locationProvider.html5Mode(true);
5050
}])
51+
.config(function($compileProvider) {
52+
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|javascript):/);
53+
})
5154
.config(DataPreProcessing);
5255

5356
DataPreProcessing.$inject = ['$httpProvider', 'RestangularProvider', 'API_URL'];

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

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,10 @@
1212

1313
<div class="leftColumn">
1414
<div ng-if="!CD.isDesign">
15-
<div ng-if="CD.showAppealsButtons">
16-
<a class="btn btnAction" target="_blank" ng-href="//{{CD.reviewAppURL}}/actions/ViewProjectDetails?pid={{CD.challenge.challengeId}}">
17-
<span>1</span>
18-
<strong>View Scorecard</strong>
19-
</a>
20-
<a class="btn btnAction unregister" target="_blank" ng-href="//{{CD.reviewAppURL}}/actions/EarlyAppeals?pid={{CD.challenge.challengeId}}">
21-
<span>2</span>
22-
<strong>Complete Appeals</strong>
23-
</a>
24-
</div>
25-
<div ng-if="!CD.showAppealsButtons">
26-
<a 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:;">
27-
<span>1</span>
28-
<strong ng-hide="CD.isRegistered">
29-
Register For This Challenge
30-
</strong>
31-
<strong ng-show="CD.isRegistered">
32-
Unregister From This Challenge
33-
</strong>
34-
</a>
35-
<a ng-class="{disabled:CD.challenge.submissionDisabled || !CD.callComplete, disabledNOT:!CD.challenge.submissionDisabled}" class="btn btnAction" target="_blank"
36-
ng-href="/challenge-details/{{CD.challenge.challengeId}}/submit/?type=develop">
37-
<span>2</span><strong>Submit Your Entries</strong>
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>
3819
</a>
3920
</div>
4021
</div>

0 commit comments

Comments
 (0)