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

Commit 0aba724

Browse files
committed
Merge pull request #196 from appirio-tech/mobile-blog-feed
Finish mobile and desktop blog feed
2 parents 7a32354 + 44aa199 commit 0aba724

File tree

5 files changed

+99
-31
lines changed

5 files changed

+99
-31
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@
88
// Access and parses the blog RSS feed
99
function CommunityUpdatesController(BlogService, $log) {
1010
var vm = this;
11+
vm.loading = true;
1112

1213
activate();
1314

1415
function activate() {
1516
BlogService.getBlogFeed()
1617
.then(function(data) {
18+
vm.loading = false;
1719
vm.blogPosts = data;
1820
})
1921
.catch(function(err) {
22+
vm.loading = false;
2023
$log.debug(err);
2124
});
2225
}
Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
header
22
h1.section-title Community Updates
33

4-
section
5-
.posts
6-
.post(ng-repeat='blog in vm.blogPosts | orderBy : pubDate | limitTo : 4')
7-
.blog-link
8-
a(ng-href='{{blog.link}}', target='_blank') {{blog.title}}
4+
.section-loading(ng-show="vm.loading")
95

10-
.description(ng-bind-html="blog.description")
6+
.posts(ng-hide="vm.loading")
7+
.post(ng-repeat='blog in vm.blogPosts | orderBy : pubDate | limitTo : 4')
8+
.blog-link
9+
a(ng-href='{{blog.link}}', target='_blank') {{blog.title}}
1110

12-
.section-links
13-
.link
14-
a(ng-href="https://www.{{DOMAIN}}/blog/") View Topcoder Blog
15-
16-
.link
17-
a(ng-href="https://community.{{DOMAIN}}/") Go to Community
11+
.description(ng-bind-html="blog.description")

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

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

3838
ProfileService.getUserStats(handle)
3939
.then(function(stats) {
40-
if (!_.isUndefined(stats.COPILOT)) {
40+
if (stats.COPILOT != null) {
4141
vm.numCopilotActiveContests = stats.COPILOT.activeContests;
4242
} else {
4343
vm.numCopilotActiveContests = 0;

assets/css/my-dashboard/community-updates.scss

Lines changed: 81 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,106 @@
11
@import '../partials/combined';
22

33
.community-updates {
4+
display: flex;
5+
flex-direction: column;
6+
color: #3D3D3D;
7+
48
header {
5-
margin-bottom: 35px;
9+
margin-top: 6px;
10+
margin-bottom: -6px;
11+
padding-top: 30px;
12+
padding-bottom: 24px;
13+
background-color: $white;
14+
@media only screen and (min-width: 570px) {
15+
margin-bottom: 0;
16+
}
17+
@media only screen and (min-width: 1132px) {
18+
margin-top: 0;
19+
padding-top: 0;
20+
padding-bottom: 30px;
21+
}
622
}
723

824
.posts {
9-
display: flex;
10-
flex-direction: row;
11-
margin-bottom: 25px;
25+
@media only screen and (min-width: 570px) {
26+
display: flex;
27+
flex-flow: row wrap;
28+
margin: 0 auto;
29+
width: 550px;
30+
}
31+
@media only screen and (min-width: 850px) {
32+
width: 830px;
33+
}
34+
@media only screen and (min-width: 1132px) {
35+
width: 1110px;
36+
}
1237

1338
.post {
39+
@include module-s;
1440
display: flex;
1541
flex-direction: column;
16-
margin-right: 25px;
17-
padding: 10px;
18-
width: 23%;
42+
border: 1px solid #F0F0F0;
43+
@media only screen and (min-width: 570px) {
44+
width: 270px;
45+
height: 386px;
46+
47+
&:nth-child(2n + 1) {
48+
margin-right: 10px;
49+
}
50+
}
51+
@media only screen and (min-width: 850px) {
52+
margin-right: 10px;
53+
54+
&:nth-child(3) {
55+
margin-right: 0;
56+
}
57+
}
58+
@media only screen and (min-width: 1132px) {
59+
margin-top: 0;
1960

20-
&:last-child {
21-
margin-right: 0;
61+
&:nth-child(3) {
62+
margin-right: 10px;
63+
}
64+
&:last-child {
65+
margin-right: 0;
66+
}
2267
}
2368

2469
.blog-link {
25-
min-height: 50px;
70+
min-height: 76px;
71+
padding: 20px 10px 12px;
72+
@include sofia-pro-medium;
73+
font-size: 16px;
74+
line-height: 22px;
75+
background-color: #F2FAFF;
76+
@media only screen and (min-width: 570px) {
77+
padding: 20px 20px 12px;
78+
}
2679

2780
a {
2881
text-decoration: none;
29-
color: $color_storm_dust_approx;
30-
31-
&:hover {
32-
color: $color_selective_yellow_approx;
33-
}
82+
color: inherit;
3483
}
3584
}
3685

3786
.description {
38-
margin-top: 10px;
39-
font-size: 14px;
87+
padding: 20px 10px;
88+
@include source-sans-regular;
89+
font-size: 13px;
90+
line-height: 18px;
91+
@media only screen and (min-width: 570px) {
92+
padding: 20px 20px;
93+
}
94+
95+
a {
96+
display: block;
97+
margin-top: 25px;
98+
color: $primary-color;
99+
text-decoration: none;
100+
@media only screen and (min-width: 1132px) {
101+
margin-top: 0;
102+
}
103+
}
40104
}
41105
}
42106
}

assets/css/my-dashboard/my-dashboard.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
padding-right: 0;
1212
}
1313

14-
.subtrack-stats, .my-challenges, .srms, .programs, .community-updates {
14+
.subtrack-stats, .my-challenges, .srms, .programs {
1515
@include module-l;
1616
width: 100%;
1717
}
@@ -26,6 +26,13 @@
2626
}
2727
}
2828

29+
.community-updates {
30+
width: 100%;
31+
@media only screen and (min-width: 1132px) {
32+
@include module-l;
33+
}
34+
}
35+
2936
.section-title {
3037
@include sofia-pro-bold;
3138
font-size: 22px;

0 commit comments

Comments
 (0)