]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig
Merge pull request #2841 from Kdecherf/active-menu-search
[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 <link rel="stylesheet" href="{{ asset('bundles/wallabagcore/themes/material/css/style.min.css') }}" media="screen,projection,print"/>
6 {% endblock %}
7
8 {% block scripts %}
9 {{ parent() }}
10 <script src="{{ asset('bundles/wallabagcore/themes/material/js/material.min.js') }}"></script>
11 {% endblock %}
12
13 {% block header %}
14 {% endblock %}
15
16 {% block messages %}
17 {% for flashMessage in app.session.flashbag.get('notice') %}
18 <script>
19 Materialize.toast('{{ flashMessage|trans }}', 4000);
20 </script>
21 {% endfor %}
22 {% endblock %}
23
24 {% block menu %}
25 <nav class="cyan darken-1">
26 <ul id="slide-out" class="side-nav fixed">
27 {% block logo %}
28 <li class="logo border-bottom">
29 <a title="{{ 'menu.left.back_to_unread'|trans }}" href="{{ path('unread') }}">
30 <img src="{{ asset('bundles/wallabagcore/themes/_global/img/logo-square.png') }}" alt="wallabag logo" />
31 </a>
32 </li>
33 {% endblock %}
34
35 {% set currentRoute = app.request.attributes.get('_route') %}
36 {% set currentRouteFromQueryParams = app.request.query.get('currentRoute') %}
37
38 {% set activeRoute = null %}
39 {% if currentRoute == 'all' or currentRouteFromQueryParams == 'all' %}
40 {% set activeRoute = 'all' %}
41 {% elseif currentRoute == 'archive' or currentRouteFromQueryParams == 'archive' %}
42 {% set activeRoute = 'archive' %}
43 {% elseif currentRoute == 'starred' or currentRouteFromQueryParams == 'starred' %}
44 {% set activeRoute = 'starred' %}
45 {% elseif currentRoute == 'unread' or currentRoute == 'homepage' or currentRouteFromQueryParams == 'unread' %}
46 {% set activeRoute = 'unread' %}
47 {% endif %}
48
49 <li class="bold {% if activeRoute == 'unread' %}active{% endif %}">
50 <a class="waves-effect" href="{{ path('unread') }}">{{ 'menu.left.unread'|trans }} <span class="numberItems grey-text">{{ count_entries('unread') }}</span></a>
51 </li>
52 <li class="bold {% if activeRoute == 'starred' %}active{% endif %}">
53 <a class="waves-effect" href="{{ path('starred') }}">{{ 'menu.left.starred'|trans }} <span class="numberItems grey-text">{{ count_entries('starred') }}</span></a>
54 </li>
55 <li class="bold {% if activeRoute == 'archive' %}active{% endif %}">
56 <a class="waves-effect" href="{{ path('archive') }}">{{ 'menu.left.archive'|trans }} <span class="numberItems grey-text">{{ count_entries('archive') }}</span></a>
57 </li>
58 <li class="bold {% if activeRoute == 'all' %}active{% endif %}">
59 <a class="waves-effect" href="{{ path('all') }}">{{ 'menu.left.all_articles'|trans }} <span class="numberItems grey-text">{{ count_entries('all') }}</span></a>
60 </li>
61 <li class="bold border-bottom {% if currentRoute == 'tags' %}active{% endif %}">
62 <a class="waves-effect" href="{{ path('tag') }}">{{ 'menu.left.tags'|trans }} <span class="numberItems grey-text">{{ count_tags() }}</span></a>
63 </li>
64 <li class="bold {% if currentRoute == 'config' %}active{% endif %}">
65 <a class="waves-effect" href="{{ path('config') }}">{{ 'menu.left.config'|trans }}</a>
66 </li>
67 {% if is_granted('ROLE_SUPER_ADMIN') %}
68 <li class="bold {% if currentRoute starts with 'user_' %}active{% endif %}">
69 <a class="waves-effect" href="{{ path('user_index') }}">{{ 'menu.left.users_management'|trans }}</a>
70 </li>
71
72 <li class="bold border-bottom {% if currentRoute == 'craue_config_settings_modify' %}active{% endif %}">
73 <a class="waves-effect" href="{{ path('craue_config_settings_modify') }}">{{ 'menu.left.internal_settings'|trans }}</a>
74 </li>
75 {% endif %}
76 <li class="bold {% if currentRoute == 'import' %}active{% endif %}">
77 <a class="waves-effect" href="{{ path('import') }}">{{ 'menu.left.import'|trans }}</a>
78 </li>
79 <li class="bold {% if currentRoute == 'developer' %}active{% endif %}">
80 <a class="waves-effect" href="{{ path('developer') }}">{{ 'menu.left.developer'|trans }}</a>
81 </li>
82 <li class="bold {% if currentRoute == 'howto' %}active{% endif %}">
83 <a class="waves-effect" href="{{ path('howto') }}">{{ 'menu.left.howto'|trans }}</a>
84 </li>
85 <li class="bold">
86 <a class="waves-effect icon icon-power" href="{{ path('fos_user_security_logout') }}">{{ 'menu.left.logout'|trans }}</a>
87 </li>
88 </ul>
89 <div class="nav-wrapper nav-panels">
90 <a href="#" data-activates="slide-out" class="nav-panel-menu button-collapse"><i class="material-icons">menu</i></a>
91 <div class="left action">
92 {% block title %}
93 {% endblock %}
94 </div>
95 <ul class="input-field nav-panel-buttom">
96 <li class="bold">
97 <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">
98 <i class="material-icons">add</i>
99 </a>
100 </li>
101 <li>
102 <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">
103 <i class="material-icons">search</i>
104 </a>
105 </li>
106 <li id="button_filters">
107 <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">
108 <i class="material-icons">filter_list</i>
109 </a>
110 </li>
111 <li id="button_export">
112 <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">
113 <i class="material-icons">file_download</i>
114 </a>
115 </li>
116 </ul>
117 <div class="input-field nav-panel-search" style="display: none">
118 {{ render(controller("WallabagCoreBundle:Entry:searchForm", {'currentRoute': app.request.attributes.get('_route')})) }}
119 <label for="search" class="active"><i class="material-icons search">search</i></label>
120 <i class="material-icons close">clear</i>
121 </div>
122 <div class="input-field nav-panel-add" style="display: none">
123 {{ render(controller("WallabagCoreBundle:Entry:addEntryForm")) }}
124 <label for="add" class="active"><i class="material-icons add">add</i></label>
125 <i class="material-icons close">clear</i>
126 </div>
127 </div>
128 </nav>
129 {% endblock %}
130
131 {% block footer %}
132 <footer class="page-footer cyan darken-2">
133 <div class="footer-copyright">
134 <div class="container">
135 <div class="row">
136 <div class="col m12 l8 hide-on-small-only">
137 <p title="{{ display_stats() | raw | striptags }}">
138 {{ display_stats() }}
139 </p>
140 </div>
141 <div class="col s12 l4">
142 <p>
143 {{ 'footer.wallabag.powered_by'|trans }} <a target="_blank" href="https://wallabag.org" class="grey-text text-lighten-4">wallabag</a> –
144 <a class="grey-text text-lighten-4" href="{{ path('about') }}">{{ 'footer.wallabag.about'|trans|lower }}</a>
145 </p>
146 </div>
147 </div>
148 </div>
149 </div>
150 </footer>
151 {% endblock %}