From addd9a8f02f239f6442f37f698e44d191a1fed0b Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Fri, 28 Oct 2016 17:55:58 +0300 Subject: [PATCH] notification centre improvements --- web/css/styles.min.css | 35 +++++++++++++++++++++++++++++------ web/inc/i18n/ar.php | 2 ++ web/inc/i18n/bs.php | 1 + web/inc/i18n/cn.php | 1 + web/inc/i18n/cz.php | 1 + web/inc/i18n/da.php | 1 + web/inc/i18n/de.php | 1 + web/inc/i18n/el.php | 1 + web/inc/i18n/en.php | 1 + web/inc/i18n/es.php | 1 + web/inc/i18n/fa.php | 2 ++ web/inc/i18n/fi.php | 1 + web/inc/i18n/fr.php | 1 + web/inc/i18n/hu.php | 1 + web/inc/i18n/id.php | 1 + web/inc/i18n/it.php | 1 + web/inc/i18n/ja.php | 1 + web/inc/i18n/ka.php | 1 + web/inc/i18n/nl.php | 1 + web/inc/i18n/no.php | 1 + web/inc/i18n/pl.php | 1 + web/inc/i18n/pt-BR.php | 1 + web/inc/i18n/pt.php | 1 + web/inc/i18n/ro.php | 1 + web/inc/i18n/ru.php | 1 + web/inc/i18n/se.php | 1 + web/inc/i18n/tr.php | 1 + web/inc/i18n/tw.php | 1 + web/inc/i18n/ua.php | 1 + web/inc/i18n/vi.php | 1 + web/js/events.js | 14 ++++++++++---- web/js/i18n.js.php | 1 + web/js/templates.js | 11 ++++++++--- web/templates/scripts.html | 1 + 34 files changed, 80 insertions(+), 13 deletions(-) diff --git a/web/css/styles.min.css b/web/css/styles.min.css index 3723c9ec..3f2eeb3e 100644 --- a/web/css/styles.min.css +++ b/web/css/styles.min.css @@ -595,6 +595,15 @@ a { text-decoration: line-through; } +.unselectable { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + .clearfix:before, .clearfix:after { content: ''; @@ -830,6 +839,8 @@ input[type="checkbox"] { font-size: 12px; padding: 0; color: #7f7f7f; + max-height: 95%; + overflow: auto; } .notification-container .unseen { color: #ABABAB; @@ -840,21 +851,33 @@ input[type="checkbox"] { border-bottom: 1px solid #555; padding: 10px 15px 24px; } +.notification-container li.empty { + padding-top: 50px; + height: 50px; + font-size: 15px; + font-style: italic; + text-align: center; + color: #999; +} + .notification-container .mark-seen { - background-color: #abc04b; - border: 2px solid #454545; - border-radius: 10px; + background: rgba(0, 0, 0, 0) url("/images/sprite.png?1446554103") repeat scroll -426px 165px; + border: 3px solid #454545; cursor: pointer; display: none; float: right; - height: 7px; + height:11px; margin-right: -5px; margin-top: 0; - width: 7px; + width: 11px; + opacity: 0.5; + border-radius: 10px; } .notification-container .mark-seen:hover { background-color: #333; - border-color: #abc04b; + border-color: #333; + + opacity: 0.8; } .notification-container .mark-seen:active { background-color: #777; diff --git a/web/inc/i18n/ar.php b/web/inc/i18n/ar.php index bf657f06..293d65fc 100644 --- a/web/inc/i18n/ar.php +++ b/web/inc/i18n/ar.php @@ -751,6 +751,8 @@ $LANG['ar'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', + // Texts below doesn't exist in en.php '%s rule' => 'قواعد %s', 'MainDomain' => 'النطاق الرئيسي', diff --git a/web/inc/i18n/bs.php b/web/inc/i18n/bs.php index bbeaf2f9..acfcd354 100644 --- a/web/inc/i18n/bs.php +++ b/web/inc/i18n/bs.php @@ -750,4 +750,5 @@ $LANG['bs'] = array( 'maximum characters length, including prefix' => 'maksimalna dužina sme biti %s karaktera, uključujući i prefix', + 'no notifications' => 'no notifications', ); \ No newline at end of file diff --git a/web/inc/i18n/cn.php b/web/inc/i18n/cn.php index fd34501c..fda878fe 100644 --- a/web/inc/i18n/cn.php +++ b/web/inc/i18n/cn.php @@ -751,4 +751,5 @@ $LANG['cn'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', ); diff --git a/web/inc/i18n/cz.php b/web/inc/i18n/cz.php index a0966882..41c7824f 100644 --- a/web/inc/i18n/cz.php +++ b/web/inc/i18n/cz.php @@ -752,4 +752,5 @@ $LANG['cz'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', ); diff --git a/web/inc/i18n/da.php b/web/inc/i18n/da.php index a06ebbcf..b37ec339 100644 --- a/web/inc/i18n/da.php +++ b/web/inc/i18n/da.php @@ -753,4 +753,5 @@ $LANG['da'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', ); diff --git a/web/inc/i18n/de.php b/web/inc/i18n/de.php index ce73830c..64e5ba67 100644 --- a/web/inc/i18n/de.php +++ b/web/inc/i18n/de.php @@ -751,4 +751,5 @@ $LANG['de'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', ); diff --git a/web/inc/i18n/el.php b/web/inc/i18n/el.php index a1506fd2..4ef5064e 100644 --- a/web/inc/i18n/el.php +++ b/web/inc/i18n/el.php @@ -752,4 +752,5 @@ $LANG['el'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', ); diff --git a/web/inc/i18n/en.php b/web/inc/i18n/en.php index 8f0dd0e7..2d7c1654 100644 --- a/web/inc/i18n/en.php +++ b/web/inc/i18n/en.php @@ -751,4 +751,5 @@ $LANG['en'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', ); diff --git a/web/inc/i18n/es.php b/web/inc/i18n/es.php index 4e2937de..5392ed9d 100644 --- a/web/inc/i18n/es.php +++ b/web/inc/i18n/es.php @@ -749,4 +749,5 @@ $LANG['es'] = array( 'maximum characters length, including prefix' => 'usar un máximo de %s, incluyendo prefijo', + 'no notifications' => 'no notifications', ); diff --git a/web/inc/i18n/fa.php b/web/inc/i18n/fa.php index 8cac9fb4..6fd2b953 100644 --- a/web/inc/i18n/fa.php +++ b/web/inc/i18n/fa.php @@ -754,6 +754,8 @@ $LANG['fa'] = [ 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', + // Texts below doesn't exist in en.php '70 خط اخر %s.%s.log' => 'هفتاد خط انتهايي از %s.%s.log', ]; diff --git a/web/inc/i18n/fi.php b/web/inc/i18n/fi.php index 4d20b84c..6e767e8a 100644 --- a/web/inc/i18n/fi.php +++ b/web/inc/i18n/fi.php @@ -753,6 +753,7 @@ $LANG['fi'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', // Texts below doesn't exist in en.php 'traffic' => 'tiedonsiirto', 'disk' => 'levytila', diff --git a/web/inc/i18n/fr.php b/web/inc/i18n/fr.php index dcf4cc07..8f30c309 100644 --- a/web/inc/i18n/fr.php +++ b/web/inc/i18n/fr.php @@ -751,6 +751,7 @@ $LANG['fr'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', // Texts below doesn't exist in en.php 'disk' => 'disque', 'traffic' => 'traffic', diff --git a/web/inc/i18n/hu.php b/web/inc/i18n/hu.php index 2a109313..00bc3c58 100644 --- a/web/inc/i18n/hu.php +++ b/web/inc/i18n/hu.php @@ -755,6 +755,7 @@ $LANG['hu'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', // Texts below doesn't exist in en.php 'Bandwidth Usage eth1' => 'eth1 sávszélesség használat', ); diff --git a/web/inc/i18n/id.php b/web/inc/i18n/id.php index 3ab9a663..e9729f6c 100644 --- a/web/inc/i18n/id.php +++ b/web/inc/i18n/id.php @@ -754,4 +754,5 @@ $LANG['id'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', ); diff --git a/web/inc/i18n/it.php b/web/inc/i18n/it.php index 1388f1ce..2f66a224 100644 --- a/web/inc/i18n/it.php +++ b/web/inc/i18n/it.php @@ -752,4 +752,5 @@ $LANG['it'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', ); diff --git a/web/inc/i18n/ja.php b/web/inc/i18n/ja.php index 0b6f8a3c..893013bd 100644 --- a/web/inc/i18n/ja.php +++ b/web/inc/i18n/ja.php @@ -751,4 +751,5 @@ $LANG['ja'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', ); diff --git a/web/inc/i18n/ka.php b/web/inc/i18n/ka.php index 68b5263f..ba68a7fa 100644 --- a/web/inc/i18n/ka.php +++ b/web/inc/i18n/ka.php @@ -751,4 +751,5 @@ $LANG['ka'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', ); diff --git a/web/inc/i18n/nl.php b/web/inc/i18n/nl.php index 9659f8de..95a7bd1e 100644 --- a/web/inc/i18n/nl.php +++ b/web/inc/i18n/nl.php @@ -752,4 +752,5 @@ $LANG['nl'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', ); diff --git a/web/inc/i18n/no.php b/web/inc/i18n/no.php index e808e1a5..e699f644 100644 --- a/web/inc/i18n/no.php +++ b/web/inc/i18n/no.php @@ -752,4 +752,5 @@ $LANG['no'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', ); diff --git a/web/inc/i18n/pl.php b/web/inc/i18n/pl.php index 37a870ed..284c1e2b 100644 --- a/web/inc/i18n/pl.php +++ b/web/inc/i18n/pl.php @@ -751,4 +751,5 @@ $LANG['pl'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', ); diff --git a/web/inc/i18n/pt-BR.php b/web/inc/i18n/pt-BR.php index 901e2a4b..40d685fc 100644 --- a/web/inc/i18n/pt-BR.php +++ b/web/inc/i18n/pt-BR.php @@ -751,4 +751,5 @@ $LANG['pt-BR'] = array( 'maximum characters length, including prefix' => 'comprimento máximo de % caracteres, incluindo o prefixo', + 'no notifications' => 'no notifications', ); diff --git a/web/inc/i18n/pt.php b/web/inc/i18n/pt.php index 97ddd425..affc82bf 100644 --- a/web/inc/i18n/pt.php +++ b/web/inc/i18n/pt.php @@ -751,4 +751,5 @@ $LANG['pt'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', ); diff --git a/web/inc/i18n/ro.php b/web/inc/i18n/ro.php index 22097b75..98c34208 100644 --- a/web/inc/i18n/ro.php +++ b/web/inc/i18n/ro.php @@ -753,4 +753,5 @@ $LANG['ro'] = array( 'maximum characters length, including prefix' => 'maximum %s caractere, incluzând prefixul', + 'no notifications' => 'no notifications', ); diff --git a/web/inc/i18n/ru.php b/web/inc/i18n/ru.php index f7aa02be..80347c4f 100644 --- a/web/inc/i18n/ru.php +++ b/web/inc/i18n/ru.php @@ -752,4 +752,5 @@ $LANG['ru'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', ); diff --git a/web/inc/i18n/se.php b/web/inc/i18n/se.php index 158addc4..3475a6fd 100644 --- a/web/inc/i18n/se.php +++ b/web/inc/i18n/se.php @@ -751,4 +751,5 @@ $LANG['se'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', ); diff --git a/web/inc/i18n/tr.php b/web/inc/i18n/tr.php index 676cdc62..42a313ff 100644 --- a/web/inc/i18n/tr.php +++ b/web/inc/i18n/tr.php @@ -752,4 +752,5 @@ $LANG['tr'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', ); diff --git a/web/inc/i18n/tw.php b/web/inc/i18n/tw.php index 1487492a..1c946dd8 100644 --- a/web/inc/i18n/tw.php +++ b/web/inc/i18n/tw.php @@ -774,4 +774,5 @@ $LANG['tw'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', ); diff --git a/web/inc/i18n/ua.php b/web/inc/i18n/ua.php index c3b2f813..2ce7e1cf 100644 --- a/web/inc/i18n/ua.php +++ b/web/inc/i18n/ua.php @@ -752,4 +752,5 @@ $LANG['ua'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', ); \ No newline at end of file diff --git a/web/inc/i18n/vi.php b/web/inc/i18n/vi.php index b35bb7c7..23b7eac6 100644 --- a/web/inc/i18n/vi.php +++ b/web/inc/i18n/vi.php @@ -750,4 +750,5 @@ $LANG['vi'] = array( 'maximum characters length, including prefix' => 'maximum %s characters length, including prefix', + 'no notifications' => 'no notifications', ); diff --git a/web/js/events.js b/web/js/events.js index 40593312..196fa857 100644 --- a/web/js/events.js +++ b/web/js/events.js @@ -406,12 +406,16 @@ VE.notifications.get_list = function(){ acc.push(tpl.finalize()); }); + if(!Object.keys(data).length){ + var tpl = Tpl.get('notification_empty', 'WEB'); + acc.push(tpl.finalize()); + } + $('.notification-container').html(acc.done()).show(); $('.notification-container .mark-seen').click(function(event){ - /// TODO add token - VE.notifications.mark_seen($(event.target).attr('id').replace("notification-", "")); -// VE.notifications.delete($(event.target).attr('id').replace("notification-", "")); +// VE.notifications.mark_seen($(event.target).attr('id').replace("notification-", "")); + VE.notifications.delete($(event.target).attr('id').replace("notification-", "")); }); }); @@ -419,10 +423,12 @@ VE.notifications.get_list = function(){ VE.notifications.delete = function(id){ - $('#notification-'+id).parents('li').remove(); + $('#notification-'+id).parents('li').hide(); $.ajax({ url: "/delete/notification/?delete=1¬ification_id="+id+"&token="+$('#token').attr('token') }); + if($('.notification-container li:visible').length == 0) + $('.l-profile__notifications').removeClass('updates').removeClass('active'); } VE.notifications.mark_seen = function(id){ diff --git a/web/js/i18n.js.php b/web/js/i18n.js.php index f625beca..a5afcabc 100644 --- a/web/js/i18n.js.php +++ b/web/js/i18n.js.php @@ -63,3 +63,4 @@ App.Constants.FM_READ_BY_OTHERS = ''; App.Constants.FM_WRITE_BY_OTHERS = ''; App.Constants.FM_EXECUTE_BY_OTHERS = ''; +App.Constants.NOTIFICATIONS_EMPTY = ''; diff --git a/web/js/templates.js b/web/js/templates.js index 983cd0ef..fdac676c 100644 --- a/web/js/templates.js +++ b/web/js/templates.js @@ -6,13 +6,18 @@ App.Templates.html = { WEB: { hint: [''], notification: [ - '
  •  \ -  ~!:TOPIC~!\ + '
  •  \ +  ~!:TOPIC~!\ ~!:NOTICE~!\
  • ' + ], + notification_empty: [ + '
  • \ + '+App.Constants.NOTIFICATIONS_EMPTY+'\ +
  • ' ] - }, + // file manager // diff --git a/web/templates/scripts.html b/web/templates/scripts.html index 30f04fe6..7c1e551e 100644 --- a/web/templates/scripts.html +++ b/web/templates/scripts.html @@ -5,6 +5,7 @@ +