From: Thomas Citharel Date: Tue, 22 Nov 2016 09:27:14 +0000 (+0100) Subject: Merge pull request #2613 from wallabag/fix-overlap X-Git-Tag: 2.2.0~3^2~52 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=944b8d61752bedd126e1cdaeb3205177e414cf6b;hp=77e2898ad406c5aa7672dcaead6b5090cd203d47;p=github%2Fwallabag%2Fwallabag.git Merge pull request #2613 from wallabag/fix-overlap Fix card action overlap --- diff --git a/CHANGELOG.md b/CHANGELOG.md index de523f91..ad916426 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## Changelog +### 2.1.5 2016/11/21 +- [#2623](https://github.com/wallabag/wallabag/pull/2623) Force composer to run as PHP 5.5.9 (@j0k3r) +- [#2608](https://github.com/wallabag/wallabag/pull/2608) Change version to 2.2.0-dev (@nicosomb) +- [#2607](https://github.com/wallabag/wallabag/pull/2607) Updated changelog for 2.1.4 (@nicosomb) + ### 2.1.4 2016/11/19 - [#2604](https://github.com/wallabag/wallabag/pull/2604) wallabag can’t work on PostgreSQL <= 9.1 (@j0k3r) - [#2605](https://github.com/wallabag/wallabag/pull/2605) Add .travis.yml change to RELEASE_PROCESS (@j0k3r) diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml index 8ee0a303..fac3b4f8 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.da.yml @@ -1,3 +1,4 @@ +# settings_changed: Configuration updated download_pictures: Download billeder på din server carrot: Aktiver deling til Carrot diaspora_url: Diaspora URL, hvis tjenesten er aktiv diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml index 73a9d640..d382733c 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.de.yml @@ -1,3 +1,4 @@ +# settings_changed: Configuration updated download_pictures: Bilder auf den Server herunterladen carrot: Teilen zu Carrot aktivieren diaspora_url: Diaspora-URL, sofern der Service aktiviert ist diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml index c8c13805..23de7a43 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml @@ -1,3 +1,4 @@ +settings_changed: Configuration updated download_pictures: Download pictures on your server carrot: Enable share to Carrot diaspora_url: Diaspora URL, if the service is enabled diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml index 0ea98d8f..ff1dd04f 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.es.yml @@ -1,3 +1,4 @@ +# settings_changed: Configuration updated download_pictures: Descargar imágenes carrot: Activar compartir con Carrot diaspora_url: Diaspora URL, si el servicio está activado diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml index c527b971..4e712fdd 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fa.yml @@ -1,3 +1,4 @@ +# settings_changed: Configuration updated download_pictures: تصاویر را در کارگزار خودتان باربگیرید carrot: فعال‌سازی هم‌رسانی به Carrot diaspora_url: نشانی Diaspora، اگر فعال بود diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml index 176e7c86..cae4c662 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml @@ -1,3 +1,4 @@ +settings_changed: Configuration mise à jour download_pictures: Télécharger les images sur le serveur carrot: Activer le partage vers Carrot diaspora_url: URL de Diaspora, si le service Diaspora est activé diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml index 621d4dcd..f94f834f 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.it.yml @@ -1,3 +1,4 @@ +# settings_changed: Configuration updated download_pictures: Scarica le immagini sul tuo server carrot: Abilita la condivisione con Carrot diaspora_url: Diaspora URL, se il servizio è abilitato diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml index 04accd45..de60a194 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.oc.yml @@ -1,3 +1,4 @@ +# settings_changed: Configuration updated download_pictures: Telecargar los imatges sul servidor carrot: Activar lo partatge cap a Carrot diaspora_url: URL de Diaspora, se lo servici Diaspora es activat diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml index 2f4f3154..11579745 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pl.yml @@ -1,3 +1,4 @@ +# settings_changed: Configuration updated download_pictures: Pobierz obrazy na swój serwer carrot: Włącz udostępnianie dla Carrot diaspora_url: Adres URL Diaspora, jeżeli usługa jest włączona diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml index 5da940e9..74ae5a44 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.pt.yml @@ -1,3 +1,4 @@ +# settings_changed: Configuration updated download_pictures: Download imagens no seu servidor carrot: Habilitar compartilhamento para o Carrot diaspora_url: URL Diaspora, se o serviço está habilitado @@ -8,7 +9,8 @@ export_csv: Habilita exportação para CSV export_json: Habilita exportação para JSON export_txt: Habilita exportação para TXT export_xml: Habilita exportação para XML -pocket_consumer_key: Chave de consumidor do Pocket para importar conteúdo (https://getpocket.com/developer/docs/authentication) +# import_with_rabbitmq: Enable RabbitMQ to import data asynchronously +# import_with_redis: Enable Redis to import data asynchronously shaarli_url: URL Shaarli, se o serviço está habilitado share_diaspora: Habilitar compartilhamento para o Diaspora share_mail: Habilitar compartilhamento por e-mail @@ -28,3 +30,5 @@ piwik_site_id: ID de seu website Piwik piwik_enabled: Habilitar Piwik demo_mode_enabled: "Habilitar modo demo? (somente usado para o demo público do wallabag)" demo_mode_username: "Usuário demo" +# share_public: Allow public url for entries +# download_images_enabled: Download images locally diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml index 6d2eaffd..5095dfa0 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.ro.yml @@ -1,3 +1,4 @@ +# settings_changed: Configuration updated download_pictures: Descarcă poze pe server carrot: Permite share către Carrot diaspora_url: Diaspora URL, dacă serviciul este permis diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml index 9146bfb6..cd42e595 100644 --- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml +++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.tr.yml @@ -1,3 +1,4 @@ +# settings_changed: Configuration updated # download_pictures: Download pictures on your server # carrot: Enable share to Carrot # diaspora_url: Diaspora URL, if the service is enabled diff --git a/app/config/config.yml b/app/config/config.yml index 53c26beb..487e934b 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -30,7 +30,7 @@ framework: assets: ~ wallabag_core: - version: 2.2.0-dev + version: 2.1.5 paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb" languages: en: 'English' @@ -218,7 +218,9 @@ fos_oauth_server: auth_code_class: Wallabag\ApiBundle\Entity\AuthCode service: user_provider: fos_user.user_manager - + options: + refresh_token_lifetime: 1209600 + scheb_two_factor: trusted_computer: enabled: true diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist index 7a22cb98..f821f2a8 100644 --- a/app/config/parameters.yml.dist +++ b/app/config/parameters.yml.dist @@ -55,3 +55,4 @@ parameters: redis_host: localhost redis_port: 6379 redis_path: null + redis_password: null diff --git a/composer.json b/composer.json index 6d7a7adf..1548d6ec 100644 --- a/composer.json +++ b/composer.json @@ -89,7 +89,7 @@ "doctrine/doctrine-fixtures-bundle": "~2.2", "doctrine/data-fixtures": "~1.1.1", "sensio/generator-bundle": "^3.0", - "phpunit/phpunit": "~5.0", + "phpunit/phpunit": "~4.0", "symfony/phpunit-bridge": "^3.0", "friendsofphp/php-cs-fixer": "~1.9", "m6web/redis-mock": "^2.0" @@ -128,7 +128,10 @@ "psr-4": { "Tests\\": "tests/" } }, "config": { - "bin-dir": "bin" + "bin-dir": "bin", + "platform": { + "php": "5.5.9" + } }, "minimum-stability": "dev", "prefer-stable": true diff --git a/docs/de/user/configuration.rst b/docs/de/user/configuration.rst index c0a8cd67..47c60f4c 100644 --- a/docs/de/user/configuration.rst +++ b/docs/de/user/configuration.rst @@ -52,6 +52,9 @@ Jetzt hast du drei Links, einen für jeden Status: Füge sie in deinem liebsten Du kannst auch definieren wie viele Artikel du in deinem RSS Feed (Standardwert: 50) haben willst. +There is also a pagination available for these feeds. You can add ``?page=2`` to jump to the second page. +The pagination follow `the RFC `_ about that, which means you'll find the ``next``, ``previous`` & ``last`` page link inside the `` tag of each RSS feed. + Benutzer-Informationen ---------------------- diff --git a/docs/de/user/parameters.rst b/docs/de/user/parameters.rst index a5a4e4f2..8d8f9206 100644 --- a/docs/de/user/parameters.rst +++ b/docs/de/user/parameters.rst @@ -39,6 +39,7 @@ Wenn du nicht weißt, welchen Wert du setzen sollst, belasse es bei dem Standard redis_host: localhost redis_port: 6379 redis_path: null + redis_password: null Bedeutung von jedem Parameter ----------------------------- @@ -91,3 +92,4 @@ Bedeutung von jedem Parameter "redis_host", "localhost", "IP oder Hostname des Zielservers (ignoriert bei Unix Schema)" "redis_port", "6379", "TCP/IP Port des Zielservers (ignoriert bei Unix Schema)" "redis_path", "null", "Pfad zur Unix Domain Socket Datei, wenn Redis Unix Domain Sockets nutzt" + "redis_password", "null", "Kennwort, welches in der Redis-Server-Konfiguration definiert ist (Parameter `requirepass` in `redis.conf`)" diff --git a/docs/en/user/configuration.rst b/docs/en/user/configuration.rst index a52d3ddd..caca834f 100644 --- a/docs/en/user/configuration.rst +++ b/docs/en/user/configuration.rst @@ -52,6 +52,9 @@ Now you have three links, one for each status: add them into your favourite RSS You can also define how many articles you want in each RSS feed (default value: 50). +There is also a pagination available for these feeds. You can add ``?page=2`` to jump to the second page. +The pagination follow `the RFC `_ about that, which means you'll find the ``next``, ``previous`` & ``last`` page link inside the `` tag of each RSS feed. + User information ---------------- diff --git a/docs/en/user/parameters.rst b/docs/en/user/parameters.rst index eb312f7e..d8a209e7 100644 --- a/docs/en/user/parameters.rst +++ b/docs/en/user/parameters.rst @@ -39,6 +39,7 @@ If you don't know which value you need to set, please leave the default one. redis_host: localhost redis_port: 6379 redis_path: null + redis_password: null Meaning of each parameter ------------------------- @@ -92,3 +93,4 @@ Meaning of each parameter "redis_host", "localhost", "IP or hostname of the target server (ignored for unix scheme)" "redis_port", "6379", "TCP/IP port of the target server (ignored for unix scheme)" "redis_path", "null", "Path of the UNIX domain socket file used when connecting to Redis using UNIX domain sockets" + "redis_password", "null", "Password defined in the Redis server configuration (parameter `requirepass` in `redis.conf`)" diff --git a/docs/fr/user/configuration.rst b/docs/fr/user/configuration.rst index 5ce80f58..025b05bb 100644 --- a/docs/fr/user/configuration.rst +++ b/docs/fr/user/configuration.rst @@ -53,6 +53,9 @@ Vous avez maintenant trois liens, un par statut : ajoutez-les dans votre agrég Vous pouvez aussi définir combien d'articles vous souhaitez dans vos flux RSS (50 est la valeur par défaut). +Une pagination est aussi disponible pour ces flux. Il suffit de rajouter ``?page=2`` pour aller à la seconde page, par exemple. +Cette pagination suit `la RFC `_, ce qui signifie que vous trouverez la page suivante (``next``), précédente (``previous``) et la dernière (``last``) dans la balise `` de chaque flux RSS. + Mon compte ---------- diff --git a/docs/fr/user/parameters.rst b/docs/fr/user/parameters.rst index d1c20ceb..b2e33524 100644 --- a/docs/fr/user/parameters.rst +++ b/docs/fr/user/parameters.rst @@ -39,6 +39,7 @@ Si vous ne savez pas quelle valeur vous devez mettre, laissez celle par défaut. redis_host: localhost redis_port: 6379 redis_path: null + redis_password: null Meaning of each parameter ------------------------- @@ -91,3 +92,4 @@ Meaning of each parameter "redis_host", "localhost", "IP ou hôte du serveur cible (ignoré pour un schéma unix)" "redis_port", "6379", "Port TCP/IP du serveur cible (ignoré pour un schéma unix)" "redis_path", "null", "Chemin du fichier de socket du domaine UNIX utilisé quand on se connecte à Redis en utilisant les sockets du domaine UNIX" + "redis_password", "null", "Mot de passe défini dans la configuration serveur de Redis (paramètre `requirepass` dans `redis.conf`)" diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index c5bf1df8..1a726b6e 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -285,6 +285,51 @@ class EntryRestController extends WallabagRestController return (new JsonResponse())->setJson($json); } + /** + * Reload an entry. + * A response with HTTP Status 400 will be return if we weren't able to update the content (because it hasn't changed or we got an error). + * + * @ApiDoc( + * requirements={ + * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"} + * } + * ) + * + * @return JsonResponse + */ + public function patchEntriesReloadAction(Entry $entry) + { + $this->validateAuthentication(); + $this->validateUserAccess($entry->getUser()->getId()); + + try { + $entry = $this->get('wallabag_core.content_proxy')->updateEntry($entry, $entry->getUrl()); + } catch (\Exception $e) { + $this->get('logger')->error('Error while saving an entry', [ + 'exception' => $e, + 'entry' => $entry, + ]); + + return new JsonResponse(['error' => 'Error while trying to fetch content'], 400); + } + + // if refreshing entry failed, don't save it + if ($this->getParameter('wallabag_core.fetching_error_message') === $entry->getContent()) { + return new JsonResponse(['error' => 'Error while trying to extract content'], 400); + } + + $em = $this->getDoctrine()->getManager(); + $em->persist($entry); + $em->flush(); + + // entry saved, dispatch event about it! + $this->get('event_dispatcher')->dispatch(EntrySavedEvent::NAME, new EntrySavedEvent($entry)); + + $json = $this->get('serializer')->serialize($entry, 'json'); + + return (new JsonResponse())->setJson($json); + } + /** * Delete **permanently** an entry. * diff --git a/src/Wallabag/CoreBundle/Controller/RssController.php b/src/Wallabag/CoreBundle/Controller/RssController.php index 38e3b5a0..2290386f 100644 --- a/src/Wallabag/CoreBundle/Controller/RssController.php +++ b/src/Wallabag/CoreBundle/Controller/RssController.php @@ -3,12 +3,15 @@ namespace Wallabag\CoreBundle\Controller; use Pagerfanta\Adapter\DoctrineORMAdapter; +use Pagerfanta\Exception\OutOfRangeCurrentPageException; use Pagerfanta\Pagerfanta; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; +use Symfony\Component\HttpFoundation\Request; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\UserBundle\Entity\User; +use Symfony\Component\Routing\Generator\UrlGeneratorInterface; class RssController extends Controller { @@ -20,9 +23,9 @@ class RssController extends Controller * * @return \Symfony\Component\HttpFoundation\Response */ - public function showUnreadAction(User $user) + public function showUnreadAction(Request $request, User $user) { - return $this->showEntries('unread', $user); + return $this->showEntries('unread', $user, $request->query->get('page', 1)); } /** @@ -33,9 +36,9 @@ class RssController extends Controller * * @return \Symfony\Component\HttpFoundation\Response */ - public function showArchiveAction(User $user) + public function showArchiveAction(Request $request, User $user) { - return $this->showEntries('archive', $user); + return $this->showEntries('archive', $user, $request->query->get('page', 1)); } /** @@ -46,9 +49,9 @@ class RssController extends Controller * * @return \Symfony\Component\HttpFoundation\Response */ - public function showStarredAction(User $user) + public function showStarredAction(Request $request, User $user) { - return $this->showEntries('starred', $user); + return $this->showEntries('starred', $user, $request->query->get('page', 1)); } /** @@ -57,10 +60,11 @@ class RssController extends Controller * * @param string $type Entries type: unread, starred or archive * @param User $user + * @param int $page * * @return \Symfony\Component\HttpFoundation\Response */ - private function showEntries($type, User $user) + private function showEntries($type, User $user, $page = 1) { $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry'); @@ -87,8 +91,26 @@ class RssController extends Controller $perPage = $user->getConfig()->getRssLimit() ?: $this->getParameter('wallabag_core.rss_limit'); $entries->setMaxPerPage($perPage); + $url = $this->generateUrl( + $type.'_rss', + [ + 'username' => $user->getUsername(), + 'token' => $user->getConfig()->getRssToken(), + ], + UrlGeneratorInterface::ABSOLUTE_URL + ); + + try { + $entries->setCurrentPage((int) $page); + } catch (OutOfRangeCurrentPageException $e) { + if ($page > 1) { + return $this->redirect($url.'?page='.$entries->getNbPages(), 302); + } + } + return $this->render('@WallabagCore/themes/common/Entry/entries.xml.twig', [ 'type' => $type, + 'url' => $url, 'entries' => $entries, ]); } diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml index 0036f45e..0280bc18 100644 --- a/src/Wallabag/CoreBundle/Resources/config/services.yml +++ b/src/Wallabag/CoreBundle/Resources/config/services.yml @@ -110,6 +110,7 @@ services: host: '%redis_host%' port: '%redis_port%' path: '%redis_path%' + password: '%redis_password%' wallabag_core.exception_controller: class: Wallabag\CoreBundle\Controller\ExceptionController diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 38fc4ceb..c124b744 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -61,7 +61,7 @@ config: save: 'Zapisz' form_settings: theme_label: 'Temat' - items_per_page_label: 'Ilość elementóœ na stronie' + items_per_page_label: 'Ilość elementów na stronie' language_label: 'Język' reading_speed: label: 'Prędkość czytania' @@ -76,11 +76,11 @@ config: redirect_current_page: 'do bieżącej strony' pocket_consumer_key_label: 'Klucz klienta Pocket do importu zawartości' android_configuration: Skonfiguruj swoją androidową aplikację - # help_theme: "wallabag is customizable. You can choose your prefered theme here." - # help_items_per_page: "You can change the number of articles displayed on each page." - # help_reading_speed: "wallabag calculates a reading time for each article. You can define here, thanks to this list, if you are a fast or a slow reader. wallabag will recalculate the reading time for each article." - # help_language: "You can change the language of wallabag interface." - # help_pocket_consumer_key: "Required for Pocket import. You can create it in your Pocket account." + help_theme: "Dopasuj wallabag do swoich potrzeb. Tutaj możesz wybrać preferowany przez ciebie motyw." + help_items_per_page: "Możesz zmienić ilość artykułów wyświetlanych na każdej stronie." + help_reading_speed: "wallabag oblicza czas czytania każdego artykułu. Dzięki tej liście możesz określić swoje tempo. Wallabag przeliczy ponownie czas potrzebny, na przeczytanie każdego z artykułów." + help_language: "Możesz zmienić język interfejsu wallabag." + help_pocket_consumer_key: "Wymagane dla importu z Pocket. Możesz go stworzyć na swoim koncie Pocket." form_rss: description: 'Kanały RSS prowadzone przez wallabag pozwalają Ci na czytanie twoich zapisanych artykułów w twoium ulubionym czytniku RSS. Musisz najpierw wynegenerować tokena.‌' token_label: 'Token RSS' @@ -98,7 +98,7 @@ config: name_label: 'Nazwa' email_label: 'Adres email' twoFactorAuthentication_label: 'Autoryzacja dwuetapowa' - # help_twoFactorAuthentication: "If you enable 2FA, each time you want to login to wallabag, you'll receive a code by email." + help_twoFactorAuthentication: "Jeżeli włączysz autoryzację dwuetapową. Za każdym razem, kiedy będziesz chciał się zalogować, dostaniesz kod na swój e-mail." delete: title: Usuń moje konto (niebezpieczna strefa !) description: Jeżeli usuniesz swoje konto, wszystkie twoje artykuły, tagi, adnotacje, oraz konto zostaną trwale usunięte (operacja jest NIEODWRACALNA). Następnie zostaniesz wylogowany. @@ -112,7 +112,7 @@ config: entries: usuń WSZYTSTKIE wpisy confirm: Jesteś pewien? (tej operacji NIE MOŻNA cofnąć) form_password: - # description: "You can change your password here. Your new password should by at least 8 characters long." + description: "Tutaj możesz zmienić swoje hasło. Twoje nowe hasło powinno mieć conajmniej 8 znaków." old_password_label: 'Stare hasło' new_password_label: 'Nowe hasło' repeat_new_password_label: 'Powtórz nowe hasło' @@ -162,7 +162,7 @@ entry: archived: 'Zarchiwizowane wpisy' filtered: 'Odfiltrowane wpisy' filtered_tags: 'Filtrowane po tagach:' - # filtered_search: 'Filtered by search:' + filtered_search: 'Filtrowanie po wyszukiwaniu:' untagged: 'Odtaguj wpisy' list: number_on_the_page: '{0} Nie ma wpisów.|{1} Jest jeden wpis.|]1,Inf[ Są %count% wpisy.' @@ -186,7 +186,7 @@ entry: preview_picture_label: 'Posiada podgląd obrazu' preview_picture_help: 'Podgląd obrazu' language_label: 'Język' - # http_status_label: 'HTTP status' + http_status_label: 'Status HTTP' reading_time: label: 'Czas czytania w minutach' from: 'od' @@ -229,7 +229,7 @@ entry: form_new: url_label: Url search: - # placeholder: 'What are you looking for?' + placeholder: 'Czego szukasz?' edit: page_title: 'Edytuj wpis' title_label: 'Tytuł' diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/entries.xml.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/entries.xml.twig index 288bb54f..16ecaa97 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/entries.xml.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/entries.xml.twig @@ -2,7 +2,15 @@ wallabag — {{type}} feed - {{ url('unread') }} + {{ url(type) }} + + {% if entries.hasPreviousPage -%} + + {% endif -%} + {% if entries.hasNextPage -%} + + {% endif -%} + {{ "now"|date('D, d M Y H:i:s') }} wallabag wallabag {{type}} elements diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/quickstart.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/quickstart.html.twig index c8a303a6..b7a48551 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/quickstart.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/quickstart.html.twig @@ -15,7 +15,7 @@
  • - {{ 'quickstart.configure.title'|trans }} + {{ 'quickstart.configure.title'|trans }}

    {{ 'quickstart.configure.description'|trans }}

    @@ -31,7 +31,7 @@
  • - {{ 'quickstart.first_steps.title'|trans }} + {{ 'quickstart.first_steps.title'|trans }}

    {{ 'quickstart.first_steps.description'|trans }}

    @@ -46,7 +46,7 @@
  • - {{ 'quickstart.migrate.title'|trans }} + {{ 'quickstart.migrate.title'|trans }}

    {{ 'quickstart.migrate.description'|trans }}

    @@ -63,7 +63,7 @@
  • - {{ 'quickstart.developer.title'|trans }} + {{ 'quickstart.developer.title'|trans }}

    {{ 'quickstart.developer.description'|trans }}

    @@ -79,7 +79,7 @@
  • - {{ 'quickstart.docs.title'|trans }} + {{ 'quickstart.docs.title'|trans }}

    {{ 'quickstart.docs.description'|trans }}

    @@ -95,7 +95,7 @@
  • - {{ 'quickstart.support.title'|trans }} + {{ 'quickstart.support.title'|trans }}

    {{ 'quickstart.support.description'|trans }}

    diff --git a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php index 566e9493..432ce7d8 100644 --- a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php @@ -678,4 +678,44 @@ class EntryRestControllerTest extends WallabagApiTestCase $this->assertEquals(403, $this->client->getResponse()->getStatusCode()); } + + public function testReloadEntryErrorWhileFetching() + { + $entry = $this->client->getContainer()->get('doctrine.orm.entity_manager') + ->getRepository('WallabagCoreBundle:Entry') + ->findByUrlAndUserId('http://0.0.0.0/entry4', 1); + + if (!$entry) { + $this->markTestSkipped('No content found in db.'); + } + + $this->client->request('PATCH', '/api/entries/'.$entry->getId().'/reload.json'); + $this->assertEquals(400, $this->client->getResponse()->getStatusCode()); + + $this->assertContains('Error while trying to extract content', $this->client->getResponse()->getContent()); + + $this->assertEquals('application/json', $this->client->getResponse()->headers->get('Content-Type')); + } + + public function testReloadEntry() + { + $this->client->request('POST', '/api/entries.json', [ + 'url' => 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', + 'archive' => '1', + 'tags' => 'google, apple', + ]); + + $json = json_decode($this->client->getResponse()->getContent(), true); + + $this->setUp(); + + $this->client->request('PATCH', '/api/entries/'.$json['id'].'/reload.json'); + $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); + + $content = json_decode($this->client->getResponse()->getContent(), true); + + $this->assertNotEmpty($content['title']); + + $this->assertEquals('application/json', $this->client->getResponse()->headers->get('Content-Type')); + } } diff --git a/tests/Wallabag/CoreBundle/Controller/RssControllerTest.php b/tests/Wallabag/CoreBundle/Controller/RssControllerTest.php index fb6fe06a..5a59654d 100644 --- a/tests/Wallabag/CoreBundle/Controller/RssControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/RssControllerTest.php @@ -6,7 +6,7 @@ use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; class RssControllerTest extends WallabagCoreTestCase { - public function validateDom($xml, $nb = null) + public function validateDom($xml, $type, $nb = null) { $doc = new \DOMDocument(); $doc->loadXML($xml); @@ -22,6 +22,23 @@ class RssControllerTest extends WallabagCoreTestCase $this->assertEquals(1, $xpath->query('/rss')->length); $this->assertEquals(1, $xpath->query('/rss/channel')->length); + $this->assertEquals(1, $xpath->query('/rss/channel/title')->length); + $this->assertEquals('wallabag — '.$type.' feed', $xpath->query('/rss/channel/title')->item(0)->nodeValue); + + $this->assertEquals(1, $xpath->query('/rss/channel/pubDate')->length); + + $this->assertEquals(1, $xpath->query('/rss/channel/generator')->length); + $this->assertEquals('wallabag', $xpath->query('/rss/channel/generator')->item(0)->nodeValue); + + $this->assertEquals(1, $xpath->query('/rss/channel/description')->length); + $this->assertEquals('wallabag '.$type.' elements', $xpath->query('/rss/channel/description')->item(0)->nodeValue); + + $this->assertEquals(1, $xpath->query('/rss/channel/link[@rel="self"]')->length); + $this->assertContains($type.'.xml', $xpath->query('/rss/channel/link[@rel="self"]')->item(0)->getAttribute('href')); + + $this->assertEquals(1, $xpath->query('/rss/channel/link[@rel="last"]')->length); + $this->assertContains($type.'.xml?page=', $xpath->query('/rss/channel/link[@rel="last"]')->item(0)->getAttribute('href')); + foreach ($xpath->query('//item') as $item) { $this->assertEquals(1, $xpath->query('title', $item)->length); $this->assertEquals(1, $xpath->query('source', $item)->length); @@ -77,7 +94,7 @@ class RssControllerTest extends WallabagCoreTestCase $this->assertEquals(200, $client->getResponse()->getStatusCode()); - $this->validateDom($client->getResponse()->getContent(), 2); + $this->validateDom($client->getResponse()->getContent(), 'unread', 2); } public function testStarred() @@ -99,7 +116,7 @@ class RssControllerTest extends WallabagCoreTestCase $this->assertEquals(200, $client->getResponse()->getStatusCode(), 1); - $this->validateDom($client->getResponse()->getContent()); + $this->validateDom($client->getResponse()->getContent(), 'starred'); } public function testArchives() @@ -121,6 +138,34 @@ class RssControllerTest extends WallabagCoreTestCase $this->assertEquals(200, $client->getResponse()->getStatusCode()); - $this->validateDom($client->getResponse()->getContent()); + $this->validateDom($client->getResponse()->getContent(), 'archive'); + } + + public function testPagination() + { + $client = $this->getClient(); + $em = $client->getContainer()->get('doctrine.orm.entity_manager'); + $user = $em + ->getRepository('WallabagUserBundle:User') + ->findOneByUsername('admin'); + + $config = $user->getConfig(); + $config->setRssToken('SUPERTOKEN'); + $config->setRssLimit(1); + $em->persist($config); + $em->flush(); + + $client = $this->getClient(); + + $client->request('GET', '/admin/SUPERTOKEN/unread.xml'); + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + $this->validateDom($client->getResponse()->getContent(), 'unread'); + + $client->request('GET', '/admin/SUPERTOKEN/unread.xml?page=2'); + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + $this->validateDom($client->getResponse()->getContent(), 'unread'); + + $client->request('GET', '/admin/SUPERTOKEN/unread.xml?page=3000'); + $this->assertEquals(302, $client->getResponse()->getStatusCode()); } }