]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig
d9b6d190a188e4a3c0b790788fe36ab25ba9ea50
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Resources / views / themes / material / layout.html.twig
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 {% 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
85 <li class="bold border-bottom {% if currentRoute == 'ignore_origin_instance_rules_index' %}active{% endif %}">
86 <a class="waves-effect" href="{{ path('ignore_origin_instance_rules_index') }}">{{ 'menu.left.ignore_origin_instance_rules'|trans }}</a>
87 </li>
88 {% endif %}
89 <li class="bold {% if currentRoute == 'import' %}active{% endif %}">
90 <a class="waves-effect" href="{{ path('import') }}">{{ 'menu.left.import'|trans }}</a>
91 </li>
92 <li class="bold {% if currentRoute == 'developer' %}active{% endif %}">
93 <a class="waves-effect" href="{{ path('developer') }}">{{ 'menu.left.developer'|trans }}</a>
94 </li>
95 <li class="bold {% if currentRoute == 'howto' %}active{% endif %}">
96 <a class="waves-effect" href="{{ path('howto') }}">{{ 'menu.left.howto'|trans }}</a>
97 </li>
98 <li class="bold {% if currentRoute == 'quickstart' %}active{% endif %}">
99 <a class="waves-effect" href="{{ path('quickstart') }}">{{ 'menu.left.quickstart'|trans }}</a>
100 </li>
101 <li class="bold">
102 <a class="waves-effect icon icon-power" href="{{ path('fos_user_security_logout') }}">{{ 'menu.left.logout'|trans }}</a>
103 </li>
104 </ul>
105 <div class="nav-panels">
106 <div class="nav-panel-actions nav-panel-item">
107 <div class="nav-panel-top">
108 <button data-activates="slide-out" class="nav-panel-menu button-collapse"><i class="material-icons">menu</i></button>
109 <h1 class="left action">
110 {% block title %}
111 {% endblock %}
112 </h1>
113 </div>
114 <ul class="input-field nav-panel-buttom">
115 <li class="bold">
116 <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">
117 <i class="material-icons">add</i>
118 </a>
119 </li>
120 <li>
121 <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">
122 <i class="material-icons">search</i>
123 </a>
124 </li>
125 {% if activeRoute %}
126 <li id="button_random">
127 <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 }) }}">
128 <i class="material-icons">casino</i>
129 </a>
130 </li>
131 {% endif %}
132 <li id="button_filters">
133 <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">
134 <i class="material-icons">filter_list</i>
135 </a>
136 </li>
137 <li id="button_export">
138 <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">
139 <i class="material-icons">file_download</i>
140 </a>
141 </li>
142 </ul>
143 </div>
144 {{ render(controller("WallabagCoreBundle:Entry:searchForm", {'currentRoute': currentRoute})) }}
145 {{ render(controller("WallabagCoreBundle:Entry:addEntryForm")) }}
146 </div>
147 </nav>
148 {% endblock %}
149
150 {% block footer %}
151 <footer class="page-footer cyan darken-2">
152 <div class="footer-copyright">
153 <div class="container">
154 <div class="row">
155 <div class="col m12 l8">
156 <p class="footer-text" title="{{ display_stats() | raw | striptags }}">
157 {{ display_stats() }}
158 </p>
159 </div>
160 <div class="col s12 l4">
161 <p class="footer-text">
162 {{ 'footer.wallabag.powered_by'|trans }} <a target="_blank" rel="noopener" href="https://wallabag.org" class="grey-text text-lighten-4">wallabag</a> –
163 <a class="grey-text text-lighten-4" href="{{ path('about') }}">{{ 'footer.wallabag.about'|trans|lower }}</a>
164 </p>
165 </div>
166 </div>
167 </div>
168 </div>
169 </footer>
170 {% endblock %}