]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig
Adds Webpack support and removes the use for Grunt
[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('bundles/wallabagcore/material.css') }}">
7 {% endif %}
8 {% endblock %}
9
10 {% block scripts %}
11 {{ parent() }}
12 <script src="{{ asset('bundles/wallabagcore/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('bundles/wallabagcore/themes/_global/img/logo-square.png') }}" 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 {% endif %}
50
51 <li class="bold {% if activeRoute == 'unread' %}active{% endif %}">
52 <a class="waves-effect" href="{{ path('unread') }}">{{ 'menu.left.unread'|trans }} <span class="numberItems grey-text">{{ count_entries('unread') }}</span></a>
53 </li>
54 <li class="bold {% if activeRoute == 'starred' %}active{% endif %}">
55 <a class="waves-effect" href="{{ path('starred') }}">{{ 'menu.left.starred'|trans }} <span class="numberItems grey-text">{{ count_entries('starred') }}</span></a>
56 </li>
57 <li class="bold {% if activeRoute == 'archive' %}active{% endif %}">
58 <a class="waves-effect" href="{{ path('archive') }}">{{ 'menu.left.archive'|trans }} <span class="numberItems grey-text">{{ count_entries('archive') }}</span></a>
59 </li>
60 <li class="bold {% if activeRoute == 'all' %}active{% endif %}">
61 <a class="waves-effect" href="{{ path('all') }}">{{ 'menu.left.all_articles'|trans }} <span class="numberItems grey-text">{{ count_entries('all') }}</span></a>
62 </li>
63 <li class="bold border-bottom {% if currentRoute == 'tags' %}active{% endif %}">
64 <a class="waves-effect" href="{{ path('tag') }}">{{ 'menu.left.tags'|trans }} <span class="numberItems grey-text">{{ count_tags() }}</span></a>
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>
69 {% if is_granted('ROLE_SUPER_ADMIN') %}
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
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>
77 {% endif %}
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">
88 <a class="waves-effect icon icon-power" href="{{ path('fos_user_security_logout') }}">{{ 'menu.left.logout'|trans }}</a>
89 </li>
90 </ul>
91 <div class="nav-wrapper nav-panels">
92 <a href="#" data-activates="slide-out" class="nav-panel-menu button-collapse"><i class="material-icons">menu</i></a>
93 <div class="left action">
94 {% block title %}
95 {% endblock %}
96 </div>
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>
108 <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">
110 <i class="material-icons">filter_list</i>
111 </a>
112 </li>
113 <li id="button_export">
114 <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">
115 <i class="material-icons">file_download</i>
116 </a>
117 </li>
118 </ul>
119 <div class="input-field nav-panel-search" style="display: none">
120 {{ render(controller("WallabagCoreBundle:Entry:searchForm", {'currentRoute': app.request.attributes.get('_route')})) }}
121 <label for="search"><i class="material-icons search">search</i></label>
122 <i class="material-icons close">clear</i>
123 </div>
124 <div class="input-field nav-panel-add" style="display: none">
125 {{ render(controller("WallabagCoreBundle:Entry:addEntryForm")) }}
126 <label for="add"><i class="material-icons add">add</i></label>
127 <i class="material-icons close">clear</i>
128 </div>
129 </div>
130 </nav>
131 {% endblock %}
132
133 {% block footer %}
134 <footer class="page-footer cyan darken-2">
135 <div class="footer-copyright">
136 <div class="container">
137 <div class="row">
138 <div class="col m12 l8 hide-on-small-only">
139 <p title="{{ display_stats() | raw | striptags }}">
140 {{ display_stats() }}
141 </p>
142 </div>
143 <div class="col s12 l4">
144 <p>
145 {{ 'footer.wallabag.powered_by'|trans }} <a target="_blank" href="https://wallabag.org" class="grey-text text-lighten-4">wallabag</a> –
146 <a class="grey-text text-lighten-4" href="{{ path('about') }}">{{ 'footer.wallabag.about'|trans|lower }}</a>
147 </p>
148 </div>
149 </div>
150 </div>
151 </div>
152 </footer>
153 {% endblock %}