]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #1418 from wallabag/v2-previewpicture-filter
authorJeremy Benoist <j0k3r@users.noreply.github.com>
Sun, 13 Sep 2015 08:14:42 +0000 (10:14 +0200)
committerJeremy Benoist <j0k3r@users.noreply.github.com>
Sun, 13 Sep 2015 08:14:42 +0000 (10:14 +0200)
filter for entries with previewPicture

1  2 
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php

index 1ecaecc56a901fe7bf5593df67097ff420394b4c,9a2442a08596e1363d9c73e447fce2964dc274aa..89182d98f3b2f5dde6926b00149dc30d8114537d
@@@ -58,6 -58,7 +58,6 @@@
          {% endfor %}
      </ul>
  
 -
      <!-- Filters -->
      <div id="filters" class="side-nav fixed right-aligned">
          <form action="{{ path('all') }}">
                  <div class="col s12">
                      <label>{% trans %}Status{% endtrans %}</label>
                  </div>
+                 <div class="input-field col s6">
+                     {{ form_widget(form.previewPicture) }}
+                     <label for="entry_filter_previewPicture">{% trans %}Has a preview picture{% endtrans %}</label>
+                 </div>
                  <div class="input-field col s6">
                      {{ form_widget(form.isArchived) }}
                      <label for="entry_filter_isArchived">{% trans %}Archived{% endtrans %}</label>
index a92835b3162b6072014e08e15a123227e376f64f,5798009ca188bbe2d50de6305c057c4c41e3e7f2..77b57884679d0dbd0651ed37ce27ae9ba799908c
@@@ -209,7 -209,7 +209,7 @@@ class EntryControllerTest extends Walla
          $content = $client->getContainer()
              ->get('doctrine.orm.entity_manager')
              ->getRepository('WallabagCoreBundle:Entry')
 -            ->findOneById(1);
 +            ->findOneByIsStarred(false);
  
          $client->request('GET', '/delete/'.$content->getId());
  
          $form['entry_filter[isStarred]']->untick();
  
          $crawler = $client->submit($form);
 -        $this->assertCount(1, $crawler->filter('div[class=entry]'));
 +        $this->assertCount(2, $crawler->filter('div[class=entry]'));
  
          $form = $crawler->filter('button[id=submit-filter]')->form();
          $form['entry_filter[isArchived]']->untick();
          $form['entry_filter[isStarred]']->tick();
  
          $crawler = $client->submit($form);
 -        $this->assertCount(1, $crawler->filter('div[class=entry]'));
 +        $this->assertCount(2, $crawler->filter('div[class=entry]'));
      }
+     public function testPreviewPictureFilter()
+     {
+         $this->logInAs('admin');
+         $client = $this->getClient();
+         $crawler = $client->request('GET', '/unread/list');
+         $form = $crawler->filter('button[id=submit-filter]')->form();
+         $form['entry_filter[previewPicture]']->tick();
+         $crawler = $client->submit($form);
+         $this->assertCount(1, $crawler->filter('div[class=entry]'));
+     }
  }