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

Commit db612d1

Browse files
author
Parth Shah
committed
Merge branch 'dev' of github.com:appirio-tech/topcoder-app into dev
2 parents 0b53b52 + 5789afa commit db612d1

File tree

10 files changed

+36
-14
lines changed

10 files changed

+36
-14
lines changed

app/directives/profile-widget/profile-widget.directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
scope: {
1111
profile: '=profile',
1212
editProfileLink: '=editProfileLink',
13-
numChallenges: '=numChallenges',
13+
numWins: '=numWins',
1414
profileVm: '=profileVm'
1515
},
1616
link: function(scope, elem, attrs) {

app/directives/profile-widget/profile-widget.jade

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
| Member Since {{profile.startMonth}}
1111

1212
h3.location-challenges {{profile.homeCountryCode | isoCountry}}
13-
span.bar(ng-show="profile.homeCountryCode && numChallenges")  | 
14-
span(ng-show="numChallenges") {{numChallenges}} Challenges
13+
span.bar(ng-show="profile.homeCountryCode && numWins")  | 
14+
span(ng-show="numWins") {{numWins}} Wins
1515

1616
p.description {{profile.description}}
1717

app/index.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ html
8181
8282
body(ng-app="topcoder", ng-controller="TopcoderController as main", ng-class="{'menu-visible': main.menuVisible}", ng-strict-di)
8383

84-
#header(ui-view="header")
84+
#header(ui-view="header", autoscroll="true")
8585

8686
.intro-js-container(ng-intro-options="main.introOptions", ng-intro-method="main.startIntro")
8787

app/my-dashboard/my-dashboard.controller.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,35 @@
33

44
angular.module('tc.myDashboard').controller('MyDashboardController', MyDashboardController);
55

6-
MyDashboardController.$inject = ['userIdentity'];
6+
MyDashboardController.$inject = ['userIdentity', 'ProfileService', '$log'];
77

8-
function MyDashboardController(userIdentity) {
8+
function MyDashboardController(userIdentity, ProfileService, $log) {
99
var vm = this;
1010

1111
activate();
1212

1313
function activate() {
14+
vm.showSRMs = false;
1415
vm.isCopilot = _.includes(userIdentity.roles, 'copilot');
16+
17+
displaySRMsBasedOnTrack();
18+
}
19+
20+
function displaySRMsBasedOnTrack() {
21+
ProfileService.getUserProfile(userIdentity.handle)
22+
.then(function(userProfile) {
23+
var isDesigner = _.includes(userProfile.tracks, 'DESIGN');
24+
25+
if (isDesigner && userProfile.tracks.length === 1) {
26+
vm.showSRMs = false;
27+
} else {
28+
vm.showSRMs = true;
29+
}
30+
})
31+
.catch(function(err) {
32+
vm.showSRMs = false;
33+
$log.error(err);
34+
})
1535
}
1636
}
1737
})();

app/my-dashboard/my-dashboard.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
.my-challenges(id="challenges", ui-view="my-challenges")
77

8-
.srms(id="srms", ui-view="srms")
8+
.srms(id="srms", ui-view="srms", ng-show="dashboard.showSRMs")
99

1010
.programs(id="community", ui-view="programs")
1111

app/profile/about/about.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.profile-header-container(ng-cloak)
2-
profile-widget(profile="profileVm.profile", edit-profile-link="profileVm.showEditProfileLink", num-challenges="profileVm.numProjects", profile-vm="profileVm")
2+
profile-widget(profile="profileVm.profile", edit-profile-link="profileVm.showEditProfileLink", num-wins="profileVm.numWins", profile-vm="profileVm")
33

44
.profile-about-container
55

app/profile/profile.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
.profile-container
2-
ui-view(ng-cloak, autoscroll="true")
2+
ui-view(ng-cloak)

app/profile/subtrack/develop/develop.jade

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
span.square(ng-if="vm.typeStats.rank.rating", style="background-color: {{vm.typeStats.rank.rating | ratingColor}}")
77
.name RATING
88

9-
li.stat(ng-if="!vm.typeStats.rank.rating")
9+
li.stat(ng-if="!vm.typeStats.rank.rating && !vm.nonRated")
1010
.value -
1111
.name RATING
1212

13-
li.stat
13+
li.stat(ng-hide="vm.nonRated")
1414
.value {{vm.typeStats.rank.overallRank | empty}}
1515
.name RANK
1616

17-
li.stat
17+
li.stat(ng-hide="vm.nonRated")
1818
.value {{vm.typeStats.rank.overallPercentile / 100 | percentage | empty}}
1919
.name PERCENTILE
2020

@@ -26,7 +26,7 @@
2626
.value {{vm.typeStats.wins | empty}}
2727
.name WINS
2828

29-
li.stat
29+
li.stat(ng-hide="vm.nonRated")
3030
.value {{vm.typeStats.rank.reliability | percentage | empty}}
3131
.name RELIABILITY
3232

app/profile/subtrack/subtrack.controller.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@
7676
vm.subTrack.toLowerCase().replace(/ /g, '')
7777
);
7878

79+
vm.nonRated = !vm.typeStats.rank.rating && !vm.typeStats.rank.overallRank && !vm.typeStats.rank.reliability;
80+
7981
if (vm.subTrack) {
8082
vm.dropdown = ProfileService.getSubTracks(profileVm.stats, vm.track.toLowerCase())
8183
.map(function(subtrack) {

app/settings/edit-profile/edit-profile.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
.bio
3939
.form-label short bio
4040
span(style="float:right;") {{vm.userData.description.length || 0}}/144
41-
textarea.form-field(name="description", ng-model="vm.userData.description", maxlength="144")
41+
textarea.form-field(name="description", ng-model="vm.userData.description", data-ng-trim="false", maxlength="144")
4242

4343
.settings-section.tracks
4444
.section-info

0 commit comments

Comments
 (0)