diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index b6a689633..b73e9eecd 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -101,6 +101,21 @@ class EntryController extends Controller )); } + /** + * Shows all entries for current user. + * + * @param Request $request + * @param int $page + * + * @Route("/all/list/{page}", name="all", defaults={"page" = "1"}) + * + * @return \Symfony\Component\HttpFoundation\Response + */ + public function showAllAction(Request $request, $page) + { + return $this->showEntries('all', $request, $page); + } + /** * Shows unread entries for current user. * @@ -173,6 +188,10 @@ class EntryController extends Controller $qb = $repository->getBuilderForUnreadByUser($this->getUser()->getId()); break; + case 'all': + $qb = $repository->getBuilderForAllByUser($this->getUser()->getId()); + break; + default: throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type)); } diff --git a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php index 771daef17..ff51785b8 100644 --- a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php @@ -39,7 +39,9 @@ class EntryFilterType extends AbstractType return $filterQuery->createCondition($expression); }, - )); + )) + ->add('isArchived', 'filter_checkbox') + ->add('isStarred', 'filter_checkbox'); } public function getName() diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 5538ae82b..e764e8f70 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -24,6 +24,20 @@ class EntryRepository extends EntityRepository ; } + /** + * Retrieves all entries for a user. + * + * @param int $userId + * + * @return QueryBuilder + */ + public function getBuilderForAllByUser($userId) + { + return $this + ->getBuilderByUser($userId) + ; + } + /** * Retrieves unread entries for a user. * diff --git a/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig index a794df0e5..118a2f4be 100644 --- a/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Entry/entries.html.twig @@ -21,7 +21,7 @@ {% if entries is empty %}

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

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

{{ entry.title|raw }}

diff --git a/src/Wallabag/CoreBundle/Resources/views/base.html.twig b/src/Wallabag/CoreBundle/Resources/views/base.html.twig index ac5d2bf9c..3ad776b99 100644 --- a/src/Wallabag/CoreBundle/Resources/views/base.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/base.html.twig @@ -71,7 +71,8 @@
  • {% trans %}unread{% endtrans %}
  • {% trans %}favorites{% endtrans %}
  • {% trans %}archive{% endtrans %}
  • -
  • {% trans %}tags{% endtrans %}
  • +
  • {% trans %}all{% endtrans %}
  • +
  • {% trans %}tags{% endtrans %}
  • {% trans %}save a link{% endtrans %}
  • {% trans %}search{% endtrans %}