diff options
author | Thomas Citharel <tcit@tcit.fr> | 2017-05-12 15:02:32 +0200 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2017-05-25 19:09:52 +0200 |
commit | 22a4b20ed04a9c709fbbe3e254ad8b2d7757a38b (patch) | |
tree | 221d5cbf49107a83f223dae6afd8db8fab6ede1f /src/Wallabag/CoreBundle/Resources/views/themes/material | |
parent | 35941d57ee4d06ec3557d4b126d5f6fd263bcf3a (diff) | |
download | wallabag-22a4b20ed04a9c709fbbe3e254ad8b2d7757a38b.tar.gz wallabag-22a4b20ed04a9c709fbbe3e254ad8b2d7757a38b.tar.zst wallabag-22a4b20ed04a9c709fbbe3e254ad8b2d7757a38b.zip |
First draft for notifications
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'src/Wallabag/CoreBundle/Resources/views/themes/material')
5 files changed, 90 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig index 9b0816eb..67073c7d 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig | |||
@@ -3,7 +3,7 @@ | |||
3 | {% block title %}{{ 'config.page_title'|trans }}{% endblock %} | 3 | {% block title %}{{ 'config.page_title'|trans }}{% endblock %} |
4 | 4 | ||
5 | {% block content %} | 5 | {% block content %} |
6 | 6 | {{ parent() }} | |
7 | <div class="row"> | 7 | <div class="row"> |
8 | <div class="col s12"> | 8 | <div class="col s12"> |
9 | <div class="card-panel settings"> | 9 | <div class="card-panel settings"> |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig index b2d91c9c..b74d32b7 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig | |||
@@ -12,6 +12,7 @@ | |||
12 | {% endblock %} | 12 | {% endblock %} |
13 | 13 | ||
14 | {% block content %} | 14 | {% block content %} |
15 | {{ parent() }} | ||
15 | {% set listMode = app.user.config.listMode %} | 16 | {% set listMode = app.user.config.listMode %} |
16 | <div class="results clearfix"> | 17 | <div class="results clearfix"> |
17 | <div class="nb-results left"> | 18 | <div class="nb-results left"> |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Notification/notifications.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Notification/notifications.html.twig new file mode 100644 index 00000000..bc72c704 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Notification/notifications.html.twig | |||
@@ -0,0 +1,42 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | ||
2 | |||
3 | {% block title %}{{ 'notifications.list.page_title' | trans }}{% endblock %} | ||
4 | |||
5 | {% block content %} | ||
6 | <div class="row"> | ||
7 | <div class="col l6 offset-l3"> | ||
8 | <ul class="collection"> | ||
9 | {% for notification in notifications | slice(0, 10) %} | ||
10 | <li class="collection-item avatar{% if not notification.read %} light-blue lighten-5{% else %} grey-text{% endif %}"> | ||
11 | <i class="material-icons circle">{% spaceless %} | ||
12 | {% if notification.type == constant('TYPE_ADMIN', notification) %} | ||
13 | build | ||
14 | {% elseif notification.type == constant('TYPE_USER', notification) %} | ||
15 | person | ||
16 | {% elseif notification.type == constant('TYPE_RELEASE', notification) %} | ||
17 | new_releases | ||
18 | {% endif %} | ||
19 | {% endspaceless %}</i> | ||
20 | <span class="title">{{ notification.title }}</span> | ||
21 | <p><em>{{ notification.timestamp | date }}</p> | ||
22 | <div class="secondary-content"> | ||
23 | {% for action in notification.actions %} | ||
24 | <a class="btn waves-effect waves-light {% spaceless %} | ||
25 | {% if action.type == constant('TYPE_OK', action) %} | ||
26 | {% elseif action.type == constant('TYPE_YES', action) %} | ||
27 | cyan | ||
28 | {% elseif action.type == constant('TYPE_NO', action) %} | ||
29 | red | ||
30 | {% elseif action.type == constant('TYPE_INFO', action) %} | ||
31 | blue-grey | ||
32 | {% endif %} | ||
33 | {% endspaceless %}" href="{{ action.link }}">{{ action.label }}</a> | ||
34 | {% endfor %} | ||
35 | </div> | ||
36 | </li> | ||
37 | {% endfor %} | ||
38 | </ul> | ||
39 | <a href="{{ path('notification-archive-all') }}" class="btn waves-effect waves-light ">{{ 'notifications.list.mark_all_as_read' | trans }}</a> | ||
40 | </div> | ||
41 | </div> | ||
42 | {% endblock %} | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig index c83543ac..01dc4c6a 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig | |||
@@ -3,6 +3,7 @@ | |||
3 | {% block title %}{{ 'tag.page_title'|trans }}{% endblock %} | 3 | {% block title %}{{ 'tag.page_title'|trans }}{% endblock %} |
4 | 4 | ||
5 | {% block content %} | 5 | {% block content %} |
6 | {{ parent() }} | ||
6 | <div class="results clearfix"> | 7 | <div class="results clearfix"> |
7 | <div class="nb-results left">{{ 'tag.list.number_on_the_page'|transchoice(tags|length) }}</div> | 8 | <div class="nb-results left">{{ 'tag.list.number_on_the_page'|transchoice(tags|length) }}</div> |
8 | </div> | 9 | </div> |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig index 2dab1c18..6e2828de 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig | |||
@@ -105,6 +105,13 @@ | |||
105 | <i class="material-icons">search</i> | 105 | <i class="material-icons">search</i> |
106 | </a> | 106 | </a> |
107 | </li> | 107 | </li> |
108 | <li id="button_notifications"> | ||
109 | {% set unreadNotifs = app.user.notifications | unread_notif | length %} | ||
110 | <a class="nav-panel-menu button-collapse-right tooltipped js-notifications-action" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.notifications' | trans }}" href="#" data-activates="notifications"> | ||
111 | <i class="material-icons">notifications{% if unreadNotifs == 0 %}_none{% endif %}</i> | ||
112 | {% if unreadNotifs > 0 %}<span id="notifications-count" class="red-text text-accent-2">{{ unreadNotifs }}</span>{% endif %} | ||
113 | </a> | ||
114 | </li> | ||
108 | <li id="button_filters"> | 115 | <li id="button_filters"> |
109 | <a class="nav-panel-menu button-collapse-right tooltipped js-filters-action" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.filter_entries'|trans }}" href="#" data-activates="filters"> | 116 | <a class="nav-panel-menu button-collapse-right tooltipped js-filters-action" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.filter_entries'|trans }}" href="#" data-activates="filters"> |
110 | <i class="material-icons">filter_list</i> | 117 | <i class="material-icons">filter_list</i> |
@@ -130,6 +137,44 @@ | |||
130 | </nav> | 137 | </nav> |
131 | {% endblock %} | 138 | {% endblock %} |
132 | 139 | ||
140 | {% block content %} | ||
141 | |||
142 | <div id="notifications" class="side-nav"> | ||
143 | <ul class="collection"> | ||
144 | {% for notification in app.user.notifications | slice(0, 10) %} | ||
145 | <li class="notification collection-item avatar{% if not notification.read %} light-blue lighten-5{% else %} grey-text{% endif %}"> | ||
146 | <i class="material-icons circle">{% spaceless %} | ||
147 | {% if notification.type == constant('TYPE_ADMIN', notification) %} | ||
148 | build | ||
149 | {% elseif notification.type == constant('TYPE_USER', notification) %} | ||
150 | person | ||
151 | {% elseif notification.type == constant('TYPE_RELEASE', notification) %} | ||
152 | new_releases | ||
153 | {% endif %} | ||
154 | {% endspaceless %}</i> | ||
155 | <span class="title">{{ notification.title }}</span> | ||
156 | <p><em>{{ notification.timestamp | date }}</em></p> | ||
157 | <div> | ||
158 | {% for action in notification.actions %} | ||
159 | <a class="btn waves-effect waves-light {% spaceless %} | ||
160 | {% if action.type == constant('TYPE_OK', action) %} | ||
161 | {% elseif action.type == constant('TYPE_YES', action) %} | ||
162 | cyan | ||
163 | {% elseif action.type == constant('TYPE_NO', action) %} | ||
164 | red | ||
165 | {% elseif action.type == constant('TYPE_INFO', action) %} | ||
166 | blue-grey | ||
167 | {% endif %} | ||
168 | {% endspaceless %}" href="{{ action.link }}">{{ action.label }}</a> | ||
169 | {% endfor %} | ||
170 | </div> | ||
171 | </li> | ||
172 | {% endfor %} | ||
173 | </ul> | ||
174 | <a class="waves-effect waves-light btn" href="{{ path('notifications-all') }}">{{ 'notifications.sidebar.view_more' | trans }}</a> | ||
175 | </div> | ||
176 | {% endblock %} | ||
177 | |||
133 | {% block footer %} | 178 | {% block footer %} |
134 | <footer class="page-footer cyan darken-2"> | 179 | <footer class="page-footer cyan darken-2"> |
135 | <div class="footer-copyright"> | 180 | <div class="footer-copyright"> |