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

Commit 7ea5256

Browse files
author
Nick Litwin
committed
Add data to header
1 parent 17a6e28 commit 7ea5256

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

app/submissions/submissions.controller.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33

44
angular.module('tc.submissions').controller('SubmissionsController', SubmissionsController);
55

6-
SubmissionsController.$inject = [];
6+
SubmissionsController.$inject = ['challengeToSubmitTo'];
77

8-
function SubmissionsController() {
8+
function SubmissionsController(challengeToSubmitTo) {
99
var vm = this;
10+
vm.challengeTitle = challengeToSubmitTo.name;
11+
vm.challengeId = challengeToSubmitTo.id;
12+
vm.track = challengeToSubmitTo.track.toLowerCase();
1013

1114
activate();
1215

app/submissions/submissions.jade

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
.panel-page
22
.panel-header.flex.space-between
3-
a.panel-header__back-button.flex.space-between.middle
3+
a.panel-header__back-button.flex.space-between.middle(ng-href="https://www.{{DOMAIN}}/challenge-details/{{submissions.challengeId}}/?type={{submissions.track}}")
44

55
//- TODO: Replace below with svg tag
66
.icon-arrow
77

88
p Back
99

10-
h1.panel-header__title HPE - GMARS Topology Dashboard Design Concepts Challenge
10+
h1.panel-header__title(ng-bind="submissions.challengeTitle")
1111

1212
ui-view

app/submissions/submissions.routes.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
submissions: {
1313
parent: 'root',
1414
abstract: true,
15+
url: '/challenges/:challengeId/submit/',
1516
templateUrl: 'submissions/submissions.html',
1617
controller: 'SubmissionsController',
1718
controllerAs: 'submissions',
@@ -20,13 +21,7 @@
2021

2122
// TODO: Get title from PMs
2223
title: 'Submit'
23-
}
24-
},
25-
'submissions.file': {
26-
url: '/challenges/:challengeId/submit/?method=file',
27-
templateUrl: 'submissions/submit-file/submit-file.html',
28-
controller: 'SubmitFileController',
29-
controllerAs: 'vm',
24+
},
3025
resolve: {
3126
challengeToSubmitTo: ['ChallengeService', '$stateParams', 'UserService', function(ChallengeService, $stateParams, UserService) {
3227
// This page is only available to users that are registered to the challenge (submitter role) and the challenge is in the Checkpoint Submission or Submission phase.
@@ -38,6 +33,7 @@
3833

3934
return ChallengeService.getUserChallenges(userHandle, params)
4035
.then(function(challenge) {
36+
console.log('Challenge???? ', challenge.plain())
4137
challenge = challenge[0];
4238

4339
var isPhaseSubmission = _.some(challenge.currentPhases, {
@@ -53,6 +49,8 @@
5349
// TODO: Where do we redirect if you can't submit?
5450
alert('You should not have access to this page');
5551
}
52+
53+
return challenge;
5654
})
5755
.catch(function(err) {
5856
console.log('ERROR GETTING CHALLENGE: ', err);
@@ -61,6 +59,12 @@
6159
});
6260
}]
6361
}
62+
},
63+
'submissions.file': {
64+
url: '?method=file',
65+
templateUrl: 'submissions/submit-file/submit-file.html',
66+
controller: 'SubmitFileController',
67+
controllerAs: 'vm',
6468
}
6569
};
6670

0 commit comments

Comments
 (0)