Skip to content

Commit 665780b

Browse files
committed
Notifications: show timestamp and change color scheme
-Allow vertical scroll on notification window [cli:v-list-user-notifications] fix json output when printing double quotes Implements hestiacp#402
1 parent b064c27 commit 665780b

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

bin/v-list-user-notifications

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ json_list() {
2828
NOTICE=$(echo "$NOTICE" |sed -e "s/%quote%/'/g")
2929
echo -n ' "'$NID'": {
3030
"TOPIC": "'$TOPIC'",
31-
"NOTICE": "'$NOTICE'",
31+
"NOTICE": "'${NOTICE//\"/\'}'",
3232
"TYPE": "'$TYPE'",
3333
"ACK": "'$ACK'",
3434
"TPL": "'$TPL'",

web/css/styles.min.css

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,31 +1008,32 @@ a {
10081008
}
10091009

10101010
.notification-container {
1011-
background-color: rgba(0,0,0,0.90);
1011+
background-color: rgba(255,255,255,0.95);
10121012
box-shadow: 0 3px 30px 0 rgba(0, 0, 0, 0.5);
10131013
list-style-type: none;
10141014
margin: 0 27px;
1015-
overflow: hidden;
1015+
max-height: 90%;
1016+
overflow-y: auto;
10161017
padding-left: 0;
10171018
position: fixed;
10181019
top: 34px;
10191020
width: 393px;
10201021
z-index: 300;
10211022
font-size: 0.8rem;
10221023
padding: 0;
1023-
color: #e9e9e9;
1024+
color: #6f6f6f;
10241025
border-bottom-left-radius: 6px;
10251026
border-bottom-right-radius: 6px;
10261027
border: 1px solid #fff;
10271028
border-top: none;
10281029
}
10291030

10301031
.notification-container .unseen {
1031-
color: #e7e7e7;
1032+
color: #6f6f6f;
10321033
}
10331034

10341035
.notification-container li {
1035-
border-bottom: 1px solid #4b4b4b;
1036+
border-bottom: 1px solid #e9e4e4;
10361037
padding: 20px;
10371038
}
10381039

@@ -1102,6 +1103,11 @@ a {
11021103
width: 21px;
11031104
}
11041105

1106+
.notification-container .time {
1107+
float: right;
1108+
margin-top: 1rem;
1109+
font-size: 0.7rem;
1110+
}
11051111

11061112

11071113
.l-stat {

web/js/events.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,8 @@ VE.notifications.get_list = function(){
416416
tpl.set(':TYPE', elm.TYPE);
417417
tpl.set(':TOPIC', elm.TOPIC);
418418
tpl.set(':NOTICE', elm.NOTICE);
419+
tpl.set(':TIME', elm.TIME);
420+
tpl.set(':DATE', elm.DATE);
419421
acc.push(tpl.finalize());
420422
});
421423

web/js/templates.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ App.Templates.html = {
99
'<li class="~!:UNSEEN~!"><span class="unselectable mark-seen" id="notification-~!:ID~!">&nbsp;</span>\
1010
<span class="title"><span class="unselectable icon ~!:TYPE~!">&nbsp;</span>~!:TOPIC~!</span>\
1111
~!:NOTICE~!\
12+
<span class="time">~!:TIME~! ~!:DATE~!</span>\
1213
</li>'
1314
],
1415
notification_empty: [

0 commit comments

Comments
 (0)