]>
Commit | Line | Data |
---|---|---|
53e12188 AD |
1 | {% extends "WallabagCoreBundle::base.html.twig" %} |
2 | ||
3 | {% block css %} | |
4 | {{ parent() }} | |
64f81bc3 TC |
5 | {% if not app.debug %} |
6 | <link rel="stylesheet" href="{{ asset('bundles/wallabagcore/material.css') }}"> | |
7 | {% endif %} | |
53e12188 AD |
8 | {% endblock %} |
9 | ||
10 | {% block scripts %} | |
11 | {{ parent() }} | |
64f81bc3 | 12 | <script src="{{ asset('bundles/wallabagcore/material' ~ (app.debug ? '.dev' : '') ~ '.js') }}"></script> |
53e12188 AD |
13 | {% endblock %} |
14 | ||
15 | {% block header %} | |
16 | {% endblock %} | |
17 | ||
a6523cfe AD |
18 | {% block messages %} |
19 | {% for flashMessage in app.session.flashbag.get('notice') %} | |
20 | <script> | |
8e417206 | 21 | Materialize.toast('{{ flashMessage|trans }}', 4000); |
a6523cfe AD |
22 | </script> |
23 | {% endfor %} | |
24 | {% endblock %} | |
25 | ||
26 | {% block menu %} | |
27 | <nav class="cyan darken-1"> | |
28 | <ul id="slide-out" class="side-nav fixed"> | |
29 | {% block logo %} | |
30 | <li class="logo border-bottom"> | |
0d42217e | 31 | <a title="{{ 'menu.left.back_to_unread'|trans }}" href="{{ path('unread') }}"> |
5ecdfcd0 | 32 | <img src="{{ asset('bundles/wallabagcore/themes/_global/img/logo-square.png') }}" alt="wallabag logo" /> |
a6523cfe AD |
33 | </a> |
34 | </li> | |
35 | {% endblock %} | |
36 | ||
37 | {% set currentRoute = app.request.attributes.get('_route') %} | |
7d9a67de | 38 | {% set currentRouteFromQueryParams = app.request.query.get('currentRoute') %} |
a6523cfe | 39 | |
7d9a67de KD |
40 | {% set activeRoute = null %} |
41 | {% if currentRoute == 'all' or currentRouteFromQueryParams == 'all' %} | |
42 | {% set activeRoute = 'all' %} | |
43 | {% elseif currentRoute == 'archive' or currentRouteFromQueryParams == 'archive' %} | |
44 | {% set activeRoute = 'archive' %} | |
45 | {% elseif currentRoute == 'starred' or currentRouteFromQueryParams == 'starred' %} | |
46 | {% set activeRoute = 'starred' %} | |
47 | {% elseif currentRoute == 'unread' or currentRoute == 'homepage' or currentRouteFromQueryParams == 'unread' %} | |
48 | {% set activeRoute = 'unread' %} | |
49 | {% endif %} | |
50 | ||
51 | <li class="bold {% if activeRoute == 'unread' %}active{% endif %}"> | |
59ddb9ae | 52 | <a class="waves-effect" href="{{ path('unread') }}">{{ 'menu.left.unread'|trans }} <span class="numberItems grey-text">{{ count_entries('unread') }}</span></a> |
0d42217e | 53 | </li> |
7d9a67de | 54 | <li class="bold {% if activeRoute == 'starred' %}active{% endif %}"> |
59ddb9ae | 55 | <a class="waves-effect" href="{{ path('starred') }}">{{ 'menu.left.starred'|trans }} <span class="numberItems grey-text">{{ count_entries('starred') }}</span></a> |
0d42217e | 56 | </li> |
7d9a67de | 57 | <li class="bold {% if activeRoute == 'archive' %}active{% endif %}"> |
59ddb9ae | 58 | <a class="waves-effect" href="{{ path('archive') }}">{{ 'menu.left.archive'|trans }} <span class="numberItems grey-text">{{ count_entries('archive') }}</span></a> |
0d42217e | 59 | </li> |
7d9a67de | 60 | <li class="bold {% if activeRoute == 'all' %}active{% endif %}"> |
59ddb9ae | 61 | <a class="waves-effect" href="{{ path('all') }}">{{ 'menu.left.all_articles'|trans }} <span class="numberItems grey-text">{{ count_entries('all') }}</span></a> |
0d42217e JB |
62 | </li> |
63 | <li class="bold border-bottom {% if currentRoute == 'tags' %}active{% endif %}"> | |
429d86f3 | 64 | <a class="waves-effect" href="{{ path('tag') }}">{{ 'menu.left.tags'|trans }} <span class="numberItems grey-text">{{ count_tags() }}</span></a> |
0d42217e JB |
65 | </li> |
66 | <li class="bold {% if currentRoute == 'config' %}active{% endif %}"> | |
67 | <a class="waves-effect" href="{{ path('config') }}">{{ 'menu.left.config'|trans }}</a> | |
68 | </li> | |
63e40f2d | 69 | {% if is_granted('ROLE_SUPER_ADMIN') %} |
152fcccd JB |
70 | <li class="bold {% if currentRoute starts with 'user_' %}active{% endif %}"> |
71 | <a class="waves-effect" href="{{ path('user_index') }}">{{ 'menu.left.users_management'|trans }}</a> | |
72 | </li> | |
73 | ||
0d42217e JB |
74 | <li class="bold border-bottom {% if currentRoute == 'craue_config_settings_modify' %}active{% endif %}"> |
75 | <a class="waves-effect" href="{{ path('craue_config_settings_modify') }}">{{ 'menu.left.internal_settings'|trans }}</a> | |
76 | </li> | |
63e40f2d | 77 | {% endif %} |
0d42217e JB |
78 | <li class="bold {% if currentRoute == 'import' %}active{% endif %}"> |
79 | <a class="waves-effect" href="{{ path('import') }}">{{ 'menu.left.import'|trans }}</a> | |
80 | </li> | |
81 | <li class="bold {% if currentRoute == 'developer' %}active{% endif %}"> | |
82 | <a class="waves-effect" href="{{ path('developer') }}">{{ 'menu.left.developer'|trans }}</a> | |
83 | </li> | |
84 | <li class="bold {% if currentRoute == 'howto' %}active{% endif %}"> | |
85 | <a class="waves-effect" href="{{ path('howto') }}">{{ 'menu.left.howto'|trans }}</a> | |
86 | </li> | |
87 | <li class="bold"> | |
c5e4293e | 88 | <a class="waves-effect icon icon-power" href="{{ path('fos_user_security_logout') }}">{{ 'menu.left.logout'|trans }}</a> |
0d42217e | 89 | </li> |
a6523cfe AD |
90 | </ul> |
91 | <div class="nav-wrapper nav-panels"> | |
5ecdfcd0 | 92 | <a href="#" data-activates="slide-out" class="nav-panel-menu button-collapse"><i class="material-icons">menu</i></a> |
a6523cfe | 93 | <div class="left action"> |
a64f1d9f NL |
94 | {% block title %} |
95 | {% endblock %} | |
a6523cfe | 96 | </div> |
22d0c929 S |
97 | <ul class="input-field nav-panel-buttom"> |
98 | <li class="bold"> | |
99 | <a class="waves-effect tooltipped" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.add_new_entry'|trans }}" href="{{ path('new') }}" id="nav-btn-add"> | |
100 | <i class="material-icons">add</i> | |
101 | </a> | |
102 | </li> | |
103 | <li> | |
104 | <a class="waves-effect tooltipped" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.search'|trans }}" href="javascript: void(null);" id="nav-btn-search"> | |
105 | <i class="material-icons">search</i> | |
106 | </a> | |
107 | </li> | |
22a4b20e TC |
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> | |
22d0c929 | 115 | <li id="button_filters"> |
ccb9e79a | 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"> |
22d0c929 S |
117 | <i class="material-icons">filter_list</i> |
118 | </a> | |
119 | </li> | |
120 | <li id="button_export"> | |
ccb9e79a | 121 | <a class="nav-panel-menu button-collapse-right tooltipped js-export-action" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.export'|trans }}" href="#" data-activates="export"> |
22d0c929 S |
122 | <i class="material-icons">file_download</i> |
123 | </a> | |
124 | </li> | |
125 | </ul> | |
ee122a75 | 126 | <div class="input-field nav-panel-search" style="display: none"> |
49b042df | 127 | {{ render(controller("WallabagCoreBundle:Entry:searchForm", {'currentRoute': app.request.attributes.get('_route')})) }} |
64f81bc3 | 128 | <label for="search"><i class="material-icons search">search</i></label> |
ee122a75 NL |
129 | <i class="material-icons close">clear</i> |
130 | </div> | |
053b9568 | 131 | <div class="input-field nav-panel-add" style="display: none"> |
0d42217e | 132 | {{ render(controller("WallabagCoreBundle:Entry:addEntryForm")) }} |
64f81bc3 | 133 | <label for="add"><i class="material-icons add">add</i></label> |
5ecdfcd0 | 134 | <i class="material-icons close">clear</i> |
053b9568 | 135 | </div> |
a6523cfe AD |
136 | </div> |
137 | </nav> | |
138 | {% endblock %} | |
4e9f656e | 139 | |
22a4b20e TC |
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 | ||
4e9f656e | 178 | {% block footer %} |
e77cde45 NL |
179 | <footer class="page-footer cyan darken-2"> |
180 | <div class="footer-copyright"> | |
181 | <div class="container"> | |
1264029c | 182 | <div class="row"> |
d56d416d TC |
183 | <div class="col m12 l8 hide-on-small-only"> |
184 | <p title="{{ display_stats() | raw | striptags }}"> | |
1264029c JB |
185 | {{ display_stats() }} |
186 | </p> | |
187 | </div> | |
d56d416d | 188 | <div class="col s12 l4"> |
1264029c JB |
189 | <p> |
190 | {{ 'footer.wallabag.powered_by'|trans }} <a target="_blank" href="https://wallabag.org" class="grey-text text-lighten-4">wallabag</a> – | |
191 | <a class="grey-text text-lighten-4" href="{{ path('about') }}">{{ 'footer.wallabag.about'|trans|lower }}</a> | |
192 | </p> | |
193 | </div> | |
194 | </div> | |
e77cde45 NL |
195 | </div> |
196 | </div> | |
197 | </footer> | |
4e9f656e | 198 | {% endblock %} |