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

Commit 25bac9e

Browse files
committed
Added basic nav
1 parent 09ba68c commit 25bac9e

File tree

5 files changed

+223
-3
lines changed

5 files changed

+223
-3
lines changed

app/profile/profile.controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
vm.statsPromise = ProfileService.getUserStats(vm.userHandle).then(function(stats) {
3838
vm.stats = stats;
3939
vm.profile.tracks = vm.profile.tracks || ProfileService.getTracks(vm.stats) || [];
40-
if (stats.COPILOT && stats.COPILOT.contests) {
40+
if (stats.COPILOT && stats.COPILOT.contests && vm.profile.tracks.indexOf('COPILOT') == -1) {
4141
vm.profile.tracks.push('COPILOT');
4242
}
4343
vm.numProjects = vm.stats.challenges;

app/profile/subtrack/nav.jade

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
.categoryNav
2+
.track(
3+
ng-repeat="track in vm.profile.tracks",
4+
ng-if="vm.categories[track].length > 0"
5+
)
6+
7+
div(class="name")
8+
img(ng-if="track == 'DATA_SCIENCE'", src="/images/ico-track-data-outline.svg")
9+
img(ng-if="track == 'DEVELOP'", src="/images/ico-track-develop-outline.svg")
10+
img(ng-if="track == 'DESIGN'", src="/images/ico-track-design-outline.svg")
11+
img(ng-if="track == 'COPILOT'", src="/images/ico-track-co_pilot-outline.svg")
12+
span {{track | track | uppercase}}
13+
14+
.subtrack(
15+
ng-repeat="subtrack in vm.categories[track]",
16+
ui-sref="profile.subtrack({track: subtrack.track, subTrack: subtrack.subTrack})",
17+
class="{{$index == 0 && 'first'}}"
18+
)
19+
.name {{subtrack.subTrack | track}}
20+
21+
.ranking(ng-if="subtrack.rating")
22+
.number.rating
23+
| {{subtrack.rating}}
24+
span.square(style="background-color: {{subtrack.rating | ratingColor}}")
25+
26+
.tag Rating
27+
28+
.ranking(ng-if="subtrack.rank && !subtrack.rating")
29+
.number {{subtrack.rank | ordinal}}
30+
31+
.tag Ranking
32+
33+
.ranking(ng-if="subtrack.wins && !subtrack.rank && !subtrack.rating")
34+
.number {{subtrack.wins}}
35+
36+
.tag Wins
37+
38+
.ranking(ng-if="subtrack.fulfillment")
39+
.number {{subtrack.fulfillment + '%'}}
40+
41+
.tag Fulfillment
42+
43+
img.arrow(src="/images/ico-arrow-big-right.svg")
44+
45+

app/profile/subtrack/subtrack.controller.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
.module('tc.profile')
55
.controller('ProfileSubtrackController', ProfileSubtrackController);
66

7-
ProfileSubtrackController.$inject = ['$scope', 'ProfileService', '$q', '$stateParams', 'ChallengeService', 'CONSTANTS', '$state', '$window', 'userHandle'];
7+
ProfileSubtrackController.$inject = ['$scope', 'ProfileService', '$q', '$stateParams', 'ChallengeService', 'CONSTANTS', '$state', '$window', 'ngDialog'];
88

9-
function ProfileSubtrackController($scope, ProfileService, $q, $stateParams, ChallengeService, CONSTANTS, $state, $window) {
9+
function ProfileSubtrackController($scope, ProfileService, $q, $stateParams, ChallengeService, CONSTANTS, $state, $window, ngDialog) {
1010
var vm = this;
1111
vm.graphState = { show: 'history' };
1212
vm.subTrack = decodeURIComponent($stateParams.subTrack || '') || '';
@@ -20,6 +20,7 @@
2020
vm.ddSelected = {};
2121
vm.distribution = {};
2222
vm.selectSubTrack = selectSubTrack;
23+
vm.showNav = showNav;
2324
vm.back = back;
2425
vm.status = {
2526
'challenges': CONSTANTS.STATE_LOADING
@@ -131,6 +132,25 @@
131132
});
132133
}
133134

135+
function showNav() {
136+
console.log('dialog')
137+
console.log(ngDialog)
138+
ngDialog.open({
139+
template: 'profile/subtrack/nav.html',
140+
controller: 'ProfileCtrl',
141+
controllerAs: 'vm',
142+
className: 'ngdialog-theme-default',
143+
resolve: {
144+
userHandle: function() {
145+
return vm.userHandle;
146+
},
147+
profile: function() {
148+
return profileVm.profile;
149+
}
150+
}
151+
});
152+
}
153+
134154
}
135155

136156

app/profile/subtrack/subtrack.jade

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
.subtrack // {{vm.subTrack | track}}
1515

1616
.right
17+
i(class="fa fa-th", ng-click="vm.showNav()")
1718

1819
include ./develop/develop.jade
1920
include ./design/design.jade

assets/css/profile/subtrack.scss

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@
2020
}
2121
.right {
2222
width: 15px;
23+
margin-right: 50px;
24+
i {
25+
color: #a3a3ae;
26+
font-size: 19px;
27+
cursor: pointer;
28+
&:hover {
29+
color: black;
30+
}
31+
}
2332
}
2433
.breadcrumbs {
2534
font-family: 'Sofia Pro';
@@ -491,3 +500,148 @@
491500
}
492501
}
493502
}
503+
.categoryNav {
504+
background: white;
505+
@include module-l;
506+
margin-left: auto;
507+
margin-right: auto;
508+
align-self: center;
509+
background: white;
510+
display: flex;
511+
flex-direction: column;
512+
justify-content: space-between;
513+
align-items: center;
514+
.track {
515+
margin-top: 22.4px;
516+
display: flex;
517+
flex-direction: column;
518+
align-items: center;
519+
cursor: pointer;
520+
521+
.name {
522+
span {
523+
}
524+
margin: auto;
525+
font-family: 'Sofia Pro';
526+
font-weight: 200;
527+
font-size: 20px;
528+
line-height: 24px;
529+
margin-bottom: 10.6px;
530+
}
531+
img {
532+
height: 20px;
533+
width: 20px;
534+
margin-right: 7px;
535+
margin-bottom: -2px;
536+
}
537+
.subtrack {
538+
display: flex;
539+
flex-direction: row;
540+
justify-content: space-between;
541+
align-items: center;
542+
width: 300px;
543+
height: 52px;
544+
border-bottom: 1px solid #f0f0f0;
545+
&.first {
546+
border-top: 1px solid #f0f0f0;
547+
}
548+
&:hover {
549+
background-color: #f0f0f0;
550+
}
551+
.name {
552+
margin-left: 25px;
553+
align-self: center;
554+
flex-basis: 250px;
555+
align-text: left;
556+
overflow: hidden;
557+
text-overflow: ellipsis;
558+
white-space: nowrap;
559+
font-family: 'Sofia Pro';
560+
font-size: 14px;
561+
line-height: 18px;
562+
font-weight: 300;
563+
text-transform: uppercase;
564+
display: flex;
565+
flex-direction: row;
566+
justify-content: flex-start;
567+
margin-top: 12px;
568+
span {
569+
}
570+
}
571+
.ranking {
572+
margin: auto;
573+
margin-right: 15px;
574+
color: #7f7f7f;
575+
.number {
576+
text-align: center;
577+
font-family: 'Sofia Pro';
578+
font-size: 13.4px;
579+
line-height: 16px;
580+
font-weight: 600;
581+
span.square {
582+
position: absolute;
583+
margin-left: 5px;
584+
width: 6px;
585+
height: 6px;
586+
}
587+
}
588+
.tag {
589+
text-transform: uppercase;
590+
margin: 10px auto 0px auto;
591+
font-family: 'Sofia Pro';
592+
font-size: 8.4px;
593+
line-height: 10px;
594+
color: #7f7f7f;
595+
font-weight: normal;
596+
}
597+
}
598+
.arrow {
599+
font-family: 'Sofia Pro';
600+
font-weight: 200;
601+
color: #cccccc;
602+
font-size: 18px;
603+
display: flex;
604+
flex-direction: column;
605+
justify-content: center;
606+
}
607+
}
608+
.icon {
609+
width: 80px;
610+
height: 80px;
611+
margin: auto;
612+
}
613+
614+
}
615+
.empty-state {
616+
display: flex;
617+
flex-direction: column;
618+
align-items: center;
619+
.action-text {
620+
margin-top: 32px;
621+
font-family: 'Sofia Pro';
622+
font-size: 18px;
623+
line-height: 24px;
624+
font-weight: 200;
625+
}
626+
.tracks {
627+
display: flex;
628+
flex-direction: row;
629+
justify-content: space-between;
630+
width: 50%;
631+
.track {
632+
}
633+
}
634+
.description {
635+
margin-top: 50px;
636+
font-family: 'Source Sans Pro';
637+
font-size: 15px;
638+
line-height: 22px;
639+
width: 60%;
640+
}
641+
button.link-button {
642+
@include button-1-l;
643+
margin-top: 20px;
644+
}
645+
padding-bottom: 40px;
646+
}
647+
}

0 commit comments

Comments
 (0)