]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge remote-tracking branch 'origin/master' into 2.1
authorJeremy Benoist <jeremy.benoist@gmail.com>
Mon, 22 Aug 2016 21:03:16 +0000 (23:03 +0200)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Mon, 22 Aug 2016 21:03:16 +0000 (23:03 +0200)
45 files changed:
.travis.yml
.zappr.yaml [new file with mode: 0644]
CHANGELOG.md
README.md
app/Resources/static/themes/baggy/css/ratatouille.css
app/Resources/static/themes/material/css/main.css
app/config/config.yml
docs/de/user/installation.rst
docs/en/user/installation.rst
docs/fr/user/installation.rst
src/Wallabag/CoreBundle/Controller/EntryController.php
src/Wallabag/CoreBundle/Controller/FooterController.php [new file with mode: 0644]
src/Wallabag/CoreBundle/Controller/StaticController.php
src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php
src/Wallabag/CoreBundle/Form/Type/ConfigType.php
src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php
src/Wallabag/CoreBundle/Resources/config/parameters.yml [new file with mode: 0644]
src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/baggy/Static/howto.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/material/Static/howto.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/material/footer.html.twig [new file with mode: 0644]
src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig
src/Wallabag/ImportBundle/Import/AbstractImport.php [new file with mode: 0644]
src/Wallabag/ImportBundle/Import/PocketImport.php
src/Wallabag/ImportBundle/Import/WallabagImport.php
tests/Wallabag/CoreBundle/Command/InstallCommandTest.php
tests/Wallabag/ImportBundle/Import/PocketImportTest.php
tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php
tests/Wallabag/ImportBundle/fixtures/wallabag-v2-empty.json [new file with mode: 0644]

index 69b4f91984928960a3cae24ed311ddd6351880c1..65e7e3047520236450f84b824093b53187e5feba 100644 (file)
@@ -23,8 +23,8 @@ php:
     - 5.5
     - 5.6
     - 7.0
+    - 7.1
     - nightly
-    - hhvm
 
 node_js:
     - "5"
@@ -37,15 +37,32 @@ env:
 matrix:
     fast_finish: true
     include:
+        # driver for PostgreSQL currently unsupported by HHVM, requires 3rd party dependency
+        - php: hhvm-3.12
+          sudo: required
+          dist: trusty
+          group: edge
+          env: DB=mysql
+          addons:
+            apt:
+                packages:
+                    - mysql-server-5.6
+                    - mysql-client-core-5.6
+                    - mysql-client-5.6
+          services:
+            - mysql
+        - php: hhvm-3.12
+          sudo: required
+          dist: trusty
+          group: edge
+          env: DB=sqlite
         - php: 7.0
           env: CS_FIXER=run VALIDATE_TRANSLATION_FILE=run DB=sqlite ASSETS=nobuild
         - php: 7.0
           env: DB=sqlite ASSETS=build
-    exclude:
-        - php: hhvm
-          env: DB=pgsql  # driver for PostgreSQL currently unsupported by HHVM, requires 3rd party dependency
     allow_failures:
-        - php: hhvm
+        - php: hhvm-3.12
+        - php: nightly
 
 # exclude v1 branches
 branches:
@@ -53,9 +70,11 @@ branches:
         - legacy
 
 before_script:
