]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig
Show active list in the left menu during search
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Resources / views / themes / material / layout.html.twig
index e5bfc62c734b336ceefb1c0e743b5409eb29cbf9..3c169c04fce17c4071d43b4af4e17d69e6272182 100644 (file)
@@ -19,8 +19,6 @@
             Materialize.toast('{{ flashMessage|trans }}', 4000);
         </script>
     {% endfor %}
-
-    {{ render(controller("WallabagImportBundle:Import:checkQueue")) }}
 {% endblock %}
 
 {% block menu %}
             {% endblock %}
 
             {% set currentRoute = app.request.attributes.get('_route') %}
+            {% set currentRouteFromQueryParams = app.request.query.get('currentRoute') %}
+
+            {% set activeRoute = null %}
+            {% if currentRoute == 'all' or currentRouteFromQueryParams == 'all' %}
+               {% set activeRoute = 'all' %}
+            {% elseif currentRoute == 'archive' or currentRouteFromQueryParams == 'archive' %}
+               {% set activeRoute = 'archive' %}
+            {% elseif currentRoute == 'starred' or currentRouteFromQueryParams == 'starred' %}
+               {% set activeRoute = 'starred' %}
+            {% elseif currentRoute == 'unread' or currentRoute == 'homepage' or currentRouteFromQueryParams == 'unread' %}
+               {% set activeRoute = 'unread' %}
+            {% endif %}
 
-            <li class="bold {% if currentRoute == 'unread' or currentRoute == 'homepage' %}active{% endif %}">
+            <li class="bold {% if activeRoute == 'unread' %}active{% endif %}">
                 <a class="waves-effect" href="{{ path('unread') }}">{{ 'menu.left.unread'|trans }} <span class="numberItems grey-text">{{ count_entries('unread') }}</span></a>
             </li>
-            <li class="bold {% if currentRoute == 'starred' %}active{% endif %}">
+            <li class="bold {% if activeRoute == 'starred' %}active{% endif %}">
                 <a class="waves-effect" href="{{ path('starred') }}">{{ 'menu.left.starred'|trans }} <span class="numberItems grey-text">{{ count_entries('starred') }}</span></a>
             </li>
-            <li class="bold {% if currentRoute == 'archive' %}active{% endif %}">
+            <li class="bold {% if activeRoute == 'archive' %}active{% endif %}">
                 <a class="waves-effect" href="{{ path('archive') }}">{{ 'menu.left.archive'|trans }} <span class="numberItems grey-text">{{ count_entries('archive') }}</span></a>
             </li>
-            <li class="bold {% if currentRoute == 'all' %}active{% endif %}">
+            <li class="bold {% if activeRoute == 'all' %}active{% endif %}">
                 <a class="waves-effect" href="{{ path('all') }}">{{ 'menu.left.all_articles'|trans }} <span class="numberItems grey-text">{{ count_entries('all') }}</span></a>
             </li>
             <li class="bold border-bottom {% if currentRoute == 'tags' %}active{% endif %}">
                 {% block title %}
                 {% endblock %}
             </div>
-            <div class="input-field nav-panel-buttom">
-                <ul>
-                    <li class="bold">
-                        <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">
-                            <i class="material-icons">add</i>
-                        </a>
-                    </li>
-                    <li>
-                        <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">
-                            <i class="material-icons">search</i>
-                        </a>
-                    </li>
-                    <li id="button_filters">
-                        <a class="nav-panel-menu button-collapse-right tooltipped" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.filter_entries'|trans }}" href="#" data-activates="filters">
-                            <i class="material-icons">filter_list</i>
-                        </a>
-                    </li>
-                    <li id="button_export">
-                        <a class="nav-panel-menu button-collapse-right tooltipped" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.export'|trans }}" href="#" data-activates="export">
-                            <i class="material-icons">file_download</i>
-                        </a>
-                    </li>
-                </ul>
-            </div>
+            <ul class="input-field nav-panel-buttom">
+                <li class="bold">
+                    <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">
+                        <i class="material-icons">add</i>
+                    </a>
+                </li>
+                <li>
+                    <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">
+                        <i class="material-icons">search</i>
+                    </a>
+                </li>
+                <li id="button_filters">
+                    <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">
+                        <i class="material-icons">filter_list</i>
+                    </a>
+                </li>
+                <li id="button_export">
+                    <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">
+                        <i class="material-icons">file_download</i>
+                    </a>
+                </li>
+            </ul>
             <div class="input-field nav-panel-search" style="display: none">
                 {{ render(controller("WallabagCoreBundle:Entry:searchForm", {'currentRoute': app.request.attributes.get('_route')})) }}
                 <label for="search" class="active"><i class="material-icons search">search</i></label>