]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - 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
index d9fb5d73e03508776240f92fc94d5d8b99ee0107..2dab1c186d60e9fd6f2c9b372b2113f3f898928d 100644 (file)
@@ -2,12 +2,14 @@
 
 {% block css %}
     {{ parent() }}
-    <link rel="stylesheet" href="{{ asset('bundles/wallabagcore/themes/material/css/style.min.css') }}"  media="screen,projection,print"/>
+    {% if not app.debug %}
+        <link rel="stylesheet" href="{{ asset('bundles/wallabagcore/material.css') }}">
+    {% endif %}
 {% endblock %}
 
 {% block scripts %}
     {{ parent() }}
-    <script src="{{ asset('bundles/wallabagcore/themes/material/js/material.min.js') }}"></script>
+    <script src="{{ asset('bundles/wallabagcore/material' ~ (app.debug ? '.dev' : '') ~ '.js') }}"></script>
 {% endblock %}
 
 {% block header %}
             {% endblock %}
 
             {% set currentRoute = app.request.attributes.get('_route') %}
+            {% set currentRouteFromQueryParams = app.request.query.get('currentRoute') %}
 
-            <li class="bold {% if currentRoute == 'unread' or currentRoute == 'homepage' %}active{% endif %}">
+            {% 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 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 %}">
             </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>
+                <label for="search"><i class="material-icons search">search</i></label>
                 <i class="material-icons close">clear</i>
             </div>
             <div class="input-field nav-panel-add" style="display: none">
                 {{ render(controller("WallabagCoreBundle:Entry:addEntryForm")) }}
-                <label for="add" class="active"><i class="material-icons add">add</i></label>
+                <label for="add"><i class="material-icons add">add</i></label>
                 <i class="material-icons close">clear</i>
             </div>
         </div>