From: Nicolas LÅ“uillet Date: Sat, 5 Nov 2016 14:24:42 +0000 (+0100) Subject: Added search engine in baggy theme X-Git-Tag: 2.2.0~3^2~59^2~3 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=398de40517356981a9fe1b9185f5f9e5e498c346;p=github%2Fwallabag%2Fwallabag.git Added search engine in baggy theme --- diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig index d1baa283..a13fe903 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig @@ -1,11 +1,14 @@ {% extends "WallabagCoreBundle::layout.html.twig" %} {% block title %} - {% set currentTag = '' %} + {% set filter = '' %} {% if tag is defined %} - {% set currentTag = tag %} + {% set filter = tag %} + {% endif %} + {% if searchTerm is defined and searchTerm is not empty %} + {% set filter = searchTerm %} {% endif %} - {% include "@WallabagCore/themes/common/Entry/_title.html.twig" with {'currentTag': currentTag} %} + {% include "@WallabagCore/themes/common/Entry/_title.html.twig" with {'filter': filter} %} {% endblock %} {% block content %} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/search_form.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/search_form.html.twig new file mode 100644 index 00000000..818513f3 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/search_form.html.twig @@ -0,0 +1,15 @@ +
+

{{ 'menu.left.search'|trans }}

+ × + {% if form_errors(form) %} + {{ form_errors(form) }} + {% endif %} + + {% if form_errors(form.term) %} + {{ form_errors(form.term) }} + {% endif %} + + {{ form_widget(form.term, { 'attr': {'autocomplete': 'off', 'placeholder': 'entry.search.placeholder'} }) }} + + {{ form_rest(form) }} +
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig index cd4ed3fa..fc024aff 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig @@ -31,17 +31,11 @@ - + {% if is_granted('ROLE_SUPER_ADMIN') %} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig index ff555055..00e8bf63 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig @@ -5,7 +5,7 @@ {% if tag is defined %} {% set filter = tag %} {% endif %} - {% if searchTerm is not empty %} + {% if searchTerm is defined and searchTerm is not empty %} {% set filter = searchTerm %} {% endif %} {% include "@WallabagCore/themes/common/Entry/_title.html.twig" with {'filter': filter} %} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/search_form.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/search_form.html.twig index 9b8ac86d..bba6adb1 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/search_form.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/search_form.html.twig @@ -1,5 +1,4 @@ -
+ {% if form_errors(form) %} {{ form_errors(form) }} {% endif %}