aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php17
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php7
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php8
-rw-r--r--src/Wallabag/CoreBundle/Entity/Entry.php19
-rw-r--r--src/Wallabag/CoreBundle/Entity/Tag.php23
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php12
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.da.yml2
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.de.yml2
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.en.yml2
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.es.yml2
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml46
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml2
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.it.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml2
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml2
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml2
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml2
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig5
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig5
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php52
20 files changed, 172 insertions, 41 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index 69dfd4b1..33b5e2ad 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -23,10 +23,16 @@ class EntryController extends Controller
23 { 23 {
24 try { 24 try {
25 $entry = $this->get('wallabag_core.content_proxy')->updateEntry($entry, $entry->getUrl()); 25 $entry = $this->get('wallabag_core.content_proxy')->updateEntry($entry, $entry->getUrl());
26
26 $em = $this->getDoctrine()->getManager(); 27 $em = $this->getDoctrine()->getManager();
27 $em->persist($entry); 28 $em->persist($entry);
28 $em->flush(); 29 $em->flush();
29 } catch (\Exception $e) { 30 } catch (\Exception $e) {
31 $this->get('logger')->error('Error while saving an entry', [
32 'exception' => $e,
33 'entry' => $entry,
34 ]);
35
30 return false; 36 return false;
31 } 37 }
32 38
@@ -60,11 +66,12 @@ class EntryController extends Controller
60 return $this->redirect($this->generateUrl('view', ['id' => $existingEntry->getId()])); 66 return $this->redirect($this->generateUrl('view', ['id' => $existingEntry->getId()]));
61 } 67 }
62 68
63 $this->updateEntry($entry); 69 $message = 'flashes.entry.notice.entry_saved';
64 $this->get('session')->getFlashBag()->add( 70 if (false === $this->updateEntry($entry)) {
65 'notice', 71 $message = 'flashes.entry.notice.entry_saved_failed';
66 'flashes.entry.notice.entry_saved' 72 }
67 ); 73
74 $this->get('session')->getFlashBag()->add('notice', $message);
68 75
69 return $this->redirect($this->generateUrl('homepage')); 76 return $this->redirect($this->generateUrl('homepage'));
70 } 77 }
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php
index 5a376453..03be9667 100644
--- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php
+++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php
@@ -6,7 +6,6 @@ use Doctrine\Common\DataFixtures\AbstractFixture;
6use Doctrine\Common\DataFixtures\OrderedFixtureInterface; 6use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
7use Doctrine\Common\Persistence\ObjectManager; 7use Doctrine\Common\Persistence\ObjectManager;
8use Wallabag\CoreBundle\Entity\Config; 8use Wallabag\CoreBundle\Entity\Config;
9use Wallabag\CoreBundle\Entity\TaggingRule;
10 9
11class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface 10class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface
12{ 11{
@@ -16,12 +15,6 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface
16 public function load(ObjectManager $manager) 15 public function load(ObjectManager $manager)
17 { 16 {
18 $adminConfig = new Config($this->getReference('admin-user')); 17 $adminConfig = new Config($this->getReference('admin-user'));
19 $taggingRule = new TaggingRule();
20
21 $taggingRule->setConfig($adminConfig);
22 $taggingRule->setRule('title matches "wallabag"');
23 $taggingRule->setTags(['wallabag']);
24 $manager->persist($taggingRule);
25 18
26 $adminConfig->setTheme('material'); 19 $adminConfig->setTheme('material');
27 $adminConfig->setItemsPerPage(30); 20 $adminConfig->setItemsPerPage(30);
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php
index 2e1cc270..7efe6356 100644
--- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php
+++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php
@@ -28,6 +28,14 @@ class LoadTaggingRuleData extends AbstractFixture implements OrderedFixtureInter
28 28
29 $manager->persist($tr2); 29 $manager->persist($tr2);
30 30
31 $tr3 = new TaggingRule();
32
33 $tr3->setRule('title matches "wallabag"');
34 $tr3->setTags(['wallabag']);
35 $tr3->setConfig($this->getReference('admin-config'));
36
37 $manager->persist($tr3);
38
31 $manager->flush(); 39 $manager->flush();
32 } 40 }
33 41
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php
index 1271f1f5..ceae78b0 100644
--- a/src/Wallabag/CoreBundle/Entity/Entry.php
+++ b/src/Wallabag/CoreBundle/Entity/Entry.php
@@ -177,8 +177,16 @@ class Entry
177 private $user; 177 private $user;
178 178
179 /** 179 /**
180 * @ORM\ManyToMany(targetEntity="Tag", inversedBy="entries", cascade={"persist", "remove"}) 180 * @ORM\ManyToMany(targetEntity="Tag", inversedBy="entries", cascade={"persist"})
181 * @ORM\JoinTable 181 * @ORM\JoinTable(
182 * name="entry_tag",
183 * joinColumns={
184 * @ORM\JoinColumn(name="entry_id", referencedColumnName="id")
185 * },
186 * inverseJoinColumns={
187 * @ORM\JoinColumn(name="tag_id", referencedColumnName="id")
188 * }
189 * )
182 * 190 *
183 * @Groups({"entries_for_user", "export_all"}) 191 * @Groups({"entries_for_user", "export_all"})
184 */ 192 */
@@ -526,13 +534,18 @@ class Entry
526 } 534 }
527 } 535 }
528 536
529 $this->tags[] = $tag; 537 $this->tags->add($tag);
530 $tag->addEntry($this); 538 $tag->addEntry($this);
531 } 539 }
532 540
533 public function removeTag(Tag $tag) 541 public function removeTag(Tag $tag)
534 { 542 {
543 if (!$this->tags->contains($tag)) {
544 return;
545 }
546
535 $this->tags->removeElement($tag); 547 $this->tags->removeElement($tag);
548 $tag->removeEntry($this);
536 } 549 }
537 550
538 /** 551 /**
diff --git a/src/Wallabag/CoreBundle/Entity/Tag.php b/src/Wallabag/CoreBundle/Entity/Tag.php
index b4adbbd3..4b480ff1 100644
--- a/src/Wallabag/CoreBundle/Entity/Tag.php
+++ b/src/Wallabag/CoreBundle/Entity/Tag.php
@@ -98,9 +98,30 @@ class Tag
98 return $this->slug; 98 return $this->slug;
99 } 99 }
100 100
101 /**
102 * @param Entry $entry
103 */
101 public function addEntry(Entry $entry) 104 public function addEntry(Entry $entry)
102 { 105 {
103 $this->entries[] = $entry; 106 if ($this->entries->contains($entry)) {
107 return;
108 }
109
110 $this->entries->add($entry);
111 $entry->addTag($this);
112 }
113
114 /**
115 * @param Entry $entry
116 */
117 public function removeEntry(Entry $entry)
118 {
119 if (!$this->entries->contains($entry)) {
120 return;
121 }
122
123 $this->entries->removeElement($entry);
124 $entry->removeTag($this);
104 } 125 }
105 126
106 public function hasEntry($entry) 127 public function hasEntry($entry)
diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
index cd4d3490..f3f848e9 100644
--- a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
@@ -87,6 +87,18 @@ class EntryFilterType extends AbstractType
87 ->add('isStarred', CheckboxFilterType::class, [ 87 ->add('isStarred', CheckboxFilterType::class, [
88 'label' => 'entry.filters.starred_label', 88 'label' => 'entry.filters.starred_label',
89 ]) 89 ])
90 ->add('isUnread', CheckboxFilterType::class, [
91 'label' => 'entry.filters.unread_label',
92 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
93 if (false === $values['value']) {
94 return;
95 }
96
97 $expression = $filterQuery->getExpr()->eq('e.isArchived', 'false');
98
99 return $filterQuery->createCondition($expression);
100 },
101 ])
90 ->add('previewPicture', CheckboxFilterType::class, [ 102 ->add('previewPicture', CheckboxFilterType::class, [
91 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { 103 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
92 if (false === $values['value']) { 104 if (false === $values['value']) {
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
index 8d392063..213d5790 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
@@ -154,6 +154,7 @@ entry:
154 status_label: 'Status' 154 status_label: 'Status'
155 archived_label: 'Arkiveret' 155 archived_label: 'Arkiveret'
156 starred_label: 'Favorit' 156 starred_label: 'Favorit'
157 unread_label: 'Ulæst'
157 preview_picture_label: 'Har et vist billede' 158 preview_picture_label: 'Har et vist billede'
158 preview_picture_help: 'Forhåndsvis billede' 159 preview_picture_help: 'Forhåndsvis billede'
159 language_label: 'Sprog' 160 language_label: 'Sprog'
@@ -396,6 +397,7 @@ flashes:
396 notice: 397 notice:
397 # entry_already_saved: 'Entry already saved on %date%' 398 # entry_already_saved: 'Entry already saved on %date%'
398 # entry_saved: 'Entry saved' 399 # entry_saved: 'Entry saved'
400 # entry_saved_failed: 'Failed to save entry'
399 # entry_updated: 'Entry updated' 401 # entry_updated: 'Entry updated'
400 # entry_reloaded: 'Entry reloaded' 402 # entry_reloaded: 'Entry reloaded'
401 # entry_reload_failed: 'Failed to reload entry' 403 # entry_reload_failed: 'Failed to reload entry'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
index c7a89492..89cbbbf8 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
@@ -154,6 +154,7 @@ entry:
154 status_label: 'Status' 154 status_label: 'Status'
155 archived_label: 'Archiviert' 155 archived_label: 'Archiviert'
156 starred_label: 'Favorisiert' 156 starred_label: 'Favorisiert'
157 unread_label: 'Ungelesene'
157 preview_picture_label: 'Vorschaubild vorhanden' 158 preview_picture_label: 'Vorschaubild vorhanden'
158 preview_picture_help: 'Vorschaubild' 159 preview_picture_help: 'Vorschaubild'
159 language_label: 'Sprache' 160 language_label: 'Sprache'
@@ -396,6 +397,7 @@ flashes:
396 notice: 397 notice:
397 entry_already_saved: 'Eintrag bereits am %date% gespeichert' 398 entry_already_saved: 'Eintrag bereits am %date% gespeichert'
398 entry_saved: 'Eintag gespeichert' 399 entry_saved: 'Eintag gespeichert'
400 # entry_saved_failed: 'Failed to save entry'
399 entry_updated: 'Eintrag aktualisiert' 401 entry_updated: 'Eintrag aktualisiert'
400 entry_reloaded: 'Eintrag neugeladen' 402 entry_reloaded: 'Eintrag neugeladen'
401 entry_reload_failed: 'Neuladen des Eintrags fehlgeschlagen' 403 entry_reload_failed: 'Neuladen des Eintrags fehlgeschlagen'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
index 876e7900..b65e4522 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
@@ -154,6 +154,7 @@ entry:
154 status_label: 'Status' 154 status_label: 'Status'
155 archived_label: 'Archived' 155 archived_label: 'Archived'
156 starred_label: 'Starred' 156 starred_label: 'Starred'
157 unread_label: 'Unread'
157 preview_picture_label: 'Has a preview picture' 158 preview_picture_label: 'Has a preview picture'
158 preview_picture_help: 'Preview picture' 159 preview_picture_help: 'Preview picture'
159 language_label: 'Language' 160 language_label: 'Language'
@@ -396,6 +397,7 @@ flashes:
396 notice: 397 notice:
397 entry_already_saved: 'Entry already saved on %date%' 398 entry_already_saved: 'Entry already saved on %date%'
398 entry_saved: 'Entry saved' 399 entry_saved: 'Entry saved'
400 entry_saved_failed: 'Failed to save entry'
399 entry_updated: 'Entry updated' 401 entry_updated: 'Entry updated'
400 entry_reloaded: 'Entry reloaded' 402 entry_reloaded: 'Entry reloaded'
401 entry_reload_failed: 'Failed to reload entry' 403 entry_reload_failed: 'Failed to reload entry'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
index e8461247..8351bcf4 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
@@ -154,6 +154,7 @@ entry:
154 status_label: 'Estatus' 154 status_label: 'Estatus'
155 archived_label: 'Archivado' 155 archived_label: 'Archivado'
156 starred_label: 'Favorito' 156 starred_label: 'Favorito'
157 unread_label: 'Sin leer'
157 preview_picture_label: 'Hay una foto' 158 preview_picture_label: 'Hay una foto'
158 preview_picture_help: 'Foto de preview' 159 preview_picture_help: 'Foto de preview'
159 language_label: 'Idioma' 160 language_label: 'Idioma'
@@ -396,6 +397,7 @@ flashes:
396 notice: 397 notice:
397 entry_already_saved: 'Entrada ya guardada por %fecha%' 398 entry_already_saved: 'Entrada ya guardada por %fecha%'
398 entry_saved: 'Entrada guardada' 399 entry_saved: 'Entrada guardada'
400 # entry_saved_failed: 'Failed to save entry'
399 entry_updated: 'Entrada actualizada' 401 entry_updated: 'Entrada actualizada'
400 entry_reloaded: 'Entrada recargada' 402 entry_reloaded: 'Entrada recargada'
401 entry_reload_failed: 'Entrada recargada reprobada' 403 entry_reload_failed: 'Entrada recargada reprobada'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
index d34ff8ff..db6e5960 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
@@ -96,8 +96,8 @@ config:
96 rule_label: 'قانون' 96 rule_label: 'قانون'
97 tags_label: 'برچسب‌ها' 97 tags_label: 'برچسب‌ها'
98 faq: 98 faq:
99 title: 'پرسش‌های متداول' 99 title: 'پرسش‌های متداول'
100 tagging_rules_definition_title: 'برچسب‌گذاری خودکار یعنی چه؟' 100 tagging_rules_definition_title: 'برچسب‌گذاری خودکار یعنی چه؟'
101 # tagging_rules_definition_description: 'They are rules used by Wallabag to automatically tag new entries.<br />Each time a new entry is added, all the tagging rules will be used to add the tags you configured, thus saving you the trouble to manually classify your entries.' 101 # tagging_rules_definition_description: 'They are rules used by Wallabag to automatically tag new entries.<br />Each time a new entry is added, all the tagging rules will be used to add the tags you configured, thus saving you the trouble to manually classify your entries.'
102 # how_to_use_them_title: 'How do I use them?' 102 # how_to_use_them_title: 'How do I use them?'
103 # how_to_use_them_description: 'Let assume you want to tag new entries as « <i>short reading</i> » when the reading time is inferior to 3 minutes.<br />In that case, you should put « readingTime &lt;= 3 » in the <i>Rule</i> field and « <i>short reading</i> » in the <i>Tags</i> field.<br />Several tags can added simultaneously by separating them by a comma: « <i>short reading, must read</i> »<br />Complex rules can be written by using predefined operators: if « <i>readingTime &gt;= 5 AND domainName = "github.com"</i> » then tag as « <i>long reading, github </i> »' 103 # how_to_use_them_description: 'Let assume you want to tag new entries as « <i>short reading</i> » when the reading time is inferior to 3 minutes.<br />In that case, you should put « readingTime &lt;= 3 » in the <i>Rule</i> field and « <i>short reading</i> » in the <i>Tags</i> field.<br />Several tags can added simultaneously by separating them by a comma: « <i>short reading, must read</i> »<br />Complex rules can be written by using predefined operators: if « <i>readingTime &gt;= 5 AND domainName = "github.com"</i> » then tag as « <i>long reading, github </i> »'
@@ -154,6 +154,7 @@ entry:
154 status_label: 'وضعیت' 154 status_label: 'وضعیت'
155 archived_label: 'بایگانی‌شده' 155 archived_label: 'بایگانی‌شده'
156 starred_label: 'برگزیده' 156 starred_label: 'برگزیده'
157 unread_label: 'خوانده‌نشده'
157 preview_picture_label: 'دارای عکس پیش‌نمایش' 158 preview_picture_label: 'دارای عکس پیش‌نمایش'
158 preview_picture_help: 'پیش‌نمایش عکس' 159 preview_picture_help: 'پیش‌نمایش عکس'
159 language_label: 'زبان' 160 language_label: 'زبان'
@@ -383,30 +384,31 @@ developer:
383flashes: 384flashes:
384 config: 385 config:
385 notice: 386 notice:
386 config_saved: 'پیکربندی ذخیره شد. برخی از تنظیمات پس از این که قطع شدید اعمال می‌شود.' 387 config_saved: 'پیکربندی ذخیره شد. برخی از تنظیمات پس از این که قطع شدید اعمال می‌شود.'
387 password_updated: 'رمز به‌روز شد' 388 password_updated: 'رمز به‌روز شد'
388 password_not_updated_demo: "در حالت نمایشی نمی‌توانید رمز کاربر را عوض کنید." 389 password_not_updated_demo: "در حالت نمایشی نمی‌توانید رمز کاربر را عوض کنید."
389 user_updated: 'اطلاعات به‌روز شد' 390 user_updated: 'اطلاعات به‌روز شد'
390 rss_updated: 'اطلاعات آر-اس-اس به‌روز شد' 391 rss_updated: 'اطلاعات آر-اس-اس به‌روز شد'
391 tagging_rules_updated: 'برچسب‌گذاری خودکار به‌روز شد' 392 tagging_rules_updated: 'برچسب‌گذاری خودکار به‌روز شد'
392 tagging_rules_deleted: 'قانون برچسب‌گذاری پاک شد' 393 tagging_rules_deleted: 'قانون برچسب‌گذاری پاک شد'
393 user_added: 'کابر "%username%" افزوده شد' 394 user_added: 'کابر "%username%" افزوده شد'
394 rss_token_updated: 'کد آر-اس-اس به‌روز شد' 395 rss_token_updated: 'کد آر-اس-اس به‌روز شد'
395 entry: 396 entry:
396 notice: 397 notice:
397 entry_already_saved: 'این مقاله در تاریخ %date% ذخیره شده بود' 398 entry_already_saved: 'این مقاله در تاریخ %date% ذخیره شده بود'
398 entry_saved: 'مقاله ذخیره شد' 399 entry_saved: 'مقاله ذخیره شد'
399 entry_updated: 'مقاله به‌روز شد' 400 # entry_saved_failed: 'Failed to save entry'
400 entry_reloaded: 'مقاله به‌روز شد' 401 entry_updated: 'مقاله به‌روز شد'
401 entry_reload_failed: 'به‌روزرسانی مقاله شکست خورد' 402 entry_reloaded: 'مقاله به‌روز شد'
402 entry_archived: 'مقاله بایگانی شد' 403 entry_reload_failed: 'به‌روزرسانی مقاله شکست خورد'
403 entry_unarchived: 'مقاله از بایگانی درآمد' 404 entry_archived: 'مقاله بایگانی شد'
404 entry_starred: 'مقاله برگزیده شد' 405 entry_unarchived: 'مقاله از بایگانی درآمد'
405 entry_unstarred: 'مقاله نابرگزیده شد' 406 entry_starred: 'مقاله برگزیده شد'
406 entry_deleted: 'مقاله پاک شد' 407 entry_unstarred: 'مقاله نابرگزیده شد'
408 entry_deleted: 'مقاله پاک شد'
407 tag: 409 tag:
408 notice: 410 notice:
409 tag_added: 'برچسب افزوده شد' 411 tag_added: 'برچسب افزوده شد'
410 import: 412 import:
411 notice: 413 notice:
412 failed: 'درون‌ریزی شکست خورد. لطفاً دوباره تلاش کنید.' 414 failed: 'درون‌ریزی شکست خورد. لطفاً دوباره تلاش کنید.'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
index 80ba0546..9fc8ca2a 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
@@ -154,6 +154,7 @@ entry:
154 status_label: 'Status' 154 status_label: 'Status'
155 archived_label: 'Lus' 155 archived_label: 'Lus'
156 starred_label: 'Favoris' 156 starred_label: 'Favoris'
157 unread_label: 'Non lus'
157 preview_picture_label: 'A une photo' 158 preview_picture_label: 'A une photo'
158 preview_picture_help: 'Photo' 159 preview_picture_help: 'Photo'
159 language_label: 'Langue' 160 language_label: 'Langue'
@@ -396,6 +397,7 @@ flashes:
396 notice: 397 notice:
397 entry_already_saved: 'Article déjà sauvergardé le %date%' 398 entry_already_saved: 'Article déjà sauvergardé le %date%'
398 entry_saved: 'Article enregistré' 399 entry_saved: 'Article enregistré'
400 entry_saved_failed: "L'enregistrement a échoué"
399 entry_updated: 'Article mis à jour' 401 entry_updated: 'Article mis à jour'
400 entry_reloaded: 'Article rechargé' 402 entry_reloaded: 'Article rechargé'
401 entry_reload_failed: "Le rechargement de l'article a échoué" 403 entry_reload_failed: "Le rechargement de l'article a échoué"
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
index 4f3ac090..00ed9c98 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
@@ -396,6 +396,7 @@ flashes:
396 notice: 396 notice:
397 entry_already_saved: 'Contenuto già salvato in data %date%' 397 entry_already_saved: 'Contenuto già salvato in data %date%'
398 entry_saved: 'Contenuto salvato' 398 entry_saved: 'Contenuto salvato'
399 # entry_saved_failed: 'Failed to save entry'
399 entry_updated: 'Contenuto aggiornato' 400 entry_updated: 'Contenuto aggiornato'
400 entry_reloaded: 'Contenuto ricaricato' 401 entry_reloaded: 'Contenuto ricaricato'
401 entry_reload_failed: 'Errore nel ricaricamento del contenuto' 402 entry_reload_failed: 'Errore nel ricaricamento del contenuto'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
index 46f58bbf..c81c852b 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
@@ -154,6 +154,7 @@ entry:
154 status_label: 'Estatus' 154 status_label: 'Estatus'
155 archived_label: 'Legits' 155 archived_label: 'Legits'
156 starred_label: 'Favorits' 156 starred_label: 'Favorits'
157 unread_label: 'Pas legits'
157 preview_picture_label: 'A una fotò' 158 preview_picture_label: 'A una fotò'
158 preview_picture_help: 'Fotò' 159 preview_picture_help: 'Fotò'
159 language_label: 'Lenga' 160 language_label: 'Lenga'
@@ -396,6 +397,7 @@ flashes:
396 notice: 397 notice:
397 entry_already_saved: 'Article ja salvargardat lo %date%' 398 entry_already_saved: 'Article ja salvargardat lo %date%'
398 entry_saved: 'Article enregistrat' 399 entry_saved: 'Article enregistrat'
400 # entry_saved_failed: 'Failed to save entry'
399 entry_updated: 'Article mes a jorn' 401 entry_updated: 'Article mes a jorn'
400 entry_reloaded: 'Article recargat' 402 entry_reloaded: 'Article recargat'
401 entry_reload_failed: "Fracàs de l'actualizacion de l'article" 403 entry_reload_failed: "Fracàs de l'actualizacion de l'article"
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
index 292749ed..3707a857 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
@@ -154,6 +154,7 @@ entry:
154 status_label: 'Status' 154 status_label: 'Status'
155 archived_label: 'Zarchiwizowane' 155 archived_label: 'Zarchiwizowane'
156 starred_label: 'Oznaczone gwiazdką' 156 starred_label: 'Oznaczone gwiazdką'
157 unread_label: 'Nieprzeczytane'
157 preview_picture_label: 'Posiada podgląd obrazu' 158 preview_picture_label: 'Posiada podgląd obrazu'
158 preview_picture_help: 'Podgląd obrazu' 159 preview_picture_help: 'Podgląd obrazu'
159 language_label: 'Język' 160 language_label: 'Język'
@@ -396,6 +397,7 @@ flashes:
396 notice: 397 notice:
397 entry_already_saved: 'Wpis już został dodany %date%' 398 entry_already_saved: 'Wpis już został dodany %date%'
398 entry_saved: 'Wpis zapisany' 399 entry_saved: 'Wpis zapisany'
400 # entry_saved_failed: 'Failed to save entry'
399 entry_updated: 'Wpis zaktualizowany' 401 entry_updated: 'Wpis zaktualizowany'
400 entry_reloaded: 'Wpis ponownie załadowany' 402 entry_reloaded: 'Wpis ponownie załadowany'
401 entry_reload_failed: 'Błąd ponownego załadowania' 403 entry_reload_failed: 'Błąd ponownego załadowania'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
index 45040f35..27be1edc 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
@@ -154,6 +154,7 @@ entry:
154 status_label: 'Status' 154 status_label: 'Status'
155 archived_label: 'Arhivat' 155 archived_label: 'Arhivat'
156 starred_label: 'Steluțe' 156 starred_label: 'Steluțe'
157 unread_label: 'Necitite'
157 preview_picture_label: 'Are o imagine de previzualizare' 158 preview_picture_label: 'Are o imagine de previzualizare'
158 preview_picture_help: 'Previzualizare imagine' 159 preview_picture_help: 'Previzualizare imagine'
159 language_label: 'Limbă' 160 language_label: 'Limbă'
@@ -396,6 +397,7 @@ flashes:
396 notice: 397 notice:
397 # entry_already_saved: 'Entry already saved on %date%' 398 # entry_already_saved: 'Entry already saved on %date%'
398 # entry_saved: 'Entry saved' 399 # entry_saved: 'Entry saved'
400 # entry_saved_failed: 'Failed to save entry'
399 # entry_updated: 'Entry updated' 401 # entry_updated: 'Entry updated'
400 # entry_reloaded: 'Entry reloaded' 402 # entry_reloaded: 'Entry reloaded'
401 # entry_reload_failed: 'Failed to reload entry' 403 # entry_reload_failed: 'Failed to reload entry'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
index 8a095a5b..85ee7316 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
@@ -154,6 +154,7 @@ entry:
154 status_label: 'Durum' 154 status_label: 'Durum'
155 archived_label: 'Arşiv' 155 archived_label: 'Arşiv'
156 starred_label: 'Favori' 156 starred_label: 'Favori'
157 unread_label: 'Okunmayan'
157 preview_picture_label: 'Resim önizlemesi varsa' 158 preview_picture_label: 'Resim önizlemesi varsa'
158 preview_picture_help: 'Resim önizlemesi' 159 preview_picture_help: 'Resim önizlemesi'
159 language_label: 'Dil' 160 language_label: 'Dil'
@@ -396,6 +397,7 @@ flashes:
396 notice: 397 notice:
397 entry_already_saved: 'Entry already saved on %date%' 398 entry_already_saved: 'Entry already saved on %date%'
398 entry_saved: 'Makale kaydedildi' 399 entry_saved: 'Makale kaydedildi'
400 # entry_saved_failed: 'Failed to save entry'
399 # entry_updated: 'Entry updated' 401 # entry_updated: 'Entry updated'
400 entry_reloaded: 'Makale içeriği yenilendi' 402 entry_reloaded: 'Makale içeriği yenilendi'
401 # entry_reload_failed: 'Failed to reload entry' 403 # entry_reload_failed: 'Failed to reload entry'
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 a2caaebf..778625ae 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
@@ -54,6 +54,11 @@
54 </div> 54 </div>
55 55
56 <div class="input-field"> 56 <div class="input-field">
57 {{ form_widget(form.isUnread) }}
58 {{ form_label(form.isUnread) }}
59 </div>
60
61 <div class="input-field">
57 {{ form_widget(form.previewPicture) }} 62 {{ form_widget(form.previewPicture) }}
58 {{ form_label(form.previewPicture) }} 63 {{ form_label(form.previewPicture) }}
59 </div> 64 </div>
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 1d569226..920fa933 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
@@ -126,6 +126,11 @@
126 {{ form_label(form.isStarred) }} 126 {{ form_label(form.isStarred) }}
127 </div> 127 </div>
128 128
129 <div class="input-field col s6 with-checkbox">
130 {{ form_widget(form.isUnread) }}
131 {{ form_label(form.isUnread) }}
132 </div>
133
129 <div class="col s12"> 134 <div class="col s12">
130 <label>{{ 'entry.filters.preview_picture_help'|trans }}</label> 135 <label>{{ 'entry.filters.preview_picture_help'|trans }}</label>
131 </div> 136 </div>
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
index df4c34cd..5ce893c1 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
@@ -163,7 +163,7 @@ class EntryControllerTest extends WallabagCoreTestCase
163 /** 163 /**
164 * This test will require an internet connection. 164 * This test will require an internet connection.
165 */ 165 */
166 public function testPostNewThatWillBeTaggued() 166 public function testPostNewThatWillBeTagged()
167 { 167 {
168 $this->logInAs('admin'); 168 $this->logInAs('admin');
169 $client = $this->getClient(); 169 $client = $this->getClient();
@@ -181,8 +181,7 @@ class EntryControllerTest extends WallabagCoreTestCase
181 $client->submit($form, $data); 181 $client->submit($form, $data);
182 182
183 $this->assertEquals(302, $client->getResponse()->getStatusCode()); 183 $this->assertEquals(302, $client->getResponse()->getStatusCode());
184 184 $this->assertContains('/', $client->getResponse()->getTargetUrl());
185 $client->followRedirect();
186 185
187 $em = $client->getContainer() 186 $em = $client->getContainer()
188 ->get('doctrine.orm.entity_manager'); 187 ->get('doctrine.orm.entity_manager');
@@ -196,6 +195,35 @@ class EntryControllerTest extends WallabagCoreTestCase
196 195
197 $em->remove($entry); 196 $em->remove($entry);
198 $em->flush(); 197 $em->flush();
198
199 // and now re-submit it to test the cascade persistence for tags after entry removal
200 // related https://github.com/wallabag/wallabag/issues/2121
201 $crawler = $client->request('GET', '/new');
202
203 $this->assertEquals(200, $client->getResponse()->getStatusCode());
204
205 $form = $crawler->filter('form[name=entry]')->form();
206
207 $data = [
208 'entry[url]' => $url = 'https://github.com/wallabag/wallabag/tree/master',
209 ];
210
211 $client->submit($form, $data);
212
213 $this->assertEquals(302, $client->getResponse()->getStatusCode());
214 $this->assertContains('/', $client->getResponse()->getTargetUrl());
215
216 $entry = $em
217 ->getRepository('WallabagCoreBundle:Entry')
218 ->findOneByUrl($url);
219
220 $tags = $entry->getTags();
221
222 $this->assertCount(1, $tags);
223 $this->assertEquals('wallabag', $tags[0]->getLabel());
224
225 $em->remove($entry);
226 $em->flush();
199 } 227 }
200 228
201 public function testArchive() 229 public function testArchive()
@@ -471,6 +499,24 @@ class EntryControllerTest extends WallabagCoreTestCase
471 $this->assertCount(1, $crawler->filter('div[class=entry]')); 499 $this->assertCount(1, $crawler->filter('div[class=entry]'));
472 } 500 }
473 501
502 public function testFilterOnUnreadStatus()
503 {
504 $this->logInAs('admin');
505 $client = $this->getClient();
506
507 $crawler = $client->request('GET', '/all/list');
508
509 $form = $crawler->filter('button[id=submit-filter]')->form();
510
511 $data = [
512 'entry_filter[isUnread]' => true,
513 ];
514
515 $crawler = $client->submit($form, $data);
516
517 $this->assertCount(4, $crawler->filter('div[class=entry]'));
518 }
519
474 public function testFilterOnCreationDate() 520 public function testFilterOnCreationDate()
475 { 521 {
476 $this->logInAs('admin'); 522 $this->logInAs('admin');