From: Jérémy Benoist Date: Sun, 30 Jul 2017 06:31:04 +0000 (+0200) Subject: Merge pull request #3297 from nclsHart/commands-better-rendering X-Git-Tag: 2.3.0~31^2~29 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=882da5c5eb283cbc7a869182b26a69b8fbebda2b;hp=e1b33efb3dd7c9ebb4dcfb23a2ca5efbda0a05f6;p=github%2Fwallabag%2Fwallabag.git Merge pull request #3297 from nclsHart/commands-better-rendering Better rendering for all core commands --- diff --git a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php index 014c29b6..b44f7e64 100644 --- a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php +++ b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php @@ -3,6 +3,8 @@ namespace Wallabag\AnnotationBundle\Repository; use Doctrine\ORM\EntityRepository; +use Doctrine\ORM\QueryBuilder; +use Wallabag\AnnotationBundle\Entity\Annotation; /** * AnnotationRepository. diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 9277e1a1..bc1b6f92 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -8,6 +8,7 @@ use JMS\Serializer\SerializationContext; use Nelmio\ApiDocBundle\Annotation\ApiDoc; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Wallabag\CoreBundle\Entity\Entry; diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 845ebef6..3dcfbebe 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -573,6 +573,7 @@ class EntryController extends Controller 'entries' => $entries, 'currentPage' => $page, 'searchTerm' => $searchTerm, + 'isFiltered' => $form->isSubmitted(), ] ); } diff --git a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php index 10689c62..da19fe31 100644 --- a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php +++ b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php @@ -8,6 +8,7 @@ use Graby\SiteConfig\ConfigBuilder; use Psr\Log\LoggerInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; use Wallabag\CoreBundle\Repository\SiteCredentialRepository; +use Wallabag\UserBundle\Entity\User; class GrabySiteConfigBuilder implements SiteConfigBuilder { @@ -27,7 +28,7 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder private $logger; /** - * @var Wallabag\UserBundle\Entity\User|null + * @var User|null */ private $currentUser; diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index 64d82193..de259e7f 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -2,12 +2,12 @@ namespace Wallabag\CoreBundle\Helper; -use JMS\Serializer; use JMS\Serializer\SerializationContext; use JMS\Serializer\SerializerBuilder; use PHPePub\Core\EPub; use PHPePub\Core\Structure\OPF\DublinCore; use Symfony\Component\HttpFoundation\Response; +use Wallabag\CoreBundle\Entity\Entry; /** * This class doesn't have unit test BUT it's fully covered by a functional test with ExportControllerTest. @@ -427,7 +427,7 @@ class EntriesExport * * @param string $format * - * @return Serializer + * @return string */ private function prepareSerializingContent($format) { diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index c27ee90c..7f35bb9a 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -3,9 +3,10 @@ namespace Wallabag\CoreBundle\Repository; use Doctrine\ORM\EntityRepository; -use Doctrine\ORM\Query; +use Doctrine\ORM\QueryBuilder; use Pagerfanta\Adapter\DoctrineORMAdapter; use Pagerfanta\Pagerfanta; +use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Tag; class EntryRepository extends EntityRepository @@ -74,7 +75,7 @@ class EntryRepository extends EntityRepository * * @param int $userId * @param string $term - * @param strint $currentRoute + * @param string $currentRoute * * @return QueryBuilder */ @@ -126,7 +127,7 @@ class EntryRepository extends EntityRepository * @param int $since * @param string $tags * - * @return array + * @return Pagerfanta */ public function findEntries($userId, $isArchived = null, $isStarred = null, $isPublic = null, $sort = 'created', $order = 'ASC', $since = 0, $tags = '') { @@ -172,7 +173,7 @@ class EntryRepository extends EntityRepository * * @param int $userId * - * @return Entry + * @return array */ public function findOneWithTags($userId) { diff --git a/src/Wallabag/CoreBundle/Repository/TagRepository.php b/src/Wallabag/CoreBundle/Repository/TagRepository.php index 6c63a6a2..213283e5 100644 --- a/src/Wallabag/CoreBundle/Repository/TagRepository.php +++ b/src/Wallabag/CoreBundle/Repository/TagRepository.php @@ -3,6 +3,7 @@ namespace Wallabag\CoreBundle\Repository; use Doctrine\ORM\EntityRepository; +use Wallabag\CoreBundle\Entity\Tag; class TagRepository extends EntityRepository { diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index 5229ac73..5e5bbde2 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -169,6 +169,7 @@ entry: # filtered_tags: 'Filtered by tags:' # filtered_search: 'Filtered by search:' # untagged: 'Untagged entries' + # all: 'All entries' list: # number_on_the_page: '{0} There is no entry.|{1} There is one entry.|]1,Inf[ There are %count% entries.' reading_time: 'estimeret læsetid' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 996f173a..48f8a535 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -169,6 +169,7 @@ entry: filtered_tags: 'Gefiltert nach Tags:' filtered_search: 'Gefiltert nach Suche:' untagged: 'Nicht getaggte Einträge' + all: 'Alle Einträge' list: number_on_the_page: '{0} Es gibt keine Einträge.|{1} Es gibt einen Eintrag.|]1,Inf[ Es gibt %count% Einträge.' reading_time: 'geschätzte Lesezeit' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index aa1cd1a9..f41a7c85 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -169,6 +169,7 @@ entry: filtered_tags: 'Filtered by tags:' filtered_search: 'Filtered by search:' untagged: 'Untagged entries' + all: 'All entries' list: number_on_the_page: '{0} There are no entries.|{1} There is one entry.|]1,Inf[ There are %count% entries.' reading_time: 'estimated reading time' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 96998f53..ea4d84ba 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -169,6 +169,7 @@ entry: filtered_tags: 'Filtrado por etiquetas:' filtered_search: 'Filtrado por búsqueda:' untagged: 'Artículos sin etiquetas' + all: "Todos los artículos" list: number_on_the_page: '{0} No hay artículos.|{1} Hay un artículo.|]1,Inf[ Hay %count% artículos.' reading_time: 'tiempo estimado de lectura' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index 57e6c029..11047e83 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -169,6 +169,7 @@ entry: # filtered_tags: 'Filtered by tags:' # filtered_search: 'Filtered by search:' # untagged: 'Untagged entries' + # all: 'All entries' list: number_on_the_page: '{0} هیج مقاله‌ای نیست.|{1} یک مقاله هست.|]1,Inf[ %count% مقاله هست.' reading_time: 'زمان تخمینی برای خواندن' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 6eac4c36..246add86 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -169,6 +169,7 @@ entry: filtered_tags: "Articles filtrés par tags :" filtered_search: "Articles filtrés par recherche :" untagged: "Article sans tag" + all: "Tous les articles" list: number_on_the_page: "{0} Il n’y a pas d’article.|{1} Il y a un article.|]1,Inf[ Il y a %count% articles." reading_time: "durée de lecture" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index fa7ae0b2..0de8bed7 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -169,6 +169,7 @@ entry: filtered_tags: 'Filtrati per etichetta:' filtered_search: 'Filtrati per ricerca:' untagged: 'Articoli non etichettati' + all: 'Tutti gli articoli' list: number_on_the_page: "{0} Non ci sono contenuti.|{1} C'è un contenuto.|]1,Inf[ Ci sono %count% contenuti." reading_time: 'tempo di lettura stimato' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index be57e903..b2842ed2 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -169,6 +169,7 @@ entry: filtered_tags: 'Articles filtrats per etiquetas :' filtered_search: 'Articles filtrats per recèrca :' untagged: 'Articles sens etiqueta' + all: 'Totes los articles' list: number_on_the_page: "{0} I a pas cap d'article.|{1} I a un article.|]1,Inf[ I a %count% articles." reading_time: 'durada de lectura' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 00c559ed..ab1b3d63 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -169,6 +169,7 @@ entry: filtered_tags: 'Filtrowane po tagach:' filtered_search: 'Filtrowanie po wyszukiwaniu:' untagged: 'Odtaguj wpisy' + all: 'Wszystkie przedmioty' list: number_on_the_page: '{0} Nie ma wpisów.|{1} Jest jeden wpis.|]1,Inf[ Są %count% wpisy.' reading_time: 'szacunkowy czas czytania' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 4ab5f144..5c1ae058 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -169,6 +169,7 @@ entry: filtered_tags: 'Filtrar por tags:' # filtered_search: 'Filtered by search:' untagged: 'Entradas sem tags' + # all: 'All entries' list: number_on_the_page: '{0} Não existem entradas.|{1} Existe uma entrada.|]1,Inf[ Existem %count% entradas.' reading_time: 'tempo estimado de leitura' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index f16504ed..0d6f5f8e 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -169,6 +169,7 @@ entry: # filtered_tags: 'Filtered by tags:' # filtered_search: 'Filtered by search:' # untagged: 'Untagged entries' + # all: 'All entries' list: # number_on_the_page: '{0} There is no entry.|{1} There is one entry.|]1,Inf[ There are %count% entries.' reading_time: 'timp estimat de citire' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 90a140cd..87b5e200 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -169,6 +169,7 @@ entry: # filtered_tags: 'Filtered by tags:' # filtered_search: 'Filtered by search:' # untagged: 'Untagged entries' + # all: 'All entries' list: number_on_the_page: '{0} Herhangi bir makale yok.|{1} Burada bir adet makale var.|]1,Inf[ Burada %count% adet makale var.' reading_time: 'tahmini okuma süresi' diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_title.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_title.html.twig index 654c1d2d..5c17e9f7 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_title.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_title.html.twig @@ -5,7 +5,7 @@ {% elseif currentRoute == 'archive' %} {{ 'entry.page_titles.archived'|trans }} {% elseif currentRoute == 'all' %} - {{ 'entry.page_titles.filtered'|trans }} + {{ isFiltered ? 'entry.page_titles.filtered'|trans : 'entry.page_titles.all'|trans }} {% elseif currentRoute == 'search' %} {{ 'entry.page_titles.filtered_search'|trans }} {{ filter }} {% elseif currentRoute == 'tag_entries' %} diff --git a/src/Wallabag/ImportBundle/Controller/WallabagController.php b/src/Wallabag/ImportBundle/Controller/WallabagController.php index 7b61805b..6e6524b4 100644 --- a/src/Wallabag/ImportBundle/Controller/WallabagController.php +++ b/src/Wallabag/ImportBundle/Controller/WallabagController.php @@ -3,7 +3,9 @@ namespace Wallabag\ImportBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; use Wallabag\ImportBundle\Form\Type\UploadImportType; /** diff --git a/src/Wallabag/ImportBundle/Import/BrowserImport.php b/src/Wallabag/ImportBundle/Import/BrowserImport.php index f1195824..78077324 100644 --- a/src/Wallabag/ImportBundle/Import/BrowserImport.php +++ b/src/Wallabag/ImportBundle/Import/BrowserImport.php @@ -4,7 +4,6 @@ namespace Wallabag\ImportBundle\Import; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Event\EntrySavedEvent; -use Wallabag\UserBundle\Entity\User; abstract class BrowserImport extends AbstractImport { @@ -232,4 +231,6 @@ abstract class BrowserImport extends AbstractImport return $importedEntry; } + + abstract protected function prepareEntry(array $entry = []); } diff --git a/src/Wallabag/UserBundle/Repository/UserRepository.php b/src/Wallabag/UserBundle/Repository/UserRepository.php index b1d753d2..75cbeef2 100644 --- a/src/Wallabag/UserBundle/Repository/UserRepository.php +++ b/src/Wallabag/UserBundle/Repository/UserRepository.php @@ -3,6 +3,8 @@ namespace Wallabag\UserBundle\Repository; use Doctrine\ORM\EntityRepository; +use Doctrine\ORM\QueryBuilder; +use Wallabag\UserBundle\Entity\User; class UserRepository extends EntityRepository {