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

Commit 72ea978

Browse files
author
Parth Shah
committed
Merge branch 'sup-1508-sup-1509-community-pages' into dev
2 parents 39b37e7 + cd3ae1f commit 72ea978

Some content is hidden

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

58 files changed

+1611
-20
lines changed

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: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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+
resolve: {
33+
membersData: function($http) {
34+
// TODO this needs to move to a service
35+
return $http.get('community/mock-data/members.json', {skipAuthorization: true});
36+
}
37+
}
38+
},
39+
40+
'community.statistics': {
41+
parent: 'root',
42+
url: '/community/statistics/',
43+
templateUrl: 'community/statistics.html',
44+
controller: 'StatisticsController',
45+
controllerAs: 'ctrl',
46+
data: {
47+
title: 'Community Statistics'
48+
},
49+
resolve: {
50+
statData: function($http) {
51+
// TODO this needs to move to a service
52+
return $http.get('community/mock-data/statistics.json', {skipAuthorization: true});
53+
}
54+
}
55+
},
56+
};
57+
58+
angular.forEach(states, function(state, name) {
59+
$stateProvider.state(name, state);
60+
});
61+
};
62+
})();

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 = ['membersData', '$http', 'CONSTANTS'];
7+
8+
function MembersController(membersData, $http, CONSTANTS) {
9+
10+
this.notSearch = true;
11+
this.showing = 'list';
12+
this.domain = CONSTANTS.domain;
13+
this.currentMonth = 'October 2015';
14+
this.memberLeaderboard = membersData.data.memberLeaderboard;
15+
this.copilots = membersData.data.copilots;
16+
this.search = function() {
17+
if (this.keywords) {
18+
window.location.replace('/search?s=' + this.keywords + '&scope=member');
19+
20+
//$http.get('community/mock-data/search-result.json')
21+
// .success(function(data) {
22+
// this.searchResult = data.result;
23+
// this.notSearch = false;
24+
// }.bind(this));
25+
} else {
26+
this.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+

app/community/mock-data/avatar.png

831 Bytes
Loading

app/community/mock-data/members.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"memberLeaderboard": [{
3+
"avatar": "//www.topcoder.com/wp-content/uploads/2015/05/yoki_august2015.png",
4+
"name": "yoki",
5+
"contestType": "Design",
6+
"description": "Won $3,800 in design challenges.",
7+
"class": "design"
8+
}, {
9+
"avatar": "//www.topcoder.com/wp-content/uploads/2015/05/ultronzero_august2015.png",
10+
"name": "ultronzero",
11+
"contestType": "Software",
12+
"description": "Won $6750 in development challenges.",
13+
"class": "develop"
14+
}, {
15+
"avatar": "//www.topcoder.com/wp-content/uploads/2015/05/lowsfish_august2015.png",
16+
"name": "lowsfish",
17+
"contestType": "Data Science",
18+
"description": "Rating increased in both SRMs & advanced from Div 2 to Div 1.",
19+
"class": "data-science"
20+
}],
21+
"copilots": [{
22+
"avatar": "//community.topcoder.com/i/m/maroosh.jpeg",
23+
"name": "maroosh",
24+
"country": "Jordan"
25+
}, {
26+
"avatar": "//community.topcoder.com/i/m/elkhawajah.jpeg",
27+
"name": "elkhawajah",
28+
"country": "Jordan"
29+
}, {
30+
"avatar": "//community.topcoder.com/i/m/hohosky.png",
31+
"name": "hohosky",
32+
"country": "China"
33+
}, {
34+
"avatar": "//community.topcoder.com/i/m/Wendell.jpeg",
35+
"name": "Wendell",
36+
"country": "China"
37+
}, {
38+
"avatar": "//community.topcoder.com/i/m/callmekatootie.jpeg",
39+
"name": "callmekatootie",
40+
"country": "India"
41+
}, {
42+
"avatar": "//community.topcoder.com/i/m/iSpartan.jpeg",
43+
"name": "iSpartan",
44+
"country": "United States"
45+
}]
46+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"result": [{
3+
"avatar": "community/mock-data/avatar.png",
4+
"name": "ilesmana",
5+
"country": "Indonesia"
6+
}, {
7+
"avatar": "community/mock-data/avatar.png",
8+
"name": "utamidwi",
9+
"country": "Indonesia"
10+
}, {
11+
"avatar": "community/mock-data/avatar.png",
12+
"name": "janedoe",
13+
"country": "Brazil"
14+
}, {
15+
"avatar": "community/mock-data/avatar.png",
16+
"name": "freeyourself",
17+
"country": "Chile"
18+
}, {
19+
"avatar": "community/mock-data/avatar.png",
20+
"name": "buureen",
21+
"country": "Venezuela"
22+
}, {
23+
"avatar": "community/mock-data/avatar.png",
24+
"name": "mariaja",
25+
"country": "Malaysia"
26+
}, {
27+
"avatar": "community/mock-data/avatar.png",
28+
"name": "ilesmana",
29+
"country": "Indonesia"
30+
}, {
31+
"avatar": "community/mock-data/avatar.png",
32+
"name": "afputra",
33+
"country": "Indonesia"
34+
}, {
35+
"avatar": "community/mock-data/avatar.png",
36+
"name": "janedoe",
37+
"country": "Brazil"
38+
}, {
39+
"avatar": "community/mock-data/avatar.png",
40+
"name": "freeyourself",
41+
"country": "Chile"
42+
}, {
43+
"avatar": "community/mock-data/avatar.png",
44+
"name": "buureen",
45+
"country": "Venezuela"
46+
}, {
47+
"avatar": "community/mock-data/avatar.png",
48+
"name": "mariaja",
49+
"country": "Malaysia"
50+
}]
51+
}

0 commit comments

Comments
 (0)