diff options
author | Thomas Citharel <tcit@tcit.fr> | 2017-06-15 09:43:48 +0200 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2017-06-23 09:42:20 +0200 |
commit | e0f9010ec2a558f6cf7d16fb96a2c4cdb34e3f37 (patch) | |
tree | 904f42fa442188bf456b9773295fb9582634ba6c /app | |
parent | 29714661b1df78871ceaf0e079f11041a8641d4b (diff) | |
download | wallabag-e0f9010ec2a558f6cf7d16fb96a2c4cdb34e3f37.tar.gz wallabag-e0f9010ec2a558f6cf7d16fb96a2c4cdb34e3f37.tar.zst wallabag-e0f9010ec2a558f6cf7d16fb96a2c4cdb34e3f37.zip |
Notifications
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'app')
-rw-r--r-- | app/Resources/static/themes/material/css/index.scss | 1 | ||||
-rw-r--r-- | app/Resources/static/themes/material/css/nav.scss | 4 | ||||
-rw-r--r-- | app/Resources/static/themes/material/css/notifications.scss | 38 | ||||
-rw-r--r-- | app/Resources/static/themes/material/css/sidenav.scss | 11 | ||||
-rw-r--r-- | app/Resources/static/themes/material/css/various.scss | 6 | ||||
-rwxr-xr-x | app/Resources/static/themes/material/index.js | 3 | ||||
-rw-r--r-- | app/Resources/static/themes/material/js/tools.js | 9 | ||||
-rw-r--r-- | app/config/services.yml | 9 | ||||
-rw-r--r-- | app/config/wallabag.yml | 1 |
9 files changed, 80 insertions, 2 deletions
diff --git a/app/Resources/static/themes/material/css/index.scss b/app/Resources/static/themes/material/css/index.scss index 285a6504..8300e430 100644 --- a/app/Resources/static/themes/material/css/index.scss +++ b/app/Resources/static/themes/material/css/index.scss | |||
@@ -8,6 +8,7 @@ | |||
8 | @import 'layout'; | 8 | @import 'layout'; |
9 | @import 'nav'; | 9 | @import 'nav'; |
10 | @import 'sidenav'; | 10 | @import 'sidenav'; |
11 | @import 'notifications'; | ||
11 | @import 'various'; | 12 | @import 'various'; |
12 | 13 | ||
13 | /* Tools */ | 14 | /* Tools */ |
diff --git a/app/Resources/static/themes/material/css/nav.scss b/app/Resources/static/themes/material/css/nav.scss index 1a25a5be..601aada2 100644 --- a/app/Resources/static/themes/material/css/nav.scss +++ b/app/Resources/static/themes/material/css/nav.scss | |||
@@ -104,3 +104,7 @@ nav { | |||
104 | #button_export { | 104 | #button_export { |
105 | display: none; | 105 | display: none; |
106 | } | 106 | } |
107 | |||
108 | #button_notifications a.nav-panel-menu { | ||
109 | max-height: 65px; | ||
110 | } | ||
diff --git a/app/Resources/static/themes/material/css/notifications.scss b/app/Resources/static/themes/material/css/notifications.scss new file mode 100644 index 00000000..60114ce4 --- /dev/null +++ b/app/Resources/static/themes/material/css/notifications.scss | |||
@@ -0,0 +1,38 @@ | |||
1 | @mixin notification { | ||
2 | .notifications-area { | ||
3 | flex-grow: 1; | ||
4 | |||
5 | .collection { | ||
6 | margin: auto; | ||
7 | } | ||
8 | } | ||
9 | |||
10 | .no-notifications { | ||
11 | position: absolute; | ||
12 | top: 40%; | ||
13 | left: 50%; | ||
14 | transform: translate(-40%, -50%); | ||
15 | } | ||
16 | |||
17 | .view-more { | ||
18 | display: block; | ||
19 | margin: auto 5px 10px; | ||
20 | flex: 0 1 2.5em; | ||
21 | } | ||
22 | |||
23 | .btn.notification-action-button { | ||
24 | display: block; | ||
25 | line-height: 25px; | ||
26 | height: auto; | ||
27 | } | ||
28 | } | ||
29 | |||
30 | .notifications-page { | ||
31 | @include notification; | ||
32 | |||
33 | .pagination { | ||
34 | float: none; | ||
35 | text-align: center; | ||
36 | margin-top: 30px; | ||
37 | } | ||
38 | } | ||
diff --git a/app/Resources/static/themes/material/css/sidenav.scss b/app/Resources/static/themes/material/css/sidenav.scss index 416dc1c7..a86eed17 100644 --- a/app/Resources/static/themes/material/css/sidenav.scss +++ b/app/Resources/static/themes/material/css/sidenav.scss | |||
@@ -2,6 +2,8 @@ | |||
2 | Side-nav | 2 | Side-nav |
3 | ========================================================================== */ | 3 | ========================================================================== */ |
4 | 4 | ||
5 | @import 'notifications'; | ||
6 | |||
5 | .side-nav { | 7 | .side-nav { |
6 | width: 240px; | 8 | width: 240px; |
7 | 9 | ||
@@ -36,6 +38,15 @@ | |||
36 | } | 38 | } |
37 | } | 39 | } |
38 | 40 | ||
41 | #notifications { | ||
42 | width: 300px; | ||
43 | display: flex; | ||
44 | flex-flow: column; | ||
45 | justify-content: space-between; | ||
46 | |||
47 | @include notification; | ||
48 | } | ||
49 | |||
39 | .bold > a { | 50 | .bold > a { |
40 | font-weight: bold; | 51 | font-weight: bold; |
41 | } | 52 | } |
diff --git a/app/Resources/static/themes/material/css/various.scss b/app/Resources/static/themes/material/css/various.scss index 7daf40ec..300015ab 100644 --- a/app/Resources/static/themes/material/css/various.scss +++ b/app/Resources/static/themes/material/css/various.scss | |||
@@ -30,3 +30,9 @@ nav .input-field input { | |||
30 | .tab { | 30 | .tab { |
31 | flex: 1; | 31 | flex: 1; |
32 | } | 32 | } |
33 | |||
34 | #notifications-count { | ||
35 | position: relative; | ||
36 | top: -50px; | ||
37 | left: 15px; | ||
38 | } | ||
diff --git a/app/Resources/static/themes/material/index.js b/app/Resources/static/themes/material/index.js index d6afbb8a..435cd02f 100755 --- a/app/Resources/static/themes/material/index.js +++ b/app/Resources/static/themes/material/index.js | |||
@@ -8,7 +8,7 @@ import 'materialize-css/dist/js/materialize'; | |||
8 | import '../_global/index'; | 8 | import '../_global/index'; |
9 | 9 | ||
10 | /* Tools */ | 10 | /* Tools */ |
11 | import { initExport, initFilters } from './js/tools'; | 11 | import { initExport, initFilters, initNotifications } from './js/tools'; |
12 | 12 | ||
13 | /* Import shortcuts */ | 13 | /* Import shortcuts */ |
14 | import './js/shortcuts/main'; | 14 | import './js/shortcuts/main'; |
@@ -34,6 +34,7 @@ $(document).ready(() => { | |||
34 | }); | 34 | }); |
35 | initFilters(); | 35 | initFilters(); |
36 | initExport(); | 36 | initExport(); |
37 | initNotifications(); | ||
37 | 38 | ||
38 | $('#nav-btn-add-tag').on('click', () => { | 39 | $('#nav-btn-add-tag').on('click', () => { |
39 | $('.nav-panel-add-tag').toggle(100); | 40 | $('.nav-panel-add-tag').toggle(100); |
diff --git a/app/Resources/static/themes/material/js/tools.js b/app/Resources/static/themes/material/js/tools.js index 39398fd8..492640a0 100644 --- a/app/Resources/static/themes/material/js/tools.js +++ b/app/Resources/static/themes/material/js/tools.js | |||
@@ -21,4 +21,11 @@ function initExport() { | |||
21 | } | 21 | } |
22 | } | 22 | } |
23 | 23 | ||
24 | export { initExport, initFilters }; | 24 | function initNotifications() { |
25 | if ($('div').is('#notifications')) { | ||
26 | $('#button_notifications').show(); | ||
27 | $('.js-notifications-action').sideNav({ edge: 'right' }); | ||
28 | } | ||
29 | } | ||
30 | |||
31 | export { initExport, initFilters, initNotifications }; | ||
diff --git a/app/config/services.yml b/app/config/services.yml index 7b85d846..3b454760 100644 --- a/app/config/services.yml +++ b/app/config/services.yml | |||
@@ -13,14 +13,23 @@ services: | |||
13 | tags: | 13 | tags: |
14 | - { name: twig.extension } | 14 | - { name: twig.extension } |
15 | 15 | ||
16 | twig.extension.date: | ||
17 | class: Twig_Extensions_Extension_Date | ||
18 | arguments: | ||
19 | - "@translator" | ||
20 | tags: | ||
21 | - { name: twig.extension } | ||
22 | |||
16 | wallabag.twig_extension: | 23 | wallabag.twig_extension: |
17 | class: Wallabag\CoreBundle\Twig\WallabagExtension | 24 | class: Wallabag\CoreBundle\Twig\WallabagExtension |
18 | public: false | 25 | public: false |
19 | arguments: | 26 | arguments: |
20 | - "@wallabag_core.entry_repository" | 27 | - "@wallabag_core.entry_repository" |
21 | - "@wallabag_core.tag_repository" | 28 | - "@wallabag_core.tag_repository" |
29 | - "@wallabag_core.notification_repository" | ||
22 | - "@security.token_storage" | 30 | - "@security.token_storage" |
23 | - "%wallabag_core.cache_lifetime%" | 31 | - "%wallabag_core.cache_lifetime%" |
32 | - "%wallabag_core.notifications_nb%" | ||
24 | - "@translator" | 33 | - "@translator" |
25 | tags: | 34 | tags: |
26 | - { name: twig.extension } | 35 | - { name: twig.extension } |
diff --git a/app/config/wallabag.yml b/app/config/wallabag.yml index b45934e4..ab12d68a 100644 --- a/app/config/wallabag.yml +++ b/app/config/wallabag.yml | |||
@@ -22,6 +22,7 @@ wallabag_core: | |||
22 | cache_lifetime: 10 | 22 | cache_lifetime: 10 |
23 | action_mark_as_read: 1 | 23 | action_mark_as_read: 1 |
24 | list_mode: 0 | 24 | list_mode: 0 |
25 | notifications_nb: 5 | ||
25 | fetching_error_message_title: 'No title found' | 26 | fetching_error_message_title: 'No title found' |
26 | fetching_error_message: | | 27 | fetching_error_message: | |
27 | wallabag can't retrieve contents for this article. Please <a href="http://doc.wallabag.org/en/user/errors_during_fetching.html#how-can-i-help-to-fix-that">troubleshoot this issue</a>. | 28 | wallabag can't retrieve contents for this article. Please <a href="http://doc.wallabag.org/en/user/errors_during_fetching.html#how-can-i-help-to-fix-that">troubleshoot this issue</a>. |