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

Commit c13d40f

Browse files
committedJul 28, 2017
A few updates for Dashboard notifications
- Makes notifications background graish rather than bluish/purple; - Increments spacing between text in open notification and video (if any); - Allows to add custom tags to collapsed notifications. - Adds background under notification collapse handle.
1 parent 4237fce commit c13d40f

File tree

4 files changed

+30
-6
lines changed

4 files changed

+30
-6
lines changed
 

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ There's a constant `VIDEO_DEFAULT_HEIGHT` has been added to /app/topcoder.consta
4848

4949
To add a new notification, append a new configuration object to /app/my-dashboard/notifications/news.json, the configuration object has following properties:
5050

51+
- customTag: allows to show a custom tag in the collapsed notification, similarly to the LIVE tag. If provided, it should be an object with three fields: `text` - the label on the tag, `color` - text color of the tag (defaults to white), `background` - background color of the tag (defaults to red, the same as for LIVE tag).
5152
- header: header text displayed when collapsed.
5253
- details: details text displayed when collapsed.
5354
- headerExpand: header text displayed when expanded, use `header` if this property is falsy

‎app/directives/notification/notification.jade

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.notification
22
.collapsed(ng-show="!vm.expanded")
33
.live(ng-show="config.live") LIVE
4+
.customTag(ng-show="config.customTag" ng-style="{'background': config.customTag.background, color: config.customTag.color}") {{config.customTag.text}}
45
.header {{config.header}}: 
56
.details {{config.details}}
67
i.expand.fa.fa-plus(ng-click="vm.toggle()")

‎app/my-dashboard/notifications/news.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@
88
"redirectTo": "https://tco17.topcoder.com/",
99
"redirectText": "Learn More",
1010
"videoCode": "https://www.youtube.com/embed/Qc_PcN6ECjg?autoplay=1",
11-
"live": true,
12-
"liveExpand": true
11+
"live": false,
12+
"liveExpand": false,
13+
"customTag": {
14+
"color": "red",
15+
"background": "blue",
16+
"text": "Announcement"
17+
}
1318
},
1419
{
1520
"header": "SRM 789 is starting in 10 days (June 3, 22:30pm)",

‎assets/css/directives/notification.directive.scss

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,30 @@
1212
text-align: center;
1313
font-size: 14px;
1414
}
15+
.customTag{
16+
height: 30px;
17+
line-height: 30px;
18+
padding: 0 12px;
19+
color: $white;
20+
background: #E73851;
21+
border-radius: 4px;
22+
text-align: center;
23+
font-size: 14px;
24+
}
1525
.collapsed{
1626
display: flex;
1727
align-items: center;
1828
color: $white;
1929
font-size: 18px;
2030
height: 60px;
21-
background: linear-gradient(to bottom, #20a6e2 0%, #5c82db 45%, #a17fdd 100%);
31+
background: linear-gradient(to bottom, gainsboro 0%, silver 50%, lightgray 100%);
2232
padding: 0 15px;
2333
.live{
2434
margin-right: 12px;
2535
}
36+
.customTag{
37+
margin-right: 12px;
38+
}
2639
.header{
2740
font-weight: bold;
2841
}
@@ -57,10 +70,12 @@
5770
}
5871
.left{
5972
padding-top: 70px;
73+
padding-right: 64px;
6074
flex: 1;
6175
height: 100%;
6276
position: relative;
63-
background: linear-gradient(to bottom, #20a6e2 0%, rgba(92, 130, 219, 0.8) 45%, rgba(161, 127, 221, 0.75) 100%)
77+
background: linear-gradient(to bottom, darkgray 0%, #444 50%, gray 100%);
78+
opacity: 0.8;
6479
}
6580
.header{
6681
font-weight: bold;
@@ -111,9 +126,11 @@
111126
}
112127
}
113128
.collapse{
129+
background: #444;
130+
padding: 15px;
114131
position: absolute;
115-
top: 15px;
116-
right: 15px;
132+
top: 0;
133+
right: 0;
117134
cursor: pointer;
118135
font-size: 26px;
119136
font-weight: 100;

0 commit comments

Comments
 (0)