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

Commit 1b33424

Browse files
committed
include submission from ui challenge
1 parent c64bb15 commit 1b33424

15 files changed

+1325
-4
lines changed

app/community/community.routes.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,27 @@
2323
'community.members': {
2424
parent: 'root',
2525
url: '/community/members/',
26-
templateUrl: 'community/members.html'
26+
templateUrl: 'community/members.html',
27+
controller: 'MembersController',
28+
controllerAs: 'ctrl',
29+
resolve: {
30+
membersData: function($http) {
31+
return $http.get('community/mock-data/members.json');
32+
}
33+
}
2734
},
2835

2936
'community.statistics': {
3037
parent: 'root',
3138
url: '/community/statistics/',
32-
templateUrl: 'community/statistics.html'
39+
templateUrl: 'community/statistics.html',
40+
controller: 'StatisticsController',
41+
controllerAs: 'ctrl',
42+
resolve: {
43+
statData: function($http) {
44+
return $http.get('community/mock-data/statistics.json');
45+
}
46+
}
3347
},
3448
};
3549

app/community/members.controller.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
(function() {
2+
'use strict';
3+
4+
angular.module('tc.community').controller('MembersController', MembersController);
5+
6+
MembersController.$inject = ['membersData', '$http'];
7+
8+
function MembersController(membersData, $http) {
9+
this.notSearch = true;
10+
this.showing = 'list';
11+
this.currentMonth = 'September 2015';
12+
this.memberLeaderboard = membersData.data.memberLeaderboard;
13+
this.copilots = membersData.data.copilots;
14+
this.search = function() {
15+
if (this.keywords) {
16+
$http.get('community/mock-data/search-result.json')
17+
.success(function(data) {
18+
this.searchResult = data.result;
19+
this.notSearch = false;
20+
}.bind(this));
21+
} else {
22+
this.notSearch = true;
23+
}
24+
};
25+
}
26+
})();

app/community/members.jade

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,56 @@
1-
span members page placeholder
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="Search member here...", 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.user-more Read the story
23+
p.member-congratulation Congratulations for all member of the month, win prize each
24+
25+
.copilots-container
26+
h2 Copilots
27+
.copilots-wrapper
28+
.user-tile(ng-repeat="item in ctrl.copilots")
29+
.avatar-wrapper: img(ng-src="{{item.avatar}}")
30+
.user-name {{item.name}}
31+
.user-country {{item.country}}
32+
.btn-wrapper
33+
a.blue-btn View all copilots
34+
35+
.search-result-container(ng-hide="ctrl.notSearch")
36+
h2 Search Result For:
37+
span "{{ctrl.keywords}}"
38+
.showing-controll-wrapper
39+
ul
40+
li
41+
input(type="radio" ng-model="ctrl.showing" value="grid" name="showing")#member-showing-grid
42+
label(for="member-showing-grid").grid-lbl grid
43+
li
44+
input(type="radio" ng-model="ctrl.showing" value="list" name="showing")#member-showing-list
45+
label(for="member-showing-list").list-lbl list
46+
.results-wrapper(ng-class="{'show-grid': ctrl.showing=='grid'}")
47+
.user-tile(ng-repeat="item in ctrl.searchResult")
48+
.avatar-wrapper: img(ng-src="{{item.avatar}}")
49+
.text-content
50+
.user-name {{item.name}}
51+
.user-country {{item.country}}
52+
a.user-more View Profile
53+
.btn-wrapper
54+
a.gray-btn Load More
55+
56+

app/community/mock-data/avatar.png

831 Bytes
Loading