-    - if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;
-    - if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-rm xdebug.ini; fi;
-    - if [ "$TRAVIS_PHP_VERSION" = "5.5" ]; then composer require "phpunit/phpunit:4.*" --no-update; fi;
+    - PHP=$TRAVIS_PHP_VERSION
+    - if [[ ! $PHP = hhvm* ]]; then echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;
+    # xdebug isn't enable for PHP 7.1
+    - if [[ ! $PHP = hhvm* ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi
+    - if [[ $PHP = 5.5 ]]; then composer require "phpunit/phpunit:4.*" --no-update; fi;
     - composer self-update --no-progress
     - if [[ "$DB" = "pgsql" ]]; then psql -c 'create database wallabag_test;' -U postgres; fi;
 
diff --git a/.zappr.yaml b/.zappr.yaml
new file mode 100644 (file)
index 0000000..f90cd80
--- /dev/null
@@ -0,0 +1,26 @@
+# see https://zappr.opensource.zalan.do/
+autobranch: false
+commit: false
+approvals:
+  minimum: 1
+  ignore: pr_opener
+  pattern: "^(:\\+1:|👍)$"
+  veto:
+    pattern: "^(:\\-1:|👎)$"
+  from:
+    orgs:
+      - wallabag
+    collaborators: true
+specification:
+  title:
+    minimum-length:
+      enabled: true
+      length: 8
+  body:
+    minimum-length:
+      enabled: true
+      length: 8
+    contains-url: false
+    contains-issue-number: false
+  template:
+    differs-from-body: true
index 97245c68cde0ccb54a7bf92ef1b35e9c7678ad59..a6f7e168d613fe2ef5074c0d5f6d0ccb008c703f 100644 (file)
@@ -2,6 +2,39 @@
 
 All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).
 
+## [2.0.7] - 2016-08-22
+
+### Added
+
+- [#2222](https://github.com/wallabag/wallabag/pull/2222) Added creation date and reading time on article view (Nicolas Lœuillet)
+- [#2134](https://github.com/wallabag/wallabag/pull/2134) Run tests on an uptodate HHVM (Jeremy Benoist)
+
+### Changed
+
+- [#2221](https://github.com/wallabag/wallabag/pull/2221) Replaced favorite word/icon with star one (Nicolas Lœuillet)
+
+### Fixed
+
+- [#2224](https://github.com/wallabag/wallabag/pull/2224) Avoid breaking import when fetching fail (Jeremy Benoist)
+- [#2216](https://github.com/wallabag/wallabag/pull/2216), [#2220](https://github.com/wallabag/wallabag/pull/2220) Enable CORS headers for OAUTH part (Rurik19)
+- [#2095](https://github.com/wallabag/wallabag/pull/2095) Fix form user display when 2FA is disabled (Nicolas Lœuillet)
+
+## [2.0.6] - 2016-08-10
+
+### Changed
+
+- [#2199](https://github.com/wallabag/wallabag/pull/2199) Handling socials links into a config file (Simon Alberny)
+- [#2172](https://github.com/wallabag/wallabag/pull/2172) Change the way to login user in tests (Jeremy Benoist)
+- [#2155](https://github.com/wallabag/wallabag/pull/2155) Use friendsofphp instead of fabpot for PHP CS Fixer (Jeremy Benoist)
+
+### Fixed
+
+- [#2200](https://github.com/wallabag/wallabag/pull/2200) Fixed typo in entry:notice:entry_saved (charno6)
+- [#2185](https://github.com/wallabag/wallabag/pull/2185) Fix 3rd-Party Apps links (Chrome & Firefox) (Thomas Citharel)
+- [#2165](https://github.com/wallabag/wallabag/pull/2165) Fix a few french translations typos (Thomas Citharel)
+- [#2157](https://github.com/wallabag/wallabag/pull/2157) Handle only upper or only lower reading filter (Jeremy Benoist)
+- [#2156](https://github.com/wallabag/wallabag/pull/2156) Try to find bad redirection after delete (Jeremy Benoist)
+
 ## [2.0.5] - 2016-05-31
 
 ### Added
index 0d87d7bb332210eb6bfe09f418d86297a60f11f1..6053e6d9e9a395b82db27711e9b33f91e08d4a31 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
 [![Build Status](https://api.travis-ci.org/wallabag/wallabag.svg?branch=master)](https://travis-ci.org/wallabag/wallabag)
-[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/wallabag/wallabag/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/wallabag/wallabag/?branch=v2)
+[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/wallabag/wallabag/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/wallabag/wallabag/?branch=master)
 [![Gitter](https://badges.gitter.im/gitterHQ/gitter.svg)](https://gitter.im/wallabag/wallabag)
 
 # What is wallabag?
@@ -16,7 +16,7 @@ Then you can install wallabag by executing the following commands:
 ```
     git clone https://github.com/wallabag/wallabag.git
     cd wallabag
-    git checkout 2.0.5
+    git checkout 2.0.7
     SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
     php bin/console wallabag:install --env=prod
     php bin/console server:run --env=prod
index bf89d8816e66be7b21a2aade9c58d1769e29fed9..b5aeb54e415352e81898c01e1fdaecdee27f607b 100644 (file)
@@ -63,8 +63,7 @@ pre {
   max-width: 61.25em; /* 980px */
 }
 
-table,
-img {
+table, img, figure {
   max-width: 100%;
   height: auto;
 }
index 2ffe0b4681846e6e306842ce137889184d250f9d..cade37f634f79d6744ded02292a8bb1c3055c7b6 100755 (executable)
@@ -436,7 +436,8 @@ main ul.row {
   max-width: 40em;
 }
 
-#article img {
+#article img,
+#article figure {
   max-width: 100%;
   height: auto;
 }
index a1517e974eff46a3004344b50518448e421847fc..807543930045daf6b6640963c76366dbe9fa4986 100644 (file)
@@ -30,7 +30,7 @@ framework:
     assets: ~
 
 wallabag_core:
-    version: 2.0.5
+    version: 2.0.7
     paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb"
     languages:
         en: 'English'
@@ -138,6 +138,11 @@ nelmio_cors:
         #origin_regex: false
     paths:
         '^/api/':
+            allow_origin: ['*']
+            allow_headers: ['X-Custom-Auth']
+            allow_methods: ['POST', 'PUT', 'PATCH','GET', 'DELETE']
+            max_age: 3600
+        '^/oauth/':
             allow_origin: ['*']
             allow_headers: ['X-Custom-Auth']
             allow_methods: ['POST', 'PUT', 'GET', 'DELETE']
index 37a8017070bccdbf5b21ac637f0dc1e9d42f5116..1b6710b7cfa24dff94507d0827f2ece0853d8a97 100644 (file)
@@ -54,7 +54,7 @@ Um wallabag selbst zu installieren, musst du die folgenden Kommandos ausführen:
 
     git clone https://github.com/wallabag/wallabag.git
     cd wallabag
-    git checkout 2.0.5
+    git checkout 2.0.7
     SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
     php bin/console wallabag:install --env=prod
 
@@ -73,7 +73,7 @@ Und wallabag unter http://deineserverip:8000 erreichen
 Auf einem geteilten Webhosting
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-Wir stellen ein Paket inkl. aller Abhängigkeiten bereit. 
+Wir stellen ein Paket inkl. aller Abhängigkeiten bereit.
 Die Standardkonfiguration nutzt SQLite für die Datenbank. Wenn du diese Einstellung ändern willst, ändere bitte ``app/config/parameters.yml``.
 
 Wir haben bereits einen Nutzer erstellt: Login und Passwort sind ``wallabag``.
index bd3095e03752d55e630c74a6f215decc03f55803..95df263ab5b470225f6a3db22fdcdf0645a8dad3 100644 (file)
@@ -53,7 +53,7 @@ To install wallabag itself, you must run the following commands:
 
     git clone https://github.com/wallabag/wallabag.git
     cd wallabag
-    git checkout 2.0.5
+    git checkout 2.0.7
     SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
     php bin/console wallabag:install --env=prod
 
index 0693fc5d33542782a274dcd0e0f5c43556a4df0c..d46f79a40acc90d3403f31f010c893a1fd4adaf1 100644 (file)
@@ -51,7 +51,7 @@ Pour installer wallabag, vous devez exécuter ces deux commandes :
 
     git clone https://github.com/wallabag/wallabag.git
     cd wallabag
-    git checkout 2.0.5
+    git checkout 2.0.7
     SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
     php bin/console wallabag:install --env=prod
 
index 4eb314f7510b68133f418d16dba774abe5b9e6fe..ccdf940669bde3d5aa00073256c5607e8ba1805c 100644 (file)
@@ -357,7 +357,7 @@ class EntryController extends Controller
     }
 
     /**
-     * Changes favorite status for an entry.
+     * Changes starred status for an entry.
      *
      * @param Request $request
      * @param Entry   $entry
diff --git a/src/Wallabag/CoreBundle/Controller/FooterController.php b/src/Wallabag/CoreBundle/Controller/FooterController.php
new file mode 100644 (file)
index 0000000..fd93c43
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+
+namespace Wallabag\CoreBundle\Controller;
+
+use Symfony\Bundle\FrameworkBundle\Controller\Controller;
+
+class FooterController extends Controller
+{
+    /**
+     * Display the footer.
+     *
+     * @return \Symfony\Component\HttpFoundation\Response
+     */
+    public function indexAction()
+    {
+        $addonsUrl = $this->container->getParameter('addons_url');
+        $socialsUrl = $this->container->getParameter('socials_url');
+
+        return $this->render(
+            'WallabagCoreBundle::footer.html.twig',
+            [
+                'addonsUrl' => $addonsUrl,
+                'socialsUrl' => $socialsUrl,
+            ]
+        );
+    }
+}
index b41302f855ccf131e69b1574749e5c185b07633e..2a57f06fb055bc416ad037ed7a8580b91e4eea3c 100644 (file)
@@ -12,9 +12,11 @@ class StaticController extends Controller
      */
     public function howtoAction()
     {
+        $addonsUrl = $this->container->getParameter('addons_url');
+
         return $this->render(
             'WallabagCoreBundle:Static:howto.html.twig',
-            []
+            ['addonsUrl' => $addonsUrl]
         );
     }
 
index 84599f0d7b3d5eb7956e15a5a3c62f9f481171f2..7d08b73b78ceacf095e8c34a1ce61242e32f62d8 100644 (file)
@@ -25,6 +25,7 @@ class WallabagCoreExtension extends Extension
 
         $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
         $loader->load('services.yml');
+        $loader->load('parameters.yml');
     }
 
     public function getAlias()
index b712ad152c13e1fc1d8a0830eb7b7978d41244ad..cb4bee83069562aa3caca4bced262dab32408dcf 100644 (file)
@@ -16,7 +16,7 @@ class StringToListTransformer implements DataTransformerInterface
     private $separator;
 
     /**
-     * @param string $separator The separator used in the list.
+     * @param string $separator The separator used in the list
      */
     public function __construct($separator = ',')
     {
index 74c53bf058d3825e39b0efdb005b6c0807622eb4..7d25cc80597a06c70544fba356c0d99101e916e4 100644 (file)
@@ -21,7 +21,9 @@ class ConfigType extends AbstractType
     {
         $this->themes = array_combine(
             $themes,
-            array_map(function ($s) { return ucwords(strtolower(str_replace('-', ' ', $s))); }, $themes)
+            array_map(function ($s) {
+                return ucwords(strtolower(str_replace('-', ' ', $s)));
+            }, $themes)
         );
 
         $this->languages = $languages;
index 14ef4a6411928b439e33b399bee866c40d2c2859..239d09ae7bd8ff7f13dd8aeb74d12884621476db 100644 (file)
@@ -25,7 +25,7 @@ class RuleBasedTagger
     /**
      * Add tags from rules defined by the user.
      *
-     * @param Entry $entry Entry to tag.
+     * @param Entry $entry Entry to tag
      */
     public function tag(Entry $entry)
     {
@@ -49,7 +49,7 @@ class RuleBasedTagger
      *
      * @param User $user
      *
-     * @return array<Entry> A list of modified entries.
+     * @return array<Entry> A list of modified entries
      */
     public function tagAllForUser(User $user)
     {
@@ -75,7 +75,7 @@ class RuleBasedTagger
     /**
      * Fetch a tag.
      *
-     * @param string $label The tag's label.
+     * @param string $label The tag's label
      *
      * @return Tag
      */
diff --git a/src/Wallabag/CoreBundle/Resources/config/parameters.yml b/src/Wallabag/CoreBundle/Resources/config/parameters.yml
new file mode 100644 (file)
index 0000000..abd9ab6
--- /dev/null
@@ -0,0 +1,12 @@
+parameters:
+    addons_url:
+        firefox: https://addons.mozilla.org/firefox/addon/wallabag-v2/
+        chrome: https://chrome.google.com/webstore/detail/wallabagit/peehlcgckcnclnjlndmoddifcicdnabm
+        f_droid: https://f-droid.org/app/fr.gaulupeau.apps.InThePoche
+        google_play: https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche
+        ios: https://itunes.apple.com/app/wallabag/id828331015?mt=8
+        windows: https://www.microsoft.com/store/apps/wallabag/9nblggh11646
+    socials_url:
+        twitter: https://twitter.com/wallabagapp
+        google_plus: https://plus.google.com/+WallabagOrg/posts
+        facebook: https://facebook.com/Wallabag
index 798d8cbad0c909fbb99bceb99d52c7f65a515f18..c24475d2688b1780bd4e78a124d5a264f67e048b 100644 (file)
@@ -145,6 +145,8 @@ entry:
         reading_time_minutes: 'estimeret læsetid: %readingTime% min'
         reading_time_less_one_minute: 'estimeret læsetid: <small class="inferieur">&lt;</small> 1 min'
         # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags'
+        reading_time_minutes_short: '%readingTime% min'
+        reading_time_less_one_minute_short: '<small class="inferieur">&lt;</small> 1 min'
         original_article: 'original'
         toogle_as_read: 'Marker som læst'
         toogle_as_star: 'Skift favoritstatus'
@@ -177,7 +179,7 @@ entry:
             back_to_homepage: 'Tilbage'
             set_as_read: 'Marker som læst'
             # set_as_unread: 'Mark as unread'
-            set_as_favorite: 'Marker som favorit'
+            set_as_starred: 'Marker som favorit'
             view_original_article: 'Originalartikel'
             # re_fetch_content: 'Re-fetch content'
             delete: 'Slet'
@@ -192,6 +194,7 @@ entry:
         edit_title: 'Rediger titel'
         original_article: 'original'
         # annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations'
+        created_at: 'Oprettelsesdato'
     new:
         page_title: 'Gem ny artikel'
         placeholder: 'http://website.com'
index 0b8516ee733ee8174613f5d7adbd584caad6873e..384ec09a15eeda9ad4a312f2aa5332508bae6923 100644 (file)
@@ -145,6 +145,8 @@ entry:
         reading_time_minutes: 'geschätzte Lesezeit: %readingTime% min'
         reading_time_less_one_minute: 'geschätzte Lesezeit: <small class="inferieur">&lt;</small> 1 min'
         # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags'
+        reading_time_minutes_short: '%readingTime% min'
+        reading_time_less_one_minute_short: '<small class="inferieur">&lt;</small> 1 min'
         original_article: 'original'
         toogle_as_read: 'Gelesen-Status ändern'
         toogle_as_star: 'Favoriten-Status ändern'
@@ -177,7 +179,7 @@ entry:
             back_to_homepage: 'Zurück'
             set_as_read: 'Als gelesen markieren'
             set_as_unread: 'Als ungelesen markieren'
-            set_as_favorite: 'Favorisieren'
+            set_as_starred: 'Favorisieren'
             view_original_article: 'Original-Artikel'
             re_fetch_content: 'Inhalt neu laden'
             delete: 'Löschen'
@@ -192,6 +194,7 @@ entry:
         edit_title: 'Titel ändern'
         original_article: 'original'
         annotations_on_the_entry: '{0} Keine Anmerkungen|{1} Eine Anmerkung|]1,Inf[ %nbAnnotations% Anmerkungen'
+        created_at: 'Erstellungsdatum'
     new:
         page_title: 'Neuen Artikel speichern'
         placeholder: 'https://website.de'
@@ -397,7 +400,7 @@ flashes:
     entry:
         notice:
             entry_already_saved: 'Eintrag bereits am %date% gespeichert'
-            entry_saved: 'Eintag gespeichert'
+            entry_saved: 'Eintrag gespeichert'
             # entry_saved_failed: 'Failed to save entry'
             entry_updated: 'Eintrag aktualisiert'
             entry_reloaded: 'Eintrag neugeladen'
index 2c087421d33adcde57f31fbcbfb3574453ad9f1b..ea860564b9eabf177b824bd59d6dfc241d15104e 100644 (file)
@@ -145,9 +145,11 @@ entry:
         reading_time_minutes: 'estimated reading time: %readingTime% min'
         reading_time_less_one_minute: 'estimated reading time: <small class="inferieur">&lt;</small> 1 min'
         number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags'
+        reading_time_minutes_short: '%readingTime% min'
+        reading_time_less_one_minute_short: '<small class="inferieur">&lt;</small> 1 min'
         original_article: 'original'
         toogle_as_read: 'Toggle mark as read'
-        toogle_as_star: 'Toggle favorite'
+        toogle_as_star: 'Toggle starred'
         delete: 'Delete'
         export_title: 'Export'
     filters:
@@ -177,7 +179,7 @@ entry:
             back_to_homepage: 'Back'
             set_as_read: 'Mark as read'
             set_as_unread: 'Mark as unread'
-            set_as_favorite: 'Favorite'
+            set_as_starred: 'Toggle starred'
             view_original_article: 'Original article'
             re_fetch_content: 'Re-fetch content'
             delete: 'Delete'
@@ -192,6 +194,7 @@ entry:
         edit_title: 'Edit title'
         original_article: 'original'
         annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations'
+        created_at: 'Creation date'
     new:
         page_title: 'Save new entry'
         placeholder: 'http://website.com'
index 5a755e6c095bbc655708e015dd7171ca83144f58..f64e95d5acac8bf3943db45d55f841169e93f8d4 100644 (file)
@@ -145,6 +145,8 @@ entry:
         reading_time_minutes: 'tiempo estimado de lectura: %readingTime% min'
         reading_time_less_one_minute: 'tiempo estimado de lectura: <small class="inferieur">&lt;</small> 1 min'
         # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags'
+        reading_time_minutes_short: '%readingTime% min'
+        reading_time_less_one_minute_short: '<small class="inferieur">&lt;</small> 1 min'
         original_article: 'original'
         toogle_as_read: 'Marcar como leído/ no leído'
         toogle_as_star: 'Marcar como favorito/ no favorito'
@@ -177,7 +179,7 @@ entry:
             back_to_homepage: 'Regrese a la página principal'
             set_as_read: 'Marcar como leído'
             set_as_unread: 'Marcar como no leído'
-            set_as_favorite: 'Marcar como favorito'
+            set_as_starred: 'Marcar como favorito'
             view_original_article: 'Artículo original'
             re_fetch_content: 'Redescargar el contenido'
             delete: 'Suprimir'
@@ -192,6 +194,7 @@ entry:
         edit_title: 'Modificar el título'
         original_article: 'original'
         annotations_on_the_entry: '{0} Sin anotaciones|{1} Una anotación|]1,Inf[ %nbAnnotations% anotaciones'
+        created_at: 'Fecha de creación'
     new:
         page_title: 'Guardar un nuevo artículo'
         placeholder: 'http://website.com'
index 5a8bc5c4b4395894e292fe9337ea09dd07371ff0..e3592a782865c8bb0f0a6acfa7d7f116325e2086 100644 (file)
@@ -145,6 +145,8 @@ entry:
         reading_time_minutes: 'زمان تخمینی برای خواندن: %readingTime% min'
         reading_time_less_one_minute: 'زمان تخمینی برای خواندن: <small class="inferieur">&lt;</small> 1 min'
         # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags'
+        reading_time_minutes_short: '%readingTime% min'
+        reading_time_less_one_minute_short: '<small class="inferieur">&lt;</small> 1 min'
         original_article: 'original'
         toogle_as_read: 'خوانده‌شده/خوانده‌نشده'
         toogle_as_star: 'برگزیده/نابرگزیده'
@@ -177,7 +179,7 @@ entry:
             back_to_homepage: 'بازگشت'
             set_as_read: 'خوانده‌شده'
             set_as_unread: 'به عنوان خوانده‌نشده علامت بزن'
-            set_as_favorite: 'برگزیده'
+            set_as_starred: 'برگزیده'
             view_original_article: 'مقالهٔ اصلی'
             re_fetch_content: 'مقاله‌ها را دوباره دریافت کن'
             delete: 'پاک کردن'
@@ -192,6 +194,7 @@ entry:
         edit_title: 'ویرایش عنوان'
         original_article: 'اصلی'
         annotations_on_the_entry: '{0} بدون حاشیه|{1} یک حاشیه|]1,Inf[ %nbحاشیه% annotations'
+        created_at: 'زمان ساخت'
     new:
         page_title: 'ذخیرهٔ مقالهٔ تازه'
         placeholder: 'http://website.com'
index 542f61c2081e43be9581ae646816ff21826971ed..9e47d600a005af84c7b2faae6441c7514cfe659b 100644 (file)
@@ -145,6 +145,8 @@ entry:
         reading_time_minutes: 'durée de lecture: %readingTime% min'
         reading_time_less_one_minute: 'durée de lecture: <small class="inferieur">&lt;</small> 1 min'
         number_of_tags: '{1}et un autre tag|]1,Inf[et %count% autres tags'
+        reading_time_minutes_short: '%readingTime% min'
+        reading_time_less_one_minute_short: '<small class="inferieur">&lt;</small> 1 min'
         original_article: 'original'
         toogle_as_read: 'Marquer comme lu/non lu'
         toogle_as_star: 'Marquer comme favori'
@@ -177,7 +179,7 @@ entry:
             back_to_homepage: 'Retour'
             set_as_read: 'Marquer comme lu'
             set_as_unread: 'Marquer comme non lu'
-            set_as_favorite: 'Mettre en favori'
+            set_as_starred: 'Mettre en favori'
             view_original_article: 'Article original'
             re_fetch_content: 'Recharger le contenu'
             delete: 'Supprimer'
@@ -192,6 +194,7 @@ entry:
         edit_title: 'Modifier le titre'
         original_article: 'original'
         annotations_on_the_entry: '{0} Aucune annotation|{1} Une annotation|]1,Inf[ %nbAnnotations% annotations'
+        created_at: 'Date de création'
     new:
         page_title: 'Sauvegarder un nouvel article'
         placeholder: 'http://website.com'
index 0bcc94a5a93e17434033eb85a7ed81964aaeadf3..3760c2d64f4d3de3e290a48d87cee085dcbf40b7 100644 (file)
@@ -145,6 +145,8 @@ entry:
         reading_time_minutes: 'tempo di lettura stimato: %readingTime% min'
         reading_time_less_one_minute: 'tempo di lettura stimato: <small class="inferieur">&lt;</small> 1 min'
         # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags'
+        reading_time_minutes_short: '%readingTime% min'
+        reading_time_less_one_minute_short: '<small class="inferieur">&lt;</small> 1 min'
         original_article: 'originale'
         toogle_as_read: 'Segna come da leggere'
         toogle_as_star: 'Segna come non preferito'
@@ -176,7 +178,7 @@ entry:
             back_to_homepage: 'Indietro'
             set_as_read: 'Segna come già letto'
             set_as_unread: 'Segna come da leggere'
-            set_as_favorite: 'Segna come preferito'
+            set_as_starred: 'Segna come preferito'
             view_original_article: 'Contenuto originale'
             re_fetch_content: 'Ri-ottieni pagina'
             delete: 'Elimina'
@@ -191,6 +193,7 @@ entry:
         edit_title: 'Modifica titolo'
         original_article: 'originale'
         annotations_on_the_entry: '{0} Nessuna annotazione|{1} Una annotazione|]1,Inf[ %nbAnnotations% annotazioni'
+        created_at: 'Data di creazione'
     new:
         page_title: 'Salva un nuovo contenuto'
         placeholder: 'http://website.com'
index bf6b4100ba967cbd9e5e1a93b0f8d453ebba473d..1e23168bf7ff8c49e20837ef0f741037f4f98b45 100644 (file)
@@ -145,6 +145,8 @@ entry:
         reading_time_minutes: 'durada de lectura : %readingTime% min'
         reading_time_less_one_minute: 'durada de lectura : <small class="inferieur">&lt;</small> 1 min'
         # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags'
+        reading_time_minutes_short: '%readingTime% min'
+        reading_time_less_one_minute_short: '<small class="inferieur">&lt;</small> 1 min'
         original_article: 'original'
         toogle_as_read: 'Marcar coma legit/pas legit'
         toogle_as_star: 'Marcar coma favorit'
@@ -177,7 +179,7 @@ entry:
             back_to_homepage: 'Tornar'
             set_as_read: 'Marcar coma legit'
             set_as_unread: 'Marcar coma pas legit'
-            set_as_favorite: 'Metre en favori'
+            set_as_starred: 'Metre en favori'
             view_original_article: 'Article original'
             re_fetch_content: 'Tornar cargar lo contengut'
             delete: 'Suprimir'
@@ -192,6 +194,7 @@ entry:
         edit_title: 'Modificar lo títol'
         original_article: 'original'
         annotations_on_the_entry: "{0} Pas cap d'anotacion|{1} Una anotacion|]1,Inf[ %nbAnnotations% anotacions"
+        created_at: 'Data de creacion'
     new:
         page_title: 'Enregistrar un novèl article'
         placeholder: 'http://website.com'
index 09428c890e6c17078e5b1c457157dc683372c302..0a325c574ff68e3857247c7bf13a9f6437071f9e 100644 (file)
@@ -145,6 +145,8 @@ entry:
         reading_time_minutes: 'szacunkowy czas czytania: %readingTime% min'
         reading_time_less_one_minute: 'szacunkowy czas czytania: <small class="inferieur">&lt;</small> 1 min'
         # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags'
+        reading_time_minutes_short: '%readingTime% min'
+        reading_time_less_one_minute_short: '<small class="inferieur">&lt;</small> 1 min'
         original_article: 'oryginał'
         toogle_as_read: 'Oznacz jako przeczytane'
         toogle_as_star: 'Oznacz jako ulubione'
@@ -177,7 +179,7 @@ entry:
             back_to_homepage: 'Cofnij'
             set_as_read: 'Oznacz jako przeczytane'
             set_as_unread: 'Oznacz jako nieprzeczytane'
-            set_as_favorite: 'Ulubione'
+            set_as_starred: 'Ulubione'
             view_original_article: 'Oryginalny artykuł'
             re_fetch_content: 'Pobierz ponownie treść'
             delete: 'Usuń'
@@ -192,6 +194,7 @@ entry:
         edit_title: 'Edytuj tytuł'
         original_article: 'oryginalny'
         annotations_on_the_entry: '{0} Nie ma adnotacji |{1} Jedna adnotacja |]1,Inf[ %nbAnnotations% adnotacji'
+        created_at: 'Czas stworzenia'
     new:
         page_title: 'Zapisz nowy wpis'
         placeholder: 'http://website.com'
index bc16eddc1a5383b5305985903196b686cedfdb33..42ad28eec58f04dd45edd9ac0cf5c9c3ff7fb7fa 100644 (file)
@@ -145,6 +145,8 @@ entry:
         reading_time_minutes: 'timp estimat de citire: %readingTime% min'
         reading_time_less_one_minute: 'timp estimat de citire: <small class="inferieur">&lt;</small> 1 min'
         # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags'
+        reading_time_minutes_short: '%readingTime% min'
+        reading_time_less_one_minute_short: '<small class="inferieur">&lt;</small> 1 min'
         original_article: 'original'
         toogle_as_read: 'Comută marcat ca citit'
         toogle_as_star: 'Comută marcat ca favorit'
@@ -177,7 +179,7 @@ entry:
             back_to_homepage: 'Înapoi'
             set_as_read: 'Marchează ca citit'
             # set_as_unread: 'Mark as unread'
-            set_as_favorite: 'Favorit'
+            set_as_starred: 'Favorit'
             view_original_article: 'Articol original'
             # re_fetch_content: 'Re-fetch content'
             delete: 'Șterge'
@@ -192,6 +194,7 @@ entry:
         edit_title: 'Editează titlul'
         original_article: 'original'
         # annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations'
+        created_at: 'Data creării'
     new:
         page_title: 'Salvează un nou articol'
         placeholder: 'http://website.com'
index 240bc53acf41e08504ce7204d1f52475b364080c..a60dfc86105c9b226c4d58c485979711fd56a85b 100644 (file)
@@ -145,6 +145,8 @@ entry:
         reading_time_minutes: 'tahmini okuma süresi: %readingTime% min'
         reading_time_less_one_minute: 'tahmini okuma süresi: <small class="inferieur">&lt;</small> 1 min'
         # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags'
+        reading_time_minutes_short: '%readingTime% min'
+        reading_time_less_one_minute_short: '<small class="inferieur">&lt;</small> 1 min'
         original_article: 'orijinal'
         toogle_as_read: 'Okundu/okunmadı olarak işaretle'
         toogle_as_star: 'Favorilere ekle/çıkar'
@@ -177,7 +179,7 @@ entry:
             back_to_homepage: 'Back'
             set_as_read: 'Okundu olarak işaretle'
             set_as_unread: 'Okunmadı olarak işaretle'
-            set_as_favorite: 'Favorilere ekle/çıkar'
+            set_as_starred: 'Favorilere ekle/çıkar'
             view_original_article: 'Orijinal makale'
             re_fetch_content: 'İçeriği yenile'
             delete: 'Sil'
@@ -192,6 +194,7 @@ entry:
         edit_title: 'Başlığı düzenle'
         original_article: 'orijinal'
         # annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations'
+        created_at: 'Oluşturulma tarihi'
     new:
         page_title: 'Yeni makaleyi kaydet'
         placeholder: 'http://website.com'
index 40f0ae165c9ea5f4cec3cf2be81a82fd5dfc1b8e..f89265d403605f6943a33b8a44d652dcf3b78bbf 100644 (file)
         </fieldset>
         {% endif %}
 
-        {{ form_rest(form.user) }}
+        {{ form_widget(form.user._token) }}
+        {{ form_widget(form.user.save) }}
     </form>
 
     <h2>{{ 'config.tab_menu.password'|trans }}</h2>
index 8c06cf110c32092cc3c31aaa7d737f0574670ec2..ce47a6771977718ce7a590e27f67df3483468a18 100644 (file)
@@ -9,26 +9,39 @@
         </header>
 
         <div id="article_toolbar">
-        <ul class="links">
-            <li class="topPosF"><a href="#top" title="{{ 'entry.view.left_menu.back_to_top'|trans }}" class="tool top icon icon-arrow-up-thick"><span>{{ 'entry.view.left_menu.set_as_read'|trans }}</span></a></li>
-            <li><a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|e }}" class="tool link icon icon-link"><span>{{ entry.domainName|removeWww }}</span></a></li>
-            <li><a title="{{ 'entry.view.left_menu.re_fetch_content'|trans }}" class="tool icon icon-reload" href="{{ path('reload_entry', { 'id': entry.id }) }}"><span>{{ 'entry.view.left_menu.re_fetch_content'|trans }}</span></a></li>
-            <li><a title="{% if entry.isArchived == 0 %}{{ 'entry.view.left_menu.set_as_read'|trans }}{% else %}{{ 'entry.view.left_menu.set_as_unread'|trans }}{% endif %}" class="tool icon icon-check {% if entry.isArchived == 0 %}archive-off{% else %}archive{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"><span>{% if entry.isArchived == 0 %}{{ 'entry.view.left_menu.set_as_read'|trans }}{% else %}{{ 'entry.view.left_menu.set_as_unread'|trans }}{% endif %}</span></a></li>
-            <li><a title="{{ 'entry.view.left_menu.set_as_favorite'|trans }}" class="tool icon icon-star {% if entry.isStarred == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{{ 'entry.view.left_menu.set_as_favorite'|trans }}</span></a></li>
-            <li><a id="nav-btn-add-tag" title="{{ 'entry.view.left_menu.add_a_tag'|trans }}"><span>{{ 'entry.view.left_menu.add_a_tag'|trans }}</span></a></li>
-            <li><a title="{{ 'entry.view.left_menu.delete'|trans }}" class="tool delete icon icon-trash" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{{ 'entry.view.left_menu.delete'|trans }}</span></a></li>
-            {% if craue_setting('share_twitter') %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool twitter icon icon-twitter" title="Tweet"><span>Tweet</span></a></li>{% endif %}
-            {% if craue_setting('share_mail') %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email icon icon-mail" title="Email"><span>Email</span></a></li>{% endif %}
-            {% if craue_setting('share_shaarli') %}<li><a href="{{ craue_setting('shaarli_url') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="shaarli"><span>shaarli</span></a></li>{% endif %}
-            {% if craue_setting('share_diaspora') %}<li><a href="{{ craue_setting('diaspora_url') }}/bookmarklet?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}&notes=&v=1&noui=1&jump=doclose" target="_blank" class="tool diaspora icon-image icon-image--diaspora" title="diaspora"><span>diaspora</span></a></li>{% endif %}
-            {% if craue_setting('carrot') %}<li><a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" class="tool carrot icon-image icon-image--carrot" target="_blank" title="carrot"><span>Carrot</span></a></li>{% endif %}
-            {% if craue_setting('show_printlink') %}<li><a title="{{ 'entry.view.left_menu.print'|trans }}" class="tool icon icon-print" href="javascript: window.print();"><span>{{ 'entry.view.left_menu.print'|trans }}</span></a></li>{% endif %}
-            {% if craue_setting('export_epub') %}<li><a href="?epub&amp;method=id&amp;value={{ entry.id }}" title="Generate ePub file">EPUB</a></li>{% endif %}
-            {% if craue_setting('export_mobi') %}<li><a href="?mobi&amp;method=id&amp;value={{ entry.id }}" title="Generate Mobi file">MOBI</a></li>{% endif %}
-            {% if craue_setting('export_pdf') %}<li><a href="?pdf&amp;method=id&amp;value={{ entry.id }}" title="Generate PDF file">PDF</a></li>{% endif %}
-            <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&amp;body={{ entry.url|url_encode }}" title="{{ 'entry.view.left_menu.problem.label'|trans }}" class="tool bad-display icon icon-delete"><span>{{ 'entry.view.left_menu.problem.label'|trans }}</span></a></li>
-        </ul>
-    </div>
+            <ul class="links">
+                <li class="topPosF"><a href="#top" title="{{ 'entry.view.left_menu.back_to_top'|trans }}" class="tool top icon icon-arrow-up-thick"><span>{{ 'entry.view.left_menu.set_as_read'|trans }}</span></a></li>
+                <li><a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|e }}" class="tool link icon icon-link"><span>{{ entry.domainName|removeWww }}</span></a></li>
+                <li><a title="{{ 'entry.view.left_menu.re_fetch_content'|trans }}" class="tool icon icon-reload" href="{{ path('reload_entry', { 'id': entry.id }) }}"><span>{{ 'entry.view.left_menu.re_fetch_content'|trans }}</span></a></li>
+                <li><a title="{% if entry.isArchived == 0 %}{{ 'entry.view.left_menu.set_as_read'|trans }}{% else %}{{ 'entry.view.left_menu.set_as_unread'|trans }}{% endif %}" class="tool icon icon-check {% if entry.isArchived == 0 %}archive-off{% else %}archive{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"><span>{% if entry.isArchived == 0 %}{{ 'entry.view.left_menu.set_as_read'|trans }}{% else %}{{ 'entry.view.left_menu.set_as_unread'|trans }}{% endif %}</span></a></li>
+                <li><a title="{{ 'entry.view.left_menu.set_as_starred'|trans }}" class="tool icon icon-star {% if entry.isStarred == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{{ 'entry.view.left_menu.set_as_starred'|trans }}</span></a></li>
+                <li><a id="nav-btn-add-tag" title="{{ 'entry.view.left_menu.add_a_tag'|trans }}"><span>{{ 'entry.view.left_menu.add_a_tag'|trans }}</span></a></li>
+                <li><a title="{{ 'entry.view.left_menu.delete'|trans }}" class="tool delete icon icon-trash" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{{ 'entry.view.left_menu.delete'|trans }}</span></a></li>
+                {% if craue_setting('share_twitter') %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool twitter icon icon-twitter" title="Tweet"><span>Tweet</span></a></li>{% endif %}
+                {% if craue_setting('share_mail') %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email icon icon-mail" title="Email"><span>Email</span></a></li>{% endif %}
+                {% if craue_setting('share_shaarli') %}<li><a href="{{ craue_setting('shaarli_url') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="shaarli"><span>shaarli</span></a></li>{% endif %}
+                {% if craue_setting('share_diaspora') %}<li><a href="{{ craue_setting('diaspora_url') }}/bookmarklet?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}&notes=&v=1&noui=1&jump=doclose" target="_blank" class="tool diaspora icon-image icon-image--diaspora" title="diaspora"><span>diaspora</span></a></li>{% endif %}
+                {% if craue_setting('carrot') %}<li><a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" class="tool carrot icon-image icon-image--carrot" target="_blank" title="carrot"><span>Carrot</span></a></li>{% endif %}
+                {% if craue_setting('show_printlink') %}<li><a title="{{ 'entry.view.left_menu.print'|trans }}" class="tool icon icon-print" href="javascript: window.print();"><span>{{ 'entry.view.left_menu.print'|trans }}</span></a></li>{% endif %}
+                {% if craue_setting('export_epub') %}<li><a href="?epub&amp;method=id&amp;value={{ entry.id }}" title="Generate ePub file">EPUB</a></li>{% endif %}
+                {% if craue_setting('export_mobi') %}<li><a href="?mobi&amp;method=id&amp;value={{ entry.id }}" title="Generate Mobi file">MOBI</a></li>{% endif %}
+                {% if craue_setting('export_pdf') %}<li><a href="?pdf&amp;method=id&amp;value={{ entry.id }}" title="Generate PDF file">PDF</a></li>{% endif %}
+                <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&amp;body={{ entry.url|url_encode }}" title="{{ 'entry.view.left_menu.problem.label'|trans }}" class="tool bad-display icon icon-delete"><span>{{ 'entry.view.left_menu.problem.label'|trans }}</span></a></li>
+            </ul>
+        </div>
+        <div class="link mdi-action-today">
+            {{ 'entry.view.created_at'|trans }}: {{ entry.createdAt|date('Y-m-d') }}
+        </div>
+
+        <div class="link mdi-action-query-builder">
+            {% set readingTime = entry.readingTime / app.user.config.readingSpeed %}
+            {% if readingTime > 0 %}
+                {{ 'entry.list.reading_time_minutes'|trans({'%readingTime%': readingTime|round})|capitalize }}
+            {% else %}
+                {{ 'entry.list.reading_time_less_one_minute'|trans|raw }}
+            {% endif %}
+        </div>
+
         {% set nbAnnotations = entry.annotations | length %}
         <span class="tool link"><i class="material-icons link">comment</i> {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}</span>
         <aside class="tags">
@@ -46,6 +59,7 @@
             {{ entry.content | raw }}
         </article>
     </div>
+
     <script id="annotationroutes" type="application/json">
     {
         "prefix": "",
         "entryId": "{{ entry.id }}"
     }
     </script>
+    <script src="{{ asset('bundles/wallabagcore/themes/_global/js/restoreScroll.js')}}"></script>
+    <script type="text/javascript">
+        $(document).ready(function() {
+            $(window).scroll(function(e){
+                var scrollTop = $(window).scrollTop();
+                var docHeight = $(document).height();
+                var scrollPercent = (scrollTop) / (docHeight);
+                var scrollPercentRounded = Math.round(scrollPercent*100)/100;
+                savePercent({{ entry.id }}, scrollPercentRounded);
+            });
+
+            retrievePercent({{ entry.id }});
+
+            $(window).resize(function(){
+                retrievePercent({{ entry.id }});
+            });
+        });
+    </script>
 {% endblock %}
index eab092c7fe42322f8b219eda9ef44c02fe592640..b529a0ac8d3cfaaa2b8fb9d546580f58420e63b0 100644 (file)
     </ul>
     <h3>{{ 'howto.top_menu.browser_addons'|trans }}</h3>
     <ul>
-        <li><a href="https://addons.mozilla.org/firefox/addon/wallabag-v2/" target="_blank">{{ 'howto.browser_addons.firefox'|trans }}</a></li>
-        <li><a href="https://chrome.google.com/webstore/detail/wallabag/bepdcjnnkglfjehplaogpoonpffbdcdj" target="_blank">{{ 'howto.browser_addons.chrome'|trans }}</a></li>
+        <li><a href="{{ addonsUrl.firefox }}" target="_blank">{{ 'howto.browser_addons.firefox'|trans }}</a></li>
+        <li><a href="{{ addonsUrl.chrome }}" target="_blank">{{ 'howto.browser_addons.chrome'|trans }}</a></li>
     </ul>
     <h3>{{ 'howto.top_menu.mobile_apps'|trans }}</h3>
     <ul>
-        <li>Android: <a href="https://f-droid.org/app/fr.gaulupeau.apps.InThePoche" target="_blank">{{ 'howto.mobile_apps.android.via_f_droid'|trans }}</a> / <a href="https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche" target="_blank">{{ 'howto.mobile_apps.android.via_google_play'|trans }}</a></li>
-        <li>iOS: <a href="https://itunes.apple.com/app/wallabag/id828331015?mt=8" target="_blank">{{ 'howto.mobile_apps.ios'|trans }}</a></li>
-        <li>Windows Phone: <a href="http://www.windowsphone.com/en-US/store/app/wallabag/d5226cf1-f422-4e00-996c-88e9c5233332" target="_blank">{{ 'howto.mobile_apps.windows'|trans }}</a></li>
+        <li>Android: <a href="{{ addonsUrl.f_droid }}" target="_blank">{{ 'howto.mobile_apps.android.via_f_droid'|trans }}</a> / <a href="{{ addonsUrl.google_play }}" target="_blank">{{ 'howto.mobile_apps.android.via_google_play'|trans }}</a></li>
+        <li>iOS: <a href="{{ addonsUrl.ios }}" target="_blank">{{ 'howto.mobile_apps.ios'|trans }}</a></li>
+        <li>Windows Phone: <a href="{{ addonsUrl.windows }}" target="_blank">{{ 'howto.mobile_apps.windows'|trans }}</a></li>
     </ul>
     <h3>{{ 'howto.top_menu.bookmarklet'|trans }}</h3>
     <p>
index 9fb92d3d71ddc526978121ad988a2461967e0f76..11b02294b131dc8e4cc40f9446e3c4a0525598fe 100644 (file)
                             {% endif %}
 
                             {{ form_widget(form.user.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
-                            {{ form_rest(form.user) }}
+                            {{ form_widget(form.user._token) }}
                         </form>
                     </div>
 
index e9a2b1831063fa2ce7d0c157a916b22ca26230cf..eca8924ec6149845bbc473a5f0e0f56d14c4a365 100644 (file)
@@ -93,7 +93,7 @@
                         <ul class="tools right">
                             <li>
                                 <a title="{{ 'entry.list.toogle_as_read'|trans }}" class="tool grey-text" href="{{ path('archive_entry', { 'id': entry.id }) }}"><i class="material-icons">{% if entry.isArchived == 0 %}done{% else %}redo{% endif %}</i></a>
-                                <a title="{{ 'entry.list.toogle_as_star'|trans }}" class="tool grey-text" href="{{ path('star_entry', { 'id': entry.id }) }}"><i class="material-icons">{% if entry.isStarred == 0 %}favorite_border{% else %}favorite{% endif %}</i></a>
+                                <a title="{{ 'entry.list.toogle_as_star'|trans }}" class="tool grey-text" href="{{ path('star_entry', { 'id': entry.id }) }}"><i class="material-icons">{% if entry.isStarred == 0 %}star_border{% else %}star{% endif %}</i></a>
                                 <a title="{{ 'entry.list.delete'|trans }}" class="tool grey-text delete" href="{{ path('delete_entry', { 'id': entry.id }) }}"><i class="material-icons">delete</i></a>
                             </li>
                         </ul>
index 2a5cdfac1ddb419d782cd5e09fd100f0df42017a..5dd2afb3e32d58d52b953067086da402ea844557 100644 (file)
@@ -24,8 +24,8 @@
                     </a>
                 </li>
                 <li>
-                    <a class="waves-effect" title="{{ 'entry.view.left_menu.set_as_favorite'|trans }}" href="{{ path('star_entry', { 'id': entry.id }) }}" id="setFav">
-                        <i class="material-icons small">{% if entry.isStarred == 0 %}favorite_outline{% else %}favorite{% endif %}</i>
+                    <a class="waves-effect" title="{{ 'entry.view.left_menu.set_as_starred'|trans }}" href="{{ path('star_entry', { 'id': entry.id }) }}" id="setFav">
+                        <i class="material-icons small">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i>
                     </a>
                 </li>
                 <li>
@@ -70,9 +70,9 @@
         </li>
 
         <li class="bold hide-on-med-and-down">
-            <a class="waves-effect collapsible-header" title="{{ 'entry.view.left_menu.set_as_favorite'|trans }}" href="{{ path('star_entry', { 'id': entry.id }) }}" id="setFav">
-                <i class="material-icons spall">{% if entry.isStarred == 0 %}favorite_outline{% else %}favorite{% endif %}</i>
-                <span>{{ 'entry.view.left_menu.set_as_favorite'|trans }}</span>
+            <a class="waves-effect collapsible-header" title="{{ 'entry.view.left_menu.set_as_starred'|trans }}" href="{{ path('star_entry', { 'id': entry.id }) }}" id="setFav">
+                <i class="material-icons spall">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i>
+                <span>{{ 'entry.view.left_menu.set_as_starred'|trans }}</span>
             </a>
             <div class="collapsible-body"></div>
         </li>
             <h1>{{ entry.title|raw }} <a href="{{ path('edit', { 'id': entry.id }) }}" title="{{ 'entry.view.edit_title'|trans }}">✎</a></h1>
         </header>
         <aside>
+            {% set readingTime = entry.readingTime / app.user.config.readingSpeed %}
+            <span class="link mdi-action-query-builder">
+                {% if readingTime > 0 %}
+                    {{ 'entry.list.reading_time_minutes_short'|trans({'%readingTime%': readingTime|round}) }}
+                {% else %}
+                    {{ 'entry.list.reading_time_less_one_minute_short'|trans|raw }}
+                {% endif %}
+            </span>
+            <span class="link mdi-action-today" title="{{ 'entry.view.created_at'|trans }}"> {{ entry.createdAt|date('Y-m-d') }}</span>
             <a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|e }}" class="tool">
             <span class="link"><i class="material-icons link">link</i> {{ entry.domainName|removeWww }}</span></a>
             <span class="tool link"><i class="material-icons link">comment</i> {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}</span>
index 4354a6b7fb80aa30c513b784d8128a2ee9391450..6a177d6bbaa7e2feb822b54b6988b567f3264d52 100644 (file)
                     <div class="col s12">
                         <h5>{{ 'howto.top_menu.browser_addons'|trans }}</h5>
                         <ul>
-                            <li><a href="https://addons.mozilla.org/firefox/addon/wallabag-v2/" target="_blank">{{ 'howto.browser_addons.firefox'|trans }}</a></li>
-                            <li><a href="https://chrome.google.com/webstore/detail/wallabag/bepdcjnnkglfjehplaogpoonpffbdcdj" target="_blank">{{ 'howto.browser_addons.chrome'|trans }}</a></li>
+                            <li><a href="{{ addonsUrl.firefox }}" target="_blank">{{ 'howto.browser_addons.firefox'|trans }}</a></li>
+                            <li><a href="{{ addonsUrl.chrome }}" target="_blank">{{ 'howto.browser_addons.chrome'|trans }}</a></li>
                         </ul>
                     </div>
 
                     <div class="col s12">
                         <h5>{{ 'howto.top_menu.mobile_apps'|trans }}</h5>
                         <ul>
-                            <li>Android: <a href="https://f-droid.org/app/fr.gaulupeau.apps.InThePoche" target="_blank">{{ 'howto.mobile_apps.android.via_f_droid'|trans }}</a> / <a href="https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche" target="_blank">{{ 'howto.mobile_apps.android.via_google_play'|trans }}</a></li>
-                            <li>iOS: <a href="https://itunes.apple.com/app/wallabag/id828331015?mt=8" target="_blank">{{ 'howto.mobile_apps.ios'|trans }}</a></li>
-                            <li>Windows Phone: <a href="http://www.windowsphone.com/en-US/store/app/wallabag/d5226cf1-f422-4e00-996c-88e9c5233332" target="_blank">{{ 'howto.mobile_apps.windows'|trans }}</a></li>
+                            <li>Android: <a href="{{ addonsUrl.f_droid }}" target="_blank">{{ 'howto.mobile_apps.android.via_f_droid'|trans }}</a> / <a href="{{ addonsUrl.google_play }}" target="_blank">{{ 'howto.mobile_apps.android.via_google_play'|trans }}</a></li>
+                            <li>iOS: <a href="{{ addonsUrl.ios }}" target="_blank">{{ 'howto.mobile_apps.ios'|trans }}</a></li>
+                            <li>Windows Phone: <a href="{{ addonsUrl.windows }}" target="_blank">{{ 'howto.mobile_apps.windows'|trans }}</a></li>
                         </ul>
                     </div>
 
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/footer.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/footer.html.twig
new file mode 100644 (file)
index 0000000..7cb1996
--- /dev/null
@@ -0,0 +1,41 @@
+<footer class="page-footer cyan darken-2">
+    <div class="container">
+        <div class="row">
+            <div class="col l6 s12">
+                <h5 class="white-text">{{ 'footer.wallabag.elsewhere'|trans }}</h5>
+                <p class="grey-text text-lighten-4">
+                    <a target="_blank" class="grey-text text-lighten-3" href="{{ addonsUrl.google_play }}" title="Android">
+                        <span class="icon-android"></span>
+                    </a>
+                    <a target="_blank" class="grey-text text-lighten-3" href="{{ addonsUrl.ios }}" title="iOS">
+                        <span class="icon-apple"></span>
+                    </a>
+                    <a target="_blank" class="grey-text text-lighten-3" href="{{ addonsUrl.firefox }}" title="Firefox">
+                        <span class="icon-firefox"></span>
+                    </a>
+                    <a target="_blank" class="grey-text text-lighten-3" href="{{ addonsUrl.chrome }}" title="Chrome">
+                        <span class="icon-chrome"></span>
+                    </a>
+                </p>
+            </div>
+            <div class="col l4 offset-l2 s12">
+                <h5 class="white-text">{{ 'footer.wallabag.social'|trans }}</h5>
+                <a target="_blank" class="grey-text text-lighten-3" href="{{ socialsUrl.twitter }}" title="Twitter">
+                    <span class="icon-twitter"></span>
+                </a>
+                <a target="_blank" class="grey-text text-lighten-3" href="{{ socialsUrl.google_plus }}" title="Google+">
+                    <span class="icon-google-plus2"></span>
+                </a>
+                <a target="_blank" class="grey-text text-lighten-3" href="{{ socialsUrl.facebook }}" title="Facebook">
+                    <span class="icon-facebook2"></span>
+                </a>
+            </div>
+        </div>
+    </div>
+    <div class="footer-copyright">
+        <div class="container">
+            <p>{{ 'footer.wallabag.powered_by'|trans }} <a target="_blank" href="https://wallabag.org" class="grey-text text-lighten-4">wallabag</a></p>
+            <a class="grey-text text-lighten-4 right" href="{{ path('about') }}">{{ 'footer.wallabag.about'|trans }}</a>
+        </div>
+    </div>
+</footer>
index 563820969c42f1c92fa50e2956cdda3c2f6f4c5b..50134357f942a47327a10b8c146f80c3244d94ea 100644 (file)
@@ -26,7 +26,7 @@
         <ul id="slide-out" class="side-nav fixed">
             {% block logo %}
                 <li class="logo border-bottom">
-                    <a title="{% trans %}Back to unread articles{% endtrans %}" href="{{ path('unread') }}">
+                    <a title="{{ 'menu.left.back_to_unread'|trans }}" href="{{ path('unread') }}">
                         <img src="{{ asset('bundles/wallabagcore/themes/_global/img/logo-square.png') }}" alt="wallabag logo" />
                     </a>
                 </li>
 {% endblock %}
 
 {% block footer %}
-    <footer class="page-footer cyan darken-2">
-        <div class="container">
-            <div class="row">
-                <div class="col l6 s12">
-                    <h5 class="white-text">{{ 'footer.wallabag.elsewhere'|trans }}</h5>
-                    <p class="grey-text text-lighten-4">
-                        <a target="_blank" class="grey-text text-lighten-3" href="https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche" title="Android">
-                            <span class="icon-android"></span>
-                        </a>
-                        <a target="_blank" class="grey-text text-lighten-3" href="https://itunes.apple.com/app/id828331015" title="iOS">
-                            <span class="icon-apple"></span>
-                        </a>
-                        <a target="_blank" class="grey-text text-lighten-3" href="https://addons.mozilla.org/firefox/addon/wallabag-v2/" title="Firefox">
-                            <span class="icon-firefox"></span>
-                        </a>
-                        <a target="_blank" class="grey-text text-lighten-3" href="https://chrome.google.com/webstore/detail/wallabagger/gbmgphmejlcoihgedabhgjdkcahacjlj" title="Chrome">
-                            <span class="icon-chrome"></span>
-                        </a>
-                    </p>
-                </div>
-                <div class="col l4 offset-l2 s12">
-                    <h5 class="white-text">{{ 'footer.wallabag.social'|trans }}</h5>
-                    <a target="_blank" class="grey-text text-lighten-3" href="https://twitter.com/wallabagapp" title="Twitter">
-                        <span class="icon-twitter"></span>
-                    </a>
-                    <a target="_blank" class="grey-text text-lighten-3" href="https://plus.google.com/+WallabagOrg/posts" title="Google+">
-                        <span class="icon-google-plus2"></span>
-                    </a>
-                    <a target="_blank" class="grey-text text-lighten-3" href="https://facebook.com/Wallabag" title="Facebook">
-                        <span class="icon-facebook2"></span>
-                    </a>
-                </div>
-            </div>
-        </div>
-        <div class="footer-copyright">
-            <div class="container">
-                <p>{{ 'footer.wallabag.powered_by'|trans }} <a target="_blank" href="https://wallabag.org" class="grey-text text-lighten-4">wallabag</a></p>
-                <a class="grey-text text-lighten-4 right" href="{{ path('about') }}">{{ 'footer.wallabag.about'|trans }}</a>
-            </div>
-        </div>
-    </footer>
+    {{ render(controller("WallabagCoreBundle:Footer:index")) }}
 {% endblock %}
diff --git a/src/Wallabag/ImportBundle/Import/AbstractImport.php b/src/Wallabag/ImportBundle/Import/AbstractImport.php
new file mode 100644 (file)
index 0000000..14377a3
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+
+namespace Wallabag\ImportBundle\Import;
+
+use Psr\Log\LoggerInterface;
+use Psr\Log\NullLogger;
+use Doctrine\ORM\EntityManager;
+use Wallabag\CoreBundle\Helper\ContentProxy;
+use Wallabag\CoreBundle\Entity\Entry;
+
+abstract class AbstractImport implements ImportInterface
+{
+    protected $em;
+    protected $logger;
+    protected $contentProxy;
+
+    public function __construct(EntityManager $em, ContentProxy $contentProxy)
+    {
+        $this->em = $em;
+        $this->logger = new NullLogger();
+        $this->contentProxy = $contentProxy;
+    }
+
+    public function setLogger(LoggerInterface $logger)
+    {
+        $this->logger = $logger;
+    }
+
+    /**
+     * Fetch content from the ContentProxy (using graby).
+     * If it fails return false instead of the updated entry.
+     *
+     * @param Entry  $entry   Entry to update
+     * @param string $url     Url to grab content for
+     * @param array  $content An array with AT LEAST keys title, html, url, language & content_type to skip the fetchContent from the url
+     *
+     * @return Entry|false
+     */
+    protected function fetchContent(Entry $entry, $url, array $content = [])
+    {
+        try {
+            return $this->contentProxy->updateEntry($entry, $url, $content);
+        } catch (\Exception $e) {
+            return false;
+        }
+    }
+}
index 29361a328cf11d44c62f4b1e18c1288b8a4ae15d..798cfdaefe05cc0746340d8f21b2b8b38e2d616b 100644 (file)
@@ -2,7 +2,6 @@
 
 namespace Wallabag\ImportBundle\Import;
 
-use Psr\Log\LoggerInterface;
 use Psr\Log\NullLogger;
 use Doctrine\ORM\EntityManager;
 use GuzzleHttp\Client;
@@ -12,12 +11,9 @@ use Wallabag\CoreBundle\Entity\Entry;
 use Wallabag\CoreBundle\Helper\ContentProxy;
 use Craue\ConfigBundle\Util\Config;
 
-class PocketImport implements ImportInterface
+class PocketImport extends AbstractImport
 {
     private $user;
-    private $em;
-    private $contentProxy;
-    private $logger;
     private $client;
     private $consumerKey;
     private $skippedEntries = 0;
@@ -34,11 +30,6 @@ class PocketImport implements ImportInterface
         $this->logger = new NullLogger();
     }
 
-    public function setLogger(LoggerInterface $logger)
-    {
-        $this->logger = $logger;
-    }
-
     /**
      * {@inheritdoc}
      */
@@ -219,14 +210,20 @@ class PocketImport implements ImportInterface
             }
 
             $entry = new Entry($this->user);
-            $entry = $this->contentProxy->updateEntry($entry, $url);
+            $entry = $this->fetchContent($entry, $url);
+
+            // jump to next entry in case of problem while getting content
+            if (false === $entry) {
+                ++$this->skippedEntries;
+                continue;
+            }
 
             // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted
             if ($pocketEntry['status'] == 1 || $this->markAsRead) {
                 $entry->setArchived(true);
             }
 
-            // 0 or 1 - 1 If the item is favorited
+            // 0 or 1 - 1 If the item is starred
             if ($pocketEntry['favorite'] == 1) {
                 $entry->setStarred(true);
             }
index 65803823b04bac3f4b008b778564291d13655a6d..a1cc085b3e12c14a8ba0ceaccbde48b7f5a3c0ea 100644 (file)
@@ -2,19 +2,12 @@
 
 namespace Wallabag\ImportBundle\Import;
 
-use Psr\Log\LoggerInterface;
-use Psr\Log\NullLogger;
-use Doctrine\ORM\EntityManager;
 use Wallabag\CoreBundle\Entity\Entry;
 use Wallabag\UserBundle\Entity\User;
-use Wallabag\CoreBundle\Helper\ContentProxy;
 
-abstract class WallabagImport implements ImportInterface
+abstract class WallabagImport extends AbstractImport
 {
     protected $user;
-    protected $em;
-    protected $logger;
-    protected $contentProxy;
     protected $skippedEntries = 0;
     protected $importedEntries = 0;
     protected $filepath;
@@ -35,18 +28,6 @@ abstract class WallabagImport implements ImportInterface
         '',
     ];
 
-    public function __construct(EntityManager $em, ContentProxy $contentProxy)
-    {
-        $this->em = $em;
-        $this->logger = new NullLogger();
-        $this->contentProxy = $contentProxy;
-    }
-
-    public function setLogger(LoggerInterface $logger)
-    {
-        $this->logger = $logger;
-    }
-
     /**
      * We define the user in a custom call because on the import command there is no logged in user.
      * So we can't retrieve user from the `security.token_storage` service.
@@ -159,12 +140,18 @@ abstract class WallabagImport implements ImportInterface
 
             $data = $this->prepareEntry($importedEntry, $this->markAsRead);
 
-            $entry = $this->contentProxy->updateEntry(
+            $entry = $this->fetchContent(
                 new Entry($this->user),
                 $importedEntry['url'],
                 $data
             );
 
+            // jump to next entry in case of problem while getting content
+            if (false === $entry) {
+                ++$this->skippedEntries;
+                continue;
+            }
+
             if (array_key_exists('tags', $data)) {
                 $this->contentProxy->assignTagsToEntry(
                     $entry,
index 2413d735485811761d3bb49536dcbac9be9346eb..c0133af4ab6cb7260dade5ca34f03dc9dacf5352 100644 (file)
@@ -28,16 +28,32 @@ class InstallCommandTest extends WallabagCoreTestCase
              *
              * http://stackoverflow.com/a/14374832/569101
              */
-            $this->markTestSkipped('PostgreSQL spotted: can find a good way to drop current database, skipping.');
+            $this->markTestSkipped('PostgreSQL spotted: can\'t find a good way to drop current database, skipping.');
         }
     }
 
+    /**
+     * Ensure next tests will have a clean database
+     */
     public static function tearDownAfterClass()
     {
         $application = new Application(static::$kernel);
         $application->setAutoExit(false);
 
-        $code = $application->run(new ArrayInput([
+        $application->run(new ArrayInput([
+            'command' => 'doctrine:schema:drop',
+            '--no-interaction' => true,
+            '--force' => true,
+            '--env' => 'test',
+        ]), new NullOutput());
+
+        $application->run(new ArrayInput([
+            'command' => 'doctrine:schema:create',
+            '--no-interaction' => true,
+            '--env' => 'test',
+        ]), new NullOutput());
+
+        $application->run(new ArrayInput([
             'command' => 'doctrine:fixtures:load',
             '--no-interaction' => true,
             '--env' => 'test',
index 41f9b51f2bd4108438d341ac5aa036d3b4eaacb6..8534e1c8fa832c9e401a8b6248a9e892b7154319 100644 (file)
@@ -390,4 +390,55 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase
         $this->assertContains('PocketImport: Failed to import', $records[0]['message']);
         $this->assertEquals('ERROR', $records[0]['level_name']);
     }
+
+    public function testImportWithExceptionFromGraby()
+    {
+        $client = new Client();
+
+        $mock = new Mock([
+            new Response(200, ['Content-Type' => 'application/json'], Stream::factory(json_encode(['access_token' => 'wunderbar_token']))),
+            new Response(200, ['Content-Type' => 'application/json'], Stream::factory('
+                {
+                    "status": 1,
+                    "list": {
+                        "229279689": {
+                            "resolved_url": "http://www.grantland.com/blog/the-triangle/post/_/id/38347/ryder-cup-preview"
+                        }
+                    }
+                }
+            ')),
+        ]);
+
+        $client->getEmitter()->attach($mock);
+
+        $pocketImport = $this->getPocketImport();
+
+        $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')
+            ->disableOriginalConstructor()
+            ->getMock();
+
+        $entryRepo->expects($this->once())
+            ->method('findByUrlAndUserId')
+            ->will($this->onConsecutiveCalls(false, true));
+
+        $this->em
+            ->expects($this->once())
+            ->method('getRepository')
+            ->willReturn($entryRepo);
+
+        $entry = new Entry($this->user);
+
+        $this->contentProxy
+            ->expects($this->once())
+            ->method('updateEntry')
+            ->will($this->throwException(new \Exception()));
+
+        $pocketImport->setClient($client);
+        $pocketImport->authorize('wunderbar_code');
+
+        $res = $pocketImport->import();
+
+        $this->assertTrue($res);
+        $this->assertEquals(['skipped' => 1, 'imported' => 0], $pocketImport->getSummary());
+    }
 }
index 8ec66b12e41672b4d7e223217d8231b550386a5f..4a45e0f0a6779ab750f710ce157e85b235aa8c9e 100644 (file)
@@ -143,4 +143,44 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase
         $this->assertContains('WallabagImport: user is not defined', $records[0]['message']);
         $this->assertEquals('ERROR', $records[0]['level_name']);
     }
+
+    public function testImportEmptyFile()
+    {
+        $wallabagV2Import = $this->getWallabagV2Import();
+        $wallabagV2Import->setFilepath(__DIR__.'/../fixtures/wallabag-v2-empty.json');
+
+        $res = $wallabagV2Import->import();
+
+        $this->assertFalse($res);
+        $this->assertEquals(['skipped' => 0, 'imported' => 0], $wallabagV2Import->getSummary());
+    }
+
+    public function testImportWithExceptionFromGraby()
+    {
+        $wallabagV2Import = $this->getWallabagV2Import();
+        $wallabagV2Import->setFilepath(__DIR__.'/../fixtures/wallabag-v2.json');
+
+        $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')
+            ->disableOriginalConstructor()
+            ->getMock();
+
+        $entryRepo->expects($this->exactly(24))
+            ->method('findByUrlAndUserId')
+            ->will($this->onConsecutiveCalls(false, true, false));
+
+        $this->em
+            ->expects($this->any())
+            ->method('getRepository')
+            ->willReturn($entryRepo);
+
+        $this->contentProxy
+            ->expects($this->exactly(2))
+            ->method('updateEntry')
+            ->will($this->throwException(new \Exception()));
+
+        $res = $wallabagV2Import->import();
+
+        $this->assertTrue($res);
+        $this->assertEquals(['skipped' => 24, 'imported' => 0], $wallabagV2Import->getSummary());
+    }
 }
diff --git a/tests/Wallabag/ImportBundle/fixtures/wallabag-v2-empty.json b/tests/Wallabag/ImportBundle/fixtures/wallabag-v2-empty.json
new file mode 100644 (file)
index 0000000..e69de29