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

Commit e988966

Browse files
committed
platform stats in members page
1 parent 5757bdc commit e988966

File tree

4 files changed

+52
-3
lines changed

4 files changed

+52
-3
lines changed

app/community/members.controller.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
angular.module('tc.community').controller('MembersController', MembersController);
55

6-
MembersController.$inject = ['CommunityDataService', 'CONSTANTS'];
6+
MembersController.$inject = ['CommunityDataService', 'StatisticsService', 'CONSTANTS'];
77

8-
function MembersController(CommunityDataService, CONSTANTS) {
8+
function MembersController(CommunityDataService, StatisticsService, CONSTANTS) {
99
var ctrl = this;
1010
ctrl.notSearch = true;
1111
ctrl.showing = 'list';
@@ -26,6 +26,10 @@
2626
ctrl.notSearch = true;
2727
}
2828
};
29+
30+
StatisticsService.getPlatformStats().then(function(data) {
31+
ctrl.platformStats = data;
32+
})
2933
}
3034

3135
})();

app/community/members.jade

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@
1010
input(type="submit" name="search-btn" value="").search-ico
1111

1212
.default-show-container(ng-show="ctrl.notSearch")
13+
.platform-stats-container
14+
.stat
15+
p.statVal {{ctrl.platformStats.memberCount | number : 0}}
16+
p.statLabel ACTIVE MEMBER
17+
.stat
18+
p.statVal {{ctrl.platformStats.activeMembersCount | number : 0}}
19+
p.statLabel COMPETING TODAY
20+
.stat
21+
p.statVal {{ctrl.platformStats.prizePurse | currency:undefined:0}}
22+
p.statLabel AVAILABLE PRIZE
23+
.stat
24+
p.statVal {{ctrl.platformStats.activeContestsCount | number : 0}}
25+
p.statLabel ACTIVE CHALLENGES
1326
.members-of-month-container
1427
h2 Members of the Month
1528
small {{ctrl.currentMonth}}

app/services/statistics.service.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,20 @@
1010
var service = {
1111
getDevTop: getDevTop,
1212
getDesignTop: getDesignTop,
13-
getDataTop: getDataTop
13+
getDataTop: getDataTop,
14+
getPlatformStats: getPlatformStats
1415
};
1516
return service;
1617

1718
///////////////
1819

20+
21+
function getPlatformStats() {
22+
return ApiService.restangularV2.all('platform')
23+
.withHttpConfig({skipAuthorization: true})
24+
.customGET('statistics');
25+
}
26+
1927
function getDevTop(size) {
2028
var url = CONSTANTS.API_URL_V2 + '/users/tops/develop?pageSize=' + size;
2129
return ApiService.restangularV2.all('users')

assets/css/community/members.scss

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,30 @@
3737
}
3838
}
3939
}
40+
.platform-stats-container {
41+
background: $white;
42+
padding: 10px;
43+
margin-bottom: 6px;
44+
height: 70px;
45+
font-family: "Sofia Pro",Arial,Helvetica,sans-serif;
46+
.stat {
47+
float: left;
48+
width: 25% ;
49+
text-align: center;
50+
}
51+
.statVal {
52+
color: #3d3d3d;
53+
font-size: 32px;
54+
margin-bottom: 7px;
55+
position: relative;
56+
}
57+
58+
.statLabel {
59+
color: #a3a3ae;
60+
font-size: 12px;
61+
font-weight: 400;
62+
}
63+
}
4064
.search-container {
4165
@include module-full-width;
4266
background: $white;

0 commit comments

Comments
 (0)