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

Commit 7e3e06b

Browse files
author
vikasrohit
committed
Merge branch 'dev' into feature/empty-state-directive
* dev: (27 commits) attempting to clean up community app, moving data to a service refactoring controller & adding default view for /community reading link domain from config, refactoring api to skipAuthorization updating version Added link for recent SRM color changes SUP-2257, Problem Archive link under SRM section should go to https://arena.topcoder.com/#/u/practiceProblemList. SUP-2260, Forum Posts link on profile is wrong URL. Should use apps.topcoder.com/forums as the base SUP-2245, Dashboard--> Practice on past problems card is 2 pixel less in length. SUP-2232, Dashboard--> Lean more link path is not correct. fixing social registration problem Fixed some labels members / statistic page updates, read top ranks from API added "Get Started" link to main navigation Added sitemap links fixing test Renamed Tops Added review board session and wired up member search to existing search page. Sitemap updating v3 endpoint Added static content and links for members page ... Conflicts: app/index.jade
2 parents 2d07ac5 + d1b49da commit 7e3e06b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1802
-21
lines changed

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.0.7
1+
v1.0.8

app/account/register/register.controller.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,21 @@
9898

9999
vm.socialRegister = function(provider) {
100100
TcAuthService.socialRegistration(provider, null)
101-
.then(function(socialData) {
102-
vm.socialUserId = socialData.socialUserId;
103-
vm.username = socialData.username;
104-
vm.firstname = socialData.firstname;
105-
vm.lastname = socialData.lastname;
106-
vm.email = socialData.email;
107-
vm.isSocialRegistration = true;
108-
vm.socialProfile = socialData.socialProfile;
109-
vm.socialProvider = socialData.socialProvider;
110-
vm.socialContext.accessToken = socialData.socialaccessToken;
101+
.then(function(resp) {
102+
if (resp.status === 'SUCCESS') {
103+
var socialData = resp.data;
104+
vm.socialUserId = socialData.socialUserId;
105+
vm.username = socialData.username;
106+
vm.firstname = socialData.firstname;
107+
vm.lastname = socialData.lastname;
108+
vm.email = socialData.email;
109+
vm.socialProfile = socialData.socialProfile;
110+
vm.socialProvider = socialData.socialProvider;
111+
vm.socialContext= {'accessToken': socialData.accessToken};
112+
vm.isSocialRegistration = true;
113+
} else {
114+
vm.isSocialRegistration = false;
115+
}
111116
})
112117
.catch(function(result) {
113118
switch (result.status) {

app/community/community.controller.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
(function() {
2+
'use strict';
3+
angular.module('tc.community').controller('BaseCommunityController', BaseCommunityController);
4+
5+
BaseCommunityController.$inject = ['$state'];
6+
7+
function BaseCommunityController($state) {
8+
9+
// provide default redirect to a child state
10+
if ($state.$current.name === 'community') {
11+
$state.go('community.members');
12+
}
13+
}
14+
})();
15+
16+

app/community/community.module.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
(function() {
2+
'use strict';
3+
4+
var dependencies = [
5+
'ui.router',
6+
'tc.services',
7+
'tcUIComponents',
8+
'toaster'
9+
];
10+
11+
angular.module('tc.community', dependencies);
12+
13+
})();

app/community/community.routes.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
(function() {
2+
'use strict';
3+
4+
angular.module('tc.community').config([
5+
'$stateProvider',
6+
'$urlRouterProvider',
7+
'$locationProvider',
8+
routes
9+
]);
10+
11+
function routes($stateProvider, $urlRouterProvider, $locationProvider) {
12+
$locationProvider.html5Mode(true);
13+
var states = {
14+
'community': {
15+
parent: 'root',
16+
url: '/community/',
17+
data: {
18+
authRequired: false,
19+
},
20+
controller: 'BaseCommunityController'
21+
},
22+
'community.members': {
23+
parent: 'root',
24+
url: '/community/members/',
25+
templateUrl: 'community/members.html',
26+
controller: 'MembersController',
27+
controllerAs: 'ctrl',
28+
data: {
29+
authRequired: false,
30+
title: 'Community Members'
31+
}
32+
},
33+
34+
'community.statistics': {
35+
parent: 'root',
36+
url: '/community/statistics/',
37+
templateUrl: 'community/statistics.html',
38+
controller: 'StatisticsController',
39+
controllerAs: 'ctrl',
40+
data: {
41+
title: 'Community Statistics'
42+
}
43+
}
44+
};
45+
46+
angular.forEach(states, function(state, name) {
47+
$stateProvider.state(name, state);
48+
});
49+
};
50+
})();

app/community/members.controller.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
(function() {
2+
'use strict';
3+
4+
angular.module('tc.community').controller('MembersController', MembersController);
5+
6+
MembersController.$inject = ['CommunityDataService', 'CONSTANTS'];
7+
8+
function MembersController(CommunityDataService, CONSTANTS) {
9+
var ctrl = this;
10+
ctrl.notSearch = true;
11+
ctrl.showing = 'list';
12+
ctrl.domain = CONSTANTS.domain;
13+
ctrl.currentMonth = 'October 2015';
14+
ctrl.memberLeaderboard = [];
15+
ctrl.copilots = [];
16+
CommunityDataService.getMembersData()
17+
.then(function(data) {
18+
ctrl.memberLeaderboard = data.memberLeaderboard;
19+
ctrl.copilots = data.copilots;
20+
});
21+
22+
ctrl.search = function() {
23+
if (ctrl.keywords) {
24+
window.location.replace('/search?s=' + ctrl.keywords + '&scope=member');
25+
} else {
26+
ctrl.notSearch = true;
27+
}
28+
};
29+
}
30+
31+
})();

app/community/members.jade

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
.community-view
2+
.header-community
3+
header
4+
h1 Members
5+
6+
.members-container
7+
.search-container
8+
form(name="searchForm", role="form", ng-submit="ctrl.search()", novalidate)
9+
input(ng-model="ctrl.keywords", name="keywords", placeholder="find people", type="text", required)
10+
input(type="submit" name="search-btn" value="").search-ico
11+
12+
.default-show-container(ng-show="ctrl.notSearch")
13+
.members-of-month-container
14+
h2 Members of the Month
15+
small {{ctrl.currentMonth}}
16+
.members-wrapper
17+
.user-tile(ng-repeat="item in ctrl.memberLeaderboard")
18+
.avatar-wrapper: img(ng-src="{{item.avatar}}")
19+
.user-name {{item.name}}
20+
.user-tag(class="{{item.class}}") {{item.contestType}}
21+
p.user-desc {{item.description}}
22+
a(ng-href="//www.{{ctrl.domain}}/community/member-programs/topcoder-member-of-the-month/", target="_blank").user-more Read the story
23+
p.member-congratulation Congratulations to all the members of the month!
24+
25+
.reviewboard-container
26+
h2 Review Boards
27+
.content-wrapper
28+
.col
29+
.link: a(ng-href="//www.{{ctrl.domain}}/tc?module=ReviewBoard&pt=23", target="_blank") Conceptualization
30+
.link: a(ng-href="//www.{{ctrl.domain}}/tc?module=ReviewBoard&pt=6", target="_blank") Specification
31+
.link: a(ng-href="//www.{{ctrl.domain}}/tc?module=ReviewBoard&pt=7", target="_blank") Architecture
32+
.link: a(ng-href="//www.{{ctrl.domain}}/tc?module=ReviewBoard&pt=1", target="_blank") Component Design
33+
.link: a(ng-href="//www.{{ctrl.domain}}/tc?module=ReviewBoard&pt=2", target="_blank") Component Development
34+
.col
35+
.link: a(ng-href="//www.{{ctrl.domain}}/tc?module=ReviewBoard&pt=14", target="_blank") Assembly
36+
.link: a(ng-href="//www.{{ctrl.domain}}/tc?module=ReviewBoard&pt=38", target="_blank") First2Finish
37+
.link: a(ng-href="//www.{{ctrl.domain}}/tc?module=ReviewBoard&pt=39", target="_blank") Code
38+
.link: a(ng-href="//www.{{ctrl.domain}}/tc?module=ReviewBoard&pt=13", target="_blank") Test Suites
39+
.link: a(ng-href="//www.{{ctrl.domain}}/tc?module=ReviewBoard&pt=36", target="_blank") Report
40+
.col
41+
.link: a(ng-href="//www.{{ctrl.domain}}/tc?module=ReviewBoard&pt=19", target="_blank") UI prototype
42+
.link: a(ng-href="//www.{{ctrl.domain}}/tc?module=ReviewBoard&pt=24", target="_blank") RIA Build
43+
.link: a(ng-href="//www.{{ctrl.domain}}/tc?module=ReviewBoard&pt=35", target="_blank") Content Creation
44+
.link: a(ng-href="//www.{{ctrl.domain}}/tc?module=ReviewBoard&pt=26", target="_blank") Test Scenarios
45+
.link: a(ng-href="//www.{{ctrl.domain}}/tc?module=ReviewBoard&pt=9", target="_blank") Bug Hunt
46+
47+
48+
.copilots-container
49+
h2 Copilots
50+
.copilots-wrapper
51+
.user-tile(ng-repeat="item in ctrl.copilots")
52+
.avatar-wrapper: img(ng-src="{{item.avatar}}")
53+
.user-name {{item.name}}
54+
.user-country {{item.country}}
55+
.btn-wrapper
56+
a(ng-href="//community.{{ctrl.domain}}/tc?module=ViewCopilotPool&size=20&view=0&sort=12", target="_blank").blue-btn View all copilots
57+
58+
59+
.search-result-container(ng-hide="ctrl.notSearch")
60+
h2 Search Result For:
61+
span "{{ctrl.keywords}}"
62+
.showing-controll-wrapper
63+
ul
64+
li
65+
input(type="radio" ng-model="ctrl.showing" value="grid" name="showing")#member-showing-grid
66+
label(for="member-showing-grid").grid-lbl grid
67+
li
68+
input(type="radio" ng-model="ctrl.showing" value="list" name="showing")#member-showing-list
69+
label(for="member-showing-list").list-lbl list
70+
.results-wrapper(ng-class="{'show-grid': ctrl.showing=='grid'}")
71+
.user-tile(ng-repeat="item in ctrl.searchResult")
72+
.avatar-wrapper: img(ng-src="{{item.avatar}}")
73+
.text-content
74+
.user-name {{item.name}}
75+
.user-country {{item.country}}
76+
a.user-more View Profile
77+
.btn-wrapper
78+
a.gray-btn Load More
79+
80+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
(function() {
2+
'use strict';
3+
4+
angular.module('tc.community').controller('StatisticsController', StatisticsController);
5+
6+
StatisticsController.$inject = ['CommunityDataService', 'StatisticsService', 'CONSTANTS'];
7+
8+
function StatisticsController(CommunityDataService, StatisticsService, CONSTANTS) {
9+
var statsData = this;
10+
statsData.domain = CONSTANTS.domain;
11+
statsData.SRMWinners = [];
12+
statsData.MarathonWinner = [];
13+
statsData.TopPerformers = [];
14+
15+
CommunityDataService.getStatisticsData()
16+
.then(function(data) {
17+
statsData.SRMWinners = data.SRMWinners;
18+
statsData.MarathonWinner = data.MarathonWinner;
19+
});
20+
21+
StatisticsService.getDesignTop(10).then(function(data) {
22+
statsData.TopPerformers.push({
23+
"contestType": "Design",
24+
"class": "design",
25+
"dataType": "Wins",
26+
"performers": data.plain().data
27+
});
28+
});
29+
30+
StatisticsService.getDevTop(10).then(function(data) {
31+
statsData.TopPerformers.push({
32+
"contestType": "Development",
33+
"class": "develop",
34+
"dataType": "Rating",
35+
"performers": data.plain().data
36+
});
37+
});
38+
39+
StatisticsService.getDataTop(10).then(function(data) {
40+
statsData.TopPerformers.push({
41+
"contestType": "Competitive Programming",
42+
"class": "data-science",
43+
"dataType": "Rating",
44+
"performers": data.plain().data
45+
});
46+
});
47+
}
48+
})();

app/community/statistics.jade

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
.community-view
2+
.header-community
3+
header
4+
h1 Statistics
5+
6+
.statistics-container
7+
.winner-container
8+
.SRM-winner-container
9+
h2 Recent SRM Winners
10+
.tile-wrapper
11+
.winner-tile(ng-repeat="item in ctrl.SRMWinners")
12+
.avatar-wrapper: img(ng-src="{{item.avatar}}")
13+
.text-content
14+
p
15+
span.winner-name {{item.name}}
16+
span.winning-date {{item.date | date: 'dd MMM yyyy'}}
17+
p.winner-country {{item.country}}
18+
.contests
19+
p(ng-repeat="contest in item.contests") {{contest}}
20+
.btn-wrapper: a(ng-href="//community.{{ctrl.domain}}/tc?module=SrmDivisionWins", target="_blank").outlined-btn View All
21+
22+
23+
.MM-winner-container
24+
h2 Recent Marathon Match Winners
25+
.tile-wrapper
26+
.winner-tile(ng-repeat="item in ctrl.MarathonWinner")
27+
.avatar-wrapper: img(ng-src="{{item.avatar}}")
28+
.text-content
29+
p
30+
span.winner-name {{item.name}}
31+
span.winning-date {{item.date | date: 'dd MMM yyyy'}}
32+
p.winner-country {{item.country}}
33+
.contests
34+
p(ng-repeat="contest in item.contests") {{contest}}
35+
.btn-wrapper: a(ng-href="//community.{{ctrl.domain}}/longcontest/stats/?module=MatchWinners", target="_blank").outlined-btn View All
36+
37+
.top-performers-container
38+
h2 Top Performers
39+
.performers-container
40+
.performer-wrapper(ng-repeat="item in ctrl.TopPerformers")
41+
h3 {{item.contestType}}
42+
table
43+
thead(class="{{item.class}}")
44+
tr
45+
th #
46+
th Handle
47+
th {{item.dataType}}
48+
tbody
49+
tr(ng-repeat="user in item.performers track by $index", ng-class="{even: $even}")
50+
td {{$index + 1}}
51+
td {{user.handle}}
52+
td {{user.rating}}
53+
54+
.tops-container
55+
h2 Top Ranked
56+
.content-wrapper
57+
.col
58+
.link: a(ng-href="//community.{{ctrl.domain}}/tc?module=AlgoRank", target="_blank") Algorithm
59+
.link: a(ng-href="//www.{{ctrl.domain}}/longcontest/stats/?module=CoderRank", target="_blank") Marathon
60+
.link: a(ng-href="//www.{{ctrl.domain}}/stat?c=top_conceptors", target="_blank") Conceptualization
61+
.col
62+
.link: a(ng-href="//www.{{ctrl.domain}}/stat?c=top_specificators", target="_blank") Specification
63+
.link: a(ng-href="//www.{{ctrl.domain}}/stat?c=top_architects", target="_blank") Architecture
64+
.link: a(ng-href="//www.{{ctrl.domain}}/stat?c=top_designers", target="_blank") Component Design
65+
.col
66+
.link: a(ng-href="//www.{{ctrl.domain}}/stat?c=top_developers", target="_blank") Component Development
67+
.link: a(ng-href="//www.{{ctrl.domain}}/stat?c=top_assemblers", target="_blank") Assembly
68+
.link: a(ng-href="//www.{{ctrl.domain}}/stat?c=top_testers", target="_blank") Test Suites
69+
70+
.record-books-container
71+
h2 Record Books
72+
.content-wrapper
73+
.col
74+
.link: a(ng-href="//www.{{ctrl.domain}}/tc?module=Static&d1=statistics&d2=recordbook_home", target="_blank") Algorithm
75+
.link: a(ng-href="//community.{{ctrl.domain}}/tc?module=ColorChange&ratid=1", target="_blank") Recent SRM Color Changes
76+
.col
77+
.link: a(ng-href="//www.{{ctrl.domain}}/longcontest/?module=Static&d1=stats&d2=recordbook_home", target="_blank") Marathon
78+
79+
.col
80+
.link: a(ng-href="//www.{{ctrl.domain}}/tc?module=Static&d1=compstats&d2=comp_recordbook_home", target="_blank") Component
81+

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@
2727
.links
2828
a.badges.link(ng-click="profileVm.showBadges()", ng-show="profileVm.profile.badges.Achievements.length > 0")
2929
| Badges
30-
a.forums.link(ng-href="http://forums.{{DOMAIN}}/?module=History&userID={{profileVm.profile.userId}}")
30+
a.forums.link(ng-href="https://apps.{{DOMAIN}}/forums/?module=History&userID={{profileVm.profile.userId}}")
3131
| Forum Posts

0 commit comments

Comments
 (0)