aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-08-22 23:03:16 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-08-22 23:03:16 +0200
commit79efca1e6ff28362d4bd2713f68205294cdd07de (patch)
treec20482071f97b5ba0f075d59a9a097b08b26b910
parent9c545fe028013b30417c1a932cd6b9027bff752d (diff)
parent80bb0b73445092c4aa3e94f90cc5f8667fa123ba (diff)
downloadwallabag-79efca1e6ff28362d4bd2713f68205294cdd07de.tar.gz
wallabag-79efca1e6ff28362d4bd2713f68205294cdd07de.tar.zst
wallabag-79efca1e6ff28362d4bd2713f68205294cdd07de.zip
Merge remote-tracking branch 'origin/master' into 2.1
-rw-r--r--.travis.yml35
-rw-r--r--.zappr.yaml26
-rw-r--r--CHANGELOG.md33
-rw-r--r--README.md4
-rw-r--r--app/Resources/static/themes/baggy/css/ratatouille.css3
-rwxr-xr-xapp/Resources/static/themes/material/css/main.css3
-rw-r--r--app/config/config.yml7
-rw-r--r--docs/de/user/installation.rst4
-rw-r--r--docs/en/user/installation.rst2
-rw-r--r--docs/fr/user/installation.rst2
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php2
-rw-r--r--src/Wallabag/CoreBundle/Controller/FooterController.php27
-rw-r--r--src/Wallabag/CoreBundle/Controller/StaticController.php4
-rw-r--r--src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php1
-rw-r--r--src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php2
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/ConfigType.php4
-rw-r--r--src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php6
-rw-r--r--src/Wallabag/CoreBundle/Resources/config/parameters.yml12
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.da.yml5
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.de.yml7
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.en.yml7
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.es.yml5
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml5
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml5
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.it.yml5
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml5
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml5
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml5
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml5
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig3
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig72
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/Static/howto.html.twig10
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig2
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig2
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig19
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Static/howto.html.twig10
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/footer.html.twig41
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig44
-rw-r--r--src/Wallabag/ImportBundle/Import/AbstractImport.php47
-rw-r--r--src/Wallabag/ImportBundle/Import/PocketImport.php21
-rw-r--r--src/Wallabag/ImportBundle/Import/WallabagImport.php29
-rw-r--r--tests/Wallabag/CoreBundle/Command/InstallCommandTest.php20
-rw-r--r--tests/Wallabag/ImportBundle/Import/PocketImportTest.php51
-rw-r--r--tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php40
-rw-r--r--tests/Wallabag/ImportBundle/fixtures/wallabag-v2-empty.json0
45 files changed, 494 insertions, 153 deletions
diff --git a/.travis.yml b/.travis.yml
index 69b4f919..65e7e304 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -23,8 +23,8 @@ php:
23 - 5.5 23 - 5.5
24 - 5.6 24 - 5.6
25 - 7.0 25 - 7.0
26 - 7.1
26 - nightly 27 - nightly
27 - hhvm
28 28
29node_js: 29node_js:
30 - "5" 30 - "5"
@@ -37,15 +37,32 @@ env:
37matrix: 37matrix:
38 fast_finish: true 38 fast_finish: true
39 include: 39 include:
40 # driver for PostgreSQL currently unsupported by HHVM, requires 3rd party dependency
41 - php: hhvm-3.12
42 sudo: required
43 dist: trusty
44 group: edge
45 env: DB=mysql
46 addons:
47 apt:
48 packages:
49 - mysql-server-5.6
50 - mysql-client-core-5.6
51 - mysql-client-5.6
52 services:
53 - mysql
54 - php: hhvm-3.12
55 sudo: required
56 dist: trusty
57 group: edge
58 env: DB=sqlite
40 - php: 7.0 59 - php: 7.0
41 env: CS_FIXER=run VALIDATE_TRANSLATION_FILE=run DB=sqlite ASSETS=nobuild 60 env: CS_FIXER=run VALIDATE_TRANSLATION_FILE=run DB=sqlite ASSETS=nobuild
42 - php: 7.0 61 - php: 7.0
43 env: DB=sqlite ASSETS=build 62 env: DB=sqlite ASSETS=build
44 exclude:
45 - php: hhvm
46 env: DB=pgsql # driver for PostgreSQL currently unsupported by HHVM, requires 3rd party dependency
47 allow_failures: 63 allow_failures:
48 - php: hhvm 64 - php: hhvm-3.12
65 - php: nightly
49 66
50# exclude v1 branches 67# exclude v1 branches
51branches: 68branches:
@@ -53,9 +70,11 @@ branches:
53 - legacy 70 - legacy
54 71
55before_script: 72before_script:
56 - if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi; 73 - PHP=$TRAVIS_PHP_VERSION
57 - if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-rm xdebug.ini; fi; 74 - if [[ ! $PHP = hhvm* ]]; then echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;
58 - if [ "$TRAVIS_PHP_VERSION" = "5.5" ]; then composer require "phpunit/phpunit:4.*" --no-update; fi; 75 # xdebug isn't enable for PHP 7.1
76 - if [[ ! $PHP = hhvm* ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi
77 - if [[ $PHP = 5.5 ]]; then composer require "phpunit/phpunit:4.*" --no-update; fi;
59 - composer self-update --no-progress 78 - composer self-update --no-progress
60 - if [[ "$DB" = "pgsql" ]]; then psql -c 'create database wallabag_test;' -U postgres; fi; 79 - if [[ "$DB" = "pgsql" ]]; then psql -c 'create database wallabag_test;' -U postgres; fi;
61 80
diff --git a/.zappr.yaml b/.zappr.yaml
new file mode 100644
index 00000000..f90cd809
--- /dev/null
+++ b/.zappr.yaml
@@ -0,0 +1,26 @@
1# see https://zappr.opensource.zalan.do/
2autobranch: false
3commit: false
4approvals:
5 minimum: 1
6 ignore: pr_opener
7 pattern: "^(:\\+1:|👍)$"
8 veto:
9 pattern: "^(:\\-1:|👎)$"
10 from:
11 orgs:
12 - wallabag
13 collaborators: true
14specification:
15 title:
16 minimum-length:
17 enabled: true
18 length: 8
19 body:
20 minimum-length:
21 enabled: true
22 length: 8
23 contains-url: false
24 contains-issue-number: false
25 template:
26 differs-from-body: true
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 97245c68..a6f7e168 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,39 @@
2 2
3All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). 3All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).
4 4
5## [2.0.7] - 2016-08-22
6
7### Added
8
9- [#2222](https://github.com/wallabag/wallabag/pull/2222) Added creation date and reading time on article view (Nicolas Lœuillet)
10- [#2134](https://github.com/wallabag/wallabag/pull/2134) Run tests on an uptodate HHVM (Jeremy Benoist)
11
12### Changed
13
14- [#2221](https://github.com/wallabag/wallabag/pull/2221) Replaced favorite word/icon with star one (Nicolas Lœuillet)
15
16### Fixed
17
18- [#2224](https://github.com/wallabag/wallabag/pull/2224) Avoid breaking import when fetching fail (Jeremy Benoist)
19- [#2216](https://github.com/wallabag/wallabag/pull/2216), [#2220](https://github.com/wallabag/wallabag/pull/2220) Enable CORS headers for OAUTH part (Rurik19)
20- [#2095](https://github.com/wallabag/wallabag/pull/2095) Fix form user display when 2FA is disabled (Nicolas Lœuillet)
21
22## [2.0.6] - 2016-08-10
23
24### Changed
25
26- [#2199](https://github.com/wallabag/wallabag/pull/2199) Handling socials links into a config file (Simon Alberny)
27- [#2172](https://github.com/wallabag/wallabag/pull/2172) Change the way to login user in tests (Jeremy Benoist)
28- [#2155](https://github.com/wallabag/wallabag/pull/2155) Use friendsofphp instead of fabpot for PHP CS Fixer (Jeremy Benoist)
29
30### Fixed
31
32- [#2200](https://github.com/wallabag/wallabag/pull/2200) Fixed typo in entry:notice:entry_saved (charno6)
33- [#2185](https://github.com/wallabag/wallabag/pull/2185) Fix 3rd-Party Apps links (Chrome & Firefox) (Thomas Citharel)
34- [#2165](https://github.com/wallabag/wallabag/pull/2165) Fix a few french translations typos (Thomas Citharel)
35- [#2157](https://github.com/wallabag/wallabag/pull/2157) Handle only upper or only lower reading filter (Jeremy Benoist)
36- [#2156](https://github.com/wallabag/wallabag/pull/2156) Try to find bad redirection after delete (Jeremy Benoist)
37
5## [2.0.5] - 2016-05-31 38## [2.0.5] - 2016-05-31
6 39
7### Added 40### Added
diff --git a/README.md b/README.md
index 0d87d7bb..6053e6d9 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
1[![Build Status](https://api.travis-ci.org/wallabag/wallabag.svg?branch=master)](https://travis-ci.org/wallabag/wallabag) 1[![Build Status](https://api.travis-ci.org/wallabag/wallabag.svg?branch=master)](https://travis-ci.org/wallabag/wallabag)
2[![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) 2[![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)
3[![Gitter](https://badges.gitter.im/gitterHQ/gitter.svg)](https://gitter.im/wallabag/wallabag) 3[![Gitter](https://badges.gitter.im/gitterHQ/gitter.svg)](https://gitter.im/wallabag/wallabag)
4 4
5# What is wallabag? 5# What is wallabag?
@@ -16,7 +16,7 @@ Then you can install wallabag by executing the following commands:
16``` 16```
17 git clone https://github.com/wallabag/wallabag.git 17 git clone https://github.com/wallabag/wallabag.git
18 cd wallabag 18 cd wallabag
19 git checkout 2.0.5 19 git checkout 2.0.7
20 SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist 20 SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
21 php bin/console wallabag:install --env=prod 21 php bin/console wallabag:install --env=prod
22 php bin/console server:run --env=prod 22 php bin/console server:run --env=prod
diff --git a/app/Resources/static/themes/baggy/css/ratatouille.css b/app/Resources/static/themes/baggy/css/ratatouille.css
index bf89d881..b5aeb54e 100644
--- a/app/Resources/static/themes/baggy/css/ratatouille.css
+++ b/app/Resources/static/themes/baggy/css/ratatouille.css
@@ -63,8 +63,7 @@ pre {
63 max-width: 61.25em; /* 980px */ 63 max-width: 61.25em; /* 980px */
64} 64}
65 65
66table, 66table, img, figure {
67img {
68 max-width: 100%; 67 max-width: 100%;
69 height: auto; 68 height: auto;
70} 69}
diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css
index 2ffe0b46..cade37f6 100755
--- a/app/Resources/static/themes/material/css/main.css
+++ b/app/Resources/static/themes/material/css/main.css
@@ -436,7 +436,8 @@ main ul.row {
436 max-width: 40em; 436 max-width: 40em;
437} 437}
438 438
439#article img { 439#article img,
440#article figure {
440 max-width: 100%; 441 max-width: 100%;
441 height: auto; 442 height: auto;
442} 443}
diff --git a/app/config/config.yml b/app/config/config.yml
index a1517e97..80754393 100644
--- a/app/config/config.yml
+++ b/app/config/config.yml
@@ -30,7 +30,7 @@ framework:
30 assets: ~ 30 assets: ~
31 31
32wallabag_core: 32wallabag_core:
33 version: 2.0.5 33 version: 2.0.7
34 paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb" 34 paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb"
35 languages: 35 languages:
36 en: 'English' 36 en: 'English'
@@ -140,6 +140,11 @@ nelmio_cors:
140 '^/api/': 140 '^/api/':
141 allow_origin: ['*'] 141 allow_origin: ['*']
142 allow_headers: ['X-Custom-Auth'] 142 allow_headers: ['X-Custom-Auth']
143 allow_methods: ['POST', 'PUT', 'PATCH','GET', 'DELETE']
144 max_age: 3600
145 '^/oauth/':
146 allow_origin: ['*']
147 allow_headers: ['X-Custom-Auth']
143 allow_methods: ['POST', 'PUT', 'GET', 'DELETE'] 148 allow_methods: ['POST', 'PUT', 'GET', 'DELETE']
144 max_age: 3600 149 max_age: 3600
145 '^/': 150 '^/':
diff --git a/docs/de/user/installation.rst b/docs/de/user/installation.rst
index 37a80170..1b6710b7 100644
--- a/docs/de/user/installation.rst
+++ b/docs/de/user/installation.rst
@@ -54,7 +54,7 @@ Um wallabag selbst zu installieren, musst du die folgenden Kommandos ausfÃŒhren:
54 54
55 git clone https://github.com/wallabag/wallabag.git 55 git clone https://github.com/wallabag/wallabag.git
56 cd wallabag 56 cd wallabag
57 git checkout 2.0.5 57 git checkout 2.0.7
58 SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist 58 SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
59 php bin/console wallabag:install --env=prod 59 php bin/console wallabag:install --env=prod
60 60
@@ -73,7 +73,7 @@ Und wallabag unter http://deineserverip:8000 erreichen
73Auf einem geteilten Webhosting 73Auf einem geteilten Webhosting
74~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 74~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75 75
76Wir stellen ein Paket inkl. aller AbhÀngigkeiten bereit. 76Wir stellen ein Paket inkl. aller AbhÀngigkeiten bereit.
77Die Standardkonfiguration nutzt SQLite fÌr die Datenbank. Wenn du diese Einstellung Àndern willst, Àndere bitte ``app/config/parameters.yml``. 77Die Standardkonfiguration nutzt SQLite fÌr die Datenbank. Wenn du diese Einstellung Àndern willst, Àndere bitte ``app/config/parameters.yml``.
78 78
79Wir haben bereits einen Nutzer erstellt: Login und Passwort sind ``wallabag``. 79Wir haben bereits einen Nutzer erstellt: Login und Passwort sind ``wallabag``.
diff --git a/docs/en/user/installation.rst b/docs/en/user/installation.rst
index bd3095e0..95df263a 100644
--- a/docs/en/user/installation.rst
+++ b/docs/en/user/installation.rst
@@ -53,7 +53,7 @@ To install wallabag itself, you must run the following commands:
53 53
54 git clone https://github.com/wallabag/wallabag.git 54 git clone https://github.com/wallabag/wallabag.git
55 cd wallabag 55 cd wallabag
56 git checkout 2.0.5 56 git checkout 2.0.7
57 SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist 57 SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
58 php bin/console wallabag:install --env=prod 58 php bin/console wallabag:install --env=prod
59 59
diff --git a/docs/fr/user/installation.rst b/docs/fr/user/installation.rst
index 0693fc5d..d46f79a4 100644
--- a/docs/fr/user/installation.rst
+++ b/docs/fr/user/installation.rst
@@ -51,7 +51,7 @@ Pour installer wallabag, vous devez exécuter ces deux commandes :
51 51
52 git clone https://github.com/wallabag/wallabag.git 52 git clone https://github.com/wallabag/wallabag.git
53 cd wallabag 53 cd wallabag
54 git checkout 2.0.5 54 git checkout 2.0.7
55 SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist 55 SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
56 php bin/console wallabag:install --env=prod 56 php bin/console wallabag:install --env=prod
57 57
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index 4eb314f7..ccdf9406 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -357,7 +357,7 @@ class EntryController extends Controller
357 } 357 }
358 358
359 /** 359 /**
360 * Changes favorite status for an entry. 360 * Changes starred status for an entry.
361 * 361 *
362 * @param Request $request 362 * @param Request $request
363 * @param Entry $entry 363 * @param Entry $entry
diff --git a/src/Wallabag/CoreBundle/Controller/FooterController.php b/src/Wallabag/CoreBundle/Controller/FooterController.php
new file mode 100644
index 00000000..fd93c436
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Controller/FooterController.php
@@ -0,0 +1,27 @@
1<?php
2
3namespace Wallabag\CoreBundle\Controller;
4
5use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6
7class FooterController extends Controller
8{
9 /**
10 * Display the footer.
11 *
12 * @return \Symfony\Component\HttpFoundation\Response
13 */
14 public function indexAction()
15 {
16 $addonsUrl = $this->container->getParameter('addons_url');
17 $socialsUrl = $this->container->getParameter('socials_url');
18
19 return $this->render(
20 'WallabagCoreBundle::footer.html.twig',
21 [
22 'addonsUrl' => $addonsUrl,
23 'socialsUrl' => $socialsUrl,
24 ]
25 );
26 }
27}
diff --git a/src/Wallabag/CoreBundle/Controller/StaticController.php b/src/Wallabag/CoreBundle/Controller/StaticController.php
index b41302f8..2a57f06f 100644
--- a/src/Wallabag/CoreBundle/Controller/StaticController.php
+++ b/src/Wallabag/CoreBundle/Controller/StaticController.php
@@ -12,9 +12,11 @@ class StaticController extends Controller
12 */ 12 */
13 public function howtoAction() 13 public function howtoAction()
14 { 14 {
15 $addonsUrl = $this->container->getParameter('addons_url');
16
15 return $this->render( 17 return $this->render(
16 'WallabagCoreBundle:Static:howto.html.twig', 18 'WallabagCoreBundle:Static:howto.html.twig',
17 [] 19 ['addonsUrl' => $addonsUrl]
18 ); 20 );
19 } 21 }
20 22
diff --git a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
index 84599f0d..7d08b73b 100644
--- a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
+++ b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
@@ -25,6 +25,7 @@ class WallabagCoreExtension extends Extension
25 25
26 $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); 26 $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
27 $loader->load('services.yml'); 27 $loader->load('services.yml');
28 $loader->load('parameters.yml');
28 } 29 }
29 30
30 public function getAlias() 31 public function getAlias()
diff --git a/src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php b/src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php
index b712ad15..cb4bee83 100644
--- a/src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php
+++ b/src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php
@@ -16,7 +16,7 @@ class StringToListTransformer implements DataTransformerInterface
16 private $separator; 16 private $separator;
17 17
18 /** 18 /**
19 * @param string $separator The separator used in the list. 19 * @param string $separator The separator used in the list
20 */ 20 */
21 public function __construct($separator = ',') 21 public function __construct($separator = ',')
22 { 22 {
diff --git a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php
index 74c53bf0..7d25cc80 100644
--- a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php
@@ -21,7 +21,9 @@ class ConfigType extends AbstractType
21 { 21 {
22 $this->themes = array_combine( 22 $this->themes = array_combine(
23 $themes, 23 $themes,
24 array_map(function ($s) { return ucwords(strtolower(str_replace('-', ' ', $s))); }, $themes) 24 array_map(function ($s) {
25 return ucwords(strtolower(str_replace('-', ' ', $s)));
26 }, $themes)
25 ); 27 );
26 28
27 $this->languages = $languages; 29 $this->languages = $languages;
diff --git a/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php b/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php
index 14ef4a64..239d09ae 100644
--- a/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php
+++ b/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php
@@ -25,7 +25,7 @@ class RuleBasedTagger
25 /** 25 /**
26 * Add tags from rules defined by the user. 26 * Add tags from rules defined by the user.
27 * 27 *
28 * @param Entry $entry Entry to tag. 28 * @param Entry $entry Entry to tag
29 */ 29 */
30 public function tag(Entry $entry) 30 public function tag(Entry $entry)
31 { 31 {
@@ -49,7 +49,7 @@ class RuleBasedTagger
49 * 49 *
50 * @param User $user 50 * @param User $user
51 * 51 *
52 * @return array<Entry> A list of modified entries. 52 * @return array<Entry> A list of modified entries
53 */ 53 */
54 public function tagAllForUser(User $user) 54 public function tagAllForUser(User $user)
55 { 55 {
@@ -75,7 +75,7 @@ class RuleBasedTagger
75 /** 75 /**
76 * Fetch a tag. 76 * Fetch a tag.
77 * 77 *
78 * @param string $label The tag's label. 78 * @param string $label The tag's label
79 * 79 *
80 * @return Tag 80 * @return Tag
81 */ 81 */
diff --git a/src/Wallabag/CoreBundle/Resources/config/parameters.yml b/src/Wallabag/CoreBundle/Resources/config/parameters.yml
new file mode 100644
index 00000000..abd9ab68
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Resources/config/parameters.yml
@@ -0,0 +1,12 @@
1parameters:
2 addons_url:
3 firefox: https://addons.mozilla.org/firefox/addon/wallabag-v2/
4 chrome: https://chrome.google.com/webstore/detail/wallabagit/peehlcgckcnclnjlndmoddifcicdnabm
5 f_droid: https://f-droid.org/app/fr.gaulupeau.apps.InThePoche
6 google_play: https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche
7 ios: https://itunes.apple.com/app/wallabag/id828331015?mt=8
8 windows: https://www.microsoft.com/store/apps/wallabag/9nblggh11646
9 socials_url:
10 twitter: https://twitter.com/wallabagapp
11 google_plus: https://plus.google.com/+WallabagOrg/posts
12 facebook: https://facebook.com/Wallabag
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
index 798d8cba..c24475d2 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
@@ -145,6 +145,8 @@ entry:
145 reading_time_minutes: 'estimeret lÊsetid: %readingTime% min' 145 reading_time_minutes: 'estimeret lÊsetid: %readingTime% min'
146 reading_time_less_one_minute: 'estimeret lÊsetid: <small class="inferieur">&lt;</small> 1 min' 146 reading_time_less_one_minute: 'estimeret lÊsetid: <small class="inferieur">&lt;</small> 1 min'
147 # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags' 147 # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags'
148 reading_time_minutes_short: '%readingTime% min'
149 reading_time_less_one_minute_short: '<small class="inferieur">&lt;</small> 1 min'
148 original_article: 'original' 150 original_article: 'original'
149 toogle_as_read: 'Marker som lÊst' 151 toogle_as_read: 'Marker som lÊst'
150 toogle_as_star: 'Skift favoritstatus' 152 toogle_as_star: 'Skift favoritstatus'
@@ -177,7 +179,7 @@ entry:
177 back_to_homepage: 'Tilbage' 179 back_to_homepage: 'Tilbage'
178 set_as_read: 'Marker som lÊst' 180 set_as_read: 'Marker som lÊst'
179 # set_as_unread: 'Mark as unread' 181 # set_as_unread: 'Mark as unread'
180 set_as_favorite: 'Marker som favorit' 182 set_as_starred: 'Marker som favorit'
181 view_original_article: 'Originalartikel' 183 view_original_article: 'Originalartikel'
182 # re_fetch_content: 'Re-fetch content' 184 # re_fetch_content: 'Re-fetch content'
183 delete: 'Slet' 185 delete: 'Slet'
@@ -192,6 +194,7 @@ entry:
192 edit_title: 'Rediger titel' 194 edit_title: 'Rediger titel'
193 original_article: 'original' 195 original_article: 'original'
194 # annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations' 196 # annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations'
197 created_at: 'Oprettelsesdato'
195 new: 198 new:
196 page_title: 'Gem ny artikel' 199 page_title: 'Gem ny artikel'
197 placeholder: 'http://website.com' 200 placeholder: 'http://website.com'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
index 0b8516ee..384ec09a 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
@@ -145,6 +145,8 @@ entry:
145 reading_time_minutes: 'geschÀtzte Lesezeit: %readingTime% min' 145 reading_time_minutes: 'geschÀtzte Lesezeit: %readingTime% min'
146 reading_time_less_one_minute: 'geschÀtzte Lesezeit: <small class="inferieur">&lt;</small> 1 min' 146 reading_time_less_one_minute: 'geschÀtzte Lesezeit: <small class="inferieur">&lt;</small> 1 min'
147 # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags' 147 # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags'
148 reading_time_minutes_short: '%readingTime% min'
149 reading_time_less_one_minute_short: '<small class="inferieur">&lt;</small> 1 min'
148 original_article: 'original' 150 original_article: 'original'
149 toogle_as_read: 'Gelesen-Status Àndern' 151 toogle_as_read: 'Gelesen-Status Àndern'
150 toogle_as_star: 'Favoriten-Status Àndern' 152 toogle_as_star: 'Favoriten-Status Àndern'
@@ -177,7 +179,7 @@ entry:
177 back_to_homepage: 'ZurÃŒck' 179 back_to_homepage: 'ZurÃŒck'
178 set_as_read: 'Als gelesen markieren' 180 set_as_read: 'Als gelesen markieren'
179 set_as_unread: 'Als ungelesen markieren' 181 set_as_unread: 'Als ungelesen markieren'
180 set_as_favorite: 'Favorisieren' 182 set_as_starred: 'Favorisieren'
181 view_original_article: 'Original-Artikel' 183 view_original_article: 'Original-Artikel'
182 re_fetch_content: 'Inhalt neu laden' 184 re_fetch_content: 'Inhalt neu laden'
183 delete: 'Löschen' 185 delete: 'Löschen'
@@ -192,6 +194,7 @@ entry:
192 edit_title: 'Titel Àndern' 194 edit_title: 'Titel Àndern'
193 original_article: 'original' 195 original_article: 'original'
194 annotations_on_the_entry: '{0} Keine Anmerkungen|{1} Eine Anmerkung|]1,Inf[ %nbAnnotations% Anmerkungen' 196 annotations_on_the_entry: '{0} Keine Anmerkungen|{1} Eine Anmerkung|]1,Inf[ %nbAnnotations% Anmerkungen'
197 created_at: 'Erstellungsdatum'
195 new: 198 new:
196 page_title: 'Neuen Artikel speichern' 199 page_title: 'Neuen Artikel speichern'
197 placeholder: 'https://website.de' 200 placeholder: 'https://website.de'
@@ -397,7 +400,7 @@ flashes:
397 entry: 400 entry:
398 notice: 401 notice:
399 entry_already_saved: 'Eintrag bereits am %date% gespeichert' 402 entry_already_saved: 'Eintrag bereits am %date% gespeichert'
400 entry_saved: 'Eintag gespeichert' 403 entry_saved: 'Eintrag gespeichert'
401 # entry_saved_failed: 'Failed to save entry' 404 # entry_saved_failed: 'Failed to save entry'
402 entry_updated: 'Eintrag aktualisiert' 405 entry_updated: 'Eintrag aktualisiert'
403 entry_reloaded: 'Eintrag neugeladen' 406 entry_reloaded: 'Eintrag neugeladen'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
index 2c087421..ea860564 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
@@ -145,9 +145,11 @@ entry:
145 reading_time_minutes: 'estimated reading time: %readingTime% min' 145 reading_time_minutes: 'estimated reading time: %readingTime% min'
146 reading_time_less_one_minute: 'estimated reading time: <small class="inferieur">&lt;</small> 1 min' 146 reading_time_less_one_minute: 'estimated reading time: <small class="inferieur">&lt;</small> 1 min'
147 number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags' 147 number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags'
148 reading_time_minutes_short: '%readingTime% min'
149 reading_time_less_one_minute_short: '<small class="inferieur">&lt;</small> 1 min'
148 original_article: 'original' 150 original_article: 'original'
149 toogle_as_read: 'Toggle mark as read' 151 toogle_as_read: 'Toggle mark as read'
150 toogle_as_star: 'Toggle favorite' 152 toogle_as_star: 'Toggle starred'
151 delete: 'Delete' 153 delete: 'Delete'
152 export_title: 'Export' 154 export_title: 'Export'
153 filters: 155 filters:
@@ -177,7 +179,7 @@ entry:
177 back_to_homepage: 'Back' 179 back_to_homepage: 'Back'
178 set_as_read: 'Mark as read' 180 set_as_read: 'Mark as read'
179 set_as_unread: 'Mark as unread' 181 set_as_unread: 'Mark as unread'
180 set_as_favorite: 'Favorite' 182 set_as_starred: 'Toggle starred'
181 view_original_article: 'Original article' 183 view_original_article: 'Original article'
182 re_fetch_content: 'Re-fetch content' 184 re_fetch_content: 'Re-fetch content'
183 delete: 'Delete' 185 delete: 'Delete'
@@ -192,6 +194,7 @@ entry:
192 edit_title: 'Edit title' 194 edit_title: 'Edit title'
193 original_article: 'original' 195 original_article: 'original'
194 annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations' 196 annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations'
197 created_at: 'Creation date'
195 new: 198 new:
196 page_title: 'Save new entry' 199 page_title: 'Save new entry'
197 placeholder: 'http://website.com' 200 placeholder: 'http://website.com'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
index 5a755e6c..f64e95d5 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
@@ -145,6 +145,8 @@ entry:
145 reading_time_minutes: 'tiempo estimado de lectura: %readingTime% min' 145 reading_time_minutes: 'tiempo estimado de lectura: %readingTime% min'
146 reading_time_less_one_minute: 'tiempo estimado de lectura: <small class="inferieur">&lt;</small> 1 min' 146 reading_time_less_one_minute: 'tiempo estimado de lectura: <small class="inferieur">&lt;</small> 1 min'
147 # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags' 147 # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags'
148 reading_time_minutes_short: '%readingTime% min'
149 reading_time_less_one_minute_short: '<small class="inferieur">&lt;</small> 1 min'
148 original_article: 'original' 150 original_article: 'original'
149 toogle_as_read: 'Marcar como leído/ no leído' 151 toogle_as_read: 'Marcar como leído/ no leído'
150 toogle_as_star: 'Marcar como favorito/ no favorito' 152 toogle_as_star: 'Marcar como favorito/ no favorito'
@@ -177,7 +179,7 @@ entry:
177 back_to_homepage: 'Regrese a la página principal' 179 back_to_homepage: 'Regrese a la página principal'
178 set_as_read: 'Marcar como leído' 180 set_as_read: 'Marcar como leído'
179 set_as_unread: 'Marcar como no leído' 181 set_as_unread: 'Marcar como no leído'
180 set_as_favorite: 'Marcar como favorito' 182 set_as_starred: 'Marcar como favorito'
181 view_original_article: 'Artículo original' 183 view_original_article: 'Artículo original'
182 re_fetch_content: 'Redescargar el contenido' 184 re_fetch_content: 'Redescargar el contenido'
183 delete: 'Suprimir' 185 delete: 'Suprimir'
@@ -192,6 +194,7 @@ entry:
192 edit_title: 'Modificar el título' 194 edit_title: 'Modificar el título'
193 original_article: 'original' 195 original_article: 'original'
194 annotations_on_the_entry: '{0} Sin anotaciones|{1} Una anotación|]1,Inf[ %nbAnnotations% anotaciones' 196 annotations_on_the_entry: '{0} Sin anotaciones|{1} Una anotación|]1,Inf[ %nbAnnotations% anotaciones'
197 created_at: 'Fecha de creación'
195 new: 198 new:
196 page_title: 'Guardar un nuevo artículo' 199 page_title: 'Guardar un nuevo artículo'
197 placeholder: 'http://website.com' 200 placeholder: 'http://website.com'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
index 5a8bc5c4..e3592a78 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
@@ -145,6 +145,8 @@ entry:
145 reading_time_minutes: 'زمان تخمینی ؚرای خواندن: %readingTime% min' 145 reading_time_minutes: 'زمان تخمینی ؚرای خواندن: %readingTime% min'
146 reading_time_less_one_minute: 'زمان تخمینی ؚرای خواندن: <small class="inferieur">&lt;</small> 1 min' 146 reading_time_less_one_minute: 'زمان تخمینی ؚرای خواندن: <small class="inferieur">&lt;</small> 1 min'
147 # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags' 147 # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags'
148 reading_time_minutes_short: '%readingTime% min'
149 reading_time_less_one_minute_short: '<small class="inferieur">&lt;</small> 1 min'
148 original_article: 'original' 150 original_article: 'original'
149 toogle_as_read: 'خوانده‌؎ده/خوانده‌ن؎ده' 151 toogle_as_read: 'خوانده‌؎ده/خوانده‌ن؎ده'
150 toogle_as_star: 'ؚرگزیده/ناؚرگزیده' 152 toogle_as_star: 'ؚرگزیده/ناؚرگزیده'
@@ -177,7 +179,7 @@ entry:
177 back_to_homepage: 'ؚازگ؎ت' 179 back_to_homepage: 'ؚازگ؎ت'
178 set_as_read: 'خوانده‌؎ده' 180 set_as_read: 'خوانده‌؎ده'
179 set_as_unread: 'ØšÙ‡ عنوان خوانده‌ن؎ده علامت ؚزن' 181 set_as_unread: 'ØšÙ‡ عنوان خوانده‌ن؎ده علامت ؚزن'
180 set_as_favorite: 'ؚرگزیده' 182 set_as_starred: 'ؚرگزیده'
181 view_original_article: 'مقالهٔ اصلی' 183 view_original_article: 'مقالهٔ اصلی'
182 re_fetch_content: 'مقاله‌ها را دوؚاره دریافت کن' 184 re_fetch_content: 'مقاله‌ها را دوؚاره دریافت کن'
183 delete: 'ٟاک کردن' 185 delete: 'ٟاک کردن'
@@ -192,6 +194,7 @@ entry:
192 edit_title: 'ویرای؎ عنوان' 194 edit_title: 'ویرای؎ عنوان'
193 original_article: 'اصلی' 195 original_article: 'اصلی'
194 annotations_on_the_entry: '{0} ؚدون حا؎یه|{1} یک حا؎یه|]1,Inf[ %nbحا؎یه% annotations' 196 annotations_on_the_entry: '{0} ؚدون حا؎یه|{1} یک حا؎یه|]1,Inf[ %nbحا؎یه% annotations'
197 created_at: 'زمان ساخت'
195 new: 198 new:
196 page_title: 'ذخیرهٔ مقالهٔ تازه' 199 page_title: 'ذخیرهٔ مقالهٔ تازه'
197 placeholder: 'http://website.com' 200 placeholder: 'http://website.com'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
index 542f61c2..9e47d600 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
@@ -145,6 +145,8 @@ entry:
145 reading_time_minutes: 'durée de lecture: %readingTime% min' 145 reading_time_minutes: 'durée de lecture: %readingTime% min'
146 reading_time_less_one_minute: 'durée de lecture: <small class="inferieur">&lt;</small> 1 min' 146 reading_time_less_one_minute: 'durée de lecture: <small class="inferieur">&lt;</small> 1 min'
147 number_of_tags: '{1}et un autre tag|]1,Inf[et %count% autres tags' 147 number_of_tags: '{1}et un autre tag|]1,Inf[et %count% autres tags'
148 reading_time_minutes_short: '%readingTime% min'
149 reading_time_less_one_minute_short: '<small class="inferieur">&lt;</small> 1 min'
148 original_article: 'original' 150 original_article: 'original'
149 toogle_as_read: 'Marquer comme lu/non lu' 151 toogle_as_read: 'Marquer comme lu/non lu'
150 toogle_as_star: 'Marquer comme favori' 152 toogle_as_star: 'Marquer comme favori'
@@ -177,7 +179,7 @@ entry:
177 back_to_homepage: 'Retour' 179 back_to_homepage: 'Retour'
178 set_as_read: 'Marquer comme lu' 180 set_as_read: 'Marquer comme lu'
179 set_as_unread: 'Marquer comme non lu' 181 set_as_unread: 'Marquer comme non lu'
180 set_as_favorite: 'Mettre en favori' 182 set_as_starred: 'Mettre en favori'
181 view_original_article: 'Article original' 183 view_original_article: 'Article original'
182 re_fetch_content: 'Recharger le contenu' 184 re_fetch_content: 'Recharger le contenu'
183 delete: 'Supprimer' 185 delete: 'Supprimer'
@@ -192,6 +194,7 @@ entry:
192 edit_title: 'Modifier le titre' 194 edit_title: 'Modifier le titre'
193 original_article: 'original' 195 original_article: 'original'
194 annotations_on_the_entry: '{0} Aucune annotation|{1} Une annotation|]1,Inf[ %nbAnnotations% annotations' 196 annotations_on_the_entry: '{0} Aucune annotation|{1} Une annotation|]1,Inf[ %nbAnnotations% annotations'
197 created_at: 'Date de création'
195 new: 198 new:
196 page_title: 'Sauvegarder un nouvel article' 199 page_title: 'Sauvegarder un nouvel article'
197 placeholder: 'http://website.com' 200 placeholder: 'http://website.com'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
index 0bcc94a5..3760c2d6 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
@@ -145,6 +145,8 @@ entry:
145 reading_time_minutes: 'tempo di lettura stimato: %readingTime% min' 145 reading_time_minutes: 'tempo di lettura stimato: %readingTime% min'
146 reading_time_less_one_minute: 'tempo di lettura stimato: <small class="inferieur">&lt;</small> 1 min' 146 reading_time_less_one_minute: 'tempo di lettura stimato: <small class="inferieur">&lt;</small> 1 min'
147 # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags' 147 # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags'
148 reading_time_minutes_short: '%readingTime% min'
149 reading_time_less_one_minute_short: '<small class="inferieur">&lt;</small> 1 min'
148 original_article: 'originale' 150 original_article: 'originale'
149 toogle_as_read: 'Segna come da leggere' 151 toogle_as_read: 'Segna come da leggere'
150 toogle_as_star: 'Segna come non preferito' 152 toogle_as_star: 'Segna come non preferito'
@@ -176,7 +178,7 @@ entry:
176 back_to_homepage: 'Indietro' 178 back_to_homepage: 'Indietro'
177 set_as_read: 'Segna come già letto' 179 set_as_read: 'Segna come già letto'
178 set_as_unread: 'Segna come da leggere' 180 set_as_unread: 'Segna come da leggere'
179 set_as_favorite: 'Segna come preferito' 181 set_as_starred: 'Segna come preferito'
180 view_original_article: 'Contenuto originale' 182 view_original_article: 'Contenuto originale'
181 re_fetch_content: 'Ri-ottieni pagina' 183 re_fetch_content: 'Ri-ottieni pagina'
182 delete: 'Elimina' 184 delete: 'Elimina'
@@ -191,6 +193,7 @@ entry:
191 edit_title: 'Modifica titolo' 193 edit_title: 'Modifica titolo'
192 original_article: 'originale' 194 original_article: 'originale'
193 annotations_on_the_entry: '{0} Nessuna annotazione|{1} Una annotazione|]1,Inf[ %nbAnnotations% annotazioni' 195 annotations_on_the_entry: '{0} Nessuna annotazione|{1} Una annotazione|]1,Inf[ %nbAnnotations% annotazioni'
196 created_at: 'Data di creazione'
194 new: 197 new:
195 page_title: 'Salva un nuovo contenuto' 198 page_title: 'Salva un nuovo contenuto'
196 placeholder: 'http://website.com' 199 placeholder: 'http://website.com'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
index bf6b4100..1e23168b 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
@@ -145,6 +145,8 @@ entry:
145 reading_time_minutes: 'durada de lectura : %readingTime% min' 145 reading_time_minutes: 'durada de lectura : %readingTime% min'
146 reading_time_less_one_minute: 'durada de lectura : <small class="inferieur">&lt;</small> 1 min' 146 reading_time_less_one_minute: 'durada de lectura : <small class="inferieur">&lt;</small> 1 min'
147 # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags' 147 # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags'
148 reading_time_minutes_short: '%readingTime% min'
149 reading_time_less_one_minute_short: '<small class="inferieur">&lt;</small> 1 min'
148 original_article: 'original' 150 original_article: 'original'
149 toogle_as_read: 'Marcar coma legit/pas legit' 151 toogle_as_read: 'Marcar coma legit/pas legit'
150 toogle_as_star: 'Marcar coma favorit' 152 toogle_as_star: 'Marcar coma favorit'
@@ -177,7 +179,7 @@ entry:
177 back_to_homepage: 'Tornar' 179 back_to_homepage: 'Tornar'
178 set_as_read: 'Marcar coma legit' 180 set_as_read: 'Marcar coma legit'
179 set_as_unread: 'Marcar coma pas legit' 181 set_as_unread: 'Marcar coma pas legit'
180 set_as_favorite: 'Metre en favori' 182 set_as_starred: 'Metre en favori'
181 view_original_article: 'Article original' 183 view_original_article: 'Article original'
182 re_fetch_content: 'Tornar cargar lo contengut' 184 re_fetch_content: 'Tornar cargar lo contengut'
183 delete: 'Suprimir' 185 delete: 'Suprimir'
@@ -192,6 +194,7 @@ entry:
192 edit_title: 'Modificar lo títol' 194 edit_title: 'Modificar lo títol'
193 original_article: 'original' 195 original_article: 'original'
194 annotations_on_the_entry: "{0} Pas cap d'anotacion|{1} Una anotacion|]1,Inf[ %nbAnnotations% anotacions" 196 annotations_on_the_entry: "{0} Pas cap d'anotacion|{1} Una anotacion|]1,Inf[ %nbAnnotations% anotacions"
197 created_at: 'Data de creacion'
195 new: 198 new:
196 page_title: 'Enregistrar un novÚl article' 199 page_title: 'Enregistrar un novÚl article'
197 placeholder: 'http://website.com' 200 placeholder: 'http://website.com'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
index 09428c89..0a325c57 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
@@ -145,6 +145,8 @@ entry:
145 reading_time_minutes: 'szacunkowy czas czytania: %readingTime% min' 145 reading_time_minutes: 'szacunkowy czas czytania: %readingTime% min'
146 reading_time_less_one_minute: 'szacunkowy czas czytania: <small class="inferieur">&lt;</small> 1 min' 146 reading_time_less_one_minute: 'szacunkowy czas czytania: <small class="inferieur">&lt;</small> 1 min'
147 # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags' 147 # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags'
148 reading_time_minutes_short: '%readingTime% min'
149 reading_time_less_one_minute_short: '<small class="inferieur">&lt;</small> 1 min'
148 original_article: 'oryginał' 150 original_article: 'oryginał'
149 toogle_as_read: 'Oznacz jako przeczytane' 151 toogle_as_read: 'Oznacz jako przeczytane'
150 toogle_as_star: 'Oznacz jako ulubione' 152 toogle_as_star: 'Oznacz jako ulubione'
@@ -177,7 +179,7 @@ entry:
177 back_to_homepage: 'Cofnij' 179 back_to_homepage: 'Cofnij'
178 set_as_read: 'Oznacz jako przeczytane' 180 set_as_read: 'Oznacz jako przeczytane'
179 set_as_unread: 'Oznacz jako nieprzeczytane' 181 set_as_unread: 'Oznacz jako nieprzeczytane'
180 set_as_favorite: 'Ulubione' 182 set_as_starred: 'Ulubione'
181 view_original_article: 'Oryginalny artykuł' 183 view_original_article: 'Oryginalny artykuł'
182 re_fetch_content: 'Pobierz ponownie treść' 184 re_fetch_content: 'Pobierz ponownie treść'
183 delete: 'Usuń' 185 delete: 'Usuń'
@@ -192,6 +194,7 @@ entry:
192 edit_title: 'Edytuj tytuł' 194 edit_title: 'Edytuj tytuł'
193 original_article: 'oryginalny' 195 original_article: 'oryginalny'
194 annotations_on_the_entry: '{0} Nie ma adnotacji |{1} Jedna adnotacja |]1,Inf[ %nbAnnotations% adnotacji' 196 annotations_on_the_entry: '{0} Nie ma adnotacji |{1} Jedna adnotacja |]1,Inf[ %nbAnnotations% adnotacji'
197 created_at: 'Czas stworzenia'
195 new: 198 new:
196 page_title: 'Zapisz nowy wpis' 199 page_title: 'Zapisz nowy wpis'
197 placeholder: 'http://website.com' 200 placeholder: 'http://website.com'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
index bc16eddc..42ad28ee 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
@@ -145,6 +145,8 @@ entry:
145 reading_time_minutes: 'timp estimat de citire: %readingTime% min' 145 reading_time_minutes: 'timp estimat de citire: %readingTime% min'
146 reading_time_less_one_minute: 'timp estimat de citire: <small class="inferieur">&lt;</small> 1 min' 146 reading_time_less_one_minute: 'timp estimat de citire: <small class="inferieur">&lt;</small> 1 min'
147 # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags' 147 # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags'
148 reading_time_minutes_short: '%readingTime% min'
149 reading_time_less_one_minute_short: '<small class="inferieur">&lt;</small> 1 min'
148 original_article: 'original' 150 original_article: 'original'
149 toogle_as_read: 'Comută marcat ca citit' 151 toogle_as_read: 'Comută marcat ca citit'
150 toogle_as_star: 'Comută marcat ca favorit' 152 toogle_as_star: 'Comută marcat ca favorit'
@@ -177,7 +179,7 @@ entry:
177 back_to_homepage: 'Înapoi' 179 back_to_homepage: 'Înapoi'
178 set_as_read: 'Marchează ca citit' 180 set_as_read: 'Marchează ca citit'
179 # set_as_unread: 'Mark as unread' 181 # set_as_unread: 'Mark as unread'
180 set_as_favorite: 'Favorit' 182 set_as_starred: 'Favorit'
181 view_original_article: 'Articol original' 183 view_original_article: 'Articol original'
182 # re_fetch_content: 'Re-fetch content' 184 # re_fetch_content: 'Re-fetch content'
183 delete: 'Șterge' 185 delete: 'Șterge'
@@ -192,6 +194,7 @@ entry:
192 edit_title: 'Editează titlul' 194 edit_title: 'Editează titlul'
193 original_article: 'original' 195 original_article: 'original'
194 # annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations' 196 # annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations'
197 created_at: 'Data creării'
195 new: 198 new:
196 page_title: 'Salvează un nou articol' 199 page_title: 'Salvează un nou articol'
197 placeholder: 'http://website.com' 200 placeholder: 'http://website.com'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
index 240bc53a..a60dfc86 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
@@ -145,6 +145,8 @@ entry:
145 reading_time_minutes: 'tahmini okuma sÃŒresi: %readingTime% min' 145 reading_time_minutes: 'tahmini okuma sÃŒresi: %readingTime% min'
146 reading_time_less_one_minute: 'tahmini okuma sÃŒresi: <small class="inferieur">&lt;</small> 1 min' 146 reading_time_less_one_minute: 'tahmini okuma sÃŒresi: <small class="inferieur">&lt;</small> 1 min'
147 # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags' 147 # number_of_tags: '{1}and one other tag|]1,Inf[and %count% other tags'
148 reading_time_minutes_short: '%readingTime% min'
149 reading_time_less_one_minute_short: '<small class="inferieur">&lt;</small> 1 min'
148 original_article: 'orijinal' 150 original_article: 'orijinal'
149 toogle_as_read: 'Okundu/okunmadı olarak işaretle' 151 toogle_as_read: 'Okundu/okunmadı olarak işaretle'
150 toogle_as_star: 'Favorilere ekle/çıkar' 152 toogle_as_star: 'Favorilere ekle/çıkar'
@@ -177,7 +179,7 @@ entry:
177 back_to_homepage: 'Back' 179 back_to_homepage: 'Back'
178 set_as_read: 'Okundu olarak işaretle' 180 set_as_read: 'Okundu olarak işaretle'
179 set_as_unread: 'Okunmadı olarak işaretle' 181 set_as_unread: 'Okunmadı olarak işaretle'
180 set_as_favorite: 'Favorilere ekle/çıkar' 182 set_as_starred: 'Favorilere ekle/çıkar'
181 view_original_article: 'Orijinal makale' 183 view_original_article: 'Orijinal makale'
182 re_fetch_content: 'İçeriği yenile' 184 re_fetch_content: 'İçeriği yenile'
183 delete: 'Sil' 185 delete: 'Sil'
@@ -192,6 +194,7 @@ entry:
192 edit_title: 'Başlığı dÃŒzenle' 194 edit_title: 'Başlığı dÃŒzenle'
193 original_article: 'orijinal' 195 original_article: 'orijinal'
194 # annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations' 196 # annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations'
197 created_at: 'Oluşturulma tarihi'
195 new: 198 new:
196 page_title: 'Yeni makaleyi kaydet' 199 page_title: 'Yeni makaleyi kaydet'
197 placeholder: 'http://website.com' 200 placeholder: 'http://website.com'
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig
index 40f0ae16..f89265d4 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig
@@ -134,7 +134,8 @@
134 </fieldset> 134 </fieldset>
135 {% endif %} 135 {% endif %}
136 136
137 {{ form_rest(form.user) }} 137 {{ form_widget(form.user._token) }}
138 {{ form_widget(form.user.save) }}
138 </form> 139 </form>
139 140
140 <h2>{{ 'config.tab_menu.password'|trans }}</h2> 141 <h2>{{ 'config.tab_menu.password'|trans }}</h2>
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig
index 8c06cf11..ce47a677 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig
@@ -9,26 +9,39 @@
9 </header> 9 </header>
10 10
11 <div id="article_toolbar"> 11 <div id="article_toolbar">
12 <ul class="links"> 12 <ul class="links">
13 <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> 13 <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>
14 <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> 14 <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>
15 <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> 15 <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>
16 <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> 16 <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>
17 <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> 17 <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>
18 <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> 18 <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>
19 <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> 19 <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>
20 {% 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 %} 20 {% 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 %}
21 {% 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 %} 21 {% 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 %}
22 {% 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 %} 22 {% 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 %}
23 {% 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 %} 23 {% 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 %}
24 {% 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 %} 24 {% 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 %}
25 {% 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 %} 25 {% 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 %}
26 {% if craue_setting('export_epub') %}<li><a href="?epub&amp;method=id&amp;value={{ entry.id }}" title="Generate ePub file">EPUB</a></li>{% endif %} 26 {% if craue_setting('export_epub') %}<li><a href="?epub&amp;method=id&amp;value={{ entry.id }}" title="Generate ePub file">EPUB</a></li>{% endif %}
27 {% if craue_setting('export_mobi') %}<li><a href="?mobi&amp;method=id&amp;value={{ entry.id }}" title="Generate Mobi file">MOBI</a></li>{% endif %} 27 {% if craue_setting('export_mobi') %}<li><a href="?mobi&amp;method=id&amp;value={{ entry.id }}" title="Generate Mobi file">MOBI</a></li>{% endif %}
28 {% if craue_setting('export_pdf') %}<li><a href="?pdf&amp;method=id&amp;value={{ entry.id }}" title="Generate PDF file">PDF</a></li>{% endif %} 28 {% if craue_setting('export_pdf') %}<li><a href="?pdf&amp;method=id&amp;value={{ entry.id }}" title="Generate PDF file">PDF</a></li>{% endif %}
29 <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> 29 <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>
30 </ul> 30 </ul>
31 </div> 31 </div>
32 <div class="link mdi-action-today">
33 {{ 'entry.view.created_at'|trans }}: {{ entry.createdAt|date('Y-m-d') }}
34 </div>
35
36 <div class="link mdi-action-query-builder">
37 {% set readingTime = entry.readingTime / app.user.config.readingSpeed %}
38 {% if readingTime > 0 %}
39 {{ 'entry.list.reading_time_minutes'|trans({'%readingTime%': readingTime|round})|capitalize }}
40 {% else %}
41 {{ 'entry.list.reading_time_less_one_minute'|trans|raw }}
42 {% endif %}
43 </div>
44
32 {% set nbAnnotations = entry.annotations | length %} 45 {% set nbAnnotations = entry.annotations | length %}
33 <span class="tool link"><i class="material-icons link">comment</i> {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}</span> 46 <span class="tool link"><i class="material-icons link">comment</i> {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}</span>
34 <aside class="tags"> 47 <aside class="tags">
@@ -46,6 +59,7 @@
46 {{ entry.content | raw }} 59 {{ entry.content | raw }}
47 </article> 60 </article>
48 </div> 61 </div>
62
49 <script id="annotationroutes" type="application/json"> 63 <script id="annotationroutes" type="application/json">
50 { 64 {
51 "prefix": "", 65 "prefix": "",
@@ -58,4 +72,22 @@
58 "entryId": "{{ entry.id }}" 72 "entryId": "{{ entry.id }}"
59 } 73 }
60 </script> 74 </script>
75 <script src="{{ asset('bundles/wallabagcore/themes/_global/js/restoreScroll.js')}}"></script>
76 <script type="text/javascript">
77 $(document).ready(function() {
78 $(window).scroll(function(e){
79 var scrollTop = $(window).scrollTop();
80 var docHeight = $(document).height();
81 var scrollPercent = (scrollTop) / (docHeight);
82 var scrollPercentRounded = Math.round(scrollPercent*100)/100;
83 savePercent({{ entry.id }}, scrollPercentRounded);
84 });
85
86 retrievePercent({{ entry.id }});
87
88 $(window).resize(function(){
89 retrievePercent({{ entry.id }});
90 });
91 });
92 </script>
61{% endblock %} 93{% endblock %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Static/howto.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Static/howto.html.twig
index eab092c7..b529a0ac 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Static/howto.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Static/howto.html.twig
@@ -11,14 +11,14 @@
11 </ul> 11 </ul>
12 <h3>{{ 'howto.top_menu.browser_addons'|trans }}</h3> 12 <h3>{{ 'howto.top_menu.browser_addons'|trans }}</h3>
13 <ul> 13 <ul>
14 <li><a href="https://addons.mozilla.org/firefox/addon/wallabag-v2/" target="_blank">{{ 'howto.browser_addons.firefox'|trans }}</a></li> 14 <li><a href="{{ addonsUrl.firefox }}" target="_blank">{{ 'howto.browser_addons.firefox'|trans }}</a></li>
15 <li><a href="https://chrome.google.com/webstore/detail/wallabag/bepdcjnnkglfjehplaogpoonpffbdcdj" target="_blank">{{ 'howto.browser_addons.chrome'|trans }}</a></li> 15 <li><a href="{{ addonsUrl.chrome }}" target="_blank">{{ 'howto.browser_addons.chrome'|trans }}</a></li>
16 </ul> 16 </ul>
17 <h3>{{ 'howto.top_menu.mobile_apps'|trans }}</h3> 17 <h3>{{ 'howto.top_menu.mobile_apps'|trans }}</h3>
18 <ul> 18 <ul>
19 <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> 19 <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>
20 <li>iOS: <a href="https://itunes.apple.com/app/wallabag/id828331015?mt=8" target="_blank">{{ 'howto.mobile_apps.ios'|trans }}</a></li> 20 <li>iOS: <a href="{{ addonsUrl.ios }}" target="_blank">{{ 'howto.mobile_apps.ios'|trans }}</a></li>
21 <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> 21 <li>Windows Phone: <a href="{{ addonsUrl.windows }}" target="_blank">{{ 'howto.mobile_apps.windows'|trans }}</a></li>
22 </ul> 22 </ul>
23 <h3>{{ 'howto.top_menu.bookmarklet'|trans }}</h3> 23 <h3>{{ 'howto.top_menu.bookmarklet'|trans }}</h3>
24 <p> 24 <p>
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig
index 9fb92d3d..11b02294 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig
@@ -158,7 +158,7 @@
158 {% endif %} 158 {% endif %}
159 159
160 {{ form_widget(form.user.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} 160 {{ form_widget(form.user.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
161 {{ form_rest(form.user) }} 161 {{ form_widget(form.user._token) }}
162 </form> 162 </form>
163 </div> 163 </div>
164 164
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
index e9a2b183..eca8924e 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
@@ -93,7 +93,7 @@
93 <ul class="tools right"> 93 <ul class="tools right">
94 <li> 94 <li>
95 <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> 95 <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>
96 <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> 96 <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>
97 <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> 97 <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>
98 </li> 98 </li>
99 </ul> 99 </ul>
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig
index 2a5cdfac..5dd2afb3 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig
@@ -24,8 +24,8 @@
24 </a> 24 </a>
25 </li> 25 </li>
26 <li> 26 <li>
27 <a class="waves-effect" title="{{ 'entry.view.left_menu.set_as_favorite'|trans }}" href="{{ path('star_entry', { 'id': entry.id }) }}" id="setFav"> 27 <a class="waves-effect" title="{{ 'entry.view.left_menu.set_as_starred'|trans }}" href="{{ path('star_entry', { 'id': entry.id }) }}" id="setFav">
28 <i class="material-icons small">{% if entry.isStarred == 0 %}favorite_outline{% else %}favorite{% endif %}</i> 28 <i class="material-icons small">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i>
29 </a> 29 </a>
30 </li> 30 </li>
31 <li> 31 <li>
@@ -70,9 +70,9 @@
70 </li> 70 </li>
71 71
72 <li class="bold hide-on-med-and-down"> 72 <li class="bold hide-on-med-and-down">
73 <a class="waves-effect collapsible-header" title="{{ 'entry.view.left_menu.set_as_favorite'|trans }}" href="{{ path('star_entry', { 'id': entry.id }) }}" id="setFav"> 73 <a class="waves-effect collapsible-header" title="{{ 'entry.view.left_menu.set_as_starred'|trans }}" href="{{ path('star_entry', { 'id': entry.id }) }}" id="setFav">
74 <i class="material-icons spall">{% if entry.isStarred == 0 %}favorite_outline{% else %}favorite{% endif %}</i> 74 <i class="material-icons spall">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i>
75 <span>{{ 'entry.view.left_menu.set_as_favorite'|trans }}</span> 75 <span>{{ 'entry.view.left_menu.set_as_starred'|trans }}</span>
76 </a> 76 </a>
77 <div class="collapsible-body"></div> 77 <div class="collapsible-body"></div>
78 </li> 78 </li>
@@ -194,6 +194,15 @@
194 <h1>{{ entry.title|raw }} <a href="{{ path('edit', { 'id': entry.id }) }}" title="{{ 'entry.view.edit_title'|trans }}">✎</a></h1> 194 <h1>{{ entry.title|raw }} <a href="{{ path('edit', { 'id': entry.id }) }}" title="{{ 'entry.view.edit_title'|trans }}">✎</a></h1>
195 </header> 195 </header>
196 <aside> 196 <aside>
197 {% set readingTime = entry.readingTime / app.user.config.readingSpeed %}
198 <span class="link mdi-action-query-builder">
199 {% if readingTime > 0 %}
200 {{ 'entry.list.reading_time_minutes_short'|trans({'%readingTime%': readingTime|round}) }}
201 {% else %}
202 {{ 'entry.list.reading_time_less_one_minute_short'|trans|raw }}
203 {% endif %}
204 </span>
205 <span class="link mdi-action-today" title="{{ 'entry.view.created_at'|trans }}"> {{ entry.createdAt|date('Y-m-d') }}</span>
197 <a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|e }}" class="tool"> 206 <a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|e }}" class="tool">
198 <span class="link"><i class="material-icons link">link</i> {{ entry.domainName|removeWww }}</span></a> 207 <span class="link"><i class="material-icons link">link</i> {{ entry.domainName|removeWww }}</span></a>
199 <span class="tool link"><i class="material-icons link">comment</i> {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}</span> 208 <span class="tool link"><i class="material-icons link">comment</i> {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}</span>
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Static/howto.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Static/howto.html.twig
index 4354a6b7..6a177d6b 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Static/howto.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Static/howto.html.twig
@@ -18,17 +18,17 @@
18 <div class="col s12"> 18 <div class="col s12">
19 <h5>{{ 'howto.top_menu.browser_addons'|trans }}</h5> 19 <h5>{{ 'howto.top_menu.browser_addons'|trans }}</h5>
20 <ul> 20 <ul>
21 <li><a href="https://addons.mozilla.org/firefox/addon/wallabag-v2/" target="_blank">{{ 'howto.browser_addons.firefox'|trans }}</a></li> 21 <li><a href="{{ addonsUrl.firefox }}" target="_blank">{{ 'howto.browser_addons.firefox'|trans }}</a></li>
22 <li><a href="https://chrome.google.com/webstore/detail/wallabag/bepdcjnnkglfjehplaogpoonpffbdcdj" target="_blank">{{ 'howto.browser_addons.chrome'|trans }}</a></li> 22 <li><a href="{{ addonsUrl.chrome }}" target="_blank">{{ 'howto.browser_addons.chrome'|trans }}</a></li>
23 </ul> 23 </ul>
24 </div> 24 </div>
25 25
26 <div class="col s12"> 26 <div class="col s12">
27 <h5>{{ 'howto.top_menu.mobile_apps'|trans }}</h5> 27 <h5>{{ 'howto.top_menu.mobile_apps'|trans }}</h5>
28 <ul> 28 <ul>
29 <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> 29 <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>
30 <li>iOS: <a href="https://itunes.apple.com/app/wallabag/id828331015?mt=8" target="_blank">{{ 'howto.mobile_apps.ios'|trans }}</a></li> 30 <li>iOS: <a href="{{ addonsUrl.ios }}" target="_blank">{{ 'howto.mobile_apps.ios'|trans }}</a></li>
31 <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> 31 <li>Windows Phone: <a href="{{ addonsUrl.windows }}" target="_blank">{{ 'howto.mobile_apps.windows'|trans }}</a></li>
32 </ul> 32 </ul>
33 </div> 33 </div>
34 34
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
index 00000000..7cb19966
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/footer.html.twig
@@ -0,0 +1,41 @@
1<footer class="page-footer cyan darken-2">
2 <div class="container">
3 <div class="row">
4 <div class="col l6 s12">
5 <h5 class="white-text">{{ 'footer.wallabag.elsewhere'|trans }}</h5>
6 <p class="grey-text text-lighten-4">
7 <a target="_blank" class="grey-text text-lighten-3" href="{{ addonsUrl.google_play }}" title="Android">
8 <span class="icon-android"></span>
9 </a>
10 <a target="_blank" class="grey-text text-lighten-3" href="{{ addonsUrl.ios }}" title="iOS">
11 <span class="icon-apple"></span>
12 </a>
13 <a target="_blank" class="grey-text text-lighten-3" href="{{ addonsUrl.firefox }}" title="Firefox">
14 <span class="icon-firefox"></span>
15 </a>
16 <a target="_blank" class="grey-text text-lighten-3" href="{{ addonsUrl.chrome }}" title="Chrome">
17 <span class="icon-chrome"></span>
18 </a>
19 </p>
20 </div>
21 <div class="col l4 offset-l2 s12">
22 <h5 class="white-text">{{ 'footer.wallabag.social'|trans }}</h5>
23 <a target="_blank" class="grey-text text-lighten-3" href="{{ socialsUrl.twitter }}" title="Twitter">
24 <span class="icon-twitter"></span>
25 </a>
26 <a target="_blank" class="grey-text text-lighten-3" href="{{ socialsUrl.google_plus }}" title="Google+">
27 <span class="icon-google-plus2"></span>
28 </a>
29 <a target="_blank" class="grey-text text-lighten-3" href="{{ socialsUrl.facebook }}" title="Facebook">
30 <span class="icon-facebook2"></span>
31 </a>
32 </div>
33 </div>
34 </div>
35 <div class="footer-copyright">
36 <div class="container">
37 <p>{{ 'footer.wallabag.powered_by'|trans }} <a target="_blank" href="https://wallabag.org" class="grey-text text-lighten-4">wallabag</a></p>
38 <a class="grey-text text-lighten-4 right" href="{{ path('about') }}">{{ 'footer.wallabag.about'|trans }}</a>
39 </div>
40 </div>
41</footer>
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig
index 56382096..50134357 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig
@@ -26,7 +26,7 @@
26 <ul id="slide-out" class="side-nav fixed"> 26 <ul id="slide-out" class="side-nav fixed">
27 {% block logo %} 27 {% block logo %}
28 <li class="logo border-bottom"> 28 <li class="logo border-bottom">
29 <a title="{% trans %}Back to unread articles{% endtrans %}" href="{{ path('unread') }}"> 29 <a title="{{ 'menu.left.back_to_unread'|trans }}" href="{{ path('unread') }}">
30 <img src="{{ asset('bundles/wallabagcore/themes/_global/img/logo-square.png') }}" alt="wallabag logo" /> 30 <img src="{{ asset('bundles/wallabagcore/themes/_global/img/logo-square.png') }}" alt="wallabag logo" />
31 </a> 31 </a>
32 </li> 32 </li>
@@ -117,45 +117,5 @@
117{% endblock %} 117{% endblock %}
118 118
119{% block footer %} 119{% block footer %}
120 <footer class="page-footer cyan darken-2"> 120 {{ render(controller("WallabagCoreBundle:Footer:index")) }}
121 <div class="container">
122 <div class="row">
123 <div class="col l6 s12">
124 <h5 class="white-text">{{ 'footer.wallabag.elsewhere'|trans }}</h5>
125 <p class="grey-text text-lighten-4">
126 <a target="_blank" class="grey-text text-lighten-3" href="https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche" title="Android">
127 <span class="icon-android"></span>
128 </a>
129 <a target="_blank" class="grey-text text-lighten-3" href="https://itunes.apple.com/app/id828331015" title="iOS">
130 <span class="icon-apple"></span>
131 </a>
132 <a target="_blank" class="grey-text text-lighten-3" href="https://addons.mozilla.org/firefox/addon/wallabag-v2/" title="Firefox">
133 <span class="icon-firefox"></span>
134 </a>
135 <a target="_blank" class="grey-text text-lighten-3" href="https://chrome.google.com/webstore/detail/wallabagger/gbmgphmejlcoihgedabhgjdkcahacjlj" title="Chrome">
136 <span class="icon-chrome"></span>
137 </a>
138 </p>
139 </div>
140 <div class="col l4 offset-l2 s12">
141 <h5 class="white-text">{{ 'footer.wallabag.social'|trans }}</h5>
142 <a target="_blank" class="grey-text text-lighten-3" href="https://twitter.com/wallabagapp" title="Twitter">
143 <span class="icon-twitter"></span>
144 </a>
145 <a target="_blank" class="grey-text text-lighten-3" href="https://plus.google.com/+WallabagOrg/posts" title="Google+">
146 <span class="icon-google-plus2"></span>
147 </a>
148 <a target="_blank" class="grey-text text-lighten-3" href="https://facebook.com/Wallabag" title="Facebook">
149 <span class="icon-facebook2"></span>
150 </a>
151 </div>
152 </div>
153 </div>
154 <div class="footer-copyright">
155 <div class="container">
156 <p>{{ 'footer.wallabag.powered_by'|trans }} <a target="_blank" href="https://wallabag.org" class="grey-text text-lighten-4">wallabag</a></p>
157 <a class="grey-text text-lighten-4 right" href="{{ path('about') }}">{{ 'footer.wallabag.about'|trans }}</a>
158 </div>
159 </div>
160 </footer>
161{% endblock %} 121{% endblock %}
diff --git a/src/Wallabag/ImportBundle/Import/AbstractImport.php b/src/Wallabag/ImportBundle/Import/AbstractImport.php
new file mode 100644
index 00000000..14377a35
--- /dev/null
+++ b/src/Wallabag/ImportBundle/Import/AbstractImport.php
@@ -0,0 +1,47 @@
1<?php
2
3namespace Wallabag\ImportBundle\Import;
4
5use Psr\Log\LoggerInterface;
6use Psr\Log\NullLogger;
7use Doctrine\ORM\EntityManager;
8use Wallabag\CoreBundle\Helper\ContentProxy;
9use Wallabag\CoreBundle\Entity\Entry;
10
11abstract class AbstractImport implements ImportInterface
12{
13 protected $em;
14 protected $logger;
15 protected $contentProxy;
16
17 public function __construct(EntityManager $em, ContentProxy $contentProxy)
18 {
19 $this->em = $em;
20 $this->logger = new NullLogger();
21 $this->contentProxy = $contentProxy;
22 }
23
24 public function setLogger(LoggerInterface $logger)
25 {
26 $this->logger = $logger;
27 }
28
29 /**
30 * Fetch content from the ContentProxy (using graby).
31 * If it fails return false instead of the updated entry.
32 *
33 * @param Entry $entry Entry to update
34 * @param string $url Url to grab content for
35 * @param array $content An array with AT LEAST keys title, html, url, language & content_type to skip the fetchContent from the url
36 *
37 * @return Entry|false
38 */
39 protected function fetchContent(Entry $entry, $url, array $content = [])
40 {
41 try {
42 return $this->contentProxy->updateEntry($entry, $url, $content);
43 } catch (\Exception $e) {
44 return false;
45 }
46 }
47}
diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php
index 29361a32..798cfdae 100644
--- a/src/Wallabag/ImportBundle/Import/PocketImport.php
+++ b/src/Wallabag/ImportBundle/Import/PocketImport.php
@@ -2,7 +2,6 @@
2 2
3namespace Wallabag\ImportBundle\Import; 3namespace Wallabag\ImportBundle\Import;
4 4
5use Psr\Log\LoggerInterface;
6use Psr\Log\NullLogger; 5use Psr\Log\NullLogger;
7use Doctrine\ORM\EntityManager; 6use Doctrine\ORM\EntityManager;
8use GuzzleHttp\Client; 7use GuzzleHttp\Client;
@@ -12,12 +11,9 @@ use Wallabag\CoreBundle\Entity\Entry;
12use Wallabag\CoreBundle\Helper\ContentProxy; 11use Wallabag\CoreBundle\Helper\ContentProxy;
13use Craue\ConfigBundle\Util\Config; 12use Craue\ConfigBundle\Util\Config;
14 13
15class PocketImport implements ImportInterface 14class PocketImport extends AbstractImport
16{ 15{
17 private $user; 16 private $user;
18 private $em;
19 private $contentProxy;
20 private $logger;
21 private $client; 17 private $client;
22 private $consumerKey; 18 private $consumerKey;
23 private $skippedEntries = 0; 19 private $skippedEntries = 0;
@@ -34,11 +30,6 @@ class PocketImport implements ImportInterface
34 $this->logger = new NullLogger(); 30 $this->logger = new NullLogger();
35 } 31 }
36 32
37 public function setLogger(LoggerInterface $logger)
38 {
39 $this->logger = $logger;
40 }
41
42 /** 33 /**
43 * {@inheritdoc} 34 * {@inheritdoc}
44 */ 35 */
@@ -219,14 +210,20 @@ class PocketImport implements ImportInterface
219 } 210 }
220 211
221 $entry = new Entry($this->user); 212 $entry = new Entry($this->user);
222 $entry = $this->contentProxy->updateEntry($entry, $url); 213 $entry = $this->fetchContent($entry, $url);
214
215 // jump to next entry in case of problem while getting content
216 if (false === $entry) {
217 ++$this->skippedEntries;
218 continue;
219 }
223 220
224 // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted 221 // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted
225 if ($pocketEntry['status'] == 1 || $this->markAsRead) { 222 if ($pocketEntry['status'] == 1 || $this->markAsRead) {
226 $entry->setArchived(true); 223 $entry->setArchived(true);
227 } 224 }
228 225
229 // 0 or 1 - 1 If the item is favorited 226 // 0 or 1 - 1 If the item is starred
230 if ($pocketEntry['favorite'] == 1) { 227 if ($pocketEntry['favorite'] == 1) {
231 $entry->setStarred(true); 228 $entry->setStarred(true);
232 } 229 }
diff --git a/src/Wallabag/ImportBundle/Import/WallabagImport.php b/src/Wallabag/ImportBundle/Import/WallabagImport.php
index 65803823..a1cc085b 100644
--- a/src/Wallabag/ImportBundle/Import/WallabagImport.php
+++ b/src/Wallabag/ImportBundle/Import/WallabagImport.php
@@ -2,19 +2,12 @@
2 2
3namespace Wallabag\ImportBundle\Import; 3namespace Wallabag\ImportBundle\Import;
4 4
5use Psr\Log\LoggerInterface;
6use Psr\Log\NullLogger;
7use Doctrine\ORM\EntityManager;
8use Wallabag\CoreBundle\Entity\Entry; 5use Wallabag\CoreBundle\Entity\Entry;
9use Wallabag\UserBundle\Entity\User; 6use Wallabag\UserBundle\Entity\User;
10use Wallabag\CoreBundle\Helper\ContentProxy;
11 7
12abstract class WallabagImport implements ImportInterface 8abstract class WallabagImport extends AbstractImport
13{ 9{
14 protected $user; 10 protected $user;
15 protected $em;
16 protected $logger;
17 protected $contentProxy;
18 protected $skippedEntries = 0; 11 protected $skippedEntries = 0;
19 protected $importedEntries = 0; 12 protected $importedEntries = 0;
20 protected $filepath; 13 protected $filepath;
@@ -35,18 +28,6 @@ abstract class WallabagImport implements ImportInterface
35 '', 28 '',
36 ]; 29 ];
37 30
38 public function __construct(EntityManager $em, ContentProxy $contentProxy)
39 {
40 $this->em = $em;
41 $this->logger = new NullLogger();
42 $this->contentProxy = $contentProxy;
43 }
44
45 public function setLogger(LoggerInterface $logger)
46 {
47 $this->logger = $logger;
48 }
49
50 /** 31 /**
51 * We define the user in a custom call because on the import command there is no logged in user. 32 * We define the user in a custom call because on the import command there is no logged in user.
52 * So we can't retrieve user from the `security.token_storage` service. 33 * So we can't retrieve user from the `security.token_storage` service.
@@ -159,12 +140,18 @@ abstract class WallabagImport implements ImportInterface
159 140
160 $data = $this->prepareEntry($importedEntry, $this->markAsRead); 141 $data = $this->prepareEntry($importedEntry, $this->markAsRead);
161 142
162 $entry = $this->contentProxy->updateEntry( 143 $entry = $this->fetchContent(
163 new Entry($this->user), 144 new Entry($this->user),
164 $importedEntry['url'], 145 $importedEntry['url'],
165 $data 146 $data
166 ); 147 );
167 148
149 // jump to next entry in case of problem while getting content
150 if (false === $entry) {
151 ++$this->skippedEntries;
152 continue;
153 }
154
168 if (array_key_exists('tags', $data)) { 155 if (array_key_exists('tags', $data)) {
169 $this->contentProxy->assignTagsToEntry( 156 $this->contentProxy->assignTagsToEntry(
170 $entry, 157 $entry,
diff --git a/tests/Wallabag/CoreBundle/Command/InstallCommandTest.php b/tests/Wallabag/CoreBundle/Command/InstallCommandTest.php
index 2413d735..c0133af4 100644
--- a/tests/Wallabag/CoreBundle/Command/InstallCommandTest.php
+++ b/tests/Wallabag/CoreBundle/Command/InstallCommandTest.php
@@ -28,16 +28,32 @@ class InstallCommandTest extends WallabagCoreTestCase
28 * 28 *
29 * http://stackoverflow.com/a/14374832/569101 29 * http://stackoverflow.com/a/14374832/569101
30 */ 30 */
31 $this->markTestSkipped('PostgreSQL spotted: can find a good way to drop current database, skipping.'); 31 $this->markTestSkipped('PostgreSQL spotted: can\'t find a good way to drop current database, skipping.');
32 } 32 }
33 } 33 }
34 34
35 /**
36 * Ensure next tests will have a clean database
37 */
35 public static function tearDownAfterClass() 38 public static function tearDownAfterClass()
36 { 39 {
37 $application = new Application(static::$kernel); 40 $application = new Application(static::$kernel);
38 $application->setAutoExit(false); 41 $application->setAutoExit(false);
39 42
40 $code = $application->run(new ArrayInput([ 43 $application->run(new ArrayInput([
44 'command' => 'doctrine:schema:drop',
45 '--no-interaction' => true,
46 '--force' => true,
47 '--env' => 'test',
48 ]), new NullOutput());
49
50 $application->run(new ArrayInput([
51 'command' => 'doctrine:schema:create',
52 '--no-interaction' => true,
53 '--env' => 'test',
54 ]), new NullOutput());
55
56 $application->run(new ArrayInput([
41 'command' => 'doctrine:fixtures:load', 57 'command' => 'doctrine:fixtures:load',
42 '--no-interaction' => true, 58 '--no-interaction' => true,
43 '--env' => 'test', 59 '--env' => 'test',
diff --git a/tests/Wallabag/ImportBundle/Import/PocketImportTest.php b/tests/Wallabag/ImportBundle/Import/PocketImportTest.php
index 41f9b51f..8534e1c8 100644
--- a/tests/Wallabag/ImportBundle/Import/PocketImportTest.php
+++ b/tests/Wallabag/ImportBundle/Import/PocketImportTest.php
@@ -390,4 +390,55 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase
390 $this->assertContains('PocketImport: Failed to import', $records[0]['message']); 390 $this->assertContains('PocketImport: Failed to import', $records[0]['message']);
391 $this->assertEquals('ERROR', $records[0]['level_name']); 391 $this->assertEquals('ERROR', $records[0]['level_name']);
392 } 392 }
393
394 public function testImportWithExceptionFromGraby()
395 {
396 $client = new Client();
397
398 $mock = new Mock([
399 new Response(200, ['Content-Type' => 'application/json'], Stream::factory(json_encode(['access_token' => 'wunderbar_token']))),
400 new Response(200, ['Content-Type' => 'application/json'], Stream::factory('
401 {
402 "status": 1,
403 "list": {
404 "229279689": {
405 "resolved_url": "http://www.grantland.com/blog/the-triangle/post/_/id/38347/ryder-cup-preview"
406 }
407 }
408 }
409 ')),
410 ]);
411
412 $client->getEmitter()->attach($mock);
413
414 $pocketImport = $this->getPocketImport();
415
416 $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')
417 ->disableOriginalConstructor()
418 ->getMock();
419
420 $entryRepo->expects($this->once())
421 ->method('findByUrlAndUserId')
422 ->will($this->onConsecutiveCalls(false, true));
423
424 $this->em
425 ->expects($this->once())
426 ->method('getRepository')
427 ->willReturn($entryRepo);
428
429 $entry = new Entry($this->user);
430
431 $this->contentProxy
432 ->expects($this->once())
433 ->method('updateEntry')
434 ->will($this->throwException(new \Exception()));
435
436 $pocketImport->setClient($client);
437 $pocketImport->authorize('wunderbar_code');
438
439 $res = $pocketImport->import();
440
441 $this->assertTrue($res);
442 $this->assertEquals(['skipped' => 1, 'imported' => 0], $pocketImport->getSummary());
443 }
393} 444}
diff --git a/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php b/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php
index 8ec66b12..4a45e0f0 100644
--- a/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php
+++ b/tests/Wallabag/ImportBundle/Import/WallabagV2ImportTest.php
@@ -143,4 +143,44 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase
143 $this->assertContains('WallabagImport: user is not defined', $records[0]['message']); 143 $this->assertContains('WallabagImport: user is not defined', $records[0]['message']);
144 $this->assertEquals('ERROR', $records[0]['level_name']); 144 $this->assertEquals('ERROR', $records[0]['level_name']);
145 } 145 }
146
147 public function testImportEmptyFile()
148 {
149 $wallabagV2Import = $this->getWallabagV2Import();
150 $wallabagV2Import->setFilepath(__DIR__.'/../fixtures/wallabag-v2-empty.json');
151
152 $res = $wallabagV2Import->import();
153
154 $this->assertFalse($res);
155 $this->assertEquals(['skipped' => 0, 'imported' => 0], $wallabagV2Import->getSummary());
156 }
157
158 public function testImportWithExceptionFromGraby()
159 {
160 $wallabagV2Import = $this->getWallabagV2Import();
161 $wallabagV2Import->setFilepath(__DIR__.'/../fixtures/wallabag-v2.json');
162
163 $entryRepo = $this->getMockBuilder('Wallabag\CoreBundle\Repository\EntryRepository')
164 ->disableOriginalConstructor()
165 ->getMock();
166
167 $entryRepo->expects($this->exactly(24))
168 ->method('findByUrlAndUserId')
169 ->will($this->onConsecutiveCalls(false, true, false));
170
171 $this->em
172 ->expects($this->any())
173 ->method('getRepository')
174 ->willReturn($entryRepo);
175
176 $this->contentProxy
177 ->expects($this->exactly(2))
178 ->method('updateEntry')
179 ->will($this->throwException(new \Exception()));
180
181 $res = $wallabagV2Import->import();
182
183 $this->assertTrue($res);
184 $this->assertEquals(['skipped' => 24, 'imported' => 0], $wallabagV2Import->getSummary());
185 }
146} 186}
diff --git a/tests/Wallabag/ImportBundle/fixtures/wallabag-v2-empty.json b/tests/Wallabag/ImportBundle/fixtures/wallabag-v2-empty.json
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/Wallabag/ImportBundle/fixtures/wallabag-v2-empty.json