]>
Commit | Line | Data |
---|---|---|
1 | {% extends "WallabagCoreBundle::base.html.twig" %} | |
2 | ||
3 | {% block css %} | |
4 | {{ parent() }} | |
5 | {% if not app.debug %} | |
6 | <link rel="stylesheet" href="{{ asset('wallassets/material.css') }}"> | |
7 | {% endif %} | |
8 | {% endblock %} | |
9 | ||
10 | {% block scripts %} | |
11 | {{ parent() }} | |
12 | <script src="{{ asset('wallassets/material' ~ (app.debug ? '.dev' : '') ~ '.js') }}"></script> | |
13 | {% endblock %} | |
14 | ||
15 | {% block header %} | |
16 | {% endblock %} | |
17 | ||
18 | {% block messages %} | |
19 | {% for flashMessage in app.session.flashbag.get('notice') %} | |
20 | <script> | |
21 | Materialize.toast('{{ flashMessage|trans }}', 4000); | |
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"> | |
31 | <a title="{{ 'menu.left.back_to_unread'|trans }}" href="{{ path('unread') }}"> | |
32 | <img src="{{ asset('wallassets/themes/_global/img/logo-square.svg') }}" alt="wallabag logo" /> | |
33 | </a> | |
34 | </li> | |
35 | {% endblock %} | |
36 | ||
37 | {% set currentRoute = app.request.attributes.get('_route') %} | |
38 | {% set currentRouteFromQueryParams = app.request.query.get('currentRoute') %} | |
39 | ||
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 | {% elseif currentRoute == 'untagged' %} | |
50 | {% set activeRoute = 'untagged' %} | |
51 | {% endif %} | |
52 | ||
53 | <li class="bold {% if activeRoute == 'unread' %}active{% endif %}"> | |
54 | <a class="waves-effect" href="{{ path('unread') }}">{{ 'menu.left.unread'|trans }} <span class="numberItems grey-text">{{ count_entries('unread') }}</span></a> | |
55 | </li> | |
56 | <li class="bold {% if activeRoute == 'starred' %}active{% endif %}"> | |
57 | <a class="waves-effect" href="{{ path('starred') }}">{{ 'menu.left.starred'|trans }} <span class="numberItems grey-text">{{ count_entries('starred') }}</span></a> | |
58 | </li> | |
59 | <li class="bold {% if activeRoute == 'archive' %}active{% endif %}"> | |
60 | <a class="waves-effect" href="{{ path('archive') }}">{{ 'menu.left.archive'|trans }} <span class="numberItems grey-text">{{ count_entries('archive') }}</span></a> | |
61 | </li> | |
62 | <li class="bold {% if activeRoute == 'all' %}active{% endif %}"> | |
63 | <a class="waves-effect" href="{{ path('all') }}">{{ 'menu.left.all_articles'|trans }} <span class="numberItems grey-text">{{ count_entries('all') }}</span></a> | |
64 | </li> | |
65 | <li class="bold border-bottom {% if currentRoute == 'tags' %}active{% endif %}"> | |
66 | <a class="waves-effect" href="{{ path('tag') }}">{{ 'menu.left.tags'|trans }} <span class="numberItems grey-text">{{ count_tags() }}</span></a> | |
67 | </li> | |
68 | <li class="bold {% if currentRoute == 'config' %}active{% endif %}"> | |
69 | <a class="waves-effect" href="{{ path('config') }}">{{ 'menu.left.config'|trans }}</a> | |
70 | </li> | |
71 | {% if craue_setting('restricted_access') %} | |
72 | <li class="bold {% if currentRoute starts with 'site_credentials_' %}active{% endif %}"> | |
73 | <a class="waves-effect" href="{{ path('site_credentials_index') }}">{{ 'menu.left.site_credentials'|trans }}</a> | |
74 | </li> | |
75 | {% endif %} | |
76 | {% if is_granted('ROLE_SUPER_ADMIN') %} | |
77 | <li class="bold {% if currentRoute starts with 'user_' %}active{% endif %}"> | |
78 | <a class="waves-effect" href="{{ path('user_index') }}">{{ 'menu.left.users_management'|trans }}</a> | |
79 | </li> | |
80 | ||
81 | <li class="bold border-bottom {% if currentRoute == 'craue_config_settings_modify' %}active{% endif %}"> | |
82 | <a class="waves-effect" href="{{ path('craue_config_settings_modify') }}">{{ 'menu.left.internal_settings'|trans }}</a> | |
83 | </li> | |
84 | {% endif %} | |
85 | <li class="bold {% if currentRoute == 'import' %}active{% endif %}"> | |
86 | <a class="waves-effect" href="{{ path('import') }}">{{ 'menu.left.import'|trans }}</a> | |
87 | </li> | |
88 | <li class="bold {% if currentRoute == 'developer' %}active{% endif %}"> | |
89 | <a class="waves-effect" href="{{ path('developer') }}">{{ 'menu.left.developer'|trans }}</a> | |
90 | </li> | |
91 | <li class="bold {% if currentRoute == 'howto' %}active{% endif %}"> | |
92 | <a class="waves-effect" href="{{ path('howto') }}">{{ 'menu.left.howto'|trans }}</a> | |
93 | </li> | |
94 | <li class="bold"> | |
95 | <a class="waves-effect icon icon-power" href="{{ path('fos_user_security_logout') }}">{{ 'menu.left.logout'|trans }}</a> | |
96 | </li> | |
97 | </ul> | |
98 | <div class="nav-panels"> | |
99 | <div class="nav-panel-actions nav-panel-item"> | |
100 | <div class="nav-panel-top"> | |
101 | <button data-activates="slide-out" class="nav-panel-menu button-collapse"><i class="material-icons">menu</i></button> | |
102 | <h1 class="left action"> | |
103 | {% block title %} | |
104 | {% endblock %} | |
105 | </h1> | |
106 | </div> | |
107 | <ul class="input-field nav-panel-buttom"> | |
108 | <li class="bold"> | |
109 | <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"> | |
110 | <i class="material-icons">add</i> | |
111 | </a> | |
112 | </li> | |
113 | <li> | |
114 | <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"> | |
115 | <i class="material-icons">search</i> | |
116 | </a> | |
117 | </li> | |
118 | {% if activeRoute %} | |
119 | <li id="button_random"> | |
120 | <a class="waves-effect tooltipped js-random-action" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.random_entry'|trans }}" href="{{ path('random_entry', { 'type': activeRoute }) }}"> | |
121 | <i class="material-icons">casino</i> | |
122 | </a> | |
123 | </li> | |
124 | {% endif %} | |
125 | <li id="button_filters"> | |
126 | <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"> | |
127 | <i class="material-icons">filter_list</i> | |
128 | </a> | |
129 | </li> | |
130 | <li id="button_export"> | |
131 | <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"> | |
132 | <i class="material-icons">file_download</i> | |
133 | </a> | |
134 | </li> | |
135 | </ul> | |
136 | </div> | |
137 | {{ render(controller("WallabagCoreBundle:Entry:searchForm", {'currentRoute': currentRoute})) }} | |
138 | {{ render(controller("WallabagCoreBundle:Entry:addEntryForm")) }} | |
139 | </div> | |
140 | </nav> | |
141 | {% endblock %} | |
142 | ||
143 | {% block footer %} | |
144 | <footer class="page-footer cyan darken-2"> | |
145 | <div class="footer-copyright"> | |
146 | <div class="container"> | |
147 | <div class="row"> | |
148 | <div class="col m12 l8"> | |
149 | <p class="footer-text" title="{{ display_stats() | raw | striptags }}"> | |
150 | {{ display_stats() }} | |
151 | </p> | |
152 | </div> | |
153 | <div class="col s12 l4"> | |
154 | <p class="footer-text"> | |
155 | {{ 'footer.wallabag.powered_by'|trans }} <a target="_blank" rel="noopener" href="https://wallabag.org" class="grey-text text-lighten-4">wallabag</a> – | |
156 | <a class="grey-text text-lighten-4" href="{{ path('about') }}">{{ 'footer.wallabag.about'|trans|lower }}</a> | |
157 | </p> | |
158 | </div> | |
159 | </div> | |
160 | </div> | |
161 | </div> | |
162 | </footer> | |
163 | {% endblock %} |