aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas Lœuillet <nicolas@loeuillet.org>2015-09-23 09:13:34 +0200
committerNicolas Lœuillet <nicolas@loeuillet.org>2015-09-23 09:13:34 +0200
commit57162494557c5eac938a7d6800ac1b112f73efc9 (patch)
tree0e0638166e8b734e17b9eb9a4c86d9008ed7be3d
parent1db9d411c5b1fe592788866dc206e2fd6dc87a71 (diff)
parentd4ebe5c5dcf581416ab76136908cafbde78f63bf (diff)
downloadwallabag-57162494557c5eac938a7d6800ac1b112f73efc9.tar.gz
wallabag-57162494557c5eac938a7d6800ac1b112f73efc9.tar.zst
wallabag-57162494557c5eac938a7d6800ac1b112f73efc9.zip
Merge pull request #1429 from wallabag/v2-language
V2 – Handle language in entry
-rw-r--r--composer.lock221
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php2
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php6
-rw-r--r--src/Wallabag/CoreBundle/Entity/Entry.php31
-rw-r--r--src/Wallabag/CoreBundle/Entity/User.php5
-rw-r--r--src/Wallabag/CoreBundle/Filter/EntryFilterType.php23
-rw-r--r--src/Wallabag/CoreBundle/Helper/ContentProxy.php1
-rw-r--r--src/Wallabag/CoreBundle/Repository/EntryRepository.php27
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig8
-rwxr-xr-xsrc/Wallabag/CoreBundle/Resources/views/themes/baggy/public/css/main.css102
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig26
-rwxr-xr-xsrc/Wallabag/CoreBundle/Resources/views/themes/material/public/css/main.css5
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php23
-rw-r--r--src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php24
14 files changed, 381 insertions, 123 deletions
diff --git a/composer.lock b/composer.lock
index d8c55fda..ef060b5e 100644
--- a/composer.lock
+++ b/composer.lock
@@ -285,16 +285,16 @@
285 }, 285 },
286 { 286 {
287 "name": "doctrine/dbal", 287 "name": "doctrine/dbal",
288 "version": "v2.5.1", 288 "version": "v2.5.2",
289 "source": { 289 "source": {
290 "type": "git", 290 "type": "git",
291 "url": "https://github.com/doctrine/dbal.git", 291 "url": "https://github.com/doctrine/dbal.git",
292 "reference": "628c2256b646ae2417d44e063bce8aec5199d48d" 292 "reference": "01dbcbc5cd0a913d751418e635434a18a2f2a75c"
293 }, 293 },
294 "dist": { 294 "dist": {
295 "type": "zip", 295 "type": "zip",
296 "url": "https://api.github.com/repos/doctrine/dbal/zipball/628c2256b646ae2417d44e063bce8aec5199d48d", 296 "url": "https://api.github.com/repos/doctrine/dbal/zipball/01dbcbc5cd0a913d751418e635434a18a2f2a75c",
297 "reference": "628c2256b646ae2417d44e063bce8aec5199d48d", 297 "reference": "01dbcbc5cd0a913d751418e635434a18a2f2a75c",
298 "shasum": "" 298 "shasum": ""
299 }, 299 },
300 "require": { 300 "require": {
@@ -352,20 +352,20 @@
352 "persistence", 352 "persistence",
353 "queryobject" 353 "queryobject"
354 ], 354 ],
355 "time": "2015-01-12 21:52:47" 355 "time": "2015-09-16 16:29:33"
356 }, 356 },
357 { 357 {
358 "name": "doctrine/doctrine-bundle", 358 "name": "doctrine/doctrine-bundle",
359 "version": "v1.5.1", 359 "version": "v1.5.2",
360 "source": { 360 "source": {
361 "type": "git", 361 "type": "git",
362 "url": "https://github.com/doctrine/DoctrineBundle.git", 362 "url": "https://github.com/doctrine/DoctrineBundle.git",
363 "reference": "8c5cedb4f2f7ebb66a963ae46ad9daa1e31cee01" 363 "reference": "d63be7eb9a95d46720f7d6badac4e5bc2bcff2e3"
364 }, 364 },
365 "dist": { 365 "dist": {
366 "type": "zip", 366 "type": "zip",
367 "url": "https://api.github.com/repos/doctrine/DoctrineBundle/zipball/8c5cedb4f2f7ebb66a963ae46ad9daa1e31cee01", 367 "url": "https://api.github.com/repos/doctrine/DoctrineBundle/zipball/d63be7eb9a95d46720f7d6badac4e5bc2bcff2e3",
368 "reference": "8c5cedb4f2f7ebb66a963ae46ad9daa1e31cee01", 368 "reference": "d63be7eb9a95d46720f7d6badac4e5bc2bcff2e3",
369 "shasum": "" 369 "shasum": ""
370 }, 370 },
371 "require": { 371 "require": {
@@ -392,7 +392,7 @@
392 "type": "symfony-bundle", 392 "type": "symfony-bundle",
393 "extra": { 393 "extra": {
394 "branch-alias": { 394 "branch-alias": {
395 "dev-master": "1.5.x-dev" 395 "dev-master": "1.6.x-dev"
396 } 396 }
397 }, 397 },
398 "autoload": { 398 "autoload": {
@@ -430,7 +430,7 @@
430 "orm", 430 "orm",
431 "persistence" 431 "persistence"
432 ], 432 ],
433 "time": "2015-08-12 15:52:00" 433 "time": "2015-08-31 14:47:06"
434 }, 434 },
435 { 435 {
436 "name": "doctrine/doctrine-cache-bundle", 436 "name": "doctrine/doctrine-cache-bundle",
@@ -948,12 +948,12 @@
948 "source": { 948 "source": {
949 "type": "git", 949 "type": "git",
950 "url": "https://github.com/FriendsOfSymfony/FOSUserBundle.git", 950 "url": "https://github.com/FriendsOfSymfony/FOSUserBundle.git",
951 "reference": "6b7bb04c6d507bb5356bf70b2d1bc30ce64ffc60" 951 "reference": "d5b28c367d393f9d9fbc48c4138b2a74d51c0c83"
952 }, 952 },
953 "dist": { 953 "dist": {
954 "type": "zip", 954 "type": "zip",
955 "url": "https://api.github.com/repos/FriendsOfSymfony/FOSUserBundle/zipball/6b7bb04c6d507bb5356bf70b2d1bc30ce64ffc60", 955 "url": "https://api.github.com/repos/FriendsOfSymfony/FOSUserBundle/zipball/d5b28c367d393f9d9fbc48c4138b2a74d51c0c83",
956 "reference": "6b7bb04c6d507bb5356bf70b2d1bc30ce64ffc60", 956 "reference": "d5b28c367d393f9d9fbc48c4138b2a74d51c0c83",
957 "shasum": "" 957 "shasum": ""
958 }, 958 },
959 "require": { 959 "require": {
@@ -1007,7 +1007,7 @@
1007 "keywords": [ 1007 "keywords": [
1008 "User management" 1008 "User management"
1009 ], 1009 ],
1010 "time": "2015-09-07 08:53:52" 1010 "time": "2015-09-15 13:15:07"
1011 }, 1011 },
1012 { 1012 {
1013 "name": "guzzlehttp/guzzle", 1013 "name": "guzzlehttp/guzzle",
@@ -1267,16 +1267,16 @@
1267 }, 1267 },
1268 { 1268 {
1269 "name": "j0k3r/graby", 1269 "name": "j0k3r/graby",
1270 "version": "1.0.0-alpha.1", 1270 "version": "1.0.0-alpha.2",
1271 "source": { 1271 "source": {
1272 "type": "git", 1272 "type": "git",
1273 "url": "https://github.com/j0k3r/graby.git", 1273 "url": "https://github.com/j0k3r/graby.git",
1274 "reference": "9d4f62aa83a7cd563fe3ca9fcc4b176d7e1d264c" 1274 "reference": "9cc399bbe70f12b302ea65e604a80ea738042599"
1275 }, 1275 },
1276 "dist": { 1276 "dist": {
1277 "type": "zip", 1277 "type": "zip",
1278 "url": "https://api.github.com/repos/j0k3r/graby/zipball/9d4f62aa83a7cd563fe3ca9fcc4b176d7e1d264c", 1278 "url": "https://api.github.com/repos/j0k3r/graby/zipball/9cc399bbe70f12b302ea65e604a80ea738042599",
1279 "reference": "9d4f62aa83a7cd563fe3ca9fcc4b176d7e1d264c", 1279 "reference": "9cc399bbe70f12b302ea65e604a80ea738042599",
1280 "shasum": "" 1280 "shasum": ""
1281 }, 1281 },
1282 "require": { 1282 "require": {
@@ -1289,6 +1289,7 @@
1289 "neitanod/forceutf8": "^1.4", 1289 "neitanod/forceutf8": "^1.4",
1290 "php": ">=5.4", 1290 "php": ">=5.4",
1291 "simplepie/simplepie": "^1.3.1", 1291 "simplepie/simplepie": "^1.3.1",
1292 "smalot/pdfparser": "~0.9.24",
1292 "symfony/options-resolver": "^2.6.6" 1293 "symfony/options-resolver": "^2.6.6"
1293 }, 1294 },
1294 "type": "library", 1295 "type": "library",
@@ -1314,20 +1315,20 @@
1314 } 1315 }
1315 ], 1316 ],
1316 "description": "Graby helps you extract article content from web pages", 1317 "description": "Graby helps you extract article content from web pages",
1317 "time": "2015-09-13 10:07:45" 1318 "time": "2015-09-17 11:43:10"
1318 }, 1319 },
1319 { 1320 {
1320 "name": "j0k3r/graby-site-config", 1321 "name": "j0k3r/graby-site-config",
1321 "version": "1.0.2", 1322 "version": "1.0.3",
1322 "source": { 1323 "source": {
1323 "type": "git", 1324 "type": "git",
1324 "url": "https://github.com/j0k3r/graby-site-config.git", 1325 "url": "https://github.com/j0k3r/graby-site-config.git",
1325 "reference": "9ad65e69bb21397dfededd420e1d4ab22006993c" 1326 "reference": "1b0ac25687aa33785c5d9d8ede92b26f757354f5"
1326 }, 1327 },
1327 "dist": { 1328 "dist": {
1328 "type": "zip", 1329 "type": "zip",
1329 "url": "https://api.github.com/repos/j0k3r/graby-site-config/zipball/9ad65e69bb21397dfededd420e1d4ab22006993c", 1330 "url": "https://api.github.com/repos/j0k3r/graby-site-config/zipball/1b0ac25687aa33785c5d9d8ede92b26f757354f5",
1330 "reference": "9ad65e69bb21397dfededd420e1d4ab22006993c", 1331 "reference": "1b0ac25687aa33785c5d9d8ede92b26f757354f5",
1331 "shasum": "" 1332 "shasum": ""
1332 }, 1333 },
1333 "require": { 1334 "require": {
@@ -1350,20 +1351,20 @@
1350 } 1351 }
1351 ], 1352 ],
1352 "description": "Graby site config files", 1353 "description": "Graby site config files",
1353 "time": "2015-09-13 10:26:25" 1354 "time": "2015-09-17 17:32:42"
1354 }, 1355 },
1355 { 1356 {
1356 "name": "j0k3r/php-readability", 1357 "name": "j0k3r/php-readability",
1357 "version": "v1.0.4", 1358 "version": "v1.0.7",
1358 "source": { 1359 "source": {
1359 "type": "git", 1360 "type": "git",
1360 "url": "https://github.com/j0k3r/php-readability.git", 1361 "url": "https://github.com/j0k3r/php-readability.git",
1361 "reference": "c5a4a490e155fa20809c9bbcf3e318defbb7a261" 1362 "reference": "1830dc45d4fccfe09d2d107ab59890f07adc35c4"
1362 }, 1363 },
1363 "dist": { 1364 "dist": {
1364 "type": "zip", 1365 "type": "zip",
1365 "url": "https://api.github.com/repos/j0k3r/php-readability/zipball/c5a4a490e155fa20809c9bbcf3e318defbb7a261", 1366 "url": "https://api.github.com/repos/j0k3r/php-readability/zipball/1830dc45d4fccfe09d2d107ab59890f07adc35c4",
1366 "reference": "c5a4a490e155fa20809c9bbcf3e318defbb7a261", 1367 "reference": "1830dc45d4fccfe09d2d107ab59890f07adc35c4",
1367 "shasum": "" 1368 "shasum": ""
1368 }, 1369 },
1369 "require": { 1370 "require": {
@@ -1413,7 +1414,7 @@
1413 "extraction", 1414 "extraction",
1414 "html" 1415 "html"
1415 ], 1416 ],
1416 "time": "2015-08-24 09:10:54" 1417 "time": "2015-09-20 19:05:55"
1417 }, 1418 },
1418 { 1419 {
1419 "name": "jdorn/sql-formatter", 1420 "name": "jdorn/sql-formatter",
@@ -2058,20 +2059,20 @@
2058 }, 2059 },
2059 { 2060 {
2060 "name": "neitanod/forceutf8", 2061 "name": "neitanod/forceutf8",
2061 "version": "v1.4", 2062 "version": "v1.5",
2062 "source": { 2063 "source": {
2063 "type": "git", 2064 "type": "git",
2064 "url": "https://github.com/neitanod/forceutf8.git", 2065 "url": "https://github.com/neitanod/forceutf8.git",
2065 "reference": "28d50d579179abac1f6a55b03c6d9d3f6573867c" 2066 "reference": "1b577b9430cb7bd20d8dd7435f36120b85880ace"
2066 }, 2067 },
2067 "dist": { 2068 "dist": {
2068 "type": "zip", 2069 "type": "zip",
2069 "url": "https://api.github.com/repos/neitanod/forceutf8/zipball/28d50d579179abac1f6a55b03c6d9d3f6573867c", 2070 "url": "https://api.github.com/repos/neitanod/forceutf8/zipball/1b577b9430cb7bd20d8dd7435f36120b85880ace",
2070 "reference": "28d50d579179abac1f6a55b03c6d9d3f6573867c", 2071 "reference": "1b577b9430cb7bd20d8dd7435f36120b85880ace",
2071 "shasum": "" 2072 "shasum": ""
2072 }, 2073 },
2073 "require": { 2074 "require": {
2074 "php": ">=5.2.0" 2075 "php": ">=5.3.0"
2075 }, 2076 },
2076 "type": "library", 2077 "type": "library",
2077 "autoload": { 2078 "autoload": {
@@ -2088,7 +2089,7 @@
2088 ], 2089 ],
2089 "description": "PHP Class Encoding featuring popular Encoding::toUTF8() function --formerly known as forceUTF8()-- that fixes mixed encoded strings.", 2090 "description": "PHP Class Encoding featuring popular Encoding::toUTF8() function --formerly known as forceUTF8()-- that fixes mixed encoded strings.",
2090 "homepage": "https://github.com/neitanod/forceutf8", 2091 "homepage": "https://github.com/neitanod/forceutf8",
2091 "time": "2014-09-24 14:59:43" 2092 "time": "2015-01-02 13:36:36"
2092 }, 2093 },
2093 { 2094 {
2094 "name": "nelmio/api-doc-bundle", 2095 "name": "nelmio/api-doc-bundle",
@@ -2686,6 +2687,49 @@
2686 "time": "2012-10-30 17:54:03" 2687 "time": "2012-10-30 17:54:03"
2687 }, 2688 },
2688 { 2689 {
2690 "name": "smalot/pdfparser",
2691 "version": "v0.9.25",
2692 "source": {
2693 "type": "git",
2694 "url": "https://github.com/smalot/pdfparser.git",
2695 "reference": "31590f7938a22f1c7fc4fb292611e3742a62ebaa"
2696 },
2697 "dist": {
2698 "type": "zip",
2699 "url": "https://api.github.com/repos/smalot/pdfparser/zipball/31590f7938a22f1c7fc4fb292611e3742a62ebaa",
2700 "reference": "31590f7938a22f1c7fc4fb292611e3742a62ebaa",
2701 "shasum": ""
2702 },
2703 "require": {
2704 "php": ">=5.3.0",
2705 "tecnickcom/tcpdf": ">=6.0.050"
2706 },
2707 "require-dev": {
2708 "atoum/atoum": "dev-master"
2709 },
2710 "type": "library",
2711 "autoload": {
2712 "psr-0": {
2713 "Smalot\\PdfParser\\": "src/"
2714 }
2715 },
2716 "notification-url": "https://packagist.org/downloads/",
2717 "license": [
2718 "GPL-3.0"
2719 ],
2720 "authors": [
2721 {
2722 "name": "Sebastien MALOT",
2723 "email": "sebastien@malot.fr",
2724 "homepage": "http://www.malot.fr",
2725 "role": "Developer"
2726 }
2727 ],
2728 "description": "Pdf parser library. Can read and extract information from pdf file.",
2729 "homepage": "http://www.pdfparser.org",
2730 "time": "2015-09-18 08:29:33"
2731 },
2732 {
2689 "name": "swiftmailer/swiftmailer", 2733 "name": "swiftmailer/swiftmailer",
2690 "version": "v5.4.1", 2734 "version": "v5.4.1",
2691 "source": { 2735 "source": {
@@ -3110,6 +3154,69 @@
3110 "time": "2015-08-02 12:30:27" 3154 "time": "2015-08-02 12:30:27"
3111 }, 3155 },
3112 { 3156 {
3157 "name": "tecnickcom/tcpdf",
3158 "version": "6.2.12",
3159 "source": {
3160 "type": "git",
3161 "url": "https://github.com/tecnickcom/TCPDF.git",
3162 "reference": "2f732eaa91b5665274689b1d40b285a7bacdc37f"
3163 },
3164 "dist": {
3165 "type": "zip",
3166 "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/2f732eaa91b5665274689b1d40b285a7bacdc37f",
3167 "reference": "2f732eaa91b5665274689b1d40b285a7bacdc37f",
3168 "shasum": ""
3169 },
3170 "require": {
3171 "php": ">=5.3.0"
3172 },
3173 "type": "library",
3174 "autoload": {
3175 "classmap": [
3176 "fonts",
3177 "config",
3178 "include",
3179 "tcpdf.php",
3180 "tcpdf_parser.php",
3181 "tcpdf_import.php",
3182 "tcpdf_barcodes_1d.php",
3183 "tcpdf_barcodes_2d.php",
3184 "include/tcpdf_colors.php",
3185 "include/tcpdf_filters.php",
3186 "include/tcpdf_font_data.php",
3187 "include/tcpdf_fonts.php",
3188 "include/tcpdf_images.php",
3189 "include/tcpdf_static.php",
3190 "include/barcodes/datamatrix.php",
3191 "include/barcodes/pdf417.php",
3192 "include/barcodes/qrcode.php"
3193 ]
3194 },
3195 "notification-url": "https://packagist.org/downloads/",
3196 "license": [
3197 "LGPLv3"
3198 ],
3199 "authors": [
3200 {
3201 "name": "Nicola Asuni",
3202 "email": "info@tecnick.com",
3203 "homepage": "http://nicolaasuni.tecnick.com"
3204 }
3205 ],
3206 "description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
3207 "homepage": "http://www.tcpdf.org/",
3208 "keywords": [
3209 "PDFD32000-2008",
3210 "TCPDF",
3211 "barcodes",
3212 "datamatrix",
3213 "pdf",
3214 "pdf417",
3215 "qrcode"
3216 ],
3217 "time": "2015-09-12 10:08:34"
3218 },
3219 {
3113 "name": "twig/extensions", 3220 "name": "twig/extensions",
3114 "version": "v1.3.0", 3221 "version": "v1.3.0",
3115 "source": { 3222 "source": {
@@ -3163,16 +3270,16 @@
3163 }, 3270 },
3164 { 3271 {
3165 "name": "twig/twig", 3272 "name": "twig/twig",
3166 "version": "v1.21.2", 3273 "version": "v1.22.2",
3167 "source": { 3274 "source": {
3168 "type": "git", 3275 "type": "git",
3169 "url": "https://github.com/twigphp/Twig.git", 3276 "url": "https://github.com/twigphp/Twig.git",
3170 "reference": "ddce1136beb8db29b9cd7dffa8ab518b978c9db3" 3277 "reference": "79249fc8c9ff62e41e217e0c630e2e00bcadda6a"
3171 }, 3278 },
3172 "dist": { 3279 "dist": {
3173 "type": "zip", 3280 "type": "zip",
3174 "url": "https://api.github.com/repos/twigphp/Twig/zipball/ddce1136beb8db29b9cd7dffa8ab518b978c9db3", 3281 "url": "https://api.github.com/repos/twigphp/Twig/zipball/79249fc8c9ff62e41e217e0c630e2e00bcadda6a",
3175 "reference": "ddce1136beb8db29b9cd7dffa8ab518b978c9db3", 3282 "reference": "79249fc8c9ff62e41e217e0c630e2e00bcadda6a",
3176 "shasum": "" 3283 "shasum": ""
3177 }, 3284 },
3178 "require": { 3285 "require": {
@@ -3185,7 +3292,7 @@
3185 "type": "library", 3292 "type": "library",
3186 "extra": { 3293 "extra": {
3187 "branch-alias": { 3294 "branch-alias": {
3188 "dev-master": "1.21-dev" 3295 "dev-master": "1.22-dev"
3189 } 3296 }
3190 }, 3297 },
3191 "autoload": { 3298 "autoload": {
@@ -3220,7 +3327,7 @@
3220 "keywords": [ 3327 "keywords": [
3221 "templating" 3328 "templating"
3222 ], 3329 ],
3223 "time": "2015-09-09 05:28:51" 3330 "time": "2015-09-22 13:59:32"
3224 }, 3331 },
3225 { 3332 {
3226 "name": "willdurand/hateoas", 3333 "name": "willdurand/hateoas",
@@ -3655,16 +3762,16 @@
3655 }, 3762 },
3656 { 3763 {
3657 "name": "phpunit/php-code-coverage", 3764 "name": "phpunit/php-code-coverage",
3658 "version": "2.2.2", 3765 "version": "2.2.3",
3659 "source": { 3766 "source": {
3660 "type": "git", 3767 "type": "git",
3661 "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 3768 "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
3662 "reference": "2d7c03c0e4e080901b8f33b2897b0577be18a13c" 3769 "reference": "ef1ca6835468857944d5c3b48fa503d5554cff2f"
3663 }, 3770 },
3664 "dist": { 3771 "dist": {
3665 "type": "zip", 3772 "type": "zip",
3666 "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2d7c03c0e4e080901b8f33b2897b0577be18a13c", 3773 "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef1ca6835468857944d5c3b48fa503d5554cff2f",
3667 "reference": "2d7c03c0e4e080901b8f33b2897b0577be18a13c", 3774 "reference": "ef1ca6835468857944d5c3b48fa503d5554cff2f",
3668 "shasum": "" 3775 "shasum": ""
3669 }, 3776 },
3670 "require": { 3777 "require": {
@@ -3713,7 +3820,7 @@
3713 "testing", 3820 "testing",
3714 "xunit" 3821 "xunit"
3715 ], 3822 ],
3716 "time": "2015-08-04 03:42:39" 3823 "time": "2015-09-14 06:51:16"
3717 }, 3824 },
3718 { 3825 {
3719 "name": "phpunit/php-file-iterator", 3826 "name": "phpunit/php-file-iterator",
@@ -3846,16 +3953,16 @@
3846 }, 3953 },
3847 { 3954 {
3848 "name": "phpunit/php-token-stream", 3955 "name": "phpunit/php-token-stream",
3849 "version": "1.4.6", 3956 "version": "1.4.8",
3850 "source": { 3957 "source": {
3851 "type": "git", 3958 "type": "git",
3852 "url": "https://github.com/sebastianbergmann/php-token-stream.git", 3959 "url": "https://github.com/sebastianbergmann/php-token-stream.git",
3853 "reference": "3ab72c62e550370a6cd5dc873e1a04ab57562f5b" 3960 "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da"
3854 }, 3961 },
3855 "dist": { 3962 "dist": {
3856 "type": "zip", 3963 "type": "zip",
3857 "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3ab72c62e550370a6cd5dc873e1a04ab57562f5b", 3964 "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da",
3858 "reference": "3ab72c62e550370a6cd5dc873e1a04ab57562f5b", 3965 "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da",
3859 "shasum": "" 3966 "shasum": ""
3860 }, 3967 },
3861 "require": { 3968 "require": {
@@ -3891,20 +3998,20 @@
3891 "keywords": [ 3998 "keywords": [
3892 "tokenizer" 3999 "tokenizer"
3893 ], 4000 ],
3894 "time": "2015-08-16 08:51:00" 4001 "time": "2015-09-15 10:49:45"
3895 }, 4002 },
3896 { 4003 {
3897 "name": "phpunit/phpunit", 4004 "name": "phpunit/phpunit",
3898 "version": "4.8.6", 4005 "version": "4.8.9",
3899 "source": { 4006 "source": {
3900 "type": "git", 4007 "type": "git",
3901 "url": "https://github.com/sebastianbergmann/phpunit.git", 4008 "url": "https://github.com/sebastianbergmann/phpunit.git",
3902 "reference": "2246830f4a1a551c67933e4171bf2126dc29d357" 4009 "reference": "73fad41adb5b7bc3a494bb930d90648df1d5e74b"
3903 }, 4010 },
3904 "dist": { 4011 "dist": {
3905 "type": "zip", 4012 "type": "zip",
3906 "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2246830f4a1a551c67933e4171bf2126dc29d357", 4013 "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/73fad41adb5b7bc3a494bb930d90648df1d5e74b",
3907 "reference": "2246830f4a1a551c67933e4171bf2126dc29d357", 4014 "reference": "73fad41adb5b7bc3a494bb930d90648df1d5e74b",
3908 "shasum": "" 4015 "shasum": ""
3909 }, 4016 },
3910 "require": { 4017 "require": {
@@ -3963,7 +4070,7 @@
3963 "testing", 4070 "testing",
3964 "xunit" 4071 "xunit"
3965 ], 4072 ],
3966 "time": "2015-08-24 04:09:38" 4073 "time": "2015-09-20 12:56:44"
3967 }, 4074 },
3968 { 4075 {
3969 "name": "phpunit/phpunit-mock-objects", 4076 "name": "phpunit/phpunit-mock-objects",
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index b9e4e67e..a9f35c36 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -192,7 +192,7 @@ class EntryController extends Controller
192 throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type)); 192 throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type));
193 } 193 }
194 194
195 $form = $this->get('form.factory')->create(new EntryFilterType()); 195 $form = $this->get('form.factory')->create(new EntryFilterType($repository, $this->getUser()));
196 196
197 if ($request->query->has($form->getName())) { 197 if ($request->query->has($form->getName())) {
198 // manually bind values from the request 198 // manually bind values from the request
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php
index 6cd24d44..dd316194 100644
--- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php
+++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php
@@ -19,6 +19,7 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface
19 $entry1->setUrl('http://0.0.0.0'); 19 $entry1->setUrl('http://0.0.0.0');
20 $entry1->setTitle('test title entry1'); 20 $entry1->setTitle('test title entry1');
21 $entry1->setContent('This is my content /o/'); 21 $entry1->setContent('This is my content /o/');
22 $entry1->setLanguage('en');
22 23
23 $manager->persist($entry1); 24 $manager->persist($entry1);
24 25
@@ -28,6 +29,7 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface
28 $entry2->setUrl('http://0.0.0.0'); 29 $entry2->setUrl('http://0.0.0.0');
29 $entry2->setTitle('test title entry2'); 30 $entry2->setTitle('test title entry2');
30 $entry2->setContent('This is my content /o/'); 31 $entry2->setContent('This is my content /o/');
32 $entry2->setLanguage('fr');
31 33
32 $manager->persist($entry2); 34 $manager->persist($entry2);
33 35
@@ -37,6 +39,7 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface
37 $entry3->setUrl('http://0.0.0.0'); 39 $entry3->setUrl('http://0.0.0.0');
38 $entry3->setTitle('test title entry3'); 40 $entry3->setTitle('test title entry3');
39 $entry3->setContent('This is my content /o/'); 41 $entry3->setContent('This is my content /o/');
42 $entry3->setLanguage('en');
40 43
41 $tag1 = new Tag($this->getReference('bob-user')); 44 $tag1 = new Tag($this->getReference('bob-user'));
42 $tag1->setLabel('foo'); 45 $tag1->setLabel('foo');
@@ -54,6 +57,7 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface
54 $entry4->setUrl('http://0.0.0.0'); 57 $entry4->setUrl('http://0.0.0.0');
55 $entry4->setTitle('test title entry4'); 58 $entry4->setTitle('test title entry4');
56 $entry4->setContent('This is my content /o/'); 59 $entry4->setContent('This is my content /o/');
60 $entry4->setLanguage('en');
57 61
58 $tag1 = new Tag($this->getReference('admin-user')); 62 $tag1 = new Tag($this->getReference('admin-user'));
59 $tag1->setLabel('foo'); 63 $tag1->setLabel('foo');
@@ -72,6 +76,7 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface
72 $entry5->setTitle('test title entry5'); 76 $entry5->setTitle('test title entry5');
73 $entry5->setContent('This is my content /o/'); 77 $entry5->setContent('This is my content /o/');
74 $entry5->setStarred(true); 78 $entry5->setStarred(true);
79 $entry5->setLanguage('fr');
75 80
76 $manager->persist($entry5); 81 $manager->persist($entry5);
77 82
@@ -82,6 +87,7 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface
82 $entry6->setTitle('test title entry6'); 87 $entry6->setTitle('test title entry6');
83 $entry6->setContent('This is my content /o/'); 88 $entry6->setContent('This is my content /o/');
84 $entry6->setArchived(true); 89 $entry6->setArchived(true);
90 $entry6->setLanguage('de');
85 91
86 $manager->persist($entry6); 92 $manager->persist($entry6);
87 93
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php
index e684c9b1..7108889e 100644
--- a/src/Wallabag/CoreBundle/Entity/Entry.php
+++ b/src/Wallabag/CoreBundle/Entity/Entry.php
@@ -95,6 +95,13 @@ class Entry
95 private $mimetype; 95 private $mimetype;
96 96
97 /** 97 /**
98 * @var string
99 *
100 * @ORM\Column(name="language", type="text", nullable=true)
101 */
102 private $language;
103
104 /**
98 * @var int 105 * @var int
99 * 106 *
100 * @ORM\Column(name="reading_time", type="integer", nullable=true) 107 * @ORM\Column(name="reading_time", type="integer", nullable=true)
@@ -450,4 +457,28 @@ class Entry
450 { 457 {
451 return $this->previewPicture; 458 return $this->previewPicture;
452 } 459 }
460
461 /**
462 * Set language.
463 *
464 * @param string $language
465 *
466 * @return Entry
467 */
468 public function setLanguage($language)
469 {
470 $this->language = $language;
471
472 return $this;
473 }
474
475 /**
476 * Get language.
477 *
478 * @return string
479 */
480 public function getLanguage()
481 {
482 return $this->language;
483 }
453} 484}
diff --git a/src/Wallabag/CoreBundle/Entity/User.php b/src/Wallabag/CoreBundle/Entity/User.php
index eeae331e..a6002352 100644
--- a/src/Wallabag/CoreBundle/Entity/User.php
+++ b/src/Wallabag/CoreBundle/Entity/User.php
@@ -7,7 +7,6 @@ use Doctrine\ORM\Mapping as ORM;
7use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; 7use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
8use Symfony\Component\Security\Core\User\UserInterface; 8use Symfony\Component\Security\Core\User\UserInterface;
9use Symfony\Component\Security\Core\User\AdvancedUserInterface; 9use Symfony\Component\Security\Core\User\AdvancedUserInterface;
10use Symfony\Component\Validator\Constraints as Assert;
11use JMS\Serializer\Annotation\ExclusionPolicy; 10use JMS\Serializer\Annotation\ExclusionPolicy;
12use JMS\Serializer\Annotation\Expose; 11use JMS\Serializer\Annotation\Expose;
13use FOS\UserBundle\Model\User as BaseUser; 12use FOS\UserBundle\Model\User as BaseUser;
@@ -74,8 +73,8 @@ class User extends BaseUser implements AdvancedUserInterface, \Serializable
74 public function __construct() 73 public function __construct()
75 { 74 {
76 parent::__construct(); 75 parent::__construct();
77 $this->entries = new ArrayCollection(); 76 $this->entries = new ArrayCollection();
78 $this->tags = new ArrayCollection(); 77 $this->tags = new ArrayCollection();
79 } 78 }
80 79
81 /** 80 /**
diff --git a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php
index 024486e6..f40c1c2d 100644
--- a/src/Wallabag/CoreBundle/Filter/EntryFilterType.php
+++ b/src/Wallabag/CoreBundle/Filter/EntryFilterType.php
@@ -6,9 +6,26 @@ use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\FormBuilderInterface; 6use Symfony\Component\Form\FormBuilderInterface;
7use Symfony\Component\OptionsResolver\OptionsResolver; 7use Symfony\Component\OptionsResolver\OptionsResolver;
8use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface; 8use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface;
9use Doctrine\ORM\EntityRepository;
10use Wallabag\CoreBundle\Entity\User;
9 11
10class EntryFilterType extends AbstractType 12class EntryFilterType extends AbstractType
11{ 13{
14 private $user;
15 private $repository;
16
17 /**
18 * Repository & user are used to get a list of language entries for this user
19 *
20 * @param EntityRepository $entryRepository
21 * @param User $user
22 */
23 public function __construct(EntityRepository $entryRepository, User $user)
24 {
25 $this->repository = $entryRepository;
26 $this->user = $user;
27 }
28
12 public function buildForm(FormBuilderInterface $builder, array $options) 29 public function buildForm(FormBuilderInterface $builder, array $options)
13 { 30 {
14 $builder 31 $builder
@@ -53,7 +70,11 @@ class EntryFilterType extends AbstractType
53 70
54 return $filterQuery->createCondition($expression); 71 return $filterQuery->createCondition($expression);
55 }, 72 },
56 )); 73 ))
74 ->add('language', 'filter_choice', array(
75 'choices' => $this->repository->findDistinctLanguageByUser($this->user->getId()),
76 ))
77 ;
57 } 78 }
58 79
59 public function getName() 80 public function getName()
diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php
index 4565d8e7..3de8828f 100644
--- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php
+++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php
@@ -49,6 +49,7 @@ class ContentProxy
49 $entry->setUrl($content['url'] ?: $url); 49 $entry->setUrl($content['url'] ?: $url);
50 $entry->setTitle($title); 50 $entry->setTitle($title);
51 $entry->setContent($html); 51 $entry->setContent($html);
52 $entry->setLanguage($content['language']);
52 $entry->setMimetype($content['content_type']); 53 $entry->setMimetype($content['content_type']);
53 54
54 if (isset($content['open_graph']['og_image'])) { 55 if (isset($content['open_graph']['og_image'])) {
diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
index e764e8f7..87b9befe 100644
--- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
@@ -134,4 +134,31 @@ class EntryRepository extends EntityRepository
134 134
135 return $qb->getQuery()->getResult(); 135 return $qb->getQuery()->getResult();
136 } 136 }
137
138 /**
139 * Find distinct language for a given user.
140 * Used to build the filter language list.
141 *
142 * @param int $userId User id
143 *
144 * @return array
145 */
146 public function findDistinctLanguageByUser($userId)
147 {
148 $results = $this->createQueryBuilder('e')
149 ->select('e.language')
150 ->where('e.user = :userId')->setParameter('userId', $userId)
151 ->andWhere('e.language IS NOT NULL')
152 ->groupBy('e.language')
153 ->orderBy('e.language', ' ASC')
154 ->getQuery()
155 ->getResult();
156
157 $languages = array();
158 foreach ($results as $result) {
159 $languages[$result['language']] = $result['language'];
160 }
161
162 return $languages;
163 }
137} 164}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
index 176290e4..08f3fe60 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
@@ -71,6 +71,14 @@
71 <label for="entry_filter_previewPicture">{% trans %}Has a preview picture{% endtrans %}</label> 71 <label for="entry_filter_previewPicture">{% trans %}Has a preview picture{% endtrans %}</label>
72 </div> 72 </div>
73 </div> 73 </div>
74
75 <div id="filter-language" class="filter-group">
76 <label for="entry_filter_language">{% trans %}Language{% endtrans %}</label>
77 <div class="input-field ">
78 {{ form_widget(form.language) }}
79 </div>
80 </div>
81
74 <div id="filter-reading-time" class="filter-group"> 82 <div id="filter-reading-time" class="filter-group">
75 <div class=""> 83 <div class="">
76 <label>{% trans %}Reading time in minutes{% endtrans %}</label> 84 <label>{% trans %}Reading time in minutes{% endtrans %}</label>
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/public/css/main.css b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/public/css/main.css
index 950d8b0e..4aeadb4f 100755
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/public/css/main.css
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/public/css/main.css
@@ -356,9 +356,9 @@ footer a {
356 overflow: hidden; 356 overflow: hidden;
357 padding: 1.5em 1.5em 3em 1.5em; 357 padding: 1.5em 1.5em 3em 1.5em;
358 358
359 /* Removing CSS transitions because they make the switch from list view to 359 /* Removing CSS transitions because they make the switch from list view to
360 * table view jerky 360 * table view jerky
361 */ 361 */
362 /* -webkit-transition: all 0.5s ease; */ 362 /* -webkit-transition: all 0.5s ease; */
363 /* -moz-transition: all 0.5s ease; */ 363 /* -moz-transition: all 0.5s ease; */
364 /* -ms-transition: all 0.5s ease; */ 364 /* -ms-transition: all 0.5s ease; */
@@ -570,47 +570,47 @@ img.preview {
570 border-left: 1px #EEE solid; 570 border-left: 1px #EEE solid;
571} 571}
572 572
573 .popup-form form { 573 .popup-form form {
574 background-color: #FFF; 574 background-color: #FFF;
575 position: absolute; 575 position: absolute;
576 top: 0; 576 top: 0;
577 left: 0; 577 left: 0;
578 z-index: 20; 578 z-index: 20;
579 border: 10px solid #000; 579 border: 10px solid #000;
580 width: 400px; 580 width: 400px;
581 height: 200px; 581 height: 200px;
582 padding: 2em; 582 padding: 2em;
583 } 583 }
584 584
585#bagit-form-form .addurl { 585#bagit-form-form .addurl {
586 margin-left: 0; 586 margin-left: 0;
587} 587}
588 588
589.closeMessage, 589.closeMessage,
590.close-button { 590.close-button {
591 background-color: #000; 591 background-color: #000;
592 color: #FFF; 592 color: #FFF;
593 font-size: 1.2em; 593 font-size: 1.2em;
594 line-height: 1.6; 594 line-height: 1.6;
595 width: 1.6em; 595 width: 1.6em;
596 height: 1.6em; 596 height: 1.6em;
597 text-align: center; 597 text-align: center;
598 text-decoration: none; 598 text-decoration: none;
599} 599}
600 .closeMessage:hover, 600 .closeMessage:hover,
601 .closeMessage:focus, 601 .closeMessage:focus,
602 .close-button:hover, 602 .close-button:hover,
603 .close-button:focus { 603 .close-button:focus {
604 background-color: #999; 604 background-color: #999;
605 color: #000; 605 color: #000;
606 } 606 }
607 607
608.close-button--popup { 608.close-button--popup {
609 display: inline-block; 609 display: inline-block;
610 position: absolute; 610 position: absolute;
611 top: 0; 611 top: 0;
612 right: 0; 612 right: 0;
613 font-size: 1.4em; 613 font-size: 1.4em;
614} 614}
615 615
616.active-current { 616.active-current {
@@ -753,24 +753,24 @@ a.add-to-wallabag-link-after:after {
753 753
754 754
755/* .icon-image class, for image-based icons 755/* .icon-image class, for image-based icons
756 ========================================================================== */ 756 ========================================================================== */
757 757
758.icon-image { 758.icon-image {
759 background-size: 16px 16px; 759 background-size: 16px 16px;
760 background-repeat: no-repeat; 760 background-repeat: no-repeat;
761 background-position: center; 761 background-position: center;
762 padding-right: 1em !important; 762 padding-right: 1em !important;
763 padding-left: 1em !important; 763 padding-left: 1em !important;
764} 764}
765 765
766/* Carrot (http://carrot.org) */ 766/* Carrot (http://carrot.org) */
767.icon-image--carrot { 767.icon-image--carrot {
768 background-image: url('../../_global/img/icons/carrot-icon--white.png'); 768 background-image: url('../../_global/img/icons/carrot-icon--white.png');
769} 769}
770 770
771/* Diaspora */ 771/* Diaspora */
772.icon-image--diaspora { 772.icon-image--diaspora {
773 background-image: url('../../_global/img/icons/diaspora-icon--black.png'); 773 background-image: url('../../_global/img/icons/diaspora-icon--black.png');
774}} 774}}
775 775
776/* ========================================================================== 776/* ==========================================================================
@@ -813,14 +813,14 @@ a.add-to-wallabag-link-after:after {
813} 813}
814 814
815.more-info { 815.more-info {
816 font-size: 0.85em; 816 font-size: 0.85em;
817 line-height: 1.5; 817 line-height: 1.5;
818 color: #aaa; 818 color: #aaa;
819} 819}
820 820
821 .more-info a { 821 .more-info a {
822 color: #aaa; 822 color: #aaa;
823 } 823 }
824 824
825/* ========================================================================== 825/* ==========================================================================
826 5 = Article 826 5 = Article
@@ -934,9 +934,9 @@ blockquote {
934} 934}
935 935
936pre code { 936pre code {
937 font-family: "Courier New", Courier, monospace; 937 font-family: "Courier New", Courier, monospace;
938 border: 1px solid #ccc; 938 border: 1px solid #ccc;
939 font-size: 0.96em; 939 font-size: 0.96em;
940} 940}
941 941
942#filter-form { 942#filter-form {
@@ -949,18 +949,18 @@ pre code {
949 padding: 15px; 949 padding: 15px;
950 padding-right: 30px; 950 padding-right: 30px;
951 padding-top: 30px; 951 padding-top: 30px;
952 952 border-left: 1px #333 solid;
953 z-index: 12; 953 z-index: 12;
954 954
955 /*transition-property: transform; 955 /*transition-property: transform;
956 transition-duration: 0.3s; 956 transition-duration: 0.3s;
957 transition-delay: 0.3s; 957 transition-delay: 0.3s;
958 958
959 transform: translate3d(100%, 0, 0);*/ 959 transform: translate3d(100%, 0, 0);*/
960} 960}
961 961
962#filter-form form { 962#filter-form form {
963 963
964} 964}
965 965
966#filter-form form .filter-group { 966#filter-form form .filter-group {
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 77483a09..dcdf7c09 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
@@ -98,25 +98,35 @@
98 <h4 class="center">{% trans %}Filters{% endtrans %}</h1> 98 <h4 class="center">{% trans %}Filters{% endtrans %}</h1>
99 99
100 <div class="row"> 100 <div class="row">
101 <div class="col s12">
102 <label>{% trans %}Status{% endtrans %}</label>
103 </div>
104
105 <div class="input-field col s6 with-checkbox">
106 {{ form_widget(form.isArchived) }}
107 <label for="entry_filter_isArchived">{% trans %}Archived{% endtrans %}</label>
108 </div>
101 109
110 <div class="input-field col s6 with-checkbox">
111 {{ form_widget(form.isStarred) }}
112 <label for="entry_filter_isStarred">{% trans %}Starred{% endtrans %}</label>
113 </div>
102 114
103 <div class="col s12"> 115 <div class="col s12">
104 <label>{% trans %}Status{% endtrans %}</label> 116 <label>{% trans %}Preview picture{% endtrans %}</label>
105 </div> 117 </div>
106 118
107 <div class="input-field col s6"> 119 <div class="input-field col s12 with-checkbox">
108 {{ form_widget(form.previewPicture) }} 120 {{ form_widget(form.previewPicture) }}
109 <label for="entry_filter_previewPicture">{% trans %}Has a preview picture{% endtrans %}</label> 121 <label for="entry_filter_previewPicture">{% trans %}Has a preview picture{% endtrans %}</label>
110 </div> 122 </div>
111 123
112 <div class="input-field col s6"> 124 <div class="col s12">
113 {{ form_widget(form.isArchived) }} 125 <label>{% trans %}Language{% endtrans %}</label>
114 <label for="entry_filter_isArchived">{% trans %}Archived{% endtrans %}</label>
115 </div> 126 </div>
116 127
117 <div class="input-field col s6"> 128 <div class="input-field col s12">
118 {{ form_widget(form.isStarred) }} 129 {{ form_widget(form.language) }}
119 <label for="entry_filter_isStarred">{% trans %}Starred{% endtrans %}</label>
120 </div> 130 </div>
121 131
122 <div class="col s12"> 132 <div class="col s12">
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/public/css/main.css b/src/Wallabag/CoreBundle/Resources/views/themes/material/public/css/main.css
index 144e259f..7a4e7df2 100755
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/public/css/main.css
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/public/css/main.css
@@ -209,6 +209,11 @@ nav input {
209 overflow-y: visible; 209 overflow-y: visible;
210} 210}
211 211
212#filters div.with-checkbox {
213 height: 3rem;
214 margin-top: 0px;
215}
216
212/* ========================================================================== 217/* ==========================================================================
213 4 = Cards 218 4 = Cards
214 ========================================================================== */ 219 ========================================================================== */
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
index 77b57884..cbd84a97 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
@@ -382,4 +382,27 @@ class EntryControllerTest extends WallabagCoreTestCase
382 $crawler = $client->submit($form); 382 $crawler = $client->submit($form);
383 $this->assertCount(1, $crawler->filter('div[class=entry]')); 383 $this->assertCount(1, $crawler->filter('div[class=entry]'));
384 } 384 }
385
386 public function testFilterOnLanguage()
387 {
388 $this->logInAs('admin');
389 $client = $this->getClient();
390
391 $crawler = $client->request('GET', '/unread/list');
392 $form = $crawler->filter('button[id=submit-filter]')->form();
393 $data = array(
394 'entry_filter[language]' => 'de',
395 );
396
397 $crawler = $client->submit($form, $data);
398 $this->assertCount(1, $crawler->filter('div[class=entry]'));
399
400 $form = $crawler->filter('button[id=submit-filter]')->form();
401 $data = array(
402 'entry_filter[language]' => 'en',
403 );
404
405 $crawler = $client->submit($form, $data);
406 $this->assertCount(2, $crawler->filter('div[class=entry]'));
407 }
385} 408}
diff --git a/src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php b/src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php
index 71a004ff..30065d6b 100644
--- a/src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php
@@ -18,7 +18,13 @@ class ContentProxyTest extends KernelTestCase
18 18
19 $graby->expects($this->any()) 19 $graby->expects($this->any())
20 ->method('fetchContent') 20 ->method('fetchContent')
21 ->willReturn(array('html' => false, 'title' => '', 'url' => '', 'content_type' => '')); 21 ->willReturn(array(
22 'html' => false,
23 'title' => '',
24 'url' => '',
25 'content_type' => '',
26 'language' => '',
27 ));
22 28
23 $proxy = new ContentProxy($graby); 29 $proxy = new ContentProxy($graby);
24 $entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0'); 30 $entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0');
@@ -28,6 +34,7 @@ class ContentProxyTest extends KernelTestCase
28 $this->assertEquals('<p>Unable to retrieve readable content.</p>', $entry->getContent()); 34 $this->assertEquals('<p>Unable to retrieve readable content.</p>', $entry->getContent());
29 $this->assertEmpty($entry->getPreviewPicture()); 35 $this->assertEmpty($entry->getPreviewPicture());
30 $this->assertEmpty($entry->getMimetype()); 36 $this->assertEmpty($entry->getMimetype());
37 $this->assertEmpty($entry->getLanguage());
31 } 38 }
32 39
33 public function testWithEmptyContentButOG() 40 public function testWithEmptyContentButOG()
@@ -39,7 +46,17 @@ class ContentProxyTest extends KernelTestCase
39 46
40 $graby->expects($this->any()) 47 $graby->expects($this->any())
41 ->method('fetchContent') 48 ->method('fetchContent')
42 ->willReturn(array('html' => false, 'title' => '', 'url' => '', 'content_type' => '', 'open_graph' => array('og_title' => 'my title', 'og_description' => 'desc'))); 49 ->willReturn(array(
50 'html' => false,
51 'title' => '',
52 'url' => '',
53 'content_type' => '',
54 'language' => '',
55 'open_graph' => array(
56 'og_title' => 'my title',
57 'og_description' => 'desc',
58 ),
59 ));
43 60
44 $proxy = new ContentProxy($graby); 61 $proxy = new ContentProxy($graby);
45 $entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0'); 62 $entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0');
@@ -48,6 +65,7 @@ class ContentProxyTest extends KernelTestCase
48 $this->assertEquals('my title', $entry->getTitle()); 65 $this->assertEquals('my title', $entry->getTitle());
49 $this->assertEquals('<p>Unable to retrieve readable content.</p><p><i>But we found a short description: </i></p>desc', $entry->getContent()); 66 $this->assertEquals('<p>Unable to retrieve readable content.</p><p><i>But we found a short description: </i></p>desc', $entry->getContent());
50 $this->assertEmpty($entry->getPreviewPicture()); 67 $this->assertEmpty($entry->getPreviewPicture());
68 $this->assertEmpty($entry->getLanguage());
51 $this->assertEmpty($entry->getMimetype()); 69 $this->assertEmpty($entry->getMimetype());
52 } 70 }
53 71
@@ -65,6 +83,7 @@ class ContentProxyTest extends KernelTestCase
65 'title' => 'this is my title', 83 'title' => 'this is my title',
66 'url' => 'http://1.1.1.1', 84 'url' => 'http://1.1.1.1',
67 'content_type' => 'text/html', 85 'content_type' => 'text/html',
86 'language' => 'fr',
68 'open_graph' => array( 87 'open_graph' => array(
69 'og_title' => 'my OG title', 88 'og_title' => 'my OG title',
70 'og_description' => 'OG desc', 89 'og_description' => 'OG desc',
@@ -80,5 +99,6 @@ class ContentProxyTest extends KernelTestCase
80 $this->assertEquals('this is my content', $entry->getContent()); 99 $this->assertEquals('this is my content', $entry->getContent());
81 $this->assertEquals('http://3.3.3.3/cover.jpg', $entry->getPreviewPicture()); 100 $this->assertEquals('http://3.3.3.3/cover.jpg', $entry->getPreviewPicture());
82 $this->assertEquals('text/html', $entry->getMimetype()); 101 $this->assertEquals('text/html', $entry->getMimetype());
102 $this->assertEquals('fr', $entry->getLanguage());
83 } 103 }
84} 104}