From: Jeremy Benoist Date: Mon, 24 Aug 2015 18:43:29 +0000 (+0200) Subject: Handle filter form using some JS X-Git-Tag: 2.0.0-alpha.0~1^2~6 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=d2fcbf5d846eabb89714f4c59ff6729e2666a948;p=github%2Fwallabag%2Fwallabag.git Handle filter form using some JS Instead of displaying an ugly form --- 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 0d295431..28bf0ab9 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 @@ -4,24 +4,34 @@ {% block content %} {% block pager %} - {% if entries is not empty %}
{{ entries.count }} {% trans %}entries{% endtrans %}
- - {% endif %} {% endblock %} + + {% if entries is empty %}

{% trans %}No articles found.{% endtrans %}

{% else %} -
{{ form_rest(form) }}
{% for entry in entries %}

{{ entry.title|raw }}

diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/public/css/main.css b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/public/css/main.css index 72a7b205..dee307f3 100755 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/public/css/main.css +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/public/css/main.css @@ -939,6 +939,19 @@ pre code { font-size: 0.96em; } +#filter-form { + margin-top: 30px !important; + width: 500px; + height: 370px; + right: 5em; + left: inherit; +} + +#filter-form form { + width: 500px; + height: 370px; +} + /* ========================================================================== 6 = Media Queries diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/public/js/popupForm.js b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/public/js/popupForm.js index d233e600..b933acd1 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/public/js/popupForm.js +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/public/js/popupForm.js @@ -2,6 +2,7 @@ $(document).ready(function() { $("#search-form").hide(); $("#bagit-form").hide(); + $("#filter-form").hide(); //--------------------------------------------------------------------------- // Toggle the "Search" popup in the sidebar @@ -18,6 +19,13 @@ $(document).ready(function() { } } + //--------------------------------------------------------------------------- + // Toggle the "Filter" popup on entries list + //--------------------------------------------------------------------------- + function toggleFilter() { + $("#filter-form").toggle(); + } + //--------------------------------------------------------------------------- // Toggle the "Save a Link" popup in the sidebar //--------------------------------------------------------------------------- @@ -50,6 +58,11 @@ $(document).ready(function() { $("#searchfield").focus(); }); + $("#filter").click(function(){ + closePopups(); + toggleFilter(); + }); + $("#bagit").click(function(){ closePopups(); toggleBagit(); @@ -60,13 +73,11 @@ $(document).ready(function() { toggleSearch(); }); + $("#filter-form-close").click(function(){ + toggleFilter(); + }); + $("#bagit-form-close").click(function(){ toggleBagit(); }); - - // $("#").click(function(){ - // toggleSearch(); - // }); - - });