app/community/mock-data/members.json

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"memberLeaderboard": [{
3+
"avatar": "community/mock-data/avatar.png",
4+
"name": "ilesmana",
5+
"contestType": "Design",
6+
"description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s.",
7+
"class": "design"
8+
}, {
9+
"avatar": "community/mock-data/avatar.png",
10+
"name": "arminmuaniez",
11+
"contestType": "Software",
12+
"description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s.",
13+
"class": "develop"
14+
}, {
15+
"avatar": "community/mock-data/avatar.png",
16+
"name": "koimsz",
17+
"contestType": "Data Science",
18+
"description": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s.",
19+
"class": "data-science"
20+
}],
21+
"copilots": [{
22+
"avatar": "community/mock-data/avatar.png",
23+
"name": "ilesmana",
24+
"country": "Indonesia"
25+
}, {
26+
"avatar": "community/mock-data/avatar.png",
27+
"name": "utamidwi",
28+
"country": "Indonesia"
29+
}, {
30+
"avatar": "community/mock-data/avatar.png",
31+
"name": "janedoe",
32+
"country": "Brazil"
33+
}, {
34+
"avatar": "community/mock-data/avatar.png",
35+
"name": "freeyourself",
36+
"country": "Chile"
37+
}, {
38+
"avatar": "community/mock-data/avatar.png",
39+
"name": "buureen",
40+
"country": "Venezuela"
41+
}, {
42+
"avatar": "community/mock-data/avatar.png",
43+
"name": "mariaja",
44+
"country": "Malaysia"
45+
}, {
46+
"avatar": "community/mock-data/avatar.png",
47+
"name": "ilesmana",
48+
"country": "Indonesia"
49+
}, {
50+
"avatar": "community/mock-data/avatar.png",
51+
"name": "afputra",
52+
"country": "Indonesia"
53+
}, {
54+
"avatar": "community/mock-data/avatar.png",
55+
"name": "janedoe",
56+
"country": "Brazil"
57+
}, {
58+
"avatar": "community/mock-data/avatar.png",
59+
"name": "freeyourself",
60+
"country": "Chile"
61+
}, {
62+
"avatar": "community/mock-data/avatar.png",
63+
"name": "buureen",
64+
"country": "Venezuela"
65+
}, {
66+
"avatar": "community/mock-data/avatar.png",
67+
"name": "mariaja",
68+
"country": "Malaysia"
69+
}]
70+
}
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+
}
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
{
2+
"SRMWinners": [{
3+
"avatar": "community/mock-data/avatar.png",
4+
"name": "enot",
5+
"date": "20150813T000000Z",
6+
"country": "Indonesia",
7+
"contests": ["SRM 668 DIVISION WINNER"]
8+
}, {
9+
"avatar": "community/mock-data/avatar.png",
10+
"name": "javaiscool",
11+
"date": "20150813T000000Z",
12+
"country": "Brazil",
13+
"contests": ["SRM 668 DIVISION WINNER"]
14+
}],
15+
"MarathonWinner": [{
16+
"avatar": "community/mock-data/avatar.png",
17+
"name": "tomerun",
18+
"date": "20150813T000000Z",
19+
"country": "Brazil",
20+
"contests": ["MARATHON MATCH 87", "Population Mapping"]
21+
}],
22+
"TopPerformers": [{
23+
"contestType": "Design",
24+
"class": "design",
25+
"performers": [{
26+
"name": "jQluvix",
27+
"wins": 900
28+
}, {
29+
"name": "Truahm",
30+
"wins": 850
31+
}, {
32+
"name": "jQluvix",
33+
"wins": 900
34+
}, {
35+
"name": "Truahm",
36+
"wins": 850
37+
}, {
38+
"name": "jQluvix",
39+
"wins": 900
40+
}, {
41+
"name": "Truahm",
42+
"wins": 850
43+
}, {
44+
"name": "jQluvix",
45+
"wins": 900
46+
}, {
47+
"name": "Truahm",
48+
"wins": 850
49+
}, {
50+
"name": "jQluvix",
51+
"wins": 900
52+
}, {
53+
"name": "Truahm",
54+
"wins": 850
55+
}]
56+
}, {
57+
"contestType": "Development",
58+
"class": "develop",
59+
"performers": [{
60+
"name": "jQluvix",
61+
"wins": 900
62+
}, {
63+
"name": "Truahm",
64+
"wins": 850
65+
}, {
66+
"name": "jQluvix",
67+
"wins": 900
68+
}, {
69+
"name": "Truahm",
70+
"wins": 850
71+
}, {
72+
"name": "jQluvix",
73+
"wins": 900
74+
}, {
75+
"name": "Truahm",
76+
"wins": 850
77+
}, {
78+
"name": "jQluvix",
79+
"wins": 900
80+
}, {
81+
"name": "Truahm",
82+
"wins": 850
83+
}, {
84+
"name": "jQluvix",
85+
"wins": 900
86+
}, {
87+
"name": "Truahm",
88+
"wins": 850
89+
}]
90+
}, {
91+
"contestType": "Data Science",
92+
"class": "data-science",
93+
"performers": [{
94+
"name": "jQluvix",
95+
"wins": 900
96+
}, {
97+
"name": "Truahm",
98+
"wins": 850
99+
}, {
100+
"name": "jQluvix",
101+
"wins": 900
102+
}, {
103+
"name": "Truahm",
104+
"wins": 850
105+
}, {
106+
"name": "jQluvix",
107+
"wins": 900
108+
}, {
109+
"name": "Truahm",
110+
"wins": 850
111+
}, {
112+
"name": "jQluvix",
113+
"wins": 900
114+
}, {
115+
"name": "Truahm",
116+
"wins": 850
117+
}, {
118+
"name": "jQluvix",
119+
"wins": 900
120+
}, {
121+
"name": "Truahm",
122+
"wins": 850
123+
}]
124+
}]
125+
}
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+
angular.module('tc.community').controller('StatisticsController', StatisticsController);
5+
6+
StatisticsController.$inject = ['statData'];
7+
8+
function StatisticsController(statData) {
9+
this.SRMWinners = statData.data.SRMWinners;
10+
this.MarathonWinner = statData.data.MarathonWinner;
11+
this.TopPerformers = statData.data.TopPerformers;
12+
}
13+
})();

0 commit comments

Comments
 (0)