diff options
author | Jeremy Benoist <j0k3r@users.noreply.github.com> | 2017-02-05 21:08:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-05 21:08:39 +0100 |
commit | 10caff98759d37ca1553895f6325611a994b3f88 (patch) | |
tree | 89db05eb1c7bf85726f1d246fbd41fde5bdefca4 /src/Wallabag/CoreBundle/Resources | |
parent | 20da238413d1c6cc360d58a13df33eb199fa5f05 (diff) | |
parent | 7d9a67de14bd49db96d87058b7bdfc26bdd53f6e (diff) | |
download | wallabag-10caff98759d37ca1553895f6325611a994b3f88.tar.gz wallabag-10caff98759d37ca1553895f6325611a994b3f88.tar.zst wallabag-10caff98759d37ca1553895f6325611a994b3f88.zip |
Merge pull request #2841 from Kdecherf/active-menu-search
Show active list in the left menu during search
Diffstat (limited to 'src/Wallabag/CoreBundle/Resources')
-rw-r--r-- | src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig index d9fb5d73..3c169c04 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig | |||
@@ -33,17 +33,29 @@ | |||
33 | {% endblock %} | 33 | {% endblock %} |
34 | 34 | ||
35 | {% set currentRoute = app.request.attributes.get('_route') %} | 35 | {% set currentRoute = app.request.attributes.get('_route') %} |
36 | {% set currentRouteFromQueryParams = app.request.query.get('currentRoute') %} | ||
36 | 37 | ||
37 | <li class="bold {% if currentRoute == 'unread' or currentRoute == 'homepage' %}active{% endif %}"> | 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 %}"> | ||
38 | <a class="waves-effect" href="{{ path('unread') }}">{{ 'menu.left.unread'|trans }} <span class="numberItems grey-text">{{ count_entries('unread') }}</span></a> | 50 | <a class="waves-effect" href="{{ path('unread') }}">{{ 'menu.left.unread'|trans }} <span class="numberItems grey-text">{{ count_entries('unread') }}</span></a> |
39 | </li> | 51 | </li> |
40 | <li class="bold {% if currentRoute == 'starred' %}active{% endif %}"> | 52 | <li class="bold {% if activeRoute == 'starred' %}active{% endif %}"> |
41 | <a class="waves-effect" href="{{ path('starred') }}">{{ 'menu.left.starred'|trans }} <span class="numberItems grey-text">{{ count_entries('starred') }}</span></a> | 53 | <a class="waves-effect" href="{{ path('starred') }}">{{ 'menu.left.starred'|trans }} <span class="numberItems grey-text">{{ count_entries('starred') }}</span></a> |
42 | </li> | 54 | </li> |
43 | <li class="bold {% if currentRoute == 'archive' %}active{% endif %}"> | 55 | <li class="bold {% if activeRoute == 'archive' %}active{% endif %}"> |
44 | <a class="waves-effect" href="{{ path('archive') }}">{{ 'menu.left.archive'|trans }} <span class="numberItems grey-text">{{ count_entries('archive') }}</span></a> | 56 | <a class="waves-effect" href="{{ path('archive') }}">{{ 'menu.left.archive'|trans }} <span class="numberItems grey-text">{{ count_entries('archive') }}</span></a> |
45 | </li> | 57 | </li> |
46 | <li class="bold {% if currentRoute == 'all' %}active{% endif %}"> | 58 | <li class="bold {% if activeRoute == 'all' %}active{% endif %}"> |
47 | <a class="waves-effect" href="{{ path('all') }}">{{ 'menu.left.all_articles'|trans }} <span class="numberItems grey-text">{{ count_entries('all') }}</span></a> | 59 | <a class="waves-effect" href="{{ path('all') }}">{{ 'menu.left.all_articles'|trans }} <span class="numberItems grey-text">{{ count_entries('all') }}</span></a> |
48 | </li> | 60 | </li> |
49 | <li class="bold border-bottom {% if currentRoute == 'tags' %}active{% endif %}"> | 61 | <li class="bold border-bottom {% if currentRoute == 'tags' %}active{% endif %}"> |