From 7975395d10bb381de8cd15b5ee15198318af6d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Viande?= Date: Wed, 11 Apr 2018 11:42:52 +0200 Subject: Entry: add archived_at property and updateArchived method --- .../ApiBundle/Controller/EntryRestController.php | 4 +- .../CoreBundle/DataFixtures/ORM/LoadEntryData.php | 2 +- src/Wallabag/CoreBundle/Entity/Entry.php | 49 +++++++++++++++++++++- src/Wallabag/ImportBundle/Import/BrowserImport.php | 2 +- .../ImportBundle/Import/InstapaperImport.php | 2 +- .../ImportBundle/Import/PinboardImport.php | 2 +- src/Wallabag/ImportBundle/Import/PocketImport.php | 2 +- .../ImportBundle/Import/ReadabilityImport.php | 2 +- .../ImportBundle/Import/WallabagImport.php | 2 +- 9 files changed, 57 insertions(+), 10 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 0b4e74a0..dc63b98d 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -358,7 +358,7 @@ class EntryRestController extends WallabagRestController } if (null !== $data['isArchived']) { - $entry->setArchived((bool) $data['isArchived']); + $entry->updateArchived((bool) $data['isArchived']); } if (null !== $data['isStarred']) { @@ -474,7 +474,7 @@ class EntryRestController extends WallabagRestController } if (null !== $data['isArchived']) { - $entry->setArchived((bool) $data['isArchived']); + $entry->updateArchived((bool) $data['isArchived']); } if (null !== $data['isStarred']) { diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php index 0e1510a2..62fb5fa6 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php @@ -98,7 +98,7 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface $entry6->setMimetype('text/html'); $entry6->setTitle('test title entry6'); $entry6->setContent('This is my content /o/'); - $entry6->setArchived(true); + $entry6->updateArchived(true); $entry6->setLanguage('de'); $entry6->addTag($this->getReference('bar-tag')); diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 2b1f2e05..b3cfdc4a 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -86,6 +86,15 @@ class Entry */ private $isArchived = false; + /** + * @var \DateTime + * + * @ORM\Column(name="archived_at", type="datetime", nullable=true) + * + * @Groups({"entries_for_user", "export_all"}) + */ + private $archivedAt = null; + /** * @var bool * @@ -335,6 +344,44 @@ class Entry return $this; } + /** + * update isArchived and archive_at fields. + * + * @param bool $isArchived + * + * @return Entry + */ + public function updateArchived($isArchived = false) + { + $this->setArchived($isArchived); + $this->setArchivedAt(null); + if ($this->isArchived()) { + $this->setArchivedAt(new \DateTime()); + } + + return $this; + } + + /** + * @return \DateTime|null + */ + public function getArchivedAt() + { + return $this->archivedAt; + } + + /** + * @param \DateTime|null $archivedAt + * + * @return Entry + */ + public function setArchivedAt($archivedAt = null) + { + $this->archivedAt = $archivedAt; + + return $this; + } + /** * Get isArchived. * @@ -357,7 +404,7 @@ class Entry public function toggleArchive() { - $this->isArchived = $this->isArchived() ^ 1; + $this->updateArchived($this->isArchived() ^ 1); return $this; } diff --git a/src/Wallabag/ImportBundle/Import/BrowserImport.php b/src/Wallabag/ImportBundle/Import/BrowserImport.php index 225f1791..614386cb 100644 --- a/src/Wallabag/ImportBundle/Import/BrowserImport.php +++ b/src/Wallabag/ImportBundle/Import/BrowserImport.php @@ -133,7 +133,7 @@ abstract class BrowserImport extends AbstractImport ); } - $entry->setArchived($data['is_archived']); + $entry->updateArchived($data['is_archived']); if (!empty($data['created_at'])) { $dt = new \DateTime(); diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php index e4f0970c..e113ba00 100644 --- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php +++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php @@ -135,7 +135,7 @@ class InstapaperImport extends AbstractImport ); } - $entry->setArchived($importedEntry['is_archived']); + $entry->updateArchived($importedEntry['is_archived']); $entry->setStarred($importedEntry['is_starred']); $this->em->persist($entry); diff --git a/src/Wallabag/ImportBundle/Import/PinboardImport.php b/src/Wallabag/ImportBundle/Import/PinboardImport.php index 110b0464..9a5e8cb6 100644 --- a/src/Wallabag/ImportBundle/Import/PinboardImport.php +++ b/src/Wallabag/ImportBundle/Import/PinboardImport.php @@ -119,7 +119,7 @@ class PinboardImport extends AbstractImport ); } - $entry->setArchived($data['is_archived']); + $entry->updateArchived($data['is_archived']); $entry->setStarred($data['is_starred']); $entry->setCreatedAt(new \DateTime($data['created_at'])); diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index c1b35b7e..4b1ad1d7 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php @@ -194,7 +194,7 @@ class PocketImport extends AbstractImport $this->fetchContent($entry, $url); // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted - $entry->setArchived(1 === $importedEntry['status'] || $this->markAsRead); + $entry->updateArchived(1 === $importedEntry['status'] || $this->markAsRead); // 0 or 1 - 1 If the item is starred $entry->setStarred(1 === $importedEntry['favorite']); diff --git a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php index 002b27f4..d6777582 100644 --- a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php +++ b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php @@ -111,7 +111,7 @@ class ReadabilityImport extends AbstractImport // update entry with content (in case fetching failed, the given entry will be return) $this->fetchContent($entry, $data['url'], $data); - $entry->setArchived($data['is_archived']); + $entry->updateArchived($data['is_archived']); $entry->setStarred($data['is_starred']); $entry->setCreatedAt(new \DateTime($data['created_at'])); diff --git a/src/Wallabag/ImportBundle/Import/WallabagImport.php b/src/Wallabag/ImportBundle/Import/WallabagImport.php index c64ccd64..916137f1 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagImport.php +++ b/src/Wallabag/ImportBundle/Import/WallabagImport.php @@ -122,7 +122,7 @@ abstract class WallabagImport extends AbstractImport $entry->setPreviewPicture($importedEntry['preview_picture']); } - $entry->setArchived($data['is_archived']); + $entry->updateArchived($data['is_archived']); $entry->setStarred($data['is_starred']); if (!empty($data['created_at'])) { -- cgit v1.2.3 From 0e70e812274a4e13b02e821e8a64a3206c7688ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Viande?= Date: Thu, 26 Apr 2018 07:20:52 +0200 Subject: Entry: add sort parameter archived --- src/Wallabag/ApiBundle/Controller/EntryRestController.php | 2 +- src/Wallabag/CoreBundle/Repository/EntryRepository.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index dc63b98d..5882aaee 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -79,7 +79,7 @@ class EntryRestController extends WallabagRestController * parameters={ * {"name"="archive", "dataType"="integer", "required"=false, "format"="1 or 0, all entries by default", "description"="filter by archived status."}, * {"name"="starred", "dataType"="integer", "required"=false, "format"="1 or 0, all entries by default", "description"="filter by starred status."}, - * {"name"="sort", "dataType"="string", "required"=false, "format"="'created' or 'updated', default 'created'", "description"="sort entries by date."}, + * {"name"="sort", "dataType"="string", "required"=false, "format"="'created' or 'updated' or 'archived', default 'created'", "description"="sort entries by date."}, * {"name"="order", "dataType"="string", "required"=false, "format"="'asc' or 'desc', default 'desc'", "description"="order of sort."}, * {"name"="page", "dataType"="integer", "required"=false, "format"="default '1'", "description"="what page you want."}, * {"name"="perPage", "dataType"="integer", "required"=false, "format"="default'30'", "description"="results per page."}, diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 83379998..c0818ca0 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -189,6 +189,8 @@ class EntryRepository extends EntityRepository $qb->orderBy('e.id', $order); } elseif ('updated' === $sort) { $qb->orderBy('e.updatedAt', $order); + } else if ('archived' === $sort) { + $qb->orderBy('e.archivedAt', $order); } $pagerAdapter = new DoctrineORMAdapter($qb, true, false); -- cgit v1.2.3 From 7c0d682687e9e79266573eeed73b50a3e2674e66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Viande?= Date: Fri, 15 Jun 2018 11:30:54 +0200 Subject: Code Style --- src/Wallabag/CoreBundle/Repository/EntryRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index c0818ca0..10389cc1 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -189,7 +189,7 @@ class EntryRepository extends EntityRepository $qb->orderBy('e.id', $order); } elseif ('updated' === $sort) { $qb->orderBy('e.updatedAt', $order); - } else if ('archived' === $sort) { + } elseif ('archived' === $sort) { $qb->orderBy('e.archivedAt', $order); } -- cgit v1.2.3 From 9007fe006286c63a7793326d9429792383ebd76d Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 21 Sep 2018 11:18:29 +0200 Subject: Sort archive page by archived at --- src/Wallabag/CoreBundle/Controller/EntryController.php | 2 -- src/Wallabag/CoreBundle/Repository/EntryRepository.php | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index b7fdea27..29400833 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -532,11 +532,9 @@ class EntryController extends Controller switch ($type) { case 'search': $qb = $repository->getBuilderForSearchByUser($this->getUser()->getId(), $searchTerm, $currentRoute); - break; case 'untagged': $qb = $repository->getBuilderForUntaggedByUser($this->getUser()->getId()); - break; case 'starred': $qb = $repository->getBuilderForStarredByUser($this->getUser()->getId()); diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 10389cc1..93c630c0 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -50,7 +50,7 @@ class EntryRepository extends EntityRepository public function getBuilderForArchiveByUser($userId) { return $this - ->getSortedQueryBuilderByUser($userId) + ->getSortedQueryBuilderByUser($userId, 'archivedAt', 'desc') ->andWhere('e.isArchived = true') ; } -- cgit v1.2.3 From a664a1d876174e9d61d8324039ee86d2b6bf164d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20HULARD?= Date: Tue, 23 Jan 2018 19:09:03 +0100 Subject: Rename Tag : Add a new FormType --- .../CoreBundle/Form/Type/RenameTagType.php | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/Wallabag/CoreBundle/Form/Type/RenameTagType.php (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Form/Type/RenameTagType.php b/src/Wallabag/CoreBundle/Form/Type/RenameTagType.php new file mode 100644 index 00000000..e6270048 --- /dev/null +++ b/src/Wallabag/CoreBundle/Form/Type/RenameTagType.php @@ -0,0 +1,35 @@ +add('label', TextType::class, [ + 'required' => true, + 'attr' => [ + 'placeholder' => 'tag.rename.placeholder', + ], + ]) + ; + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults([ + 'data_class' => 'Wallabag\CoreBundle\Entity\Tag', + ]); + } + + public function getBlockPrefix() + { + return 'tag'; + } +} -- cgit v1.2.3 From be326a22f90a5f4006ff41ee7b4ed0ca73a8fddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20HULARD?= Date: Wed, 24 Jan 2018 17:27:16 +0100 Subject: Create a new Tag action to rename tags. The current tag is removed from all the current logged user entries. Then the new one is created and attached. --- .../CoreBundle/Controller/TagController.php | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index b6d28e59..70b273e0 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php @@ -11,6 +11,7 @@ use Symfony\Component\HttpFoundation\Request; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Tag; use Wallabag\CoreBundle\Form\Type\NewTagType; +use Wallabag\CoreBundle\Form\Type\RenameTagType; class TagController extends Controller { @@ -130,4 +131,48 @@ class TagController extends Controller 'tag' => $tag, ]); } + + /** + * Rename a given tag with a new label + * Create a new tag with the new name and drop the old one. + * + * @param Tag $tag + * @param Request $request + * + * @Route("/tag/rename/{slug}", name="tag_rename") + * @ParamConverter("tag", options={"mapping": {"slug": "slug"}}) + * + * @return \Symfony\Component\HttpFoundation\Response + */ + public function renameTagAction(Tag $tag, Request $request) + { + $form = $this->createForm(RenameTagType::class, new Tag()); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $entries = $this->get('wallabag_core.entry_repository')->findAllByTagId( + $this->getUser()->getId(), + $tag->getId() + ); + foreach ($entries as $entry) { + $this->get('wallabag_core.tags_assigner')->assignTagsToEntry( + $entry, + $form->get('label')->getData() + ); + $entry->removeTag($tag); + } + + $em = $this->getDoctrine()->getManager(); + $em->flush(); + } + + $this->get('session')->getFlashBag()->add( + 'notice', + 'flashes.tag.notice.tag_renamed' + ); + + $redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'), '', true); + + return $this->redirect($redirectUrl); + } } -- cgit v1.2.3 From b846c1e4d03ec51ae6b740040d79d47d9bdec12c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20HULARD?= Date: Wed, 24 Jan 2018 18:04:39 +0100 Subject: Add RenameForm as tag list view parameters. This will help handling the CSRF protection token and use symfony HTML generation layer. Also a FormView instance is generated for each tag because we need to render a form for each tag and FormView are not reusable. --- src/Wallabag/CoreBundle/Controller/TagController.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index 70b273e0..a041510d 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php @@ -88,8 +88,14 @@ class TagController extends Controller $tags = $this->get('wallabag_core.tag_repository') ->findAllFlatTagsWithNbEntries($this->getUser()->getId()); + $renameForms = []; + foreach ($tags as $tag) { + $renameForms[$tag['id']] = $this->createForm(RenameTagType::class, new Tag())->createView(); + } + return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [ 'tags' => $tags, + 'renameForms' => $renameForms, ]); } -- cgit v1.2.3 From 9b0aef9171389aa9cdc39e8434df0f912ee5bdae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20HULARD?= Date: Wed, 24 Jan 2018 17:29:26 +0100 Subject: Update tag list template to allow renaming. * Add a form on each tag to handle rename action. * Add JavaScript to handle action on the corresponding page inside the global index.js file. * Add support for the 2 active themes : material / baggy The form solution is cleaner than an Ajax one because it let the browser validate input data and make the POST easier without the need to handle JSON response. --- .../Resources/views/themes/baggy/Tag/tags.html.twig | 18 +++++++++++++++--- .../Resources/views/themes/material/Tag/tags.html.twig | 13 ++++++++++++- 2 files changed, 27 insertions(+), 4 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig index 070d5629..35351ab1 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig @@ -10,10 +10,22 @@ diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig index c15b5146..21e88a9a 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig @@ -13,7 +13,18 @@
    {% for tag in tags %}
  • - {{tag.label}} ({{ tag.nbEntries }}) + + {{ tag.label }} ({{ tag.nbEntries }}) + + {% if renameForms is defined and renameForms[tag.id] is defined %} + + + mode_edit + + {% endif %} {% if app.user.config.rssToken %} rss_feed {% endif %} -- cgit v1.2.3 From 559f708cae6143564284034369771737119a6bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20HULARD?= Date: Wed, 24 Jan 2018 17:29:41 +0100 Subject: Add translations about latest Tag changes. Add new translations in each language file. --- src/Wallabag/CoreBundle/Resources/translations/messages.da.yml | 3 +++ src/Wallabag/CoreBundle/Resources/translations/messages.de.yml | 3 +++ src/Wallabag/CoreBundle/Resources/translations/messages.en.yml | 3 +++ src/Wallabag/CoreBundle/Resources/translations/messages.es.yml | 3 +++ src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml | 3 +++ src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml | 3 +++ src/Wallabag/CoreBundle/Resources/translations/messages.it.yml | 3 +++ src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml | 3 +++ src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml | 3 +++ src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml | 3 +++ src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml | 3 +++ src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml | 5 ++++- src/Wallabag/CoreBundle/Resources/translations/messages.th.yml | 3 +++ src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml | 3 +++ 14 files changed, 43 insertions(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index e1384675..c8500ad3 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -399,6 +399,8 @@ tag: new: # add: 'Add' # placeholder: 'You can add several tags, separated by a comma.' + rename: + # placeholder: 'You can update tag name.' # export: # footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' @@ -585,6 +587,7 @@ flashes: tag: notice: # tag_added: 'Tag added' + # tag_renamed: 'Tag renamed' import: notice: # failed: 'Import failed, please try again.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index c297ffb5..888d9b39 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -399,6 +399,8 @@ tag: new: add: 'Hinzufügen' placeholder: 'Du kannst verschiedene Tags, getrennt von einem Komma, hinzufügen.' + rename: + # placeholder: 'You can update tag name.' export: footer_template: '

    Generiert von wallabag mit Hilfe von %method%

    Bitte öffne ein Ticket wenn du ein Problem mit der Darstellung von diesem E-Book auf deinem Gerät hast.

    ' @@ -585,6 +587,7 @@ flashes: tag: notice: tag_added: 'Tag hinzugefügt' + #tag_renamed: 'Tag renamed' import: notice: failed: 'Import fehlgeschlagen, bitte erneut probieren.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index bd81c72f..827bf770 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -399,6 +399,8 @@ tag: new: add: 'Add' placeholder: 'You can add several tags, separated by a comma.' + rename: + placeholder: 'You can update tag name.' export: footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' @@ -585,6 +587,7 @@ flashes: tag: notice: tag_added: 'Tag added' + tag_renamed: 'Tag renamed' import: notice: failed: 'Import failed, please try again.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 700190a6..e5878f2c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -399,6 +399,8 @@ tag: new: add: 'Añadir' placeholder: 'Puedes añadir varias etiquetas, separadas por una coma.' + rename: + # placeholder: 'You can update tag name.' # export: # footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' @@ -585,6 +587,7 @@ flashes: tag: notice: tag_added: 'Etiqueta añadida' + # tag_renamed: 'Tag renamed' import: notice: failed: 'Importación fallida, por favor, inténtelo de nuevo.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index 83645933..2e922358 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -399,6 +399,8 @@ tag: new: # add: 'Add' # placeholder: 'You can add several tags, separated by a comma.' + rename: + # placeholder: 'You can update tag name.' # export: # footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' @@ -585,6 +587,7 @@ flashes: tag: notice: tag_added: 'برچسب افزوده شد' + # tag_renamed: 'Tag renamed' import: notice: failed: 'درون‌ریزی شکست خورد. لطفاً دوباره تلاش کنید.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index edf29654..cf5031d3 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -399,6 +399,8 @@ tag: new: add: "Ajouter" placeholder: "Vous pouvez ajouter plusieurs tags, séparés par une virgule." + rename: + placeholder: 'Vous pouvez changer le nom de votre tag.' export: footer_template: '

    Généré par wallabag with %method%

    Merci d''ouvrir un ticket si vous rencontrez des soucis d''affichage avec ce document sur votre support.

    ' @@ -585,6 +587,7 @@ flashes: tag: notice: tag_added: "Tag ajouté" + tag_renamed: "Tag renommé" import: notice: failed: "L’import a échoué, veuillez ré-essayer" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 47292116..1563703a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -399,6 +399,8 @@ tag: new: add: 'Aggiungi' placeholder: 'Puoi aggiungere varie etichette, separate da una virgola.' + rename: + # placeholder: 'You can update tag name.' # export: # footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' @@ -585,6 +587,7 @@ flashes: tag: notice: tag_added: 'Etichetta aggiunta' + # tag_renamed: 'Tag renamed' import: notice: failed: 'Importazione fallita, riprova.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 95bc9560..9e9f8a2f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -399,6 +399,8 @@ tag: new: add: 'Ajustar' placeholder: "Podètz ajustar mai qu'una etiqueta, separadas per de virgula." + rename: + # placeholder: 'You can update tag name.' export: footer_template: '

    Produch per wallabag amb %method%

    Mercés de dobrir una sollicitacion s’avètz de problèmas amb l’afichatge d’aqueste E-Book sus vòstre periferic.

    ' @@ -585,6 +587,7 @@ flashes: tag: notice: tag_added: 'Etiqueta ajustada' + # tag_renamed: 'Tag renamed' import: notice: failed: "L'importacion a fracassat, mercés de tornar ensajar." diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index a64e60b0..4e2238d2 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -399,6 +399,8 @@ tag: new: add: 'Dodaj' placeholder: 'Możesz dodać kilka tagów, oddzielając je przecinkami.' + rename: + # placeholder: 'You can update tag name.' export: footer_template: '

    Stworzone przez wallabag z %method%

    Proszę zgłoś sprawę, jeżeli masz problem z wyświetleniem tego e-booka na swoim urządzeniu.

    ' @@ -585,6 +587,7 @@ flashes: tag: notice: tag_added: 'Tag dodany' + # tag_renamed: 'Tag renamed' import: notice: failed: 'Nieudany import, prosimy spróbować ponownie.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 7aef9694..127b425e 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -399,6 +399,8 @@ tag: new: # add: 'Add' # placeholder: 'You can add several tags, separated by a comma.' + rename: + # placeholder: 'You can update tag name.' # export: # footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' @@ -585,6 +587,7 @@ flashes: tag: notice: tag_added: 'Tag adicionada' + # tag_renamed: 'Tag renamed' import: notice: failed: 'Importação falhou, por favor tente novamente.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index 9b7068c6..e68a91ec 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -399,6 +399,8 @@ tag: new: # add: 'Add' # placeholder: 'You can add several tags, separated by a comma.' + rename: + # placeholder: 'You can update tag name.' # export: # footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' @@ -585,6 +587,7 @@ flashes: tag: notice: # tag_added: 'Tag added' + # tag_renamed: 'Tag renamed' import: notice: # failed: 'Import failed, please try again.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index 5f210c93..d713f13f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -387,6 +387,8 @@ tag: new: add: 'Добавить' placeholder: 'Вы можете добавить несколько тегов, разделенных запятой.' + rename: + # placeholder: 'You can update tag name.' import: page_title: 'Импорт' @@ -547,6 +549,7 @@ flashes: tag: notice: tag_added: 'Тег добавлен' + # tag_renamed: 'Tag renamed' import: notice: failed: 'Во время импорта произошла ошибка, повторите попытку.' @@ -564,4 +567,4 @@ flashes: notice: added: 'Пользователь "%username%" добавлен' updated: 'Пользователь "%username%" обновлен' - deleted: 'Пользователь "%username%" удален' \ No newline at end of file + deleted: 'Пользователь "%username%" удален' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index 9d22f90d..78e0f0ee 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -397,6 +397,8 @@ tag: new: add: 'เพิ่ม' placeholder: 'คุณสามารถเพิ่มได้หลายแท็ก, จากการแบ่งโดย comma' + rename: + # placeholder: 'You can update tag name.' export: footer_template: '

    ผลิตโดย wallabag กับ %method%

    ให้ทำการเปิด ฉบับนี้ ถ้าคุณมีข้อบกพร่องif you have trouble with the display of this E-Book on your device.

    ' @@ -583,6 +585,7 @@ flashes: tag: notice: tag_added: 'แท็กที่เพิ่ม' + # tag_renamed: 'Tag renamed' import: notice: failed: 'นำข้อมูลเข้าล้มเหลว, ลองใหม่อีกครั้ง' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 5c95fe63..c48a885f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -397,6 +397,8 @@ tag: new: # add: 'Add' # placeholder: 'You can add several tags, separated by a comma.' + rename: + # placeholder: 'You can update tag name.' # export: # footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' @@ -563,6 +565,7 @@ flashes: tag: notice: tag_added: 'Etiket eklendi' + # tag_renamed: 'Tag renamed' import: notice: # failed: 'Import failed, please try again.' -- cgit v1.2.3 From 115de64e5bb9d7f9151ecf15e15a0d988563528e Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 4 Oct 2018 14:07:20 +0200 Subject: Jump to Symfony 3.4 Thanks to the BC compatibility, almost nothing have to be changed. All changes are related to new bundle version of: - SensioFrameworkExtraBundle - DoctrineFixturesBundle --- .../ApiBundle/Controller/DeveloperController.php | 2 +- .../CoreBundle/Controller/ConfigController.php | 2 +- .../CoreBundle/Controller/EntryController.php | 2 +- .../CoreBundle/Controller/ExportController.php | 2 +- .../CoreBundle/Controller/RssController.php | 2 +- .../Controller/SiteCredentialController.php | 15 ++++------- .../CoreBundle/Controller/StaticController.php | 2 +- .../CoreBundle/Controller/TagController.php | 2 +- .../CoreBundle/Resources/config/services.yml | 29 ++++++++++++++++++++++ .../ImportBundle/Controller/BrowserController.php | 2 +- .../ImportBundle/Controller/ChromeController.php | 2 +- .../ImportBundle/Controller/FirefoxController.php | 2 +- .../ImportBundle/Controller/ImportController.php | 2 +- .../Controller/InstapaperController.php | 2 +- .../ImportBundle/Controller/PinboardController.php | 2 +- .../ImportBundle/Controller/PocketController.php | 2 +- .../Controller/ReadabilityController.php | 2 +- .../Controller/WallabagV1Controller.php | 2 +- .../Controller/WallabagV2Controller.php | 2 +- .../ImportBundle/Resources/config/services.yml | 8 ++++++ .../UserBundle/Controller/ManageController.php | 12 +++------ 21 files changed, 63 insertions(+), 35 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/DeveloperController.php b/src/Wallabag/ApiBundle/Controller/DeveloperController.php index c7178017..ae7e83da 100644 --- a/src/Wallabag/ApiBundle/Controller/DeveloperController.php +++ b/src/Wallabag/ApiBundle/Controller/DeveloperController.php @@ -2,9 +2,9 @@ namespace Wallabag\ApiBundle\Controller; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; use Wallabag\ApiBundle\Entity\Client; use Wallabag\ApiBundle\Form\Type\ClientType; diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index b999c539..242f557f 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -2,12 +2,12 @@ namespace Wallabag\CoreBundle\Controller; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; +use Symfony\Component\Routing\Annotation\Route; use Wallabag\CoreBundle\Entity\Config; use Wallabag\CoreBundle\Entity\TaggingRule; use Wallabag\CoreBundle\Form\Type\ChangePasswordType; diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 29400833..ac372a33 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -5,9 +5,9 @@ namespace Wallabag\CoreBundle\Controller; use Pagerfanta\Adapter\DoctrineORMAdapter; use Pagerfanta\Exception\OutOfRangeCurrentPageException; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Event\EntryDeletedEvent; diff --git a/src/Wallabag/CoreBundle/Controller/ExportController.php b/src/Wallabag/CoreBundle/Controller/ExportController.php index 7ca89239..0d2b15c5 100644 --- a/src/Wallabag/CoreBundle/Controller/ExportController.php +++ b/src/Wallabag/CoreBundle/Controller/ExportController.php @@ -2,10 +2,10 @@ namespace Wallabag\CoreBundle\Controller; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\Routing\Annotation\Route; use Wallabag\CoreBundle\Entity\Entry; /** diff --git a/src/Wallabag/CoreBundle/Controller/RssController.php b/src/Wallabag/CoreBundle/Controller/RssController.php index 848bb814..1c831c03 100644 --- a/src/Wallabag/CoreBundle/Controller/RssController.php +++ b/src/Wallabag/CoreBundle/Controller/RssController.php @@ -7,10 +7,10 @@ use Pagerfanta\Adapter\DoctrineORMAdapter; use Pagerfanta\Exception\OutOfRangeCurrentPageException; use Pagerfanta\Pagerfanta; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Wallabag\CoreBundle\Entity\Tag; use Wallabag\UserBundle\Entity\User; diff --git a/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php b/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php index 548de744..51bc1d94 100644 --- a/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php +++ b/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php @@ -2,10 +2,9 @@ namespace Wallabag\CoreBundle\Controller; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; use Wallabag\CoreBundle\Entity\SiteCredential; use Wallabag\UserBundle\Entity\User; @@ -19,8 +18,7 @@ class SiteCredentialController extends Controller /** * Lists all User entities. * - * @Route("/", name="site_credentials_index") - * @Method("GET") + * @Route("/", name="site_credentials_index", methods={"GET"}) */ public function indexAction() { @@ -36,8 +34,7 @@ class SiteCredentialController extends Controller /** * Creates a new site credential entity. * - * @Route("/new", name="site_credentials_new") - * @Method({"GET", "POST"}) + * @Route("/new", name="site_credentials_new", methods={"GET", "POST"}) * * @param Request $request * @@ -77,8 +74,7 @@ class SiteCredentialController extends Controller /** * Displays a form to edit an existing site credential entity. * - * @Route("/{id}/edit", name="site_credentials_edit") - * @Method({"GET", "POST"}) + * @Route("/{id}/edit", name="site_credentials_edit", methods={"GET", "POST"}) * * @param Request $request * @param SiteCredential $siteCredential @@ -121,8 +117,7 @@ class SiteCredentialController extends Controller /** * Deletes a site credential entity. * - * @Route("/{id}", name="site_credentials_delete") - * @Method("DELETE") + * @Route("/{id}", name="site_credentials_delete", methods={"DELETE"}) * * @param Request $request * @param SiteCredential $siteCredential diff --git a/src/Wallabag/CoreBundle/Controller/StaticController.php b/src/Wallabag/CoreBundle/Controller/StaticController.php index 318af303..fa760c14 100644 --- a/src/Wallabag/CoreBundle/Controller/StaticController.php +++ b/src/Wallabag/CoreBundle/Controller/StaticController.php @@ -2,8 +2,8 @@ namespace Wallabag\CoreBundle\Controller; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Component\Routing\Annotation\Route; class StaticController extends Controller { diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index b6d28e59..15f06ff5 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php @@ -5,9 +5,9 @@ namespace Wallabag\CoreBundle\Controller; use Pagerfanta\Adapter\ArrayAdapter; use Pagerfanta\Exception\OutOfRangeCurrentPageException; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Tag; use Wallabag\CoreBundle\Form\Type\NewTagType; diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml index 85306276..a27dd210 100644 --- a/src/Wallabag/CoreBundle/Resources/config/services.yml +++ b/src/Wallabag/CoreBundle/Resources/config/services.yml @@ -181,6 +181,7 @@ services: wallabag_core.exception_controller: class: Wallabag\CoreBundle\Controller\ExceptionController + public: true arguments: - '@twig' - '%kernel.debug%' @@ -218,3 +219,31 @@ services: arguments: - "%wallabag_core.site_credentials.encryption_key_path%" - "@logger" + + wallabag_core.command.clean_duplicates: + class: Wallabag\CoreBundle\Command\CleanDuplicatesCommand + tags: ['console.command'] + + wallabag_core.command.export: + class: Wallabag\CoreBundle\Command\ExportCommand + tags: ['console.command'] + + wallabag_core.command.install: + class: Wallabag\CoreBundle\Command\InstallCommand + tags: ['console.command'] + + wallabag_core.command.list_user: + class: Wallabag\CoreBundle\Command\ListUserCommand + tags: ['console.command'] + + wallabag_core.command.reload_entry: + class: Wallabag\CoreBundle\Command\ReloadEntryCommand + tags: ['console.command'] + + wallabag_core.command.show_user: + class: Wallabag\CoreBundle\Command\ShowUserCommand + tags: ['console.command'] + + wallabag_core.command.tag_all: + class: Wallabag\CoreBundle\Command\TagAllCommand + tags: ['console.command'] diff --git a/src/Wallabag/ImportBundle/Controller/BrowserController.php b/src/Wallabag/ImportBundle/Controller/BrowserController.php index 6418925c..58d2a730 100644 --- a/src/Wallabag/ImportBundle/Controller/BrowserController.php +++ b/src/Wallabag/ImportBundle/Controller/BrowserController.php @@ -2,10 +2,10 @@ namespace Wallabag\ImportBundle\Controller; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Routing\Annotation\Route; use Wallabag\ImportBundle\Form\Type\UploadImportType; abstract class BrowserController extends Controller diff --git a/src/Wallabag/ImportBundle/Controller/ChromeController.php b/src/Wallabag/ImportBundle/Controller/ChromeController.php index 0cb418a1..6628cdb0 100644 --- a/src/Wallabag/ImportBundle/Controller/ChromeController.php +++ b/src/Wallabag/ImportBundle/Controller/ChromeController.php @@ -2,8 +2,8 @@ namespace Wallabag\ImportBundle\Controller; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; class ChromeController extends BrowserController { diff --git a/src/Wallabag/ImportBundle/Controller/FirefoxController.php b/src/Wallabag/ImportBundle/Controller/FirefoxController.php index 88697f9d..dce8455f 100644 --- a/src/Wallabag/ImportBundle/Controller/FirefoxController.php +++ b/src/Wallabag/ImportBundle/Controller/FirefoxController.php @@ -2,8 +2,8 @@ namespace Wallabag\ImportBundle\Controller; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; class FirefoxController extends BrowserController { diff --git a/src/Wallabag/ImportBundle/Controller/ImportController.php b/src/Wallabag/ImportBundle/Controller/ImportController.php index 7e4fd174..fbd7434e 100644 --- a/src/Wallabag/ImportBundle/Controller/ImportController.php +++ b/src/Wallabag/ImportBundle/Controller/ImportController.php @@ -2,8 +2,8 @@ namespace Wallabag\ImportBundle\Controller; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Component\Routing\Annotation\Route; class ImportController extends Controller { diff --git a/src/Wallabag/ImportBundle/Controller/InstapaperController.php b/src/Wallabag/ImportBundle/Controller/InstapaperController.php index f184baf9..faed3b72 100644 --- a/src/Wallabag/ImportBundle/Controller/InstapaperController.php +++ b/src/Wallabag/ImportBundle/Controller/InstapaperController.php @@ -2,9 +2,9 @@ namespace Wallabag\ImportBundle\Controller; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; use Wallabag\ImportBundle\Form\Type\UploadImportType; class InstapaperController extends Controller diff --git a/src/Wallabag/ImportBundle/Controller/PinboardController.php b/src/Wallabag/ImportBundle/Controller/PinboardController.php index 6f54c69a..cc6fae79 100644 --- a/src/Wallabag/ImportBundle/Controller/PinboardController.php +++ b/src/Wallabag/ImportBundle/Controller/PinboardController.php @@ -2,9 +2,9 @@ namespace Wallabag\ImportBundle\Controller; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; use Wallabag\ImportBundle\Form\Type\UploadImportType; class PinboardController extends Controller diff --git a/src/Wallabag/ImportBundle/Controller/PocketController.php b/src/Wallabag/ImportBundle/Controller/PocketController.php index 9f28819a..71ceb427 100644 --- a/src/Wallabag/ImportBundle/Controller/PocketController.php +++ b/src/Wallabag/ImportBundle/Controller/PocketController.php @@ -2,10 +2,10 @@ namespace Wallabag\ImportBundle\Controller; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; class PocketController extends Controller diff --git a/src/Wallabag/ImportBundle/Controller/ReadabilityController.php b/src/Wallabag/ImportBundle/Controller/ReadabilityController.php index 729a97a3..b120ef96 100644 --- a/src/Wallabag/ImportBundle/Controller/ReadabilityController.php +++ b/src/Wallabag/ImportBundle/Controller/ReadabilityController.php @@ -2,9 +2,9 @@ namespace Wallabag\ImportBundle\Controller; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; use Wallabag\ImportBundle\Form\Type\UploadImportType; class ReadabilityController extends Controller diff --git a/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php b/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php index d700d8a8..e1c35343 100644 --- a/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php +++ b/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php @@ -2,8 +2,8 @@ namespace Wallabag\ImportBundle\Controller; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; class WallabagV1Controller extends WallabagController { diff --git a/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php b/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php index ab26400c..c4116c1d 100644 --- a/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php +++ b/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php @@ -2,8 +2,8 @@ namespace Wallabag\ImportBundle\Controller; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; class WallabagV2Controller extends WallabagController { diff --git a/src/Wallabag/ImportBundle/Resources/config/services.yml b/src/Wallabag/ImportBundle/Resources/config/services.yml index b224a6a2..2dd7dff8 100644 --- a/src/Wallabag/ImportBundle/Resources/config/services.yml +++ b/src/Wallabag/ImportBundle/Resources/config/services.yml @@ -112,3 +112,11 @@ services: - [ setLogger, [ "@logger" ]] tags: - { name: wallabag_import.import, alias: chrome } + + wallabag_import.command.import: + class: Wallabag\ImportBundle\Command\ImportCommand + tags: ['console.command'] + + wallabag_import.command.redis_worker: + class: Wallabag\ImportBundle\Command\RedisWorkerCommand + tags: ['console.command'] diff --git a/src/Wallabag/UserBundle/Controller/ManageController.php b/src/Wallabag/UserBundle/Controller/ManageController.php index f3de656f..a9746fb4 100644 --- a/src/Wallabag/UserBundle/Controller/ManageController.php +++ b/src/Wallabag/UserBundle/Controller/ManageController.php @@ -7,10 +7,9 @@ use FOS\UserBundle\FOSUserEvents; use Pagerfanta\Adapter\DoctrineORMAdapter; use Pagerfanta\Exception\OutOfRangeCurrentPageException; use Pagerfanta\Pagerfanta; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Form\SearchUserType; @@ -22,8 +21,7 @@ class ManageController extends Controller /** * Creates a new User entity. * - * @Route("/new", name="user_new") - * @Method({"GET", "POST"}) + * @Route("/new", name="user_new", methods={"GET", "POST"}) */ public function newAction(Request $request) { @@ -60,8 +58,7 @@ class ManageController extends Controller /** * Displays a form to edit an existing User entity. * - * @Route("/{id}/edit", name="user_edit") - * @Method({"GET", "POST"}) + * @Route("/{id}/edit", name="user_edit", methods={"GET", "POST"}) */ public function editAction(Request $request, User $user) { @@ -93,8 +90,7 @@ class ManageController extends Controller /** * Deletes a User entity. * - * @Route("/{id}", name="user_delete") - * @Method("DELETE") + * @Route("/{id}", name="user_delete", methods={"DELETE"}) */ public function deleteAction(Request $request, User $user) { -- cgit v1.2.3 From be417ef23685e17a239b1d192a0e9b9f484f1bfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 12 Jun 2017 17:23:35 +0200 Subject: Added possibility to change locale from login/register pages --- .../CoreBundle/Controller/ConfigController.php | 19 +++++++++++++++++++ .../UserBundle/EventListener/CreateConfigListener.php | 7 +++++-- src/Wallabag/UserBundle/Resources/config/services.yml | 1 + .../views/Registration/register_content.html.twig | 1 - .../UserBundle/Resources/views/layout.html.twig | 5 +++++ 5 files changed, 30 insertions(+), 3 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index 242f557f..99576fbb 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -329,6 +329,25 @@ class ConfigController extends Controller return $this->redirect($request->headers->get('referer')); } + /** + * Change the locale for the current user. + * + * @param Request $request + * @param string $language + * + * @Route("/locale/{language}", name="changeLocale") + * + * @return \Symfony\Component\HttpFoundation\RedirectResponse + */ + public function setLocaleAction(Request $request, $language = null) + { + if (null !== $language) { + $this->get('session')->set('_locale', $language); + } + + return $this->redirect($request->headers->get('referer')); + } + /** * Remove all tags for given tags and a given user and cleanup orphan tags. * diff --git a/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php b/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php index e4d55c19..5cabfd35 100644 --- a/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php +++ b/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php @@ -6,6 +6,7 @@ use Doctrine\ORM\EntityManager; use FOS\UserBundle\Event\UserEvent; use FOS\UserBundle\FOSUserEvents; use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\HttpFoundation\Session\Session; use Wallabag\CoreBundle\Entity\Config; /** @@ -22,8 +23,9 @@ class CreateConfigListener implements EventSubscriberInterface private $readingSpeed; private $actionMarkAsRead; private $listMode; + private $session; - public function __construct(EntityManager $em, $theme, $itemsOnPage, $rssLimit, $language, $readingSpeed, $actionMarkAsRead, $listMode) + public function __construct(EntityManager $em, $theme, $itemsOnPage, $rssLimit, $language, $readingSpeed, $actionMarkAsRead, $listMode, Session $session) { $this->em = $em; $this->theme = $theme; @@ -33,6 +35,7 @@ class CreateConfigListener implements EventSubscriberInterface $this->readingSpeed = $readingSpeed; $this->actionMarkAsRead = $actionMarkAsRead; $this->listMode = $listMode; + $this->session = $session; } public static function getSubscribedEvents() @@ -52,7 +55,7 @@ class CreateConfigListener implements EventSubscriberInterface $config->setTheme($this->theme); $config->setItemsPerPage($this->itemsOnPage); $config->setRssLimit($this->rssLimit); - $config->setLanguage($this->language); + $config->setLanguage($this->session->get('_locale', $this->language)); $config->setReadingSpeed($this->readingSpeed); $config->setActionMarkAsRead($this->actionMarkAsRead); $config->setListMode($this->listMode); diff --git a/src/Wallabag/UserBundle/Resources/config/services.yml b/src/Wallabag/UserBundle/Resources/config/services.yml index d3925de3..72cda3f8 100644 --- a/src/Wallabag/UserBundle/Resources/config/services.yml +++ b/src/Wallabag/UserBundle/Resources/config/services.yml @@ -33,6 +33,7 @@ services: - "%wallabag_core.reading_speed%" - "%wallabag_core.action_mark_as_read%" - "%wallabag_core.list_mode%" + - "@session" tags: - { name: kernel.event_subscriber } diff --git a/src/Wallabag/UserBundle/Resources/views/Registration/register_content.html.twig b/src/Wallabag/UserBundle/Resources/views/Registration/register_content.html.twig index d0a85fc7..85cd4f0d 100644 --- a/src/Wallabag/UserBundle/Resources/views/Registration/register_content.html.twig +++ b/src/Wallabag/UserBundle/Resources/views/Registration/register_content.html.twig @@ -3,7 +3,6 @@ {{ form_start(form, {'method': 'post', 'action': path('fos_user_registration_register'), 'attr': {'class': 'fos_user_registration_register'}}) }}
    - {{ form_widget(form._token) }} {% for flashMessage in app.session.flashbag.get('notice') %} diff --git a/src/Wallabag/UserBundle/Resources/views/layout.html.twig b/src/Wallabag/UserBundle/Resources/views/layout.html.twig index 99bf7dfd..6934c686 100644 --- a/src/Wallabag/UserBundle/Resources/views/layout.html.twig +++ b/src/Wallabag/UserBundle/Resources/views/layout.html.twig @@ -15,6 +15,11 @@ {% block fos_user_content %} {% endblock fos_user_content %}
    +
    {% endblock %} -- cgit v1.2.3 From 4d4147b228ac90f329fd2d40dd4fb60cb980328a Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 13 Oct 2018 09:24:39 +0200 Subject: Ensure language is valid - Do not override locale if user has choosen a locale from the login screen. - Add some tests about locale url --- src/Wallabag/CoreBundle/Controller/ConfigController.php | 9 ++++++--- src/Wallabag/CoreBundle/Event/Listener/UserLocaleListener.php | 8 +++++--- src/Wallabag/UserBundle/Resources/views/layout.html.twig | 4 ++-- 3 files changed, 13 insertions(+), 8 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index 99576fbb..be6feb7c 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -8,6 +8,7 @@ use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Validator\Constraints\Locale as LocaleConstraint; use Wallabag\CoreBundle\Entity\Config; use Wallabag\CoreBundle\Entity\TaggingRule; use Wallabag\CoreBundle\Form\Type\ChangePasswordType; @@ -341,11 +342,13 @@ class ConfigController extends Controller */ public function setLocaleAction(Request $request, $language = null) { - if (null !== $language) { - $this->get('session')->set('_locale', $language); + $errors = $this->get('validator')->validate($language, (new LocaleConstraint())); + + if (0 === \count($errors)) { + $request->getSession()->set('_locale', $language); } - return $this->redirect($request->headers->get('referer')); + return $this->redirect($request->headers->get('referer', $this->generateUrl('homepage'))); } /** diff --git a/src/Wallabag/CoreBundle/Event/Listener/UserLocaleListener.php b/src/Wallabag/CoreBundle/Event/Listener/UserLocaleListener.php index 367cdfb0..dc1db5c7 100644 --- a/src/Wallabag/CoreBundle/Event/Listener/UserLocaleListener.php +++ b/src/Wallabag/CoreBundle/Event/Listener/UserLocaleListener.php @@ -6,8 +6,10 @@ use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; /** - * Stores the locale of the user in the session after the - * login. This can be used by the LocaleListener afterwards. + * Stores the locale of the user in the session after the login. + * If no locale are defined (if user doesn't change it from the login screen), override it with the user's config one. + * + * This can be used by the LocaleListener afterwards. * * @see http://symfony.com/doc/master/cookbook/session/locale_sticky_session.html */ @@ -30,7 +32,7 @@ class UserLocaleListener { $user = $event->getAuthenticationToken()->getUser(); - if (null !== $user->getConfig()->getLanguage()) { + if (null !== $user->getConfig()->getLanguage() && null === $this->session->get('_locale')) { $this->session->set('_locale', $user->getConfig()->getLanguage()); } } diff --git a/src/Wallabag/UserBundle/Resources/views/layout.html.twig b/src/Wallabag/UserBundle/Resources/views/layout.html.twig index 6934c686..b53f8746 100644 --- a/src/Wallabag/UserBundle/Resources/views/layout.html.twig +++ b/src/Wallabag/UserBundle/Resources/views/layout.html.twig @@ -16,8 +16,8 @@ {% endblock fos_user_content %} -- cgit v1.2.3 From 0f159f8fc1dea68552dbfa845fa9a24a95953018 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 24 Oct 2018 20:33:46 +0200 Subject: Fix RulerZBundle People should really follow semver and provide UPGRADE file when they provide a library ... --- src/Wallabag/CoreBundle/Entity/TaggingRule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Entity/TaggingRule.php b/src/Wallabag/CoreBundle/Entity/TaggingRule.php index 84e11e26..c1be3165 100644 --- a/src/Wallabag/CoreBundle/Entity/TaggingRule.php +++ b/src/Wallabag/CoreBundle/Entity/TaggingRule.php @@ -3,7 +3,7 @@ namespace Wallabag\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; -use KPhoen\RulerZBundle\Validator\Constraints as RulerZAssert; +use Symfony\Bridge\RulerZ\Validator\Constraints as RulerZAssert; use Symfony\Component\Validator\Constraints as Assert; /** -- cgit v1.2.3 From 6fc95673df5349d682eb6ca6185f894eb711d13a Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 24 Oct 2018 21:02:35 +0200 Subject: Cleanup --- src/Wallabag/CoreBundle/Doctrine/WallabagMigration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Doctrine/WallabagMigration.php b/src/Wallabag/CoreBundle/Doctrine/WallabagMigration.php index 7aa2409a..4a3fef3b 100644 --- a/src/Wallabag/CoreBundle/Doctrine/WallabagMigration.php +++ b/src/Wallabag/CoreBundle/Doctrine/WallabagMigration.php @@ -2,8 +2,8 @@ namespace Wallabag\CoreBundle\Doctrine; -use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; -- cgit v1.2.3 From db9b6d8d0d9f943fe321ea690701662dac828e94 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 26 Nov 2018 20:00:01 +0100 Subject: Update fixtures --- .../DataFixtures/AnnotationFixtures.php | 50 +++++++++ .../DataFixtures/ORM/LoadAnnotationData.php | 45 -------- .../CoreBundle/DataFixtures/ConfigFixtures.php | 70 ++++++++++++ .../CoreBundle/DataFixtures/EntryFixtures.php | 123 +++++++++++++++++++++ .../CoreBundle/DataFixtures/ORM/LoadConfigData.php | 67 ----------- .../CoreBundle/DataFixtures/ORM/LoadEntryData.php | 119 -------------------- .../DataFixtures/ORM/LoadSettingData.php | 47 -------- .../DataFixtures/ORM/LoadSiteCredentialData.php | 34 ------ .../CoreBundle/DataFixtures/ORM/LoadTagData.php | 55 --------- .../DataFixtures/ORM/LoadTaggingRuleData.php | 56 ---------- .../CoreBundle/DataFixtures/SettingFixtures.php | 39 +++++++ .../DataFixtures/SiteCredentialFixtures.php | 37 +++++++ .../CoreBundle/DataFixtures/TagFixtures.php | 47 ++++++++ .../DataFixtures/TaggingRuleFixtures.php | 58 ++++++++++ .../UserBundle/DataFixtures/ORM/LoadUserData.php | 61 ---------- .../UserBundle/DataFixtures/UserFixtures.php | 52 +++++++++ 16 files changed, 476 insertions(+), 484 deletions(-) create mode 100644 src/Wallabag/AnnotationBundle/DataFixtures/AnnotationFixtures.php delete mode 100644 src/Wallabag/AnnotationBundle/DataFixtures/ORM/LoadAnnotationData.php create mode 100644 src/Wallabag/CoreBundle/DataFixtures/ConfigFixtures.php create mode 100644 src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php delete mode 100644 src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php delete mode 100644 src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php delete mode 100644 src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php delete mode 100644 src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php delete mode 100644 src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php delete mode 100644 src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php create mode 100644 src/Wallabag/CoreBundle/DataFixtures/SettingFixtures.php create mode 100644 src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php create mode 100644 src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php create mode 100644 src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php delete mode 100644 src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php create mode 100644 src/Wallabag/UserBundle/DataFixtures/UserFixtures.php (limited to 'src/Wallabag') diff --git a/src/Wallabag/AnnotationBundle/DataFixtures/AnnotationFixtures.php b/src/Wallabag/AnnotationBundle/DataFixtures/AnnotationFixtures.php new file mode 100644 index 00000000..ed46cea9 --- /dev/null +++ b/src/Wallabag/AnnotationBundle/DataFixtures/AnnotationFixtures.php @@ -0,0 +1,50 @@ +getReference('admin-user')); + $annotation1->setEntry($this->getReference('entry1')); + $annotation1->setText('This is my annotation /o/'); + $annotation1->setQuote('content'); + + $manager->persist($annotation1); + + $this->addReference('annotation1', $annotation1); + + $annotation2 = new Annotation($this->getReference('admin-user')); + $annotation2->setEntry($this->getReference('entry2')); + $annotation2->setText('This is my 2nd annotation /o/'); + $annotation2->setQuote('content'); + + $manager->persist($annotation2); + + $this->addReference('annotation2', $annotation2); + + $manager->flush(); + } + + /** + * {@inheritdoc} + */ + public function getDependencies() + { + return [ + EntryFixtures::class, + UserFixtures::class, + ]; + } +} diff --git a/src/Wallabag/AnnotationBundle/DataFixtures/ORM/LoadAnnotationData.php b/src/Wallabag/AnnotationBundle/DataFixtures/ORM/LoadAnnotationData.php deleted file mode 100644 index 20e07fa3..00000000 --- a/src/Wallabag/AnnotationBundle/DataFixtures/ORM/LoadAnnotationData.php +++ /dev/null @@ -1,45 +0,0 @@ -getReference('admin-user')); - $annotation1->setEntry($this->getReference('entry1')); - $annotation1->setText('This is my annotation /o/'); - $annotation1->setQuote('content'); - - $manager->persist($annotation1); - - $this->addReference('annotation1', $annotation1); - - $annotation2 = new Annotation($this->getReference('admin-user')); - $annotation2->setEntry($this->getReference('entry2')); - $annotation2->setText('This is my 2nd annotation /o/'); - $annotation2->setQuote('content'); - - $manager->persist($annotation2); - - $this->addReference('annotation2', $annotation2); - - $manager->flush(); - } - - /** - * {@inheritdoc} - */ - public function getOrder() - { - return 35; - } -} diff --git a/src/Wallabag/CoreBundle/DataFixtures/ConfigFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/ConfigFixtures.php new file mode 100644 index 00000000..c54e9f2c --- /dev/null +++ b/src/Wallabag/CoreBundle/DataFixtures/ConfigFixtures.php @@ -0,0 +1,70 @@ +getReference('admin-user')); + + $adminConfig->setTheme('material'); + $adminConfig->setItemsPerPage(30); + $adminConfig->setReadingSpeed(1); + $adminConfig->setLanguage('en'); + $adminConfig->setPocketConsumerKey('xxxxx'); + $adminConfig->setActionMarkAsRead(0); + $adminConfig->setListMode(0); + + $manager->persist($adminConfig); + + $this->addReference('admin-config', $adminConfig); + + $bobConfig = new Config($this->getReference('bob-user')); + $bobConfig->setTheme('default'); + $bobConfig->setItemsPerPage(10); + $bobConfig->setReadingSpeed(1); + $bobConfig->setLanguage('fr'); + $bobConfig->setPocketConsumerKey(null); + $bobConfig->setActionMarkAsRead(1); + $bobConfig->setListMode(1); + + $manager->persist($bobConfig); + + $this->addReference('bob-config', $bobConfig); + + $emptyConfig = new Config($this->getReference('empty-user')); + $emptyConfig->setTheme('material'); + $emptyConfig->setItemsPerPage(10); + $emptyConfig->setReadingSpeed(1); + $emptyConfig->setLanguage('en'); + $emptyConfig->setPocketConsumerKey(null); + $emptyConfig->setActionMarkAsRead(0); + $emptyConfig->setListMode(0); + + $manager->persist($emptyConfig); + + $this->addReference('empty-config', $emptyConfig); + + $manager->flush(); + } + + /** + * {@inheritdoc} + */ + public function getDependencies() + { + return [ + UserFixtures::class, + ]; + } +} diff --git a/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php new file mode 100644 index 00000000..0bd58487 --- /dev/null +++ b/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php @@ -0,0 +1,123 @@ +getReference('admin-user')); + $entry1->setUrl('http://0.0.0.0/entry1'); + $entry1->setReadingTime(11); + $entry1->setDomainName('domain.io'); + $entry1->setMimetype('text/html'); + $entry1->setTitle('test title entry1'); + $entry1->setContent('This is my content /o/'); + $entry1->setLanguage('en'); + + $entry1->addTag($this->getReference('foo-tag')); + $entry1->addTag($this->getReference('baz-tag')); + + $manager->persist($entry1); + + $this->addReference('entry1', $entry1); + + $entry2 = new Entry($this->getReference('admin-user')); + $entry2->setUrl('http://0.0.0.0/entry2'); + $entry2->setReadingTime(1); + $entry2->setDomainName('domain.io'); + $entry2->setMimetype('text/html'); + $entry2->setTitle('test title entry2'); + $entry2->setContent('This is my content /o/'); + $entry2->setOriginUrl('ftp://oneftp.tld'); + $entry2->setLanguage('fr'); + + $manager->persist($entry2); + + $this->addReference('entry2', $entry2); + + $entry3 = new Entry($this->getReference('bob-user')); + $entry3->setUrl('http://0.0.0.0/entry3'); + $entry3->setReadingTime(1); + $entry3->setDomainName('domain.io'); + $entry3->setMimetype('text/html'); + $entry3->setTitle('test title entry3'); + $entry3->setContent('This is my content /o/'); + $entry3->setLanguage('en'); + + $entry3->addTag($this->getReference('foo-tag')); + $entry3->addTag($this->getReference('bar-tag')); + + $manager->persist($entry3); + + $this->addReference('entry3', $entry3); + + $entry4 = new Entry($this->getReference('admin-user')); + $entry4->setUrl('http://0.0.0.0/entry4'); + $entry4->setReadingTime(12); + $entry4->setDomainName('domain.io'); + $entry4->setMimetype('text/html'); + $entry4->setTitle('test title entry4'); + $entry4->setContent('This is my content /o/'); + $entry4->setLanguage('en'); + + $entry4->addTag($this->getReference('foo-tag')); + $entry4->addTag($this->getReference('bar-tag')); + + $manager->persist($entry4); + + $this->addReference('entry4', $entry4); + + $entry5 = new Entry($this->getReference('admin-user')); + $entry5->setUrl('http://0.0.0.0/entry5'); + $entry5->setReadingTime(12); + $entry5->setDomainName('domain.io'); + $entry5->setMimetype('text/html'); + $entry5->setTitle('test title entry5'); + $entry5->setContent('This is my content /o/'); + $entry5->setStarred(true); + $entry5->setLanguage('fr'); + $entry5->setPreviewPicture('http://0.0.0.0/image.jpg'); + + $manager->persist($entry5); + + $this->addReference('entry5', $entry5); + + $entry6 = new Entry($this->getReference('admin-user')); + $entry6->setUrl('http://0.0.0.0/entry6'); + $entry6->setReadingTime(12); + $entry6->setDomainName('domain.io'); + $entry6->setMimetype('text/html'); + $entry6->setTitle('test title entry6'); + $entry6->setContent('This is my content /o/'); + $entry6->updateArchived(true); + $entry6->setLanguage('de'); + $entry6->addTag($this->getReference('bar-tag')); + + $manager->persist($entry6); + + $this->addReference('entry6', $entry6); + + $manager->flush(); + } + + /** + * {@inheritdoc} + */ + public function getDependencies() + { + return [ + UserFixtures::class, + TagFixtures::class, + ]; + } +} diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php deleted file mode 100644 index 3d4d5def..00000000 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php +++ /dev/null @@ -1,67 +0,0 @@ -getReference('admin-user')); - - $adminConfig->setTheme('material'); - $adminConfig->setItemsPerPage(30); - $adminConfig->setReadingSpeed(1); - $adminConfig->setLanguage('en'); - $adminConfig->setPocketConsumerKey('xxxxx'); - $adminConfig->setActionMarkAsRead(0); - $adminConfig->setListMode(0); - - $manager->persist($adminConfig); - - $this->addReference('admin-config', $adminConfig); - - $bobConfig = new Config($this->getReference('bob-user')); - $bobConfig->setTheme('default'); - $bobConfig->setItemsPerPage(10); - $bobConfig->setReadingSpeed(1); - $bobConfig->setLanguage('fr'); - $bobConfig->setPocketConsumerKey(null); - $bobConfig->setActionMarkAsRead(1); - $bobConfig->setListMode(1); - - $manager->persist($bobConfig); - - $this->addReference('bob-config', $bobConfig); - - $emptyConfig = new Config($this->getReference('empty-user')); - $emptyConfig->setTheme('material'); - $emptyConfig->setItemsPerPage(10); - $emptyConfig->setReadingSpeed(1); - $emptyConfig->setLanguage('en'); - $emptyConfig->setPocketConsumerKey(null); - $emptyConfig->setActionMarkAsRead(0); - $emptyConfig->setListMode(0); - - $manager->persist($emptyConfig); - - $this->addReference('empty-config', $emptyConfig); - - $manager->flush(); - } - - /** - * {@inheritdoc} - */ - public function getOrder() - { - return 20; - } -} diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php deleted file mode 100644 index 62fb5fa6..00000000 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php +++ /dev/null @@ -1,119 +0,0 @@ -getReference('admin-user')); - $entry1->setUrl('http://0.0.0.0/entry1'); - $entry1->setReadingTime(11); - $entry1->setDomainName('domain.io'); - $entry1->setMimetype('text/html'); - $entry1->setTitle('test title entry1'); - $entry1->setContent('This is my content /o/'); - $entry1->setLanguage('en'); - - $entry1->addTag($this->getReference('foo-tag')); - $entry1->addTag($this->getReference('baz-tag')); - - $manager->persist($entry1); - - $this->addReference('entry1', $entry1); - - $entry2 = new Entry($this->getReference('admin-user')); - $entry2->setUrl('http://0.0.0.0/entry2'); - $entry2->setReadingTime(1); - $entry2->setDomainName('domain.io'); - $entry2->setMimetype('text/html'); - $entry2->setTitle('test title entry2'); - $entry2->setContent('This is my content /o/'); - $entry2->setOriginUrl('ftp://oneftp.tld'); - $entry2->setLanguage('fr'); - - $manager->persist($entry2); - - $this->addReference('entry2', $entry2); - - $entry3 = new Entry($this->getReference('bob-user')); - $entry3->setUrl('http://0.0.0.0/entry3'); - $entry3->setReadingTime(1); - $entry3->setDomainName('domain.io'); - $entry3->setMimetype('text/html'); - $entry3->setTitle('test title entry3'); - $entry3->setContent('This is my content /o/'); - $entry3->setLanguage('en'); - - $entry3->addTag($this->getReference('foo-tag')); - $entry3->addTag($this->getReference('bar-tag')); - - $manager->persist($entry3); - - $this->addReference('entry3', $entry3); - - $entry4 = new Entry($this->getReference('admin-user')); - $entry4->setUrl('http://0.0.0.0/entry4'); - $entry4->setReadingTime(12); - $entry4->setDomainName('domain.io'); - $entry4->setMimetype('text/html'); - $entry4->setTitle('test title entry4'); - $entry4->setContent('This is my content /o/'); - $entry4->setLanguage('en'); - - $entry4->addTag($this->getReference('foo-tag')); - $entry4->addTag($this->getReference('bar-tag')); - - $manager->persist($entry4); - - $this->addReference('entry4', $entry4); - - $entry5 = new Entry($this->getReference('admin-user')); - $entry5->setUrl('http://0.0.0.0/entry5'); - $entry5->setReadingTime(12); - $entry5->setDomainName('domain.io'); - $entry5->setMimetype('text/html'); - $entry5->setTitle('test title entry5'); - $entry5->setContent('This is my content /o/'); - $entry5->setStarred(true); - $entry5->setLanguage('fr'); - $entry5->setPreviewPicture('http://0.0.0.0/image.jpg'); - - $manager->persist($entry5); - - $this->addReference('entry5', $entry5); - - $entry6 = new Entry($this->getReference('admin-user')); - $entry6->setUrl('http://0.0.0.0/entry6'); - $entry6->setReadingTime(12); - $entry6->setDomainName('domain.io'); - $entry6->setMimetype('text/html'); - $entry6->setTitle('test title entry6'); - $entry6->setContent('This is my content /o/'); - $entry6->updateArchived(true); - $entry6->setLanguage('de'); - $entry6->addTag($this->getReference('bar-tag')); - - $manager->persist($entry6); - - $this->addReference('entry6', $entry6); - - $manager->flush(); - } - - /** - * {@inheritdoc} - */ - public function getOrder() - { - return 30; - } -} diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php deleted file mode 100644 index 3fe88e7f..00000000 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php +++ /dev/null @@ -1,47 +0,0 @@ -container = $container; - } - - /** - * {@inheritdoc} - */ - public function load(ObjectManager $manager) - { - foreach ($this->container->getParameter('wallabag_core.default_internal_settings') as $setting) { - $newSetting = new Setting(); - $newSetting->setName($setting['name']); - $newSetting->setValue($setting['value']); - $newSetting->setSection($setting['section']); - $manager->persist($newSetting); - } - - $manager->flush(); - } - - /** - * {@inheritdoc} - */ - public function getOrder() - { - return 29; - } -} diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php deleted file mode 100644 index 866f55a4..00000000 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php +++ /dev/null @@ -1,34 +0,0 @@ -getReference('admin-user')); - $credential->setHost('example.com'); - $credential->setUsername('foo'); - $credential->setPassword('bar'); - - $manager->persist($credential); - - $manager->flush(); - } - - /** - * {@inheritdoc} - */ - public function getOrder() - { - return 50; - } -} diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php deleted file mode 100644 index 0ecfd18b..00000000 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php +++ /dev/null @@ -1,55 +0,0 @@ -setLabel('foo bar'); - - $manager->persist($tag1); - - $this->addReference('foo-bar-tag', $tag1); - - $tag2 = new Tag(); - $tag2->setLabel('bar'); - - $manager->persist($tag2); - - $this->addReference('bar-tag', $tag2); - - $tag3 = new Tag(); - $tag3->setLabel('baz'); - - $manager->persist($tag3); - - $this->addReference('baz-tag', $tag3); - - $tag4 = new Tag(); - $tag4->setLabel('foo'); - - $manager->persist($tag4); - - $this->addReference('foo-tag', $tag4); - - $manager->flush(); - } - - /** - * {@inheritdoc} - */ - public function getOrder() - { - return 25; - } -} diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php deleted file mode 100644 index 55abd63c..00000000 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php +++ /dev/null @@ -1,56 +0,0 @@ -setRule('content matches "spurs"'); - $tr1->setTags(['sport']); - $tr1->setConfig($this->getReference('admin-config')); - - $manager->persist($tr1); - - $tr2 = new TaggingRule(); - $tr2->setRule('content matches "basket"'); - $tr2->setTags(['sport']); - $tr2->setConfig($this->getReference('admin-config')); - - $manager->persist($tr2); - - $tr3 = new TaggingRule(); - - $tr3->setRule('title matches "wallabag"'); - $tr3->setTags(['wallabag']); - $tr3->setConfig($this->getReference('admin-config')); - - $manager->persist($tr3); - - $tr4 = new TaggingRule(); - $tr4->setRule('content notmatches "basket"'); - $tr4->setTags(['foot']); - $tr4->setConfig($this->getReference('admin-config')); - - $manager->persist($tr4); - - $manager->flush(); - } - - /** - * {@inheritdoc} - */ - public function getOrder() - { - return 40; - } -} diff --git a/src/Wallabag/CoreBundle/DataFixtures/SettingFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/SettingFixtures.php new file mode 100644 index 00000000..fd129829 --- /dev/null +++ b/src/Wallabag/CoreBundle/DataFixtures/SettingFixtures.php @@ -0,0 +1,39 @@ +container = $container; + } + + /** + * {@inheritdoc} + */ + public function load(ObjectManager $manager) + { + foreach ($this->container->getParameter('wallabag_core.default_internal_settings') as $setting) { + $newSetting = new Setting(); + $newSetting->setName($setting['name']); + $newSetting->setValue($setting['value']); + $newSetting->setSection($setting['section']); + $manager->persist($newSetting); + } + + $manager->flush(); + } +} diff --git a/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php new file mode 100644 index 00000000..c73173e8 --- /dev/null +++ b/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php @@ -0,0 +1,37 @@ +getReference('admin-user')); + $credential->setHost('example.com'); + $credential->setUsername('foo'); + $credential->setPassword('bar'); + + $manager->persist($credential); + + $manager->flush(); + } + + /** + * {@inheritdoc} + */ + public function getDependencies() + { + return [ + UserFixtures::class, + ]; + } +} diff --git a/src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php new file mode 100644 index 00000000..803ad778 --- /dev/null +++ b/src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php @@ -0,0 +1,47 @@ +setLabel('foo bar'); + + $manager->persist($tag1); + + $this->addReference('foo-bar-tag', $tag1); + + $tag2 = new Tag(); + $tag2->setLabel('bar'); + + $manager->persist($tag2); + + $this->addReference('bar-tag', $tag2); + + $tag3 = new Tag(); + $tag3->setLabel('baz'); + + $manager->persist($tag3); + + $this->addReference('baz-tag', $tag3); + + $tag4 = new Tag(); + $tag4->setLabel('foo'); + + $manager->persist($tag4); + + $this->addReference('foo-tag', $tag4); + + $manager->flush(); + } +} diff --git a/src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php new file mode 100644 index 00000000..78ff314a --- /dev/null +++ b/src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php @@ -0,0 +1,58 @@ +setRule('content matches "spurs"'); + $tr1->setTags(['sport']); + $tr1->setConfig($this->getReference('admin-config')); + + $manager->persist($tr1); + + $tr2 = new TaggingRule(); + $tr2->setRule('content matches "basket"'); + $tr2->setTags(['sport']); + $tr2->setConfig($this->getReference('admin-config')); + + $manager->persist($tr2); + + $tr3 = new TaggingRule(); + + $tr3->setRule('title matches "wallabag"'); + $tr3->setTags(['wallabag']); + $tr3->setConfig($this->getReference('admin-config')); + + $manager->persist($tr3); + + $tr4 = new TaggingRule(); + $tr4->setRule('content notmatches "basket"'); + $tr4->setTags(['foot']); + $tr4->setConfig($this->getReference('admin-config')); + + $manager->persist($tr4); + + $manager->flush(); + } + + /** + * {@inheritdoc} + */ + public function getDependencies() + { + return [ + ConfigFixtures::class, + ]; + } +} diff --git a/src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php b/src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php deleted file mode 100644 index 26dbda3b..00000000 --- a/src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php +++ /dev/null @@ -1,61 +0,0 @@ -setName('Big boss'); - $userAdmin->setEmail('bigboss@wallabag.org'); - $userAdmin->setUsername('admin'); - $userAdmin->setPlainPassword('mypassword'); - $userAdmin->setEnabled(true); - $userAdmin->addRole('ROLE_SUPER_ADMIN'); - - $manager->persist($userAdmin); - - $this->addReference('admin-user', $userAdmin); - - $bobUser = new User(); - $bobUser->setName('Bobby'); - $bobUser->setEmail('bobby@wallabag.org'); - $bobUser->setUsername('bob'); - $bobUser->setPlainPassword('mypassword'); - $bobUser->setEnabled(true); - - $manager->persist($bobUser); - - $this->addReference('bob-user', $bobUser); - - $emptyUser = new User(); - $emptyUser->setName('Empty'); - $emptyUser->setEmail('empty@wallabag.org'); - $emptyUser->setUsername('empty'); - $emptyUser->setPlainPassword('mypassword'); - $emptyUser->setEnabled(true); - - $manager->persist($emptyUser); - - $this->addReference('empty-user', $emptyUser); - - $manager->flush(); - } - - /** - * {@inheritdoc} - */ - public function getOrder() - { - return 10; - } -} diff --git a/src/Wallabag/UserBundle/DataFixtures/UserFixtures.php b/src/Wallabag/UserBundle/DataFixtures/UserFixtures.php new file mode 100644 index 00000000..1e375e09 --- /dev/null +++ b/src/Wallabag/UserBundle/DataFixtures/UserFixtures.php @@ -0,0 +1,52 @@ +setName('Big boss'); + $userAdmin->setEmail('bigboss@wallabag.org'); + $userAdmin->setUsername('admin'); + $userAdmin->setPlainPassword('mypassword'); + $userAdmin->setEnabled(true); + $userAdmin->addRole('ROLE_SUPER_ADMIN'); + + $manager->persist($userAdmin); + + $this->addReference('admin-user', $userAdmin); + + $bobUser = new User(); + $bobUser->setName('Bobby'); + $bobUser->setEmail('bobby@wallabag.org'); + $bobUser->setUsername('bob'); + $bobUser->setPlainPassword('mypassword'); + $bobUser->setEnabled(true); + + $manager->persist($bobUser); + + $this->addReference('bob-user', $bobUser); + + $emptyUser = new User(); + $emptyUser->setName('Empty'); + $emptyUser->setEmail('empty@wallabag.org'); + $emptyUser->setUsername('empty'); + $emptyUser->setPlainPassword('mypassword'); + $emptyUser->setEnabled(true); + + $manager->persist($emptyUser); + + $this->addReference('empty-user', $emptyUser); + + $manager->flush(); + } +} -- cgit v1.2.3 From 1b6b77f02956a767fb3fa9825a7b97b4879f7d42 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 26 Nov 2018 20:02:15 +0100 Subject: Remove custom Postgres class Because PG > 10 is now supported by DBAL >= 2.6.0 --- .../DBAL/Driver/CustomPostgreSQLDriver.php | 25 -------------- .../DBAL/Schema/CustomPostgreSqlSchemaManager.php | 38 ---------------------- 2 files changed, 63 deletions(-) delete mode 100644 src/Wallabag/CoreBundle/Doctrine/DBAL/Driver/CustomPostgreSQLDriver.php delete mode 100644 src/Wallabag/CoreBundle/Doctrine/DBAL/Schema/CustomPostgreSqlSchemaManager.php (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Doctrine/DBAL/Driver/CustomPostgreSQLDriver.php b/src/Wallabag/CoreBundle/Doctrine/DBAL/Driver/CustomPostgreSQLDriver.php deleted file mode 100644 index eb5b203f..00000000 --- a/src/Wallabag/CoreBundle/Doctrine/DBAL/Driver/CustomPostgreSQLDriver.php +++ /dev/null @@ -1,25 +0,0 @@ -_platform->quoteIdentifier($sequenceName); - - // the `method_exists` is only to avoid test to fail: - // DAMA\DoctrineTestBundle\Doctrine\DBAL\StaticConnection doesn't support the `getServerVersion` - if (method_exists($this->_conn->getWrappedConnection(), 'getServerVersion') && (float) ($this->_conn->getWrappedConnection()->getServerVersion()) >= 10) { - $query = "SELECT min_value, increment_by FROM pg_sequences WHERE schemaname = 'public' AND sequencename = " . $this->_conn->quote($sequenceName); - } - - $data = $this->_conn->fetchAll($query); - - return new Sequence($sequenceName, $data[0]['increment_by'], $data[0]['min_value']); - } -} -- cgit v1.2.3 From b13b2ef052f3c21f17ab2a4f3f410049e3c79c83 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 26 Nov 2018 22:46:44 +0100 Subject: CS --- src/Wallabag/CoreBundle/DataFixtures/SettingFixtures.php | 1 - src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php | 1 - 2 files changed, 2 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/DataFixtures/SettingFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/SettingFixtures.php index fd129829..cc7d1f59 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/SettingFixtures.php +++ b/src/Wallabag/CoreBundle/DataFixtures/SettingFixtures.php @@ -4,7 +4,6 @@ namespace Wallabag\CoreBundle\DataFixtures; use Craue\ConfigBundle\Entity\Setting; use Doctrine\Bundle\FixturesBundle\Fixture; -use Doctrine\Common\DataFixtures\DependentFixtureInterface; use Doctrine\Common\Persistence\ObjectManager; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php index 803ad778..d78dd0b8 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php +++ b/src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php @@ -3,7 +3,6 @@ namespace Wallabag\CoreBundle\DataFixtures; use Doctrine\Bundle\FixturesBundle\Fixture; -use Doctrine\Common\DataFixtures\DependentFixtureInterface; use Doctrine\Common\Persistence\ObjectManager; use Wallabag\CoreBundle\Entity\Tag; -- cgit v1.2.3 From 877787e5fe6a6545105616968939949b4db81347 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 28 Nov 2018 20:26:18 +0100 Subject: Fix utf8mb4 on vendor tables When creating the schema for test these tables use default length for string: 255. Which fail when using utf8mb4. > Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes Also move the `setKeepStaticConnections` in before and after class to avoid: > SAVEPOINT DOCTRINE2_SAVEPOINT_2 does not exist See https://github.com/dmaicher/doctrine-test-bundle#troubleshooting --- src/Wallabag/ApiBundle/Entity/AccessToken.php | 16 ++++++++++++++++ src/Wallabag/ApiBundle/Entity/AuthCode.php | 16 ++++++++++++++++ src/Wallabag/ApiBundle/Entity/RefreshToken.php | 16 ++++++++++++++++ 3 files changed, 48 insertions(+) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Entity/AccessToken.php b/src/Wallabag/ApiBundle/Entity/AccessToken.php index c09a0c80..5e4099dd 100644 --- a/src/Wallabag/ApiBundle/Entity/AccessToken.php +++ b/src/Wallabag/ApiBundle/Entity/AccessToken.php @@ -8,6 +8,22 @@ use FOS\OAuthServerBundle\Entity\AccessToken as BaseAccessToken; /** * @ORM\Table("oauth2_access_tokens") * @ORM\Entity + * @ORM\AttributeOverrides({ + * @ORM\AttributeOverride(name="token", + * column=@ORM\Column( + * name = "token", + * type = "string", + * length = 191 + * ) + * ), + * @ORM\AttributeOverride(name="scope", + * column=@ORM\Column( + * name = "scope", + * type = "string", + * length = 191 + * ) + * ) + * }) */ class AccessToken extends BaseAccessToken { diff --git a/src/Wallabag/ApiBundle/Entity/AuthCode.php b/src/Wallabag/ApiBundle/Entity/AuthCode.php index 4d4b09fe..5fa205ac 100644 --- a/src/Wallabag/ApiBundle/Entity/AuthCode.php +++ b/src/Wallabag/ApiBundle/Entity/AuthCode.php @@ -8,6 +8,22 @@ use FOS\OAuthServerBundle\Entity\AuthCode as BaseAuthCode; /** * @ORM\Table("oauth2_auth_codes") * @ORM\Entity + * @ORM\AttributeOverrides({ + * @ORM\AttributeOverride(name="token", + * column=@ORM\Column( + * name = "token", + * type = "string", + * length = 191 + * ) + * ), + * @ORM\AttributeOverride(name="scope", + * column=@ORM\Column( + * name = "scope", + * type = "string", + * length = 191 + * ) + * ) + * }) */ class AuthCode extends BaseAuthCode { diff --git a/src/Wallabag/ApiBundle/Entity/RefreshToken.php b/src/Wallabag/ApiBundle/Entity/RefreshToken.php index 822a02d8..dd8e9c63 100644 --- a/src/Wallabag/ApiBundle/Entity/RefreshToken.php +++ b/src/Wallabag/ApiBundle/Entity/RefreshToken.php @@ -8,6 +8,22 @@ use FOS\OAuthServerBundle\Entity\RefreshToken as BaseRefreshToken; /** * @ORM\Table("oauth2_refresh_tokens") * @ORM\Entity + * @ORM\AttributeOverrides({ + * @ORM\AttributeOverride(name="token", + * column=@ORM\Column( + * name = "token", + * type = "string", + * length = 191 + * ) + * ), + * @ORM\AttributeOverride(name="scope", + * column=@ORM\Column( + * name = "scope", + * type = "string", + * length = 191 + * ) + * ) + * }) */ class RefreshToken extends BaseRefreshToken { -- cgit v1.2.3 From e014fa0395ae5a6b6914c5a06f0856bd7cc06959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Rumi=C5=84ski?= Date: Sun, 2 Dec 2018 18:14:21 +0100 Subject: Update messages.pl.yml Add missing translation --- src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 4e2238d2..83f6d2e6 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -400,7 +400,7 @@ tag: add: 'Dodaj' placeholder: 'Możesz dodać kilka tagów, oddzielając je przecinkami.' rename: - # placeholder: 'You can update tag name.' + placeholder: 'Możesz zaktualizować nazwę taga.' export: footer_template: '

    Stworzone przez wallabag z %method%

    Proszę zgłoś sprawę, jeżeli masz problem z wyświetleniem tego e-booka na swoim urządzeniu.

    ' @@ -587,7 +587,7 @@ flashes: tag: notice: tag_added: 'Tag dodany' - # tag_renamed: 'Tag renamed' + tag_renamed: 'Nazwa taga zmieniona' import: notice: failed: 'Nieudany import, prosimy spróbować ponownie.' -- cgit v1.2.3 From 5becf260fafd741fd34948f12131d8074dc2b5dc Mon Sep 17 00:00:00 2001 From: lizyn Date: Tue, 25 Dec 2018 15:31:44 +0800 Subject: fix incorrect reading time calculation for entries with CJK characters --- src/Wallabag/CoreBundle/Tools/Utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Tools/Utils.php b/src/Wallabag/CoreBundle/Tools/Utils.php index 46bb1dc5..0a805210 100644 --- a/src/Wallabag/CoreBundle/Tools/Utils.php +++ b/src/Wallabag/CoreBundle/Tools/Utils.php @@ -29,6 +29,6 @@ class Utils */ public static function getReadingTime($text) { - return floor(\count(preg_split('~[^\p{L}\p{N}\']+~u', strip_tags($text))) / 200); + return floor(\count(preg_split('~([^\p{L}\p{N}\']+|\p{Han}|\p{Hiragana}|\p{Katakana}|\p{Hangul})~u', strip_tags($text))) / 200); } } -- cgit v1.2.3 From bafb9744c87255ebe28945879da85e587175d241 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sat, 29 Dec 2018 19:22:05 +0100 Subject: fixtures: refactor EntryData, TagData, add a new tag Signed-off-by: Kevin Decherf --- .../CoreBundle/DataFixtures/ORM/LoadEntryData.php | 197 +++++++++++---------- .../CoreBundle/DataFixtures/ORM/LoadTagData.php | 43 ++--- 2 files changed, 122 insertions(+), 118 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php index 0e1510a2..8e7a1d2a 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php @@ -14,97 +14,112 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface */ public function load(ObjectManager $manager) { - $entry1 = new Entry($this->getReference('admin-user')); - $entry1->setUrl('http://0.0.0.0/entry1'); - $entry1->setReadingTime(11); - $entry1->setDomainName('domain.io'); - $entry1->setMimetype('text/html'); - $entry1->setTitle('test title entry1'); - $entry1->setContent('This is my content /o/'); - $entry1->setLanguage('en'); - - $entry1->addTag($this->getReference('foo-tag')); - $entry1->addTag($this->getReference('baz-tag')); - - $manager->persist($entry1); - - $this->addReference('entry1', $entry1); - - $entry2 = new Entry($this->getReference('admin-user')); - $entry2->setUrl('http://0.0.0.0/entry2'); - $entry2->setReadingTime(1); - $entry2->setDomainName('domain.io'); - $entry2->setMimetype('text/html'); - $entry2->setTitle('test title entry2'); - $entry2->setContent('This is my content /o/'); - $entry2->setOriginUrl('ftp://oneftp.tld'); - $entry2->setLanguage('fr'); - - $manager->persist($entry2); - - $this->addReference('entry2', $entry2); - - $entry3 = new Entry($this->getReference('bob-user')); - $entry3->setUrl('http://0.0.0.0/entry3'); - $entry3->setReadingTime(1); - $entry3->setDomainName('domain.io'); - $entry3->setMimetype('text/html'); - $entry3->setTitle('test title entry3'); - $entry3->setContent('This is my content /o/'); - $entry3->setLanguage('en'); - - $entry3->addTag($this->getReference('foo-tag')); - $entry3->addTag($this->getReference('bar-tag')); - - $manager->persist($entry3); - - $this->addReference('entry3', $entry3); - - $entry4 = new Entry($this->getReference('admin-user')); - $entry4->setUrl('http://0.0.0.0/entry4'); - $entry4->setReadingTime(12); - $entry4->setDomainName('domain.io'); - $entry4->setMimetype('text/html'); - $entry4->setTitle('test title entry4'); - $entry4->setContent('This is my content /o/'); - $entry4->setLanguage('en'); - - $entry4->addTag($this->getReference('foo-tag')); - $entry4->addTag($this->getReference('bar-tag')); - - $manager->persist($entry4); - - $this->addReference('entry4', $entry4); - - $entry5 = new Entry($this->getReference('admin-user')); - $entry5->setUrl('http://0.0.0.0/entry5'); - $entry5->setReadingTime(12); - $entry5->setDomainName('domain.io'); - $entry5->setMimetype('text/html'); - $entry5->setTitle('test title entry5'); - $entry5->setContent('This is my content /o/'); - $entry5->setStarred(true); - $entry5->setLanguage('fr'); - $entry5->setPreviewPicture('http://0.0.0.0/image.jpg'); - - $manager->persist($entry5); - - $this->addReference('entry5', $entry5); - - $entry6 = new Entry($this->getReference('admin-user')); - $entry6->setUrl('http://0.0.0.0/entry6'); - $entry6->setReadingTime(12); - $entry6->setDomainName('domain.io'); - $entry6->setMimetype('text/html'); - $entry6->setTitle('test title entry6'); - $entry6->setContent('This is my content /o/'); - $entry6->setArchived(true); - $entry6->setLanguage('de'); - $entry6->addTag($this->getReference('bar-tag')); - - $manager->persist($entry6); - - $this->addReference('entry6', $entry6); + $entries = [ + 'entry1' => [ + 'user' => 'admin-user', + 'url' => 'http://0.0.0.0/entry1', + 'reading_time' => 11, + 'domain' => 'domain.io', + 'mime' => 'text/html', + 'title' => 'test title entry1', + 'content' => 'This is my content /o/', + 'language' => 'en', + 'tags' => ['foo-tag', 'baz-tag'], + ], + 'entry2' => [ + 'user' => 'admin-user', + 'url' => 'http://0.0.0.0/entry2', + 'reading_time' => 1, + 'domain' => 'domain.io', + 'mime' => 'text/html', + 'title' => 'test title entry2', + 'content' => 'This is my content /o/', + 'origin' => 'ftp://oneftp.tld', + 'language' => 'fr', + ], + 'entry3' => [ + 'user' => 'bob-user', + 'url' => 'http://0.0.0.0/entry3', + 'reading_time' => 1, + 'domain' => 'domain.io', + 'mime' => 'text/html', + 'title' => 'test title entry3', + 'content' => 'This is my content /o/', + 'language' => 'en', + 'tags' => ['foo-tag', 'bar-tag', 'bob-tag'], + ], + 'entry4' => [ + 'user' => 'admin-user', + 'url' => 'http://0.0.0.0/entry4', + 'reading_time' => 12, + 'domain' => 'domain.io', + 'mime' => 'text/html', + 'title' => 'test title entry4', + 'content' => 'This is my content /o/', + 'language' => 'en', + 'tags' => ['foo-tag', 'bar-tag'], + ], + 'entry5' => [ + 'user' => 'admin-user', + 'url' => 'http://0.0.0.0/entry5', + 'reading_time' => 12, + 'domain' => 'domain.io', + 'mime' => 'text/html', + 'title' => 'test title entry5', + 'content' => 'This is my content /o/', + 'language' => 'fr', + 'starred' => true, + 'preview' => 'http://0.0.0.0/image.jpg', + ], + 'entry6' => [ + 'user' => 'admin-user', + 'url' => 'http://0.0.0.0/entry6', + 'reading_time' => 12, + 'domain' => 'domain.io', + 'mime' => 'text/html', + 'title' => 'test title entry6', + 'content' => 'This is my content /o/', + 'language' => 'de', + 'archived' => true, + 'tags' => ['bar-tag'], + ], + ]; + + foreach ($entries as $reference => $item) { + $entry = new Entry($this->getReference($item['user'])); + $entry->setUrl($item['url']); + $entry->setReadingTime($item['reading_time']); + $entry->setDomainName($item['domain']); + $entry->setMimetype($item['mime']); + $entry->setTitle($item['title']); + $entry->setContent($item['content']); + $entry->setLanguage($item['language']); + + if (isset($item['tags'])) { + foreach ($item['tags'] as $tag) { + $entry->addTag($this->getReference($tag)); + } + } + + if (isset($item['origin'])) { + $entry->setOriginUrl($item['origin']); + } + + if (isset($item['starred'])) { + $entry->setStarred($item['starred']); + } + + if (isset($item['archived'])) { + $entry->setArchived($item['archived']); + } + + if (isset($item['preview'])) { + $entry->setPreviewPicture($item['preview']); + } + + $manager->persist($entry); + $this->addReference($reference, $entry); + } $manager->flush(); } diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php index 0ecfd18b..485445c1 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php @@ -14,33 +14,22 @@ class LoadTagData extends AbstractFixture implements OrderedFixtureInterface */ public function load(ObjectManager $manager) { - $tag1 = new Tag(); - $tag1->setLabel('foo bar'); - - $manager->persist($tag1); - - $this->addReference('foo-bar-tag', $tag1); - - $tag2 = new Tag(); - $tag2->setLabel('bar'); - - $manager->persist($tag2); - - $this->addReference('bar-tag', $tag2); - - $tag3 = new Tag(); - $tag3->setLabel('baz'); - - $manager->persist($tag3); - - $this->addReference('baz-tag', $tag3); - - $tag4 = new Tag(); - $tag4->setLabel('foo'); - - $manager->persist($tag4); - - $this->addReference('foo-tag', $tag4); + $tags = [ + 'foo-bar-tag' => 'foo bar', //tag used for EntryControllerTest + 'bar-tag' => 'bar', + 'baz-tag' => 'baz', // tag used for ExportControllerTest + 'foo-tag' => 'foo', + 'bob-tag' => 'bob', // tag used for TagRestControllerTest + ]; + + foreach ($tags as $reference => $label) { + $tag = new Tag(); + $tag->setLabel($label); + + $manager->persist($tag); + + $this->addReference($reference, $tag); + } $manager->flush(); } -- cgit v1.2.3 From 6708bf238de46d7ce861e3c0eeb6a9b4623931ed Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sat, 29 Dec 2018 19:42:37 +0100 Subject: TagRepository: refactor query builder for queries by userId Signed-off-by: Kevin Decherf --- .../CoreBundle/Repository/TagRepository.php | 36 ++++++++++++---------- 1 file changed, 20 insertions(+), 16 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Repository/TagRepository.php b/src/Wallabag/CoreBundle/Repository/TagRepository.php index 3ae9d414..bd2d9f97 100644 --- a/src/Wallabag/CoreBundle/Repository/TagRepository.php +++ b/src/Wallabag/CoreBundle/Repository/TagRepository.php @@ -3,6 +3,7 @@ namespace Wallabag\CoreBundle\Repository; use Doctrine\ORM\EntityRepository; +use Doctrine\ORM\QueryBuilder; use Wallabag\CoreBundle\Entity\Tag; class TagRepository extends EntityRepository @@ -45,12 +46,8 @@ class TagRepository extends EntityRepository */ public function findAllTags($userId) { - $ids = $this->createQueryBuilder('t') + $ids = $this->getQueryBuilderByUser($userId) ->select('t.id') - ->leftJoin('t.entries', 'e') - ->where('e.user = :userId')->setParameter('userId', $userId) - ->groupBy('t.id') - ->orderBy('t.slug') ->getQuery() ->getArrayResult(); @@ -71,14 +68,9 @@ class TagRepository extends EntityRepository */ public function findAllFlatTagsWithNbEntries($userId) { - return $this->createQueryBuilder('t') + return $this->getQueryBuilderByUser($userId) ->select('t.id, t.label, t.slug, count(e.id) as nbEntries') ->distinct(true) - ->leftJoin('t.entries', 'e') - ->where('e.user = :userId') - ->groupBy('t.id') - ->orderBy('t.slug') - ->setParameter('userId', $userId) ->getQuery() ->getArrayResult(); } @@ -101,13 +93,9 @@ class TagRepository extends EntityRepository public function findForArchivedArticlesByUser($userId) { - $ids = $this->createQueryBuilder('t') + $ids = $this->getQueryBuilderByUser($userId) ->select('t.id') - ->leftJoin('t.entries', 'e') - ->where('e.user = :userId')->setParameter('userId', $userId) ->andWhere('e.isArchived = true') - ->groupBy('t.id') - ->orderBy('t.slug') ->getQuery() ->getArrayResult(); @@ -118,4 +106,20 @@ class TagRepository extends EntityRepository return $tags; } + + /** + * Retrieve a sorted list of tags used by a user. + * + * @param int $userId + * + * @return QueryBuilder + */ + private function getQueryBuilderByUser($userId) + { + return $this->createQueryBuilder('t') + ->leftJoin('t.entries', 'e') + ->where('e.user = :userId')->setParameter('userId', $userId) + ->groupBy('t.id') + ->orderBy('t.slug'); + } } -- cgit v1.2.3 From 2a0e0a47d853937702d235bdb91df0ca0e3116b6 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sat, 29 Dec 2018 20:42:41 +0100 Subject: TagRestController: rewrite delete actions to only retrieve tags related to the user Fixes #3815 Signed-off-by: Kevin Decherf --- .../ApiBundle/Controller/TagRestController.php | 22 +++++++++++----------- .../CoreBundle/Repository/TagRepository.php | 17 +++++++++++++++++ 2 files changed, 28 insertions(+), 11 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/TagRestController.php b/src/Wallabag/ApiBundle/Controller/TagRestController.php index c6d6df6a..f3498f55 100644 --- a/src/Wallabag/ApiBundle/Controller/TagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/TagRestController.php @@ -46,12 +46,14 @@ class TagRestController extends WallabagRestController $this->validateAuthentication(); $label = $request->get('tag', ''); - $tag = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findOneByLabel($label); + $tags = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findByLabelsAndUser([$label], $this->getUser()->getId()); - if (empty($tag)) { + if (empty($tags)) { throw $this->createNotFoundException('Tag not found'); } + $tag = $tags[0]; + $this->getDoctrine() ->getRepository('WallabagCoreBundle:Entry') ->removeTag($this->getUser()->getId(), $tag); @@ -80,15 +82,7 @@ class TagRestController extends WallabagRestController $tagsLabels = $request->get('tags', ''); - $tags = []; - - foreach (explode(',', $tagsLabels) as $tagLabel) { - $tagEntity = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findOneByLabel($tagLabel); - - if (!empty($tagEntity)) { - $tags[] = $tagEntity; - } - } + $tags = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findByLabelsAndUser(explode(',', $tagsLabels), $this->getUser()->getId()); if (empty($tags)) { throw $this->createNotFoundException('Tags not found'); @@ -120,6 +114,12 @@ class TagRestController extends WallabagRestController { $this->validateAuthentication(); + $tagFromDb = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findByLabelsAndUser([$tag->getLabel()], $this->getUser()->getId()); + + if (empty($tagFromDb)) { + throw $this->createNotFoundException('Tag not found'); + } + $this->getDoctrine() ->getRepository('WallabagCoreBundle:Entry') ->removeTag($this->getUser()->getId(), $tag); diff --git a/src/Wallabag/CoreBundle/Repository/TagRepository.php b/src/Wallabag/CoreBundle/Repository/TagRepository.php index bd2d9f97..8464a6a5 100644 --- a/src/Wallabag/CoreBundle/Repository/TagRepository.php +++ b/src/Wallabag/CoreBundle/Repository/TagRepository.php @@ -75,6 +75,23 @@ class TagRepository extends EntityRepository ->getArrayResult(); } + public function findByLabelsAndUser($labels, $userId) + { + $qb = $this->getQueryBuilderByUser($userId) + ->select('t.id'); + + $ids = $qb->andWhere($qb->expr()->in('t.label', $labels)) + ->getQuery() + ->getArrayResult(); + + $tags = []; + foreach ($ids as $id) { + $tags[] = $this->find($id); + } + + return $tags; + } + /** * Used only in test case to get a tag for our entry. * -- cgit v1.2.3 From 9f8f188d928b47503d39348c5990379a572b570a Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 18 Dec 2018 13:14:42 +0100 Subject: Validate imported entry to avoid error on import We got some imports with a missing `url` field generating some errors while trying to retrieve an existing entry with that url. Introducing the `validateEntry` allow us to dismiss a message when it doesn't have an url (or other missing stuff in the future) --- src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php | 7 +++++++ src/Wallabag/ImportBundle/Import/AbstractImport.php | 17 +++++++++++++++-- src/Wallabag/ImportBundle/Import/BrowserImport.php | 4 ++-- src/Wallabag/ImportBundle/Import/ChromeImport.php | 12 ++++++++++++ src/Wallabag/ImportBundle/Import/FirefoxImport.php | 12 ++++++++++++ src/Wallabag/ImportBundle/Import/InstapaperImport.php | 12 ++++++++++++ src/Wallabag/ImportBundle/Import/PinboardImport.php | 12 ++++++++++++ src/Wallabag/ImportBundle/Import/PocketImport.php | 12 ++++++++++++ src/Wallabag/ImportBundle/Import/ReadabilityImport.php | 12 ++++++++++++ src/Wallabag/ImportBundle/Import/WallabagImport.php | 12 ++++++++++++ 10 files changed, 108 insertions(+), 4 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php b/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php index b035f5cc..e4bfbdf0 100644 --- a/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php +++ b/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php @@ -52,6 +52,13 @@ abstract class AbstractConsumer $this->import->setUser($user); + if (false === $this->import->validateEntry($storedEntry)) { + $this->logger->warning('Entry is invalid', ['entry' => $storedEntry]); + + // return true to skip message + return true; + } + $entry = $this->import->parseEntry($storedEntry); if (null === $entry) { diff --git a/src/Wallabag/ImportBundle/Import/AbstractImport.php b/src/Wallabag/ImportBundle/Import/AbstractImport.php index 58a234f4..d39d71b6 100644 --- a/src/Wallabag/ImportBundle/Import/AbstractImport.php +++ b/src/Wallabag/ImportBundle/Import/AbstractImport.php @@ -118,6 +118,15 @@ abstract class AbstractImport implements ImportInterface */ abstract public function parseEntry(array $importedEntry); + /** + * Validate that an entry is valid (like has some required keys, etc.). + * + * @param array $importedEntry + * + * @return bool + */ + abstract public function validateEntry(array $importedEntry); + /** * Fetch content from the ContentProxy (using graby). * If it fails return the given entry to be saved in all case (to avoid user to loose the content). @@ -141,9 +150,9 @@ abstract class AbstractImport implements ImportInterface /** * Parse and insert all given entries. * - * @param $entries + * @param array $entries */ - protected function parseEntries($entries) + protected function parseEntries(array $entries) { $i = 1; $entryToBeFlushed = []; @@ -153,6 +162,10 @@ abstract class AbstractImport implements ImportInterface $importedEntry = $this->setEntryAsRead($importedEntry); } + if (false === $this->validateEntry($importedEntry)) { + continue; + } + $entry = $this->parseEntry($importedEntry); if (null === $entry) { diff --git a/src/Wallabag/ImportBundle/Import/BrowserImport.php b/src/Wallabag/ImportBundle/Import/BrowserImport.php index 225f1791..4678ae0c 100644 --- a/src/Wallabag/ImportBundle/Import/BrowserImport.php +++ b/src/Wallabag/ImportBundle/Import/BrowserImport.php @@ -149,9 +149,9 @@ abstract class BrowserImport extends AbstractImport /** * Parse and insert all given entries. * - * @param $entries + * @param array $entries */ - protected function parseEntries($entries) + protected function parseEntries(array $entries) { $i = 1; $entryToBeFlushed = []; diff --git a/src/Wallabag/ImportBundle/Import/ChromeImport.php b/src/Wallabag/ImportBundle/Import/ChromeImport.php index 09183abe..eccee698 100644 --- a/src/Wallabag/ImportBundle/Import/ChromeImport.php +++ b/src/Wallabag/ImportBundle/Import/ChromeImport.php @@ -30,6 +30,18 @@ class ChromeImport extends BrowserImport return 'import.chrome.description'; } + /** + * {@inheritdoc} + */ + public function validateEntry(array $importedEntry) + { + if (empty($importedEntry['url'])) { + return false; + } + + return true; + } + /** * {@inheritdoc} */ diff --git a/src/Wallabag/ImportBundle/Import/FirefoxImport.php b/src/Wallabag/ImportBundle/Import/FirefoxImport.php index 73269fe1..8999e3f3 100644 --- a/src/Wallabag/ImportBundle/Import/FirefoxImport.php +++ b/src/Wallabag/ImportBundle/Import/FirefoxImport.php @@ -30,6 +30,18 @@ class FirefoxImport extends BrowserImport return 'import.firefox.description'; } + /** + * {@inheritdoc} + */ + public function validateEntry(array $importedEntry) + { + if (empty($importedEntry['uri'])) { + return false; + } + + return true; + } + /** * {@inheritdoc} */ diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php index e4f0970c..5a18c7c0 100644 --- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php +++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php @@ -105,6 +105,18 @@ class InstapaperImport extends AbstractImport return true; } + /** + * {@inheritdoc} + */ + public function validateEntry(array $importedEntry) + { + if (empty($importedEntry['url'])) { + return false; + } + + return true; + } + /** * {@inheritdoc} */ diff --git a/src/Wallabag/ImportBundle/Import/PinboardImport.php b/src/Wallabag/ImportBundle/Import/PinboardImport.php index 110b0464..995d1f2c 100644 --- a/src/Wallabag/ImportBundle/Import/PinboardImport.php +++ b/src/Wallabag/ImportBundle/Import/PinboardImport.php @@ -80,6 +80,18 @@ class PinboardImport extends AbstractImport return true; } + /** + * {@inheritdoc} + */ + public function validateEntry(array $importedEntry) + { + if (empty($importedEntry['href'])) { + return false; + } + + return true; + } + /** * {@inheritdoc} */ diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index c1b35b7e..d3643389 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php @@ -168,6 +168,18 @@ class PocketImport extends AbstractImport $this->client = $client; } + /** + * {@inheritdoc} + */ + public function validateEntry(array $importedEntry) + { + if (empty($importedEntry['resolved_url']) && empty($importedEntry['given_url'])) { + return false; + } + + return true; + } + /** * {@inheritdoc} * diff --git a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php index 002b27f4..a5f3798e 100644 --- a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php +++ b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php @@ -80,6 +80,18 @@ class ReadabilityImport extends AbstractImport return true; } + /** + * {@inheritdoc} + */ + public function validateEntry(array $importedEntry) + { + if (empty($importedEntry['article__url'])) { + return false; + } + + return true; + } + /** * {@inheritdoc} */ diff --git a/src/Wallabag/ImportBundle/Import/WallabagImport.php b/src/Wallabag/ImportBundle/Import/WallabagImport.php index c64ccd64..350d0600 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagImport.php +++ b/src/Wallabag/ImportBundle/Import/WallabagImport.php @@ -86,6 +86,18 @@ abstract class WallabagImport extends AbstractImport return $this; } + /** + * {@inheritdoc} + */ + public function validateEntry(array $importedEntry) + { + if (empty($importedEntry['url'])) { + return false; + } + + return true; + } + /** * {@inheritdoc} */ -- cgit v1.2.3 From 35983eb9bbbf78041ff9f6679ca345850f41c5f1 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 4 Jan 2019 11:22:43 +0100 Subject: Improve reading time tests --- src/Wallabag/CoreBundle/Tools/Utils.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Tools/Utils.php b/src/Wallabag/CoreBundle/Tools/Utils.php index 0a805210..c14d2aa0 100644 --- a/src/Wallabag/CoreBundle/Tools/Utils.php +++ b/src/Wallabag/CoreBundle/Tools/Utils.php @@ -20,10 +20,9 @@ class Utils } /** - * For a given text, we calculate reading time for an article - * based on 200 words per minute. + * For a given text, we calculate reading time for an article based on 200 words per minute. * - * @param $text + * @param string $text * * @return float */ -- cgit v1.2.3 From 7f8630b91c1ef0a650bfe7cf422126187eb3c8f2 Mon Sep 17 00:00:00 2001 From: lizyn Date: Sat, 5 Jan 2019 12:30:15 +0800 Subject: Counting two characters together as a word in CJK --- src/Wallabag/CoreBundle/Tools/Utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Tools/Utils.php b/src/Wallabag/CoreBundle/Tools/Utils.php index c14d2aa0..e56e251e 100644 --- a/src/Wallabag/CoreBundle/Tools/Utils.php +++ b/src/Wallabag/CoreBundle/Tools/Utils.php @@ -28,6 +28,6 @@ class Utils */ public static function getReadingTime($text) { - return floor(\count(preg_split('~([^\p{L}\p{N}\']+|\p{Han}|\p{Hiragana}|\p{Katakana}|\p{Hangul})~u', strip_tags($text))) / 200); + return floor(\count(preg_split('~([^\p{L}\p{N}\']+|(\p{Han}|\p{Hiragana}|\p{Katakana}|\p{Hangul}){1,2})~u', strip_tags($text))) / 200); } } -- cgit v1.2.3 From bf22266a6230be105ec9a91eccf00e489108405c Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 6 Jan 2019 18:38:02 +0100 Subject: EntriesExport/epub: replace epub identifier with unique urn We replace the title used as the unique identifier of the epub file with a urn following the format: urn:wallabag:{sha1("wallabagUrl:listOfEntryIdsSeparatedByComma")} This format is repeatable: it always gives the same uid for the same list of entries. Fixes #3811 Signed-off-by: Kevin Decherf --- src/Wallabag/CoreBundle/Helper/EntriesExport.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index cbf1037b..6082f6b9 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -150,8 +150,6 @@ class EntriesExport */ $book->setTitle($this->title); - // Could also be the ISBN number, prefered for published books, or a UUID. - $book->setIdentifier($this->title, EPub::IDENTIFIER_URI); // Not needed, but included for the example, Language is mandatory, but EPub defaults to "en". Use RFC3066 Language codes, such as "en", "da", "fr" etc. $book->setLanguage($this->language); $book->setDescription('Some articles saved on my wallabag'); @@ -174,6 +172,8 @@ class EntriesExport $book->setCoverImage('Cover.png', file_get_contents($this->logoPath), 'image/png'); } + $entryIds = []; + /* * Adding actual entries */ @@ -192,8 +192,14 @@ class EntriesExport $book->addChapter('Title', 'Title.html', $titlepage, true, EPub::EXTERNAL_REF_ADD); $chapter = $content_start . $entry->getContent() . $bookEnd; $book->addChapter($entry->getTitle(), htmlspecialchars($filename) . '.html', $chapter, true, EPub::EXTERNAL_REF_ADD); + + $entryIds[] = $entry->getId(); } + // Could also be the ISBN number, prefered for published books, or a UUID. + $hash = sha1(sprintf('%s:%s', $this->wallabagUrl, implode(',', $entryIds))); + $book->setIdentifier(sprintf('urn:wallabag:%s', $hash), EPub::IDENTIFIER_URI); + $book->buildTOC(); return Response::create( -- cgit v1.2.3 From 063d5e7bda58fee5363dcbb1f86cee51d72c4940 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 6 Jan 2019 18:55:39 +0100 Subject: EntriesExport/epub: remove TOC page This change only remove the rendered page of the TOC at the end of the book, the TOC remains available to readers. Fixes #3603 Signed-off-by: Kevin Decherf --- src/Wallabag/CoreBundle/Helper/EntriesExport.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index 6082f6b9..5658a7d3 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -200,8 +200,6 @@ class EntriesExport $hash = sha1(sprintf('%s:%s', $this->wallabagUrl, implode(',', $entryIds))); $book->setIdentifier(sprintf('urn:wallabag:%s', $hash), EPub::IDENTIFIER_URI); - $book->buildTOC(); - return Response::create( $book->getBook(), 200, -- cgit v1.2.3 From edd1825b5832303b714bec37b8796b9077e7ddc0 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 6 Jan 2019 19:13:26 +0100 Subject: EntriesExport/epub: use sha1 sums for filenames, fix and rename title chapters This commit renames entry chapters file using a sha1 sum of their title for simplicity. Also we fix the 'Title' chapter duplicate issue by using the hash of the related entry and the suffix '_title'. Signed-off-by: Kevin Decherf --- src/Wallabag/CoreBundle/Helper/EntriesExport.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index 5658a7d3..ea5a03cf 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -173,6 +173,8 @@ class EntriesExport } $entryIds = []; + $entryCount = \count($this->entries); + $i = 0; /* * Adding actual entries @@ -180,20 +182,18 @@ class EntriesExport // set tags as subjects foreach ($this->entries as $entry) { + ++$i; foreach ($entry->getTags() as $tag) { $book->setSubject($tag->getLabel()); } - - // the reader in Kobo Devices doesn't likes special caracters - // in filenames, we limit to A-z/0-9 - $filename = preg_replace('/[^A-Za-z0-9\-]/', '', $entry->getTitle()); + $filename = sha1($entry->getTitle()); $titlepage = $content_start . '

    ' . $entry->getTitle() . '

    ' . $this->getExportInformation('PHPePub') . $bookEnd; - $book->addChapter('Title', 'Title.html', $titlepage, true, EPub::EXTERNAL_REF_ADD); + $book->addChapter("Entry {$i} of {$entryCount}", "{$filename}_cover.html", $titlepage, true, EPub::EXTERNAL_REF_ADD); $chapter = $content_start . $entry->getContent() . $bookEnd; - $book->addChapter($entry->getTitle(), htmlspecialchars($filename) . '.html', $chapter, true, EPub::EXTERNAL_REF_ADD); $entryIds[] = $entry->getId(); + $book->addChapter($entry->getTitle(), "{$filename}.html", $chapter, true, EPub::EXTERNAL_REF_ADD); } // Could also be the ISBN number, prefered for published books, or a UUID. -- cgit v1.2.3 From 30cf72bf55cdb2130e9096b1f7bcfa2f2ea1df1c Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 6 Jan 2019 19:23:01 +0100 Subject: EntriesExport/epub: revert c779373f, move exportinfo to the end of the book Signed-off-by: Kevin Decherf --- src/Wallabag/CoreBundle/Helper/EntriesExport.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index ea5a03cf..92f1779c 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -188,7 +188,7 @@ class EntriesExport } $filename = sha1($entry->getTitle()); - $titlepage = $content_start . '

    ' . $entry->getTitle() . '

    ' . $this->getExportInformation('PHPePub') . $bookEnd; + $titlepage = $content_start . '

    ' . $entry->getTitle() . '

    ' . $bookEnd; $book->addChapter("Entry {$i} of {$entryCount}", "{$filename}_cover.html", $titlepage, true, EPub::EXTERNAL_REF_ADD); $chapter = $content_start . $entry->getContent() . $bookEnd; @@ -196,6 +196,8 @@ class EntriesExport $book->addChapter($entry->getTitle(), "{$filename}.html", $chapter, true, EPub::EXTERNAL_REF_ADD); } + $book->addChapter('Notices', 'Cover2.html', $content_start . $this->getExportInformation('PHPePub') . $bookEnd); + // Could also be the ISBN number, prefered for published books, or a UUID. $hash = sha1(sprintf('%s:%s', $this->wallabagUrl, implode(',', $entryIds))); $book->setIdentifier(sprintf('urn:wallabag:%s', $hash), EPub::IDENTIFIER_URI); -- cgit v1.2.3 From f8108346236e18768c08d6c0d4dc5fb4dfe13b78 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 6 Jan 2019 20:17:35 +0100 Subject: EntriesExport: change authors and title when not single entry export Change '{method} authors' (which gives 'Tag_entries authors' when exporting a tag) to 'Various authors'. When exporting a tag (tag_entries), change the title from 'Tag_entries articles' to 'Tag {tag} articles'. Signed-off-by: Kevin Decherf --- src/Wallabag/CoreBundle/Controller/ExportController.php | 5 ++++- src/Wallabag/CoreBundle/Helper/EntriesExport.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Controller/ExportController.php b/src/Wallabag/CoreBundle/Controller/ExportController.php index 7ca89239..9e9dbe49 100644 --- a/src/Wallabag/CoreBundle/Controller/ExportController.php +++ b/src/Wallabag/CoreBundle/Controller/ExportController.php @@ -58,6 +58,7 @@ class ExportController extends Controller $method = ucfirst($category); $methodBuilder = 'getBuilderFor' . $method . 'ByUser'; $repository = $this->get('wallabag_core.entry_repository'); + $title = $method; if ('tag_entries' === $category) { $tag = $this->get('wallabag_core.tag_repository')->findOneBySlug($request->query->get('tag')); @@ -66,6 +67,8 @@ class ExportController extends Controller $this->getUser()->getId(), $tag->getId() ); + + $title = 'Tag ' . $tag->getLabel(); } else { $entries = $repository ->$methodBuilder($this->getUser()->getId()) @@ -76,7 +79,7 @@ class ExportController extends Controller try { return $this->get('wallabag_core.helper.entries_export') ->setEntries($entries) - ->updateTitle($method) + ->updateTitle($title) ->updateAuthor($method) ->exportAs($format); } catch (\InvalidArgumentException $e) { diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index 92f1779c..db5340fc 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -85,7 +85,7 @@ class EntriesExport public function updateAuthor($method) { if ('entry' !== $method) { - $this->author = $method . ' authors'; + $this->author = 'Various authors'; return $this; } -- cgit v1.2.3 From 4944703edc7cdd2c8cd645b785603b4405d2a288 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 6 Jan 2019 23:27:13 +0100 Subject: EntriesExport/epub: add metadata to each entry's cover Add metadata to the cover of each entry: - Publishers - Estimated reading time - Date of creation ("Added on") - Address (URL) Related to #2821 Signed-off-by: Kevin Decherf --- src/Wallabag/CoreBundle/Helper/EntriesExport.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index db5340fc..9cde27c6 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -188,7 +188,22 @@ class EntriesExport } $filename = sha1($entry->getTitle()); - $titlepage = $content_start . '

    ' . $entry->getTitle() . '

    ' . $bookEnd; + $publishedBy = $entry->getPublishedBy(); + if (!empty($publishedBy)) { + $authors = implode(',', $publishedBy); + } else { + $authors = $this->translator->trans('export.unknown'); + } + + $titlepage = $content_start . + '

    ' . $entry->getTitle() . '

    ' . + '
    ' . + '
    ' . $this->translator->trans('entry.view.published_by') . '
    ' . $authors . '
    ' . + '
    ' . $this->translator->trans('entry.metadata.reading_time') . '
    ' . $this->translator->trans('entry.metadata.reading_time_minutes_short', ['%readingTime%' => $entry->getReadingTime()]) . '
    ' . + '
    ' . $this->translator->trans('entry.metadata.added_on') . '
    ' . $entry->getCreatedAt()->format('Y-m-d') . '
    ' . + '
    ' . $this->translator->trans('entry.metadata.address') . '
    ' . $entry->getUrl() . '
    ' . + '
    ' . + $bookEnd; $book->addChapter("Entry {$i} of {$entryCount}", "{$filename}_cover.html", $titlepage, true, EPub::EXTERNAL_REF_ADD); $chapter = $content_start . $entry->getContent() . $bookEnd; -- cgit v1.2.3 From af83d05ce2bfda2a00bd764f5717d77824325d33 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 6 Jan 2019 23:28:39 +0100 Subject: Add translations Signed-off-by: Kevin Decherf --- src/Wallabag/CoreBundle/Resources/translations/messages.da.yml | 6 ++++++ src/Wallabag/CoreBundle/Resources/translations/messages.de.yml | 6 ++++++ src/Wallabag/CoreBundle/Resources/translations/messages.en.yml | 6 ++++++ src/Wallabag/CoreBundle/Resources/translations/messages.es.yml | 6 ++++++ src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml | 6 ++++++ src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml | 6 ++++++ src/Wallabag/CoreBundle/Resources/translations/messages.it.yml | 6 ++++++ src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml | 6 ++++++ src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml | 8 +++++++- src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml | 6 ++++++ src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml | 6 ++++++ src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml | 9 +++++++++ src/Wallabag/CoreBundle/Resources/translations/messages.th.yml | 6 ++++++ src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml | 6 ++++++ 14 files changed, 88 insertions(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index e3ff21f1..97eb874d 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -253,6 +253,11 @@ entry: confirm: # delete: "Are you sure you want to remove that article?" # delete_tag: "Are you sure you want to remove that tag from that article?" + metadata: + # reading_time: "Estimated reading time" + # reading_time_minutes_short: "%readingTime% min" + # address: "Address" + # added_on: "Added on" about: page_title: 'Om' @@ -402,6 +407,7 @@ tag: # export: # footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' +# unknown: 'Unknown' import: # page_title: 'Import' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index c297ffb5..0cf3b138 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -253,6 +253,11 @@ entry: confirm: delete: 'Bist du sicher, dass du diesen Artikel löschen möchtest?' delete_tag: 'Bist du sicher, dass du diesen Tag vom Artikel entfernen möchtest?' + metadata: + # reading_time: "Estimated reading time" + # reading_time_minutes_short: "%readingTime% min" + # address: "Address" + # added_on: "Added on" about: page_title: 'Über' @@ -402,6 +407,7 @@ tag: export: footer_template: '

    Generiert von wallabag mit Hilfe von %method%

    Bitte öffne ein Ticket wenn du ein Problem mit der Darstellung von diesem E-Book auf deinem Gerät hast.

    ' + # unknown: 'Unknown' import: page_title: 'Importieren' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 169ae728..6085be14 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -253,6 +253,11 @@ entry: confirm: delete: "Are you sure you want to remove that article?" delete_tag: "Are you sure you want to remove that tag from that article?" + metadata: + reading_time: "Estimated reading time" + reading_time_minutes_short: "%readingTime% min" + address: "Address" + added_on: "Added on" about: page_title: 'About' @@ -402,6 +407,7 @@ tag: export: footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' + unknown: 'Unknown' import: page_title: 'Import' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 039a1867..f2a8fb89 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -253,6 +253,11 @@ entry: confirm: # delete: "Are you sure you want to remove that article?" # delete_tag: "Are you sure you want to remove that tag from that article?" + metadata: + # reading_time: "Estimated reading time" + # reading_time_minutes_short: "%readingTime% min" + # address: "Address" + # added_on: "Added on" about: page_title: 'Acerca de' @@ -402,6 +407,7 @@ tag: # export: # footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' +# unknown: 'Unknown' import: page_title: 'Importar' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index b3f2eb58..a5cbd7ec 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -253,6 +253,11 @@ entry: confirm: # delete: "Are you sure you want to remove that article?" # delete_tag: "Are you sure you want to remove that tag from that article?" + metadata: + # reading_time: "Estimated reading time" + # reading_time_minutes_short: "%readingTime% min" + # address: "Address" + # added_on: "Added on" about: page_title: 'درباره' @@ -402,6 +407,7 @@ tag: # export: # footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' +# unknown: 'Unknown' import: page_title: 'درون‌ریزی' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 5cdd836e..a36d84ae 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -253,6 +253,11 @@ entry: confirm: delete: "Voulez-vous vraiment supprimer cet article ?" delete_tag: "Voulez-vous vraiment supprimer ce tag de cet article ?" + metadata: + reading_time: "Durée de lecture estimée" + reading_time_minutes_short: "%readingTime% min" + address: "Adresse" + added_on: "Ajouté le" about: page_title: "À propos" @@ -402,6 +407,7 @@ tag: export: footer_template: '

    Généré par wallabag with %method%

    Merci d''ouvrir un ticket si vous rencontrez des soucis d''affichage avec ce document sur votre support.

    ' + unknown: 'Inconnu' import: page_title: "Importer" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 83b3edcd..1649c0e4 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -253,6 +253,11 @@ entry: confirm: delete: "Vuoi veramente rimuovere quell'articolo?" delete_tag: "Vuoi veramente rimuovere quell'etichetta da quell'articolo?" + metadata: + # reading_time: "Estimated reading time" + # reading_time_minutes_short: "%readingTime% min" + # address: "Address" + # added_on: "Added on" about: page_title: 'A proposito' @@ -402,6 +407,7 @@ tag: # export: # footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' +# unknown: 'Unknown' import: page_title: 'Importa' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 95bc9560..e2298f1f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -253,6 +253,11 @@ entry: confirm: delete: "Sètz segur de voler suprimir aqueste article ?" delete_tag: "Sètz segur de voler levar aquesta etiqueta de l'article ?" + metadata: + # reading_time: "Estimated reading time" + # reading_time_minutes_short: "%readingTime% min" + # address: "Address" + # added_on: "Added on" about: page_title: 'A prepaus' @@ -402,6 +407,7 @@ tag: export: footer_template: '

    Produch per wallabag amb %method%

    Mercés de dobrir una sollicitacion s’avètz de problèmas amb l’afichatge d’aqueste E-Book sus vòstre periferic.

    ' + # unknown: 'Unknown' import: page_title: 'Importar' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index a64e60b0..a5712733 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -253,6 +253,11 @@ entry: confirm: delete: "Czy jesteś pewien, że chcesz usunąć ten artykuł?" delete_tag: "Czy jesteś pewien, że chcesz usunąć ten tag, z tego artykułu?" + metadata: + # reading_time: "Estimated reading time" + # reading_time_minutes_short: "%readingTime% min" + # address: "Address" + # added_on: "Added on" about: page_title: 'O nas' @@ -401,7 +406,8 @@ tag: placeholder: 'Możesz dodać kilka tagów, oddzielając je przecinkami.' export: - footer_template: '

    Stworzone przez wallabag z %method%

    Proszę zgłoś sprawę, jeżeli masz problem z wyświetleniem tego e-booka na swoim urządzeniu.

    ' + footer_template: '

    Stworzone przez wallabag z %method%

    Proszę zgłoś sprawę, jeżeli masz problem z wyświetleniem tego e-booka na swoim urządzeniu.

    ' + # unknown: 'Unknown' import: page_title: 'Import' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 58d2d058..1ccf49e1 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -253,6 +253,11 @@ entry: confirm: # delete: "Are you sure you want to remove that article?" # delete_tag: "Are you sure you want to remove that tag from that article?" + metadata: + # reading_time: "Estimated reading time" + # reading_time_minutes_short: "%readingTime% min" + # address: "Address" + # added_on: "Added on" about: page_title: 'Sobre' @@ -402,6 +407,7 @@ tag: # export: # footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' +# unknown: 'Unknown' import: page_title: 'Importar' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index 564fed94..6c0e18e1 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -253,6 +253,11 @@ entry: confirm: # delete: "Are you sure you want to remove that article?" # delete_tag: "Are you sure you want to remove that tag from that article?" + metadata: + # reading_time: "Estimated reading time" + # reading_time_minutes_short: "%readingTime% min" + # address: "Address" + # added_on: "Added on" about: page_title: 'Despre' @@ -402,6 +407,7 @@ tag: # export: # footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' +# unknown: 'Unknown' import: # page_title: 'Import' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index 5f210c93..48753b55 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -241,6 +241,11 @@ entry: save_label: 'Сохранить' public: shared_by_wallabag: "Запись была опубликована wallabag" + metadata: + # reading_time: "Estimated reading time" + # reading_time_minutes_short: "%readingTime% min" + # address: "Address" + # added_on: "Added on" about: page_title: 'О' @@ -388,6 +393,10 @@ tag: add: 'Добавить' placeholder: 'Вы можете добавить несколько тегов, разделенных запятой.' +# export: +# footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' +# unknown: 'Unknown' + import: page_title: 'Импорт' page_description: 'Добро пожаловать в импортер wallabag. Выберите сервис, из которого вы хотите перенести данные.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index 9d22f90d..5524b1f1 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -251,6 +251,11 @@ entry: confirm: delete: "คุณแน่ใจหรือไม่ว่าคุณต้องการลบบทความนี้?" delete_tag: "คุณแน่ใจหรือไม่ว่าคุณต้องการลบแท็กจากบทความนี้?" + metadata: + # reading_time: "Estimated reading time" + # reading_time_minutes_short: "%readingTime% min" + # address: "Address" + # added_on: "Added on" about: page_title: 'เกี่ยวกับ' @@ -400,6 +405,7 @@ tag: export: footer_template: '

    ผลิตโดย wallabag กับ %method%

    ให้ทำการเปิด ฉบับนี้ ถ้าคุณมีข้อบกพร่องif you have trouble with the display of this E-Book on your device.

    ' + # unknown: 'Unknown' import: page_title: 'นำข้อมูลเช้า' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 4c71f0b9..e2156d47 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -251,6 +251,11 @@ entry: confirm: # delete: "Are you sure you want to remove that article?" # delete_tag: "Are you sure you want to remove that tag from that article?" + metadata: + # reading_time: "Estimated reading time" + # reading_time_minutes_short: "%readingTime% min" + # address: "Address" + # added_on: "Added on" about: page_title: 'Hakkımızda' @@ -400,6 +405,7 @@ tag: # export: # footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' +# unknown: 'Unknown' import: page_title: 'İçe Aktar' -- cgit v1.2.3 From ad5ef8bca0c0321f348dcf402e0a20791eca3f4d Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Mon, 7 Jan 2019 23:36:41 +0100 Subject: EntriesExport/pdf: move notice to the end, add metadata cover Signed-off-by: Kevin Decherf --- src/Wallabag/CoreBundle/Helper/EntriesExport.php | 33 ++++++++++++++++++------ 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index 9cde27c6..1debdf8e 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -299,14 +299,6 @@ class EntriesExport $pdf->SetSubject('Articles via wallabag'); $pdf->SetKeywords('wallabag'); - /* - * Front page - */ - $pdf->AddPage(); - $intro = '

    ' . $this->title . '

    ' . $this->getExportInformation('tcpdf'); - - $pdf->writeHTMLCell(0, 0, '', '', $intro, 0, 1, 0, true, '', true); - /* * Adding actual entries */ @@ -315,6 +307,23 @@ class EntriesExport $pdf->SetKeywords($tag->getLabel()); } + $publishedBy = $entry->getPublishedBy(); + if (!empty($publishedBy)) { + $authors = implode(',', $publishedBy); + } else { + $authors = $this->translator->trans('export.unknown'); + } + + $pdf->addPage(); + $html = '

    ' . $entry->getTitle() . '

    ' . + '
    ' . + '
    ' . $this->translator->trans('entry.view.published_by') . '
    ' . $authors . '
    ' . + '
    ' . $this->translator->trans('entry.metadata.reading_time') . '
    ' . $this->translator->trans('entry.metadata.reading_time_minutes_short', ['%readingTime%' => $entry->getReadingTime()]) . '
    ' . + '
    ' . $this->translator->trans('entry.metadata.added_on') . '
    ' . $entry->getCreatedAt()->format('Y-m-d') . '
    ' . + '
    ' . $this->translator->trans('entry.metadata.address') . '
    ' . $entry->getUrl() . '
    ' . + '
    '; + $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true); + $pdf->AddPage(); $html = '

    ' . $entry->getTitle() . '

    '; $html .= $entry->getContent(); @@ -322,6 +331,14 @@ class EntriesExport $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true); } + /* + * Last page + */ + $pdf->AddPage(); + $html = $this->getExportInformation('tcpdf'); + + $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true); + // set image scale factor $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); -- cgit v1.2.3 From dac93644e8585cc6b2ea1a0409b11ed82bb8169d Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Mon, 7 Jan 2019 23:50:08 +0100 Subject: EntriesExport: sanitize filename and fix tests Filename will now only use a-zA-Z0-9-' and space. Fixes remaining filename issue on #3811 Signed-off-by: Kevin Decherf --- src/Wallabag/CoreBundle/Helper/EntriesExport.php | 28 +++++++++++++++--------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index 1debdf8e..1a611199 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -223,7 +223,7 @@ class EntriesExport [ 'Content-Description' => 'File Transfer', 'Content-type' => 'application/epub+zip', - 'Content-Disposition' => 'attachment; filename="' . $this->title . '.epub"', + 'Content-Disposition' => 'attachment; filename="' . $this->getSanitizedFilename() . '.epub"', 'Content-Transfer-Encoding' => 'binary', ] ); @@ -265,9 +265,6 @@ class EntriesExport } $mobi->setContentProvider($content); - // the browser inside Kindle Devices doesn't likes special caracters either, we limit to A-z/0-9 - $this->title = preg_replace('/[^A-Za-z0-9\-]/', '', $this->title); - return Response::create( $mobi->toString(), 200, @@ -275,7 +272,7 @@ class EntriesExport 'Accept-Ranges' => 'bytes', 'Content-Description' => 'File Transfer', 'Content-type' => 'application/x-mobipocket-ebook', - 'Content-Disposition' => 'attachment; filename="' . $this->title . '.mobi"', + 'Content-Disposition' => 'attachment; filename="' . $this->getSanitizedFilename() . '.mobi"', 'Content-Transfer-Encoding' => 'binary', ] ); @@ -348,7 +345,7 @@ class EntriesExport [ 'Content-Description' => 'File Transfer', 'Content-type' => 'application/pdf', - 'Content-Disposition' => 'attachment; filename="' . $this->title . '.pdf"', + 'Content-Disposition' => 'attachment; filename="' . $this->getSanitizedFilename() . '.pdf"', 'Content-Transfer-Encoding' => 'binary', ] ); @@ -394,7 +391,7 @@ class EntriesExport 200, [ 'Content-type' => 'application/csv', - 'Content-Disposition' => 'attachment; filename="' . $this->title . '.csv"', + 'Content-Disposition' => 'attachment; filename="' . $this->getSanitizedFilename() . '.csv"', 'Content-Transfer-Encoding' => 'UTF-8', ] ); @@ -412,7 +409,7 @@ class EntriesExport 200, [ 'Content-type' => 'application/json', - 'Content-Disposition' => 'attachment; filename="' . $this->title . '.json"', + 'Content-Disposition' => 'attachment; filename="' . $this->getSanitizedFilename() . '.json"', 'Content-Transfer-Encoding' => 'UTF-8', ] ); @@ -430,7 +427,7 @@ class EntriesExport 200, [ 'Content-type' => 'application/xml', - 'Content-Disposition' => 'attachment; filename="' . $this->title . '.xml"', + 'Content-Disposition' => 'attachment; filename="' . $this->getSanitizedFilename() . '.xml"', 'Content-Transfer-Encoding' => 'UTF-8', ] ); @@ -456,7 +453,7 @@ class EntriesExport 200, [ 'Content-type' => 'text/plain', - 'Content-Disposition' => 'attachment; filename="' . $this->title . '.txt"', + 'Content-Disposition' => 'attachment; filename="' . $this->getSanitizedFilename() . '.txt"', 'Content-Transfer-Encoding' => 'UTF-8', ] ); @@ -499,4 +496,15 @@ class EntriesExport return str_replace('%IMAGE%', '', $info); } + + /** + * Return a sanitized version of the title by applying translit iconv + * and removing non alphanumeric characters, - and space. + * + * @return string Sanitized filename + */ + private function getSanitizedFilename() + { + return preg_replace('/[^A-Za-z0-9\- \']/', '', iconv('utf-8', 'us-ascii//TRANSLIT', $this->title)); + } } -- cgit v1.2.3 From 5e1f27767bc2dcf0760bc3061544ecbb833ad5e7 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Wed, 9 Jan 2019 16:26:19 +0100 Subject: EntriesExport: avoid else on $authors Signed-off-by: Kevin Decherf --- src/Wallabag/CoreBundle/Helper/EntriesExport.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index 1a611199..64591687 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -189,10 +189,9 @@ class EntriesExport $filename = sha1($entry->getTitle()); $publishedBy = $entry->getPublishedBy(); + $authors = $this->translator->trans('export.unknown'); if (!empty($publishedBy)) { $authors = implode(',', $publishedBy); - } else { - $authors = $this->translator->trans('export.unknown'); } $titlepage = $content_start . @@ -305,10 +304,9 @@ class EntriesExport } $publishedBy = $entry->getPublishedBy(); + $authors = $this->translator->trans('export.unknown'); if (!empty($publishedBy)) { $authors = implode(',', $publishedBy); - } else { - $authors = $this->translator->trans('export.unknown'); } $pdf->addPage(); -- cgit v1.2.3 From 3a2d4cf9fda87760c86320a7f8a5041d1d4256c6 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 9 Jan 2019 23:29:30 +0100 Subject: Cast client id to avoid PG error If someone send a malformated client_id when trying to authenticate using the API we got a 500 if wallabag use postgres because the request send a string instead of an integer. --- src/Wallabag/ApiBundle/Entity/Client.php | 2 +- .../ApiBundle/Repository/ClientRepository.php | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/Wallabag/ApiBundle/Repository/ClientRepository.php (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Entity/Client.php b/src/Wallabag/ApiBundle/Entity/Client.php index e6f98f98..78349820 100644 --- a/src/Wallabag/ApiBundle/Entity/Client.php +++ b/src/Wallabag/ApiBundle/Entity/Client.php @@ -11,7 +11,7 @@ use Wallabag\UserBundle\Entity\User; /** * @ORM\Table("oauth2_clients") - * @ORM\Entity + * @ORM\Entity(repositoryClass="Wallabag\ApiBundle\Repository\ClientRepository") */ class Client extends BaseClient { diff --git a/src/Wallabag/ApiBundle/Repository/ClientRepository.php b/src/Wallabag/ApiBundle/Repository/ClientRepository.php new file mode 100644 index 00000000..fc14262e --- /dev/null +++ b/src/Wallabag/ApiBundle/Repository/ClientRepository.php @@ -0,0 +1,19 @@ + Date: Thu, 10 Jan 2019 04:23:08 +0100 Subject: Update entries.html.twig Should fix https://github.com/wallabag/wallabag/issues/3832 --- .../Resources/views/themes/material/Entry/entries.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') 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 a137f3c3..742dd330 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 @@ -68,8 +68,8 @@ {% if craue_setting('export_epub') %}
  • EPUB
  • {% endif %} {% if craue_setting('export_mobi') %}
  • MOBI
  • {% endif %} {% if craue_setting('export_pdf') %}
  • PDF
  • {% endif %} - {% if craue_setting('export_csv') %}
  • JSON
  • {% endif %} - {% if craue_setting('export_json') %}
  • CSV
  • {% endif %} + {% if craue_setting('export_json') %}
  • JSON
  • {% endif %} + {% if craue_setting('export_csv') %}
  • CSV
  • {% endif %} {% if craue_setting('export_txt') %}
  • TXT
  • {% endif %} {% if craue_setting('export_xml') %}
  • XML
  • {% endif %}
-- cgit v1.2.3 From bb8ad42b279531a4437ab283e3b995bfa88ea87f Mon Sep 17 00:00:00 2001 From: Eloi Coutant Date: Thu, 10 Jan 2019 04:25:51 +0100 Subject: Update entries.html.twig Should fix https://github.com/wallabag/wallabag/issues/3832 --- .../CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') 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 cfc6644b..832112be 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 @@ -99,8 +99,8 @@ {% if craue_setting('export_epub') %}
  • EPUB
  • {% endif %} {% if craue_setting('export_mobi') %}
  • MOBI
  • {% endif %} {% if craue_setting('export_pdf') %}
  • PDF
  • {% endif %} - {% if craue_setting('export_csv') %}
  • JSON
  • {% endif %} - {% if craue_setting('export_json') %}
  • CSV
  • {% endif %} + {% if craue_setting('export_json') %}
  • JSON
  • {% endif %} + {% if craue_setting('export_csv') %}
  • CSV
  • {% endif %} {% if craue_setting('export_txt') %}
  • TXT
  • {% endif %} {% if craue_setting('export_xml') %}
  • XML
  • {% endif %} -- cgit v1.2.3 From 78e3fafa3fab86638295fe1ee2a05a559bf56ab1 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 14 Jan 2019 17:01:21 +0100 Subject: Avoid error when a bad `order` parameter is given Only allowed parameter are asc & desc --- .../ApiBundle/Controller/EntryRestController.php | 31 +++++++++++++--------- .../CoreBundle/Repository/EntryRepository.php | 6 ++++- 2 files changed, 23 insertions(+), 14 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 0b4e74a0..b2bad406 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -9,6 +9,7 @@ use Nelmio\ApiDocBundle\Annotation\ApiDoc; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Wallabag\CoreBundle\Entity\Entry; @@ -98,24 +99,28 @@ class EntryRestController extends WallabagRestController $isArchived = (null === $request->query->get('archive')) ? null : (bool) $request->query->get('archive'); $isStarred = (null === $request->query->get('starred')) ? null : (bool) $request->query->get('starred'); $isPublic = (null === $request->query->get('public')) ? null : (bool) $request->query->get('public'); - $sort = $request->query->get('sort', 'created'); - $order = $request->query->get('order', 'desc'); + $sort = strtolower($request->query->get('sort', 'created')); + $order = strtolower($request->query->get('order', 'desc')); $page = (int) $request->query->get('page', 1); $perPage = (int) $request->query->get('perPage', 30); $tags = \is_array($request->query->get('tags')) ? '' : (string) $request->query->get('tags', ''); $since = $request->query->get('since', 0); - /** @var \Pagerfanta\Pagerfanta $pager */ - $pager = $this->get('wallabag_core.entry_repository')->findEntries( - $this->getUser()->getId(), - $isArchived, - $isStarred, - $isPublic, - $sort, - $order, - $since, - $tags - ); + try { + /** @var \Pagerfanta\Pagerfanta $pager */ + $pager = $this->get('wallabag_core.entry_repository')->findEntries( + $this->getUser()->getId(), + $isArchived, + $isStarred, + $isPublic, + $sort, + $order, + $since, + $tags + ); + } catch (\Exception $e) { + throw new BadRequestHttpException($e->getMessage()); + } $pager->setMaxPerPage($perPage); $pager->setCurrentPage($page); diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 83379998..cebce714 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -142,7 +142,7 @@ class EntryRepository extends EntityRepository * * @return Pagerfanta */ - public function findEntries($userId, $isArchived = null, $isStarred = null, $isPublic = null, $sort = 'created', $order = 'ASC', $since = 0, $tags = '') + public function findEntries($userId, $isArchived = null, $isStarred = null, $isPublic = null, $sort = 'created', $order = 'asc', $since = 0, $tags = '') { $qb = $this->createQueryBuilder('e') ->leftJoin('e.tags', 't') @@ -185,6 +185,10 @@ class EntryRepository extends EntityRepository } } + if (!\in_array(strtolower($order), ['asc', 'desc'], true)) { + throw new \Exception('Order "' . $order . '" parameter is wrong, allowed: asc or desc'); + } + if ('created' === $sort) { $qb->orderBy('e.id', $order); } elseif ('updated' === $sort) { -- cgit v1.2.3 From 3afc87426dade0eaeccf69d144a119c6f0c4534f Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 15 Jan 2019 09:49:22 +0100 Subject: CS --- src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php | 2 +- src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php | 2 +- src/Wallabag/ImportBundle/Import/InstapaperImport.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php b/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php index 1c2c5093..183d394a 100644 --- a/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php +++ b/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php @@ -23,7 +23,7 @@ class PreparePagerForEntries * @param AdapterInterface $adapter * @param User $user If user isn't logged in, we can force it (like for rss) * - * @return null|Pagerfanta + * @return Pagerfanta|null */ public function prepare(AdapterInterface $adapter, User $user = null) { diff --git a/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php b/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php index 36906761..b2e212a4 100644 --- a/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php +++ b/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php @@ -22,7 +22,7 @@ class SiteCredentialRepository extends \Doctrine\ORM\EntityRepository * @param string $host * @param int $userId * - * @return null|array + * @return array|null */ public function findOneByHostAndUser($host, $userId) { diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php index df1d6666..44c034f8 100644 --- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php +++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php @@ -62,7 +62,7 @@ class InstapaperImport extends AbstractImport } $entries = []; - $handle = fopen($this->filepath, 'rb'); + $handle = fopen($this->filepath, 'r'); while (false !== ($data = fgetcsv($handle, 10240))) { if ('URL' === $data[0]) { continue; -- cgit v1.2.3 From 3bd65991adc253715c6b74ab0ee19ff2cf3e6c69 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 15 Jan 2019 10:17:11 +0100 Subject: Add a new endpoint to retrieve information from the wallabag instance Useful for api client which required some information. We might add more inside them in the future. The endpoint /api/version should be avoided now as it contains not so much information rather the version. --- .../ApiBundle/Controller/WallabagRestController.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index 7d8cfbba..3c7ad0cf 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php @@ -14,6 +14,8 @@ class WallabagRestController extends FOSRestController * * @ApiDoc() * + * @deprecated Should use info endpoint instead + * * @return JsonResponse */ public function getVersionAction() @@ -24,6 +26,24 @@ class WallabagRestController extends FOSRestController return (new JsonResponse())->setJson($json); } + /** + * Retrieve information about the wallabag instance. + * + * @ApiDoc() + * + * @return JsonResponse + */ + public function getInfoAction() + { + $info = [ + 'appname' => 'wallabag', + 'version' => $this->container->getParameter('wallabag_core.version'), + 'allowed_registration' => $this->container->getParameter('wallabag_user.registration_enabled'), + ]; + + return (new JsonResponse())->setJson($this->get('jms_serializer')->serialize($info, 'json')); + } + protected function validateAuthentication() { if (false === $this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY')) { -- cgit v1.2.3 From 293730656d696dab8cdbc8447a0e970a58ff77d2 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 18 Jan 2019 11:14:28 +0100 Subject: Add dedicated email for site config issue Instead of sending an email to the devs, it now creates an issue on GitHub using a zap from zapier. --- .../CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig | 2 +- .../CoreBundle/Resources/views/themes/material/Entry/entry.html.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') 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 e7d42b3d..e87ba201 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 @@ -38,7 +38,7 @@ {% if craue_setting('export_epub') %}
  • EPUB
  • {% endif %} {% if craue_setting('export_mobi') %}
  • MOBI
  • {% endif %} {% if craue_setting('export_pdf') %}
  • PDF
  • {% endif %} -
  • {{ 'entry.view.left_menu.problem.label'|trans }}
  • +
  • {{ 'entry.view.left_menu.problem.label'|trans }}
  • 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 c6c19de6..15b4d82f 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 @@ -209,7 +209,7 @@
  • - + error {{ 'entry.view.left_menu.problem.label'|trans }} -- cgit v1.2.3 From 1e0d8ad7b728f6fb2cd886526b0fb84ef803e84f Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 17 Jan 2019 14:28:05 +0100 Subject: Enable PHPStan - Fix error for level 0 & 1 (level 7 has 699 errors...) - Add `updated_at` to site_credential (so the `timestamps()` method applies correctly) --- src/Wallabag/CoreBundle/Command/InstallCommand.php | 3 ++- src/Wallabag/CoreBundle/Entity/SiteCredential.php | 17 +++++++++++++++++ src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 3c76545c..49c84178 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -94,8 +94,9 @@ class InstallCommand extends ContainerAwareCommand $status = 'OK!'; $help = ''; + $conn = $this->getContainer()->get('doctrine')->getManager()->getConnection(); + try { - $conn = $this->getContainer()->get('doctrine')->getManager()->getConnection(); $conn->connect(); } catch (\Exception $e) { if (false === strpos($e->getMessage(), 'Unknown database') diff --git a/src/Wallabag/CoreBundle/Entity/SiteCredential.php b/src/Wallabag/CoreBundle/Entity/SiteCredential.php index ac714359..dee48fd5 100644 --- a/src/Wallabag/CoreBundle/Entity/SiteCredential.php +++ b/src/Wallabag/CoreBundle/Entity/SiteCredential.php @@ -59,6 +59,13 @@ class SiteCredential */ private $createdAt; + /** + * @var \DateTime + * + * @ORM\Column(name="updated_at", type="datetime") + */ + private $updatedAt; + /** * @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="siteCredentials") */ @@ -178,6 +185,16 @@ class SiteCredential return $this->createdAt; } + /** + * Get updatedAt. + * + * @return \DateTime + */ + public function getUpdatedAt() + { + return $this->updatedAt; + } + /** * @return User */ diff --git a/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php b/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php index 63f65067..fbdf2ac7 100644 --- a/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php +++ b/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php @@ -6,6 +6,7 @@ use Psr\Log\LoggerInterface; use RulerZ\RulerZ; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Tag; +use Wallabag\CoreBundle\Entity\TaggingRule; use Wallabag\CoreBundle\Repository\EntryRepository; use Wallabag\CoreBundle\Repository\TagRepository; use Wallabag\UserBundle\Entity\User; -- cgit v1.2.3 From 09ef25c3c3882db94b3941f3ba33ebc78b5dbe4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 22 Dec 2017 15:44:00 +0100 Subject: Added random feature --- .../CoreBundle/Controller/EntryController.php | 105 +++++++++++++++++++++ .../CoreBundle/Repository/EntryRepository.php | 46 ++++++++- .../Resources/translations/messages.da.yml | 1 + .../Resources/translations/messages.de.yml | 1 + .../Resources/translations/messages.en.yml | 1 + .../Resources/translations/messages.es.yml | 1 + .../Resources/translations/messages.fa.yml | 1 + .../Resources/translations/messages.fr.yml | 1 + .../Resources/translations/messages.it.yml | 1 + .../Resources/translations/messages.oc.yml | 1 + .../Resources/translations/messages.pl.yml | 1 + .../Resources/translations/messages.pt.yml | 1 + .../Resources/translations/messages.ro.yml | 1 + .../Resources/translations/messages.ru.yml | 1 + .../Resources/translations/messages.th.yml | 1 + .../Resources/translations/messages.tr.yml | 1 + .../views/themes/baggy/Entry/entries.html.twig | 7 +- .../views/themes/material/Entry/entries.html.twig | 7 +- 18 files changed, 169 insertions(+), 10 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index ac372a33..6c843ba7 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -2,6 +2,7 @@ namespace Wallabag\CoreBundle\Controller; +use Doctrine\ORM\NoResultException; use Pagerfanta\Adapter\DoctrineORMAdapter; use Pagerfanta\Exception\OutOfRangeCurrentPageException; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; @@ -232,6 +233,110 @@ class EntryController extends Controller return $this->showEntries('starred', $request, $page); } + /** + * Shows random unread entry. + * + * @param Entry $entry + * + * @Route("/unread/random", name="unread_random") + * + * @return \Symfony\Component\HttpFoundation\Response + */ + public function showRandomUnreadEntryAction() + { + $repository = $this->get('wallabag_core.entry_repository'); + + try { + $entry = $repository->getRandomEntry($this->getUser()->getId(), 'unread'); + } catch (NoResultException $e) { + $bag = $this->get('session')->getFlashBag(); + $bag->clear(); + $bag->add('notice', 'flashes.entry.notice.no_random_entry'); + + return $this->redirect($this->generateUrl('homepage')); + } + + return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()])); + } + + /** + * Shows random favorite entry. + * + * @param Entry $entry + * + * @Route("/starred/random", name="starred_random") + * + * @return \Symfony\Component\HttpFoundation\Response + */ + public function showRandomStarredEntryAction() + { + $repository = $this->get('wallabag_core.entry_repository'); + + try { + $entry = $repository->getRandomEntry($this->getUser()->getId(), 'starred'); + } catch (NoResultException $e) { + $bag = $this->get('session')->getFlashBag(); + $bag->clear(); + $bag->add('notice', 'flashes.entry.notice.no_random_entry'); + + return $this->redirect($this->generateUrl('homepage')); + } + + return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()])); + } + + /** + * Shows random archived entry. + * + * @param Entry $entry + * + * @Route("/archive/random", name="archive_random") + * + * @return \Symfony\Component\HttpFoundation\Response + */ + public function showRandomArchiveEntryAction() + { + $repository = $this->get('wallabag_core.entry_repository'); + + try { + $entry = $repository->getRandomEntry($this->getUser()->getId(), 'starred'); + } catch (NoResultException $e) { + $bag = $this->get('session')->getFlashBag(); + $bag->clear(); + $bag->add('notice', 'flashes.entry.notice.no_random_entry'); + + return $this->redirect($this->generateUrl('homepage')); + } + + return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()])); + } + + /** + * Shows random all entry. + * + * @param Entry $entry + * + * @Route("/all/random", name="all_random") + * + * @return \Symfony\Component\HttpFoundation\Response + */ + public function showRandomAllEntryAction() + { + $repository = $this->get('wallabag_core.entry_repository'); + + try { + $entry = $repository->getRandomEntry($this->getUser()->getId()); + } catch (NoResultException $e) { + $bag = $this->get('session')->getFlashBag(); + $bag->clear(); + $bag->add('notice', 'flashes.entry.notice.no_random_entry'); + + return $this->redirect($this->generateUrl('homepage')); + } + + return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()])); + } + /** * Shows entry content. * diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 8b6cf443..a26de0a8 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -110,8 +110,7 @@ class EntryRepository extends EntityRepository */ public function getBuilderForUntaggedByUser($userId) { - return $this - ->sortQueryBuilder($this->getRawBuilderForUntaggedByUser($userId)); + return $this->sortQueryBuilder($this->getRawBuilderForUntaggedByUser($userId)); } /** @@ -432,6 +431,46 @@ class EntryRepository extends EntityRepository ->getResult(); } + /** + * Returns a random entry, filtering by status. + * + * @param $userId + * @param string $status can be unread, archive or starred + * + * @throws \Doctrine\ORM\NoResultException + * @throws \Doctrine\ORM\NonUniqueResultException + * + * @return Entry + */ + public function getRandomEntry($userId, $status = '') + { + $max = $this->getEntityManager() + ->createQuery('SELECT MAX(e.id) FROM Wallabag\CoreBundle\Entity\Entry e WHERE e.user = :userId') + ->setParameter('userId', $userId) + ->getSingleScalarResult(); + + $qb = $this->createQueryBuilder('e') + ->where('e.user = :user_id')->setParameter('user_id', $userId); + + if ('unread' === $status) { + $qb->andWhere('e.isArchived = false'); + } + + if ('archive' === $status) { + $qb->andWhere('e.isArchived = true'); + } + + if ('starred' === $status) { + $qb->andWhere('e.isStarred = true'); + } + + return $qb->andWhere('e.id >= :rand') + ->setParameter('rand', rand(0, $max)) + ->setMaxResults(1) + ->getQuery() + ->getSingleResult(); + } + /** * Return a query builder to be used by other getBuilderFor* method. * @@ -470,7 +509,6 @@ class EntryRepository extends EntityRepository */ private function sortQueryBuilder(QueryBuilder $qb, $sortBy = 'createdAt', $direction = 'desc') { - return $qb - ->orderBy(sprintf('e.%s', $sortBy), $direction); + return $qb->orderBy(sprintf('e.%s', $sortBy), $direction); } } diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index 4cf69916..0099148a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -590,6 +590,7 @@ flashes: entry_starred: 'Artikel markeret som favorit' entry_unstarred: 'Artikel ikke længere markeret som favorit' entry_deleted: 'Artikel slettet' + # no_random_entry: 'No article with these criterias was found' tag: notice: # tag_added: 'Tag added' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 10981788..5e531b78 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -590,6 +590,7 @@ flashes: entry_starred: 'Eintrag favorisiert' entry_unstarred: 'Eintrag defavorisiert' entry_deleted: 'Eintrag gelöscht' + # no_random_entry: 'No article with these criterias was found' tag: notice: tag_added: 'Tag hinzugefügt' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 95e10faf..2b952bd5 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -590,6 +590,7 @@ flashes: entry_starred: 'Entry starred' entry_unstarred: 'Entry unstarred' entry_deleted: 'Entry deleted' + no_random_entry: 'No article with these criterias was found' tag: notice: tag_added: 'Tag added' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index c95bee5b..2e2fbb93 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -590,6 +590,7 @@ flashes: entry_starred: 'Artículo marcado como favorito' entry_unstarred: 'Artículo desmarcado como favorito' entry_deleted: 'Artículo eliminado' + # no_random_entry: 'No article with these criterias was found' tag: notice: tag_added: 'Etiqueta añadida' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index 4fde53dd..c58bbccb 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -590,6 +590,7 @@ flashes: entry_starred: 'مقاله برگزیده شد' entry_unstarred: 'مقاله نابرگزیده شد' entry_deleted: 'مقاله پاک شد' + # no_random_entry: 'No article with these criterias was found' tag: notice: tag_added: 'برچسب افزوده شد' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index edf3ac35..c3887f24 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -590,6 +590,7 @@ flashes: entry_starred: "Article ajouté dans les favoris" entry_unstarred: "Article retiré des favoris" entry_deleted: "Article supprimé" + no_random_entry: "Aucun article correspond aux critères n'a été trouvé" tag: notice: tag_added: "Tag ajouté" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index f178ddbf..c2135ac0 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -590,6 +590,7 @@ flashes: entry_starred: 'Contenuto segnato come preferito' entry_unstarred: 'Contenuto rimosso dai preferiti' entry_deleted: 'Contenuto eliminato' + # no_random_entry: 'No article with these criterias was found' tag: notice: tag_added: 'Etichetta aggiunta' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index a1220f52..6e2c1cf9 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -590,6 +590,7 @@ flashes: entry_starred: 'Article ajustat dins los favorits' entry_unstarred: 'Article quitat dels favorits' entry_deleted: 'Article suprimit' + # no_random_entry: 'No article with these criterias was found' tag: notice: tag_added: 'Etiqueta ajustada' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index b6f7faf7..18156cbe 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -590,6 +590,7 @@ flashes: entry_starred: 'Wpis oznaczony gwiazdką' entry_unstarred: 'Wpis odznaczony gwiazdką' entry_deleted: 'Wpis usunięty' + # no_random_entry: 'No article with these criterias was found' tag: notice: tag_added: 'Tag dodany' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 78df254f..8493af47 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -590,6 +590,7 @@ flashes: entry_starred: 'Entrada destacada' entry_unstarred: 'Entrada não destacada' entry_deleted: 'Entrada apagada' + # no_random_entry: 'No article with these criterias was found' tag: notice: tag_added: 'Tag adicionada' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index 8312ca15..8fba13dc 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -590,6 +590,7 @@ flashes: entry_starred: 'Articol adăugat la favorite' entry_unstarred: 'Articol șters de la favorite' entry_deleted: 'Articol șters' + # no_random_entry: 'No article with these criterias was found' tag: notice: # tag_added: 'Tag added' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index f14aad12..56a63b14 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -555,6 +555,7 @@ flashes: entry_starred: 'Запись помечена звездочкой' entry_unstarred: 'Пометка звездочкой у записи убрана' entry_deleted: 'Запись удалена' + # no_random_entry: 'No article with these criterias was found' tag: notice: tag_added: 'Тег добавлен' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index 7dbb1399..9f0a6532 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -588,6 +588,7 @@ flashes: entry_starred: 'รายการที่แสดง' entry_unstarred: 'รายการที่ไม่ได้แสดง' entry_deleted: 'รายการที่ถูกลบ' + # no_random_entry: 'No article with these criterias was found' tag: notice: tag_added: 'แท็กที่เพิ่ม' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index b4bc04d0..a2093223 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -568,6 +568,7 @@ flashes: entry_starred: 'Makale favorilere eklendi' entry_unstarred: 'Makale favorilerden çıkartıldı' entry_deleted: 'Makale silindi' + # no_random_entry: 'No article with these criterias was found' tag: notice: tag_added: 'Etiket eklendi' 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 832112be..7108efbd 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 @@ -20,11 +20,15 @@ {% block content %} {% set currentRoute = app.request.attributes.get('_route') %} + {% if currentRoute == 'homepage' %} + {% set currentRoute = 'unread' %} + {% endif %} {% set listMode = app.user.config.listMode %}
    {{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}
  • - shuffle + casino
  • {% endif %} -- cgit v1.2.3 From b32057980e33e7ddd93480017496a589006b8260 Mon Sep 17 00:00:00 2001 From: Craig Roberts Date: Mon, 9 Apr 2018 17:24:45 +0800 Subject: Fixes [wallabag/wallabag#2611] Add a basic Search REST endpoint - Adds a new `search` key to `src/Wallabag/ApiBundle/Resources/config/routing_rest.yml` - Reuses the `getBuilderForSearchByUser` method from the EntryRepository - Supports, `term`, `page`, and `perPage` query parameters - Some very basic tests --- .../ApiBundle/Controller/SearchRestController.php | 91 ++++++++++++++++++++++ .../ApiBundle/Resources/config/routing_rest.yml | 5 ++ 2 files changed, 96 insertions(+) create mode 100644 src/Wallabag/ApiBundle/Controller/SearchRestController.php (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/SearchRestController.php b/src/Wallabag/ApiBundle/Controller/SearchRestController.php new file mode 100644 index 00000000..c0b2cb24 --- /dev/null +++ b/src/Wallabag/ApiBundle/Controller/SearchRestController.php @@ -0,0 +1,91 @@ +validateAuthentication(); + + $term = $request->query->get('term'); + $page = (int) $request->query->get('page', 1); + $perPage = (int) $request->query->get('perPage', 30); + + $qb = $this->get('wallabag_core.entry_repository') + ->getBuilderForSearchByUser( + $this->getUser()->getId(), + $term, + null + ); + + $pagerAdapter = new DoctrineORMAdapter($qb->getQuery(), true, false); + $pager = new Pagerfanta($pagerAdapter); + + $pager->setMaxPerPage($perPage); + $pager->setCurrentPage($page); + + $pagerfantaFactory = new PagerfantaFactory('page', 'perPage'); + $paginatedCollection = $pagerfantaFactory->createRepresentation( + $pager, + new Route( + 'api_get_search', + [ + 'term' => $term, + 'page' => $page, + 'perPage' => $perPage, + ], + UrlGeneratorInterface::ABSOLUTE_URL + ) + ); + + return $this->sendResponse($paginatedCollection); + } + + /** + * Shortcut to send data serialized in json. + * + * @param mixed $data + * + * @return JsonResponse + */ + private function sendResponse($data) + { + // https://github.com/schmittjoh/JMSSerializerBundle/issues/293 + $context = new SerializationContext(); + $context->setSerializeNull(true); + + $json = $this->get('jms_serializer')->serialize($data, 'json', $context); + + return (new JsonResponse())->setJson($json); + } +} diff --git a/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml b/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml index c0283e71..06e62c37 100644 --- a/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml +++ b/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml @@ -3,6 +3,11 @@ entry: resource: "WallabagApiBundle:EntryRest" name_prefix: api_ +search: + type: rest + resource: "WallabagApiBundle:SearchRest" + name_prefix: api_ + tag: type: rest resource: "WallabagApiBundle:TagRest" -- cgit v1.2.3 From 9133bd02d11c37c98b2c7c979e363cc7bff8f914 Mon Sep 17 00:00:00 2001 From: Craig Roberts Date: Tue, 10 Apr 2018 19:50:26 +0800 Subject: [wallabag/wallabag#2611] Fix PHPCS lint errors --- src/Wallabag/ApiBundle/Controller/SearchRestController.php | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/SearchRestController.php b/src/Wallabag/ApiBundle/Controller/SearchRestController.php index c0b2cb24..6620107d 100644 --- a/src/Wallabag/ApiBundle/Controller/SearchRestController.php +++ b/src/Wallabag/ApiBundle/Controller/SearchRestController.php @@ -10,13 +10,7 @@ use Pagerfanta\Adapter\DoctrineORMAdapter; use Pagerfanta\Pagerfanta; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -use Wallabag\CoreBundle\Entity\Entry; -use Wallabag\CoreBundle\Entity\Tag; -use Wallabag\CoreBundle\Event\EntryDeletedEvent; -use Wallabag\CoreBundle\Event\EntrySavedEvent; class SearchRestController extends WallabagRestController { -- cgit v1.2.3 From 019e1acc4962229a538421b6f2b0643d03c1d72c Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 24 Oct 2018 20:11:45 +0200 Subject: Factorize sendResponse between Api controllers And run newer cs fixer --- .../ApiBundle/Controller/EntryRestController.php | 19 ------------------- .../ApiBundle/Controller/SearchRestController.php | 19 ------------------- .../ApiBundle/Controller/WallabagRestController.php | 19 +++++++++++++++++++ 3 files changed, 19 insertions(+), 38 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index f792aaf2..a79e852c 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -4,7 +4,6 @@ namespace Wallabag\ApiBundle\Controller; use Hateoas\Configuration\Route; use Hateoas\Representation\Factory\PagerfantaFactory; -use JMS\Serializer\SerializationContext; use Nelmio\ApiDocBundle\Annotation\ApiDoc; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; @@ -773,24 +772,6 @@ class EntryRestController extends WallabagRestController return $this->sendResponse($results); } - /** - * Shortcut to send data serialized in json. - * - * @param mixed $data - * - * @return JsonResponse - */ - private function sendResponse($data) - { - // https://github.com/schmittjoh/JMSSerializerBundle/issues/293 - $context = new SerializationContext(); - $context->setSerializeNull(true); - - $json = $this->get('jms_serializer')->serialize($data, 'json', $context); - - return (new JsonResponse())->setJson($json); - } - /** * Retrieve value from the request. * Used for POST & PATCH on a an entry. diff --git a/src/Wallabag/ApiBundle/Controller/SearchRestController.php b/src/Wallabag/ApiBundle/Controller/SearchRestController.php index 6620107d..f8da0ad4 100644 --- a/src/Wallabag/ApiBundle/Controller/SearchRestController.php +++ b/src/Wallabag/ApiBundle/Controller/SearchRestController.php @@ -4,7 +4,6 @@ namespace Wallabag\ApiBundle\Controller; use Hateoas\Configuration\Route; use Hateoas\Representation\Factory\PagerfantaFactory; -use JMS\Serializer\SerializationContext; use Nelmio\ApiDocBundle\Annotation\ApiDoc; use Pagerfanta\Adapter\DoctrineORMAdapter; use Pagerfanta\Pagerfanta; @@ -64,22 +63,4 @@ class SearchRestController extends WallabagRestController return $this->sendResponse($paginatedCollection); } - - /** - * Shortcut to send data serialized in json. - * - * @param mixed $data - * - * @return JsonResponse - */ - private function sendResponse($data) - { - // https://github.com/schmittjoh/JMSSerializerBundle/issues/293 - $context = new SerializationContext(); - $context->setSerializeNull(true); - - $json = $this->get('jms_serializer')->serialize($data, 'json', $context); - - return (new JsonResponse())->setJson($json); - } } diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index 3c7ad0cf..f18b0910 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php @@ -3,6 +3,7 @@ namespace Wallabag\ApiBundle\Controller; use FOS\RestBundle\Controller\FOSRestController; +use JMS\Serializer\SerializationContext; use Nelmio\ApiDocBundle\Annotation\ApiDoc; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\Exception\AccessDeniedException; @@ -64,4 +65,22 @@ class WallabagRestController extends FOSRestController throw $this->createAccessDeniedException('Access forbidden. Entry user id: ' . $requestUserId . ', logged user id: ' . $user->getId()); } } + + /** + * Shortcut to send data serialized in json. + * + * @param mixed $data + * + * @return JsonResponse + */ + protected function sendResponse($data) + { + // https://github.com/schmittjoh/JMSSerializerBundle/issues/293 + $context = new SerializationContext(); + $context->setSerializeNull(true); + + $json = $this->get('jms_serializer')->serialize($data, 'json', $context); + + return (new JsonResponse())->setJson($json); + } } -- cgit v1.2.3 From 801042544444d58580d87d04d5602797027153fc Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 24 Oct 2018 20:29:33 +0200 Subject: Fix third argument to Route --- src/Wallabag/ApiBundle/Controller/EntryRestController.php | 3 +-- src/Wallabag/ApiBundle/Controller/SearchRestController.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index a79e852c..16d8a40b 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -10,7 +10,6 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\HttpException; -use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Tag; use Wallabag\CoreBundle\Event\EntryDeletedEvent; @@ -140,7 +139,7 @@ class EntryRestController extends WallabagRestController 'tags' => $tags, 'since' => $since, ], - UrlGeneratorInterface::ABSOLUTE_URL + true ) ); diff --git a/src/Wallabag/ApiBundle/Controller/SearchRestController.php b/src/Wallabag/ApiBundle/Controller/SearchRestController.php index f8da0ad4..d9f99844 100644 --- a/src/Wallabag/ApiBundle/Controller/SearchRestController.php +++ b/src/Wallabag/ApiBundle/Controller/SearchRestController.php @@ -9,7 +9,6 @@ use Pagerfanta\Adapter\DoctrineORMAdapter; use Pagerfanta\Pagerfanta; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\Routing\Generator\UrlGeneratorInterface; class SearchRestController extends WallabagRestController { @@ -57,7 +56,7 @@ class SearchRestController extends WallabagRestController 'page' => $page, 'perPage' => $perPage, ], - UrlGeneratorInterface::ABSOLUTE_URL + true ) ); -- cgit v1.2.3 From acd4412080dfb73ecaa7f9983728d1d55bc27ea4 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 2 Dec 2018 08:54:54 +0100 Subject: Create a dedicated tab to reset data --- .../Resources/translations/messages.da.yml | 1 + .../Resources/translations/messages.de.yml | 1 + .../Resources/translations/messages.en.yml | 1 + .../Resources/translations/messages.es.yml | 1 + .../Resources/translations/messages.fa.yml | 1 + .../Resources/translations/messages.fr.yml | 1 + .../Resources/translations/messages.it.yml | 1 + .../Resources/translations/messages.oc.yml | 1 + .../Resources/translations/messages.pl.yml | 1 + .../Resources/translations/messages.pt.yml | 1 + .../Resources/translations/messages.ro.yml | 1 + .../Resources/translations/messages.ru.yml | 1 + .../Resources/translations/messages.th.yml | 1 + .../Resources/translations/messages.tr.yml | 1 + .../views/themes/material/Config/index.html.twig | 63 +++++++++++----------- 15 files changed, 46 insertions(+), 31 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index 5a770dff..96679a9c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -59,6 +59,7 @@ config: password: 'Adgangskode' # rules: 'Tagging rules' new_user: 'Tilføj bruger' + # reset: 'Reset area' form: save: 'Gem' form_settings: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 2ae8f08e..c56e87b5 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -59,6 +59,7 @@ config: password: 'Kennwort' rules: 'Tagging-Regeln' new_user: 'Benutzer hinzufügen' + reset: 'Zurücksetzen' form: save: 'Speichern' form_settings: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index d1d74159..d57cea0f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -59,6 +59,7 @@ config: password: 'Password' rules: 'Tagging rules' new_user: 'Add a user' + reset: 'Reset area' form: save: 'Save' form_settings: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 741d3e9f..e1c4e221 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -59,6 +59,7 @@ config: password: 'Contraseña' rules: 'Reglas de etiquetado automáticas' new_user: 'Añadir un usuario' + reset: 'Reiniciar mi cuenta' form: save: 'Guardar' form_settings: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index 2ef5dd52..2ede433e 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -59,6 +59,7 @@ config: password: 'رمز' rules: 'برچسب‌گذاری خودکار' new_user: 'افزودن کاربر' + # reset: 'Reset area' form: save: 'ذخیره' form_settings: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 7a2029b4..d69ae280 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -59,6 +59,7 @@ config: password: "Mot de passe" rules: "Règles de tag automatiques" new_user: "Créer un compte" + reset: "Réinitialisation" form: save: "Enregistrer" form_settings: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 3a459445..f16ffb6b 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -59,6 +59,7 @@ config: password: 'Password' rules: 'Regole di etichettatura' new_user: 'Aggiungi utente' + reset: 'Area di reset' form: save: 'Salva' form_settings: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 9df9e645..b568fbc5 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -59,6 +59,7 @@ config: password: 'Senhal' rules: "Règlas d'etiquetas automaticas" new_user: 'Crear un compte' + reset: 'Zòna de reïnicializacion' form: save: 'Enregistrar' form_settings: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 684c40e2..b58e14f4 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -59,6 +59,7 @@ config: password: 'Hasło' rules: 'Zasady tagowania' new_user: 'Dodaj użytkownika' + reset: 'Reset' form: save: 'Zapisz' form_settings: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 7932d7ab..add28bf7 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -59,6 +59,7 @@ config: password: 'Senha' rules: 'Regras de tags' new_user: 'Adicionar um usuário' + # reset: 'Reset area' form: save: 'Salvar' form_settings: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index 4d091f03..6a38c4a1 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -59,6 +59,7 @@ config: password: 'Parolă' # rules: 'Tagging rules' new_user: 'Crează un utilizator' + # reset: 'Reset area' form: save: 'Salvează' form_settings: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index cc327ae4..1b7ac38a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -58,6 +58,7 @@ config: password: 'Пароль' rules: 'Правила настройки простановки тегов' new_user: 'Добавить пользователя' + reset: 'Сброс данных' form: save: 'Сохранить' form_settings: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index 148aa541..fe1b35be 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -59,6 +59,7 @@ config: password: 'รหัสผ่าน' rules: 'การแท็กข้อบังคับ' new_user: 'เพิ่มผู้ใช้' + reset: 'รีเซ็ตพื้นที่ ' form: save: 'บันทึก' form_settings: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 6fb9852a..638714e4 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -59,6 +59,7 @@ config: password: 'Şifre' rules: 'Etiketleme kuralları' new_user: 'Bir kullanıcı ekle' + # reset: 'Reset area' form: save: 'Kaydet' form_settings: 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 f896fe2d..35800989 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 @@ -16,6 +16,7 @@
  • {{ 'config.tab_menu.user_info'|trans }}
  • {{ 'config.tab_menu.password'|trans }}
  • {{ 'config.tab_menu.rules'|trans }}
  • +
  • {{ 'config.tab_menu.reset'|trans }}
  • @@ -218,37 +219,6 @@ {{ form_widget(form.user.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} {{ form_widget(form.user._token) }} - -


    - - - - {% if enabled_users > 1 %} -


    - -
    -
    {{ 'config.form_user.delete.title'|trans }}
    -

    {{ 'config.form_user.delete.description'|trans }}

    - -
    - {% endif %}
    @@ -422,6 +392,37 @@
    + +
    + + + {% if enabled_users > 1 %} +


    + +
    +
    {{ 'config.form_user.delete.title'|trans }}
    +

    {{ 'config.form_user.delete.description'|trans }}

    + +
    + {% endif %} +
    -- cgit v1.2.3 From a6b242a1fd6f8900d80354361449f1bf62506ef9 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 2 Dec 2018 12:43:05 +0100 Subject: Enable OTP 2FA - Update SchebTwoFactorBundle to version 3 - Enable Google 2fa on the bundle - Disallow ability to use both email and google as 2fa - Update Ocramius Proxy Manager to handle typed function & attributes (from PHP 7) - use `$this->addFlash` shortcut instead of `$this->get('session')->getFlashBag()->add` - update admin to be able to create/reset the 2fa --- .../CoreBundle/Command/ShowUserCommand.php | 3 +- .../CoreBundle/Controller/ConfigController.php | 35 ++++++-- .../CoreBundle/Form/Type/UserInformationType.php | 9 ++- .../Resources/translations/messages.da.yml | 9 ++- .../Resources/translations/messages.de.yml | 9 ++- .../Resources/translations/messages.en.yml | 9 ++- .../Resources/translations/messages.es.yml | 9 ++- .../Resources/translations/messages.fa.yml | 9 ++- .../Resources/translations/messages.fr.yml | 8 +- .../Resources/translations/messages.it.yml | 9 ++- .../Resources/translations/messages.oc.yml | 9 ++- .../Resources/translations/messages.pl.yml | 9 ++- .../Resources/translations/messages.pt.yml | 9 ++- .../Resources/translations/messages.ro.yml | 9 ++- .../Resources/translations/messages.ru.yml | 9 ++- .../Resources/translations/messages.th.yml | 9 ++- .../Resources/translations/messages.tr.yml | 9 ++- .../views/themes/baggy/Config/index.html.twig | 88 ++++++++++++-------- .../views/themes/material/Config/index.html.twig | 45 +++++++---- .../UserBundle/Controller/ManageController.php | 67 ++++++++++++--- src/Wallabag/UserBundle/Entity/User.php | 94 +++++++++++++++------- src/Wallabag/UserBundle/Form/UserType.php | 9 ++- src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php | 2 +- .../Resources/views/Authentication/form.html.twig | 14 +++- .../Resources/views/Manage/edit.html.twig | 17 +++- 25 files changed, 346 insertions(+), 162 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Command/ShowUserCommand.php b/src/Wallabag/CoreBundle/Command/ShowUserCommand.php index a0184267..c95efbf3 100644 --- a/src/Wallabag/CoreBundle/Command/ShowUserCommand.php +++ b/src/Wallabag/CoreBundle/Command/ShowUserCommand.php @@ -57,7 +57,8 @@ class ShowUserCommand extends ContainerAwareCommand sprintf('Display name: %s', $user->getName()), sprintf('Creation date: %s', $user->getCreatedAt()->format('Y-m-d H:i:s')), sprintf('Last login: %s', null !== $user->getLastLogin() ? $user->getLastLogin()->format('Y-m-d H:i:s') : 'never'), - sprintf('2FA activated: %s', $user->isTwoFactorAuthentication() ? 'yes' : 'no'), + sprintf('2FA (email) activated: %s', $user->isEmailTwoFactor() ? 'yes' : 'no'), + sprintf('2FA (OTP) activated: %s', $user->isGoogleAuthenticatorEnabled() ? 'yes' : 'no'), ]); } diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index be6feb7c..5bbe1c74 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -46,7 +46,7 @@ class ConfigController extends Controller $activeTheme = $this->get('liip_theme.active_theme'); $activeTheme->setName($config->getTheme()); - $this->get('session')->getFlashBag()->add( + $this->addFlash( 'notice', 'flashes.config.notice.config_saved' ); @@ -68,7 +68,7 @@ class ConfigController extends Controller $userManager->updateUser($user, true); } - $this->get('session')->getFlashBag()->add('notice', $message); + $this->addFlash('notice', $message); return $this->redirect($this->generateUrl('config') . '#set4'); } @@ -80,10 +80,29 @@ class ConfigController extends Controller ]); $userForm->handleRequest($request); + // `googleTwoFactor` isn't a field within the User entity, we need to define it's value in a different way + if (true === $user->isGoogleAuthenticatorEnabled() && false === $userForm->isSubmitted()) { + $userForm->get('googleTwoFactor')->setData(true); + } + if ($userForm->isSubmitted() && $userForm->isValid()) { + // handle creation / reset of the OTP secret if checkbox changed from the previous state + if (true === $userForm->get('googleTwoFactor')->getData() && false === $user->isGoogleAuthenticatorEnabled()) { + $secret = $this->get('scheb_two_factor.security.google_authenticator')->generateSecret(); + + $user->setGoogleAuthenticatorSecret($secret); + $user->setEmailTwoFactor(false); + + $qrCode = $this->get('scheb_two_factor.security.google_authenticator')->getQRContent($user); + + $this->addFlash('OTPSecret', ['code' => $secret, 'qrCode' => $qrCode]); + } elseif (false === $userForm->get('googleTwoFactor')->getData() && true === $user->isGoogleAuthenticatorEnabled()) { + $user->setGoogleAuthenticatorSecret(null); + } + $userManager->updateUser($user, true); - $this->get('session')->getFlashBag()->add( + $this->addFlash( 'notice', 'flashes.config.notice.user_updated' ); @@ -99,7 +118,7 @@ class ConfigController extends Controller $em->persist($config); $em->flush(); - $this->get('session')->getFlashBag()->add( + $this->addFlash( 'notice', 'flashes.config.notice.rss_updated' ); @@ -131,7 +150,7 @@ class ConfigController extends Controller $em->persist($taggingRule); $em->flush(); - $this->get('session')->getFlashBag()->add( + $this->addFlash( 'notice', 'flashes.config.notice.tagging_rules_updated' ); @@ -178,7 +197,7 @@ class ConfigController extends Controller return new JsonResponse(['token' => $config->getRssToken()]); } - $this->get('session')->getFlashBag()->add( + $this->addFlash( 'notice', 'flashes.config.notice.rss_token_updated' ); @@ -203,7 +222,7 @@ class ConfigController extends Controller $em->remove($rule); $em->flush(); - $this->get('session')->getFlashBag()->add( + $this->addFlash( 'notice', 'flashes.config.notice.tagging_rules_deleted' ); @@ -269,7 +288,7 @@ class ConfigController extends Controller break; } - $this->get('session')->getFlashBag()->add( + $this->addFlash( 'notice', 'flashes.config.notice.' . $type . '_reset' ); diff --git a/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php b/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php index 07c99949..6e4c9154 100644 --- a/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php +++ b/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php @@ -21,9 +21,14 @@ class UserInformationType extends AbstractType ->add('email', EmailType::class, [ 'label' => 'config.form_user.email_label', ]) - ->add('twoFactorAuthentication', CheckboxType::class, [ + ->add('emailTwoFactor', CheckboxType::class, [ 'required' => false, - 'label' => 'config.form_user.twoFactorAuthentication_label', + 'label' => 'config.form_user.emailTwoFactor_label', + ]) + ->add('googleTwoFactor', CheckboxType::class, [ + 'required' => false, + 'label' => 'config.form_user.googleTwoFactor_label', + 'mapped' => false, ]) ->add('save', SubmitType::class, [ 'label' => 'config.form.save', diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index 96679a9c..e62ba6d0 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -99,11 +99,11 @@ config: # all: 'All' # rss_limit: 'Number of items in the feed' form_user: - # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code on every new untrusted connexion" + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Navn' email_label: 'Emailadresse' - # twoFactorAuthentication_label: 'Two factor authentication' - # help_twoFactorAuthentication: "If you enable 2FA, each time you want to login to wallabag, you'll receive a code by email." + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' delete: # title: Delete my account (a.k.a danger zone) # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. @@ -533,7 +533,8 @@ user: email_label: 'Emailadresse' # enabled_label: 'Enabled' # last_login_label: 'Last login' - # twofactor_label: Two factor authentication + # twofactor_email_label: Two factor authentication by email + # twofactor_google_label: Two factor authentication by Google # save: Save # delete: Delete # delete_confirm: Are you sure? diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index c56e87b5..f2d0408f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -99,11 +99,11 @@ config: all: 'Alle' rss_limit: 'Anzahl der Einträge pro Feed' form_user: - two_factor_description: "Wenn du die Zwei-Faktor-Authentifizierung aktivierst, erhältst du eine E-Mail mit einem Code bei jeder nicht vertrauenswürdigen Verbindung" + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Name' email_label: 'E-Mail-Adresse' - twoFactorAuthentication_label: 'Zwei-Faktor-Authentifizierung' - help_twoFactorAuthentication: "Wenn du 2FA aktivierst, wirst du bei jedem Login einen Code per E-Mail bekommen." + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' delete: title: 'Lösche mein Konto (a.k.a Gefahrenzone)' description: 'Wenn du dein Konto löschst, werden ALL deine Artikel, ALL deine Tags, ALL deine Anmerkungen und dein Konto dauerhaft gelöscht (kann NICHT RÜCKGÄNGIG gemacht werden). Du wirst anschließend ausgeloggt.' @@ -533,7 +533,8 @@ user: email_label: 'E-Mail-Adresse' enabled_label: 'Aktiviert' last_login_label: 'Letzter Login' - twofactor_label: 'Zwei-Faktor-Authentifizierung' + # twofactor_email_label: Two factor authentication by email + # twofactor_google_label: Two factor authentication by Google save: 'Speichern' delete: 'Löschen' delete_confirm: 'Bist du sicher?' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index d57cea0f..859acdc0 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -99,11 +99,11 @@ config: all: 'All' rss_limit: 'Number of items in the feed' form_user: - two_factor_description: "Enabling two factor authentication means you'll receive an email with a code on every new untrusted connection." + two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Name' email_label: 'Email' - twoFactorAuthentication_label: 'Two factor authentication' - help_twoFactorAuthentication: "If you enable 2FA, each time you want to login to wallabag, you'll receive a code by email." + emailTwoFactor_label: 'Using email (receive a code by email)' + googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' delete: title: Delete my account (a.k.a danger zone) description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. @@ -533,7 +533,8 @@ user: email_label: 'Email' enabled_label: 'Enabled' last_login_label: 'Last login' - twofactor_label: Two factor authentication + twofactor_email_label: Two factor authentication by email + twofactor_google_label: Two factor authentication by Google save: Save delete: Delete delete_confirm: Are you sure? diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index e1c4e221..3c3cbed4 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -99,11 +99,11 @@ config: # all: 'All' rss_limit: 'Límite de artículos en feed RSS' form_user: - two_factor_description: "Con la autenticación en dos pasos recibirá código por e-mail en cada nueva conexión que no sea de confianza." + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nombre' email_label: 'Dirección de e-mail' - twoFactorAuthentication_label: 'Autenticación en dos pasos' - help_twoFactorAuthentication: "Si activas la autenticación en dos pasos, cada vez que quieras iniciar sesión en wallabag recibirás un código por e-mail." + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' delete: title: Eliminar mi cuenta (Zona peligrosa) description: Si eliminas tu cuenta, TODOS tus artículos, TODAS tus etiquetas, TODAS tus anotaciones y tu cuenta serán eliminadas de forma PERMANENTE (no se puede deshacer). Después serás desconectado. @@ -533,7 +533,8 @@ user: email_label: 'E-mail' enabled_label: 'Activado' last_login_label: 'Último inicio de sesión' - twofactor_label: Autenticación en dos pasos + # twofactor_email_label: Two factor authentication by email + # twofactor_google_label: Two factor authentication by Google save: Guardar delete: Eliminar delete_confirm: ¿Estás seguro? diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index 2ede433e..ca25b390 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -99,11 +99,11 @@ config: # all: 'All' rss_limit: 'محدودیت آر-اس-اس' form_user: - two_factor_description: "با فعال‌کردن تأیید ۲مرحله‌ای هر بار که اتصال تأییدنشده‌ای برقرار شد، به شما یک کد از راه ایمیل فرستاده می‌شود" + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'نام' email_label: 'نشانی ایمیل' - twoFactorAuthentication_label: 'تأیید ۲مرحله‌ای' - # help_twoFactorAuthentication: "If you enable 2FA, each time you want to login to wallabag, you'll receive a code by email." + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' delete: # title: Delete my account (a.k.a danger zone) # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. @@ -533,7 +533,8 @@ user: email_label: 'نشانی ایمیل' # enabled_label: 'Enabled' # last_login_label: 'Last login' - # twofactor_label: Two factor authentication + # twofactor_email_label: Two factor authentication by email + # twofactor_google_label: Two factor authentication by Google # save: Save # delete: Delete # delete_confirm: Are you sure? diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index d69ae280..b809ca32 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -99,11 +99,11 @@ config: all: "Tous" rss_limit: "Nombre d’articles dans le flux" form_user: - two_factor_description: "Activer l’authentification double-facteur veut dire que vous allez recevoir un code par courriel à chaque nouvelle connexion non approuvée." + two_factor_description: "Activer l’authentification double-facteur veut dire que vous allez recevoir un code par courriel OU que vous devriez utiliser une application de mot de passe à usage unique (comme Google Authenticator) pour obtenir un code temporaire à chaque nouvelle connexion non approuvée. Vous ne pouvez pas choisir les deux options." name_label: "Nom" email_label: "Adresse courriel" - twoFactorAuthentication_label: "Double authentification" - help_twoFactorAuthentication: "Si vous activez 2FA, à chaque tentative de connexion à wallabag, vous recevrez un code par email." + emailTwoFactor_label: 'En utlisant l’email (recevez un code par email)' + googleTwoFactor_label: 'En utilisant une application de mot de passe à usage unique (ouvrez l’app, comme Google Authenticator, pour obtenir un mot de passe à usage unique)' delete: title: "Supprimer mon compte (attention danger !)" description: "Si vous confirmez la suppression de votre compte, TOUS les articles, TOUS les tags, TOUTES les annotations et votre compte seront DÉFINITIVEMENT supprimé (c’est IRRÉVERSIBLE). Vous serez ensuite déconnecté." @@ -534,6 +534,8 @@ user: enabled_label: "Activé" last_login_label: "Dernière connexion" twofactor_label: "Double authentification" + twofactor_email_label: Double authentification par email + twofactor_google_label: Double authentification par Google save: "Sauvegarder" delete: "Supprimer" delete_confirm: "Êtes-vous sûr ?" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index f16ffb6b..7279dba1 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -99,11 +99,11 @@ config: # all: 'All' rss_limit: 'Numero di elementi nel feed' form_user: - two_factor_description: "Abilitando l'autenticazione a due fattori riceverai una e-mail con un codice per ogni nuova connesione non verificata" + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nome' email_label: 'E-mail' - twoFactorAuthentication_label: 'Autenticazione a due fattori' - help_twoFactorAuthentication: "Se abiliti l'autenticazione a due fattori, ogni volta che vorrai connetterti a wallabag, riceverai un codice via E-mail." + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' delete: title: Cancella il mio account (zona pericolosa) description: Rimuovendo il tuo account, TUTTI i tuoi articoli, TUTTE le tue etichette, TUTTE le tue annotazioni ed il tuo account verranno rimossi PERMANENTEMENTE (impossibile da ANNULLARE). Verrai poi disconnesso. @@ -533,7 +533,8 @@ user: email_label: 'E-mail' enabled_label: 'Abilitato' last_login_label: 'Ultima connessione' - twofactor_label: Autenticazione a due fattori + # twofactor_email_label: Two factor authentication by email + # twofactor_google_label: Two factor authentication by Google save: Salva delete: Cancella delete_confirm: Sei sicuro? diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index b568fbc5..f262ba7b 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -99,11 +99,11 @@ config: all: 'Totes' rss_limit: "Nombre d'articles dins un flux RSS" form_user: - two_factor_description: "Activar l'autentificacion en dos temps vòl dire que recebretz un còdi per corrièl per cada novèla connexion pas aprovada." + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nom' email_label: 'Adreça de corrièl' - twoFactorAuthentication_label: 'Dobla autentificacion' - help_twoFactorAuthentication: "S'avètz activat l'autentificacion en dos temps, cada còp que volètz vos connectar a wallabag, recebretz un còdi per corrièl." + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' delete: title: Suprimir mon compte (Mèfi zòna perilhosa) description: Se confirmatz la supression de vòstre compte, TOTES vòstres articles, TOTAS vòstras etiquetas, TOTAS vòstras anotacions e vòstre compte seràn suprimits per totjorn. E aquò es IRREVERSIBLE. Puèi seretz desconnectat. @@ -533,7 +533,8 @@ user: email_label: 'Adreça de corrièl' enabled_label: 'Actiu' last_login_label: 'Darrièra connexion' - twofactor_label: 'Autentificacion doble-factor' + # twofactor_email_label: Two factor authentication by email + # twofactor_google_label: Two factor authentication by Google save: 'Enregistrar' delete: 'Suprimir' delete_confirm: 'Sètz segur ?' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index b58e14f4..99c2183e 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -99,11 +99,11 @@ config: all: 'Wszystkie' rss_limit: 'Link do RSS' form_user: - two_factor_description: "Włączenie autoryzacji dwuetapowej oznacza, że będziesz otrzymywał maile z kodem przy każdym nowym, niezaufanym połączeniu" + two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nazwa' email_label: 'Adres email' - twoFactorAuthentication_label: 'Autoryzacja dwuetapowa' - help_twoFactorAuthentication: "Jeżeli włączysz autoryzację dwuetapową. Za każdym razem, kiedy będziesz chciał się zalogować, dostaniesz kod na swój e-mail." + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' delete: title: Usuń moje konto (niebezpieczna strefa !) description: Jeżeli usuniesz swoje konto, wszystkie twoje artykuły, tagi, adnotacje, oraz konto zostaną trwale usunięte (operacja jest NIEODWRACALNA). Następnie zostaniesz wylogowany. @@ -533,7 +533,8 @@ user: email_label: 'Adres email' enabled_label: 'Włączony' last_login_label: 'Ostatnie logowanie' - twofactor_label: Autoryzacja dwuetapowa + # twofactor_email_label: Two factor authentication by email + # twofactor_google_label: Two factor authentication by Google save: Zapisz delete: Usuń delete_confirm: Jesteś pewien? diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index add28bf7..806c2d78 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -99,11 +99,11 @@ config: # all: 'All' rss_limit: 'Número de itens no feed' form_user: - two_factor_description: 'Habilitar autenticação de dois passos significa que você receberá um e-mail com um código a cada nova conexão desconhecida.' + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nome' email_label: 'E-mail' - twoFactorAuthentication_label: 'Autenticação de dois passos' - # help_twoFactorAuthentication: "If you enable 2FA, each time you want to login to wallabag, you'll receive a code by email." + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' delete: # title: Delete my account (a.k.a danger zone) # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. @@ -533,7 +533,8 @@ user: email_label: 'E-mail' enabled_label: 'Habilitado' last_login_label: 'Último login' - twofactor_label: 'Autenticação de dois passos' + # twofactor_email_label: Two factor authentication by email + # twofactor_google_label: Two factor authentication by Google save: 'Salvar' delete: 'Apagar' delete_confirm: 'Tem certeza?' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index 6a38c4a1..ed75ed6e 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -99,11 +99,11 @@ config: # all: 'All' rss_limit: 'Limită RSS' form_user: - # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code on every new untrusted connexion" + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nume' email_label: 'E-mail' - # twoFactorAuthentication_label: 'Two factor authentication' - # help_twoFactorAuthentication: "If you enable 2FA, each time you want to login to wallabag, you'll receive a code by email." + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' delete: # title: Delete my account (a.k.a danger zone) # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. @@ -533,7 +533,8 @@ user: email_label: 'E-mail' # enabled_label: 'Enabled' # last_login_label: 'Last login' - # twofactor_label: Two factor authentication + # twofactor_email_label: Two factor authentication by email + # twofactor_google_label: Two factor authentication by Google # save: Save # delete: Delete # delete_confirm: Are you sure? diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index 1b7ac38a..1c6e6771 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -96,11 +96,11 @@ config: archive: 'архивные' rss_limit: 'Количество записей в фиде' form_user: - two_factor_description: "Включить двухфакторную аутентификацию, Вы получите сообщение на указанный email с кодом, при каждом новом непроверенном подключении." + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Имя' email_label: 'Email' - twoFactorAuthentication_label: 'Двухфакторная аутентификация' - help_twoFactorAuthentication: "Если Вы включите двухфакторную аутентификацию, то Вы будете получать код на указанный ранее email, каждый раз при входе в wallabag." + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' delete: title: "Удалить мой аккаунт (или опасная зона)" description: "Если Вы удалите ваш аккаунт, ВСЕ ваши записи, теги и другие данные, будут БЕЗВОЗВРАТНО удалены (операция не может быть отменена после). Затем Вы выйдете из системы." @@ -521,7 +521,8 @@ user: email_label: 'Email' enabled_label: 'Включить' last_login_label: 'Последний вход' - twofactor_label: "Двухфакторная аутентификация" + # twofactor_email_label: Two factor authentication by email + # twofactor_google_label: Two factor authentication by Google save: "Сохранить" delete: "Удалить" delete_confirm: "Вы уверены?" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index fe1b35be..af798943 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -99,11 +99,11 @@ config: all: 'ทั้งหมด' rss_limit: 'จำนวนไอเทมที่เก็บ' form_user: - two_factor_description: "การเปิดใช้งาน two factor authentication คือคุณจะต้องได้รับอีเมลกับ code ที่ยังไม่ตรวจสอบในการเชื่อมต่อ" + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'ชื่อ' email_label: 'อีเมล' - twoFactorAuthentication_label: 'Two factor authentication' - help_twoFactorAuthentication: "ถ้าคุณเปิด 2FA, ในแต่ละช่วงเวลาที่คุณต้องการลงชื่อเข้าใช wallabag, คุณจะต้องได้รับ code จากอีเมล" + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' delete: title: ลบบัญชีของฉัน (โซนที่เป็นภัย!) description: ถ้าคุณลบบัญชีของคุณIf , รายการทั้งหมดของคุณ, แท็กทั้งหมดของคุณ, หมายเหตุทั้งหมดของคุณและบัญชีของคุณจะถูกลบอย่างถาวร (มันไม่สามารถยกเลิกได้) คุณจะต้องลงชื่อออก @@ -531,7 +531,8 @@ user: email_label: 'อีเมล' enabled_label: 'เปิดใช้งาน' last_login_label: 'ลงชื้อเข้าใช้ครั้งสุดท้าย' - twofactor_label: Two factor authentication + # twofactor_email_label: Two factor authentication by email + # twofactor_google_label: Two factor authentication by Google save: บันทึก delete: ลบ delete_confirm: ตุณแน่ใจหรือไม่? diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 638714e4..352a2cc4 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -99,11 +99,11 @@ config: # all: 'All' rss_limit: 'RSS içeriğinden talep edilecek makale limiti' form_user: - two_factor_description: "İki adımlı doğrulamayı aktifleştirdiğinizde, her yeni güvenilmeyen bağlantılarda size e-posta ile bir kod alacaksınız." + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'İsim' email_label: 'E-posta' - twoFactorAuthentication_label: 'İki adımlı doğrulama' - # help_twoFactorAuthentication: "If you enable 2FA, each time you want to login to wallabag, you'll receive a code by email." + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' delete: # title: Delete my account (a.k.a danger zone) # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. @@ -531,7 +531,8 @@ user: email_label: 'E-posta' # enabled_label: 'Enabled' # last_login_label: 'Last login' - # twofactor_label: Two factor authentication + # twofactor_email_label: Two factor authentication by email + # twofactor_google_label: Two factor authentication by Google # save: Save # delete: Delete # delete_confirm: Are you sure? 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 bcc57dac..5c4e44dd 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 @@ -176,43 +176,36 @@
    - {{ form_label(form.user.twoFactorAuthentication) }} - {{ form_errors(form.user.twoFactorAuthentication) }} - {{ form_widget(form.user.twoFactorAuthentication) }} + {{ form_label(form.user.emailTwoFactor) }} + {{ form_errors(form.user.emailTwoFactor) }} + {{ form_widget(form.user.emailTwoFactor) }}
    - - live_help - +
    +
    + {{ form_label(form.user.googleTwoFactor) }} + {{ form_widget(form.user.googleTwoFactor) }} + {{ form_errors(form.user.googleTwoFactor) }} +
    + {% for OTPSecret in app.session.flashbag.get('OTPSecret') %} +
    + You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. +
    + That code will disapear after a page reload. +

    + {{ OTPSecret.code }} +

    + Or you can scan that QR Code with your app: +
    + + + +
    + {% endfor %}
    {% endif %} -

    {{ 'config.reset.title'|trans }}

    -
    -

    {{ 'config.reset.description'|trans }}

    - -
    - {{ form_widget(form.user._token) }} {{ form_widget(form.user.save) }} @@ -277,7 +270,7 @@ {% endfor %} - {{ form_start(form.new_tagging_rule) }} + {{ form_start(form.new_tagging_rule) }} {{ form_errors(form.new_tagging_rule) }}
    @@ -382,4 +375,31 @@ + +

    {{ 'config.reset.title'|trans }}

    +
    +

    {{ 'config.reset.description'|trans }}

    + +
    {% endblock %} 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 35800989..887d154f 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 @@ -112,8 +112,7 @@ @@ -198,22 +197,38 @@ {% if twofactor_auth %} -
    -
    +
    {{ 'config.form_user.two_factor_description'|trans }} -
    - - {{ form_widget(form.user.twoFactorAuthentication) }} - {{ form_label(form.user.twoFactorAuthentication) }} - {{ form_errors(form.user.twoFactorAuthentication) }} -
    -
    - - live_help - +
    + {{ form_widget(form.user.emailTwoFactor) }} + {{ form_label(form.user.emailTwoFactor) }} + {{ form_errors(form.user.emailTwoFactor) }} +
    +
    + {{ form_widget(form.user.googleTwoFactor) }} + {{ form_label(form.user.googleTwoFactor) }} + {{ form_errors(form.user.googleTwoFactor) }} +
    -
    + + {% for OTPSecret in app.session.flashbag.get('OTPSecret') %} +
    + You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. +
    + That code will disapear after a page reload. +

    + {{ OTPSecret.code }} +

    + Or you can scan that QR Code with your app: +
    + + + +
    + {% endfor %} {% endif %} {{ form_widget(form.user.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} diff --git a/src/Wallabag/UserBundle/Controller/ManageController.php b/src/Wallabag/UserBundle/Controller/ManageController.php index a9746fb4..08ed25dd 100644 --- a/src/Wallabag/UserBundle/Controller/ManageController.php +++ b/src/Wallabag/UserBundle/Controller/ManageController.php @@ -8,6 +8,7 @@ use Pagerfanta\Adapter\DoctrineORMAdapter; use Pagerfanta\Exception\OutOfRangeCurrentPageException; use Pagerfanta\Pagerfanta; use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; use Wallabag\UserBundle\Entity\User; @@ -31,10 +32,10 @@ class ManageController extends Controller // enable created user by default $user->setEnabled(true); - $form = $this->createForm('Wallabag\UserBundle\Form\NewUserType', $user); - $form->handleRequest($request); + $form = $this->createEditForm('NewUserType', $user, $request); if ($form->isSubmitted() && $form->isValid()) { + $user = $this->handleOtp($form, $user); $userManager->updateUser($user); // dispatch a created event so the associated config will be created @@ -62,14 +63,14 @@ class ManageController extends Controller */ public function editAction(Request $request, User $user) { + $userManager = $this->container->get('fos_user.user_manager'); + $deleteForm = $this->createDeleteForm($user); - $editForm = $this->createForm('Wallabag\UserBundle\Form\UserType', $user); - $editForm->handleRequest($request); + $form = $this->createEditForm('UserType', $user, $request); - if ($editForm->isSubmitted() && $editForm->isValid()) { - $em = $this->getDoctrine()->getManager(); - $em->persist($user); - $em->flush(); + if ($form->isSubmitted() && $form->isValid()) { + $user = $this->handleOtp($form, $user); + $userManager->updateUser($user); $this->get('session')->getFlashBag()->add( 'notice', @@ -81,7 +82,7 @@ class ManageController extends Controller return $this->render('WallabagUserBundle:Manage:edit.html.twig', [ 'user' => $user, - 'edit_form' => $editForm->createView(), + 'edit_form' => $form->createView(), 'delete_form' => $deleteForm->createView(), 'twofactor_auth' => $this->getParameter('twofactor_auth'), ]); @@ -157,7 +158,7 @@ class ManageController extends Controller } /** - * Creates a form to delete a User entity. + * Create a form to delete a User entity. * * @param User $user The User entity * @@ -171,4 +172,50 @@ class ManageController extends Controller ->getForm() ; } + + /** + * Create a form to create or edit a User entity. + * + * @param string $type Might be NewUserType or UserType + * @param User $user The new / edit user + * @param Request $request The request + * + * @return FormInterface + */ + private function createEditForm($type, User $user, Request $request) + { + $form = $this->createForm('Wallabag\UserBundle\Form\\' . $type, $user); + $form->handleRequest($request); + + // `googleTwoFactor` isn't a field within the User entity, we need to define it's value in a different way + if (true === $user->isGoogleAuthenticatorEnabled() && false === $form->isSubmitted()) { + $form->get('googleTwoFactor')->setData(true); + } + + return $form; + } + + /** + * Handle OTP update, taking care to only have one 2fa enable at a time. + * + * @see ConfigController + * + * @param FormInterface $form + * @param User $user + * + * @return User + */ + private function handleOtp(FormInterface $form, User $user) + { + if (true === $form->get('googleTwoFactor')->getData() && false === $user->isGoogleAuthenticatorEnabled()) { + $user->setGoogleAuthenticatorSecret($this->get('scheb_two_factor.security.google_authenticator')->generateSecret()); + $user->setEmailTwoFactor(false); + + return $user; + } + + $user->setGoogleAuthenticatorSecret(null); + + return $user; + } } diff --git a/src/Wallabag/UserBundle/Entity/User.php b/src/Wallabag/UserBundle/Entity/User.php index 48446e3c..6e305719 100644 --- a/src/Wallabag/UserBundle/Entity/User.php +++ b/src/Wallabag/UserBundle/Entity/User.php @@ -8,8 +8,8 @@ use FOS\UserBundle\Model\User as BaseUser; use JMS\Serializer\Annotation\Accessor; use JMS\Serializer\Annotation\Groups; use JMS\Serializer\Annotation\XmlRoot; -use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface; -use Scheb\TwoFactorBundle\Model\TrustedComputerInterface; +use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface as EmailTwoFactorInterface; +use Scheb\TwoFactorBundle\Model\Google\TwoFactorInterface as GoogleTwoFactorInterface; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Security\Core\User\UserInterface; use Wallabag\ApiBundle\Entity\Client; @@ -28,7 +28,7 @@ use Wallabag\CoreBundle\Helper\EntityTimestampsTrait; * @UniqueEntity("email") * @UniqueEntity("username") */ -class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterface +class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorInterface { use EntityTimestampsTrait; @@ -123,16 +123,16 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf private $authCode; /** - * @var bool - * - * @ORM\Column(type="boolean") + * @ORM\Column(name="googleAuthenticatorSecret", type="string", nullable=true) */ - private $twoFactorAuthentication = false; + private $googleAuthenticatorSecret; /** - * @ORM\Column(type="json_array", nullable=true) + * @var bool + * + * @ORM\Column(type="boolean") */ - private $trusted; + private $emailTwoFactor = false; public function __construct() { @@ -233,49 +233,89 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf /** * @return bool */ - public function isTwoFactorAuthentication() + public function isEmailTwoFactor() + { + return $this->emailTwoFactor; + } + + /** + * @param bool $emailTwoFactor + */ + public function setEmailTwoFactor($emailTwoFactor) { - return $this->twoFactorAuthentication; + $this->emailTwoFactor = $emailTwoFactor; } /** - * @param bool $twoFactorAuthentication + * Used in the user config form to be "like" the email option. */ - public function setTwoFactorAuthentication($twoFactorAuthentication) + public function isGoogleTwoFactor() { - $this->twoFactorAuthentication = $twoFactorAuthentication; + return $this->isGoogleAuthenticatorEnabled(); } - public function isEmailAuthEnabled() + /** + * {@inheritdoc} + */ + public function isEmailAuthEnabled(): bool { - return $this->twoFactorAuthentication; + return $this->emailTwoFactor; } - public function getEmailAuthCode() + /** + * {@inheritdoc} + */ + public function getEmailAuthCode(): string { return $this->authCode; } - public function setEmailAuthCode($authCode) + /** + * {@inheritdoc} + */ + public function setEmailAuthCode(string $authCode): void { $this->authCode = $authCode; } - public function addTrustedComputer($token, \DateTime $validUntil) + /** + * {@inheritdoc} + */ + public function getEmailAuthRecipient(): string { - $this->trusted[$token] = $validUntil->format('r'); + return $this->email; } - public function isTrustedComputer($token) + /** + * {@inheritdoc} + */ + public function isGoogleAuthenticatorEnabled(): bool { - if (isset($this->trusted[$token])) { - $now = new \DateTime(); - $validUntil = new \DateTime($this->trusted[$token]); + return $this->googleAuthenticatorSecret ? true : false; + } - return $now < $validUntil; - } + /** + * {@inheritdoc} + */ + public function getGoogleAuthenticatorUsername(): string + { + return $this->username; + } - return false; + /** + * {@inheritdoc} + */ + public function getGoogleAuthenticatorSecret(): string + { + return $this->googleAuthenticatorSecret; + } + + /** + * {@inheritdoc} + */ + public function setGoogleAuthenticatorSecret(?string $googleAuthenticatorSecret): void + { + $this->googleAuthenticatorSecret = $googleAuthenticatorSecret; } /** diff --git a/src/Wallabag/UserBundle/Form/UserType.php b/src/Wallabag/UserBundle/Form/UserType.php index 56fea640..026db9a2 100644 --- a/src/Wallabag/UserBundle/Form/UserType.php +++ b/src/Wallabag/UserBundle/Form/UserType.php @@ -35,9 +35,14 @@ class UserType extends AbstractType 'required' => false, 'label' => 'user.form.enabled_label', ]) - ->add('twoFactorAuthentication', CheckboxType::class, [ + ->add('emailTwoFactor', CheckboxType::class, [ 'required' => false, - 'label' => 'user.form.twofactor_label', + 'label' => 'user.form.twofactor_email_label', + ]) + ->add('googleTwoFactor', CheckboxType::class, [ + 'required' => false, + 'label' => 'user.form.twofactor_google_label', + 'mapped' => false, ]) ->add('save', SubmitType::class, [ 'label' => 'user.form.save', diff --git a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php index aed805c9..e8e29aa9 100644 --- a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php +++ b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php @@ -78,7 +78,7 @@ class AuthCodeMailer implements AuthCodeMailerInterface * * @param TwoFactorInterface $user */ - public function sendAuthCode(TwoFactorInterface $user) + public function sendAuthCode(TwoFactorInterface $user): void { $template = $this->twig->loadTemplate('WallabagUserBundle:TwoFactor:email_auth_code.html.twig'); diff --git a/src/Wallabag/UserBundle/Resources/views/Authentication/form.html.twig b/src/Wallabag/UserBundle/Resources/views/Authentication/form.html.twig index c8471bdd..47a5cb78 100644 --- a/src/Wallabag/UserBundle/Resources/views/Authentication/form.html.twig +++ b/src/Wallabag/UserBundle/Resources/views/Authentication/form.html.twig @@ -1,7 +1,8 @@ +{# Override `vendor/scheb/two-factor-bundle/Resources/views/Authentication/form.html.twig` #} {% extends "WallabagUserBundle::layout.html.twig" %} {% block fos_user_content %} -
    +
    @@ -9,14 +10,19 @@

    {{ flashMessage|trans }}

    {% endfor %} + {# Authentication errors #} + {% if authenticationError %} +

    {{ authenticationError|trans(authenticationErrorData) }}

    + {% endif %} +
    - +
    - {% if useTrustedOption %} + {% if displayTrustedOption %}
    - +
    {% endif %} diff --git a/src/Wallabag/UserBundle/Resources/views/Manage/edit.html.twig b/src/Wallabag/UserBundle/Resources/views/Manage/edit.html.twig index 3ffd15f5..8be37e79 100644 --- a/src/Wallabag/UserBundle/Resources/views/Manage/edit.html.twig +++ b/src/Wallabag/UserBundle/Resources/views/Manage/edit.html.twig @@ -50,10 +50,21 @@ {% if twofactor_auth %}
    - {{ form_widget(edit_form.twoFactorAuthentication) }} - {{ form_label(edit_form.twoFactorAuthentication) }} - {{ form_errors(edit_form.twoFactorAuthentication) }} + {{ form_widget(edit_form.emailTwoFactor) }} + {{ form_label(edit_form.emailTwoFactor) }} + {{ form_errors(edit_form.emailTwoFactor) }}
    +
    + {{ form_widget(edit_form.googleTwoFactor) }} + {{ form_label(edit_form.googleTwoFactor) }} + {{ form_errors(edit_form.googleTwoFactor) }} +
    + + {% if user.isGoogleAuthenticatorEnabled %} +
    +

    OTP Secret: {{ user.googleAuthenticatorSecret }}

    +
    + {% endif %}
    {% endif %} -- cgit v1.2.3 From 2dfbe9e5faf40364b60e6c76f3cc9fac5bf11fa4 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 2 Dec 2018 18:39:02 +0100 Subject: Fix tests --- .../CoreBundle/Controller/ConfigController.php | 20 +++---- .../views/themes/baggy/Config/index.html.twig | 9 ++- .../views/themes/material/Config/index.html.twig | 6 +- .../UserBundle/Controller/ManageController.php | 70 ++++++---------------- 4 files changed, 36 insertions(+), 69 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index 5bbe1c74..846e96ff 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -81,23 +81,23 @@ class ConfigController extends Controller $userForm->handleRequest($request); // `googleTwoFactor` isn't a field within the User entity, we need to define it's value in a different way - if (true === $user->isGoogleAuthenticatorEnabled() && false === $userForm->isSubmitted()) { + if ($this->getParameter('twofactor_auth') && true === $user->isGoogleAuthenticatorEnabled() && false === $userForm->isSubmitted()) { $userForm->get('googleTwoFactor')->setData(true); } if ($userForm->isSubmitted() && $userForm->isValid()) { // handle creation / reset of the OTP secret if checkbox changed from the previous state - if (true === $userForm->get('googleTwoFactor')->getData() && false === $user->isGoogleAuthenticatorEnabled()) { - $secret = $this->get('scheb_two_factor.security.google_authenticator')->generateSecret(); + if ($this->getParameter('twofactor_auth')) { + if (true === $userForm->get('googleTwoFactor')->getData() && false === $user->isGoogleAuthenticatorEnabled()) { + $secret = $this->get('scheb_two_factor.security.google_authenticator')->generateSecret(); - $user->setGoogleAuthenticatorSecret($secret); - $user->setEmailTwoFactor(false); + $user->setGoogleAuthenticatorSecret($secret); + $user->setEmailTwoFactor(false); - $qrCode = $this->get('scheb_two_factor.security.google_authenticator')->getQRContent($user); - - $this->addFlash('OTPSecret', ['code' => $secret, 'qrCode' => $qrCode]); - } elseif (false === $userForm->get('googleTwoFactor')->getData() && true === $user->isGoogleAuthenticatorEnabled()) { - $user->setGoogleAuthenticatorSecret(null); + $this->addFlash('OtpQrCode', $this->get('scheb_two_factor.security.google_authenticator')->getQRContent($user)); + } elseif (false === $userForm->get('googleTwoFactor')->getData() && true === $user->isGoogleAuthenticatorEnabled()) { + $user->setGoogleAuthenticatorSecret(null); + } } $userManager->updateUser($user, true); 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 5c4e44dd..6ee57443 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 @@ -86,8 +86,7 @@
    @@ -186,20 +185,20 @@ {{ form_widget(form.user.googleTwoFactor) }} {{ form_errors(form.user.googleTwoFactor) }} - {% for OTPSecret in app.session.flashbag.get('OTPSecret') %} + {% for OtpQrCode in app.session.flashbag.get('OtpQrCode') %}
    You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password.
    That code will disapear after a page reload.

    - {{ OTPSecret.code }} + {{ app.user.getGoogleAuthenticatorSecret }}

    Or you can scan that QR Code with your app:
    {% endfor %} 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 887d154f..ca7eb9f3 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 @@ -212,20 +212,20 @@ - {% for OTPSecret in app.session.flashbag.get('OTPSecret') %} + {% for OtpQrCode in app.session.flashbag.get('OtpQrCode') %}
    You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password.
    That code will disapear after a page reload.

    - {{ OTPSecret.code }} + {{ app.user.getGoogleAuthenticatorSecret }}

    Or you can scan that QR Code with your app:
    {% endfor %} diff --git a/src/Wallabag/UserBundle/Controller/ManageController.php b/src/Wallabag/UserBundle/Controller/ManageController.php index 08ed25dd..b9fd8660 100644 --- a/src/Wallabag/UserBundle/Controller/ManageController.php +++ b/src/Wallabag/UserBundle/Controller/ManageController.php @@ -8,7 +8,6 @@ use Pagerfanta\Adapter\DoctrineORMAdapter; use Pagerfanta\Exception\OutOfRangeCurrentPageException; use Pagerfanta\Pagerfanta; use Symfony\Bundle\FrameworkBundle\Controller\Controller; -use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; use Wallabag\UserBundle\Entity\User; @@ -32,10 +31,10 @@ class ManageController extends Controller // enable created user by default $user->setEnabled(true); - $form = $this->createEditForm('NewUserType', $user, $request); + $form = $this->createForm('Wallabag\UserBundle\Form\NewUserType', $user); + $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { - $user = $this->handleOtp($form, $user); $userManager->updateUser($user); // dispatch a created event so the associated config will be created @@ -66,10 +65,25 @@ class ManageController extends Controller $userManager = $this->container->get('fos_user.user_manager'); $deleteForm = $this->createDeleteForm($user); - $form = $this->createEditForm('UserType', $user, $request); + $form = $this->createForm('Wallabag\UserBundle\Form\UserType', $user); + $form->handleRequest($request); + + // `googleTwoFactor` isn't a field within the User entity, we need to define it's value in a different way + if ($this->getParameter('twofactor_auth') && true === $user->isGoogleAuthenticatorEnabled() && false === $form->isSubmitted()) { + $form->get('googleTwoFactor')->setData(true); + } if ($form->isSubmitted() && $form->isValid()) { - $user = $this->handleOtp($form, $user); + // handle creation / reset of the OTP secret if checkbox changed from the previous state + if ($this->getParameter('twofactor_auth')) { + if (true === $form->get('googleTwoFactor')->getData() && false === $user->isGoogleAuthenticatorEnabled()) { + $user->setGoogleAuthenticatorSecret($this->get('scheb_two_factor.security.google_authenticator')->generateSecret()); + $user->setEmailTwoFactor(false); + } elseif (false === $form->get('googleTwoFactor')->getData() && true === $user->isGoogleAuthenticatorEnabled()) { + $user->setGoogleAuthenticatorSecret(null); + } + } + $userManager->updateUser($user); $this->get('session')->getFlashBag()->add( @@ -172,50 +186,4 @@ class ManageController extends Controller ->getForm() ; } - - /** - * Create a form to create or edit a User entity. - * - * @param string $type Might be NewUserType or UserType - * @param User $user The new / edit user - * @param Request $request The request - * - * @return FormInterface - */ - private function createEditForm($type, User $user, Request $request) - { - $form = $this->createForm('Wallabag\UserBundle\Form\\' . $type, $user); - $form->handleRequest($request); - - // `googleTwoFactor` isn't a field within the User entity, we need to define it's value in a different way - if (true === $user->isGoogleAuthenticatorEnabled() && false === $form->isSubmitted()) { - $form->get('googleTwoFactor')->setData(true); - } - - return $form; - } - - /** - * Handle OTP update, taking care to only have one 2fa enable at a time. - * - * @see ConfigController - * - * @param FormInterface $form - * @param User $user - * - * @return User - */ - private function handleOtp(FormInterface $form, User $user) - { - if (true === $form->get('googleTwoFactor')->getData() && false === $user->isGoogleAuthenticatorEnabled()) { - $user->setGoogleAuthenticatorSecret($this->get('scheb_two_factor.security.google_authenticator')->generateSecret()); - $user->setEmailTwoFactor(false); - - return $user; - } - - $user->setGoogleAuthenticatorSecret(null); - - return $user; - } } -- cgit v1.2.3 From 43ccf4b1787c294dbfa7b052c41e95ac9eeca3af Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 2 Dec 2018 18:47:34 +0100 Subject: Cleanup --- src/Wallabag/UserBundle/Controller/ManageController.php | 2 -- src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/UserBundle/Controller/ManageController.php b/src/Wallabag/UserBundle/Controller/ManageController.php index b9fd8660..63a06206 100644 --- a/src/Wallabag/UserBundle/Controller/ManageController.php +++ b/src/Wallabag/UserBundle/Controller/ManageController.php @@ -146,8 +146,6 @@ class ManageController extends Controller $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { - $this->get('logger')->info('searching users'); - $searchTerm = (isset($request->get('search_user')['term']) ? $request->get('search_user')['term'] : ''); $qb = $em->getRepository('WallabagUserBundle:User')->getQueryBuilderForSearch($searchTerm); diff --git a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php index e8e29aa9..2797efde 100644 --- a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php +++ b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php @@ -97,7 +97,7 @@ class AuthCodeMailer implements AuthCodeMailerInterface $message = new \Swift_Message(); $message - ->setTo($user->getEmail()) + ->setTo($user->getEmailAuthRecipient()) ->setFrom($this->senderEmail, $this->senderName) ->setSubject($subject) ->setBody($bodyText, 'text/plain') -- cgit v1.2.3 From 6e4fc956abc909232044e7af0fa37cbb1b510f18 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 3 Dec 2018 06:15:57 +0100 Subject: Better translations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace “Google Authenticator” by “Google Authenticator, Authy or FreeOTP” in all text. Translate how to use the code / qr code. --- .../CoreBundle/Resources/translations/messages.da.yml | 7 +++++-- .../CoreBundle/Resources/translations/messages.de.yml | 7 +++++-- .../CoreBundle/Resources/translations/messages.en.yml | 7 +++++-- .../CoreBundle/Resources/translations/messages.es.yml | 7 +++++-- .../CoreBundle/Resources/translations/messages.fa.yml | 7 +++++-- .../CoreBundle/Resources/translations/messages.fr.yml | 7 +++++-- .../CoreBundle/Resources/translations/messages.it.yml | 7 +++++-- .../CoreBundle/Resources/translations/messages.oc.yml | 7 +++++-- .../CoreBundle/Resources/translations/messages.pl.yml | 7 +++++-- .../CoreBundle/Resources/translations/messages.pt.yml | 7 +++++-- .../CoreBundle/Resources/translations/messages.ro.yml | 7 +++++-- .../CoreBundle/Resources/translations/messages.ru.yml | 7 +++++-- .../CoreBundle/Resources/translations/messages.th.yml | 7 +++++-- .../CoreBundle/Resources/translations/messages.tr.yml | 7 +++++-- .../Resources/views/themes/material/Config/index.html.twig | 13 ++++++------- 15 files changed, 76 insertions(+), 35 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index e62ba6d0..d3e96e5c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -99,11 +99,14 @@ config: # all: 'All' # rss_limit: 'Number of items in the feed' form_user: - # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Navn' email_label: 'Emailadresse' # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Or use that code:' delete: # title: Delete my account (a.k.a danger zone) # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index f2d0408f..9aeddceb 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -99,11 +99,14 @@ config: all: 'Alle' rss_limit: 'Anzahl der Einträge pro Feed' form_user: - # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Name' email_label: 'E-Mail-Adresse' # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Or use that code:' delete: title: 'Lösche mein Konto (a.k.a Gefahrenzone)' description: 'Wenn du dein Konto löschst, werden ALL deine Artikel, ALL deine Tags, ALL deine Anmerkungen und dein Konto dauerhaft gelöscht (kann NICHT RÜCKGÄNGIG gemacht werden). Du wirst anschließend ausgeloggt.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 859acdc0..22c68c79 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -99,11 +99,14 @@ config: all: 'All' rss_limit: 'Number of items in the feed' form_user: - two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." + two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Name' email_label: 'Email' emailTwoFactor_label: 'Using email (receive a code by email)' - googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' + googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + two_factor_code_description_2: 'You can scan that QR Code with your app:' + two_factor_code_description_3: 'Or use that code:' delete: title: Delete my account (a.k.a danger zone) description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 3c3cbed4..6e710e56 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -99,11 +99,14 @@ config: # all: 'All' rss_limit: 'Límite de artículos en feed RSS' form_user: - # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nombre' email_label: 'Dirección de e-mail' # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Or use that code:' delete: title: Eliminar mi cuenta (Zona peligrosa) description: Si eliminas tu cuenta, TODOS tus artículos, TODAS tus etiquetas, TODAS tus anotaciones y tu cuenta serán eliminadas de forma PERMANENTE (no se puede deshacer). Después serás desconectado. diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index ca25b390..855f38cc 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -99,11 +99,14 @@ config: # all: 'All' rss_limit: 'محدودیت آر-اس-اس' form_user: - # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'نام' email_label: 'نشانی ایمیل' # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Or use that code:' delete: # title: Delete my account (a.k.a danger zone) # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index b809ca32..f92b64a5 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -99,11 +99,14 @@ config: all: "Tous" rss_limit: "Nombre d’articles dans le flux" form_user: - two_factor_description: "Activer l’authentification double-facteur veut dire que vous allez recevoir un code par courriel OU que vous devriez utiliser une application de mot de passe à usage unique (comme Google Authenticator) pour obtenir un code temporaire à chaque nouvelle connexion non approuvée. Vous ne pouvez pas choisir les deux options." + two_factor_description: "Activer l’authentification double-facteur veut dire que vous allez recevoir un code par courriel OU que vous devriez utiliser une application de mot de passe à usage unique (comme Google Authenticator, Authy or FreeOTP) pour obtenir un code temporaire à chaque nouvelle connexion non approuvée. Vous ne pouvez pas choisir les deux options." name_label: "Nom" email_label: "Adresse courriel" emailTwoFactor_label: 'En utlisant l’email (recevez un code par email)' - googleTwoFactor_label: 'En utilisant une application de mot de passe à usage unique (ouvrez l’app, comme Google Authenticator, pour obtenir un mot de passe à usage unique)' + googleTwoFactor_label: 'En utilisant une application de mot de passe à usage unique (ouvrez l’app, comme Google Authenticator, Authy or FreeOTP, pour obtenir un mot de passe à usage unique)' + two_factor_code_description_1: Vous venez d’activer l’authentification double-facteur, ouvrez votre application OTP pour configurer la génération du mot de passe à usage unique. Ces informations disparaîtront après un rechargement de la page. + two_factor_code_description_2: 'Vous pouvez scanner le QR code avec votre application :' + two_factor_code_description_3: 'Ou utiliser le code suivant :' delete: title: "Supprimer mon compte (attention danger !)" description: "Si vous confirmez la suppression de votre compte, TOUS les articles, TOUS les tags, TOUTES les annotations et votre compte seront DÉFINITIVEMENT supprimé (c’est IRRÉVERSIBLE). Vous serez ensuite déconnecté." diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 7279dba1..95d4ac20 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -99,11 +99,14 @@ config: # all: 'All' rss_limit: 'Numero di elementi nel feed' form_user: - # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nome' email_label: 'E-mail' # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Or use that code:' delete: title: Cancella il mio account (zona pericolosa) description: Rimuovendo il tuo account, TUTTI i tuoi articoli, TUTTE le tue etichette, TUTTE le tue annotazioni ed il tuo account verranno rimossi PERMANENTEMENTE (impossibile da ANNULLARE). Verrai poi disconnesso. diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index f262ba7b..96725a06 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -99,11 +99,14 @@ config: all: 'Totes' rss_limit: "Nombre d'articles dins un flux RSS" form_user: - # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nom' email_label: 'Adreça de corrièl' # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Or use that code:' delete: title: Suprimir mon compte (Mèfi zòna perilhosa) description: Se confirmatz la supression de vòstre compte, TOTES vòstres articles, TOTAS vòstras etiquetas, TOTAS vòstras anotacions e vòstre compte seràn suprimits per totjorn. E aquò es IRREVERSIBLE. Puèi seretz desconnectat. diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 99c2183e..5f77061c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -99,11 +99,14 @@ config: all: 'Wszystkie' rss_limit: 'Link do RSS' form_user: - two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." + two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nazwa' email_label: 'Adres email' # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Or use that code:' delete: title: Usuń moje konto (niebezpieczna strefa !) description: Jeżeli usuniesz swoje konto, wszystkie twoje artykuły, tagi, adnotacje, oraz konto zostaną trwale usunięte (operacja jest NIEODWRACALNA). Następnie zostaniesz wylogowany. diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 806c2d78..f40f9795 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -99,11 +99,14 @@ config: # all: 'All' rss_limit: 'Número de itens no feed' form_user: - # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nome' email_label: 'E-mail' # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Or use that code:' delete: # title: Delete my account (a.k.a danger zone) # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index ed75ed6e..369d2d44 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -99,11 +99,14 @@ config: # all: 'All' rss_limit: 'Limită RSS' form_user: - # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nume' email_label: 'E-mail' # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Or use that code:' delete: # title: Delete my account (a.k.a danger zone) # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index 1c6e6771..d9b33fed 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -96,11 +96,14 @@ config: archive: 'архивные' rss_limit: 'Количество записей в фиде' form_user: - # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Имя' email_label: 'Email' # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Or use that code:' delete: title: "Удалить мой аккаунт (или опасная зона)" description: "Если Вы удалите ваш аккаунт, ВСЕ ваши записи, теги и другие данные, будут БЕЗВОЗВРАТНО удалены (операция не может быть отменена после). Затем Вы выйдете из системы." diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index af798943..f25bac84 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -99,11 +99,14 @@ config: all: 'ทั้งหมด' rss_limit: 'จำนวนไอเทมที่เก็บ' form_user: - # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'ชื่อ' email_label: 'อีเมล' # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Or use that code:' delete: title: ลบบัญชีของฉัน (โซนที่เป็นภัย!) description: ถ้าคุณลบบัญชีของคุณIf , รายการทั้งหมดของคุณ, แท็กทั้งหมดของคุณ, หมายเหตุทั้งหมดของคุณและบัญชีของคุณจะถูกลบอย่างถาวร (มันไม่สามารถยกเลิกได้) คุณจะต้องลงชื่อออก diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 352a2cc4..d65fc001 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -99,11 +99,14 @@ config: # all: 'All' rss_limit: 'RSS içeriğinden talep edilecek makale limiti' form_user: - # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator) to get a one time code on every new untrusted connection. You can't choose both option." + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'İsim' email_label: 'E-posta' # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, to get a one time code)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Or use that code:' delete: # title: Delete my account (a.k.a danger zone) # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. 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 ca7eb9f3..73cf592e 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 @@ -214,19 +214,18 @@ {% for OtpQrCode in app.session.flashbag.get('OtpQrCode') %}
    - You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. + {{ 'config.form_user.two_factor_code_description_1'|trans }}
    - That code will disapear after a page reload. + {{ 'config.form_user.two_factor_code_description_2'|trans }}

    - {{ app.user.getGoogleAuthenticatorSecret }} -

    - Or you can scan that QR Code with your app: -
    - +

    + {{ 'config.form_user.two_factor_code_description_3'|trans }} +

    + {{ app.user.getGoogleAuthenticatorSecret }}
    {% endfor %} {% endif %} -- cgit v1.2.3 From dfd0a7bc5feb4fd7b77d7e2f3a25c5c3febc1eba Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 3 Dec 2018 06:51:06 +0100 Subject: Add backup codes --- .../CoreBundle/Controller/ConfigController.php | 3 ++ .../Resources/translations/messages.da.yml | 1 + .../Resources/translations/messages.de.yml | 1 + .../Resources/translations/messages.en.yml | 1 + .../Resources/translations/messages.es.yml | 1 + .../Resources/translations/messages.fa.yml | 1 + .../Resources/translations/messages.fr.yml | 1 + .../Resources/translations/messages.it.yml | 1 + .../Resources/translations/messages.oc.yml | 1 + .../Resources/translations/messages.pl.yml | 1 + .../Resources/translations/messages.pt.yml | 1 + .../Resources/translations/messages.ro.yml | 1 + .../Resources/translations/messages.ru.yml | 1 + .../Resources/translations/messages.th.yml | 1 + .../Resources/translations/messages.tr.yml | 1 + .../views/themes/baggy/Config/index.html.twig | 19 ++++++----- .../views/themes/material/Config/index.html.twig | 8 +++-- src/Wallabag/UserBundle/Entity/User.php | 38 +++++++++++++++++++++- 18 files changed, 71 insertions(+), 11 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index 846e96ff..c9fc5702 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -2,6 +2,7 @@ namespace Wallabag\CoreBundle\Controller; +use PragmaRX\Recovery\Recovery as BackupCodes; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\RedirectResponse; @@ -93,10 +94,12 @@ class ConfigController extends Controller $user->setGoogleAuthenticatorSecret($secret); $user->setEmailTwoFactor(false); + $user->setBackupCodes((new BackupCodes())->toArray()); $this->addFlash('OtpQrCode', $this->get('scheb_two_factor.security.google_authenticator')->getQRContent($user)); } elseif (false === $userForm->get('googleTwoFactor')->getData() && true === $user->isGoogleAuthenticatorEnabled()) { $user->setGoogleAuthenticatorSecret(null); + $user->setBackupCodes(null); } } diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index d3e96e5c..0114a983 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -107,6 +107,7 @@ config: # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. # two_factor_code_description_2: 'You can scan that QR Code with your app:' # two_factor_code_description_3: 'Or use that code:' + # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' delete: # title: Delete my account (a.k.a danger zone) # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 9aeddceb..fd9796ba 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -107,6 +107,7 @@ config: # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. # two_factor_code_description_2: 'You can scan that QR Code with your app:' # two_factor_code_description_3: 'Or use that code:' + # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' delete: title: 'Lösche mein Konto (a.k.a Gefahrenzone)' description: 'Wenn du dein Konto löschst, werden ALL deine Artikel, ALL deine Tags, ALL deine Anmerkungen und dein Konto dauerhaft gelöscht (kann NICHT RÜCKGÄNGIG gemacht werden). Du wirst anschließend ausgeloggt.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 22c68c79..ddc079ed 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -107,6 +107,7 @@ config: two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. two_factor_code_description_2: 'You can scan that QR Code with your app:' two_factor_code_description_3: 'Or use that code:' + two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' delete: title: Delete my account (a.k.a danger zone) description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 6e710e56..8ac66169 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -107,6 +107,7 @@ config: # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. # two_factor_code_description_2: 'You can scan that QR Code with your app:' # two_factor_code_description_3: 'Or use that code:' + # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' delete: title: Eliminar mi cuenta (Zona peligrosa) description: Si eliminas tu cuenta, TODOS tus artículos, TODAS tus etiquetas, TODAS tus anotaciones y tu cuenta serán eliminadas de forma PERMANENTE (no se puede deshacer). Después serás desconectado. diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index 855f38cc..bc754ca2 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -107,6 +107,7 @@ config: # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. # two_factor_code_description_2: 'You can scan that QR Code with your app:' # two_factor_code_description_3: 'Or use that code:' + # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' delete: # title: Delete my account (a.k.a danger zone) # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index f92b64a5..28841145 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -107,6 +107,7 @@ config: two_factor_code_description_1: Vous venez d’activer l’authentification double-facteur, ouvrez votre application OTP pour configurer la génération du mot de passe à usage unique. Ces informations disparaîtront après un rechargement de la page. two_factor_code_description_2: 'Vous pouvez scanner le QR code avec votre application :' two_factor_code_description_3: 'Ou utiliser le code suivant :' + two_factor_code_description_4: 'N’oubliez pas de sauvegarder ces codes de secours dans un endroit sûr, vous pourrez les utiliser si vous ne pouvez plus accéder à votre application OTP :' delete: title: "Supprimer mon compte (attention danger !)" description: "Si vous confirmez la suppression de votre compte, TOUS les articles, TOUS les tags, TOUTES les annotations et votre compte seront DÉFINITIVEMENT supprimé (c’est IRRÉVERSIBLE). Vous serez ensuite déconnecté." diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 95d4ac20..b78dcb32 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -107,6 +107,7 @@ config: # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. # two_factor_code_description_2: 'You can scan that QR Code with your app:' # two_factor_code_description_3: 'Or use that code:' + # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' delete: title: Cancella il mio account (zona pericolosa) description: Rimuovendo il tuo account, TUTTI i tuoi articoli, TUTTE le tue etichette, TUTTE le tue annotazioni ed il tuo account verranno rimossi PERMANENTEMENTE (impossibile da ANNULLARE). Verrai poi disconnesso. diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 96725a06..c1f57bc7 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -107,6 +107,7 @@ config: # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. # two_factor_code_description_2: 'You can scan that QR Code with your app:' # two_factor_code_description_3: 'Or use that code:' + # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' delete: title: Suprimir mon compte (Mèfi zòna perilhosa) description: Se confirmatz la supression de vòstre compte, TOTES vòstres articles, TOTAS vòstras etiquetas, TOTAS vòstras anotacions e vòstre compte seràn suprimits per totjorn. E aquò es IRREVERSIBLE. Puèi seretz desconnectat. diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 5f77061c..2dc8d854 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -107,6 +107,7 @@ config: # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. # two_factor_code_description_2: 'You can scan that QR Code with your app:' # two_factor_code_description_3: 'Or use that code:' + # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' delete: title: Usuń moje konto (niebezpieczna strefa !) description: Jeżeli usuniesz swoje konto, wszystkie twoje artykuły, tagi, adnotacje, oraz konto zostaną trwale usunięte (operacja jest NIEODWRACALNA). Następnie zostaniesz wylogowany. diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index f40f9795..a81d8d0d 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -107,6 +107,7 @@ config: # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. # two_factor_code_description_2: 'You can scan that QR Code with your app:' # two_factor_code_description_3: 'Or use that code:' + # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' delete: # title: Delete my account (a.k.a danger zone) # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index 369d2d44..fd565819 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -107,6 +107,7 @@ config: # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. # two_factor_code_description_2: 'You can scan that QR Code with your app:' # two_factor_code_description_3: 'Or use that code:' + # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' delete: # title: Delete my account (a.k.a danger zone) # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index d9b33fed..5a0c5445 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -104,6 +104,7 @@ config: # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. # two_factor_code_description_2: 'You can scan that QR Code with your app:' # two_factor_code_description_3: 'Or use that code:' + # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' delete: title: "Удалить мой аккаунт (или опасная зона)" description: "Если Вы удалите ваш аккаунт, ВСЕ ваши записи, теги и другие данные, будут БЕЗВОЗВРАТНО удалены (операция не может быть отменена после). Затем Вы выйдете из системы." diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index f25bac84..a69b5008 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -107,6 +107,7 @@ config: # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. # two_factor_code_description_2: 'You can scan that QR Code with your app:' # two_factor_code_description_3: 'Or use that code:' + # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' delete: title: ลบบัญชีของฉัน (โซนที่เป็นภัย!) description: ถ้าคุณลบบัญชีของคุณIf , รายการทั้งหมดของคุณ, แท็กทั้งหมดของคุณ, หมายเหตุทั้งหมดของคุณและบัญชีของคุณจะถูกลบอย่างถาวร (มันไม่สามารถยกเลิกได้) คุณจะต้องลงชื่อออก diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index d65fc001..0c3d84e9 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -107,6 +107,7 @@ config: # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. # two_factor_code_description_2: 'You can scan that QR Code with your app:' # two_factor_code_description_3: 'Or use that code:' + # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' delete: # title: Delete my account (a.k.a danger zone) # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. 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 6ee57443..cf439408 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 @@ -187,19 +187,22 @@ {% for OtpQrCode in app.session.flashbag.get('OtpQrCode') %}
    - You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. + {{ 'config.form_user.two_factor_code_description_1'|trans }}
    - That code will disapear after a page reload. + {{ 'config.form_user.two_factor_code_description_2'|trans }}

    - {{ app.user.getGoogleAuthenticatorSecret }} -

    - Or you can scan that QR Code with your app: -
    - +

    + {{ 'config.form_user.two_factor_code_description_3'|trans }} +

    + {{ app.user.getGoogleAuthenticatorSecret }} +

    + {{ 'config.form_user.two_factor_code_description_4'|trans }} +

    + {{ app.user.getBackupCodes|join("\n")|nl2br }}
    {% endfor %} 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 73cf592e..5b00eb7b 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 @@ -112,7 +112,7 @@ @@ -220,12 +220,16 @@



    {{ 'config.form_user.two_factor_code_description_3'|trans }}

    {{ app.user.getGoogleAuthenticatorSecret }} +

    + {{ 'config.form_user.two_factor_code_description_4'|trans }} +

    + {{ app.user.getBackupCodes|join("\n")|nl2br }} {% endfor %} {% endif %} diff --git a/src/Wallabag/UserBundle/Entity/User.php b/src/Wallabag/UserBundle/Entity/User.php index 6e305719..ab34e2bf 100644 --- a/src/Wallabag/UserBundle/Entity/User.php +++ b/src/Wallabag/UserBundle/Entity/User.php @@ -8,6 +8,7 @@ use FOS\UserBundle\Model\User as BaseUser; use JMS\Serializer\Annotation\Accessor; use JMS\Serializer\Annotation\Groups; use JMS\Serializer\Annotation\XmlRoot; +use Scheb\TwoFactorBundle\Model\BackupCodeInterface; use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface as EmailTwoFactorInterface; use Scheb\TwoFactorBundle\Model\Google\TwoFactorInterface as GoogleTwoFactorInterface; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; @@ -28,7 +29,7 @@ use Wallabag\CoreBundle\Helper\EntityTimestampsTrait; * @UniqueEntity("email") * @UniqueEntity("username") */ -class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorInterface +class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorInterface, BackupCodeInterface { use EntityTimestampsTrait; @@ -127,6 +128,11 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI */ private $googleAuthenticatorSecret; + /** + * @ORM\Column(type="json_array", nullable=true) + */ + private $backupCodes; + /** * @var bool * @@ -318,6 +324,36 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI $this->googleAuthenticatorSecret = $googleAuthenticatorSecret; } + public function setBackupCodes(array $codes = null) + { + $this->backupCodes = $codes; + } + + public function getBackupCodes() + { + return $this->backupCodes; + } + + /** + * {@inheritdoc} + */ + public function isBackupCode(string $code): bool + { + return \in_array($code, $this->backupCodes, true); + } + + /** + * {@inheritdoc} + */ + public function invalidateBackupCode(string $code): void + { + $key = array_search($code, $this->backupCodes, true); + + if (false !== $key) { + unset($this->backupCodes[$key]); + } + } + /** * @param Client $client * -- cgit v1.2.3 From e073090b8d86ce925f8a08b68e212cc2af66e639 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 7 Dec 2018 18:00:57 +0100 Subject: Update translation --- src/Wallabag/CoreBundle/Resources/translations/messages.da.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.de.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.en.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.es.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.it.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.th.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index 0114a983..ae8f8695 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -538,7 +538,7 @@ user: # enabled_label: 'Enabled' # last_login_label: 'Last login' # twofactor_email_label: Two factor authentication by email - # twofactor_google_label: Two factor authentication by Google + # twofactor_google_label: Two factor authentication by OTP app # save: Save # delete: Delete # delete_confirm: Are you sure? diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index fd9796ba..7b66e5dc 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -538,7 +538,7 @@ user: enabled_label: 'Aktiviert' last_login_label: 'Letzter Login' # twofactor_email_label: Two factor authentication by email - # twofactor_google_label: Two factor authentication by Google + # twofactor_google_label: Two factor authentication by OTP app save: 'Speichern' delete: 'Löschen' delete_confirm: 'Bist du sicher?' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index ddc079ed..567584b2 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -538,7 +538,7 @@ user: enabled_label: 'Enabled' last_login_label: 'Last login' twofactor_email_label: Two factor authentication by email - twofactor_google_label: Two factor authentication by Google + twofactor_google_label: Two factor authentication by OTP app save: Save delete: Delete delete_confirm: Are you sure? diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 8ac66169..1ba4bce4 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -538,7 +538,7 @@ user: enabled_label: 'Activado' last_login_label: 'Último inicio de sesión' # twofactor_email_label: Two factor authentication by email - # twofactor_google_label: Two factor authentication by Google + # twofactor_google_label: Two factor authentication by OTP app save: Guardar delete: Eliminar delete_confirm: ¿Estás seguro? diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index bc754ca2..d20c89d9 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -538,7 +538,7 @@ user: # enabled_label: 'Enabled' # last_login_label: 'Last login' # twofactor_email_label: Two factor authentication by email - # twofactor_google_label: Two factor authentication by Google + # twofactor_google_label: Two factor authentication by OTP app # save: Save # delete: Delete # delete_confirm: Are you sure? diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 28841145..fd405059 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -539,7 +539,7 @@ user: last_login_label: "Dernière connexion" twofactor_label: "Double authentification" twofactor_email_label: Double authentification par email - twofactor_google_label: Double authentification par Google + twofactor_google_label: Double authentification par OTP app save: "Sauvegarder" delete: "Supprimer" delete_confirm: "Êtes-vous sûr ?" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index b78dcb32..33326231 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -538,7 +538,7 @@ user: enabled_label: 'Abilitato' last_login_label: 'Ultima connessione' # twofactor_email_label: Two factor authentication by email - # twofactor_google_label: Two factor authentication by Google + # twofactor_google_label: Two factor authentication by OTP app save: Salva delete: Cancella delete_confirm: Sei sicuro? diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index c1f57bc7..599490e1 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -538,7 +538,7 @@ user: enabled_label: 'Actiu' last_login_label: 'Darrièra connexion' # twofactor_email_label: Two factor authentication by email - # twofactor_google_label: Two factor authentication by Google + # twofactor_google_label: Two factor authentication by OTP app save: 'Enregistrar' delete: 'Suprimir' delete_confirm: 'Sètz segur ?' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 2dc8d854..89fd34dc 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -538,7 +538,7 @@ user: enabled_label: 'Włączony' last_login_label: 'Ostatnie logowanie' # twofactor_email_label: Two factor authentication by email - # twofactor_google_label: Two factor authentication by Google + # twofactor_google_label: Two factor authentication by OTP app save: Zapisz delete: Usuń delete_confirm: Jesteś pewien? diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index a81d8d0d..f37aeb91 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -538,7 +538,7 @@ user: enabled_label: 'Habilitado' last_login_label: 'Último login' # twofactor_email_label: Two factor authentication by email - # twofactor_google_label: Two factor authentication by Google + # twofactor_google_label: Two factor authentication by OTP app save: 'Salvar' delete: 'Apagar' delete_confirm: 'Tem certeza?' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index fd565819..c9d9500d 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -538,7 +538,7 @@ user: # enabled_label: 'Enabled' # last_login_label: 'Last login' # twofactor_email_label: Two factor authentication by email - # twofactor_google_label: Two factor authentication by Google + # twofactor_google_label: Two factor authentication by OTP app # save: Save # delete: Delete # delete_confirm: Are you sure? diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index 5a0c5445..62a078d4 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -526,7 +526,7 @@ user: enabled_label: 'Включить' last_login_label: 'Последний вход' # twofactor_email_label: Two factor authentication by email - # twofactor_google_label: Two factor authentication by Google + # twofactor_google_label: Two factor authentication by OTP app save: "Сохранить" delete: "Удалить" delete_confirm: "Вы уверены?" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index a69b5008..78b5727a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -536,7 +536,7 @@ user: enabled_label: 'เปิดใช้งาน' last_login_label: 'ลงชื้อเข้าใช้ครั้งสุดท้าย' # twofactor_email_label: Two factor authentication by email - # twofactor_google_label: Two factor authentication by Google + # twofactor_google_label: Two factor authentication by OTP app save: บันทึก delete: ลบ delete_confirm: ตุณแน่ใจหรือไม่? diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 0c3d84e9..9f4c01f7 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -536,7 +536,7 @@ user: # enabled_label: 'Enabled' # last_login_label: 'Last login' # twofactor_email_label: Two factor authentication by email - # twofactor_google_label: Two factor authentication by Google + # twofactor_google_label: Two factor authentication by OTP app # save: Save # delete: Delete # delete_confirm: Are you sure? -- cgit v1.2.3 From 4c0e747940ac39630f1d2a6a14c628ba6729ecfd Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 7 Dec 2018 18:01:06 +0100 Subject: Remove secret from admin --- src/Wallabag/UserBundle/Resources/views/Manage/edit.html.twig | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/UserBundle/Resources/views/Manage/edit.html.twig b/src/Wallabag/UserBundle/Resources/views/Manage/edit.html.twig index 8be37e79..2de8f3a5 100644 --- a/src/Wallabag/UserBundle/Resources/views/Manage/edit.html.twig +++ b/src/Wallabag/UserBundle/Resources/views/Manage/edit.html.twig @@ -59,12 +59,6 @@ {{ form_label(edit_form.googleTwoFactor) }} {{ form_errors(edit_form.googleTwoFactor) }} - - {% if user.isGoogleAuthenticatorEnabled %} -
    -

    OTP Secret: {{ user.googleAuthenticatorSecret }}

    -
    - {% endif %} {% endif %} -- cgit v1.2.3 From a0c5eb003f1cbeef10d5620e98870c7556e17c75 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 18 Jan 2019 22:46:44 +0100 Subject: Change the way to enable 2FA And add a step to validate a generated code from the OTP app --- .../CoreBundle/Controller/ConfigController.php | 132 +++++++++++++++++---- .../Resources/translations/messages.da.yml | 25 +++- .../Resources/translations/messages.de.yml | 16 ++- .../Resources/translations/messages.en.yml | 26 +++- .../Resources/translations/messages.es.yml | 25 +++- .../Resources/translations/messages.fa.yml | 25 +++- .../Resources/translations/messages.fr.yml | 26 +++- .../Resources/translations/messages.it.yml | 24 +++- .../Resources/translations/messages.oc.yml | 24 +++- .../Resources/translations/messages.pl.yml | 26 ++-- .../Resources/translations/messages.pt.yml | 24 +++- .../Resources/translations/messages.ro.yml | 24 +++- .../Resources/translations/messages.ru.yml | 24 +++- .../Resources/translations/messages.th.yml | 24 +++- .../Resources/translations/messages.tr.yml | 24 +++- .../views/themes/baggy/Config/index.html.twig | 61 +++++----- .../views/themes/baggy/Config/otp_app.html.twig | 55 +++++++++ .../views/themes/material/Config/index.html.twig | 65 +++++----- .../views/themes/material/Config/otp_app.html.twig | 63 ++++++++++ 19 files changed, 536 insertions(+), 177 deletions(-) create mode 100644 src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/otp_app.html.twig create mode 100644 src/Wallabag/CoreBundle/Resources/views/themes/material/Config/otp_app.html.twig (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index c9fc5702..2643eed0 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -81,28 +81,7 @@ class ConfigController extends Controller ]); $userForm->handleRequest($request); - // `googleTwoFactor` isn't a field within the User entity, we need to define it's value in a different way - if ($this->getParameter('twofactor_auth') && true === $user->isGoogleAuthenticatorEnabled() && false === $userForm->isSubmitted()) { - $userForm->get('googleTwoFactor')->setData(true); - } - if ($userForm->isSubmitted() && $userForm->isValid()) { - // handle creation / reset of the OTP secret if checkbox changed from the previous state - if ($this->getParameter('twofactor_auth')) { - if (true === $userForm->get('googleTwoFactor')->getData() && false === $user->isGoogleAuthenticatorEnabled()) { - $secret = $this->get('scheb_two_factor.security.google_authenticator')->generateSecret(); - - $user->setGoogleAuthenticatorSecret($secret); - $user->setEmailTwoFactor(false); - $user->setBackupCodes((new BackupCodes())->toArray()); - - $this->addFlash('OtpQrCode', $this->get('scheb_two_factor.security.google_authenticator')->getQRContent($user)); - } elseif (false === $userForm->get('googleTwoFactor')->getData() && true === $user->isGoogleAuthenticatorEnabled()) { - $user->setGoogleAuthenticatorSecret(null); - $user->setBackupCodes(null); - } - } - $userManager->updateUser($user, true); $this->addFlash( @@ -175,11 +154,118 @@ class ConfigController extends Controller ], 'twofactor_auth' => $this->getParameter('twofactor_auth'), 'wallabag_url' => $this->getParameter('domain_name'), - 'enabled_users' => $this->get('wallabag_user.user_repository') - ->getSumEnabledUsers(), + 'enabled_users' => $this->get('wallabag_user.user_repository')->getSumEnabledUsers(), ]); } + /** + * Enable 2FA using email. + * + * @param Request $request + * + * @Route("/config/otp/email", name="config_otp_email") + */ + public function otpEmailAction(Request $request) + { + if (!$this->getParameter('twofactor_auth')) { + return $this->createNotFoundException('two_factor not enabled'); + } + + $user = $this->getUser(); + + $user->setGoogleAuthenticatorSecret(null); + $user->setBackupCodes(null); + $user->setEmailTwoFactor(true); + + $this->container->get('fos_user.user_manager')->updateUser($user, true); + + $this->addFlash( + 'notice', + 'flashes.config.notice.otp_enabled' + ); + + return $this->redirect($this->generateUrl('config') . '#set3'); + } + + /** + * Enable 2FA using OTP app, user will need to confirm the generated code from the app. + * + * @Route("/config/otp/app", name="config_otp_app") + */ + public function otpAppAction() + { + if (!$this->getParameter('twofactor_auth')) { + return $this->createNotFoundException('two_factor not enabled'); + } + + $user = $this->getUser(); + + if (!$user->isGoogleTwoFactor()) { + $secret = $this->get('scheb_two_factor.security.google_authenticator')->generateSecret(); + + $user->setGoogleAuthenticatorSecret($secret); + $user->setEmailTwoFactor(false); + $user->setBackupCodes((new BackupCodes())->toArray()); + + $this->container->get('fos_user.user_manager')->updateUser($user, true); + } + + return $this->render('WallabagCoreBundle:Config:otp_app.html.twig', [ + 'qr_code' => $this->get('scheb_two_factor.security.google_authenticator')->getQRContent($user), + ]); + } + + /** + * Cancelling 2FA using OTP app. + * + * @Route("/config/otp/app/cancel", name="config_otp_app_cancel") + */ + public function otpAppCancelAction() + { + if (!$this->getParameter('twofactor_auth')) { + return $this->createNotFoundException('two_factor not enabled'); + } + + $user = $this->getUser(); + $user->setGoogleAuthenticatorSecret(null); + $user->setBackupCodes(null); + + $this->container->get('fos_user.user_manager')->updateUser($user, true); + + return $this->redirect($this->generateUrl('config') . '#set3'); + } + + /** + * Validate OTP code. + * + * @param Request $request + * + * @Route("/config/otp/app/check", name="config_otp_app_check") + */ + public function otpAppCheckAction(Request $request) + { + $isValid = $this->get('scheb_two_factor.security.google_authenticator')->checkCode( + $this->getUser(), + $request->get('_auth_code') + ); + + if (true === $isValid) { + $this->addFlash( + 'notice', + 'flashes.config.notice.otp_enabled' + ); + + return $this->redirect($this->generateUrl('config') . '#set3'); + } + + $this->addFlash( + 'two_factor', + 'scheb_two_factor.code_invalid' + ); + + return $this->redirect($this->generateUrl('config_otp_app')); + } + /** * @param Request $request * diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index ae8f8695..454f547d 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -102,12 +102,16 @@ config: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Navn' email_label: 'Emailadresse' - # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' - # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. - # two_factor_code_description_2: 'You can scan that QR Code with your app:' - # two_factor_code_description_3: 'Or use that code:' - # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + two_factor: + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # table_method: Method + # table_state: State + # table_action: Action + # state_enabled: Enabled + # state_disabled: Disabled + # action_email: Use email + # action_app: Use OTP App delete: # title: Delete my account (a.k.a danger zone) # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. @@ -165,6 +169,15 @@ config: # and: 'One rule AND another' # matches: 'Tests that a subject matches a search (case-insensitive).
    Example: title matches "football"' # notmatches: 'Tests that a subject doesn''t match match a search (case-insensitive).
    Example: title notmatches "football"' + otp: + # page_title: Two-factor authentication + # app: + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + # two_factor_code_description_4: 'Test an OTP code from your configured app:' + # cancel: Cancel + # enable: Enable entry: # default_title: 'Title of the entry' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 7b66e5dc..dc1d4723 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -102,12 +102,16 @@ config: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Name' email_label: 'E-Mail-Adresse' - # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' - # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. - # two_factor_code_description_2: 'You can scan that QR Code with your app:' - # two_factor_code_description_3: 'Or use that code:' - # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + two_factor: + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # table_method: Method + # table_state: State + # table_action: Action + # state_enabled: Enabled + # state_disabled: Disabled + # action_email: Use email + # action_app: Use OTP App delete: title: 'Lösche mein Konto (a.k.a Gefahrenzone)' description: 'Wenn du dein Konto löschst, werden ALL deine Artikel, ALL deine Tags, ALL deine Anmerkungen und dein Konto dauerhaft gelöscht (kann NICHT RÜCKGÄNGIG gemacht werden). Du wirst anschließend ausgeloggt.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 567584b2..45145c80 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -102,12 +102,16 @@ config: two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Name' email_label: 'Email' - emailTwoFactor_label: 'Using email (receive a code by email)' - googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' - two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. - two_factor_code_description_2: 'You can scan that QR Code with your app:' - two_factor_code_description_3: 'Or use that code:' - two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + two_factor: + emailTwoFactor_label: 'Using email (receive a code by email)' + googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + table_method: Method + table_state: State + table_action: Action + state_enabled: Enabled + state_disabled: Disabled + action_email: Use email + action_app: Use OTP App delete: title: Delete my account (a.k.a danger zone) description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. @@ -165,6 +169,15 @@ config: and: 'One rule AND another' matches: 'Tests that a subject matches a search (case-insensitive).
    Example: title matches "football"' notmatches: 'Tests that a subject doesn''t match match a search (case-insensitive).
    Example: title notmatches "football"' + otp: + page_title: Two-factor authentication + app: + two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + two_factor_code_description_2: 'You can scan that QR Code with your app:' + two_factor_code_description_3: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + two_factor_code_description_4: 'Test an OTP code from your configured app:' + cancel: Cancel + enable: Enable entry: default_title: 'Title of the entry' @@ -584,6 +597,7 @@ flashes: tags_reset: Tags reset entries_reset: Entries reset archived_reset: Archived entries deleted + otp_enabled: Two-factor authentication enabled entry: notice: entry_already_saved: 'Entry already saved on %date%' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 1ba4bce4..c1047e55 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -102,12 +102,16 @@ config: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nombre' email_label: 'Dirección de e-mail' - # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' - # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. - # two_factor_code_description_2: 'You can scan that QR Code with your app:' - # two_factor_code_description_3: 'Or use that code:' - # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + two_factor: + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # table_method: Method + # table_state: State + # table_action: Action + # state_enabled: Enabled + # state_disabled: Disabled + # action_email: Use email + # action_app: Use OTP App delete: title: Eliminar mi cuenta (Zona peligrosa) description: Si eliminas tu cuenta, TODOS tus artículos, TODAS tus etiquetas, TODAS tus anotaciones y tu cuenta serán eliminadas de forma PERMANENTE (no se puede deshacer). Después serás desconectado. @@ -165,6 +169,15 @@ config: and: 'Una regla Y la otra' matches: 'Prueba si un sujeto corresponde a una búsqueda (insensible a mayusculas).
    Ejemplo : title matches "fútbol"' # notmatches: 'Tests that a subject doesn''t match match a search (case-insensitive).
    Example: title notmatches "football"' + otp: + # page_title: Two-factor authentication + # app: + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + # two_factor_code_description_4: 'Test an OTP code from your configured app:' + # cancel: Cancel + # enable: Enable entry: default_title: 'Título del artículo' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index d20c89d9..3042de2e 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -102,12 +102,16 @@ config: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'نام' email_label: 'نشانی ایمیل' - # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' - # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. - # two_factor_code_description_2: 'You can scan that QR Code with your app:' - # two_factor_code_description_3: 'Or use that code:' - # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + two_factor: + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # table_method: Method + # table_state: State + # table_action: Action + # state_enabled: Enabled + # state_disabled: Disabled + # action_email: Use email + # action_app: Use OTP App delete: # title: Delete my account (a.k.a danger zone) # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. @@ -165,6 +169,15 @@ config: # and: 'One rule AND another' # matches: 'Tests that a subject matches a search (case-insensitive).
    Example: title matches "football"' # notmatches: 'Tests that a subject doesn''t match match a search (case-insensitive).
    Example: title notmatches "football"' + otp: + # page_title: Two-factor authentication + # app: + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + # two_factor_code_description_4: 'Test an OTP code from your configured app:' + # cancel: Cancel + # enable: Enable entry: # default_title: 'Title of the entry' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index fd405059..57740ba2 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -102,12 +102,16 @@ config: two_factor_description: "Activer l’authentification double-facteur veut dire que vous allez recevoir un code par courriel OU que vous devriez utiliser une application de mot de passe à usage unique (comme Google Authenticator, Authy or FreeOTP) pour obtenir un code temporaire à chaque nouvelle connexion non approuvée. Vous ne pouvez pas choisir les deux options." name_label: "Nom" email_label: "Adresse courriel" - emailTwoFactor_label: 'En utlisant l’email (recevez un code par email)' - googleTwoFactor_label: 'En utilisant une application de mot de passe à usage unique (ouvrez l’app, comme Google Authenticator, Authy or FreeOTP, pour obtenir un mot de passe à usage unique)' - two_factor_code_description_1: Vous venez d’activer l’authentification double-facteur, ouvrez votre application OTP pour configurer la génération du mot de passe à usage unique. Ces informations disparaîtront après un rechargement de la page. - two_factor_code_description_2: 'Vous pouvez scanner le QR code avec votre application :' - two_factor_code_description_3: 'Ou utiliser le code suivant :' - two_factor_code_description_4: 'N’oubliez pas de sauvegarder ces codes de secours dans un endroit sûr, vous pourrez les utiliser si vous ne pouvez plus accéder à votre application OTP :' + two_factor: + emailTwoFactor_label: 'En utlisant l’email (recevez un code par email)' + googleTwoFactor_label: 'En utilisant une application de mot de passe à usage unique (ouvrez l’app, comme Google Authenticator, Authy or FreeOTP, pour obtenir un mot de passe à usage unique)' + table_method: Méthode + table_state: État + table_action: Action + state_enabled: Activé + state_disabled: Désactivé + action_email: Utiliser l'email + action_app: Utiliser une app OTP delete: title: "Supprimer mon compte (attention danger !)" description: "Si vous confirmez la suppression de votre compte, TOUS les articles, TOUS les tags, TOUTES les annotations et votre compte seront DÉFINITIVEMENT supprimé (c’est IRRÉVERSIBLE). Vous serez ensuite déconnecté." @@ -165,6 +169,15 @@ config: and: "Une règle ET l’autre" matches: "Teste si un sujet correspond à une recherche (non sensible à la casse).
    Exemple : title matches \"football\"" notmatches: "Teste si un sujet ne correspond pas à une recherche (non sensible à la casse).
    Exemple : title notmatches \"football\"" + otp: + page_title: Authentification double-facteur + app: + two_factor_code_description_1: Vous venez d’activer l’authentification double-facteur, ouvrez votre application OTP pour configurer la génération du mot de passe à usage unique. Ces informations disparaîtront après un rechargement de la page. + two_factor_code_description_2: 'Vous pouvez scanner le QR code avec votre application :' + two_factor_code_description_3: 'N’oubliez pas de sauvegarder ces codes de secours dans un endroit sûr, vous pourrez les utiliser si vous ne pouvez plus accéder à votre application OTP :' + two_factor_code_description_4: 'Testez un code généré par votre application OTP :' + cancel: Annuler + enable: Activer entry: default_title: "Titre de l’article" @@ -585,6 +598,7 @@ flashes: tags_reset: "Tags supprimés" entries_reset: "Articles supprimés" archived_reset: "Articles archivés supprimés" + otp_enabled: "Authentification à double-facteur activée" entry: notice: entry_already_saved: "Article déjà sauvegardé le %date%" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 33326231..274e5338 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -102,12 +102,15 @@ config: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nome' email_label: 'E-mail' - # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' - # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. - # two_factor_code_description_2: 'You can scan that QR Code with your app:' - # two_factor_code_description_3: 'Or use that code:' - # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # table_method: Method + # table_state: State + # table_action: Action + # state_enabled: Enabled + # state_disabled: Disabled + # action_email: Use email + # action_app: Use OTP App delete: title: Cancella il mio account (zona pericolosa) description: Rimuovendo il tuo account, TUTTI i tuoi articoli, TUTTE le tue etichette, TUTTE le tue annotazioni ed il tuo account verranno rimossi PERMANENTEMENTE (impossibile da ANNULLARE). Verrai poi disconnesso. @@ -165,6 +168,15 @@ config: and: "Una regola E un'altra" matches: 'Verifica che un oggetto risulti in una ricerca (case-insensitive).
    Esempio: titolo contiene "football"' # notmatches: 'Tests that a subject doesn''t match match a search (case-insensitive).
    Example: title notmatches "football"' + otp: + # page_title: Two-factor authentication + # app: + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + # two_factor_code_description_4: 'Test an OTP code from your configured app:' + # cancel: Cancel + # enable: Enable entry: default_title: "Titolo del contenuto" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 599490e1..4e5370f9 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -102,12 +102,15 @@ config: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nom' email_label: 'Adreça de corrièl' - # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' - # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. - # two_factor_code_description_2: 'You can scan that QR Code with your app:' - # two_factor_code_description_3: 'Or use that code:' - # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # table_method: Method + # table_state: State + # table_action: Action + # state_enabled: Enabled + # state_disabled: Disabled + # action_email: Use email + # action_app: Use OTP App delete: title: Suprimir mon compte (Mèfi zòna perilhosa) description: Se confirmatz la supression de vòstre compte, TOTES vòstres articles, TOTAS vòstras etiquetas, TOTAS vòstras anotacions e vòstre compte seràn suprimits per totjorn. E aquò es IRREVERSIBLE. Puèi seretz desconnectat. @@ -165,6 +168,15 @@ config: and: "Una règla E l'autra" matches: 'Teste se un subjècte correspond a una recèrca (non sensibla a la cassa).
    Exemple : title matches \"football\"' notmatches: 'Teste se subjècte correspond pas a una recèrca (sensibla a la cassa).
    Example : title notmatches "football"' + otp: + # page_title: Two-factor authentication + # app: + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + # two_factor_code_description_4: 'Test an OTP code from your configured app:' + # cancel: Cancel + # enable: Enable entry: default_title: "Títol de l'article" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 89fd34dc..a7a4d6c3 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -99,15 +99,18 @@ config: all: 'Wszystkie' rss_limit: 'Link do RSS' form_user: - two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." + # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nazwa' email_label: 'Adres email' - # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' - # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. - # two_factor_code_description_2: 'You can scan that QR Code with your app:' - # two_factor_code_description_3: 'Or use that code:' - # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # table_method: Method + # table_state: State + # table_action: Action + # state_enabled: Enabled + # state_disabled: Disabled + # action_email: Use email + # action_app: Use OTP App delete: title: Usuń moje konto (niebezpieczna strefa !) description: Jeżeli usuniesz swoje konto, wszystkie twoje artykuły, tagi, adnotacje, oraz konto zostaną trwale usunięte (operacja jest NIEODWRACALNA). Następnie zostaniesz wylogowany. @@ -165,6 +168,15 @@ config: and: 'Jedna reguła I inna' matches: 'Sprawdź czy temat pasuje szukaj (duże lub małe litery).
    Przykład: tytuł zawiera "piłka nożna"' notmatches: 'Sprawdź czy temat nie zawiera szukaj (duże lub małe litery).
    Przykład: tytuł nie zawiera "piłka nożna"' + otp: + # page_title: Two-factor authentication + # app: + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + # two_factor_code_description_4: 'Test an OTP code from your configured app:' + # cancel: Cancel + # enable: Enable entry: default_title: 'Tytuł wpisu' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index f37aeb91..a5483a6d 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -102,12 +102,15 @@ config: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nome' email_label: 'E-mail' - # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' - # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. - # two_factor_code_description_2: 'You can scan that QR Code with your app:' - # two_factor_code_description_3: 'Or use that code:' - # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # table_method: Method + # table_state: State + # table_action: Action + # state_enabled: Enabled + # state_disabled: Disabled + # action_email: Use email + # action_app: Use OTP App delete: # title: Delete my account (a.k.a danger zone) # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. @@ -165,6 +168,15 @@ config: and: 'Uma regra E outra' matches: 'Testa que um assunto corresponde a uma pesquisa (maiúscula ou minúscula).
    Exemplo: título corresponde a "futebol"' # notmatches: 'Tests that a subject doesn''t match match a search (case-insensitive).
    Example: title notmatches "football"' + otp: + # page_title: Two-factor authentication + # app: + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + # two_factor_code_description_4: 'Test an OTP code from your configured app:' + # cancel: Cancel + # enable: Enable entry: default_title: 'Título da entrada' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index c9d9500d..3b7fbd69 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -102,12 +102,15 @@ config: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nume' email_label: 'E-mail' - # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' - # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. - # two_factor_code_description_2: 'You can scan that QR Code with your app:' - # two_factor_code_description_3: 'Or use that code:' - # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # table_method: Method + # table_state: State + # table_action: Action + # state_enabled: Enabled + # state_disabled: Disabled + # action_email: Use email + # action_app: Use OTP App delete: # title: Delete my account (a.k.a danger zone) # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. @@ -165,6 +168,15 @@ config: # and: 'One rule AND another' # matches: 'Tests that a subject matches a search (case-insensitive).
    Example: title matches "football"' # notmatches: 'Tests that a subject doesn''t match match a search (case-insensitive).
    Example: title notmatches "football"' + otp: + # page_title: Two-factor authentication + # app: + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + # two_factor_code_description_4: 'Test an OTP code from your configured app:' + # cancel: Cancel + # enable: Enable entry: # default_title: 'Title of the entry' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index 62a078d4..92746631 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -99,12 +99,15 @@ config: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Имя' email_label: 'Email' - # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' - # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. - # two_factor_code_description_2: 'You can scan that QR Code with your app:' - # two_factor_code_description_3: 'Or use that code:' - # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # table_method: Method + # table_state: State + # table_action: Action + # state_enabled: Enabled + # state_disabled: Disabled + # action_email: Use email + # action_app: Use OTP App delete: title: "Удалить мой аккаунт (или опасная зона)" description: "Если Вы удалите ваш аккаунт, ВСЕ ваши записи, теги и другие данные, будут БЕЗВОЗВРАТНО удалены (операция не может быть отменена после). Затем Вы выйдете из системы." @@ -160,6 +163,15 @@ config: or: 'Одно правило ИЛИ другое' and: 'Одно правило И другое' matches: 'Тесты, в которых тема соответствует поиску (без учета регистра). Пример: title matches "футбол" ' + otp: + # page_title: Two-factor authentication + # app: + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + # two_factor_code_description_4: 'Test an OTP code from your configured app:' + # cancel: Cancel + # enable: Enable entry: default_title: 'Название записи' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index 78b5727a..1fe4fa0e 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -102,12 +102,15 @@ config: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'ชื่อ' email_label: 'อีเมล' - # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' - # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. - # two_factor_code_description_2: 'You can scan that QR Code with your app:' - # two_factor_code_description_3: 'Or use that code:' - # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # table_method: Method + # table_state: State + # table_action: Action + # state_enabled: Enabled + # state_disabled: Disabled + # action_email: Use email + # action_app: Use OTP App delete: title: ลบบัญชีของฉัน (โซนที่เป็นภัย!) description: ถ้าคุณลบบัญชีของคุณIf , รายการทั้งหมดของคุณ, แท็กทั้งหมดของคุณ, หมายเหตุทั้งหมดของคุณและบัญชีของคุณจะถูกลบอย่างถาวร (มันไม่สามารถยกเลิกได้) คุณจะต้องลงชื่อออก @@ -165,6 +168,15 @@ config: and: 'หนึ่งข้อบังคับและอื่นๆ' matches: 'ทดสอบว่า เรื่อง นี้ตรงกับ การต้นหา (กรณีไม่ทราบ).
    ตัวอย่าง: หัวข้อที่ตรงกับ "football"' notmatches: 'ทดสอบว่า เรื่อง นี้ไม่ตรงกับ การต้นหา (กรณีไม่ทราบ).
    ตัวอย่าง: หัวข้อทีไม่ตรงกับ "football"' + otp: + # page_title: Two-factor authentication + # app: + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + # two_factor_code_description_4: 'Test an OTP code from your configured app:' + # cancel: Cancel + # enable: Enable entry: default_title: 'หัวข้อรายการ' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 9f4c01f7..3b8a0d59 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -102,12 +102,15 @@ config: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'İsim' email_label: 'E-posta' - # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' - # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. - # two_factor_code_description_2: 'You can scan that QR Code with your app:' - # two_factor_code_description_3: 'Or use that code:' - # two_factor_code_description_4: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + # emailTwoFactor_label: 'Using email (receive a code by email)' + # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' + # table_method: Method + # table_state: State + # table_action: Action + # state_enabled: Enabled + # state_disabled: Disabled + # action_email: Use email + # action_app: Use OTP App delete: # title: Delete my account (a.k.a danger zone) # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. @@ -165,6 +168,15 @@ config: and: 'Bir kural ve diğeri' # matches: 'Tests that a subject matches a search (case-insensitive).
    Example: title matches "football"' # notmatches: 'Tests that a subject doesn''t match match a search (case-insensitive).
    Example: title notmatches "football"' + otp: + # page_title: Two-factor authentication + # app: + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + # two_factor_code_description_4: 'Test an OTP code from your configured app:' + # cancel: Cancel + # enable: Enable entry: default_title: 'Makalenin başlığı' 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 cf439408..93f8ddf8 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 @@ -168,48 +168,41 @@ + {{ form_widget(form.user.save) }} + {% if twofactor_auth %} +
    {{ 'config.otp.page_title'|trans }}
    +
    {{ 'config.form_user.two_factor_description'|trans }}
    -
    -
    - {{ form_label(form.user.emailTwoFactor) }} - {{ form_errors(form.user.emailTwoFactor) }} - {{ form_widget(form.user.emailTwoFactor) }} -
    -
    -
    - {{ form_label(form.user.googleTwoFactor) }} - {{ form_widget(form.user.googleTwoFactor) }} - {{ form_errors(form.user.googleTwoFactor) }} -
    - {% for OtpQrCode in app.session.flashbag.get('OtpQrCode') %} -
    - {{ 'config.form_user.two_factor_code_description_1'|trans }} -
    - {{ 'config.form_user.two_factor_code_description_2'|trans }} -

    - - -

    - {{ 'config.form_user.two_factor_code_description_3'|trans }} -

    - {{ app.user.getGoogleAuthenticatorSecret }} -

    - {{ 'config.form_user.two_factor_code_description_4'|trans }} -

    - {{ app.user.getBackupCodes|join("\n")|nl2br }} -
    - {% endfor %} -
    + + + + + + + + + + + + + + + + + + + + + +
    {{ 'config.form_user.two_factor.table_method'|trans }}{{ 'config.form_user.two_factor.table_state'|trans }}{{ 'config.form_user.two_factor.table_action'|trans }}
    {{ 'config.form_user.two_factor.emailTwoFactor_label'|trans }}{% if app.user.isEmailTwoFactor %}{{ 'config.form_user.two_factor.state_enabled'|trans }}{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}{{ 'config.form_user.two_factor.action_email'|trans }}
    {{ 'config.form_user.two_factor.googleTwoFactor_label'|trans }}{% if app.user.isGoogleTwoFactor %}{{ 'config.form_user.two_factor.state_enabled'|trans }}{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}{{ 'config.form_user.two_factor.action_app'|trans }}
    + {% endif %} {{ form_widget(form.user._token) }} - {{ form_widget(form.user.save) }} {% if enabled_users > 1 %} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/otp_app.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/otp_app.html.twig new file mode 100644 index 00000000..2e4442e3 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/otp_app.html.twig @@ -0,0 +1,55 @@ +{% extends "WallabagCoreBundle::layout.html.twig" %} + +{% block title %}{{ 'config.page_title'|trans }} > {{ 'config.otp.page_title'|trans }}{% endblock %} + +{% block content %} +
    {{ 'config.otp.page_title'|trans }}
    + +
      +
    1. +

      {{ 'config.otp.app.two_factor_code_description_1'|trans }}

      +

      {{ 'config.otp.app.two_factor_code_description_2'|trans }}

      + +

      + + +

      +
    2. +
    3. +

      {{ 'config.otp.app.two_factor_code_description_3'|trans }}

      + +

      {{ app.user.getBackupCodes|join("\n")|nl2br }}

      +
    4. +
    5. +

      {{ 'config.otp.app.two_factor_code_description_4'|trans }}

      + + {% for flashMessage in app.session.flashbag.get("two_factor") %} +
      + {{ flashMessage|trans }} +
      + {% endfor %} + +
      +
      +
      +
      + + +
      +
      +
      +
      + + {{ 'config.otp.app.cancel'|trans }} + + +
      +
      +
    6. +
    +{% endblock %} 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 5b00eb7b..412c18f4 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 @@ -196,45 +196,40 @@ + {{ form_widget(form.user.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} + {% if twofactor_auth %} +
    +
    - {{ 'config.form_user.two_factor_description'|trans }} - -
    - {{ form_widget(form.user.emailTwoFactor) }} - {{ form_label(form.user.emailTwoFactor) }} - {{ form_errors(form.user.emailTwoFactor) }} -
    -
    - {{ form_widget(form.user.googleTwoFactor) }} - {{ form_label(form.user.googleTwoFactor) }} - {{ form_errors(form.user.googleTwoFactor) }} -
    +
    {{ 'config.otp.page_title'|trans }}
    + +

    {{ 'config.form_user.two_factor_description'|trans }}

    + + + + + + + + + + + + + + + + + + + + + + +
    {{ 'config.form_user.two_factor.table_method'|trans }}{{ 'config.form_user.two_factor.table_state'|trans }}{{ 'config.form_user.two_factor.table_action'|trans }}
    {{ 'config.form_user.two_factor.emailTwoFactor_label'|trans }}{% if app.user.isEmailTwoFactor %}{{ 'config.form_user.two_factor.state_enabled'|trans }}{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}{{ 'config.form_user.two_factor.action_email'|trans }}
    {{ 'config.form_user.two_factor.googleTwoFactor_label'|trans }}{% if app.user.isGoogleTwoFactor %}{{ 'config.form_user.two_factor.state_enabled'|trans }}{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}{{ 'config.form_user.two_factor.action_app'|trans }}
    - - {% for OtpQrCode in app.session.flashbag.get('OtpQrCode') %} -
    - {{ 'config.form_user.two_factor_code_description_1'|trans }} -
    - {{ 'config.form_user.two_factor_code_description_2'|trans }} -

    - - -

    - {{ 'config.form_user.two_factor_code_description_3'|trans }} -

    - {{ app.user.getGoogleAuthenticatorSecret }} -

    - {{ 'config.form_user.two_factor_code_description_4'|trans }} -

    - {{ app.user.getBackupCodes|join("\n")|nl2br }} -
    - {% endfor %} {% endif %} - - {{ form_widget(form.user.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} {{ form_widget(form.user._token) }} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/otp_app.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/otp_app.html.twig new file mode 100644 index 00000000..6aef355e --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/otp_app.html.twig @@ -0,0 +1,63 @@ +{% extends "WallabagCoreBundle::layout.html.twig" %} + +{% block title %}{{ 'config.page_title'|trans }} > {{ 'config.otp.page_title'|trans }}{% endblock %} + +{% block content %} +
    +
    +
    +
    +
    {{ 'config.otp.page_title'|trans }}
    + +
      +
    1. +

      {{ 'config.otp.app.two_factor_code_description_1'|trans }}

      +

      {{ 'config.otp.app.two_factor_code_description_2'|trans }}

      + +

      + + +

      +
    2. +
    3. +

      {{ 'config.otp.app.two_factor_code_description_3'|trans }}

      + +

      {{ app.user.getBackupCodes|join("\n")|nl2br }}

      +
    4. +
    5. +

      {{ 'config.otp.app.two_factor_code_description_4'|trans }}

      + + {% for flashMessage in app.session.flashbag.get("two_factor") %} +
      + {{ flashMessage|trans }} +
      + {% endfor %} + +
      +
      +
      +
      + + +
      +
      +
      +
      + + {{ 'config.otp.app.cancel'|trans }} + + +
      +
      +
    6. +
    +
    +
    +
    +
    +{% endblock %} -- cgit v1.2.3 From c416ed485fd318cafb8313679fa33cb65eb88e8e Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 19 Jan 2019 20:19:56 +0100 Subject: CS --- src/Wallabag/CoreBundle/Controller/ConfigController.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index 2643eed0..ed92c999 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -161,11 +161,9 @@ class ConfigController extends Controller /** * Enable 2FA using email. * - * @param Request $request - * * @Route("/config/otp/email", name="config_otp_email") */ - public function otpEmailAction(Request $request) + public function otpEmailAction() { if (!$this->getParameter('twofactor_auth')) { return $this->createNotFoundException('two_factor not enabled'); -- cgit v1.2.3 From 4654a83b6438b88e3b7062a21d18999d9df2fb8e Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 23 Jan 2019 14:43:39 +0100 Subject: Hash backup codes in the database using `password_hash` --- .../CoreBundle/Controller/ConfigController.php | 21 ++++++++++++------- .../views/themes/baggy/Config/otp_app.html.twig | 2 +- .../views/themes/material/Config/otp_app.html.twig | 2 +- src/Wallabag/UserBundle/Entity/User.php | 24 ++++++++++++++++++++-- 4 files changed, 38 insertions(+), 11 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index ed92c999..9257ab18 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -197,18 +197,25 @@ class ConfigController extends Controller } $user = $this->getUser(); + $secret = $this->get('scheb_two_factor.security.google_authenticator')->generateSecret(); - if (!$user->isGoogleTwoFactor()) { - $secret = $this->get('scheb_two_factor.security.google_authenticator')->generateSecret(); + $user->setGoogleAuthenticatorSecret($secret); + $user->setEmailTwoFactor(false); - $user->setGoogleAuthenticatorSecret($secret); - $user->setEmailTwoFactor(false); - $user->setBackupCodes((new BackupCodes())->toArray()); + $backupCodes = (new BackupCodes())->toArray(); + $backupCodesHashed = array_map( + function ($backupCode) { + return password_hash($backupCode, PASSWORD_DEFAULT); + }, + $backupCodes + ); - $this->container->get('fos_user.user_manager')->updateUser($user, true); - } + $user->setBackupCodes($backupCodesHashed); + + $this->container->get('fos_user.user_manager')->updateUser($user, true); return $this->render('WallabagCoreBundle:Config:otp_app.html.twig', [ + 'backupCodes' => $backupCodes, 'qr_code' => $this->get('scheb_two_factor.security.google_authenticator')->getQRContent($user), ]); } diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/otp_app.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/otp_app.html.twig index 2e4442e3..0919646e 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/otp_app.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/otp_app.html.twig @@ -20,7 +20,7 @@
  • {{ 'config.otp.app.two_factor_code_description_3'|trans }}

    -

    {{ app.user.getBackupCodes|join("\n")|nl2br }}

    +

    {{ backupCodes|join("\n")|nl2br }}

  • {{ 'config.otp.app.two_factor_code_description_4'|trans }}

    diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/otp_app.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/otp_app.html.twig index 6aef355e..7875d787 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/otp_app.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/otp_app.html.twig @@ -24,7 +24,7 @@
  • {{ 'config.otp.app.two_factor_code_description_3'|trans }}

    -

    {{ app.user.getBackupCodes|join("\n")|nl2br }}

    +

    {{ backupCodes|join("\n")|nl2br }}

  • {{ 'config.otp.app.two_factor_code_description_4'|trans }}

    diff --git a/src/Wallabag/UserBundle/Entity/User.php b/src/Wallabag/UserBundle/Entity/User.php index ab34e2bf..43fa6a80 100644 --- a/src/Wallabag/UserBundle/Entity/User.php +++ b/src/Wallabag/UserBundle/Entity/User.php @@ -339,7 +339,7 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI */ public function isBackupCode(string $code): bool { - return \in_array($code, $this->backupCodes, true); + return false === $this->findBackupCode($code) ? false : true; } /** @@ -347,7 +347,7 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI */ public function invalidateBackupCode(string $code): void { - $key = array_search($code, $this->backupCodes, true); + $key = $this->findBackupCode($code); if (false !== $key) { unset($this->backupCodes[$key]); @@ -385,4 +385,24 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI return $this->clients->first(); } } + + /** + * Try to find a backup code from the list of backup codes of the current user. + * + * @param string $code Given code from the user + * + * @return string|false + */ + private function findBackupCode(string $code) + { + foreach ($this->backupCodes as $key => $backupCode) { + // backup code are hashed using `password_hash` + // see ConfigController->otpAppAction + if (password_verify($code, $backupCode)) { + return $key; + } + } + + return false; + } } -- cgit v1.2.3 From a2e60dd39382d19642346b3848d22ce1d28d4cf3 Mon Sep 17 00:00:00 2001 From: Tristan Hill Date: Sat, 22 Dec 2018 11:36:13 +0000 Subject: status and favourite are actually strings in the import so use == --- src/Wallabag/ImportBundle/Import/PocketImport.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index d3643389..a9b43993 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php @@ -206,10 +206,10 @@ class PocketImport extends AbstractImport $this->fetchContent($entry, $url); // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted - $entry->setArchived(1 === $importedEntry['status'] || $this->markAsRead); + $entry->setArchived(1 == $importedEntry['status'] || $this->markAsRead); // 0 or 1 - 1 If the item is starred - $entry->setStarred(1 === $importedEntry['favorite']); + $entry->setStarred(1 == $importedEntry['favorite']); $title = 'Untitled'; if (isset($importedEntry['resolved_title']) && '' !== $importedEntry['resolved_title']) { -- cgit v1.2.3 From 8d082488e9e62914d79c179d376d1a0529183c49 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 28 Jan 2019 06:03:16 +0100 Subject: Improve checks & add tests --- src/Wallabag/ImportBundle/Import/PocketImport.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index a9b43993..5737928d 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php @@ -206,10 +206,10 @@ class PocketImport extends AbstractImport $this->fetchContent($entry, $url); // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted - $entry->setArchived(1 == $importedEntry['status'] || $this->markAsRead); + $entry->setArchived(1 === (int) $importedEntry['status'] || $this->markAsRead); - // 0 or 1 - 1 If the item is starred - $entry->setStarred(1 == $importedEntry['favorite']); + // 0 or 1 - 1 if the item is starred + $entry->setStarred(1 === (int) $importedEntry['favorite']); $title = 'Untitled'; if (isset($importedEntry['resolved_title']) && '' !== $importedEntry['resolved_title']) { -- cgit v1.2.3 From 7e04bd4ca4060abb15e82ce9210de5d5c5dae71a Mon Sep 17 00:00:00 2001 From: Jonathan Crooke Date: Thu, 31 Jan 2019 22:14:53 +0100 Subject: Fix broken 2 factor auth logo image --- .../UserBundle/Resources/views/TwoFactor/email_auth_code.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/UserBundle/Resources/views/TwoFactor/email_auth_code.html.twig b/src/Wallabag/UserBundle/Resources/views/TwoFactor/email_auth_code.html.twig index ecc1d79a..cd5aaf40 100644 --- a/src/Wallabag/UserBundle/Resources/views/TwoFactor/email_auth_code.html.twig +++ b/src/Wallabag/UserBundle/Resources/views/TwoFactor/email_auth_code.html.twig @@ -74,7 +74,7 @@ - +
    logologo

    wallabag

    {{ "auth_code.on"|trans({}, 'wallabag_user') }} {{ wallabag_url }}
    -- cgit v1.2.3 From baa5ee2d4292460425ca7f6572425f1fb1100d9d Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 8 Feb 2019 15:03:52 +0100 Subject: Force default_protocol to generate an url input --- src/Wallabag/ApiBundle/Form/Type/ClientType.php | 1 + src/Wallabag/CoreBundle/Form/Type/EditEntryType.php | 2 ++ src/Wallabag/CoreBundle/Form/Type/NewEntryType.php | 1 + 3 files changed, 4 insertions(+) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Form/Type/ClientType.php b/src/Wallabag/ApiBundle/Form/Type/ClientType.php index fc22538f..14dc5c44 100644 --- a/src/Wallabag/ApiBundle/Form/Type/ClientType.php +++ b/src/Wallabag/ApiBundle/Form/Type/ClientType.php @@ -20,6 +20,7 @@ class ClientType extends AbstractType 'required' => false, 'label' => 'developer.client.form.redirect_uris_label', 'property_path' => 'redirectUris', + 'default_protocol' => null, ]) ->add('save', SubmitType::class, ['label' => 'developer.client.form.save_label']) ; diff --git a/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php b/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php index 08355928..2fc4c204 100644 --- a/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php +++ b/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php @@ -22,11 +22,13 @@ class EditEntryType extends AbstractType 'disabled' => true, 'required' => false, 'label' => 'entry.edit.url_label', + 'default_protocol' => null, ]) ->add('origin_url', UrlType::class, [ 'required' => false, 'property_path' => 'originUrl', 'label' => 'entry.edit.origin_url_label', + 'default_protocol' => null, ]) ->add('save', SubmitType::class, [ 'label' => 'entry.edit.save_label', diff --git a/src/Wallabag/CoreBundle/Form/Type/NewEntryType.php b/src/Wallabag/CoreBundle/Form/Type/NewEntryType.php index 7d74fee3..7af1e589 100644 --- a/src/Wallabag/CoreBundle/Form/Type/NewEntryType.php +++ b/src/Wallabag/CoreBundle/Form/Type/NewEntryType.php @@ -15,6 +15,7 @@ class NewEntryType extends AbstractType ->add('url', UrlType::class, [ 'required' => true, 'label' => 'entry.new.form_new.url_label', + 'default_protocol' => null, ]) ; } -- cgit v1.2.3 From 0182cdaec430a72379ef96ade05300e7b4d0efd7 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 11 Feb 2019 11:50:24 +0100 Subject: CS --- src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php | 2 +- src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php | 2 +- .../CoreBundle/Repository/SiteCredentialRepository.php | 2 +- src/Wallabag/ImportBundle/Import/BrowserImport.php | 10 +++++----- src/Wallabag/ImportBundle/Import/ChromeImport.php | 2 +- src/Wallabag/ImportBundle/Import/FirefoxImport.php | 2 +- src/Wallabag/ImportBundle/Import/InstapaperImport.php | 2 +- src/Wallabag/ImportBundle/Import/WallabagImport.php | 2 +- src/Wallabag/ImportBundle/Import/WallabagV1Import.php | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php index 702c7f7a..37d0640a 100644 --- a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php @@ -108,7 +108,7 @@ class EntryFilterType extends AbstractType ->add('httpStatus', TextFilterType::class, [ 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { $value = $values['value']; - if (false === array_key_exists($value, Response::$statusTexts)) { + if (false === \array_key_exists($value, Response::$statusTexts)) { return; } diff --git a/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php b/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php index 1c2c5093..183d394a 100644 --- a/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php +++ b/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php @@ -23,7 +23,7 @@ class PreparePagerForEntries * @param AdapterInterface $adapter * @param User $user If user isn't logged in, we can force it (like for rss) * - * @return null|Pagerfanta + * @return Pagerfanta|null */ public function prepare(AdapterInterface $adapter, User $user = null) { diff --git a/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php b/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php index 36906761..b2e212a4 100644 --- a/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php +++ b/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php @@ -22,7 +22,7 @@ class SiteCredentialRepository extends \Doctrine\ORM\EntityRepository * @param string $host * @param int $userId * - * @return null|array + * @return array|null */ public function findOneByHostAndUser($host, $userId) { diff --git a/src/Wallabag/ImportBundle/Import/BrowserImport.php b/src/Wallabag/ImportBundle/Import/BrowserImport.php index 4678ae0c..811e3fb8 100644 --- a/src/Wallabag/ImportBundle/Import/BrowserImport.php +++ b/src/Wallabag/ImportBundle/Import/BrowserImport.php @@ -77,7 +77,7 @@ abstract class BrowserImport extends AbstractImport */ public function parseEntry(array $importedEntry) { - if ((!array_key_exists('guid', $importedEntry) || (!array_key_exists('id', $importedEntry))) && \is_array(reset($importedEntry))) { + if ((!\array_key_exists('guid', $importedEntry) || (!\array_key_exists('id', $importedEntry))) && \is_array(reset($importedEntry))) { if ($this->producer) { $this->parseEntriesForProducer($importedEntry); @@ -89,7 +89,7 @@ abstract class BrowserImport extends AbstractImport return; } - if (array_key_exists('children', $importedEntry)) { + if (\array_key_exists('children', $importedEntry)) { if ($this->producer) { $this->parseEntriesForProducer($importedEntry['children']); @@ -101,11 +101,11 @@ abstract class BrowserImport extends AbstractImport return; } - if (!array_key_exists('uri', $importedEntry) && !array_key_exists('url', $importedEntry)) { + if (!\array_key_exists('uri', $importedEntry) && !\array_key_exists('url', $importedEntry)) { return; } - $url = array_key_exists('uri', $importedEntry) ? $importedEntry['uri'] : $importedEntry['url']; + $url = \array_key_exists('uri', $importedEntry) ? $importedEntry['uri'] : $importedEntry['url']; $existingEntry = $this->em ->getRepository('WallabagCoreBundle:Entry') @@ -126,7 +126,7 @@ abstract class BrowserImport extends AbstractImport // update entry with content (in case fetching failed, the given entry will be return) $this->fetchContent($entry, $data['url'], $data); - if (array_key_exists('tags', $data)) { + if (\array_key_exists('tags', $data)) { $this->tagsAssigner->assignTagsToEntry( $entry, $data['tags'] diff --git a/src/Wallabag/ImportBundle/Import/ChromeImport.php b/src/Wallabag/ImportBundle/Import/ChromeImport.php index eccee698..4ae82ade 100644 --- a/src/Wallabag/ImportBundle/Import/ChromeImport.php +++ b/src/Wallabag/ImportBundle/Import/ChromeImport.php @@ -57,7 +57,7 @@ class ChromeImport extends BrowserImport 'created_at' => substr($entry['date_added'], 0, 10), ]; - if (array_key_exists('tags', $entry) && '' !== $entry['tags']) { + if (\array_key_exists('tags', $entry) && '' !== $entry['tags']) { $data['tags'] = $entry['tags']; } diff --git a/src/Wallabag/ImportBundle/Import/FirefoxImport.php b/src/Wallabag/ImportBundle/Import/FirefoxImport.php index 8999e3f3..b3558f21 100644 --- a/src/Wallabag/ImportBundle/Import/FirefoxImport.php +++ b/src/Wallabag/ImportBundle/Import/FirefoxImport.php @@ -57,7 +57,7 @@ class FirefoxImport extends BrowserImport 'created_at' => substr($entry['dateAdded'], 0, 10), ]; - if (array_key_exists('tags', $entry) && '' !== $entry['tags']) { + if (\array_key_exists('tags', $entry) && '' !== $entry['tags']) { $data['tags'] = $entry['tags']; } diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php index 5a18c7c0..3a9f08b4 100644 --- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php +++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php @@ -62,7 +62,7 @@ class InstapaperImport extends AbstractImport } $entries = []; - $handle = fopen($this->filepath, 'rb'); + $handle = fopen($this->filepath, 'r'); while (false !== ($data = fgetcsv($handle, 10240))) { if ('URL' === $data[0]) { continue; diff --git a/src/Wallabag/ImportBundle/Import/WallabagImport.php b/src/Wallabag/ImportBundle/Import/WallabagImport.php index 350d0600..58b6a970 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagImport.php +++ b/src/Wallabag/ImportBundle/Import/WallabagImport.php @@ -122,7 +122,7 @@ abstract class WallabagImport extends AbstractImport // update entry with content (in case fetching failed, the given entry will be return) $this->fetchContent($entry, $data['url'], $data); - if (array_key_exists('tags', $data)) { + if (\array_key_exists('tags', $data)) { $this->tagsAssigner->assignTagsToEntry( $entry, $data['tags'], diff --git a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php index b9bb525a..e0562611 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php +++ b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php @@ -61,7 +61,7 @@ class WallabagV1Import extends WallabagImport $data['html'] = $this->fetchingErrorMessage; } - if (array_key_exists('tags', $entry) && '' !== $entry['tags']) { + if (\array_key_exists('tags', $entry) && '' !== $entry['tags']) { $data['tags'] = $entry['tags']; } -- cgit v1.2.3 From 44560c77677d1d2a0eda0bf63f56c9dff033744f Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 13 Feb 2019 14:06:57 +0100 Subject: CS --- src/Wallabag/ImportBundle/Import/InstapaperImport.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php index 3a9f08b4..5a18c7c0 100644 --- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php +++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php @@ -62,7 +62,7 @@ class InstapaperImport extends AbstractImport } $entries = []; - $handle = fopen($this->filepath, 'r'); + $handle = fopen($this->filepath, 'rb'); while (false !== ($data = fgetcsv($handle, 10240))) { if ('URL' === $data[0]) { continue; -- cgit v1.2.3 From 9a7a0e1e6b7ac8aeb110346e8ada841060496a1a Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sat, 16 Feb 2019 20:37:20 +0100 Subject: epub export: fix missing cover image, only for exports of one article Fixes #3602 Signed-off-by: Kevin Decherf --- src/Wallabag/CoreBundle/Helper/EntriesExport.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index 64591687..a2aa4d13 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -165,13 +165,6 @@ class EntriesExport $book->addDublinCoreMetadata(DublinCore::CONTRIBUTOR, 'PHP'); $book->addDublinCoreMetadata(DublinCore::CONTRIBUTOR, 'wallabag'); - /* - * Front page - */ - if (file_exists($this->logoPath)) { - $book->setCoverImage('Cover.png', file_get_contents($this->logoPath), 'image/png'); - } - $entryIds = []; $entryCount = \count($this->entries); $i = 0; @@ -183,6 +176,15 @@ class EntriesExport // set tags as subjects foreach ($this->entries as $entry) { ++$i; + + /* + * Front page + * Set if there's only one entry in the given set + */ + if (1 === $entryCount && null !== $entry->getPreviewPicture()) { + $book->setCoverImage($entry->getPreviewPicture()); + } + foreach ($entry->getTags() as $tag) { $book->setSubject($tag->getLabel()); } -- cgit v1.2.3 From 508302042f96ce771a36f0114acb0b3a89c18880 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 17 Feb 2019 15:30:42 +0100 Subject: EntryRestController: add support of expect parameter to delete action The expect parameter enables an application to request the whole entry or only the id when requesting its deletion. `expects` defaults to `entry` to prevent any API breakage. Fixes #3711 Signed-off-by: Kevin Decherf --- .../ApiBundle/Controller/EntryRestController.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index b2bad406..33b75665 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -570,18 +570,31 @@ class EntryRestController extends WallabagRestController * @ApiDoc( * requirements={ * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"} + * }, + * parameters={ + * {"name"="expect", "dataType"="string", "required"=false, "format"="id or entry", "description"="Only returns the id instead of the deleted entry's full entity if 'id' is specified. Default to entry"}, * } * ) * * @return JsonResponse */ - public function deleteEntriesAction(Entry $entry) + public function deleteEntriesAction(Entry $entry, Request $request) { + $expect = $request->query->get('expect', 'entry'); + if (!\in_array($expect, ['id', 'entry'], true)) { + throw new BadRequestHttpException(sprintf("expect: 'id' or 'entry' expected, %s given", $expect)); + } $this->validateAuthentication(); $this->validateUserAccess($entry->getUser()->getId()); - // We copy $entry to keep id in returned object - $e = $entry; + $response = $this->sendResponse([ + 'id' => $entry->getId(), + ]); + // We clone $entry to keep id in returned object + if ('entry' === $expect) { + $e = clone $entry; + $response = $this->sendResponse($e); + } $em = $this->getDoctrine()->getManager(); $em->remove($entry); @@ -590,7 +603,7 @@ class EntryRestController extends WallabagRestController // entry deleted, dispatch event about it! $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry)); - return $this->sendResponse($e); + return $response; } /** -- cgit v1.2.3 From 3784688a88230d9c3aec4ca518be52ea1c70aeb9 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Sat, 12 Jan 2019 13:09:36 +0100 Subject: Replace continue; with break; to avoid PHP 7.3 warnings Signed-off-by: Thomas Citharel --- .../CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php | 2 +- src/Wallabag/CoreBundle/Helper/DownloadImages.php | 2 +- src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php | 2 +- src/Wallabag/CoreBundle/Helper/TagsAssigner.php | 2 +- src/Wallabag/ImportBundle/Import/AbstractImport.php | 2 +- src/Wallabag/ImportBundle/Import/BrowserImport.php | 6 +++--- src/Wallabag/ImportBundle/Import/InstapaperImport.php | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php index 90e00c62..2e57aac8 100644 --- a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php +++ b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php @@ -114,7 +114,7 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder $extraFields = []; foreach ($extraFieldsStrings as $extraField) { if (false === strpos($extraField, '=')) { - continue; + break; } list($fieldName, $fieldValue) = explode('=', $extraField, 2); diff --git a/src/Wallabag/CoreBundle/Helper/DownloadImages.php b/src/Wallabag/CoreBundle/Helper/DownloadImages.php index cc3dcfce..8c1c208f 100644 --- a/src/Wallabag/CoreBundle/Helper/DownloadImages.php +++ b/src/Wallabag/CoreBundle/Helper/DownloadImages.php @@ -56,7 +56,7 @@ class DownloadImages $imagePath = $this->processSingleImage($entryId, $image, $url, $relativePath); if (false === $imagePath) { - continue; + break; } // if image contains "&" and we can't find it in the html it might be because it's encoded as & diff --git a/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php b/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php index fbdf2ac7..d156df84 100644 --- a/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php +++ b/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php @@ -37,7 +37,7 @@ class RuleBasedTagger foreach ($rules as $rule) { if (!$this->rulerz->satisfies($entry, $rule->getRule())) { - continue; + break; } $this->logger->info('Matching rule.', [ diff --git a/src/Wallabag/CoreBundle/Helper/TagsAssigner.php b/src/Wallabag/CoreBundle/Helper/TagsAssigner.php index e6b4989f..519150f5 100644 --- a/src/Wallabag/CoreBundle/Helper/TagsAssigner.php +++ b/src/Wallabag/CoreBundle/Helper/TagsAssigner.php @@ -49,7 +49,7 @@ class TagsAssigner // avoid empty tag if (0 === \strlen($label)) { - continue; + break; } if (isset($tagsNotYetFlushed[$label])) { diff --git a/src/Wallabag/ImportBundle/Import/AbstractImport.php b/src/Wallabag/ImportBundle/Import/AbstractImport.php index d39d71b6..5ae4aa8d 100644 --- a/src/Wallabag/ImportBundle/Import/AbstractImport.php +++ b/src/Wallabag/ImportBundle/Import/AbstractImport.php @@ -169,7 +169,7 @@ abstract class AbstractImport implements ImportInterface $entry = $this->parseEntry($importedEntry); if (null === $entry) { - continue; + break; } // store each entry to be flushed so we can trigger the entry.saved event for each of them diff --git a/src/Wallabag/ImportBundle/Import/BrowserImport.php b/src/Wallabag/ImportBundle/Import/BrowserImport.php index 804bc6cd..178ebe8e 100644 --- a/src/Wallabag/ImportBundle/Import/BrowserImport.php +++ b/src/Wallabag/ImportBundle/Import/BrowserImport.php @@ -158,13 +158,13 @@ abstract class BrowserImport extends AbstractImport foreach ($entries as $importedEntry) { if ((array) $importedEntry !== $importedEntry) { - continue; + break; } $entry = $this->parseEntry($importedEntry); if (null === $entry) { - continue; + break; } // @see AbstractImport @@ -206,7 +206,7 @@ abstract class BrowserImport extends AbstractImport { foreach ($entries as $importedEntry) { if ((array) $importedEntry !== $importedEntry) { - continue; + break; } // set userId for the producer (it won't know which user is connected) diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php index 439c978c..6b6b35af 100644 --- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php +++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php @@ -65,7 +65,7 @@ class InstapaperImport extends AbstractImport $handle = fopen($this->filepath, 'r'); while (false !== ($data = fgetcsv($handle, 10240))) { if ('URL' === $data[0]) { - continue; + break; } // last element in the csv is the folder where the content belong -- cgit v1.2.3 From ea925bb112ab99efbb29d8e7113e80357a70bd18 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 27 Feb 2019 14:33:26 +0100 Subject: CS --- src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php | 2 +- src/Wallabag/ImportBundle/Import/BrowserImport.php | 10 +++++----- src/Wallabag/ImportBundle/Import/ChromeImport.php | 2 +- src/Wallabag/ImportBundle/Import/FirefoxImport.php | 2 +- src/Wallabag/ImportBundle/Import/WallabagImport.php | 2 +- src/Wallabag/ImportBundle/Import/WallabagV1Import.php | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php index 702c7f7a..37d0640a 100644 --- a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php @@ -108,7 +108,7 @@ class EntryFilterType extends AbstractType ->add('httpStatus', TextFilterType::class, [ 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) { $value = $values['value']; - if (false === array_key_exists($value, Response::$statusTexts)) { + if (false === \array_key_exists($value, Response::$statusTexts)) { return; } diff --git a/src/Wallabag/ImportBundle/Import/BrowserImport.php b/src/Wallabag/ImportBundle/Import/BrowserImport.php index 178ebe8e..99717beb 100644 --- a/src/Wallabag/ImportBundle/Import/BrowserImport.php +++ b/src/Wallabag/ImportBundle/Import/BrowserImport.php @@ -77,7 +77,7 @@ abstract class BrowserImport extends AbstractImport */ public function parseEntry(array $importedEntry) { - if ((!array_key_exists('guid', $importedEntry) || (!array_key_exists('id', $importedEntry))) && \is_array(reset($importedEntry))) { + if ((!\array_key_exists('guid', $importedEntry) || (!\array_key_exists('id', $importedEntry))) && \is_array(reset($importedEntry))) { if ($this->producer) { $this->parseEntriesForProducer($importedEntry); @@ -89,7 +89,7 @@ abstract class BrowserImport extends AbstractImport return; } - if (array_key_exists('children', $importedEntry)) { + if (\array_key_exists('children', $importedEntry)) { if ($this->producer) { $this->parseEntriesForProducer($importedEntry['children']); @@ -101,11 +101,11 @@ abstract class BrowserImport extends AbstractImport return; } - if (!array_key_exists('uri', $importedEntry) && !array_key_exists('url', $importedEntry)) { + if (!\array_key_exists('uri', $importedEntry) && !\array_key_exists('url', $importedEntry)) { return; } - $url = array_key_exists('uri', $importedEntry) ? $importedEntry['uri'] : $importedEntry['url']; + $url = \array_key_exists('uri', $importedEntry) ? $importedEntry['uri'] : $importedEntry['url']; $existingEntry = $this->em ->getRepository('WallabagCoreBundle:Entry') @@ -126,7 +126,7 @@ abstract class BrowserImport extends AbstractImport // update entry with content (in case fetching failed, the given entry will be return) $this->fetchContent($entry, $data['url'], $data); - if (array_key_exists('tags', $data)) { + if (\array_key_exists('tags', $data)) { $this->tagsAssigner->assignTagsToEntry( $entry, $data['tags'] diff --git a/src/Wallabag/ImportBundle/Import/ChromeImport.php b/src/Wallabag/ImportBundle/Import/ChromeImport.php index eccee698..4ae82ade 100644 --- a/src/Wallabag/ImportBundle/Import/ChromeImport.php +++ b/src/Wallabag/ImportBundle/Import/ChromeImport.php @@ -57,7 +57,7 @@ class ChromeImport extends BrowserImport 'created_at' => substr($entry['date_added'], 0, 10), ]; - if (array_key_exists('tags', $entry) && '' !== $entry['tags']) { + if (\array_key_exists('tags', $entry) && '' !== $entry['tags']) { $data['tags'] = $entry['tags']; } diff --git a/src/Wallabag/ImportBundle/Import/FirefoxImport.php b/src/Wallabag/ImportBundle/Import/FirefoxImport.php index 8999e3f3..b3558f21 100644 --- a/src/Wallabag/ImportBundle/Import/FirefoxImport.php +++ b/src/Wallabag/ImportBundle/Import/FirefoxImport.php @@ -57,7 +57,7 @@ class FirefoxImport extends BrowserImport 'created_at' => substr($entry['dateAdded'], 0, 10), ]; - if (array_key_exists('tags', $entry) && '' !== $entry['tags']) { + if (\array_key_exists('tags', $entry) && '' !== $entry['tags']) { $data['tags'] = $entry['tags']; } diff --git a/src/Wallabag/ImportBundle/Import/WallabagImport.php b/src/Wallabag/ImportBundle/Import/WallabagImport.php index c3a142b9..75a28fbf 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagImport.php +++ b/src/Wallabag/ImportBundle/Import/WallabagImport.php @@ -122,7 +122,7 @@ abstract class WallabagImport extends AbstractImport // update entry with content (in case fetching failed, the given entry will be return) $this->fetchContent($entry, $data['url'], $data); - if (array_key_exists('tags', $data)) { + if (\array_key_exists('tags', $data)) { $this->tagsAssigner->assignTagsToEntry( $entry, $data['tags'], diff --git a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php index b9bb525a..e0562611 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php +++ b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php @@ -61,7 +61,7 @@ class WallabagV1Import extends WallabagImport $data['html'] = $this->fetchingErrorMessage; } - if (array_key_exists('tags', $entry) && '' !== $entry['tags']) { + if (\array_key_exists('tags', $entry) && '' !== $entry['tags']) { $data['tags'] = $entry['tags']; } -- cgit v1.2.3 From 8c0ba953070dca22e9a06999cfe355ea01847c64 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 27 Feb 2019 14:59:50 +0100 Subject: Adding more tests --- .../CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php | 2 +- src/Wallabag/CoreBundle/Helper/DownloadImages.php | 2 +- src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php | 2 +- src/Wallabag/CoreBundle/Helper/TagsAssigner.php | 2 +- src/Wallabag/ImportBundle/Import/AbstractImport.php | 2 +- src/Wallabag/ImportBundle/Import/BrowserImport.php | 6 +++--- src/Wallabag/ImportBundle/Import/InstapaperImport.php | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php index 2e57aac8..90e00c62 100644 --- a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php +++ b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php @@ -114,7 +114,7 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder $extraFields = []; foreach ($extraFieldsStrings as $extraField) { if (false === strpos($extraField, '=')) { - break; + continue; } list($fieldName, $fieldValue) = explode('=', $extraField, 2); diff --git a/src/Wallabag/CoreBundle/Helper/DownloadImages.php b/src/Wallabag/CoreBundle/Helper/DownloadImages.php index 8c1c208f..cc3dcfce 100644 --- a/src/Wallabag/CoreBundle/Helper/DownloadImages.php +++ b/src/Wallabag/CoreBundle/Helper/DownloadImages.php @@ -56,7 +56,7 @@ class DownloadImages $imagePath = $this->processSingleImage($entryId, $image, $url, $relativePath); if (false === $imagePath) { - break; + continue; } // if image contains "&" and we can't find it in the html it might be because it's encoded as & diff --git a/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php b/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php index d156df84..fbdf2ac7 100644 --- a/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php +++ b/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php @@ -37,7 +37,7 @@ class RuleBasedTagger foreach ($rules as $rule) { if (!$this->rulerz->satisfies($entry, $rule->getRule())) { - break; + continue; } $this->logger->info('Matching rule.', [ diff --git a/src/Wallabag/CoreBundle/Helper/TagsAssigner.php b/src/Wallabag/CoreBundle/Helper/TagsAssigner.php index 519150f5..e6b4989f 100644 --- a/src/Wallabag/CoreBundle/Helper/TagsAssigner.php +++ b/src/Wallabag/CoreBundle/Helper/TagsAssigner.php @@ -49,7 +49,7 @@ class TagsAssigner // avoid empty tag if (0 === \strlen($label)) { - break; + continue; } if (isset($tagsNotYetFlushed[$label])) { diff --git a/src/Wallabag/ImportBundle/Import/AbstractImport.php b/src/Wallabag/ImportBundle/Import/AbstractImport.php index 5ae4aa8d..d39d71b6 100644 --- a/src/Wallabag/ImportBundle/Import/AbstractImport.php +++ b/src/Wallabag/ImportBundle/Import/AbstractImport.php @@ -169,7 +169,7 @@ abstract class AbstractImport implements ImportInterface $entry = $this->parseEntry($importedEntry); if (null === $entry) { - break; + continue; } // store each entry to be flushed so we can trigger the entry.saved event for each of them diff --git a/src/Wallabag/ImportBundle/Import/BrowserImport.php b/src/Wallabag/ImportBundle/Import/BrowserImport.php index 99717beb..3987e80f 100644 --- a/src/Wallabag/ImportBundle/Import/BrowserImport.php +++ b/src/Wallabag/ImportBundle/Import/BrowserImport.php @@ -158,13 +158,13 @@ abstract class BrowserImport extends AbstractImport foreach ($entries as $importedEntry) { if ((array) $importedEntry !== $importedEntry) { - break; + continue; } $entry = $this->parseEntry($importedEntry); if (null === $entry) { - break; + continue; } // @see AbstractImport @@ -206,7 +206,7 @@ abstract class BrowserImport extends AbstractImport { foreach ($entries as $importedEntry) { if ((array) $importedEntry !== $importedEntry) { - break; + continue; } // set userId for the producer (it won't know which user is connected) diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php index 6b6b35af..439c978c 100644 --- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php +++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php @@ -65,7 +65,7 @@ class InstapaperImport extends AbstractImport $handle = fopen($this->filepath, 'r'); while (false !== ($data = fgetcsv($handle, 10240))) { if ('URL' === $data[0]) { - break; + continue; } // last element in the csv is the folder where the content belong -- cgit v1.2.3 From f1f1efb5def331721e03bc55ac3be81fbae8fd01 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 3 Mar 2019 02:13:14 +0100 Subject: material: wrap card actions, remove class hiding of creation date Signed-off-by: Kevin Decherf --- .../views/themes/material/Entry/_card_actions.html.twig | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_actions.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_actions.html.twig index 827f09d9..be764e10 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_actions.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_actions.html.twig @@ -1,9 +1,11 @@
    - - {% include "@WallabagCore/themes/material/Entry/_reading_time.html.twig" with {'entry': entry} only %} - today -  {{ entry.createdAt|date('Y-m-d') }} - +
    +
    {% include "@WallabagCore/themes/material/Entry/_reading_time.html.twig" with {'entry': entry} only %}
    +
    + today +  {{ entry.createdAt|date('Y-m-d') }} +
    +
    • -- cgit v1.2.3 From 41d476d7e74b752e693a1b70e68b8cb05045653f Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 17 Mar 2019 23:36:10 +0100 Subject: epub: fix exception when articles have the same title This commit fixes an exception occuring when exporting as epub several articles with the same title. The chapter filename is now derived from title and url. Fixes #3642 Signed-off-by: Kevin Decherf --- src/Wallabag/CoreBundle/Helper/EntriesExport.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index a2aa4d13..f981ee50 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -188,7 +188,7 @@ class EntriesExport foreach ($entry->getTags() as $tag) { $book->setSubject($tag->getLabel()); } - $filename = sha1($entry->getTitle()); + $filename = sha1(sprintf('%s:%s', $entry->getUrl(), $entry->getTitle())); $publishedBy = $entry->getPublishedBy(); $authors = $this->translator->trans('export.unknown'); -- cgit v1.2.3 From 8ca858ee7301ea332baa9ad9543bb72d10b5caa2 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 18 Mar 2019 06:23:41 +0100 Subject: Fix PHP warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Looks like sometimes (usually from import) the `html` key isn’t available. --- src/Wallabag/CoreBundle/Helper/ContentProxy.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index d38811a2..31953f12 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -256,18 +256,17 @@ class ContentProxy $entry->setTitle($content['open_graph']['og_title']); } - $html = $content['html']; - if (false === $html) { - $html = $this->fetchingErrorMessage; + if (empty($content['html'])) { + $content['html'] = $this->fetchingErrorMessage; if (!empty($content['open_graph']['og_description'])) { - $html .= '

      But we found a short description:

      '; - $html .= $content['open_graph']['og_description']; + $content['html'] .= '

      But we found a short description:

      '; + $content['html'] .= $content['open_graph']['og_description']; } } - $entry->setContent($html); - $entry->setReadingTime(Utils::getReadingTime($html)); + $entry->setContent($content['html']); + $entry->setReadingTime(Utils::getReadingTime($content['html'])); if (!empty($content['status'])) { $entry->setHttpStatus($content['status']); -- cgit v1.2.3 From bfe02a0b481055bb4e799200c8daa9a0ad987c71 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Sun, 28 May 2017 14:53:04 +0200 Subject: Hash the urls to check if they exist Signed-off-by: Thomas Citharel --- .../ApiBundle/Controller/EntryRestController.php | 36 +++++--- .../Command/GenerateUrlHashesCommand.php | 95 ++++++++++++++++++++++ .../CoreBundle/DataFixtures/EntryFixtures.php | 1 + src/Wallabag/CoreBundle/Entity/Entry.php | 30 ++++++- src/Wallabag/CoreBundle/Helper/ContentProxy.php | 2 + 5 files changed, 152 insertions(+), 12 deletions(-) create mode 100644 src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 5c850091..26746f7d 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -29,6 +29,8 @@ class EntryRestController extends WallabagRestController * {"name"="return_id", "dataType"="string", "required"=false, "format"="1 or 0", "description"="Set 1 if you want to retrieve ID in case entry(ies) exists, 0 by default"}, * {"name"="url", "dataType"="string", "required"=true, "format"="An url", "description"="Url to check if it exists"}, * {"name"="urls", "dataType"="string", "required"=false, "format"="An array of urls (?urls[]=http...&urls[]=http...)", "description"="Urls (as an array) to check if it exists"} + * {"name"="hashedurl", "dataType"="string", "required"=true, "format"="An url", "description"="Md5 url to check if it exists"}, + * {"name"="hashedurls", "dataType"="string", "required"=false, "format"="An array of urls (?urls[]=http...&urls[]=http...)", "description"="Md5 urls (as an array) to check if it exists"} * } * ) * @@ -41,34 +43,46 @@ class EntryRestController extends WallabagRestController $returnId = (null === $request->query->get('return_id')) ? false : (bool) $request->query->get('return_id'); $urls = $request->query->get('urls', []); + $hashedUrls = $request->query->get('hashedurls', []); + // handle multiple urls first - if (!empty($urls)) { + if (!empty($hashedUrls)) { $results = []; - foreach ($urls as $url) { + foreach ($hashedUrls as $hashedUrl) { $res = $this->getDoctrine() ->getRepository('WallabagCoreBundle:Entry') - ->findByUrlAndUserId($url, $this->getUser()->getId()); + ->findOneBy([ + 'hashedUrl' => $hashedUrl, + 'user' => $this->getUser()->getId(), + ]); - $results[$url] = $this->returnExistInformation($res, $returnId); + // $results[$url] = $this->returnExistInformation($res, $returnId); + $results[$hashedUrl] = $this->returnExistInformation($res, $returnId); } return $this->sendResponse($results); } // let's see if it is a simple url? - $url = $request->query->get('url', ''); + $hashedUrl = $request->query->get('hashedurl', ''); + + // if (empty($url)) { + // throw $this->createAccessDeniedException('URL is empty?, logged user id: ' . $this->getUser()->getId()); + // } - if (empty($url)) { - throw $this->createAccessDeniedException('URL is empty?, logged user id: ' . $this->getUser()->getId()); + if (empty($hashedUrl)) { + throw $this->createAccessDeniedException('URL is empty?, logged user id: '.$this->getUser()->getId()); } $res = $this->getDoctrine() ->getRepository('WallabagCoreBundle:Entry') - ->findByUrlAndUserId($url, $this->getUser()->getId()); - - $exists = $this->returnExistInformation($res, $returnId); + // ->findByUrlAndUserId($url, $this->getUser()->getId()); + ->findOneBy([ + 'hashedUrl' => $hashedUrl, + 'user' => $this->getUser()->getId(), + ]); - return $this->sendResponse(['exists' => $exists]); + return $this->sendResponse(['exists' => $this->returnExistInformation($res, $returnId)]); } /** diff --git a/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php b/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php new file mode 100644 index 00000000..fe2644f2 --- /dev/null +++ b/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php @@ -0,0 +1,95 @@ +setName('wallabag:generate-hashed-urls') + ->setDescription('Generates hashed urls for each entry') + ->setHelp('This command helps you to generates hashes of the url of each entry, to check through API if an URL is already saved') + ->addArgument( + 'username', + InputArgument::OPTIONAL, + 'User to process entries' + ); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->output = $output; + + $username = $input->getArgument('username'); + + if ($username) { + try { + $user = $this->getUser($username); + $this->generateHashedUrls($user); + } catch (NoResultException $e) { + $output->writeln(sprintf('User "%s" not found.', $username)); + + return 1; + } + } else { + $users = $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findAll(); + + $output->writeln(sprintf('Generating hashed urls for the %d user account entries', count($users))); + + foreach ($users as $user) { + $output->writeln(sprintf('Processing user %s', $user->getUsername())); + $this->generateHashedUrls($user); + } + $output->writeln(sprintf('Finished generated hashed urls')); + } + + return 0; + } + + /** + * @param User $user + */ + private function generateHashedUrls(User $user) + { + $em = $this->getContainer()->get('doctrine.orm.entity_manager'); + $repo = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry'); + + $entries = $repo->findByUser($user->getId()); + + foreach ($entries as $entry) { + $entry->setHashedUrl(hash('sha512', $entry->getUrl())); + $em->persist($entry); + $em->flush(); + } + + $this->output->writeln(sprintf('Generated hashed urls for user %s', $user->getUserName())); + } + + /** + * Fetches a user from its username. + * + * @param string $username + * + * @return \Wallabag\UserBundle\Entity\User + */ + private function getUser($username) + { + return $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findOneByUserName($username); + } + + private function getDoctrine() + { + return $this->getContainer()->get('doctrine'); + } +} diff --git a/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php index 024fcfdc..9c10500d 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php +++ b/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php @@ -30,6 +30,7 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface 'entry2' => [ 'user' => 'admin-user', 'url' => 'http://0.0.0.0/entry2', + 'hashed_url' => hash('md5', 'http://0.0.0.0/entry2'), 'reading_time' => 1, 'domain' => 'domain.io', 'mime' => 'text/html', diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index b3cfdc4a..17a1ed58 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -25,7 +25,8 @@ use Wallabag\UserBundle\Entity\User; * options={"collate"="utf8mb4_unicode_ci", "charset"="utf8mb4"}, * indexes={ * @ORM\Index(name="created_at", columns={"created_at"}), - * @ORM\Index(name="uid", columns={"uid"}) + * @ORM\Index(name="uid", columns={"uid"}), + * @ORM\Index(name="hashedurl", columns={"hashedurl"}) * } * ) * @ORM\HasLifecycleCallbacks() @@ -75,6 +76,13 @@ class Entry */ private $url; + /** + * @var string + * + * @ORM\Column(name="hashedurl", type="text", nullable=true) + */ + private $hashedUrl; + /** * @var bool * @@ -911,4 +919,24 @@ class Entry { return $this->originUrl; } + + /** + * @return string + */ + public function getHashedUrl() + { + return $this->hashedUrl; + } + + /** + * @param mixed $hashedUrl + * + * @return Entry + */ + public function setHashedUrl($hashedUrl) + { + $this->hashedUrl = $hashedUrl; + + return $this; + } } diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index 31953f12..0534d27b 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -248,6 +248,8 @@ class ContentProxy { $this->updateOriginUrl($entry, $content['url']); + $entry->setHashedUrl(hash('md5', $entry->getUrl())); + $this->setEntryDomainName($entry); if (!empty($content['title'])) { -- cgit v1.2.3 From 9c2b2aae70b06411336e6eb6ac43b3ebd30dc38c Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 1 Apr 2019 11:50:33 +0200 Subject: Keep url in exists endpoint - Add migration - Use md5 instead of sha512 (we don't need security here, just a hash) - Update tests --- .../ApiBundle/Controller/EntryRestController.php | 55 ++++++++++++---------- .../Command/GenerateUrlHashesCommand.php | 19 +++++--- .../CoreBundle/DataFixtures/EntryFixtures.php | 2 +- src/Wallabag/CoreBundle/Entity/Entry.php | 4 +- .../CoreBundle/Repository/EntryRepository.php | 24 ++++++++++ 5 files changed, 70 insertions(+), 34 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 26746f7d..0ecf1a0e 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -27,10 +27,10 @@ class EntryRestController extends WallabagRestController * @ApiDoc( * parameters={ * {"name"="return_id", "dataType"="string", "required"=false, "format"="1 or 0", "description"="Set 1 if you want to retrieve ID in case entry(ies) exists, 0 by default"}, - * {"name"="url", "dataType"="string", "required"=true, "format"="An url", "description"="Url to check if it exists"}, - * {"name"="urls", "dataType"="string", "required"=false, "format"="An array of urls (?urls[]=http...&urls[]=http...)", "description"="Urls (as an array) to check if it exists"} - * {"name"="hashedurl", "dataType"="string", "required"=true, "format"="An url", "description"="Md5 url to check if it exists"}, - * {"name"="hashedurls", "dataType"="string", "required"=false, "format"="An array of urls (?urls[]=http...&urls[]=http...)", "description"="Md5 urls (as an array) to check if it exists"} + * {"name"="url", "dataType"="string", "required"=true, "format"="An url", "description"="DEPRECATED, use hashed_url instead"}, + * {"name"="urls", "dataType"="string", "required"=false, "format"="An array of urls (?urls[]=http...&urls[]=http...)", "description"="DEPRECATED, use hashed_urls instead"}, + * {"name"="hashed_url", "dataType"="string", "required"=true, "format"="An url", "description"="Md5 url to check if it exists"}, + * {"name"="hashed_urls", "dataType"="string", "required"=false, "format"="An array of urls (?urls[]=http...&urls[]=http...)", "description"="Md5 urls (as an array) to check if it exists"} * } * ) * @@ -39,22 +39,18 @@ class EntryRestController extends WallabagRestController public function getEntriesExistsAction(Request $request) { $this->validateAuthentication(); + $repo = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry'); $returnId = (null === $request->query->get('return_id')) ? false : (bool) $request->query->get('return_id'); - $urls = $request->query->get('urls', []); - $hashedUrls = $request->query->get('hashedurls', []); + $urls = $request->query->get('urls', []); + $hashedUrls = $request->query->get('hashed_urls', []); // handle multiple urls first if (!empty($hashedUrls)) { $results = []; foreach ($hashedUrls as $hashedUrl) { - $res = $this->getDoctrine() - ->getRepository('WallabagCoreBundle:Entry') - ->findOneBy([ - 'hashedUrl' => $hashedUrl, - 'user' => $this->getUser()->getId(), - ]); + $res = $repo->findByHashedUrlAndUserId($hashedUrl, $this->getUser()->getId()); // $results[$url] = $this->returnExistInformation($res, $returnId); $results[$hashedUrl] = $this->returnExistInformation($res, $returnId); @@ -63,24 +59,33 @@ class EntryRestController extends WallabagRestController return $this->sendResponse($results); } + // @deprecated, to be remove in 3.0 + if (!empty($urls)) { + $results = []; + foreach ($urls as $url) { + $res = $repo->findByUrlAndUserId($url, $this->getUser()->getId()); + + $results[$url] = $this->returnExistInformation($res, $returnId); + } + + return $this->sendResponse($results); + } + // let's see if it is a simple url? - $hashedUrl = $request->query->get('hashedurl', ''); + $url = $request->query->get('url', ''); + $hashedUrl = $request->query->get('hashed_url', ''); - // if (empty($url)) { - // throw $this->createAccessDeniedException('URL is empty?, logged user id: ' . $this->getUser()->getId()); - // } + if (empty($url) && empty($hashedUrl)) { + throw $this->createAccessDeniedException('URL is empty?, logged user id: ' . $this->getUser()->getId()); + } - if (empty($hashedUrl)) { - throw $this->createAccessDeniedException('URL is empty?, logged user id: '.$this->getUser()->getId()); + $method = 'findByUrlAndUserId'; + if (!empty($hashedUrl)) { + $method = 'findByHashedUrlAndUserId'; + $url = $hashedUrl; } - $res = $this->getDoctrine() - ->getRepository('WallabagCoreBundle:Entry') - // ->findByUrlAndUserId($url, $this->getUser()->getId()); - ->findOneBy([ - 'hashedUrl' => $hashedUrl, - 'user' => $this->getUser()->getId(), - ]); + $res = $repo->$method($url, $this->getUser()->getId()); return $this->sendResponse(['exists' => $this->returnExistInformation($res, $returnId)]); } diff --git a/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php b/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php index fe2644f2..fb598390 100644 --- a/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php +++ b/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php @@ -45,13 +45,13 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand } else { $users = $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findAll(); - $output->writeln(sprintf('Generating hashed urls for the %d user account entries', count($users))); + $output->writeln(sprintf('Generating hashed urls for "%d" users', \count($users))); foreach ($users as $user) { - $output->writeln(sprintf('Processing user %s', $user->getUsername())); + $output->writeln(sprintf('Processing user: %s', $user->getUsername())); $this->generateHashedUrls($user); } - $output->writeln(sprintf('Finished generated hashed urls')); + $output->writeln('Finished generated hashed urls'); } return 0; @@ -67,13 +67,20 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand $entries = $repo->findByUser($user->getId()); + $i = 1; foreach ($entries as $entry) { - $entry->setHashedUrl(hash('sha512', $entry->getUrl())); + $entry->setHashedUrl(hash('md5', $entry->getUrl())); $em->persist($entry); - $em->flush(); + + if (0 === ($i % 20)) { + $em->flush(); + } + ++$i; } - $this->output->writeln(sprintf('Generated hashed urls for user %s', $user->getUserName())); + $em->flush(); + + $this->output->writeln(sprintf('Generated hashed urls for user: %s', $user->getUserName())); } /** diff --git a/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php index 9c10500d..1b18cad6 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php +++ b/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php @@ -30,7 +30,6 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface 'entry2' => [ 'user' => 'admin-user', 'url' => 'http://0.0.0.0/entry2', - 'hashed_url' => hash('md5', 'http://0.0.0.0/entry2'), 'reading_time' => 1, 'domain' => 'domain.io', 'mime' => 'text/html', @@ -90,6 +89,7 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface foreach ($entries as $reference => $item) { $entry = new Entry($this->getReference($item['user'])); $entry->setUrl($item['url']); + $entry->setHashedUrl(hash('md5', $item['url'])); $entry->setReadingTime($item['reading_time']); $entry->setDomainName($item['domain']); $entry->setMimetype($item['mime']); diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 17a1ed58..a04f101f 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -26,7 +26,7 @@ use Wallabag\UserBundle\Entity\User; * indexes={ * @ORM\Index(name="created_at", columns={"created_at"}), * @ORM\Index(name="uid", columns={"uid"}), - * @ORM\Index(name="hashedurl", columns={"hashedurl"}) + * @ORM\Index(name="hashed_url", columns={"hashed_url"}) * } * ) * @ORM\HasLifecycleCallbacks() @@ -79,7 +79,7 @@ class Entry /** * @var string * - * @ORM\Column(name="hashedurl", type="text", nullable=true) + * @ORM\Column(name="hashed_url", type="string", length=32, nullable=true) */ private $hashedUrl; diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 45366623..0c175abb 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -346,6 +346,30 @@ class EntryRepository extends EntityRepository return false; } + /** + * Find an entry by its hashed url and its owner. + * If it exists, return the entry otherwise return false. + * + * @param $hashedUrl + * @param $userId + * + * @return Entry|bool + */ + public function findByHashedUrlAndUserId($hashedUrl, $userId) + { + $res = $this->createQueryBuilder('e') + ->where('e.hashedUrl = :hashed_url')->setParameter('hashed_url', urldecode($hashedUrl)) + ->andWhere('e.user = :user_id')->setParameter('user_id', $userId) + ->getQuery() + ->getResult(); + + if (\count($res)) { + return current($res); + } + + return false; + } + /** * Count all entries for a user. * -- cgit v1.2.3 From 8a6456629814039cfc623cdb279bcba06dacff50 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 1 Apr 2019 13:51:57 +0200 Subject: Use a better index for hashed_url It'll most often be used in addition to the `user_id`. Also, automatically generate the hash when saving the url. Switch from `md5` to `sha1`. --- src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php | 2 +- src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php | 1 - src/Wallabag/CoreBundle/Entity/Entry.php | 5 +++-- src/Wallabag/CoreBundle/Helper/ContentProxy.php | 2 -- 4 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php b/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php index fb598390..685e1672 100644 --- a/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php +++ b/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php @@ -69,7 +69,7 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand $i = 1; foreach ($entries as $entry) { - $entry->setHashedUrl(hash('md5', $entry->getUrl())); + $entry->setHashedUrl(hash('sha1', $entry->getUrl())); $em->persist($entry); if (0 === ($i % 20)) { diff --git a/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php index 1b18cad6..024fcfdc 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php +++ b/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php @@ -89,7 +89,6 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface foreach ($entries as $reference => $item) { $entry = new Entry($this->getReference($item['user'])); $entry->setUrl($item['url']); - $entry->setHashedUrl(hash('md5', $item['url'])); $entry->setReadingTime($item['reading_time']); $entry->setDomainName($item['domain']); $entry->setMimetype($item['mime']); diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index a04f101f..faf4d259 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -26,7 +26,7 @@ use Wallabag\UserBundle\Entity\User; * indexes={ * @ORM\Index(name="created_at", columns={"created_at"}), * @ORM\Index(name="uid", columns={"uid"}), - * @ORM\Index(name="hashed_url", columns={"hashed_url"}) + * @ORM\Index(name="hashed_url_user_id", columns={"user_id", "hashed_url"}) * } * ) * @ORM\HasLifecycleCallbacks() @@ -79,7 +79,7 @@ class Entry /** * @var string * - * @ORM\Column(name="hashed_url", type="string", length=32, nullable=true) + * @ORM\Column(name="hashed_url", type="string", length=40, nullable=true) */ private $hashedUrl; @@ -324,6 +324,7 @@ class Entry public function setUrl($url) { $this->url = $url; + $this->hashedUrl = hash('sha1', $url); return $this; } diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index 0534d27b..31953f12 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -248,8 +248,6 @@ class ContentProxy { $this->updateOriginUrl($entry, $content['url']); - $entry->setHashedUrl(hash('md5', $entry->getUrl())); - $this->setEntryDomainName($entry); if (!empty($content['title'])) { -- cgit v1.2.3 From c579ce2306297674c56376a2ab5c8ba66a272253 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 1 Apr 2019 14:34:20 +0200 Subject: Some cleanup Also, do not run the hashed_url migration into a Doctrine migration --- src/Wallabag/ApiBundle/Controller/EntryRestController.php | 1 - src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php | 8 ++------ src/Wallabag/CoreBundle/Repository/EntryRepository.php | 6 +++--- 3 files changed, 5 insertions(+), 10 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 0ecf1a0e..ad43b1d4 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -52,7 +52,6 @@ class EntryRestController extends WallabagRestController foreach ($hashedUrls as $hashedUrl) { $res = $repo->findByHashedUrlAndUserId($hashedUrl, $this->getUser()->getId()); - // $results[$url] = $this->returnExistInformation($res, $returnId); $results[$hashedUrl] = $this->returnExistInformation($res, $returnId); } diff --git a/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php b/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php index 685e1672..45bd8c5f 100644 --- a/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php +++ b/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php @@ -20,18 +20,14 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand ->setName('wallabag:generate-hashed-urls') ->setDescription('Generates hashed urls for each entry') ->setHelp('This command helps you to generates hashes of the url of each entry, to check through API if an URL is already saved') - ->addArgument( - 'username', - InputArgument::OPTIONAL, - 'User to process entries' - ); + ->addArgument('username', InputArgument::OPTIONAL, 'User to process entries'); } protected function execute(InputInterface $input, OutputInterface $output) { $this->output = $output; - $username = $input->getArgument('username'); + $username = (string) $input->getArgument('username'); if ($username) { try { diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 0c175abb..f5089729 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -350,15 +350,15 @@ class EntryRepository extends EntityRepository * Find an entry by its hashed url and its owner. * If it exists, return the entry otherwise return false. * - * @param $hashedUrl - * @param $userId + * @param string $hashedUrl Url hashed using sha1 + * @param int $userId * * @return Entry|bool */ public function findByHashedUrlAndUserId($hashedUrl, $userId) { $res = $this->createQueryBuilder('e') - ->where('e.hashedUrl = :hashed_url')->setParameter('hashed_url', urldecode($hashedUrl)) + ->where('e.hashedUrl = :hashed_url')->setParameter('hashed_url', $hashedUrl) ->andWhere('e.user = :user_id')->setParameter('user_id', $userId) ->getQuery() ->getResult(); -- cgit v1.2.3 From 5cc0646e66f52448f83a7a458e0b60b4580e83e5 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 1 Apr 2019 15:45:17 +0200 Subject: Fix index on MySQL --- src/Wallabag/CoreBundle/Entity/Entry.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index faf4d259..c3fb87d2 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -26,7 +26,7 @@ use Wallabag\UserBundle\Entity\User; * indexes={ * @ORM\Index(name="created_at", columns={"created_at"}), * @ORM\Index(name="uid", columns={"uid"}), - * @ORM\Index(name="hashed_url_user_id", columns={"user_id", "hashed_url"}) + * @ORM\Index(name="hashed_url_user_id", columns={"user_id", "hashed_url"}, options={"lengths"={null, 40}}) * } * ) * @ORM\HasLifecycleCallbacks() -- cgit v1.2.3 From 76bc05ebc02408b213b536fec44e94b092889118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Benoist?= Date: Tue, 2 Apr 2019 22:59:50 +0200 Subject: Fix ApiDoc about md5/sha1 --- src/Wallabag/ApiBundle/Controller/EntryRestController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index ad43b1d4..06520af9 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -29,8 +29,8 @@ class EntryRestController extends WallabagRestController * {"name"="return_id", "dataType"="string", "required"=false, "format"="1 or 0", "description"="Set 1 if you want to retrieve ID in case entry(ies) exists, 0 by default"}, * {"name"="url", "dataType"="string", "required"=true, "format"="An url", "description"="DEPRECATED, use hashed_url instead"}, * {"name"="urls", "dataType"="string", "required"=false, "format"="An array of urls (?urls[]=http...&urls[]=http...)", "description"="DEPRECATED, use hashed_urls instead"}, - * {"name"="hashed_url", "dataType"="string", "required"=true, "format"="An url", "description"="Md5 url to check if it exists"}, - * {"name"="hashed_urls", "dataType"="string", "required"=false, "format"="An array of urls (?urls[]=http...&urls[]=http...)", "description"="Md5 urls (as an array) to check if it exists"} + * {"name"="hashed_url", "dataType"="string", "required"=false, "format"="A hashed url", "description"="Hashed url using SHA1 to check if it exists"}, + * {"name"="hashed_urls", "dataType"="string", "required"=false, "format"="An array of hashed urls (?hashed_urls[]=xxx...&hashed_urls[]=xxx...)", "description"="An array of hashed urls using SHA1 to check if they exist"} * } * ) * -- cgit v1.2.3 From f45496336f5bbd31b69553fcfae9cdfd03b280cc Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 23 Apr 2019 22:28:36 +0200 Subject: Add ability to match many domains for credentials MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of fetching one domain, we use the same method as in site config (to retrieve the matching file) and handle api.example.org, example.org, .org (yes the last one isn’t useful). If one of these match, we got it and use it. --- .../GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php | 12 +++++++++++- .../CoreBundle/Repository/SiteCredentialRepository.php | 8 ++++---- .../CoreBundle/Resources/translations/messages.da.yml | 2 +- .../CoreBundle/Resources/translations/messages.de.yml | 2 +- .../CoreBundle/Resources/translations/messages.en.yml | 2 +- .../CoreBundle/Resources/translations/messages.es.yml | 2 +- .../CoreBundle/Resources/translations/messages.fa.yml | 2 +- .../CoreBundle/Resources/translations/messages.fr.yml | 2 +- .../CoreBundle/Resources/translations/messages.it.yml | 2 +- .../CoreBundle/Resources/translations/messages.oc.yml | 2 +- .../CoreBundle/Resources/translations/messages.pl.yml | 2 +- .../CoreBundle/Resources/translations/messages.pt.yml | 2 +- .../CoreBundle/Resources/translations/messages.ro.yml | 2 +- .../CoreBundle/Resources/translations/messages.th.yml | 2 +- 14 files changed, 27 insertions(+), 17 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php index 90e00c62..718441bd 100644 --- a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php +++ b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php @@ -64,7 +64,17 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder $credentials = null; if ($this->currentUser) { - $credentials = $this->credentialRepository->findOneByHostAndUser($host, $this->currentUser->getId()); + $hosts = [$host]; + // will try to see for a host without the first subdomain (fr.example.org & .example.org) + $split = explode('.', $host); + + if (\count($split) > 1) { + // remove first subdomain + array_shift($split); + $hosts[] = '.' . implode('.', $split); + } + + $credentials = $this->credentialRepository->findOneByHostsAndUser($hosts, $this->currentUser->getId()); } if (null === $credentials) { diff --git a/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php b/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php index b2e212a4..aeadd770 100644 --- a/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php +++ b/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php @@ -19,16 +19,16 @@ class SiteCredentialRepository extends \Doctrine\ORM\EntityRepository /** * Retrieve one username/password for the given host and userId. * - * @param string $host - * @param int $userId + * @param array $hosts An array of host to look for + * @param int $userId * * @return array|null */ - public function findOneByHostAndUser($host, $userId) + public function findOneByHostsAndUser($hosts, $userId) { $res = $this->createQueryBuilder('s') ->select('s.username', 's.password') - ->where('s.host = :hostname')->setParameter('hostname', $host) + ->where('s.host IN (:hosts)')->setParameter('hosts', $hosts) ->andWhere('s.user = :userId')->setParameter('userId', $userId) ->setMaxResults(1) ->getQuery() diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index 97eb874d..6f842534 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -550,7 +550,7 @@ site_credential: # create_new_one: Create a new credential # form: # username_label: 'Username' - # host_label: 'Host' + # host_label: 'Host (subdomain.example.org, .example.org, etc.)' # password_label: 'Password' # save: Save # delete: Delete diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 0cf3b138..874908b9 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -550,7 +550,7 @@ site_credential: create_new_one: 'Einen neuen Seitenzugang anlegen' form: username_label: 'Benutzername' - host_label: 'Host' + host_label: 'Host (subdomain.example.org, .example.org, etc.)' password_label: 'Passwort' save: 'Speichern' delete: 'Löschen' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 6085be14..598ad58d 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -550,7 +550,7 @@ site_credential: create_new_one: Create a new credential form: username_label: 'Username' - host_label: 'Host' + host_label: 'Host (subdomain.example.org, .example.org, etc.)' password_label: 'Password' save: Save delete: Delete diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index f2a8fb89..f8aa4109 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -550,7 +550,7 @@ site_credential: # create_new_one: Create a new credential # form: # username_label: 'Username' - # host_label: 'Host' + # host_label: 'Host (subdomain.example.org, .example.org, etc.)' # password_label: 'Password' # save: Save # delete: Delete diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index a5cbd7ec..785e39ee 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -550,7 +550,7 @@ site_credential: # create_new_one: Create a new credential # form: # username_label: 'Username' - # host_label: 'Host' + # host_label: 'Host (subdomain.example.org, .example.org, etc.)' # password_label: 'Password' # save: Save # delete: Delete diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index a36d84ae..b2fa1c50 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -550,7 +550,7 @@ site_credential: create_new_one: Créer un nouvel accès à un site form: username_label: 'Identifiant' - host_label: 'Domaine' + host_label: 'Domaine (subdomain.example.org, .example.org, etc.)' password_label: 'Mot de passe' save: "Sauvegarder" delete: "Supprimer" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 1649c0e4..ecaa3b60 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -550,7 +550,7 @@ site_credential: # create_new_one: Create a new credential # form: # username_label: 'Username' - # host_label: 'Host' + # host_label: 'Host (subdomain.example.org, .example.org, etc.)' # password_label: 'Password' # save: Save # delete: Delete diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index e2298f1f..848c88d2 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -550,7 +550,7 @@ site_credential: create_new_one: Crear un novèl identificant form: username_label: "Nom d'utilizaire" - host_label: 'Òste' + host_label: 'Òste (subdomain.example.org, .example.org, etc.)' password_label: 'Senhal' save: 'Enregistrar' delete: 'Suprimir' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index a5712733..a0032fe8 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -550,7 +550,7 @@ site_credential: create_new_one: Stwórz nowe poświadczenie form: username_label: 'Nazwa użytkownika' - host_label: 'Host' + host_label: 'Host (subdomain.example.org, .example.org, etc.)' password_label: 'Hasło' save: Zapisz delete: Usuń diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 1ccf49e1..292fad61 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -550,7 +550,7 @@ site_credential: # create_new_one: Create a new credential form: # username_label: 'Username' - # host_label: 'Host' + # host_label: 'Host (subdomain.example.org, .example.org, etc.)' # password_label: 'Password' save: 'Salvar' delete: 'Apagar' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index 6c0e18e1..9e8d68b3 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -550,7 +550,7 @@ site_credential: # create_new_one: Create a new credential # form: # username_label: 'Username' - # host_label: 'Host' + # host_label: 'Host (subdomain.example.org, .example.org, etc.)' # password_label: 'Password' # save: Save # delete: Delete diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index 5524b1f1..cb3b0f23 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -548,7 +548,7 @@ site_credential: create_new_one: สร้างข้อมูลส่วนตัวใหม่ form: username_label: 'ชื่อผู้ใช้' - host_label: 'โฮส' + host_label: 'โฮส (subdomain.example.org, .example.org, etc.)' password_label: 'รหัสผ่าน' save: บันทึก delete: ลบ -- cgit v1.2.3 From 35359bd3c67e5b6c6371e2e547a3411ca0a8027b Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 24 Apr 2019 15:28:15 +0200 Subject: Adding more tests to cover different scenario --- .../DataFixtures/ORM/LoadSiteCredentialData.php | 27 ++++++++++++++++++---- .../GrabySiteConfigBuilder.php | 27 ++++++++++++---------- 2 files changed, 38 insertions(+), 16 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php index 866f55a4..faf29da6 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php @@ -5,19 +5,38 @@ namespace Wallabag\CoreBundle\DataFixtures\ORM; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; use Doctrine\Common\Persistence\ObjectManager; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; use Wallabag\CoreBundle\Entity\SiteCredential; -class LoadSiteCredentialData extends AbstractFixture implements OrderedFixtureInterface +class LoadSiteCredentialData extends AbstractFixture implements OrderedFixtureInterface, ContainerAwareInterface { + /** + * @var ContainerInterface + */ + private $container; + + public function setContainer(ContainerInterface $container = null) + { + $this->container = $container; + } + /** * {@inheritdoc} */ public function load(ObjectManager $manager) { $credential = new SiteCredential($this->getReference('admin-user')); - $credential->setHost('example.com'); - $credential->setUsername('foo'); - $credential->setPassword('bar'); + $credential->setHost('.super.com'); + $credential->setUsername($this->container->get('wallabag_core.helper.crypto_proxy')->crypt('.super')); + $credential->setPassword($this->container->get('wallabag_core.helper.crypto_proxy')->crypt('bar')); + + $manager->persist($credential); + + $credential = new SiteCredential($this->getReference('admin-user')); + $credential->setHost('paywall.example.com'); + $credential->setUsername($this->container->get('wallabag_core.helper.crypto_proxy')->crypt('paywall.example')); + $credential->setPassword($this->container->get('wallabag_core.helper.crypto_proxy')->crypt('bar')); $manager->persist($credential); diff --git a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php index 718441bd..c7502bac 100644 --- a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php +++ b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php @@ -62,21 +62,24 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder $host = substr($host, 4); } - $credentials = null; - if ($this->currentUser) { - $hosts = [$host]; - // will try to see for a host without the first subdomain (fr.example.org & .example.org) - $split = explode('.', $host); - - if (\count($split) > 1) { - // remove first subdomain - array_shift($split); - $hosts[] = '.' . implode('.', $split); - } + if (!$this->currentUser) { + $this->logger->debug('Auth: no current user defined.'); + + return false; + } + + $hosts = [$host]; + // will try to see for a host without the first subdomain (fr.example.org & .example.org) + $split = explode('.', $host); - $credentials = $this->credentialRepository->findOneByHostsAndUser($hosts, $this->currentUser->getId()); + if (\count($split) > 1) { + // remove first subdomain + array_shift($split); + $hosts[] = '.' . implode('.', $split); } + $credentials = $this->credentialRepository->findOneByHostsAndUser($hosts, $this->currentUser->getId()); + if (null === $credentials) { $this->logger->debug('Auth: no credentials available for host.', ['host' => $host]); -- cgit v1.2.3 From 531c8d0a5c55fa93438e227a7d349235fbd31d28 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 13 Jun 2017 18:48:10 +0200 Subject: Changed RSS to Atom feed and improve paging --- .../CoreBundle/Controller/ConfigController.php | 24 +-- .../CoreBundle/Controller/FeedController.php | 211 +++++++++++++++++++++ .../CoreBundle/Controller/RssController.php | 196 ------------------- .../DependencyInjection/WallabagCoreExtension.php | 2 +- src/Wallabag/CoreBundle/Entity/Config.php | 34 ++-- src/Wallabag/CoreBundle/Form/Type/FeedType.php | 36 ++++ src/Wallabag/CoreBundle/Form/Type/RssType.php | 36 ---- .../CoreBundle/Helper/PreparePagerForEntries.php | 2 +- .../ParamConverter/UsernameFeedTokenConverter.php | 91 +++++++++ .../ParamConverter/UsernameRssTokenConverter.php | 91 --------- .../CoreBundle/Resources/config/services.yml | 6 +- .../Resources/translations/messages.da.yml | 16 +- .../Resources/translations/messages.de.yml | 24 +-- .../Resources/translations/messages.en.yml | 20 +- .../Resources/translations/messages.es.yml | 16 +- .../Resources/translations/messages.fa.yml | 16 +- .../Resources/translations/messages.fr.yml | 20 +- .../Resources/translations/messages.it.yml | 16 +- .../Resources/translations/messages.oc.yml | 16 +- .../Resources/translations/messages.pl.yml | 16 +- .../Resources/translations/messages.pt.yml | 16 +- .../Resources/translations/messages.ro.yml | 16 +- .../Resources/translations/messages.tr.yml | 16 +- .../Resources/translations/validators.da.yml | 2 +- .../Resources/translations/validators.de.yml | 3 +- .../Resources/translations/validators.en.yml | 2 +- .../Resources/translations/validators.es.yml | 2 +- .../Resources/translations/validators.fa.yml | 2 +- .../Resources/translations/validators.fr.yml | 2 +- .../Resources/translations/validators.it.yml | 2 +- .../Resources/translations/validators.oc.yml | 2 +- .../Resources/translations/validators.pl.yml | 2 +- .../Resources/translations/validators.pt.yml | 2 +- .../Resources/translations/validators.ro.yml | 2 +- .../Resources/translations/validators.tr.yml | 2 +- .../views/themes/baggy/Config/index.html.twig | 42 ++-- .../views/themes/baggy/Entry/entries.html.twig | 8 +- .../views/themes/baggy/Tag/tags.html.twig | 2 +- .../views/themes/common/Entry/_feed_link.html.twig | 11 ++ .../views/themes/common/Entry/_rss_link.html.twig | 11 -- .../views/themes/common/Entry/entries.xml.twig | 83 ++++---- .../themes/common/Static/quickstart.html.twig | 2 +- .../views/themes/material/Config/index.html.twig | 44 ++--- .../views/themes/material/Entry/entries.html.twig | 8 +- .../views/themes/material/Tag/tags.html.twig | 2 +- src/Wallabag/CoreBundle/Tools/Utils.php | 2 +- src/Wallabag/CoreBundle/Twig/WallabagExtension.php | 10 +- .../EventListener/CreateConfigListener.php | 8 +- .../UserBundle/Repository/UserRepository.php | 10 +- .../UserBundle/Resources/config/services.yml | 2 +- 50 files changed, 622 insertions(+), 585 deletions(-) create mode 100644 src/Wallabag/CoreBundle/Controller/FeedController.php delete mode 100644 src/Wallabag/CoreBundle/Controller/RssController.php create mode 100644 src/Wallabag/CoreBundle/Form/Type/FeedType.php delete mode 100644 src/Wallabag/CoreBundle/Form/Type/RssType.php create mode 100644 src/Wallabag/CoreBundle/ParamConverter/UsernameFeedTokenConverter.php delete mode 100644 src/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverter.php create mode 100644 src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_feed_link.html.twig delete mode 100644 src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_rss_link.html.twig (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index 9257ab18..3b281d48 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -14,7 +14,7 @@ use Wallabag\CoreBundle\Entity\Config; use Wallabag\CoreBundle\Entity\TaggingRule; use Wallabag\CoreBundle\Form\Type\ChangePasswordType; use Wallabag\CoreBundle\Form\Type\ConfigType; -use Wallabag\CoreBundle\Form\Type\RssType; +use Wallabag\CoreBundle\Form\Type\FeedType; use Wallabag\CoreBundle\Form\Type\TaggingRuleType; use Wallabag\CoreBundle\Form\Type\UserInformationType; use Wallabag\CoreBundle\Tools\Utils; @@ -92,17 +92,17 @@ class ConfigController extends Controller return $this->redirect($this->generateUrl('config') . '#set3'); } - // handle rss information - $rssForm = $this->createForm(RssType::class, $config, ['action' => $this->generateUrl('config') . '#set2']); - $rssForm->handleRequest($request); + // handle feed information + $feedForm = $this->createForm(FeedType::class, $config, ['action' => $this->generateUrl('config') . '#set2']); + $feedForm->handleRequest($request); - if ($rssForm->isSubmitted() && $rssForm->isValid()) { + if ($feedForm->isSubmitted() && $feedForm->isValid()) { $em->persist($config); $em->flush(); $this->addFlash( 'notice', - 'flashes.config.notice.rss_updated' + 'flashes.config.notice.feed_updated' ); return $this->redirect($this->generateUrl('config') . '#set2'); @@ -143,14 +143,14 @@ class ConfigController extends Controller return $this->render('WallabagCoreBundle:Config:index.html.twig', [ 'form' => [ 'config' => $configForm->createView(), - 'rss' => $rssForm->createView(), + 'feed' => $feedForm->createView(), 'pwd' => $pwdForm->createView(), 'user' => $userForm->createView(), 'new_tagging_rule' => $newTaggingRule->createView(), ], - 'rss' => [ + 'feed' => [ 'username' => $user->getUsername(), - 'token' => $config->getRssToken(), + 'token' => $config->getFeedToken(), ], 'twofactor_auth' => $this->getParameter('twofactor_auth'), 'wallabag_url' => $this->getParameter('domain_name'), @@ -281,19 +281,19 @@ class ConfigController extends Controller public function generateTokenAction(Request $request) { $config = $this->getConfig(); - $config->setRssToken(Utils::generateToken()); + $config->setFeedToken(Utils::generateToken()); $em = $this->getDoctrine()->getManager(); $em->persist($config); $em->flush(); if ($request->isXmlHttpRequest()) { - return new JsonResponse(['token' => $config->getRssToken()]); + return new JsonResponse(['token' => $config->getFeedToken()]); } $this->addFlash( 'notice', - 'flashes.config.notice.rss_token_updated' + 'flashes.config.notice.feed_token_updated' ); return $this->redirect($this->generateUrl('config') . '#set2'); diff --git a/src/Wallabag/CoreBundle/Controller/FeedController.php b/src/Wallabag/CoreBundle/Controller/FeedController.php new file mode 100644 index 00000000..9d55a9b7 --- /dev/null +++ b/src/Wallabag/CoreBundle/Controller/FeedController.php @@ -0,0 +1,211 @@ +showEntries('unread', $user, $page); + } + + /** + * Shows read entries for current user. + * + * @Route("/feed/{username}/{token}/archive/{page}", name="archive_feed", defaults={"page": 1}) + * @Route("/{username}/{token}/archive.xml", defaults={"page": 1}) + * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_feed_token_converter") + * + * @param User $user + * @param $page + * + * @return \Symfony\Component\HttpFoundation\Response + */ + public function showArchiveFeedAction(User $user, $page) + { + return $this->showEntries('archive', $user, $page); + } + + /** + * Shows starred entries for current user. + * + * @Route("/feed/{username}/{token}/starred/{page}", name="starred_feed", defaults={"page": 1}) + * @Route("/{username}/{token}/starred.xml", defaults={"page": 1}) + * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_feed_token_converter") + * + * @param User $user + * @param $page + * + * @return \Symfony\Component\HttpFoundation\Response + */ + public function showStarredFeedAction(User $user, $page) + { + return $this->showEntries('starred', $user, $page); + } + + /** + * Shows all entries for current user. + * + * @Route("/{username}/{token}/all.xml", name="all_feed", defaults={"_format"="xml"}) + * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_feed_token_converter") + * + * @return \Symfony\Component\HttpFoundation\Response + */ + public function showAllFeedAction(Request $request, User $user) + { + return $this->showEntries('all', $user, $request->query->get('page', 1)); + } + + /** + * Shows entries associated to a tag for current user. + * + * @Route("/{username}/{token}/tags/{slug}.xml", name="tag_feed", defaults={"_format"="xml"}) + * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_feed_token_converter") + * @ParamConverter("tag", options={"mapping": {"slug": "slug"}}) + * + * @return \Symfony\Component\HttpFoundation\Response + */ + public function showTagsFeedAction(Request $request, User $user, Tag $tag) + { + $page = $request->query->get('page', 1); + + $url = $this->generateUrl( + 'tag_feed', + [ + 'username' => $user->getUsername(), + 'token' => $user->getConfig()->getFeedToken(), + 'slug' => $tag->getSlug(), + ], + UrlGeneratorInterface::ABSOLUTE_URL + ); + + $entriesByTag = $this->get('wallabag_core.entry_repository')->findAllByTagId( + $user->getId(), + $tag->getId() + ); + + $pagerAdapter = new ArrayAdapter($entriesByTag); + + $entries = $this->get('wallabag_core.helper.prepare_pager_for_entries')->prepare( + $pagerAdapter, + $user + ); + + if (null === $entries) { + throw $this->createNotFoundException('No entries found?'); + } + + try { + $entries->setCurrentPage($page); + } catch (OutOfRangeCurrentPageException $e) { + if ($page > 1) { + return $this->redirect($url . '?page=' . $entries->getNbPages(), 302); + } + } + + return $this->render( + '@WallabagCore/themes/common/Entry/entries.xml.twig', + [ + 'type' => 'tag', + 'url' => $url, + 'entries' => $entries, + 'user' => $user->getUsername(), + 'domainName' => $this->getParameter('domain_name'), + 'version' => $this->getParameter('wallabag_core.version'), + 'tag' => $tag->getSlug(), + ], + new Response('', 200, ['Content-Type' => 'application/atom+xml']) + ); + } + + /** + * Global method to retrieve entries depending on the given type + * It returns the response to be send. + * + * @param string $type Entries type: unread, starred or archive + * @param User $user + * @param int $page + * + * @return \Symfony\Component\HttpFoundation\Response + */ + private function showEntries($type, User $user, $page = 1) + { + $repository = $this->get('wallabag_core.entry_repository'); + + switch ($type) { + case 'starred': + $qb = $repository->getBuilderForStarredByUser($user->getId()); + break; + case 'archive': + $qb = $repository->getBuilderForArchiveByUser($user->getId()); + break; + case 'unread': + $qb = $repository->getBuilderForUnreadByUser($user->getId()); + break; + case 'all': + $qb = $repository->getBuilderForAllByUser($user->getId()); + break; + default: + throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type)); + } + + $pagerAdapter = new DoctrineORMAdapter($qb->getQuery(), true, false); + $entries = new Pagerfanta($pagerAdapter); + + $perPage = $user->getConfig()->getFeedLimit() ?: $this->getParameter('wallabag_core.Feed_limit'); + $entries->setMaxPerPage($perPage); + + $url = $this->generateUrl( + $type . '_feed', + [ + 'username' => $user->getUsername(), + 'token' => $user->getConfig()->getFeedToken(), + ], + UrlGeneratorInterface::ABSOLUTE_URL + ); + + try { + $entries->setCurrentPage((int) $page); + } catch (OutOfRangeCurrentPageException $e) { + if ($page > 1) { + return $this->redirect($url . '/' . $entries->getNbPages()); + } + } + + return $this->render('@WallabagCore/themes/common/Entry/entries.xml.twig', [ + 'type' => $type, + 'url' => $url, + 'entries' => $entries, + 'user' => $user->getUsername(), + 'domainName' => $this->getParameter('domain_name'), + 'version' => $this->getParameter('wallabag_core.version'), + ], + new Response('', 200, ['Content-Type' => 'application/atom+xml']) + ); + } +} diff --git a/src/Wallabag/CoreBundle/Controller/RssController.php b/src/Wallabag/CoreBundle/Controller/RssController.php deleted file mode 100644 index 1c831c03..00000000 --- a/src/Wallabag/CoreBundle/Controller/RssController.php +++ /dev/null @@ -1,196 +0,0 @@ -showEntries('unread', $user, $request->query->get('page', 1)); - } - - /** - * Shows read entries for current user. - * - * @Route("/{username}/{token}/archive.xml", name="archive_rss", defaults={"_format"="xml"}) - * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_rsstoken_converter") - * - * @return \Symfony\Component\HttpFoundation\Response - */ - public function showArchiveRSSAction(Request $request, User $user) - { - return $this->showEntries('archive', $user, $request->query->get('page', 1)); - } - - /** - * Shows starred entries for current user. - * - * @Route("/{username}/{token}/starred.xml", name="starred_rss", defaults={"_format"="xml"}) - * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_rsstoken_converter") - * - * @return \Symfony\Component\HttpFoundation\Response - */ - public function showStarredRSSAction(Request $request, User $user) - { - return $this->showEntries('starred', $user, $request->query->get('page', 1)); - } - - /** - * Shows all entries for current user. - * - * @Route("/{username}/{token}/all.xml", name="all_rss", defaults={"_format"="xml"}) - * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_rsstoken_converter") - * - * @return \Symfony\Component\HttpFoundation\Response - */ - public function showAllRSSAction(Request $request, User $user) - { - return $this->showEntries('all', $user, $request->query->get('page', 1)); - } - - /** - * Shows entries associated to a tag for current user. - * - * @Route("/{username}/{token}/tags/{slug}.xml", name="tag_rss", defaults={"_format"="xml"}) - * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_rsstoken_converter") - * @ParamConverter("tag", options={"mapping": {"slug": "slug"}}) - * - * @return \Symfony\Component\HttpFoundation\Response - */ - public function showTagsAction(Request $request, User $user, Tag $tag) - { - $page = $request->query->get('page', 1); - - $url = $this->generateUrl( - 'tag_rss', - [ - 'username' => $user->getUsername(), - 'token' => $user->getConfig()->getRssToken(), - 'slug' => $tag->getSlug(), - ], - UrlGeneratorInterface::ABSOLUTE_URL - ); - - $entriesByTag = $this->get('wallabag_core.entry_repository')->findAllByTagId( - $user->getId(), - $tag->getId() - ); - - $pagerAdapter = new ArrayAdapter($entriesByTag); - - $entries = $this->get('wallabag_core.helper.prepare_pager_for_entries')->prepare( - $pagerAdapter, - $user - ); - - if (null === $entries) { - throw $this->createNotFoundException('No entries found?'); - } - - try { - $entries->setCurrentPage($page); - } catch (OutOfRangeCurrentPageException $e) { - if ($page > 1) { - return $this->redirect($url . '?page=' . $entries->getNbPages(), 302); - } - } - - return $this->render( - '@WallabagCore/themes/common/Entry/entries.xml.twig', - [ - 'url_html' => $this->generateUrl('tag_entries', ['slug' => $tag->getSlug()], UrlGeneratorInterface::ABSOLUTE_URL), - 'type' => 'tag (' . $tag->getLabel() . ')', - 'url' => $url, - 'entries' => $entries, - ], - new Response('', 200, ['Content-Type' => 'application/rss+xml']) - ); - } - - /** - * Global method to retrieve entries depending on the given type - * It returns the response to be send. - * - * @param string $type Entries type: unread, starred or archive - * @param User $user - * @param int $page - * - * @return \Symfony\Component\HttpFoundation\Response - */ - private function showEntries($type, User $user, $page = 1) - { - $repository = $this->get('wallabag_core.entry_repository'); - - switch ($type) { - case 'starred': - $qb = $repository->getBuilderForStarredByUser($user->getId()); - break; - case 'archive': - $qb = $repository->getBuilderForArchiveByUser($user->getId()); - break; - case 'unread': - $qb = $repository->getBuilderForUnreadByUser($user->getId()); - break; - case 'all': - $qb = $repository->getBuilderForAllByUser($user->getId()); - break; - default: - throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type)); - } - - $pagerAdapter = new DoctrineORMAdapter($qb->getQuery(), true, false); - $entries = new Pagerfanta($pagerAdapter); - - $perPage = $user->getConfig()->getRssLimit() ?: $this->getParameter('wallabag_core.rss_limit'); - $entries->setMaxPerPage($perPage); - - $url = $this->generateUrl( - $type . '_rss', - [ - 'username' => $user->getUsername(), - 'token' => $user->getConfig()->getRssToken(), - ], - UrlGeneratorInterface::ABSOLUTE_URL - ); - - try { - $entries->setCurrentPage((int) $page); - } catch (OutOfRangeCurrentPageException $e) { - if ($page > 1) { - return $this->redirect($url . '?page=' . $entries->getNbPages(), 302); - } - } - - return $this->render( - '@WallabagCore/themes/common/Entry/entries.xml.twig', - [ - 'url_html' => $this->generateUrl($type, [], UrlGeneratorInterface::ABSOLUTE_URL), - 'type' => $type, - 'url' => $url, - 'entries' => $entries, - ], - new Response('', 200, ['Content-Type' => 'application/rss+xml']) - ); - } -} diff --git a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php index a3ef2b53..e9a1e9e0 100644 --- a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php +++ b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php @@ -18,7 +18,7 @@ class WallabagCoreExtension extends Extension $container->setParameter('wallabag_core.items_on_page', $config['items_on_page']); $container->setParameter('wallabag_core.theme', $config['theme']); $container->setParameter('wallabag_core.language', $config['language']); - $container->setParameter('wallabag_core.rss_limit', $config['rss_limit']); + $container->setParameter('wallabag_core.feed_limit', $config['rss_limit']); $container->setParameter('wallabag_core.reading_speed', $config['reading_speed']); $container->setParameter('wallabag_core.version', $config['version']); $container->setParameter('wallabag_core.paypal_url', $config['paypal_url']); diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php index b902ae2c..7458f757 100644 --- a/src/Wallabag/CoreBundle/Entity/Config.php +++ b/src/Wallabag/CoreBundle/Entity/Config.php @@ -62,7 +62,7 @@ class Config * * @ORM\Column(name="rss_token", type="string", nullable=true) */ - private $rssToken; + private $feedToken; /** * @var int @@ -71,10 +71,10 @@ class Config * @Assert\Range( * min = 1, * max = 100000, - * maxMessage = "validator.rss_limit_too_high" + * maxMessage = "validator.feed_limit_too_high" * ) */ - private $rssLimit; + private $feedLimit; /** * @var float @@ -231,51 +231,51 @@ class Config } /** - * Set rssToken. + * Set feed Token. * - * @param string $rssToken + * @param string $feedToken * * @return Config */ - public function setRssToken($rssToken) + public function setFeedToken($feedToken) { - $this->rssToken = $rssToken; + $this->feedToken = $feedToken; return $this; } /** - * Get rssToken. + * Get feedToken. * * @return string */ - public function getRssToken() + public function getFeedToken() { - return $this->rssToken; + return $this->feedToken; } /** - * Set rssLimit. + * Set Feed Limit. * - * @param int $rssLimit + * @param int $feedLimit * * @return Config */ - public function setRssLimit($rssLimit) + public function setFeedLimit($feedLimit) { - $this->rssLimit = $rssLimit; + $this->feedLimit = $feedLimit; return $this; } /** - * Get rssLimit. + * Get Feed Limit. * * @return int */ - public function getRssLimit() + public function getFeedLimit() { - return $this->rssLimit; + return $this->feedLimit; } /** diff --git a/src/Wallabag/CoreBundle/Form/Type/FeedType.php b/src/Wallabag/CoreBundle/Form/Type/FeedType.php new file mode 100644 index 00000000..9b34daf4 --- /dev/null +++ b/src/Wallabag/CoreBundle/Form/Type/FeedType.php @@ -0,0 +1,36 @@ +add('feed_limit', null, [ + 'label' => 'config.form_feed.feed_limit', + 'property_path' => 'feedLimit', + ]) + ->add('save', SubmitType::class, [ + 'label' => 'config.form.save', + ]) + ; + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults([ + 'data_class' => 'Wallabag\CoreBundle\Entity\Config', + ]); + } + + public function getBlockPrefix() + { + return 'feed_config'; + } +} diff --git a/src/Wallabag/CoreBundle/Form/Type/RssType.php b/src/Wallabag/CoreBundle/Form/Type/RssType.php deleted file mode 100644 index 49b31c1e..00000000 --- a/src/Wallabag/CoreBundle/Form/Type/RssType.php +++ /dev/null @@ -1,36 +0,0 @@ -add('rss_limit', null, [ - 'label' => 'config.form_rss.rss_limit', - 'property_path' => 'rssLimit', - ]) - ->add('save', SubmitType::class, [ - 'label' => 'config.form.save', - ]) - ; - } - - public function configureOptions(OptionsResolver $resolver) - { - $resolver->setDefaults([ - 'data_class' => 'Wallabag\CoreBundle\Entity\Config', - ]); - } - - public function getBlockPrefix() - { - return 'rss_config'; - } -} diff --git a/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php b/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php index 183d394a..04abc6d0 100644 --- a/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php +++ b/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php @@ -21,7 +21,7 @@ class PreparePagerForEntries /** * @param AdapterInterface $adapter - * @param User $user If user isn't logged in, we can force it (like for rss) + * @param User $user If user isn't logged in, we can force it (like for feed) * * @return Pagerfanta|null */ diff --git a/src/Wallabag/CoreBundle/ParamConverter/UsernameFeedTokenConverter.php b/src/Wallabag/CoreBundle/ParamConverter/UsernameFeedTokenConverter.php new file mode 100644 index 00000000..e220abfc --- /dev/null +++ b/src/Wallabag/CoreBundle/ParamConverter/UsernameFeedTokenConverter.php @@ -0,0 +1,91 @@ +registry = $registry; + } + + /** + * {@inheritdoc} + * + * Check, if object supported by our converter + */ + public function supports(ParamConverter $configuration) + { + // If there is no manager, this means that only Doctrine DBAL is configured + // In this case we can do nothing and just return + if (null === $this->registry || !\count($this->registry->getManagers())) { + return false; + } + + // Check, if option class was set in configuration + if (null === $configuration->getClass()) { + return false; + } + + // Get actual entity manager for class + $em = $this->registry->getManagerForClass($configuration->getClass()); + + // Check, if class name is what we need + if (null !== $em && 'Wallabag\UserBundle\Entity\User' !== $em->getClassMetadata($configuration->getClass())->getName()) { + return false; + } + + return true; + } + + /** + * {@inheritdoc} + * + * Applies converting + * + * @throws \InvalidArgumentException When route attributes are missing + * @throws NotFoundHttpException When object not found + */ + public function apply(Request $request, ParamConverter $configuration) + { + $username = $request->attributes->get('username'); + $feedToken = $request->attributes->get('token'); + + if (!$request->attributes->has('username') || !$request->attributes->has('token')) { + return false; + } + + // Get actual entity manager for class + $em = $this->registry->getManagerForClass($configuration->getClass()); + + $userRepository = $em->getRepository($configuration->getClass()); + + // Try to find user by its username and config feed_token + $user = $userRepository->findOneByUsernameAndFeedtoken($username, $feedToken); + + if (null === $user || !($user instanceof User)) { + throw new NotFoundHttpException(sprintf('%s not found.', $configuration->getClass())); + } + + // Map found user to the route's parameter + $request->attributes->set($configuration->getName(), $user); + } +} diff --git a/src/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverter.php b/src/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverter.php deleted file mode 100644 index 4a2fcab5..00000000 --- a/src/Wallabag/CoreBundle/ParamConverter/UsernameRssTokenConverter.php +++ /dev/null @@ -1,91 +0,0 @@ -registry = $registry; - } - - /** - * {@inheritdoc} - * - * Check, if object supported by our converter - */ - public function supports(ParamConverter $configuration) - { - // If there is no manager, this means that only Doctrine DBAL is configured - // In this case we can do nothing and just return - if (null === $this->registry || !\count($this->registry->getManagers())) { - return false; - } - - // Check, if option class was set in configuration - if (null === $configuration->getClass()) { - return false; - } - - // Get actual entity manager for class - $em = $this->registry->getManagerForClass($configuration->getClass()); - - // Check, if class name is what we need - if (null !== $em && 'Wallabag\UserBundle\Entity\User' !== $em->getClassMetadata($configuration->getClass())->getName()) { - return false; - } - - return true; - } - - /** - * {@inheritdoc} - * - * Applies converting - * - * @throws \InvalidArgumentException When route attributes are missing - * @throws NotFoundHttpException When object not found - */ - public function apply(Request $request, ParamConverter $configuration) - { - $username = $request->attributes->get('username'); - $rssToken = $request->attributes->get('token'); - - if (!$request->attributes->has('username') || !$request->attributes->has('token')) { - return false; - } - - // Get actual entity manager for class - $em = $this->registry->getManagerForClass($configuration->getClass()); - - $userRepository = $em->getRepository($configuration->getClass()); - - // Try to find user by its username and config rss_token - $user = $userRepository->findOneByUsernameAndRsstoken($username, $rssToken); - - if (null === $user || !($user instanceof User)) { - throw new NotFoundHttpException(sprintf('%s not found.', $configuration->getClass())); - } - - // Map found user to the route's parameter - $request->attributes->set($configuration->getName(), $user); - } -} diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml index a27dd210..280d779d 100644 --- a/src/Wallabag/CoreBundle/Resources/config/services.yml +++ b/src/Wallabag/CoreBundle/Resources/config/services.yml @@ -22,10 +22,10 @@ services: tags: - { name: form.type } - wallabag_core.param_converter.username_rsstoken_converter: - class: Wallabag\CoreBundle\ParamConverter\UsernameRssTokenConverter + wallabag_core.param_converter.username_feed_token_converter: + class: Wallabag\CoreBundle\ParamConverter\UsernameFeedTokenConverter tags: - - { name: request.param_converter, converter: username_rsstoken_converter } + - { name: request.param_converter, converter: username_feed_token_converter } arguments: - "@doctrine" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index 454f547d..61ef3b8f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -54,7 +54,7 @@ config: page_title: 'Opsætning' tab_menu: settings: 'Indstillinger' - rss: 'RSS' + feed: 'RSS' user_info: 'Brugeroplysninger' password: 'Adgangskode' # rules: 'Tagging rules' @@ -85,19 +85,19 @@ config: # help_reading_speed: "wallabag calculates a reading time for each article. You can define here, thanks to this list, if you are a fast or a slow reader. wallabag will recalculate the reading time for each article." # help_language: "You can change the language of wallabag interface." # help_pocket_consumer_key: "Required for Pocket import. You can create it in your Pocket account." - form_rss: + form_feed: description: 'RSS-feeds fra wallabag gør det muligt at læse de artikler, der gemmes i wallabag, med din RSS-læser. Det kræver, at du genererer et token først.' token_label: 'RSS-Token' no_token: 'Intet token' token_create: 'Opret token' token_reset: 'Nulstil token' - rss_links: 'RSS-Links' - rss_link: + feed_links: 'RSS-Links' + feed_link: unread: 'Ulæst' starred: 'Favoritter' archive: 'Arkiv' # all: 'All' - # rss_limit: 'Number of items in the feed' + # feed_limit: 'Number of items in the feed' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Navn' @@ -372,7 +372,7 @@ quickstart: # title: 'Configure the application' # description: 'In order to have an application which suits you, have a look into the configuration of wallabag.' # language: 'Change language and design' - # rss: 'Enable RSS feeds' + # feed: 'Enable RSS feeds' # tagging_rules: 'Write rules to automatically tag your articles' # admin: # title: 'Administration' @@ -589,10 +589,10 @@ flashes: password_updated: 'Adgangskode opdateret' # password_not_updated_demo: "In demonstration mode, you can't change password for this user." user_updated: 'Oplysninger opdateret' - rss_updated: 'RSS-oplysninger opdateret' + feed_updated: 'RSS-oplysninger opdateret' # tagging_rules_updated: 'Tagging rules updated' # tagging_rules_deleted: 'Tagging rule deleted' - # rss_token_updated: 'RSS token updated' + # feed_token_updated: 'RSS token updated' # annotations_reset: Annotations reset # tags_reset: Tags reset # entries_reset: Entries reset diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index dc1d4723..991e00f1 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -54,7 +54,7 @@ config: page_title: 'Einstellungen' tab_menu: settings: 'Einstellungen' - rss: 'RSS' + feed: 'RSS' user_info: 'Benutzerinformation' password: 'Kennwort' rules: 'Tagging-Regeln' @@ -85,19 +85,19 @@ config: help_reading_speed: "wallabag berechnet eine Lesezeit pro Artikel. Hier kannst du definieren, ob du ein schneller oder langsamer Leser bist. wallabag wird die Lesezeiten danach neu berechnen." help_language: "Du kannst die Sprache der wallabag-Oberfläche ändern." help_pocket_consumer_key: "Nötig für den Pocket-Import. Du kannst ihn in deinem Pocket account einrichten." - form_rss: + form_feed: description: 'Die RSS-Feeds von wallabag erlauben es dir, deine gespeicherten Artikel mit deinem bevorzugten RSS-Reader zu lesen. Vorher musst du jedoch einen Token erstellen.' token_label: 'RSS-Token' no_token: 'Kein Token' token_create: 'Token erstellen' token_reset: 'Token zurücksetzen' - rss_links: 'RSS-Links' - rss_link: + feed_links: 'RSS-Links' + feed_link: unread: 'Ungelesene' starred: 'Favoriten' archive: 'Archivierte' all: 'Alle' - rss_limit: 'Anzahl der Einträge pro Feed' + feed_limit: 'Anzahl der Einträge pro Feed' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Name' @@ -363,7 +363,7 @@ quickstart: title: 'Anwendung konfigurieren' description: 'Um die Applikation für dich anzupassen, schau in die Konfiguration von wallabag.' language: 'Sprache und Design ändern' - rss: 'RSS-Feeds aktivieren' + feed: 'RSS-Feeds aktivieren' tagging_rules: 'Schreibe Regeln, um deine Beiträge automatisch zu taggen (verschlagworten)' admin: title: 'Administration' @@ -580,14 +580,14 @@ flashes: password_updated: 'Kennwort aktualisiert' password_not_updated_demo: 'Im Testmodus kannst du das Kennwort nicht ändern.' user_updated: 'Information aktualisiert' - rss_updated: 'RSS-Informationen aktualisiert' + feed_updated: 'RSS-Informationen aktualisiert' tagging_rules_updated: 'Tagging-Regeln aktualisiert' tagging_rules_deleted: 'Tagging-Regel gelöscht' - rss_token_updated: 'RSS-Token aktualisiert' - annotations_reset: 'Anmerkungen zurücksetzen' - tags_reset: 'Tags zurücksetzen' - entries_reset: 'Einträge zurücksetzen' - archived_reset: 'Archiverte Einträge zurücksetzen' + feed_token_updated: 'RSS-Token aktualisiert' + annotations_reset: Anmerkungen zurücksetzen + tags_reset: Tags zurücksetzen + entries_reset: Einträge zurücksetzen + archived_reset: Archiverte Einträge zurücksetzen entry: notice: entry_already_saved: 'Eintrag bereits am %date% gespeichert' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 45145c80..5b875652 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -54,7 +54,7 @@ config: page_title: 'Config' tab_menu: settings: 'Settings' - rss: 'RSS' + feed: 'Feeds' user_info: 'User information' password: 'Password' rules: 'Tagging rules' @@ -85,19 +85,19 @@ config: help_reading_speed: "wallabag calculates a reading time for each article. You can define here, thanks to this list, if you are a fast or a slow reader. wallabag will recalculate the reading time for each article." help_language: "You can change the language of wallabag interface." help_pocket_consumer_key: "Required for Pocket import. You can create it in your Pocket account." - form_rss: - description: 'RSS feeds provided by wallabag allow you to read your saved articles with your favourite RSS reader. You need to generate a token first.' - token_label: 'RSS token' + form_feed: + description: 'Atom feeds provided by wallabag allow you to read your saved articles with your favourite Atom reader. You need to generate a token first.' + token_label: 'Feed token' no_token: 'No token' token_create: 'Create your token' token_reset: 'Regenerate your token' - rss_links: 'RSS links' - rss_link: + feed_links: 'Feed links' + feed_link: unread: 'Unread' starred: 'Starred' archive: 'Archived' all: 'All' - rss_limit: 'Number of items in the feed' + feed_limit: 'Number of items in the feed' form_user: two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Name' @@ -372,7 +372,7 @@ quickstart: title: 'Configure the application' description: 'In order to have an application which suits you, have a look into the configuration of wallabag.' language: 'Change language and design' - rss: 'Enable RSS feeds' + feed: 'Enable feeds' tagging_rules: 'Write rules to automatically tag your articles' admin: title: 'Administration' @@ -589,10 +589,10 @@ flashes: password_updated: 'Password updated' password_not_updated_demo: "In demonstration mode, you can't change password for this user." user_updated: 'Information updated' - rss_updated: 'RSS information updated' + feed_updated: 'Feed information updated' tagging_rules_updated: 'Tagging rules updated' tagging_rules_deleted: 'Tagging rule deleted' - rss_token_updated: 'RSS token updated' + feed_token_updated: 'Feed token updated' annotations_reset: Annotations reset tags_reset: Tags reset entries_reset: Entries reset diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index c1047e55..562b4191 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -54,7 +54,7 @@ config: page_title: 'Configuración' tab_menu: settings: 'Configuración' - rss: 'RSS' + feed: 'RSS' user_info: 'Información de usuario' password: 'Contraseña' rules: 'Reglas de etiquetado automáticas' @@ -85,19 +85,19 @@ config: help_reading_speed: "wallabag calcula un tiempo de lectura para cada artículo. Puedes definir aquí, gracias a esta lista, si eres un lector rápido o lento. wallabag recalculará el tiempo de lectura para cada artículo." help_language: "Puedes cambiar el idioma de la interfaz de wallabag." help_pocket_consumer_key: "Requerido para la importación desde Pocket. Puedes crearla en tu cuenta de Pocket." - form_rss: + form_feed: description: 'Los feeds RSS de wallabag permiten leer los artículos guardados con su lector RSS favorito. Primero necesitas generar un token.' token_label: 'Token RSS' no_token: 'Sin token' token_create: 'Crear token' token_reset: 'Reiniciar token' - rss_links: 'URLs de feeds RSS' - rss_link: + feed_links: 'URLs de feeds RSS' + feed_link: unread: 'sin leer' starred: 'favoritos' archive: 'archivados' # all: 'All' - rss_limit: 'Límite de artículos en feed RSS' + feed_limit: 'Límite de artículos en feed RSS' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nombre' @@ -372,7 +372,7 @@ quickstart: title: 'Configure la aplicación' description: 'Para que la aplicación se ajuste a tus necesidades, echa un vistazo a la configuración de wallabag.' language: 'Cambie el idioma y el diseño' - rss: 'Activar los feeds RSS' + feed: 'Activar los feeds RSS' tagging_rules: 'Escribe reglas para etiquetar automáticamente tus artículos' admin: title: 'Administración' @@ -589,10 +589,10 @@ flashes: password_updated: 'Contraseña actualizada' password_not_updated_demo: "En el modo demo, no puede cambiar la contraseña del usuario." user_updated: 'Información actualizada' - rss_updated: 'Configuración RSS actualizada' + feed_updated: 'Configuración RSS actualizada' tagging_rules_updated: 'Regla de etiquetado actualizada' tagging_rules_deleted: 'Regla de etiquetado eliminada' - rss_token_updated: 'Token RSS actualizado' + feed_token_updated: 'Token RSS actualizado' annotations_reset: Anotaciones reiniciadas tags_reset: Etiquetas reiniciadas entries_reset: Artículos reiniciados diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index 3042de2e..f360e0d6 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -54,7 +54,7 @@ config: page_title: 'پیکربندی' tab_menu: settings: 'تنظیمات' - rss: 'آر-اس-اس' + feed: 'آر-اس-اس' user_info: 'اطلاعات کاربر' password: 'رمز' rules: 'برچسب‌گذاری خودکار' @@ -85,19 +85,19 @@ config: # help_reading_speed: "wallabag calculates a reading time for each article. You can define here, thanks to this list, if you are a fast or a slow reader. wallabag will recalculate the reading time for each article." # help_language: "You can change the language of wallabag interface." # help_pocket_consumer_key: "Required for Pocket import. You can create it in your Pocket account." - form_rss: + form_feed: description: 'با خوراک آر-اس-اس که wallabag در اختیارتان می‌گذارد، می‌توانید مقاله‌های ذخیره‌شده را در نرم‌افزار آر-اس-اس دلخواه خود بخوانید. برای این کار نخست باید یک کد بسازید.' token_label: 'کد آر-اس-اس' no_token: 'بدون کد' token_create: 'کد خود را بسازید' token_reset: 'بازنشانی کد' - rss_links: 'پیوند آر-اس-اس' - rss_link: + feed_links: 'پیوند آر-اس-اس' + feed_link: unread: 'خوانده‌نشده' starred: 'برگزیده' archive: 'بایگانی' # all: 'All' - rss_limit: 'محدودیت آر-اس-اس' + feed_limit: 'محدودیت آر-اس-اس' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'نام' @@ -372,7 +372,7 @@ quickstart: title: 'برنامه را تنظیم کنید' # description: 'In order to have an application which suits you, have a look into the configuration of wallabag.' language: 'زبان و نمای برنامه را تغییر دهید' - rss: 'خوراک آر-اس-اس را فعال کنید' + feed: 'خوراک آر-اس-اس را فعال کنید' tagging_rules: 'قانون‌های برچسب‌گذاری خودکار مقاله‌هایتان را تعریف کنید' admin: title: 'مدیریت' @@ -589,10 +589,10 @@ flashes: password_updated: 'رمز به‌روز شد' password_not_updated_demo: "در حالت نمایشی نمی‌توانید رمز کاربر را عوض کنید." user_updated: 'اطلاعات به‌روز شد' - rss_updated: 'اطلاعات آر-اس-اس به‌روز شد' + feed_updated: 'اطلاعات آر-اس-اس به‌روز شد' tagging_rules_updated: 'برچسب‌گذاری خودکار به‌روز شد' tagging_rules_deleted: 'قانون برچسب‌گذاری پاک شد' - rss_token_updated: 'کد آر-اس-اس به‌روز شد' + feed_token_updated: 'کد آر-اس-اس به‌روز شد' # annotations_reset: Annotations reset # tags_reset: Tags reset # entries_reset: Entries reset diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 57740ba2..79f15154 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -54,7 +54,7 @@ config: page_title: "Configuration" tab_menu: settings: "Paramètres" - rss: "RSS" + feed: "Flux" user_info: "Mon compte" password: "Mot de passe" rules: "Règles de tag automatiques" @@ -85,19 +85,19 @@ config: help_reading_speed: "wallabag calcule une durée de lecture pour chaque article. Vous pouvez définir ici, grâce à cette liste déroulante, si vous lisez plus ou moins vite. wallabag recalculera la durée de lecture de chaque article." help_language: "Vous pouvez définir la langue de l’interface de wallabag." help_pocket_consumer_key: "Nécessaire pour l’import depuis Pocket. Vous pouvez le créer depuis votre compte Pocket." - form_rss: - description: "Les flux RSS fournis par wallabag vous permettent de lire vos articles sauvegardés dans votre lecteur de flux préféré. Pour pouvoir les utiliser, vous devez d’abord créer un jeton." - token_label: "Jeton RSS" + form_feed: + description: "Les flux Atom fournis par wallabag vous permettent de lire vos articles sauvegardés dans votre lecteur de flux préféré. Pour pouvoir les utiliser, vous devez d’abord créer un jeton." + token_label: "Jeton de flux" no_token: "Aucun jeton généré" token_create: "Créez votre jeton" token_reset: "Réinitialisez votre jeton" - rss_links: "Adresses de vos flux RSS" - rss_link: + feed_links: "Adresses de vos flux" + feed_link: unread: "Non lus" starred: "Favoris" archive: "Lus" all: "Tous" - rss_limit: "Nombre d’articles dans le flux" + feed_limit: "Nombre d’articles dans le flux" form_user: two_factor_description: "Activer l’authentification double-facteur veut dire que vous allez recevoir un code par courriel OU que vous devriez utiliser une application de mot de passe à usage unique (comme Google Authenticator, Authy or FreeOTP) pour obtenir un code temporaire à chaque nouvelle connexion non approuvée. Vous ne pouvez pas choisir les deux options." name_label: "Nom" @@ -372,7 +372,7 @@ quickstart: title: "Configurez l’application" description: "Pour voir une application qui vous correspond, allez voir du côté de la configuration de wallabag." language: "Changez la langue et le design de l’application" - rss: "Activez les flux RSS" + feed: "Activez les flux Atom" tagging_rules: "Écrivez des règles pour classer automatiquement vos articles" admin: title: "Administration" @@ -590,10 +590,10 @@ flashes: password_updated: "Votre mot de passe a bien été mis à jour" password_not_updated_demo: "En démo, vous ne pouvez pas changer le mot de passe de cet utilisateur." user_updated: "Vos informations personnelles ont bien été mises à jour" - rss_updated: "La configuration des flux RSS a bien été mise à jour" + feed_updated: "La configuration des flux a bien été mise à jour" tagging_rules_updated: "Règles mises à jour" tagging_rules_deleted: "Règle supprimée" - rss_token_updated: "Jeton RSS mis à jour" + feed_token_updated: "Jeton des flux mis à jour" annotations_reset: "Annotations supprimées" tags_reset: "Tags supprimés" entries_reset: "Articles supprimés" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 274e5338..daef359f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -54,7 +54,7 @@ config: page_title: 'Configurazione' tab_menu: settings: 'Impostazioni' - rss: 'RSS' + feed: 'RSS' user_info: 'Informazioni utente' password: 'Password' rules: 'Regole di etichettatura' @@ -85,19 +85,19 @@ config: help_reading_speed: "wallabag calcola un tempo di lettura per ogni articolo. Puoi definire qui, grazie a questa lista, se sei un lettore lento o veloce. wallabag ricalcolerà la velocità di lettura per ogni articolo." help_language: "Puoi cambiare la lingua dell'interfaccia di wallabag." help_pocket_consumer_key: "Richiesta per importare da Pocket. La puoi creare nel tuo account Pocket." - form_rss: + form_feed: description: 'I feed RSS generati da wallabag ti permettono di leggere i tuoi contenuti salvati con il tuo lettore di RSS preferito. Prima, devi generare un token.' token_label: 'Token RSS' no_token: 'Nessun token' token_create: 'Crea il tuo token' token_reset: 'Rigenera il tuo token' - rss_links: 'Collegamenti RSS' - rss_link: + feed_links: 'Collegamenti RSS' + feed_link: unread: 'Non letti' starred: 'Preferiti' archive: 'Archiviati' # all: 'All' - rss_limit: 'Numero di elementi nel feed' + feed_limit: 'Numero di elementi nel feed' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nome' @@ -371,7 +371,7 @@ quickstart: title: "Configura l'applicazione" description: "Per avere un'applicazione che ti soddisfi, dai un'occhiata alla configurazione di wallabag." language: 'Cambia lingua e design' - rss: 'Abilita i feed RSS' + feed: 'Abilita i feed RSS' tagging_rules: 'Scrivi delle regole per taggare automaticamente i contenuti' admin: title: 'Amministrazione' @@ -588,10 +588,10 @@ flashes: password_updated: 'Password aggiornata' password_not_updated_demo: "In modalità demo, non puoi cambiare la password dell'utente." user_updated: 'Informazioni aggiornate' - rss_updated: 'Informazioni RSS aggiornate' + feed_updated: 'Informazioni RSS aggiornate' tagging_rules_updated: 'Regole di etichettatura aggiornate' tagging_rules_deleted: 'Regola di etichettatura eliminate' - rss_token_updated: 'RSS token aggiornato' + feed_token_updated: 'RSS token aggiornato' annotations_reset: Reset annotazioni tags_reset: Reset etichette entries_reset: Reset articoli diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 4e5370f9..980ddeb4 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -54,7 +54,7 @@ config: page_title: 'Configuracion' tab_menu: settings: 'Paramètres' - rss: 'RSS' + feed: 'RSS' user_info: 'Mon compte' password: 'Senhal' rules: "Règlas d'etiquetas automaticas" @@ -85,19 +85,19 @@ config: help_reading_speed: "wallabag calcula lo temps de lectura per cada article. Podètz lo definir aquí, gràcias a aquesta lista, se sètz un legeire rapid o lent. wallabag tornarà calcular lo temps de lectura per cada article." help_language: "Podètz cambiar la lenga de l'interfàcia de wallabag." help_pocket_consumer_key: "Requesida per l'importacion de Pocket. Podètz la crear dins vòstre compte Pocket." - form_rss: + form_feed: description: "Los fluxes RSS fornits per wallabag vos permeton de legir vòstres articles salvagardats dins vòstre lector de fluxes preferit. Per los poder emplegar, vos cal, d'en primièr crear un geton." token_label: 'Geton RSS' no_token: 'Pas cap de geton generat' token_create: 'Creatz vòstre geton' token_reset: 'Reïnicializatz vòstre geton' - rss_links: 'URLs de vòstres fluxes RSS' - rss_link: + feed_links: 'URLs de vòstres fluxes RSS' + feed_link: unread: 'Pas legits' starred: 'Favorits' archive: 'Legits' all: 'Totes' - rss_limit: "Nombre d'articles dins un flux RSS" + feed_limit: "Nombre d'articles dins un flux" form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nom' @@ -371,7 +371,7 @@ quickstart: title: "Configuratz l'aplicacion" description: "Per fin d'aver una aplicacion que vos va ben, anatz veire la configuracion de wallabag." language: "Cambiatz la lenga e l'estil de l'aplicacion" - rss: 'Activatz los fluxes RSS' + feed: 'Activatz los fluxes RSS' tagging_rules: 'Escrivètz de règlas per classar automaticament vòstres articles' admin: title: 'Administracion' @@ -588,10 +588,10 @@ flashes: password_updated: 'Vòstre senhal es ben estat mes a jorn' password_not_updated_demo: "En demostracion, podètz pas cambiar lo senhal d'aqueste utilizaire." user_updated: 'Vòstres informacions personnelas son ben estadas mesas a jorn' - rss_updated: 'La configuracion dels fluxes RSS es ben estada mesa a jorn' + feed_updated: 'La configuracion dels fluxes RSS es ben estada mesa a jorn' tagging_rules_updated: 'Règlas misa a jorn' tagging_rules_deleted: 'Règla suprimida' - rss_token_updated: 'Geton RSS mes a jorn' + feed_token_updated: 'Geton RSS mes a jorn' annotations_reset: Anotacions levadas tags_reset: Etiquetas levadas entries_reset: Articles levats diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index a7a4d6c3..3813ac37 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -54,7 +54,7 @@ config: page_title: 'Konfiguracja' tab_menu: settings: 'Ustawienia' - rss: 'Kanał RSS' + feed: 'Kanał RSS' user_info: 'Informacje o użytkowniku' password: 'Hasło' rules: 'Zasady tagowania' @@ -85,19 +85,19 @@ config: help_reading_speed: "wallabag oblicza czas czytania każdego artykułu. Dzięki tej liście możesz określić swoje tempo. Wallabag przeliczy ponownie czas potrzebny, na przeczytanie każdego z artykułów." help_language: "Możesz zmienić język interfejsu wallabag." help_pocket_consumer_key: "Wymagane dla importu z Pocket. Możesz go stworzyć na swoim koncie Pocket." - form_rss: + form_feed: description: 'Kanały RSS prowadzone przez wallabag pozwalają Ci na czytanie twoich zapisanych artykułów w twoim ulubionym czytniku RSS. Musisz najpierw wynegenerować tokena.‌' token_label: 'Token RSS' no_token: 'Brak tokena' token_create: 'Stwórz tokena' token_reset: 'Zresetuj swojego tokena' - rss_links: 'RSS links' - rss_link: + feed_links: 'RSS links' + feed_link: unread: 'Nieprzeczytane' starred: 'Oznaczone gwiazdką' archive: 'Archiwum' all: 'Wszystkie' - rss_limit: 'Link do RSS' + feed_limit: 'Link do RSS' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nazwa' @@ -371,7 +371,7 @@ quickstart: title: 'Konfiguruj aplikację' description: 'W celu dopasowania aplikacji do swoich upodobań, zobacz konfigurację aplikacji' language: 'Zmień język i wygląd' - rss: 'Włącz kanały RSS' + feed: 'Włącz kanały RSS' tagging_rules: 'Napisz reguły pozwalające na automatyczne otagowanie twoich artykułów' admin: title: 'Administracja' @@ -588,10 +588,10 @@ flashes: password_updated: 'Hasło zaktualizowane' password_not_updated_demo: "In demonstration mode, you can't change password for this user." user_updated: 'Informacje zaktualizowane' - rss_updated: 'Informacje RSS zaktualizowane' + feed_updated: 'Informacje RSS zaktualizowane' tagging_rules_updated: 'Reguły tagowania zaktualizowane' tagging_rules_deleted: 'Reguła tagowania usunięta' - rss_token_updated: 'Token kanału RSS zaktualizowany' + feed_token_updated: 'Token kanału RSS zaktualizowany' annotations_reset: Zresetuj adnotacje tags_reset: Zresetuj tagi entries_reset: Zresetuj wpisy diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index a5483a6d..96943c05 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -54,7 +54,7 @@ config: page_title: 'Config' tab_menu: settings: 'Configurações' - rss: 'RSS' + feed: 'RSS' user_info: 'Informação do Usuário' password: 'Senha' rules: 'Regras de tags' @@ -85,19 +85,19 @@ config: # help_reading_speed: "wallabag calculates a reading time for each article. You can define here, thanks to this list, if you are a fast or a slow reader. wallabag will recalculate the reading time for each article." # help_language: "You can change the language of wallabag interface." # help_pocket_consumer_key: "Required for Pocket import. You can create it in your Pocket account." - form_rss: + form_feed: description: 'Feeds RSS providos pelo wallabag permitem que você leia seus artigos salvos em seu leitor de RSS favorito. Você precisa gerar um token primeiro.' token_label: 'Token RSS' no_token: 'Nenhum Token' token_create: 'Criar seu token' token_reset: 'Gerar novamente seu token' - rss_links: 'Links RSS' - rss_link: + feed_links: 'Links RSS' + feed_link: unread: 'Não lido' starred: 'Destacado' archive: 'Arquivado' # all: 'All' - rss_limit: 'Número de itens no feed' + feed_limit: 'Número de itens no feed' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nome' @@ -371,7 +371,7 @@ quickstart: title: 'Configurar a aplicação' description: 'Para ter uma aplicação que atende você, dê uma olhada na configuração do wallabag.' language: 'Alterar idioma e design' - rss: 'Habilitar feeds RSS' + feed: 'Habilitar feeds RSS' tagging_rules: 'Escrever regras para acrescentar tags automaticamente em seus artigos' admin: title: 'Administração' @@ -588,10 +588,10 @@ flashes: password_updated: 'Senha atualizada' password_not_updated_demo: 'Em modo de demonstração, você não pode alterar a senha deste usuário.' # user_updated: 'Information updated' - rss_updated: 'Informação de RSS atualizada' + feed_updated: 'Informação de RSS atualizada' tagging_rules_updated: 'Regras de tags atualizadas' tagging_rules_deleted: 'Regra de tag apagada' - rss_token_updated: 'Token RSS atualizado' + feed_token_updated: 'Token RSS atualizado' # annotations_reset: Annotations reset # tags_reset: Tags reset # entries_reset: Entries reset diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index 3b7fbd69..0ce11e74 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -54,7 +54,7 @@ config: page_title: 'Configurație' tab_menu: settings: 'Setări' - rss: 'RSS' + feed: 'RSS' user_info: 'Informații despre utilizator' password: 'Parolă' # rules: 'Tagging rules' @@ -85,19 +85,19 @@ config: # help_reading_speed: "wallabag calculates a reading time for each article. You can define here, thanks to this list, if you are a fast or a slow reader. wallabag will recalculate the reading time for each article." # help_language: "You can change the language of wallabag interface." # help_pocket_consumer_key: "Required for Pocket import. You can create it in your Pocket account." - form_rss: + form_feed: description: 'Feed-urile RSS oferite de wallabag îți permit să-ți citești articolele salvate în reader-ul tău preferat RSS.' token_label: 'RSS-Token' no_token: 'Fără token' token_create: 'Crează-ți token' token_reset: 'Resetează-ți token-ul' - rss_links: 'Link-uri RSS' - rss_link: + feed_links: 'Link-uri RSS' + feed_link: unread: 'Unread' starred: 'Starred' archive: 'Archived' # all: 'All' - rss_limit: 'Limită RSS' + feed_limit: 'Limită RSS' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Nume' @@ -371,7 +371,7 @@ quickstart: # title: 'Configure the application' # description: 'In order to have an application which suits you, have a look into the configuration of wallabag.' # language: 'Change language and design' - # rss: 'Enable RSS feeds' + # feed: 'Enable RSS feeds' # tagging_rules: 'Write rules to automatically tag your articles' # admin: # title: 'Administration' @@ -588,10 +588,10 @@ flashes: password_updated: 'Parolă actualizată' password_not_updated_demo: "In demonstration mode, you can't change password for this user." user_updated: 'Informație actualizată' - rss_updated: 'Informație RSS actualizată' + feed_updated: 'Informație RSS actualizată' # tagging_rules_updated: 'Tagging rules updated' # tagging_rules_deleted: 'Tagging rule deleted' - # rss_token_updated: 'RSS token updated' + # feed_token_updated: 'RSS token updated' # annotations_reset: Annotations reset # tags_reset: Tags reset # entries_reset: Entries reset diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 3b8a0d59..2f86f25d 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -54,7 +54,7 @@ config: page_title: 'Yapılandırma' tab_menu: settings: 'Ayarlar' - rss: 'RSS' + feed: 'RSS' user_info: 'Kullanıcı bilgileri' password: 'Şifre' rules: 'Etiketleme kuralları' @@ -85,19 +85,19 @@ config: # help_reading_speed: "wallabag calculates a reading time for each article. You can define here, thanks to this list, if you are a fast or a slow reader. wallabag will recalculate the reading time for each article." # help_language: "You can change the language of wallabag interface." # help_pocket_consumer_key: "Required for Pocket import. You can create it in your Pocket account." - form_rss: + form_feed: description: 'wallabag RSS akışı kaydetmiş olduğunuz makalelerini favori RSS okuyucunuzda görüntülemenizi sağlar. Bunu yapabilmek için öncelikle belirteç (token) oluşturmalısınız.' token_label: 'RSS belirteci (token)' no_token: 'Belirteç (token) yok' token_create: 'Yeni belirteç (token) oluştur' token_reset: 'Belirteci (token) sıfırla' - rss_links: 'RSS akış bağlantıları' - rss_link: + feed_links: 'RSS akış bağlantıları' + feed_link: unread: 'Okunmayan' starred: 'Favoriler' archive: 'Arşiv' # all: 'All' - rss_limit: 'RSS içeriğinden talep edilecek makale limiti' + feed_limit: 'RSS içeriğinden talep edilecek makale limiti' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'İsim' @@ -369,7 +369,7 @@ quickstart: title: 'Uygulamayı Yapılandırma' # description: 'In order to have an application which suits you, have a look into the configuration of wallabag.' language: 'Dili ve tasarımı değiştirme' - rss: 'RSS akışını aktifleştirme' + feed: 'RSS akışını aktifleştirme' # tagging_rules: 'Write rules to automatically tag your articles' admin: # title: 'Administration' @@ -566,10 +566,10 @@ flashes: password_updated: 'Şifre güncellendi' password_not_updated_demo: "In demonstration mode, you can't change password for this user." user_updated: 'Bilgiler güncellendi' - rss_updated: 'RSS bilgiler güncellendi' + feed_updated: 'RSS bilgiler güncellendi' tagging_rules_updated: 'Tagging rules updated' tagging_rules_deleted: 'Tagging rule deleted' - rss_token_updated: 'RSS token updated' + feed_token_updated: 'RSS token updated' # annotations_reset: Annotations reset # tags_reset: Tags reset # entries_reset: Entries reset diff --git a/src/Wallabag/CoreBundle/Resources/translations/validators.da.yml b/src/Wallabag/CoreBundle/Resources/translations/validators.da.yml index c6a84209..c0438978 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/validators.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/validators.da.yml @@ -3,5 +3,5 @@ validator: password_too_short: 'Adgangskoden skal være mindst 8 tegn' # password_wrong_value: 'Wrong value for your current password' # item_per_page_too_high: 'This will certainly kill the app' - # rss_limit_too_high: 'This will certainly kill the app' + # feed_limit_too_high: 'This will certainly kill the app' # quote_length_too_high: 'The quote is too long. It should have {{ limit }} characters or less.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/validators.de.yml b/src/Wallabag/CoreBundle/Resources/translations/validators.de.yml index 907b67a5..4c675ef4 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/validators.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/validators.de.yml @@ -3,6 +3,5 @@ validator: password_too_short: 'Kennwort-Mindestlänge von acht Zeichen nicht erfüllt' password_wrong_value: 'Falscher Wert für dein aktuelles Kennwort' item_per_page_too_high: 'Dies wird die Anwendung möglicherweise beenden' - rss_limit_too_high: 'Dies wird die Anwendung möglicherweise beenden' + feed_limit_too_high: 'Dies wird die Anwendung möglicherweise beenden' quote_length_too_high: 'Das Zitat ist zu lang. Es sollte nicht mehr als {{ limit }} Zeichen enthalten.' - diff --git a/src/Wallabag/CoreBundle/Resources/translations/validators.en.yml b/src/Wallabag/CoreBundle/Resources/translations/validators.en.yml index 8cc117fe..89d4c68a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/validators.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/validators.en.yml @@ -3,5 +3,5 @@ validator: password_too_short: 'Password should by at least 8 chars long' password_wrong_value: 'Wrong value for your current password' item_per_page_too_high: 'This will certainly kill the app' - rss_limit_too_high: 'This will certainly kill the app' + feed_limit_too_high: 'This will certainly kill the app' quote_length_too_high: 'The quote is too long. It should have {{ limit }} characters or less.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/validators.es.yml b/src/Wallabag/CoreBundle/Resources/translations/validators.es.yml index 97a8edfa..ba34ee76 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/validators.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/validators.es.yml @@ -3,5 +3,5 @@ validator: password_too_short: 'La contraseña debe tener al menos 8 carácteres' password_wrong_value: 'Entrada equivocada para su contraseña actual' item_per_page_too_high: 'Esto matará la aplicación' - rss_limit_too_high: 'Esto matará la aplicación' + feed_limit_too_high: 'Esto matará la aplicación' # quote_length_too_high: 'The quote is too long. It should have {{ limit }} characters or less.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/validators.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/validators.fa.yml index ef677525..9b1a4af2 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/validators.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/validators.fa.yml @@ -3,5 +3,5 @@ validator: password_too_short: 'رمز شما باید ۸ حرف یا بیشتر باشد' password_wrong_value: 'رمز فعلی را اشتباه وارد کرده‌اید' item_per_page_too_high: 'با این تعداد برنامه به فنا می‌رود' - rss_limit_too_high: 'با این تعداد برنامه به فنا می‌رود' + feed_limit_too_high: 'با این تعداد برنامه به فنا می‌رود' # quote_length_too_high: 'The quote is too long. It should have {{ limit }} characters or less.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/validators.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/validators.fr.yml index f31b4ed2..92f69aa0 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/validators.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/validators.fr.yml @@ -3,5 +3,5 @@ validator: password_too_short: "Le mot de passe doit contenir au moins 8 caractères" password_wrong_value: "Votre mot de passe actuel est faux" item_per_page_too_high: "Ça ne va pas plaire à l’application" - rss_limit_too_high: "Ça ne va pas plaire à l’application" + feed_limit_too_high: "Ça ne va pas plaire à l’application" quote_length_too_high: "La citation est trop longue. Elle doit avoir au maximum {{ limit }} caractères." diff --git a/src/Wallabag/CoreBundle/Resources/translations/validators.it.yml b/src/Wallabag/CoreBundle/Resources/translations/validators.it.yml index d949cc3b..b20d6f51 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/validators.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/validators.it.yml @@ -3,5 +3,5 @@ validator: password_too_short: 'La password deve essere lunga almeno 8 caratteri' password_wrong_value: 'Valore inserito per la password corrente errato' item_per_page_too_high: 'Questo valore è troppo alto' - rss_limit_too_high: 'Questo valore è troppo alto' + feed_limit_too_high: 'Questo valore è troppo alto' # quote_length_too_high: 'The quote is too long. It should have {{ limit }} characters or less.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/validators.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/validators.oc.yml index 87f00f10..cb57844f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/validators.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/validators.oc.yml @@ -3,5 +3,5 @@ validator: password_too_short: 'Lo senhal deu aver almens 8 caractèrs' password_wrong_value: 'Vòstre senhal actual es pas bon' item_per_page_too_high: "Aquò li agradarà pas a l'aplicacion" - rss_limit_too_high: "Aquò li agradarà pas a l'aplicacion" + feed_limit_too_high: "Aquò li agradarà pas a l'aplicacion" quote_length_too_high: 'Aquesta citacion es tròpa longa. Cal que faga {{ limit }} caractèrs o mens.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/validators.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/validators.pl.yml index e4165c14..94757cc5 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/validators.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/validators.pl.yml @@ -3,5 +3,5 @@ validator: password_too_short: 'Hasło powinno mieć minimum 8 znaków długości' password_wrong_value: 'Twoje obecne hasło jest błędne' item_per_page_too_high: 'To może spowodować problemy z aplikacją' - rss_limit_too_high: 'To może spowodować problemy z aplikacją' + feed_limit_too_high: 'To może spowodować problemy z aplikacją' quote_length_too_high: 'Cytat jest zbyt długi. powinien mieć {{ limit }} znaków lub mniej.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/validators.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/validators.pt.yml index a8c1f9de..df2f3f35 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/validators.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/validators.pt.yml @@ -3,5 +3,5 @@ validator: password_too_short: 'A senha deve ter pelo menos 8 caracteres' password_wrong_value: 'A senha atual informada está errada' item_per_page_too_high: 'Certamente isso pode matar a aplicação' - rss_limit_too_high: 'Certamente isso pode matar a aplicação' + feed_limit_too_high: 'Certamente isso pode matar a aplicação' # quote_length_too_high: 'The quote is too long. It should have {{ limit }} characters or less.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/validators.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/validators.ro.yml index 6840cf11..e5c8a72f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/validators.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/validators.ro.yml @@ -3,5 +3,5 @@ validator: password_too_short: 'Parola ar trebui să conțină cel puțin 8 caractere' # password_wrong_value: 'Wrong value for your current password' # item_per_page_too_high: 'This will certainly kill the app' - # rss_limit_too_high: 'This will certainly kill the app' + # feed_limit_too_high: 'This will certainly kill the app' # quote_length_too_high: 'The quote is too long. It should have {{ limit }} characters or less.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/validators.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/validators.tr.yml index e1e7317f..881ffd3b 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/validators.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/validators.tr.yml @@ -3,5 +3,5 @@ validator: # password_too_short: 'Password should by at least 8 chars long' # password_wrong_value: 'Wrong value for your current password' # item_per_page_too_high: 'This will certainly kill the app' - # rss_limit_too_high: 'This will certainly kill the app' + # feed_limit_too_high: 'This will certainly kill the app' # quote_length_too_high: 'The quote is too long. It should have {{ limit }} characters or less.' 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 93f8ddf8..4ef6ab3c 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 @@ -94,43 +94,43 @@ {{ form_rest(form.config) }} -

      {{ 'config.tab_menu.rss'|trans }}

      +

      {{ 'config.tab_menu.feed'|trans }}

      - {{ form_start(form.rss) }} - {{ form_errors(form.rss) }} + {{ form_start(form.feed) }} + {{ form_errors(form.feed) }}
      - {{ 'config.form_rss.description'|trans }} + {{ 'config.form_feed.description'|trans }}
      - - {% if rss.token %} - {{ rss.token }} + + {% if feed.token %} + {{ feed.token }} {% else %} - {{ 'config.form_rss.no_token'|trans }} + {{ 'config.form_feed.no_token'|trans }} {% endif %} – - {% if rss.token %} - {{ 'config.form_rss.token_reset'|trans }} + {% if feed.token %} + {{ 'config.form_feed.token_reset'|trans }} {% else %} - {{ 'config.form_rss.token_create'|trans }} + {{ 'config.form_feed.token_create'|trans }} {% endif %}
      - {% if rss.token %} + {% if feed.token %}
      @@ -138,13 +138,13 @@
      - {{ form_label(form.rss.rss_limit) }} - {{ form_errors(form.rss.rss_limit) }} - {{ form_widget(form.rss.rss_limit) }} + {{ form_label(form.feed.feed_limit) }} + {{ form_errors(form.feed.feed_limit) }} + {{ form_widget(form.feed.feed_limit) }}
      - {{ form_rest(form.rss) }} + {{ form_rest(form.feed) }}

      {{ 'config.tab_menu.user_info'|trans }}

      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 fb296c9d..6c5d2601 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 @@ -2,8 +2,8 @@ {% block head %} {{ parent() }} - {% if tag is defined and app.user.config.rssToken %} - + {% if tag is defined and app.user.config.feedToken %} + {% endif %} {% endblock %} @@ -28,8 +28,8 @@
      {{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}
    • {% endfor %} diff --git a/src/Wallabag/CoreBundle/Tools/Utils.php b/src/Wallabag/CoreBundle/Tools/Utils.php index e56e251e..b7ad7966 100644 --- a/src/Wallabag/CoreBundle/Tools/Utils.php +++ b/src/Wallabag/CoreBundle/Tools/Utils.php @@ -5,7 +5,7 @@ namespace Wallabag\CoreBundle\Tools; class Utils { /** - * Generate a token used for RSS. + * Generate a token used for Feeds. * * @param int $length Length of the token * diff --git a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php index 00b1e595..61107ce7 100644 --- a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php +++ b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php @@ -28,6 +28,7 @@ class WallabagExtension extends \Twig_Extension implements \Twig_Extension_Globa { return [ new \Twig_SimpleFilter('removeWww', [$this, 'removeWww']), + new \Twig_SimpleFilter('removeScheme', [$this, 'removeScheme']), new \Twig_SimpleFilter('removeSchemeAndWww', [$this, 'removeSchemeAndWww']), ]; } @@ -46,11 +47,14 @@ class WallabagExtension extends \Twig_Extension implements \Twig_Extension_Globa return preg_replace('/^www\./i', '', $url); } + public function removeScheme($url) + { + return preg_replace('#^https?://#i', '', $url); + } + public function removeSchemeAndWww($url) { - return $this->removeWww( - preg_replace('@^https?://@i', '', $url) - ); + return $this->removeWww($this->removeScheme($url) } /** diff --git a/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php b/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php index 5cabfd35..81954213 100644 --- a/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php +++ b/src/Wallabag/UserBundle/EventListener/CreateConfigListener.php @@ -18,19 +18,19 @@ class CreateConfigListener implements EventSubscriberInterface private $em; private $theme; private $itemsOnPage; - private $rssLimit; + private $feedLimit; private $language; private $readingSpeed; private $actionMarkAsRead; private $listMode; private $session; - public function __construct(EntityManager $em, $theme, $itemsOnPage, $rssLimit, $language, $readingSpeed, $actionMarkAsRead, $listMode, Session $session) + public function __construct(EntityManager $em, $theme, $itemsOnPage, $feedLimit, $language, $readingSpeed, $actionMarkAsRead, $listMode, Session $session) { $this->em = $em; $this->theme = $theme; $this->itemsOnPage = $itemsOnPage; - $this->rssLimit = $rssLimit; + $this->feedLimit = $feedLimit; $this->language = $language; $this->readingSpeed = $readingSpeed; $this->actionMarkAsRead = $actionMarkAsRead; @@ -54,7 +54,7 @@ class CreateConfigListener implements EventSubscriberInterface $config = new Config($event->getUser()); $config->setTheme($this->theme); $config->setItemsPerPage($this->itemsOnPage); - $config->setRssLimit($this->rssLimit); + $config->setFeedLimit($this->feedLimit); $config->setLanguage($this->session->get('_locale', $this->language)); $config->setReadingSpeed($this->readingSpeed); $config->setActionMarkAsRead($this->actionMarkAsRead); diff --git a/src/Wallabag/UserBundle/Repository/UserRepository.php b/src/Wallabag/UserBundle/Repository/UserRepository.php index be693d3b..80391109 100644 --- a/src/Wallabag/UserBundle/Repository/UserRepository.php +++ b/src/Wallabag/UserBundle/Repository/UserRepository.php @@ -9,18 +9,18 @@ use Wallabag\UserBundle\Entity\User; class UserRepository extends EntityRepository { /** - * Find a user by its username and rss roken. + * Find a user by its username and Feed token. * * @param string $username - * @param string $rssToken + * @param string $feedToken * - * @return User|null + * @return null|User */ - public function findOneByUsernameAndRsstoken($username, $rssToken) + public function findOneByUsernameAndFeedtoken($username, $feedToken) { return $this->createQueryBuilder('u') ->leftJoin('u.config', 'c') - ->where('c.rssToken = :rss_token')->setParameter('rss_token', $rssToken) + ->where('c.feedToken = :feed_token')->setParameter('feed_token', $feedToken) ->andWhere('u.username = :username')->setParameter('username', $username) ->getQuery() ->getOneOrNullResult(); diff --git a/src/Wallabag/UserBundle/Resources/config/services.yml b/src/Wallabag/UserBundle/Resources/config/services.yml index 72cda3f8..2dcf3011 100644 --- a/src/Wallabag/UserBundle/Resources/config/services.yml +++ b/src/Wallabag/UserBundle/Resources/config/services.yml @@ -28,7 +28,7 @@ services: - "@doctrine.orm.entity_manager" - "%wallabag_core.theme%" - "%wallabag_core.items_on_page%" - - "%wallabag_core.rss_limit%" + - "%wallabag_core.feed_limit%" - "%wallabag_core.language%" - "%wallabag_core.reading_speed%" - "%wallabag_core.action_mark_as_read%" -- cgit v1.2.3 From f277bc042c8e805aab14b31b5b51e2878d80c6f4 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 25 Apr 2019 14:12:56 +0200 Subject: Fix tests & cs & migration --- src/Wallabag/CoreBundle/Command/InstallCommand.php | 2 +- .../CoreBundle/Controller/FeedController.php | 27 +++++++++++----------- src/Wallabag/CoreBundle/Entity/Config.php | 4 ++-- .../Resources/translations/messages.ru.yml | 16 ++++++------- .../Resources/translations/messages.th.yml | 16 ++++++------- .../views/themes/baggy/Tag/tags.html.twig | 2 +- .../views/themes/material/Tag/tags.html.twig | 2 +- src/Wallabag/CoreBundle/Twig/WallabagExtension.php | 2 +- .../UserBundle/Repository/UserRepository.php | 2 +- 9 files changed, 36 insertions(+), 37 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 49c84178..c58ae2b5 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -254,7 +254,7 @@ class InstallCommand extends ContainerAwareCommand $question->setHidden(true); $user->setPlainPassword($this->io->askQuestion($question)); - $user->setEmail($this->io->ask('Email', '')); + $user->setEmail($this->io->ask('Email', 'wallabag@wallabag.io')); $user->setEnabled(true); $user->addRole('ROLE_SUPER_ADMIN'); diff --git a/src/Wallabag/CoreBundle/Controller/FeedController.php b/src/Wallabag/CoreBundle/Controller/FeedController.php index 9d55a9b7..8d422a90 100644 --- a/src/Wallabag/CoreBundle/Controller/FeedController.php +++ b/src/Wallabag/CoreBundle/Controller/FeedController.php @@ -8,7 +8,6 @@ use Pagerfanta\Exception\OutOfRangeCurrentPageException; use Pagerfanta\Pagerfanta; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Symfony\Bundle\FrameworkBundle\Controller\Controller; -use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; @@ -20,8 +19,8 @@ class FeedController extends Controller /** * Shows unread entries for current user. * - * @Route("/feed/{username}/{token}/unread/{page}", name="unread_feed", defaults={"page": 1}) - * @Route("/{username}/{token}/unread.xml", defaults={"page": 1}) + * @Route("/feed/{username}/{token}/unread/{page}", name="unread_feed", defaults={"page"=1, "_format"="xml"}) + * * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_feed_token_converter") * * @param User $user @@ -37,8 +36,8 @@ class FeedController extends Controller /** * Shows read entries for current user. * - * @Route("/feed/{username}/{token}/archive/{page}", name="archive_feed", defaults={"page": 1}) - * @Route("/{username}/{token}/archive.xml", defaults={"page": 1}) + * @Route("/feed/{username}/{token}/archive/{page}", name="archive_feed", defaults={"page"=1, "_format"="xml"}) + * * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_feed_token_converter") * * @param User $user @@ -54,8 +53,8 @@ class FeedController extends Controller /** * Shows starred entries for current user. * - * @Route("/feed/{username}/{token}/starred/{page}", name="starred_feed", defaults={"page": 1}) - * @Route("/{username}/{token}/starred.xml", defaults={"page": 1}) + * @Route("/feed/{username}/{token}/starred/{page}", name="starred_feed", defaults={"page"=1, "_format"="xml"}) + * * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_feed_token_converter") * * @param User $user @@ -71,29 +70,29 @@ class FeedController extends Controller /** * Shows all entries for current user. * - * @Route("/{username}/{token}/all.xml", name="all_feed", defaults={"_format"="xml"}) + * @Route("/feed/{username}/{token}/all/{page}", name="all_feed", defaults={"page"=1, "_format"="xml"}) + * * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_feed_token_converter") * * @return \Symfony\Component\HttpFoundation\Response */ - public function showAllFeedAction(Request $request, User $user) + public function showAllFeedAction(User $user, $page) { - return $this->showEntries('all', $user, $request->query->get('page', 1)); + return $this->showEntries('all', $user, $page); } /** * Shows entries associated to a tag for current user. * - * @Route("/{username}/{token}/tags/{slug}.xml", name="tag_feed", defaults={"_format"="xml"}) + * @Route("/feed/{username}/{token}/tags/{slug}/{page}", name="tag_feed", defaults={"page"=1, "_format"="xml"}) + * * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_feed_token_converter") * @ParamConverter("tag", options={"mapping": {"slug": "slug"}}) * * @return \Symfony\Component\HttpFoundation\Response */ - public function showTagsFeedAction(Request $request, User $user, Tag $tag) + public function showTagsFeedAction(User $user, Tag $tag, $page) { - $page = $request->query->get('page', 1); - $url = $this->generateUrl( 'tag_feed', [ diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php index 7458f757..c6e65d66 100644 --- a/src/Wallabag/CoreBundle/Entity/Config.php +++ b/src/Wallabag/CoreBundle/Entity/Config.php @@ -60,14 +60,14 @@ class Config /** * @var string * - * @ORM\Column(name="rss_token", type="string", nullable=true) + * @ORM\Column(name="feed_token", type="string", nullable=true) */ private $feedToken; /** * @var int * - * @ORM\Column(name="rss_limit", type="integer", nullable=true) + * @ORM\Column(name="feed_limit", type="integer", nullable=true) * @Assert\Range( * min = 1, * max = 100000, diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index 92746631..2ee2d83a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -53,7 +53,7 @@ config: page_title: 'Настройки' tab_menu: settings: 'Настройки' - rss: 'RSS' + feed: 'RSS' user_info: 'Информация о пользователе' password: 'Пароль' rules: 'Правила настройки простановки тегов' @@ -83,18 +83,18 @@ config: help_reading_speed: "wallabag посчитает сколько времени занимает чтение каждой записи. Вы можете определить здесь, как быстро вы читаете. wallabag пересчитает время чтения для каждой записи." help_language: "Вы можете изменить язык интерфейса wallabag." help_pocket_consumer_key: "Обязательно для импорта из Pocket. Вы можете создать это в Вашем аккаунте на Pocket." - form_rss: + form_feed: description: 'RSS фид созданный с помощью wallabag позволяет читать Ваши записи через Ваш любимый RSS агрегатор. Для начала Вам потребуется создать ключ.' token_label: 'RSS ключ' no_token: 'Ключ не задан' token_create: 'Создать ключ' token_reset: 'Пересоздать ключ' - rss_links: 'ссылка на RSS' - rss_link: + feed_links: 'ссылка на RSS' + feed_link: unread: 'непрочитанные' starred: 'помеченные' archive: 'архивные' - rss_limit: 'Количество записей в фиде' + feed_limit: 'Количество записей в фиде' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'Имя' @@ -359,7 +359,7 @@ quickstart: title: 'Настроить приложение' description: 'Чтобы иметь приложение, которое вам подходит, ознакомьтесь с конфигурацией wallabag.' language: 'Выбрать язык и дизайн' - rss: 'Включить RSS фид' + feed: 'Включить RSS фид' tagging_rules: 'Создать правило для автоматической установки тегов' admin: title: 'Администрирование' @@ -554,10 +554,10 @@ flashes: password_updated: 'Пароль обновлен' password_not_updated_demo: "В режиме демонстрации нельзя изменять пароль для этого пользователя." user_updated: 'Информация обновлена' - rss_updated: 'RSS информация обновлена' + feed_updated: 'RSS информация обновлена' tagging_rules_updated: 'Правила тегировния обновлены' tagging_rules_deleted: 'Правила тегировния удалены' - rss_token_updated: 'RSS ключ обновлен' + feed_token_updated: 'RSS ключ обновлен' annotations_reset: "Аннотации сброшены" tags_reset: "Теги сброшены" entries_reset: "Записи сброшены" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index 1fe4fa0e..e04eee68 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -54,7 +54,7 @@ config: page_title: 'กำหนดค่า' tab_menu: settings: 'ตั้งค่า' - rss: 'RSS' + feed: 'RSS' user_info: 'ข้อมูลผู้ใช้' password: 'รหัสผ่าน' rules: 'การแท็กข้อบังคับ' @@ -85,19 +85,19 @@ config: help_reading_speed: "wallabag จะคำนวณเวลาการอ่านในแต่ละรายการซึ่งคุณสามารถกำหนดได้ที่นี้,ต้องขอบคุณรายการนี้,หากคุณเป็นนักอ่านที่เร็วหรือช้า wallabag จะทำการคำนวณเวลาที่อ่านใหม่ในแต่ละรายการ" help_language: "คุณสามารถเปลี่ยภาษาของ wallabag interface ได้" help_pocket_consumer_key: "การ้องขอการเก็บการนำข้อมูลเข้า คุณสามารถสร้างบัญชีการเก็บของคุณ" - form_rss: + form_feed: description: 'RSS จะเก็บเงื่อนไขโดย wallabag ต้องยอมรับการอ่านรายการของคุณกับผู้อ่านที่ชอบ RSS คุณต้องทำเครื่องหมายก่อน' token_label: 'เครื่องหมาย RSS' no_token: 'ไม่มีเครื่องหมาย' token_create: 'สร้างเครื่องหมาย' token_reset: 'ทำเครื่องหมาย' - rss_links: 'ลิงค์ RSS' - rss_link: + feed_links: 'ลิงค์ RSS' + feed_link: unread: 'ยังไมได้่อ่าน' starred: 'ทำการแสดง' archive: 'เอกสาร' all: 'ทั้งหมด' - rss_limit: 'จำนวนไอเทมที่เก็บ' + feed_limit: 'จำนวนไอเทมที่เก็บ' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." name_label: 'ชื่อ' @@ -369,7 +369,7 @@ quickstart: title: 'กำหนดค่าแอพพลิเคชั่น' description: 'ภายใน order จะมี application suit ของคุณ, จะมองหาองค์ประกอบของ wallabag' language: 'เปลี่ยนภาษาและออกแบบ' - rss: 'เปิดใช้ RSS' + feed: 'เปิดใช้ RSS' tagging_rules: 'เขียนข้อบังคับการแท็กอัตโนมัติของบทความของคุณ' admin: title: 'ผู้ดูแลระบบ' @@ -586,10 +586,10 @@ flashes: password_updated: 'อัปเดตรหัสผ่าน' password_not_updated_demo: "In demonstration mode, you can't change password for this user." user_updated: 'อัปเดตข้อมูล' - rss_updated: 'อัปเดตข้อมูล RSS' + feed_updated: 'อัปเดตข้อมูล RSS' tagging_rules_updated: 'อัปเดตการแท็กข้อบังคับ' tagging_rules_deleted: 'การลบข้อบังคับของแท็ก' - rss_token_updated: 'อัปเดตเครื่องหมาย RSS ' + feed_token_updated: 'อัปเดตเครื่องหมาย RSS ' annotations_reset: รีเซ็ตหมายเหตุ tags_reset: รีเซ็ตแท็ก entries_reset: รีเซ็ตรายการ diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig index 142668c0..ae8403bd 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig @@ -21,7 +21,7 @@ mode_edit {% endif %} - {% if app.user.config.rssToken %} + {% if app.user.config.feedToken %} rss_feed diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig index 737ef5fe..79907bbb 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig @@ -25,7 +25,7 @@ mode_edit {% endif %} - {% if app.user.config.rssToken %} + {% if app.user.config.feedToken %} rss_feed {% endif %} diff --git a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php index 61107ce7..536185d4 100644 --- a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php +++ b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php @@ -54,7 +54,7 @@ class WallabagExtension extends \Twig_Extension implements \Twig_Extension_Globa public function removeSchemeAndWww($url) { - return $this->removeWww($this->removeScheme($url) + return $this->removeWww($this->removeScheme($url)); } /** diff --git a/src/Wallabag/UserBundle/Repository/UserRepository.php b/src/Wallabag/UserBundle/Repository/UserRepository.php index 80391109..4abd55f1 100644 --- a/src/Wallabag/UserBundle/Repository/UserRepository.php +++ b/src/Wallabag/UserBundle/Repository/UserRepository.php @@ -14,7 +14,7 @@ class UserRepository extends EntityRepository * @param string $username * @param string $feedToken * - * @return null|User + * @return User|null */ public function findOneByUsernameAndFeedtoken($username, $feedToken) { -- cgit v1.2.3 From 4b5b228650cd109db7b21fd754581416e7f7d97e Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sat, 27 Apr 2019 22:48:28 +0200 Subject: material: add metadata to list view Add reading time and creation date to rows of list view. Refactor styles using a sass mixin. Fixes #3838 Signed-off-by: Kevin Decherf --- .../Resources/views/themes/material/Entry/Card/_content.html.twig | 5 ++++- .../Resources/views/themes/material/Entry/_card_list.html.twig | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/Card/_content.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/Card/_content.html.twig index 1f3cd1a7..1102a0bd 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/Card/_content.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/Card/_content.html.twig @@ -8,8 +8,11 @@
      {{ entry.domainName|removeWww }} - {% if withTags is defined %} + {% if withMetadata is defined %} {% include "@WallabagCore/themes/material/Entry/_tags.html.twig" with {'tags': entry.tags | slice(0, 3), 'entryId': entry.id, 'listClass': ' hide-on-med-and-down'} only %} +
      +
      {% include "@WallabagCore/themes/material/Entry/_reading_time.html.twig" with {'entry': entry} only %}
      +
      {% endif %}
    diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig index 1c00f2fa..6a095035 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig @@ -5,7 +5,7 @@ - {% include "@WallabagCore/themes/material/Entry/Card/_content.html.twig" with {'entry': entry, 'withTags': true, 'subClass': 'metadata'} only %} + {% include "@WallabagCore/themes/material/Entry/Card/_content.html.twig" with {'entry': entry, 'withMetadata': true, 'subClass': 'metadata'} only %}
    • {% if entry.isArchived == 0 %}done{% else %}unarchive{% endif %} -- cgit v1.2.3 From 9306c2a368cc7c7da577b6199440f4abc907af7d Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 10 May 2019 15:32:29 +0200 Subject: Use Imagick to keep GIF animation If Imagick is available, GIF will be saved using it to keep animation. Otherwise the previous method will be used and the animation won't be kept. --- src/Wallabag/CoreBundle/Helper/DownloadImages.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/DownloadImages.php b/src/Wallabag/CoreBundle/Helper/DownloadImages.php index cc3dcfce..bc2afc64 100644 --- a/src/Wallabag/CoreBundle/Helper/DownloadImages.php +++ b/src/Wallabag/CoreBundle/Helper/DownloadImages.php @@ -135,7 +135,16 @@ class DownloadImages switch ($ext) { case 'gif': - imagegif($im, $localPath); + // use Imagick if available to keep GIF animation + if (class_exists('\\Imagick')) { + $imagick = new \Imagick(); + $imagick->readImageBlob($res->getBody()); + $imagick->setImageFormat('gif'); + $imagick->writeImages($localPath, true); + } else { + imagegif($im, $localPath); + } + $this->logger->debug('DownloadImages: Re-creating gif'); break; case 'jpeg': -- cgit v1.2.3 From 844fd9fafc577faa8d6c8faa4e37b915be2389d9 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 10 May 2019 16:52:01 +0200 Subject: Fallback to default solution if Imagick fails --- src/Wallabag/CoreBundle/Helper/DownloadImages.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/DownloadImages.php b/src/Wallabag/CoreBundle/Helper/DownloadImages.php index bc2afc64..9a7e9828 100644 --- a/src/Wallabag/CoreBundle/Helper/DownloadImages.php +++ b/src/Wallabag/CoreBundle/Helper/DownloadImages.php @@ -137,10 +137,15 @@ class DownloadImages case 'gif': // use Imagick if available to keep GIF animation if (class_exists('\\Imagick')) { - $imagick = new \Imagick(); - $imagick->readImageBlob($res->getBody()); - $imagick->setImageFormat('gif'); - $imagick->writeImages($localPath, true); + try { + $imagick = new \Imagick(); + $imagick->readImageBlob($res->getBody()); + $imagick->setImageFormat('gif'); + $imagick->writeImages($localPath, true); + } catch (\Exception $e) { + // if Imagick fail, fallback to the default solution + imagegif($im, $localPath); + } } else { imagegif($im, $localPath); } -- cgit v1.2.3 From 637f0df9760b50b56c8ffb200719907032fdd885 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 10 May 2019 16:49:19 +0200 Subject: Cascade delete on oauth2 table when deleting a user --- src/Wallabag/ApiBundle/Entity/AccessToken.php | 1 + src/Wallabag/ApiBundle/Entity/AuthCode.php | 1 + src/Wallabag/ApiBundle/Entity/RefreshToken.php | 1 + 3 files changed, 3 insertions(+) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Entity/AccessToken.php b/src/Wallabag/ApiBundle/Entity/AccessToken.php index 5e4099dd..98e0af3e 100644 --- a/src/Wallabag/ApiBundle/Entity/AccessToken.php +++ b/src/Wallabag/ApiBundle/Entity/AccessToken.php @@ -42,6 +42,7 @@ class AccessToken extends BaseAccessToken /** * @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User") + * @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE") */ protected $user; } diff --git a/src/Wallabag/ApiBundle/Entity/AuthCode.php b/src/Wallabag/ApiBundle/Entity/AuthCode.php index 5fa205ac..7c9c8539 100644 --- a/src/Wallabag/ApiBundle/Entity/AuthCode.php +++ b/src/Wallabag/ApiBundle/Entity/AuthCode.php @@ -42,6 +42,7 @@ class AuthCode extends BaseAuthCode /** * @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User") + * @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE") */ protected $user; } diff --git a/src/Wallabag/ApiBundle/Entity/RefreshToken.php b/src/Wallabag/ApiBundle/Entity/RefreshToken.php index dd8e9c63..55a507e1 100644 --- a/src/Wallabag/ApiBundle/Entity/RefreshToken.php +++ b/src/Wallabag/ApiBundle/Entity/RefreshToken.php @@ -42,6 +42,7 @@ class RefreshToken extends BaseRefreshToken /** * @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User") + * @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE") */ protected $user; } -- cgit v1.2.3 From 2dbb5b2307ceefc92b465a7cbd2d0ecf512a491b Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Wed, 1 May 2019 14:05:38 +0200 Subject: Enable no-referrer on img tags, enable strict-origin-when-cross-origin by default Fixes #3889 Signed-off-by: Kevin Decherf --- src/Wallabag/CoreBundle/Helper/ContentProxy.php | 1 + src/Wallabag/CoreBundle/Resources/views/base.html.twig | 1 + 2 files changed, 2 insertions(+) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index 31953f12..bc257ffb 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -47,6 +47,7 @@ class ContentProxy */ public function updateEntry(Entry $entry, $url, array $content = [], $disableContentUpdate = false) { + $this->graby->toggleImgNoReferrer(true); if (!empty($content['html'])) { $content['html'] = $this->graby->cleanupHtml($content['html'], $url); } diff --git a/src/Wallabag/CoreBundle/Resources/views/base.html.twig b/src/Wallabag/CoreBundle/Resources/views/base.html.twig index aa388bcb..c0eecd57 100644 --- a/src/Wallabag/CoreBundle/Resources/views/base.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/base.html.twig @@ -8,6 +8,7 @@ {% block head %} + -- cgit v1.2.3 From 19822ecb31a6ca6224abbaf1c23b2a30b5b4496c Mon Sep 17 00:00:00 2001 From: Matt Burke Date: Wed, 17 Apr 2019 22:21:17 -0400 Subject: Remove preview picture from share view page for #1875 Essentially, same as commit 038fccd for single entry views. From that commit: > Showing the preview picture usually leads to showing a duplicate > image, and frequently leads to showing duplicate images directly > adjacent to each other. --- .../CoreBundle/Resources/views/themes/common/Entry/share.html.twig | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/share.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/share.html.twig index e1c7aad9..4294a60d 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/share.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/share.html.twig @@ -29,9 +29,6 @@

      {{ entry.title|e|raw }}

      {{ entry.domainName|removeWww }}

      {{ "entry.public.shared_by_wallabag"|trans({'%wallabag_instance%': url('homepage'), '%username%': entry.user.username})|raw }}.

      - {% if entry.previewPicture is not null %} - {{ entry.title|striptags|e('html_attr') }} - {% endif %}
      {{ entry.content | raw }} -- cgit v1.2.3 From 2c290747cb0d235392f6e5d22205a706c6474168 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 12 May 2019 00:00:00 +0200 Subject: api/entries: add parameter detail to exclude or include content in response detail=metadata will nullify the content field of entries in order to make smaller responses. detail=full keeps the former behavior, it sends the content of entries. It's the default, for backward compatibility. Fixes #2817 Signed-off-by: Kevin Decherf --- .../ApiBundle/Controller/EntryRestController.php | 6 +++++- src/Wallabag/CoreBundle/Repository/EntryRepository.php | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 06520af9..aff0534a 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -103,6 +103,7 @@ class EntryRestController extends WallabagRestController * {"name"="tags", "dataType"="string", "required"=false, "format"="api,rest", "description"="a list of tags url encoded. Will returns entries that matches ALL tags."}, * {"name"="since", "dataType"="integer", "required"=false, "format"="default '0'", "description"="The timestamp since when you want entries updated."}, * {"name"="public", "dataType"="integer", "required"=false, "format"="1 or 0, all entries by default", "description"="filter by entries with a public link"}, + * {"name"="detail", "dataType"="string", "required"=false, "format"="metadata or full, metadata by default", "description"="include content field if 'full'. 'full' by default for backward compatibility."}, * } * ) * @@ -121,6 +122,7 @@ class EntryRestController extends WallabagRestController $perPage = (int) $request->query->get('perPage', 30); $tags = \is_array($request->query->get('tags')) ? '' : (string) $request->query->get('tags', ''); $since = $request->query->get('since', 0); + $detail = strtolower($request->query->get('detail', 'full')); try { /** @var \Pagerfanta\Pagerfanta $pager */ @@ -132,7 +134,8 @@ class EntryRestController extends WallabagRestController $sort, $order, $since, - $tags + $tags, + $detail ); } catch (\Exception $e) { throw new BadRequestHttpException($e->getMessage()); @@ -156,6 +159,7 @@ class EntryRestController extends WallabagRestController 'perPage' => $perPage, 'tags' => $tags, 'since' => $since, + 'detail' => $detail, ], true ) diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index f5089729..3990932e 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -139,15 +139,30 @@ class EntryRepository extends EntityRepository * @param string $order * @param int $since * @param string $tags + * @param string $detail 'metadata' or 'full'. Include content field if 'full' + * + * @todo Breaking change: replace default detail=full by detail=metadata in a future version * * @return Pagerfanta */ - public function findEntries($userId, $isArchived = null, $isStarred = null, $isPublic = null, $sort = 'created', $order = 'asc', $since = 0, $tags = '') + public function findEntries($userId, $isArchived = null, $isStarred = null, $isPublic = null, $sort = 'created', $order = 'asc', $since = 0, $tags = '', $detail = 'full') { + if (!\in_array(strtolower($detail), ['full', 'metadata'], true)) { + throw new \Exception('Detail "' . $detail . '" parameter is wrong, allowed: full or metadata'); + } + $qb = $this->createQueryBuilder('e') ->leftJoin('e.tags', 't') ->where('e.user = :userId')->setParameter('userId', $userId); + if ('metadata' === $detail) { + $fieldNames = $this->getClassMetadata()->getFieldNames(); + $fields = array_filter($fieldNames, function ($k) { + return 'content' !== $k; + }); + $qb->select(sprintf('partial e.{%s}', implode(',', $fields))); + } + if (null !== $isArchived) { $qb->andWhere('e.isArchived = :isArchived')->setParameter('isArchived', (bool) $isArchived); } -- cgit v1.2.3 From feb239ea1006685ab3862c988309a1a5a9659559 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sat, 11 May 2019 20:07:38 +0200 Subject: mysql: change collation of tag table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit utf8mb4_unicode_ci considers that 'caché' is equal to 'cache' which can lead to attaching incorrect tags to entries. This issue is due to some unicode normalization done by MySQL. utf8mb4_bin makes no unicode normalization, letting wallabag to consider 'cache' and 'caché' as two different tags. We change the collation of the whole table as Doctrine does not support setting a collation on a column for a specific platform (it tries to apply utf8mb4_bin even for pgsql and sqlite). Fixes #3302 Signed-off-by: Kevin Decherf --- src/Wallabag/CoreBundle/Entity/Tag.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Entity/Tag.php b/src/Wallabag/CoreBundle/Entity/Tag.php index a6dc8c50..95c47bbd 100644 --- a/src/Wallabag/CoreBundle/Entity/Tag.php +++ b/src/Wallabag/CoreBundle/Entity/Tag.php @@ -13,7 +13,10 @@ use JMS\Serializer\Annotation\XmlRoot; * Tag. * * @XmlRoot("tag") - * @ORM\Table(name="`tag`") + * @ORM\Table( + * name="`tag`", + * options={"collate"="utf8mb4_bin", "charset"="utf8mb4"}, + * ) * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\TagRepository") * @ExclusionPolicy("all") */ -- cgit v1.2.3 From 423efadefc2459c7b4a2eabc32edaed918e1075d Mon Sep 17 00:00:00 2001 From: nicofrand Date: Fri, 10 May 2019 23:01:07 +0200 Subject: Set first picture as preview picture --- src/Wallabag/CoreBundle/Helper/ContentProxy.php | 20 ++++++++++++---- src/Wallabag/CoreBundle/Helper/DownloadImages.php | 29 ++++++++++++++++------- 2 files changed, 37 insertions(+), 12 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index bc257ffb..ca01dec8 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -12,8 +12,8 @@ use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Tools\Utils; /** - * This kind of proxy class take care of getting the content from an url - * and update the entry with what it found. + * This kind of proxy class takes care of getting the content from an url + * and updates the entry with what it found. */ class ContentProxy { @@ -289,13 +289,25 @@ class ContentProxy $this->updateLanguage($entry, $content['language']); } + $previewPictureUrl = ''; if (!empty($content['open_graph']['og_image'])) { - $this->updatePreviewPicture($entry, $content['open_graph']['og_image']); + $previewPictureUrl = $content['open_graph']['og_image']; } // if content is an image, define it as a preview too if (!empty($content['content_type']) && \in_array($this->mimeGuesser->guess($content['content_type']), ['jpeg', 'jpg', 'gif', 'png'], true)) { - $this->updatePreviewPicture($entry, $content['url']); + $previewPictureUrl = $content['url']; + } elseif (empty($previewPictureUrl)) { + $this->logger->debug('Extracting images from content to provide a default preview picture'); + $imagesUrls = DownloadImages::extractImagesUrlsFromHtml($content['html']); + $this->logger->debug(\count($imagesUrls) . ' pictures found'); + if (!empty($imagesUrls)) { + $previewPictureUrl = $imagesUrls[0]; + } + } + + if (!empty($previewPictureUrl)) { + $this->updatePreviewPicture($entry, $previewPictureUrl); } if (!empty($content['content_type'])) { diff --git a/src/Wallabag/CoreBundle/Helper/DownloadImages.php b/src/Wallabag/CoreBundle/Helper/DownloadImages.php index 9a7e9828..c1645e45 100644 --- a/src/Wallabag/CoreBundle/Helper/DownloadImages.php +++ b/src/Wallabag/CoreBundle/Helper/DownloadImages.php @@ -31,23 +31,36 @@ class DownloadImages } /** - * Process the html and extract image from it, save them to local and return the updated html. + * Process the html and extract images URLs from it. * - * @param int $entryId ID of the entry * @param string $html - * @param string $url Used as a base path for relative image and folder * - * @return string + * @return string[] */ - public function processHtml($entryId, $html, $url) + public static function extractImagesUrlsFromHtml($html) { $crawler = new Crawler($html); $imagesCrawler = $crawler ->filterXpath('//img'); $imagesUrls = $imagesCrawler ->extract(['src']); - $imagesSrcsetUrls = $this->getSrcsetUrls($imagesCrawler); - $imagesUrls = array_unique(array_merge($imagesUrls, $imagesSrcsetUrls)); + $imagesSrcsetUrls = self::getSrcsetUrls($imagesCrawler); + + return array_unique(array_merge($imagesUrls, $imagesSrcsetUrls)); + } + + /** + * Process the html and extract image from it, save them to local and return the updated html. + * + * @param int $entryId ID of the entry + * @param string $html + * @param string $url Used as a base path for relative image and folder + * + * @return string + */ + public function processHtml($entryId, $html, $url) + { + $imagesUrls = self::extractImagesUrlsFromHtml($html); $relativePath = $this->getRelativePath($entryId); @@ -199,7 +212,7 @@ class DownloadImages * * @return array An array of urls */ - private function getSrcsetUrls(Crawler $imagesCrawler) + private static function getSrcsetUrls(Crawler $imagesCrawler) { $urls = []; $iterator = $imagesCrawler -- cgit v1.2.3 From 9ca670c801cddef0ba47adc3be02945164f6bc85 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 24 May 2019 14:37:54 +0200 Subject: Fix Instapaper import date --- src/Wallabag/ImportBundle/Import/InstapaperImport.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php index 439c978c..f7bee9ef 100644 --- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php +++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php @@ -93,6 +93,10 @@ class InstapaperImport extends AbstractImport return false; } + // most recent articles are first, which means we should create them at the end so they will show up first + // as Instapaper doesn't export the creation date of the article + $entries = array_reverse($entries); + if ($this->producer) { $this->parseEntriesForProducer($entries); -- cgit v1.2.3 From 31e276fc1636b41b03b7c29127681de257c16b06 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Thu, 2 May 2019 21:19:20 +1000 Subject: EntryRestController::getEntriesExistsAction: always find by hashed url Simplify the logic from #3158 by hashing all the urls from the request, and only doing a search by hash. This allows to get performance benefits from the new indexed hash column even when using older clients that do not hash the URL in the request. Fixes: #3158, #3919 Signed-off-by: Olivier Mehani --- .../ApiBundle/Controller/EntryRestController.php | 71 ++++++++++++---------- 1 file changed, 40 insertions(+), 31 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index aff0534a..17b53a01 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -43,50 +43,59 @@ class EntryRestController extends WallabagRestController $returnId = (null === $request->query->get('return_id')) ? false : (bool) $request->query->get('return_id'); - $urls = $request->query->get('urls', []); $hashedUrls = $request->query->get('hashed_urls', []); + $hashedUrl = $request->query->get('hashed_url', ''); + if (!empty($hashedUrl)) { + $hashedUrls[] = $hashedUrl; + } - // handle multiple urls first - if (!empty($hashedUrls)) { - $results = []; - foreach ($hashedUrls as $hashedUrl) { - $res = $repo->findByHashedUrlAndUserId($hashedUrl, $this->getUser()->getId()); - - $results[$hashedUrl] = $this->returnExistInformation($res, $returnId); - } + $urls = $request->query->get('urls', []); + $url = $request->query->get('url', ''); + if (!empty($url)) { + $urls[] = $url; + } - return $this->sendResponse($results); + $urlHashMap = []; + foreach($urls as $urlToHash) { + $urlHash = hash('sha1', $urlToHash); // XXX: the hash logic would better be in a separate util to avoid duplication with GenerateUrlHashesCommand::generateHashedUrls + $hashedUrls[] = $urlHash; + $urlHashMap[$urlHash] = $urlToHash; } - // @deprecated, to be remove in 3.0 - if (!empty($urls)) { - $results = []; - foreach ($urls as $url) { - $res = $repo->findByUrlAndUserId($url, $this->getUser()->getId()); + if (empty($hashedUrls)) { + throw $this->createAccessDeniedException('URL is empty?, logged user id: ' . $this->getUser()->getId()); + } - $results[$url] = $this->returnExistInformation($res, $returnId); - } + $results = []; + foreach ($hashedUrls as $hashedUrlToSearch) { + $res = $repo->findByHashedUrlAndUserId($hashedUrlToSearch, $this->getUser()->getId()); - return $this->sendResponse($results); + $results[$hashedUrlToSearch] = $this->returnExistInformation($res, $returnId); } - // let's see if it is a simple url? - $url = $request->query->get('url', ''); - $hashedUrl = $request->query->get('hashed_url', ''); + $results = $this->replaceUrlHashes($results, $urlHashMap); - if (empty($url) && empty($hashedUrl)) { - throw $this->createAccessDeniedException('URL is empty?, logged user id: ' . $this->getUser()->getId()); + if (!empty($url) || !empty($hashedUrl)) { + $hu = array_keys($results)[0]; + return $this->sendResponse(['exists' => $results[$hu]]); } + return $this->sendResponse($results); + } - $method = 'findByUrlAndUserId'; - if (!empty($hashedUrl)) { - $method = 'findByHashedUrlAndUserId'; - $url = $hashedUrl; + /** + * Replace the hashedUrl keys in $results with the unhashed URL from the + * request, as recorded in $urlHashMap. + */ + private function replaceUrlHashes(array $results, array $urlHashMap) { + $newResults = []; + foreach($results as $hash => $res) { + if (isset($urlHashMap[$hash])) { + $newResults[$urlHashMap[$hash]] = $res; + } else { + $newResults[$hash] = $res; + } } - - $res = $repo->$method($url, $this->getUser()->getId()); - - return $this->sendResponse(['exists' => $this->returnExistInformation($res, $returnId)]); + return $newResults; } /** -- cgit v1.2.3 From d5744bf0dfdbee4dbbe380d8a076d07b89fc76e6 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Fri, 3 May 2019 22:23:04 +1000 Subject: Delegate findByUrlAndUserId to findByHashedUrlAndUserId Signed-off-by: Olivier Mehani --- src/Wallabag/CoreBundle/Repository/EntryRepository.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 3990932e..960b682d 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -348,17 +348,9 @@ class EntryRepository extends EntityRepository */ public function findByUrlAndUserId($url, $userId) { - $res = $this->createQueryBuilder('e') - ->where('e.url = :url')->setParameter('url', urldecode($url)) - ->andWhere('e.user = :user_id')->setParameter('user_id', $userId) - ->getQuery() - ->getResult(); - - if (\count($res)) { - return current($res); - } - - return false; + return $this->findByHashedUrlAndUserId( + hash('sha1', $url), // XXX: the hash logic would better be in a separate util to avoid duplication with GenerateUrlHashesCommand::generateHashedUrls + $userId); } /** -- cgit v1.2.3 From 4a5516376bf4c8b0cdc1e81d24ce1cca68425785 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Fri, 10 May 2019 22:07:55 +1000 Subject: Add Wallabag\CoreBundle\Helper\UrlHasher Signed-off-by: Olivier Mehani --- .../ApiBundle/Controller/EntryRestController.php | 41 ++++++++++++---------- .../Command/GenerateUrlHashesCommand.php | 5 ++- src/Wallabag/CoreBundle/Entity/Entry.php | 3 +- src/Wallabag/CoreBundle/Helper/UrlHasher.php | 22 ++++++++++++ .../CoreBundle/Repository/EntryRepository.php | 29 ++++++++++++++- 5 files changed, 79 insertions(+), 21 deletions(-) create mode 100644 src/Wallabag/CoreBundle/Helper/UrlHasher.php (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 17b53a01..77eb489e 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -14,6 +14,7 @@ use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Tag; use Wallabag\CoreBundle\Event\EntryDeletedEvent; use Wallabag\CoreBundle\Event\EntrySavedEvent; +use Wallabag\CoreBundle\Helper\UrlHasher; class EntryRestController extends WallabagRestController { @@ -56,8 +57,8 @@ class EntryRestController extends WallabagRestController } $urlHashMap = []; - foreach($urls as $urlToHash) { - $urlHash = hash('sha1', $urlToHash); // XXX: the hash logic would better be in a separate util to avoid duplication with GenerateUrlHashesCommand::generateHashedUrls + foreach ($urls as $urlToHash) { + $urlHash = UrlHasher::hashUrl($urlToHash); $hashedUrls[] = $urlHash; $urlHashMap[$urlHash] = $urlToHash; } @@ -77,25 +78,11 @@ class EntryRestController extends WallabagRestController if (!empty($url) || !empty($hashedUrl)) { $hu = array_keys($results)[0]; + return $this->sendResponse(['exists' => $results[$hu]]); } - return $this->sendResponse($results); - } - /** - * Replace the hashedUrl keys in $results with the unhashed URL from the - * request, as recorded in $urlHashMap. - */ - private function replaceUrlHashes(array $results, array $urlHashMap) { - $newResults = []; - foreach($results as $hash => $res) { - if (isset($urlHashMap[$hash])) { - $newResults[$urlHashMap[$hash]] = $res; - } else { - $newResults[$hash] = $res; - } - } - return $newResults; + return $this->sendResponse($results); } /** @@ -815,6 +802,24 @@ class EntryRestController extends WallabagRestController return $this->sendResponse($results); } + /** + * Replace the hashedUrl keys in $results with the unhashed URL from the + * request, as recorded in $urlHashMap. + */ + private function replaceUrlHashes(array $results, array $urlHashMap) + { + $newResults = []; + foreach ($results as $hash => $res) { + if (isset($urlHashMap[$hash])) { + $newResults[$urlHashMap[$hash]] = $res; + } else { + $newResults[$hash] = $res; + } + } + + return $newResults; + } + /** * Retrieve value from the request. * Used for POST & PATCH on a an entry. diff --git a/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php b/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php index 45bd8c5f..775b0413 100644 --- a/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php +++ b/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php @@ -7,6 +7,7 @@ use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use Wallabag\CoreBundle\Helper\UrlHasher; use Wallabag\UserBundle\Entity\User; class GenerateUrlHashesCommand extends ContainerAwareCommand @@ -65,7 +66,9 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand $i = 1; foreach ($entries as $entry) { - $entry->setHashedUrl(hash('sha1', $entry->getUrl())); + $entry->setHashedUrl( + UrlHasher::hashUrl($entry->getUrl()) + ); $em->persist($entry); if (0 === ($i % 20)) { diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index c3fb87d2..1b4367fd 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -13,6 +13,7 @@ use JMS\Serializer\Annotation\XmlRoot; use Symfony\Component\Validator\Constraints as Assert; use Wallabag\AnnotationBundle\Entity\Annotation; use Wallabag\CoreBundle\Helper\EntityTimestampsTrait; +use Wallabag\CoreBundle\Helper\UrlHasher; use Wallabag\UserBundle\Entity\User; /** @@ -324,7 +325,7 @@ class Entry public function setUrl($url) { $this->url = $url; - $this->hashedUrl = hash('sha1', $url); + $this->hashedUrl = UrlHasher::hashUrl($url); return $this; } diff --git a/src/Wallabag/CoreBundle/Helper/UrlHasher.php b/src/Wallabag/CoreBundle/Helper/UrlHasher.php new file mode 100644 index 00000000..e44f219a --- /dev/null +++ b/src/Wallabag/CoreBundle/Helper/UrlHasher.php @@ -0,0 +1,22 @@ +findByHashedUrlAndUserId( - hash('sha1', $url), // XXX: the hash logic would better be in a separate util to avoid duplication with GenerateUrlHashesCommand::generateHashedUrls + UrlHasher::hashUrl($url), $userId); } @@ -506,6 +507,32 @@ class EntryRepository extends EntityRepository return $this->find($randomId); } + /** + * Inject a UrlHasher. + * + * @param UrlHasher $hasher + */ + public function setUrlHasher(UrlHasher $hasher) + { + $this->urlHasher = $hasher; + } + + /** + * Get the UrlHasher, or create a default one if not injected. + * + * XXX: the default uses the default hash algorithm + * + * @return UrlHasher + */ + protected function getUrlHasher() + { + if (!isset($this->urlHasher)) { + $this->setUrlHasher(new UrlHasher()); + } + + return $this->urlHasher; + } + /** * Return a query builder to be used by other getBuilderFor* method. * -- cgit v1.2.3 From 0132ccd2a2e73a831fa198940c369bcdd5249e8b Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 24 May 2019 15:15:12 +0200 Subject: Change the way to define algorithm for hashing url --- .../CoreBundle/Command/GenerateUrlHashesCommand.php | 6 ++---- src/Wallabag/CoreBundle/Helper/UrlHasher.php | 13 +++++++------ src/Wallabag/CoreBundle/Repository/EntryRepository.php | 3 ++- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php b/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php index 775b0413..8f2bff11 100644 --- a/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php +++ b/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php @@ -66,9 +66,7 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand $i = 1; foreach ($entries as $entry) { - $entry->setHashedUrl( - UrlHasher::hashUrl($entry->getUrl()) - ); + $entry->setHashedUrl(UrlHasher::hashUrl($entry->getUrl())); $em->persist($entry); if (0 === ($i % 20)) { @@ -87,7 +85,7 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand * * @param string $username * - * @return \Wallabag\UserBundle\Entity\User + * @return User */ private function getUser($username) { diff --git a/src/Wallabag/CoreBundle/Helper/UrlHasher.php b/src/Wallabag/CoreBundle/Helper/UrlHasher.php index e44f219a..d123eaba 100644 --- a/src/Wallabag/CoreBundle/Helper/UrlHasher.php +++ b/src/Wallabag/CoreBundle/Helper/UrlHasher.php @@ -7,16 +7,17 @@ namespace Wallabag\CoreBundle\Helper; */ class UrlHasher { - /** @var string */ - const ALGORITHM = 'sha1'; - /** + * Hash the given url using the given algorithm. + * Hashed url are faster to be retrieved in the database than the real url. + * * @param string $url + * @param string $algorithm * - * @return string hashed $url + * @return string */ - public static function hashUrl(string $url) + public static function hashUrl(string $url, $algorithm = 'sha1') { - return hash(static::ALGORITHM, $url); + return hash($algorithm, urldecode($url)); } } diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 37fc1000..7c4a05ed 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -351,7 +351,8 @@ class EntryRepository extends EntityRepository { return $this->findByHashedUrlAndUserId( UrlHasher::hashUrl($url), - $userId); + $userId + ); } /** -- cgit v1.2.3 From 629a3797bcef33943df8ef5631328e05d12634ed Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 24 May 2019 15:43:30 +0200 Subject: Remove useless methods Also fix a phpdoc block --- .../ApiBundle/Controller/EntryRestController.php | 4 ++-- .../CoreBundle/Repository/EntryRepository.php | 26 ---------------------- 2 files changed, 2 insertions(+), 28 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 77eb489e..bdd02129 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -848,8 +848,8 @@ class EntryRestController extends WallabagRestController /** * Return information about the entry if it exist and depending on the id or not. * - * @param Entry|null $entry - * @param bool $returnId + * @param Entry|bool|null $entry + * @param bool $returnId * * @return bool|int */ diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 7c4a05ed..880e7c65 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -508,32 +508,6 @@ class EntryRepository extends EntityRepository return $this->find($randomId); } - /** - * Inject a UrlHasher. - * - * @param UrlHasher $hasher - */ - public function setUrlHasher(UrlHasher $hasher) - { - $this->urlHasher = $hasher; - } - - /** - * Get the UrlHasher, or create a default one if not injected. - * - * XXX: the default uses the default hash algorithm - * - * @return UrlHasher - */ - protected function getUrlHasher() - { - if (!isset($this->urlHasher)) { - $this->setUrlHasher(new UrlHasher()); - } - - return $this->urlHasher; - } - /** * Return a query builder to be used by other getBuilderFor* method. * -- cgit v1.2.3 From bf9ace0643f654e7ccd9c020b8b501ad56cd19de Mon Sep 17 00:00:00 2001 From: adev Date: Tue, 24 Oct 2017 22:55:40 +0200 Subject: Use httplug --- src/Wallabag/CoreBundle/Helper/DownloadImages.php | 21 +++-- .../CoreBundle/Helper/HttpClientFactory.php | 47 ++++++----- .../CoreBundle/Resources/config/services.yml | 11 ++- src/Wallabag/ImportBundle/Import/PocketImport.php | 90 +++++++++++----------- .../ImportBundle/Resources/config/services.yml | 8 +- 5 files changed, 92 insertions(+), 85 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/DownloadImages.php b/src/Wallabag/CoreBundle/Helper/DownloadImages.php index c1645e45..e5749060 100644 --- a/src/Wallabag/CoreBundle/Helper/DownloadImages.php +++ b/src/Wallabag/CoreBundle/Helper/DownloadImages.php @@ -2,8 +2,13 @@ namespace Wallabag\CoreBundle\Helper; -use GuzzleHttp\Client; -use GuzzleHttp\Message\Response; +use Http\Client\Common\HttpMethodsClient; +use Http\Client\Common\Plugin\ErrorPlugin; +use Http\Client\Common\PluginClient; +use Http\Client\HttpClient; +use Http\Discovery\MessageFactoryDiscovery; +use Http\Message\MessageFactory; +use Psr\Http\Message\ResponseInterface; use Psr\Log\LoggerInterface; use Symfony\Component\DomCrawler\Crawler; use Symfony\Component\Finder\Finder; @@ -19,9 +24,9 @@ class DownloadImages private $mimeGuesser; private $wallabagUrl; - public function __construct(Client $client, $baseFolder, $wallabagUrl, LoggerInterface $logger) + public function __construct(HttpClient $client, $baseFolder, $wallabagUrl, LoggerInterface $logger, MessageFactory $messageFactory = null) { - $this->client = $client; + $this->client = new HttpMethodsClient(new PluginClient($client, [new ErrorPlugin()]), $messageFactory ?: MessageFactoryDiscovery::find()); $this->baseFolder = $baseFolder; $this->wallabagUrl = rtrim($wallabagUrl, '/'); $this->logger = $logger; @@ -135,7 +140,7 @@ class DownloadImages $localPath = $folderPath . '/' . $hashImage . '.' . $ext; try { - $im = imagecreatefromstring($res->getBody()); + $im = imagecreatefromstring((string) $res->getBody()); } catch (\Exception $e) { $im = false; } @@ -306,14 +311,14 @@ class DownloadImages /** * Retrieve and validate the extension from the response of the url of the image. * - * @param Response $res Guzzle Response + * @param ResponseInterface $res Http Response * @param string $imagePath Path from the src image from the content (used for log only) * * @return string|false Extension name or false if validation failed */ - private function getExtensionFromResponse(Response $res, $imagePath) + private function getExtensionFromResponse(ResponseInterface $res, $imagePath) { - $ext = $this->mimeGuesser->guess($res->getHeader('content-type')); + $ext = $this->mimeGuesser->guess(current($res->getHeader('content-type'))); $this->logger->debug('DownloadImages: Checking extension', ['ext' => $ext, 'header' => $res->getHeader('content-type')]); // ok header doesn't have the extension, try a different way diff --git a/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php b/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php index 4602a684..4899d3d4 100644 --- a/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php +++ b/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php @@ -2,16 +2,18 @@ namespace Wallabag\CoreBundle\Helper; -use Graby\Ring\Client\SafeCurlHandler; -use GuzzleHttp\Client; +use GuzzleHttp\Client as GuzzleClient; use GuzzleHttp\Cookie\CookieJar; use GuzzleHttp\Event\SubscriberInterface; +use Http\Adapter\Guzzle5\Client as GuzzleAdapter; use Psr\Log\LoggerInterface; +use Http\Client\HttpClient; +use Http\HttplugBundle\ClientFactory\ClientFactory; /** - * Builds and configures the Guzzle HTTP client. + * Builds and configures the HTTP client. */ -class HttpClientFactory +class HttpClientFactory implements ClientFactory { /** @var [\GuzzleHttp\Event\SubscriberInterface] */ private $subscribers = []; @@ -37,35 +39,38 @@ class HttpClientFactory } /** - * @return \GuzzleHttp\Client|null + * Adds a subscriber to the HTTP client. + * + * @param SubscriberInterface $subscriber + */ + public function addSubscriber(SubscriberInterface $subscriber) + { + $this->subscribers[] = $subscriber; + } + + /** + * Input an array of configuration to be able to create a HttpClient. + * + * @param array $config + * + * @return HttpClient */ - public function buildHttpClient() + public function createClient(array $config = []) { $this->logger->log('debug', 'Restricted access config enabled?', ['enabled' => (int) $this->restrictedAccess]); if (0 === (int) $this->restrictedAccess) { - return; + return new GuzzleAdapter(new GuzzleClient()); } // we clear the cookie to avoid websites who use cookies for analytics $this->cookieJar->clear(); // need to set the (shared) cookie jar - $client = new Client(['handler' => new SafeCurlHandler(), 'defaults' => ['cookies' => $this->cookieJar]]); - + $guzzle = new GuzzleClient(['defaults' => ['cookies' => $this->cookieJar]]); foreach ($this->subscribers as $subscriber) { - $client->getEmitter()->attach($subscriber); + $guzzle->getEmitter()->attach($subscriber); } - return $client; - } - - /** - * Adds a subscriber to the HTTP client. - * - * @param SubscriberInterface $subscriber - */ - public function addSubscriber(SubscriberInterface $subscriber) - { - $this->subscribers[] = $subscriber; + return new GuzzleAdapter($guzzle); } } diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml index 280d779d..31986951 100644 --- a/src/Wallabag/CoreBundle/Resources/config/services.yml +++ b/src/Wallabag/CoreBundle/Resources/config/services.yml @@ -42,7 +42,7 @@ services: - error_message: '%wallabag_core.fetching_error_message%' error_message_title: '%wallabag_core.fetching_error_message_title%' - - "@wallabag_core.guzzle.http_client" + - "@wallabag_core.http_client" - "@wallabag_core.graby.config_builder" calls: - [ setLogger, [ "@logger" ] ] @@ -55,9 +55,8 @@ services: - {} - "@logger" - wallabag_core.guzzle.http_client: - class: GuzzleHttp\ClientInterface - factory: ["@wallabag_core.guzzle.http_client_factory", buildHttpClient] + wallabag_core.http_client: + alias: 'httplug.client.wallabag_core' wallabag_core.guzzle_authenticator.config_builder: class: Wallabag\CoreBundle\GuzzleSiteAuthenticator\GrabySiteConfigBuilder @@ -73,7 +72,7 @@ services: bd_guzzle_site_authenticator.site_config_builder: alias: wallabag_core.guzzle_authenticator.config_builder - wallabag_core.guzzle.http_client_factory: + wallabag_core.http_client_factory: class: Wallabag\CoreBundle\Helper\HttpClientFactory arguments: - "@wallabag_core.guzzle.cookie_jar" @@ -212,7 +211,7 @@ services: - "@logger" wallabag_core.entry.download_images.client: - class: GuzzleHttp\Client + alias: 'httplug.client.wallabag_core.entry.download_images' wallabag_core.helper.crypto_proxy: class: Wallabag\CoreBundle\Helper\CryptoProxy diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index a39d8156..9467fae2 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php @@ -2,13 +2,22 @@ namespace Wallabag\ImportBundle\Import; -use GuzzleHttp\Client; -use GuzzleHttp\Exception\RequestException; +use Http\Client\Common\HttpMethodsClient; +use Http\Client\Common\Plugin\ErrorPlugin; +use Http\Client\Common\PluginClient; +use Http\Client\HttpClient; +use Http\Discovery\MessageFactoryDiscovery; +use Http\Message\MessageFactory; +use Http\Client\Exception\RequestException; use Wallabag\CoreBundle\Entity\Entry; +use Psr\Http\Message\ResponseInterface; class PocketImport extends AbstractImport { const NB_ELEMENTS = 5000; + /** + * @var HttpMethodsClient + */ private $client; private $accessToken; @@ -55,24 +64,18 @@ class PocketImport extends AbstractImport */ public function getRequestToken($redirectUri) { - $request = $this->client->createRequest('POST', 'https://getpocket.com/v3/oauth/request', - [ - 'body' => json_encode([ - 'consumer_key' => $this->user->getConfig()->getPocketConsumerKey(), - 'redirect_uri' => $redirectUri, - ]), - ] - ); - try { - $response = $this->client->send($request); + $response = $this->client->post('https://getpocket.com/v3/oauth/request', [], json_encode([ + 'consumer_key' => $this->user->getConfig()->getPocketConsumerKey(), + 'redirect_uri' => $redirectUri, + ])); } catch (RequestException $e) { $this->logger->error(sprintf('PocketImport: Failed to request token: %s', $e->getMessage()), ['exception' => $e]); return false; } - return $response->json()['code']; + return $this->jsonDecode($response)['code']; } /** @@ -85,24 +88,19 @@ class PocketImport extends AbstractImport */ public function authorize($code) { - $request = $this->client->createRequest('POST', 'https://getpocket.com/v3/oauth/authorize', - [ - 'body' => json_encode([ - 'consumer_key' => $this->user->getConfig()->getPocketConsumerKey(), - 'code' => $code, - ]), - ] - ); try { - $response = $this->client->send($request); + $response = $this->client->post('https://getpocket.com/v3/oauth/authorize', [], json_encode([ + 'consumer_key' => $this->user->getConfig()->getPocketConsumerKey(), + 'code' => $code, + ])); } catch (RequestException $e) { $this->logger->error(sprintf('PocketImport: Failed to authorize client: %s', $e->getMessage()), ['exception' => $e]); return false; } - $this->accessToken = $response->json()['access_token']; + $this->accessToken = $this->jsonDecode($response)['access_token']; return true; } @@ -114,29 +112,23 @@ class PocketImport extends AbstractImport { static $run = 0; - $request = $this->client->createRequest('POST', 'https://getpocket.com/v3/get', - [ - 'body' => json_encode([ - 'consumer_key' => $this->user->getConfig()->getPocketConsumerKey(), - 'access_token' => $this->accessToken, - 'detailType' => 'complete', - 'state' => 'all', - 'sort' => 'newest', - 'count' => self::NB_ELEMENTS, - 'offset' => $offset, - ]), - ] - ); - try { - $response = $this->client->send($request); + $response = $this->client->post('https://getpocket.com/v3/get', [], json_encode([ + 'consumer_key' => $this->user->getConfig()->getPocketConsumerKey(), + 'access_token' => $this->accessToken, + 'detailType' => 'complete', + 'state' => 'all', + 'sort' => 'newest', + 'count' => self::NB_ELEMENTS, + 'offset' => $offset, + ])); } catch (RequestException $e) { $this->logger->error(sprintf('PocketImport: Failed to import: %s', $e->getMessage()), ['exception' => $e]); return false; } - $entries = $response->json(); + $entries = $this->jsonDecode($response); if ($this->producer) { $this->parseEntriesForProducer($entries['list']); @@ -159,13 +151,14 @@ class PocketImport extends AbstractImport } /** - * Set the Guzzle client. + * Set the Http client. * - * @param Client $client + * @param HttpClient $client + * @param MessageFactory|null $messageFactory */ - public function setClient(Client $client) + public function setClient(HttpClient $client, MessageFactory $messageFactory = null) { - $this->client = $client; + $this->client = new HttpMethodsClient(new PluginClient($client, [new ErrorPlugin()]), $messageFactory ?: MessageFactoryDiscovery::find()); } /** @@ -252,4 +245,15 @@ class PocketImport extends AbstractImport return $importedEntry; } + + protected function jsonDecode(ResponseInterface $response) + { + $data = \json_decode((string) $response->getBody(), true); + + if (JSON_ERROR_NONE !== json_last_error()) { + throw new \InvalidArgumentException('Unable to parse JSON data: ' . json_last_error_msg()); + } + + return $data; + } } diff --git a/src/Wallabag/ImportBundle/Resources/config/services.yml b/src/Wallabag/ImportBundle/Resources/config/services.yml index 2dd7dff8..973c0d03 100644 --- a/src/Wallabag/ImportBundle/Resources/config/services.yml +++ b/src/Wallabag/ImportBundle/Resources/config/services.yml @@ -7,13 +7,7 @@ services: class: Wallabag\ImportBundle\Import\ImportChain wallabag_import.pocket.client: - class: GuzzleHttp\Client - arguments: - - - defaults: - headers: - content-type: "application/json" - X-Accept: "application/json" + alias: 'httplug.client.wallabag_import.pocket.client' wallabag_import.pocket.import: class: Wallabag\ImportBundle\Import\PocketImport -- cgit v1.2.3 From 5f08426201c336f96d593954fb45b284d7e60f4a Mon Sep 17 00:00:00 2001 From: adev Date: Sat, 11 Nov 2017 20:04:15 +0100 Subject: Fix because of some breaking changes of Graby 2.0 --- .../ApiBundle/Controller/EntryRestController.php | 4 +--- src/Wallabag/CoreBundle/Helper/ContentProxy.php | 20 +++++++++----------- .../ImportBundle/Import/WallabagV2Import.php | 4 +++- 3 files changed, 13 insertions(+), 15 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index aff0534a..d9d99c85 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -369,9 +369,7 @@ class EntryRestController extends WallabagRestController 'language' => !empty($data['language']) ? $data['language'] : $entry->getLanguage(), 'date' => !empty($data['publishedAt']) ? $data['publishedAt'] : $entry->getPublishedAt(), // faking the open graph preview picture - 'open_graph' => [ - 'og_image' => !empty($data['picture']) ? $data['picture'] : $entry->getPreviewPicture(), - ], + 'image' => !empty($data['picture']) ? $data['picture'] : $entry->getPreviewPicture(), 'authors' => \is_string($data['authors']) ? explode(',', $data['authors']) : $entry->getPublishedBy(), ] ); diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index ca01dec8..ac27e50a 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -253,16 +253,14 @@ class ContentProxy if (!empty($content['title'])) { $entry->setTitle($content['title']); - } elseif (!empty($content['open_graph']['og_title'])) { - $entry->setTitle($content['open_graph']['og_title']); } if (empty($content['html'])) { $content['html'] = $this->fetchingErrorMessage; - if (!empty($content['open_graph']['og_description'])) { + if (!empty($content['description'])) { $content['html'] .= '

      But we found a short description:

      '; - $content['html'] .= $content['open_graph']['og_description']; + $content['html'] .= $content['description']; } } @@ -277,8 +275,8 @@ class ContentProxy $entry->setPublishedBy($content['authors']); } - if (!empty($content['all_headers']) && $this->storeArticleHeaders) { - $entry->setHeaders($content['all_headers']); + if (!empty($content['headers'])) { + $entry->setHeaders($content['headers']); } if (!empty($content['date'])) { @@ -290,12 +288,12 @@ class ContentProxy } $previewPictureUrl = ''; - if (!empty($content['open_graph']['og_image'])) { - $previewPictureUrl = $content['open_graph']['og_image']; + if (!empty($content['image'])) { + $previewPictureUrl = $content['image']; } // if content is an image, define it as a preview too - if (!empty($content['content_type']) && \in_array($this->mimeGuesser->guess($content['content_type']), ['jpeg', 'jpg', 'gif', 'png'], true)) { + if (!empty($content['headers']['content_type']) && \in_array($this->mimeGuesser->guess($content['headers']['content_type']), ['jpeg', 'jpg', 'gif', 'png'], true)) { $previewPictureUrl = $content['url']; } elseif (empty($previewPictureUrl)) { $this->logger->debug('Extracting images from content to provide a default preview picture'); @@ -310,8 +308,8 @@ class ContentProxy $this->updatePreviewPicture($entry, $previewPictureUrl); } - if (!empty($content['content_type'])) { - $entry->setMimetype($content['content_type']); + if (!empty($content['headers']['content-type'])) { + $entry->setMimetype($content['headers']['content-type']); } try { diff --git a/src/Wallabag/ImportBundle/Import/WallabagV2Import.php b/src/Wallabag/ImportBundle/Import/WallabagV2Import.php index 3e085ecf..2ba26003 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagV2Import.php +++ b/src/Wallabag/ImportBundle/Import/WallabagV2Import.php @@ -35,7 +35,9 @@ class WallabagV2Import extends WallabagImport { return [ 'html' => $entry['content'], - 'content_type' => $entry['mimetype'], + 'headers' => [ + 'content-type' => $entry['mimetype'], + ], 'is_archived' => (bool) ($entry['is_archived'] || $this->markAsRead), 'is_starred' => (bool) $entry['is_starred'], ] + $entry; -- cgit v1.2.3 From 1048c9c4a811821b00cc04bfec905bebcc22bac4 Mon Sep 17 00:00:00 2001 From: adev Date: Sun, 12 Nov 2017 12:15:02 +0100 Subject: Configure timeout --- src/Wallabag/CoreBundle/Helper/HttpClientFactory.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php b/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php index 4899d3d4..3e19a7be 100644 --- a/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php +++ b/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php @@ -60,13 +60,17 @@ class HttpClientFactory implements ClientFactory $this->logger->log('debug', 'Restricted access config enabled?', ['enabled' => (int) $this->restrictedAccess]); if (0 === (int) $this->restrictedAccess) { - return new GuzzleAdapter(new GuzzleClient()); + return new GuzzleAdapter(new GuzzleClient($config)); } // we clear the cookie to avoid websites who use cookies for analytics $this->cookieJar->clear(); - // need to set the (shared) cookie jar - $guzzle = new GuzzleClient(['defaults' => ['cookies' => $this->cookieJar]]); + if (!isset($config['defaults']['cookies'])) { + // need to set the (shared) cookie jar + $config['defaults']['cookies'] = $this->cookieJar; + } + + $guzzle = new GuzzleClient($config); foreach ($this->subscribers as $subscriber) { $guzzle->getEmitter()->attach($subscriber); } -- cgit v1.2.3 From 448d99f84e93697ce49ec31224addb1da1a37a9f Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 28 Jan 2019 06:10:26 +0100 Subject: CS --- src/Wallabag/CoreBundle/Helper/DownloadImages.php | 2 +- src/Wallabag/CoreBundle/Helper/HttpClientFactory.php | 2 +- src/Wallabag/ImportBundle/Import/PocketImport.php | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/DownloadImages.php b/src/Wallabag/CoreBundle/Helper/DownloadImages.php index e5749060..7a39a2e4 100644 --- a/src/Wallabag/CoreBundle/Helper/DownloadImages.php +++ b/src/Wallabag/CoreBundle/Helper/DownloadImages.php @@ -312,7 +312,7 @@ class DownloadImages * Retrieve and validate the extension from the response of the url of the image. * * @param ResponseInterface $res Http Response - * @param string $imagePath Path from the src image from the content (used for log only) + * @param string $imagePath Path from the src image from the content (used for log only) * * @return string|false Extension name or false if validation failed */ diff --git a/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php b/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php index 3e19a7be..b8e95381 100644 --- a/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php +++ b/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php @@ -6,9 +6,9 @@ use GuzzleHttp\Client as GuzzleClient; use GuzzleHttp\Cookie\CookieJar; use GuzzleHttp\Event\SubscriberInterface; use Http\Adapter\Guzzle5\Client as GuzzleAdapter; -use Psr\Log\LoggerInterface; use Http\Client\HttpClient; use Http\HttplugBundle\ClientFactory\ClientFactory; +use Psr\Log\LoggerInterface; /** * Builds and configures the HTTP client. diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index 9467fae2..b35a561b 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php @@ -5,12 +5,12 @@ namespace Wallabag\ImportBundle\Import; use Http\Client\Common\HttpMethodsClient; use Http\Client\Common\Plugin\ErrorPlugin; use Http\Client\Common\PluginClient; +use Http\Client\Exception\RequestException; use Http\Client\HttpClient; use Http\Discovery\MessageFactoryDiscovery; use Http\Message\MessageFactory; -use Http\Client\Exception\RequestException; -use Wallabag\CoreBundle\Entity\Entry; use Psr\Http\Message\ResponseInterface; +use Wallabag\CoreBundle\Entity\Entry; class PocketImport extends AbstractImport { @@ -88,7 +88,6 @@ class PocketImport extends AbstractImport */ public function authorize($code) { - try { $response = $this->client->post('https://getpocket.com/v3/oauth/authorize', [], json_encode([ 'consumer_key' => $this->user->getConfig()->getPocketConsumerKey(), @@ -153,7 +152,7 @@ class PocketImport extends AbstractImport /** * Set the Http client. * - * @param HttpClient $client + * @param HttpClient $client * @param MessageFactory|null $messageFactory */ public function setClient(HttpClient $client, MessageFactory $messageFactory = null) -- cgit v1.2.3 From a91a3150fbc4446e379cc23618db8f74e4044515 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 7 Feb 2019 17:30:38 +0100 Subject: CS --- src/Wallabag/ImportBundle/Import/PocketImport.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index b35a561b..746120af 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php @@ -247,7 +247,7 @@ class PocketImport extends AbstractImport protected function jsonDecode(ResponseInterface $response) { - $data = \json_decode((string) $response->getBody(), true); + $data = json_decode((string) $response->getBody(), true); if (JSON_ERROR_NONE !== json_last_error()) { throw new \InvalidArgumentException('Unable to parse JSON data: ' . json_last_error_msg()); -- cgit v1.2.3 From b6c1e1bacc59ba761d1b47ac6611d1db800f7252 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 7 Feb 2019 17:56:05 +0100 Subject: Fix some tests --- src/Wallabag/CoreBundle/Helper/ContentProxy.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index ac27e50a..59465ad1 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -54,7 +54,11 @@ class ContentProxy if ((empty($content) || false === $this->validateContent($content)) && false === $disableContentUpdate) { $fetchedContent = $this->graby->fetchContent($url); - $fetchedContent['title'] = $this->sanitizeContentTitle($fetchedContent['title'], $fetchedContent['content_type']); + + $fetchedContent['title'] = $this->sanitizeContentTitle( + $fetchedContent['title'], + isset($fetchedContent['headers']['content-type']) ? $fetchedContent['headers']['content-type'] : '' + ); // when content is imported, we have information in $content // in case fetching content goes bad, we'll keep the imported information instead of overriding them @@ -188,8 +192,8 @@ class ContentProxy /** * Try to sanitize the title of the fetched content from wrong character encodings and invalid UTF-8 character. * - * @param $title - * @param $contentType + * @param string $title + * @param string $contentType * * @return string */ @@ -293,12 +297,15 @@ class ContentProxy } // if content is an image, define it as a preview too - if (!empty($content['headers']['content_type']) && \in_array($this->mimeGuesser->guess($content['headers']['content_type']), ['jpeg', 'jpg', 'gif', 'png'], true)) { + if (!empty($content['headers']['content-type']) && \in_array($this->mimeGuesser->guess($content['headers']['content-type']), ['jpeg', 'jpg', 'gif', 'png'], true)) { $previewPictureUrl = $content['url']; + + $entry->setMimetype($content['headers']['content-type']); } elseif (empty($previewPictureUrl)) { $this->logger->debug('Extracting images from content to provide a default preview picture'); $imagesUrls = DownloadImages::extractImagesUrlsFromHtml($content['html']); $this->logger->debug(\count($imagesUrls) . ' pictures found'); + if (!empty($imagesUrls)) { $previewPictureUrl = $imagesUrls[0]; } @@ -308,10 +315,6 @@ class ContentProxy $this->updatePreviewPicture($entry, $previewPictureUrl); } - if (!empty($content['headers']['content-type'])) { - $entry->setMimetype($content['headers']['content-type']); - } - try { $this->tagger->tag($entry); } catch (\Exception $e) { -- cgit v1.2.3 From 6e68417f0356d0045d7a2aa3832507d362ddcfe8 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 28 May 2019 12:02:17 +0200 Subject: Fix tests after rebase --- src/Wallabag/CoreBundle/Helper/ContentProxy.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index 59465ad1..c6fa0d98 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -299,8 +299,6 @@ class ContentProxy // if content is an image, define it as a preview too if (!empty($content['headers']['content-type']) && \in_array($this->mimeGuesser->guess($content['headers']['content-type']), ['jpeg', 'jpg', 'gif', 'png'], true)) { $previewPictureUrl = $content['url']; - - $entry->setMimetype($content['headers']['content-type']); } elseif (empty($previewPictureUrl)) { $this->logger->debug('Extracting images from content to provide a default preview picture'); $imagesUrls = DownloadImages::extractImagesUrlsFromHtml($content['html']); @@ -311,6 +309,10 @@ class ContentProxy } } + if (!empty($content['headers']['content-type'])) { + $entry->setMimetype($content['headers']['content-type']); + } + if (!empty($previewPictureUrl)) { $this->updatePreviewPicture($entry, $previewPictureUrl); } -- cgit v1.2.3 From 52e8d93248c6f47ccb98abc973fcd230b29fee6c Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 29 May 2019 12:00:23 +0200 Subject: Fix some Scrutinizer issues --- src/Wallabag/ApiBundle/Controller/EntryRestController.php | 2 +- src/Wallabag/ApiBundle/Controller/UserRestController.php | 2 +- src/Wallabag/ApiBundle/Controller/WallabagRestController.php | 4 ++-- src/Wallabag/CoreBundle/Entity/Entry.php | 2 +- src/Wallabag/CoreBundle/Repository/EntryRepository.php | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index aaacdcdc..9f933adb 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -564,7 +564,7 @@ class EntryRestController extends WallabagRestController } // if refreshing entry failed, don't save it - if ($this->getParameter('wallabag_core.fetching_error_message') === $entry->getContent()) { + if ($this->container->getParameter('wallabag_core.fetching_error_message') === $entry->getContent()) { return new JsonResponse([], 304); } diff --git a/src/Wallabag/ApiBundle/Controller/UserRestController.php b/src/Wallabag/ApiBundle/Controller/UserRestController.php index 3a4dafcd..1b10a076 100644 --- a/src/Wallabag/ApiBundle/Controller/UserRestController.php +++ b/src/Wallabag/ApiBundle/Controller/UserRestController.php @@ -45,7 +45,7 @@ class UserRestController extends WallabagRestController */ public function putUserAction(Request $request) { - if (!$this->getParameter('fosuser_registration') || !$this->get('craue_config')->get('api_user_registration')) { + if (!$this->container->getParameter('fosuser_registration') || !$this->get('craue_config')->get('api_user_registration')) { $json = $this->get('jms_serializer')->serialize(['error' => "Server doesn't allow registrations"], 'json'); return (new JsonResponse()) diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index f18b0910..44fd9683 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php @@ -2,13 +2,13 @@ namespace Wallabag\ApiBundle\Controller; -use FOS\RestBundle\Controller\FOSRestController; +use FOS\RestBundle\Controller\AbstractFOSRestController; use JMS\Serializer\SerializationContext; use Nelmio\ApiDocBundle\Annotation\ApiDoc; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\Exception\AccessDeniedException; -class WallabagRestController extends FOSRestController +class WallabagRestController extends AbstractFOSRestController { /** * Retrieve version number. diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 1b4367fd..8637c62f 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -771,7 +771,7 @@ class Entry } /** - * @return string + * @return string|null */ public function getUid() { diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 880e7c65..f9cf5233 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -345,7 +345,7 @@ class EntryRepository extends EntityRepository * @param string $url * @param int $userId * - * @return Entry|bool + * @return Entry|false */ public function findByUrlAndUserId($url, $userId) { @@ -362,7 +362,7 @@ class EntryRepository extends EntityRepository * @param string $hashedUrl Url hashed using sha1 * @param int $userId * - * @return Entry|bool + * @return Entry|false */ public function findByHashedUrlAndUserId($hashedUrl, $userId) { -- cgit v1.2.3 From b7fa51ae7dd5fef2d9459100c88479413ddd3fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 10 Jul 2017 21:32:25 +0200 Subject: Added given_url in entry table - Added index on entry table for given_url field - Fix tests: The previous `bit.ly` url redirected to doc.wallabag but that url doesn't exist in the fixtures. I used our own internal "redirector" to create a redirect to an url which exist in the fixtures. Also, updating current migration to use the new `WallabagMigration`. --- src/Wallabag/CoreBundle/Entity/Entry.php | 36 +++++++++++++++++++++- src/Wallabag/CoreBundle/Helper/ContentProxy.php | 1 + .../CoreBundle/Repository/EntryRepository.php | 1 + 3 files changed, 37 insertions(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 1b4367fd..62274136 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -28,7 +28,8 @@ use Wallabag\UserBundle\Entity\User; * @ORM\Index(name="created_at", columns={"created_at"}), * @ORM\Index(name="uid", columns={"uid"}), * @ORM\Index(name="hashed_url_user_id", columns={"user_id", "hashed_url"}, options={"lengths"={null, 40}}) - * } + * }, + * uniqueConstraints={@ORM\UniqueConstraint(name="IDX_entry_given_url",columns={"url", "given_url", "user_id"})} * ) * @ORM\HasLifecycleCallbacks() * @Hateoas\Relation("self", href = "expr('/api/entries/' ~ object.getId())") @@ -67,6 +68,15 @@ class Entry */ private $title; + /** + * @var string + * + * @ORM\Column(name="given_url", type="text", nullable=true) + * + * @Groups({"entries_for_user", "export_all"}) + */ + private $givenUrl; + /** * @var string * @@ -315,6 +325,30 @@ class Entry return $this->title; } + /** + * Set given url. + * + * @param string $givenUrl + * + * @return Entry + */ + public function setGivenUrl($givenUrl) + { + $this->givenUrl = $givenUrl; + + return $this; + } + + /** + * Get given Url. + * + * @return string + */ + public function getGivenUrl() + { + return $this->givenUrl; + } + /** * Set url. * diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index c6fa0d98..0d6a412d 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -76,6 +76,7 @@ class ContentProxy // Not sure what are the other possible cases where this property is empty if (empty($entry->getUrl()) && !empty($url)) { $entry->setUrl($url); + $entry->setGivenUrl($url); } $this->stockEntry($entry, $content); diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 880e7c65..299b0b27 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -368,6 +368,7 @@ class EntryRepository extends EntityRepository { $res = $this->createQueryBuilder('e') ->where('e.hashedUrl = :hashed_url')->setParameter('hashed_url', $hashedUrl) + // ->orWhere('e.givenUrl = :url')->setParameter('url', $url) ->andWhere('e.user = :user_id')->setParameter('user_id', $userId) ->getQuery() ->getResult(); -- cgit v1.2.3 From f3bfb875e94021a93e24a41fbc0f8d86d4dee378 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 29 May 2019 14:18:04 +0200 Subject: Use hash given url to avoid duplicate Using hashed url we can ensure an index on them to ensure it's fast. --- src/Wallabag/CoreBundle/Entity/Entry.php | 99 ++++++++++++---------- src/Wallabag/CoreBundle/Helper/ContentProxy.php | 3 +- .../CoreBundle/Repository/EntryRepository.php | 2 +- 3 files changed, 59 insertions(+), 45 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 62274136..304dd1b3 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -27,9 +27,8 @@ use Wallabag\UserBundle\Entity\User; * indexes={ * @ORM\Index(name="created_at", columns={"created_at"}), * @ORM\Index(name="uid", columns={"uid"}), - * @ORM\Index(name="hashed_url_user_id", columns={"user_id", "hashed_url"}, options={"lengths"={null, 40}}) - * }, - * uniqueConstraints={@ORM\UniqueConstraint(name="IDX_entry_given_url",columns={"url", "given_url", "user_id"})} + * @ORM\Index(name="hashed_urls_user_id", columns={"user_id", "hashed_url", "hashed_given_url"}, options={"lengths"={null, 40, 40}}) + * } * ) * @ORM\HasLifecycleCallbacks() * @Hateoas\Relation("self", href = "expr('/api/entries/' ~ object.getId())") @@ -69,30 +68,52 @@ class Entry private $title; /** + * Define the url fetched by wallabag (the final url after potential redirections). + * * @var string * - * @ORM\Column(name="given_url", type="text", nullable=true) + * @Assert\NotBlank() + * @ORM\Column(name="url", type="text", nullable=true) * * @Groups({"entries_for_user", "export_all"}) */ - private $givenUrl; + private $url; /** * @var string * - * @Assert\NotBlank() - * @ORM\Column(name="url", type="text", nullable=true) + * @ORM\Column(name="hashed_url", type="string", length=40, nullable=true) + */ + private $hashedUrl; + + /** + * From where user retrieved/found the url (an other article, a twitter, or the given_url if non are provided). + * + * @var string + * + * @ORM\Column(name="origin_url", type="text", nullable=true) * * @Groups({"entries_for_user", "export_all"}) */ - private $url; + private $originUrl; /** + * Define the url entered by the user (without redirections). + * * @var string * - * @ORM\Column(name="hashed_url", type="string", length=40, nullable=true) + * @ORM\Column(name="given_url", type="text", nullable=true) + * + * @Groups({"entries_for_user", "export_all"}) */ - private $hashedUrl; + private $givenUrl; + + /** + * @var string + * + * @ORM\Column(name="hashed_given_url", type="string", length=40, nullable=true) + */ + private $hashedGivenUrl; /** * @var bool @@ -273,15 +294,6 @@ class Entry */ private $tags; - /** - * @var string - * - * @ORM\Column(name="origin_url", type="text", nullable=true) - * - * @Groups({"entries_for_user", "export_all"}) - */ - private $originUrl; - /* * @param User $user */ @@ -325,30 +337,6 @@ class Entry return $this->title; } - /** - * Set given url. - * - * @param string $givenUrl - * - * @return Entry - */ - public function setGivenUrl($givenUrl) - { - $this->givenUrl = $givenUrl; - - return $this; - } - - /** - * Get given Url. - * - * @return string - */ - public function getGivenUrl() - { - return $this->givenUrl; - } - /** * Set url. * @@ -956,6 +944,31 @@ class Entry return $this->originUrl; } + /** + * Set origin url. + * + * @param string $givenUrl + * + * @return Entry + */ + public function setGivenUrl($givenUrl) + { + $this->givenUrl = $givenUrl; + $this->hashedGivenUrl = UrlHasher::hashUrl($givenUrl); + + return $this; + } + + /** + * Get origin url. + * + * @return string + */ + public function getGivenUrl() + { + return $this->givenUrl; + } + /** * @return string */ diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index 0d6a412d..5901df8b 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -76,9 +76,10 @@ class ContentProxy // Not sure what are the other possible cases where this property is empty if (empty($entry->getUrl()) && !empty($url)) { $entry->setUrl($url); - $entry->setGivenUrl($url); } + $entry->setGivenUrl($url); + $this->stockEntry($entry, $content); } diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 299b0b27..8b29aad2 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -368,7 +368,7 @@ class EntryRepository extends EntityRepository { $res = $this->createQueryBuilder('e') ->where('e.hashedUrl = :hashed_url')->setParameter('hashed_url', $hashedUrl) - // ->orWhere('e.givenUrl = :url')->setParameter('url', $url) + ->orWhere('e.hashedGivenUrl = :hashed_given_url')->setParameter('hashed_given_url', $hashedUrl) ->andWhere('e.user = :user_id')->setParameter('user_id', $userId) ->getQuery() ->getResult(); -- cgit v1.2.3 From 7abda3ba524219b8ce304ef2774e6352747c829e Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 29 May 2019 17:05:12 +0200 Subject: Drop SimplePie It was only used to make an absolute url when downloading images. The deps is still there (in the `composer.lock`) because Graby use it (not for absolute but for encoding). --- src/Wallabag/CoreBundle/Helper/DownloadImages.php | 31 +++++++++++------------ 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/DownloadImages.php b/src/Wallabag/CoreBundle/Helper/DownloadImages.php index 7a39a2e4..1d361d6d 100644 --- a/src/Wallabag/CoreBundle/Helper/DownloadImages.php +++ b/src/Wallabag/CoreBundle/Helper/DownloadImages.php @@ -2,6 +2,8 @@ namespace Wallabag\CoreBundle\Helper; +use GuzzleHttp\Psr7\Uri; +use GuzzleHttp\Psr7\UriResolver; use Http\Client\Common\HttpMethodsClient; use Http\Client\Common\Plugin\ErrorPlugin; use Http\Client\Common\PluginClient; @@ -45,10 +47,8 @@ class DownloadImages public static function extractImagesUrlsFromHtml($html) { $crawler = new Crawler($html); - $imagesCrawler = $crawler - ->filterXpath('//img'); - $imagesUrls = $imagesCrawler - ->extract(['src']); + $imagesCrawler = $crawler->filterXpath('//img'); + $imagesUrls = $imagesCrawler->extract(['src']); $imagesSrcsetUrls = self::getSrcsetUrls($imagesCrawler); return array_unique(array_merge($imagesUrls, $imagesSrcsetUrls)); @@ -220,22 +220,25 @@ class DownloadImages private static function getSrcsetUrls(Crawler $imagesCrawler) { $urls = []; - $iterator = $imagesCrawler - ->getIterator(); + $iterator = $imagesCrawler->getIterator(); + while ($iterator->valid()) { $srcsetAttribute = $iterator->current()->getAttribute('srcset'); + if ('' !== $srcsetAttribute) { // Couldn't start with " OR ' OR a white space // Could be one or more white space // Must be one or more digits followed by w OR x $pattern = "/(?:[^\"'\s]+\s*(?:\d+[wx])+)/"; preg_match_all($pattern, $srcsetAttribute, $matches); + $srcset = \call_user_func_array('array_merge', $matches); $srcsetUrls = array_map(function ($src) { return trim(explode(' ', $src, 2)[0]); }, $srcset); $urls = array_merge($srcsetUrls, $urls); } + $iterator->next(); } @@ -292,20 +295,16 @@ class DownloadImages return $url; } - $base = new \SimplePie_IRI($base); + $base = new Uri($base); - // remove '//' in URL path (causes URLs not to resolve properly) - if (isset($base->ipath)) { - $base->ipath = preg_replace('!//+!', '/', $base->ipath); - } + // in case the url has no scheme & host + if ('' === $base->getAuthority() || '' === $base->getScheme()) { + $this->logger->error('DownloadImages: Can not make an absolute link', ['base' => $base, 'url' => $url]); - if ($absolute = \SimplePie_IRI::absolutize($base, $url)) { - return $absolute->get_uri(); + return false; } - $this->logger->error('DownloadImages: Can not make an absolute link', ['base' => $base, 'url' => $url]); - - return false; + return (string) UriResolver::resolve($base, new Uri($url)); } /** -- cgit v1.2.3 From 70df4c335965a9562cc24d3ccea0a6ed1a23b7b1 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 5 Jun 2019 10:51:06 +0200 Subject: Use two indexes instead of one for hashed urls When using `OR` in a where clause, a composite index can't be used. We should use a `UNION` to take advantages of it. Instead, create 2 indexes on each hashed urls and make 2 queries to find an url. It'll be faster than the previous solution. --- src/Wallabag/CoreBundle/Entity/Entry.php | 3 ++- src/Wallabag/CoreBundle/Repository/EntryRepository.php | 13 ++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 304dd1b3..19f81c0f 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -27,7 +27,8 @@ use Wallabag\UserBundle\Entity\User; * indexes={ * @ORM\Index(name="created_at", columns={"created_at"}), * @ORM\Index(name="uid", columns={"uid"}), - * @ORM\Index(name="hashed_urls_user_id", columns={"user_id", "hashed_url", "hashed_given_url"}, options={"lengths"={null, 40, 40}}) + * @ORM\Index(name="hashed_url_user_id", columns={"user_id", "hashed_url"}, options={"lengths"={null, 40}}), + * @ORM\Index(name="hashed_given_url_user_id", columns={"user_id", "hashed_given_url"}, options={"lengths"={null, 40}}) * } * ) * @ORM\HasLifecycleCallbacks() diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 8b29aad2..7772e0b7 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -366,9 +366,20 @@ class EntryRepository extends EntityRepository */ public function findByHashedUrlAndUserId($hashedUrl, $userId) { + // try first using hashed_url (to use the database index) $res = $this->createQueryBuilder('e') ->where('e.hashedUrl = :hashed_url')->setParameter('hashed_url', $hashedUrl) - ->orWhere('e.hashedGivenUrl = :hashed_given_url')->setParameter('hashed_given_url', $hashedUrl) + ->andWhere('e.user = :user_id')->setParameter('user_id', $userId) + ->getQuery() + ->getResult(); + + if (\count($res)) { + return current($res); + } + + // then try using hashed_given_url (to use the database index) + $res = $this->createQueryBuilder('e') + ->where('e.hashedGivenUrl = :hashed_given_url')->setParameter('hashed_given_url', $hashedUrl) ->andWhere('e.user = :user_id')->setParameter('user_id', $userId) ->getQuery() ->getResult(); -- cgit v1.2.3 From d8809f70ea3a2f88635827b37af23b2fc2a93db6 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 5 Jun 2019 10:54:43 +0200 Subject: Typos --- src/Wallabag/CoreBundle/Entity/Entry.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 19f81c0f..4a9cb8d8 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -946,7 +946,7 @@ class Entry } /** - * Set origin url. + * Set given url. * * @param string $givenUrl * @@ -961,7 +961,7 @@ class Entry } /** - * Get origin url. + * Get given url. * * @return string */ -- cgit v1.2.3 From d010bdd44bb9fad4eff594878443a1d3b4e0e044 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 5 Jun 2019 15:51:22 +0200 Subject: Add quickstart into the menu Just in case people want to see that page again. --- src/Wallabag/CoreBundle/Resources/translations/messages.da.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.de.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.en.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.es.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.it.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml | 2 ++ src/Wallabag/CoreBundle/Resources/translations/messages.th.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml | 1 + src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig | 1 + .../CoreBundle/Resources/views/themes/material/layout.html.twig | 3 +++ 16 files changed, 19 insertions(+) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index e04c2ff1..d9440e84 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -33,6 +33,7 @@ menu: back_to_unread: 'Tilbage til de ulæste artikler' # users_management: 'Users management' # site_credentials: 'Site credentials' + # quickstart: "Quickstart" top: add_new_entry: 'Tilføj ny artikel' search: 'Søg' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 5a9668a9..d3ca30cd 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -33,6 +33,7 @@ menu: back_to_unread: 'Zurück zu ungelesenen Artikeln' users_management: 'Benutzerverwaltung' site_credentials: 'Zugangsdaten' + quickstart: "Schnelleinstieg" top: add_new_entry: 'Neuen Artikel hinzufügen' search: 'Suche' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index e2994f53..7fd67ed2 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -33,6 +33,7 @@ menu: back_to_unread: 'Back to unread articles' users_management: 'Users management' site_credentials: 'Site credentials' + quickstart: "Quickstart" top: add_new_entry: 'Add a new entry' search: 'Search' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index d1ccfc81..d37cd08d 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -33,6 +33,7 @@ menu: back_to_unread: 'Volver a los artículos sin leer' users_management: 'Configuración de usuarios' # site_credentials: 'Site credentials' + quickstart: "Inicio rápido" top: add_new_entry: 'Añadir un nuevo artículo' search: 'Buscar' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index e5d36bd3..1f74deba 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -33,6 +33,7 @@ menu: back_to_unread: 'بازگشت به خوانده‌نشده‌ها' # users_management: 'Users management' # site_credentials: 'Site credentials' + quickstart: "Quickstart" top: add_new_entry: 'افزودن مقالهٔ تازه' search: 'جستجو' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 0b1853a4..f0ff9c7b 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -33,6 +33,7 @@ menu: back_to_unread: "Retour aux articles non lus" users_management: "Gestion des utilisateurs" site_credentials: 'Accès aux sites' + quickstart: "Pour bien débuter" top: add_new_entry: "Sauvegarder un nouvel article" search: "Rechercher" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 0474d2bc..68495bad 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -33,6 +33,7 @@ menu: back_to_unread: 'Torna ai contenuti non letti' users_management: 'Gestione utenti' site_credentials: 'Credenziali sito' + quickstart: "Introduzione" top: add_new_entry: 'Aggiungi un nuovo contenuto' search: 'Cerca' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index e761832e..4c4e0a86 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -33,6 +33,7 @@ menu: back_to_unread: 'Tornar als articles pas legits' users_management: 'Gestion dels utilizaires' site_credentials: 'Identificants del site' + quickstart: "Per ben començar" top: add_new_entry: 'Enregistrar un novèl article' search: 'Cercar' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index f3d506e5..edfc7f4e 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -33,6 +33,7 @@ menu: back_to_unread: 'Powrót do nieprzeczytanych artykułów' users_management: 'Zarządzanie użytkownikami' site_credentials: 'Poświadczenia strony' + quickstart: "Szybki start" top: add_new_entry: 'Dodaj nowy wpis' search: 'Szukaj' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 6ddc1fc1..400f1d56 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -33,6 +33,7 @@ menu: back_to_unread: 'Voltar para os artigos não lidos' users_management: 'Gestão de Usuários' # site_credentials: 'Site credentials' + quickstart: "Começo Rápido" top: add_new_entry: 'Adicionar uma nova entrada' search: 'Pesquisa' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index 8c0791f0..21e920e6 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -33,6 +33,7 @@ menu: back_to_unread: 'Înapoi la articolele necitite' # users_management: 'Users management' # site_credentials: 'Site credentials' + # quickstart: "Quickstart" top: add_new_entry: 'Introdu un nou articol' search: 'Căutare' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index 2ee2d83a..cd7c165c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -32,6 +32,8 @@ menu: save_link: 'Сохранить ссылку' back_to_unread: 'Назад к непрочитанным записям' users_management: 'Управление пользователями' + site_credentials: 'Site credentials' + quickstart: "Быстрый старт" top: add_new_entry: 'Добавить новую запись' search: 'Поиск' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index 967ae427..5e772ddb 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -33,6 +33,7 @@ menu: back_to_unread: 'กลับไปยังรายการที่ไม่ได้อ่าน' users_management: 'การจัดการผู้ใช้' site_credentials: 'การรับรองไซต์' + quickstart: "เริ่มแบบด่วน" top: add_new_entry: 'เพิ่มรายการใหม่' search: 'ค้นหา' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 2f86f25d..ad11688a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -33,6 +33,7 @@ menu: back_to_unread: 'Okunmayan makalelere geri dön' # users_management: 'Users management' # site_credentials: 'Site credentials' + quickstart: "Hızlı başlangıç" top: add_new_entry: 'Yeni bir makale ekle' search: 'Ara' diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig index 35a54daf..6b1e2bd7 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig @@ -50,6 +50,7 @@ +
    {% endblock %} 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 b9c45567..c51d07fc 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig @@ -91,6 +91,9 @@
  • {{ 'menu.left.howto'|trans }}
  • +
  • + {{ 'menu.left.quickstart'|trans }} +
  • {{ 'menu.left.logout'|trans }}
  • -- cgit v1.2.3 From ad51743e8bd15782a25c5e717c87786d34091ce3 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 2 Sep 2018 16:43:49 +0200 Subject: Show untagged entries count on tag list Closes #3235 Signed-off-by: Kevin Decherf --- src/Wallabag/CoreBundle/Controller/TagController.php | 3 +++ src/Wallabag/CoreBundle/Repository/EntryRepository.php | 14 ++++++++++++++ .../Resources/views/themes/baggy/Tag/tags.html.twig | 2 +- .../Resources/views/themes/material/Tag/tags.html.twig | 2 +- 4 files changed, 19 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index d0155c60..bd50de7f 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php @@ -87,6 +87,8 @@ class TagController extends Controller { $tags = $this->get('wallabag_core.tag_repository') ->findAllFlatTagsWithNbEntries($this->getUser()->getId()); + $untagged = $this->get('wallabag_core.entry_repository') + ->countUntaggedEntriesForUser($this->getUser()->getId()); $renameForms = []; foreach ($tags as $tag) { @@ -96,6 +98,7 @@ class TagController extends Controller return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [ 'tags' => $tags, 'renameForms' => $renameForms, + 'untagged' => $untagged, ]); } diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 16c44885..77d88c9c 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -129,6 +129,20 @@ class EntryRepository extends EntityRepository ->andWhere('t.id is null'); } + /** + * Retrieve the number of untagged entries for a user. + * + * @param int $userId + * + * @return int + */ + public function countUntaggedEntriesByUser($userId) + { + return $this->getRawBuilderForUntaggedByUser($userId) + ->select('count(e.id)') + ->getSingleScalarResult(); + } + /** * Find Entries. * diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig index ae8403bd..cddd6e13 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig @@ -31,6 +31,6 @@ {% endblock %} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig index 79907bbb..552cafc9 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig @@ -34,6 +34,6 @@ {% endblock %} -- cgit v1.2.3 From 0f2d24feb4709bf0ea97e6152e8a607aaa3c1c72 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 5 Jun 2019 17:09:05 +0200 Subject: Fix typo & CS --- src/Wallabag/CoreBundle/Controller/TagController.php | 2 +- src/Wallabag/CoreBundle/Repository/EntryRepository.php | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index bd50de7f..91f34b3d 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php @@ -88,7 +88,7 @@ class TagController extends Controller $tags = $this->get('wallabag_core.tag_repository') ->findAllFlatTagsWithNbEntries($this->getUser()->getId()); $untagged = $this->get('wallabag_core.entry_repository') - ->countUntaggedEntriesForUser($this->getUser()->getId()); + ->countUntaggedEntriesByUser($this->getUser()->getId()); $renameForms = []; foreach ($tags as $tag) { diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 77d88c9c..d9675982 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -131,15 +131,16 @@ class EntryRepository extends EntityRepository /** * Retrieve the number of untagged entries for a user. - * + * * @param int $userId - * + * * @return int */ public function countUntaggedEntriesByUser($userId) { - return $this->getRawBuilderForUntaggedByUser($userId) + return (int) $this->getRawBuilderForUntaggedByUser($userId) ->select('count(e.id)') + ->getQuery() ->getSingleScalarResult(); } -- cgit v1.2.3 From c4bf12aadee9e1f757fd9d783b034bb57b03fb17 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 5 Jun 2019 17:55:13 +0200 Subject: Add ability to revoke feed token --- .../CoreBundle/Controller/ConfigController.php | 28 ++++++++++++++++++++++ .../Resources/translations/messages.da.yml | 2 ++ .../Resources/translations/messages.de.yml | 2 ++ .../Resources/translations/messages.en.yml | 2 ++ .../Resources/translations/messages.es.yml | 2 ++ .../Resources/translations/messages.fa.yml | 2 ++ .../Resources/translations/messages.fr.yml | 2 ++ .../Resources/translations/messages.it.yml | 2 ++ .../Resources/translations/messages.oc.yml | 2 ++ .../Resources/translations/messages.pl.yml | 2 ++ .../Resources/translations/messages.pt.yml | 2 ++ .../Resources/translations/messages.ro.yml | 2 ++ .../Resources/translations/messages.ru.yml | 2 ++ .../Resources/translations/messages.th.yml | 2 ++ .../Resources/translations/messages.tr.yml | 1 + .../views/themes/baggy/Config/index.html.twig | 16 ++++++------- .../views/themes/material/Config/index.html.twig | 9 +++---- 17 files changed, 68 insertions(+), 12 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index 3b281d48..cea41303 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -299,6 +299,34 @@ class ConfigController extends Controller return $this->redirect($this->generateUrl('config') . '#set2'); } + /** + * @param Request $request + * + * @Route("/revoke-token", name="revoke_token") + * + * @return RedirectResponse|JsonResponse + */ + public function revokeTokenAction(Request $request) + { + $config = $this->getConfig(); + $config->setFeedToken(null); + + $em = $this->getDoctrine()->getManager(); + $em->persist($config); + $em->flush(); + + if ($request->isXmlHttpRequest()) { + return new JsonResponse(); + } + + $this->addFlash( + 'notice', + 'flashes.config.notice.feed_token_revoked' + ); + + return $this->redirect($this->generateUrl('config') . '#set2'); + } + /** * Deletes a tagging rule and redirect to the config homepage. * diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index e04c2ff1..330b2755 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -91,6 +91,7 @@ config: no_token: 'Intet token' token_create: 'Opret token' token_reset: 'Nulstil token' + # token_revoke: 'Revoke the token' feed_links: 'RSS-Links' feed_link: unread: 'Ulæst' @@ -593,6 +594,7 @@ flashes: # tagging_rules_updated: 'Tagging rules updated' # tagging_rules_deleted: 'Tagging rule deleted' # feed_token_updated: 'RSS token updated' + # feed_token_revoked: 'RSS token revoked' # annotations_reset: Annotations reset # tags_reset: Tags reset # entries_reset: Entries reset diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 5a9668a9..6f81dc9a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -91,6 +91,7 @@ config: no_token: 'Kein Token' token_create: 'Token erstellen' token_reset: 'Token zurücksetzen' + # token_revoke: 'Revoke the token' feed_links: 'RSS-Links' feed_link: unread: 'Ungelesene' @@ -584,6 +585,7 @@ flashes: tagging_rules_updated: 'Tagging-Regeln aktualisiert' tagging_rules_deleted: 'Tagging-Regel gelöscht' feed_token_updated: 'RSS-Token aktualisiert' + # feed_token_revoked: 'RSS token revoked' annotations_reset: Anmerkungen zurücksetzen tags_reset: Tags zurücksetzen entries_reset: Einträge zurücksetzen diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index e2994f53..8533f82a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -91,6 +91,7 @@ config: no_token: 'No token' token_create: 'Create your token' token_reset: 'Regenerate your token' + token_revoke: 'Revoke the token' feed_links: 'Feed links' feed_link: unread: 'Unread' @@ -593,6 +594,7 @@ flashes: tagging_rules_updated: 'Tagging rules updated' tagging_rules_deleted: 'Tagging rule deleted' feed_token_updated: 'Feed token updated' + feed_token_revoked: 'RSS token revoked' annotations_reset: Annotations reset tags_reset: Tags reset entries_reset: Entries reset diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index d1ccfc81..51f3d69d 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -91,6 +91,7 @@ config: no_token: 'Sin token' token_create: 'Crear token' token_reset: 'Reiniciar token' + # token_revoke: 'Revoke the token' feed_links: 'URLs de feeds RSS' feed_link: unread: 'sin leer' @@ -593,6 +594,7 @@ flashes: tagging_rules_updated: 'Regla de etiquetado actualizada' tagging_rules_deleted: 'Regla de etiquetado eliminada' feed_token_updated: 'Token RSS actualizado' + # feed_token_revoked: 'RSS token revoked' annotations_reset: Anotaciones reiniciadas tags_reset: Etiquetas reiniciadas entries_reset: Artículos reiniciados diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index e5d36bd3..6a9cd09b 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -91,6 +91,7 @@ config: no_token: 'بدون کد' token_create: 'کد خود را بسازید' token_reset: 'بازنشانی کد' + # token_revoke: 'Revoke the token' feed_links: 'پیوند آر-اس-اس' feed_link: unread: 'خوانده‌نشده' @@ -593,6 +594,7 @@ flashes: tagging_rules_updated: 'برچسب‌گذاری خودکار به‌روز شد' tagging_rules_deleted: 'قانون برچسب‌گذاری پاک شد' feed_token_updated: 'کد آر-اس-اس به‌روز شد' + # feed_token_revoked: 'RSS token revoked' # annotations_reset: Annotations reset # tags_reset: Tags reset # entries_reset: Entries reset diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 0b1853a4..0367ec48 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -91,6 +91,7 @@ config: no_token: "Aucun jeton généré" token_create: "Créez votre jeton" token_reset: "Réinitialisez votre jeton" + token_revoke: 'Supprimer le jeton' feed_links: "Adresses de vos flux" feed_link: unread: "Non lus" @@ -594,6 +595,7 @@ flashes: tagging_rules_updated: "Règles mises à jour" tagging_rules_deleted: "Règle supprimée" feed_token_updated: "Jeton des flux mis à jour" + feed_token_revoked: 'Jeton des flux supprimé' annotations_reset: "Annotations supprimées" tags_reset: "Tags supprimés" entries_reset: "Articles supprimés" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 0474d2bc..02a6145c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -91,6 +91,7 @@ config: no_token: 'Nessun token' token_create: 'Crea il tuo token' token_reset: 'Rigenera il tuo token' + # token_revoke: 'Revoke the token' feed_links: 'Collegamenti RSS' feed_link: unread: 'Non letti' @@ -592,6 +593,7 @@ flashes: tagging_rules_updated: 'Regole di etichettatura aggiornate' tagging_rules_deleted: 'Regola di etichettatura eliminate' feed_token_updated: 'RSS token aggiornato' + # feed_token_revoked: 'RSS token revoked' annotations_reset: Reset annotazioni tags_reset: Reset etichette entries_reset: Reset articoli diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index e761832e..aadc8358 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -91,6 +91,7 @@ config: no_token: 'Pas cap de geton generat' token_create: 'Creatz vòstre geton' token_reset: 'Reïnicializatz vòstre geton' + # token_revoke: 'Revoke the token' feed_links: 'URLs de vòstres fluxes RSS' feed_link: unread: 'Pas legits' @@ -592,6 +593,7 @@ flashes: tagging_rules_updated: 'Règlas misa a jorn' tagging_rules_deleted: 'Règla suprimida' feed_token_updated: 'Geton RSS mes a jorn' + # feed_token_revoked: 'RSS token revoked' annotations_reset: Anotacions levadas tags_reset: Etiquetas levadas entries_reset: Articles levats diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index f3d506e5..780251d8 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -91,6 +91,7 @@ config: no_token: 'Brak tokena' token_create: 'Stwórz tokena' token_reset: 'Zresetuj swojego tokena' + # token_revoke: 'Revoke the token' feed_links: 'RSS links' feed_link: unread: 'Nieprzeczytane' @@ -592,6 +593,7 @@ flashes: tagging_rules_updated: 'Reguły tagowania zaktualizowane' tagging_rules_deleted: 'Reguła tagowania usunięta' feed_token_updated: 'Token kanału RSS zaktualizowany' + # feed_token_revoked: 'RSS token revoked' annotations_reset: Zresetuj adnotacje tags_reset: Zresetuj tagi entries_reset: Zresetuj wpisy diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 6ddc1fc1..e811c821 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -91,6 +91,7 @@ config: no_token: 'Nenhum Token' token_create: 'Criar seu token' token_reset: 'Gerar novamente seu token' + # token_revoke: 'Revoke the token' feed_links: 'Links RSS' feed_link: unread: 'Não lido' @@ -592,6 +593,7 @@ flashes: tagging_rules_updated: 'Regras de tags atualizadas' tagging_rules_deleted: 'Regra de tag apagada' feed_token_updated: 'Token RSS atualizado' + # feed_token_revoked: 'RSS token revoked' # annotations_reset: Annotations reset # tags_reset: Tags reset # entries_reset: Entries reset diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index 8c0791f0..4e2067d3 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -91,6 +91,7 @@ config: no_token: 'Fără token' token_create: 'Crează-ți token' token_reset: 'Resetează-ți token-ul' + # token_revoke: 'Revoke the token' feed_links: 'Link-uri RSS' feed_link: unread: 'Unread' @@ -592,6 +593,7 @@ flashes: # tagging_rules_updated: 'Tagging rules updated' # tagging_rules_deleted: 'Tagging rule deleted' # feed_token_updated: 'RSS token updated' + # feed_token_revoked: 'RSS token revoked' # annotations_reset: Annotations reset # tags_reset: Tags reset # entries_reset: Entries reset diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index 2ee2d83a..d1040a6b 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -89,6 +89,7 @@ config: no_token: 'Ключ не задан' token_create: 'Создать ключ' token_reset: 'Пересоздать ключ' + # token_revoke: 'Revoke the token' feed_links: 'ссылка на RSS' feed_link: unread: 'непрочитанные' @@ -558,6 +559,7 @@ flashes: tagging_rules_updated: 'Правила тегировния обновлены' tagging_rules_deleted: 'Правила тегировния удалены' feed_token_updated: 'RSS ключ обновлен' + # feed_token_revoked: 'RSS token revoked' annotations_reset: "Аннотации сброшены" tags_reset: "Теги сброшены" entries_reset: "Записи сброшены" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index 967ae427..bf2bd1f5 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -91,6 +91,7 @@ config: no_token: 'ไม่มีเครื่องหมาย' token_create: 'สร้างเครื่องหมาย' token_reset: 'ทำเครื่องหมาย' + # token_revoke: 'Revoke the token' feed_links: 'ลิงค์ RSS' feed_link: unread: 'ยังไมได้่อ่าน' @@ -590,6 +591,7 @@ flashes: tagging_rules_updated: 'อัปเดตการแท็กข้อบังคับ' tagging_rules_deleted: 'การลบข้อบังคับของแท็ก' feed_token_updated: 'อัปเดตเครื่องหมาย RSS ' + # feed_token_revoked: 'RSS token revoked' annotations_reset: รีเซ็ตหมายเหตุ tags_reset: รีเซ็ตแท็ก entries_reset: รีเซ็ตรายการ diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 2f86f25d..93fb6ca1 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -91,6 +91,7 @@ config: no_token: 'Belirteç (token) yok' token_create: 'Yeni belirteç (token) oluştur' token_reset: 'Belirteci (token) sıfırla' + # token_revoke: 'Revoke the token' feed_links: 'RSS akış bağlantıları' feed_link: unread: 'Okunmayan' 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 4ef6ab3c..a1caf242 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 @@ -111,14 +111,14 @@ {% else %} {{ 'config.form_feed.no_token'|trans }} {% endif %} - – - - {% if feed.token %} - {{ 'config.form_feed.token_reset'|trans }} - {% else %} - {{ 'config.form_feed.token_create'|trans }} - {% endif %} - + + {% if feed.token %} + – {{ 'config.form_feed.token_reset'|trans }} + – {{ 'config.form_feed.token_revoke'|trans }} + {% else %} + – {{ 'config.form_feed.token_create'|trans }} + {% endif %} + 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 818fc4e7..a48c9e28 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 @@ -140,12 +140,13 @@ {% else %} {{ 'config.form_feed.no_token'|trans }} {% endif %} - – + {% if feed.token %} - {{ 'config.form_feed.token_reset'|trans }} + – {{ 'config.form_feed.token_reset'|trans }} + – {{ 'config.form_feed.token_revoke'|trans }} {% else %} - {{ 'config.form_feed.token_create'|trans }} - {% endif %} + – {{ 'config.form_feed.token_create'|trans }} + {% endif %} -- cgit v1.2.3 From 35c7819cb63a9c481a2b612755d881d24d6586d0 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 6 Jun 2019 13:34:20 +0200 Subject: Remove link when there are no untagged articles --- src/Wallabag/CoreBundle/Controller/TagController.php | 4 ++-- src/Wallabag/CoreBundle/Resources/translations/messages.da.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.de.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.en.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.es.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.it.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.th.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml | 1 + .../CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig | 6 +++++- .../CoreBundle/Resources/views/themes/material/Tag/tags.html.twig | 6 +++++- 17 files changed, 26 insertions(+), 4 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index 91f34b3d..90d36d71 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php @@ -87,7 +87,7 @@ class TagController extends Controller { $tags = $this->get('wallabag_core.tag_repository') ->findAllFlatTagsWithNbEntries($this->getUser()->getId()); - $untagged = $this->get('wallabag_core.entry_repository') + $nbEntriesUntagged = $this->get('wallabag_core.entry_repository') ->countUntaggedEntriesByUser($this->getUser()->getId()); $renameForms = []; @@ -98,7 +98,7 @@ class TagController extends Controller return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [ 'tags' => $tags, 'renameForms' => $renameForms, - 'untagged' => $untagged, + 'nbEntriesUntagged' => $nbEntriesUntagged, ]); } diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index e04c2ff1..a01c7688 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -420,6 +420,7 @@ tag: list: # number_on_the_page: '{0} There is no tag.|{1} There is one tag.|]1,Inf[ There are %count% tags.' # see_untagged_entries: 'See untagged entries' + # no_untagged_entries: 'There are no untagged entries.' new: # add: 'Add' # placeholder: 'You can add several tags, separated by a comma.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 5a9668a9..a1b41855 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -411,6 +411,7 @@ tag: list: number_on_the_page: '{0} Es gibt keine Tags.|{1} Es gibt einen Tag.|]1,Inf[ Es gibt %count% Tags.' see_untagged_entries: 'Zeige nicht getaggte Einträge' + # no_untagged_entries: 'There are no untagged entries.' new: add: 'Hinzufügen' placeholder: 'Du kannst verschiedene Tags, getrennt von einem Komma, hinzufügen.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index e2994f53..020cd08a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -420,6 +420,7 @@ tag: list: number_on_the_page: '{0} There are no tags.|{1} There is one tag.|]1,Inf[ There are %count% tags.' see_untagged_entries: 'See untagged entries' + no_untagged_entries: 'There are no untagged entries.' new: add: 'Add' placeholder: 'You can add several tags, separated by a comma.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index d1ccfc81..130c12f3 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -420,6 +420,7 @@ tag: list: number_on_the_page: '{0} No hay ninguna etiqueta.|{1} Hay una etiqueta.|]1,Inf[ Hay %count% etiquetas.' see_untagged_entries: 'Ver artículos sin etiquetas' + # no_untagged_entries: 'There are no untagged entries.' new: add: 'Añadir' placeholder: 'Puedes añadir varias etiquetas, separadas por una coma.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index e5d36bd3..31db51fa 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -420,6 +420,7 @@ tag: list: number_on_the_page: '{0} هیچ برچسبی نیست.|{1} یک برچسب هست.|]1,Inf[ %count% برچسب هست.' # see_untagged_entries: 'See untagged entries' + # no_untagged_entries: 'There are no untagged entries.' new: # add: 'Add' # placeholder: 'You can add several tags, separated by a comma.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 0b1853a4..df3692dc 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -420,6 +420,7 @@ tag: list: number_on_the_page: "{0} Il n’y a pas de tag.|{1} Il y a un tag.|]1,Inf[ Il y a %count% tags." see_untagged_entries: "Voir les articles sans tag" + no_untagged_entries: 'Aucun article sans tag.' new: add: "Ajouter" placeholder: "Vous pouvez ajouter plusieurs tags, séparés par une virgule." diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 0474d2bc..337a1bfa 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -419,6 +419,7 @@ tag: list: number_on_the_page: "{0} Non ci sono etichette.|{1} C'è un'etichetta.|]1,Inf[ ci sono %count% etichette." see_untagged_entries: 'Vedi articoli non etichettati' + # no_untagged_entries: 'There are no untagged entries.' new: add: 'Aggiungi' placeholder: 'Puoi aggiungere varie etichette, separate da una virgola.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index e761832e..fc0a03b5 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -419,6 +419,7 @@ tag: list: number_on_the_page: "{0} I a pas cap d'etiquetas.|{1} I a una etiqueta.|]1,Inf[ I a %count% etiquetas." see_untagged_entries: "Afichar las entradas sens etiquetas" + # no_untagged_entries: 'There are no untagged entries.' new: add: 'Ajustar' placeholder: "Podètz ajustar mai qu'una etiqueta, separadas per de virgula." diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index f3d506e5..f9609ea2 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -419,6 +419,7 @@ tag: list: number_on_the_page: '{0} Nie ma tagów.|{1} Jest jeden tag.|]1,Inf[ Są %count% tagi.' see_untagged_entries: 'Zobacz nieotagowane wpisy' + # no_untagged_entries: 'There are no untagged entries.' new: add: 'Dodaj' placeholder: 'Możesz dodać kilka tagów, oddzielając je przecinkami.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 6ddc1fc1..e9d3a6cf 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -419,6 +419,7 @@ tag: list: number_on_the_page: '{0} Não existem tags.|{1} Uma tag.|]1,Inf[ Existem %count% tags.' see_untagged_entries: 'Ver entradas sem tags' + # no_untagged_entries: 'There are no untagged entries.' new: # add: 'Add' # placeholder: 'You can add several tags, separated by a comma.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index 8c0791f0..dde0c9a1 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -419,6 +419,7 @@ tag: list: # number_on_the_page: '{0} There is no tag.|{1} There is one tag.|]1,Inf[ There are %count% tags.' # see_untagged_entries: 'See untagged entries' + # no_untagged_entries: 'There are no untagged entries.' new: # add: 'Add' # placeholder: 'You can add several tags, separated by a comma.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index 2ee2d83a..8dcba74b 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -407,6 +407,7 @@ tag: list: number_on_the_page: '{0} Теги не найдены.|{1} Найден один тег.|]1,Inf[ Найдено %count% тегов.' see_untagged_entries: 'Просмотреть записи без тегов' + # no_untagged_entries: 'There are no untagged entries.' new: add: 'Добавить' placeholder: 'Вы можете добавить несколько тегов, разделенных запятой.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index 967ae427..8dc65dd6 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -417,6 +417,7 @@ tag: list: number_on_the_page: '{0} ไม่มีการแท็ก|{1} มีหนึ่งแท็ก|]1,Inf[ มี %count% แท็ก' see_untagged_entries: 'พบรายการที่ไม่ได้แท็ก' + # no_untagged_entries: 'There are no untagged entries.' new: add: 'เพิ่ม' placeholder: 'คุณสามารถเพิ่มได้หลายแท็ก, จากการแบ่งโดย comma' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 2f86f25d..49ebe79f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -417,6 +417,7 @@ tag: list: number_on_the_page: '{0} Herhangi bir etiket yok.|{1} Burada bir adet etiket var.|]1,Inf[ Burada %count% adet etiket var.' # see_untagged_entries: 'See untagged entries' + # no_untagged_entries: 'There are no untagged entries.' new: # add: 'Add' # placeholder: 'You can add several tags, separated by a comma.' diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig index cddd6e13..aa17b842 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Tag/tags.html.twig @@ -31,6 +31,10 @@
    - {{ 'tag.list.see_untagged_entries'|trans }} ({{untagged}}) + {% if nbEntriesUntagged == 0 %} + {{ 'tag.list.no_untagged_entries'|trans }} + {% else %} + {{ 'tag.list.see_untagged_entries'|trans }} ({{nbEntriesUntagged}}) + {% endif %}
    {% endblock %} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig index 552cafc9..0a3475ef 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Tag/tags.html.twig @@ -34,6 +34,10 @@
    - {{ 'tag.list.see_untagged_entries'|trans }} ({{untagged}}) + {% if nbEntriesUntagged == 0 %} + {{ 'tag.list.no_untagged_entries'|trans }} + {% else %} + {{ 'tag.list.see_untagged_entries'|trans }} ({{nbEntriesUntagged}}) + {% endif %}
    {% endblock %} -- cgit v1.2.3 From 35c4c80148fd5f31cf34753890b2b0c69fc414ef Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 6 Jun 2019 13:51:25 +0200 Subject: Display login in config / user Just so the user can see its login --- src/Wallabag/CoreBundle/Resources/translations/messages.da.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.de.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.en.yml | 9 +++++---- src/Wallabag/CoreBundle/Resources/translations/messages.es.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml | 7 ++++--- src/Wallabag/CoreBundle/Resources/translations/messages.it.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.th.yml | 1 + src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml | 1 + .../Resources/views/themes/baggy/Config/index.html.twig | 7 ++++++- .../Resources/views/themes/material/Config/index.html.twig | 9 +++++++++ 16 files changed, 36 insertions(+), 8 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index c6a91cd1..e9552ce0 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -102,6 +102,7 @@ config: # feed_limit: 'Number of items in the feed' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." + # login_label: 'Login' name_label: 'Navn' email_label: 'Emailadresse' two_factor: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 4b785306..67744aeb 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -102,6 +102,7 @@ config: feed_limit: 'Anzahl der Einträge pro Feed' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." + # login_label: 'Login' name_label: 'Name' email_label: 'E-Mail-Adresse' two_factor: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 1f8c47aa..2dda77bb 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -5,7 +5,7 @@ security: forgot_password: 'Forgot your password?' submit: 'Login' register: 'Register' - username: 'Username' + username: 'Login' password: 'Password' cancel: 'Cancel' resetting: @@ -102,6 +102,7 @@ config: feed_limit: 'Number of items in the feed' form_user: two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." + login_label: 'Login' name_label: 'Name' email_label: 'Email' two_factor: @@ -544,7 +545,7 @@ user: no: No create_new_one: Create a new user form: - username_label: 'Username' + username_label: 'Login' name_label: 'Name' password_label: 'Password' repeat_new_password_label: 'Repeat new password' @@ -559,7 +560,7 @@ user: delete_confirm: Are you sure? back_to_list: Back to list search: - placeholder: Filter by username or email + placeholder: Filter by login or email site_credential: page_title: Site credentials management @@ -573,7 +574,7 @@ site_credential: no: No create_new_one: Create a new credential form: - username_label: 'Username' + username_label: 'Login' host_label: 'Host (subdomain.example.org, .example.org, etc.)' password_label: 'Password' save: Save diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 06fa1e48..aa649799 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -102,6 +102,7 @@ config: feed_limit: 'Límite de artículos en feed RSS' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." + # login_label: 'Login' name_label: 'Nombre' email_label: 'Dirección de e-mail' two_factor: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index 5c1eaccc..5f9e7b6c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -102,6 +102,7 @@ config: feed_limit: 'محدودیت آر-اس-اس' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." + # login_label: 'Login' name_label: 'نام' email_label: 'نشانی ایمیل' two_factor: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 09c1cc8f..9597ef49 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -5,7 +5,7 @@ security: forgot_password: "Mot de passe oublié ?" submit: "Se connecter" register: "Créer un compte" - username: "Nom d’utilisateur" + username: "Identifiant" password: "Mot de passe" cancel: "Annuler" resetting: @@ -102,6 +102,7 @@ config: feed_limit: "Nombre d’articles dans le flux" form_user: two_factor_description: "Activer l’authentification double-facteur veut dire que vous allez recevoir un code par courriel OU que vous devriez utiliser une application de mot de passe à usage unique (comme Google Authenticator, Authy or FreeOTP) pour obtenir un code temporaire à chaque nouvelle connexion non approuvée. Vous ne pouvez pas choisir les deux options." + login_label: 'Identifiant' name_label: "Nom" email_label: "Adresse courriel" two_factor: @@ -544,7 +545,7 @@ user: no: "Non" create_new_one: "Créer un nouvel utilisateur" form: - username_label: "Nom d’utilisateur" + username_label: "Identifiant" name_label: "Nom" password_label: "Mot de passe" repeat_new_password_label: "Confirmez votre nouveau mot de passe" @@ -560,7 +561,7 @@ user: delete_confirm: "Êtes-vous sûr ?" back_to_list: "Revenir à la liste" search: - placeholder: "Filtrer par nom d’utilisateur ou email" + placeholder: "Filtrer par identifiant ou email" site_credential: page_title: Gestion des accès aux sites diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 92f2415b..6912df0f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -102,6 +102,7 @@ config: feed_limit: 'Numero di elementi nel feed' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." + # login_label: 'Login' name_label: 'Nome' email_label: 'E-mail' # emailTwoFactor_label: 'Using email (receive a code by email)' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 4439cbcd..8d07f8db 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -102,6 +102,7 @@ config: feed_limit: "Nombre d'articles dins un flux" form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." + # login_label: 'Login' name_label: 'Nom' email_label: 'Adreça de corrièl' # emailTwoFactor_label: 'Using email (receive a code by email)' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 8311770f..bf7e2930 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -102,6 +102,7 @@ config: feed_limit: 'Link do RSS' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." + # login_label: 'Login' name_label: 'Nazwa' email_label: 'Adres email' # emailTwoFactor_label: 'Using email (receive a code by email)' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index c83bf6c1..ba36baa4 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -102,6 +102,7 @@ config: feed_limit: 'Número de itens no feed' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." + # login_label: 'Login' name_label: 'Nome' email_label: 'E-mail' # emailTwoFactor_label: 'Using email (receive a code by email)' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index c8bf8083..b8e6883a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -102,6 +102,7 @@ config: feed_limit: 'Limită RSS' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." + # login_label: 'Login' name_label: 'Nume' email_label: 'E-mail' # emailTwoFactor_label: 'Using email (receive a code by email)' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index 5d0e70c9..443826d7 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -100,6 +100,7 @@ config: feed_limit: 'Количество записей в фиде' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." + # login_label: 'Login' name_label: 'Имя' email_label: 'Email' # emailTwoFactor_label: 'Using email (receive a code by email)' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index 66426d53..f006bf3a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -102,6 +102,7 @@ config: feed_limit: 'จำนวนไอเทมที่เก็บ' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." + # login_label: 'Login' name_label: 'ชื่อ' email_label: 'อีเมล' # emailTwoFactor_label: 'Using email (receive a code by email)' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 50bd38e3..3920266d 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -102,6 +102,7 @@ config: feed_limit: 'RSS içeriğinden talep edilecek makale limiti' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." + # login_label: 'Login' name_label: 'İsim' email_label: 'E-posta' # emailTwoFactor_label: 'Using email (receive a code by email)' 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 a1caf242..eba4539f 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 @@ -118,7 +118,6 @@ {% else %} – {{ 'config.form_feed.token_create'|trans }} {% endif %} - @@ -151,6 +150,12 @@ {{ form_start(form.user) }} {{ form_errors(form.user) }} +
    +
    + + {{ app.user.username }} +
    +
    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 a48c9e28..990546e8 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 @@ -181,6 +181,15 @@ {{ form_start(form.user) }} {{ form_errors(form.user) }} +
    +
    +
    {{ 'config.form_user.login_label'|trans }}
    +
    + {{ app.user.username }} +
    +
    +
    +
    {{ form_label(form.user.name) }} -- cgit v1.2.3 From 871216861aa1402616aa1bce47f852356b1a8f3d Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 6 Jun 2019 15:14:41 +0200 Subject: Update translations --- src/Wallabag/CoreBundle/Resources/translations/messages.da.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.de.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.en.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.es.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.it.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.th.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index e9552ce0..bf0c860e 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -102,7 +102,7 @@ config: # feed_limit: 'Number of items in the feed' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." - # login_label: 'Login' + # login_label: 'Login (can not be changed) (can not be changed)' name_label: 'Navn' email_label: 'Emailadresse' two_factor: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 67744aeb..97a6a387 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -102,7 +102,7 @@ config: feed_limit: 'Anzahl der Einträge pro Feed' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." - # login_label: 'Login' + # login_label: 'Login (can not be changed)' name_label: 'Name' email_label: 'E-Mail-Adresse' two_factor: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 2dda77bb..2bd4828a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -102,7 +102,7 @@ config: feed_limit: 'Number of items in the feed' form_user: two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." - login_label: 'Login' + login_label: 'Login (can not be changed)' name_label: 'Name' email_label: 'Email' two_factor: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index aa649799..24dc5929 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -102,7 +102,7 @@ config: feed_limit: 'Límite de artículos en feed RSS' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." - # login_label: 'Login' + # login_label: 'Login (can not be changed)' name_label: 'Nombre' email_label: 'Dirección de e-mail' two_factor: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index 5f9e7b6c..f041ef9e 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -102,7 +102,7 @@ config: feed_limit: 'محدودیت آر-اس-اس' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." - # login_label: 'Login' + # login_label: 'Login (can not be changed)' name_label: 'نام' email_label: 'نشانی ایمیل' two_factor: diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 9597ef49..5d2c5e36 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -545,7 +545,7 @@ user: no: "Non" create_new_one: "Créer un nouvel utilisateur" form: - username_label: "Identifiant" + username_label: "Identifiant (ne peut être changé)" name_label: "Nom" password_label: "Mot de passe" repeat_new_password_label: "Confirmez votre nouveau mot de passe" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 6912df0f..dd650bf4 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -102,7 +102,7 @@ config: feed_limit: 'Numero di elementi nel feed' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." - # login_label: 'Login' + # login_label: 'Login (can not be changed)' name_label: 'Nome' email_label: 'E-mail' # emailTwoFactor_label: 'Using email (receive a code by email)' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 8d07f8db..0097377d 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -102,7 +102,7 @@ config: feed_limit: "Nombre d'articles dins un flux" form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." - # login_label: 'Login' + # login_label: 'Login (can not be changed)' name_label: 'Nom' email_label: 'Adreça de corrièl' # emailTwoFactor_label: 'Using email (receive a code by email)' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index bf7e2930..9ff4f459 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -102,7 +102,7 @@ config: feed_limit: 'Link do RSS' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." - # login_label: 'Login' + # login_label: 'Login (can not be changed)' name_label: 'Nazwa' email_label: 'Adres email' # emailTwoFactor_label: 'Using email (receive a code by email)' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index ba36baa4..b90e5a54 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -102,7 +102,7 @@ config: feed_limit: 'Número de itens no feed' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." - # login_label: 'Login' + # login_label: 'Login (can not be changed)' name_label: 'Nome' email_label: 'E-mail' # emailTwoFactor_label: 'Using email (receive a code by email)' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index b8e6883a..514df6dc 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -102,7 +102,7 @@ config: feed_limit: 'Limită RSS' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." - # login_label: 'Login' + # login_label: 'Login (can not be changed)' name_label: 'Nume' email_label: 'E-mail' # emailTwoFactor_label: 'Using email (receive a code by email)' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index 443826d7..34d5cce8 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -100,7 +100,7 @@ config: feed_limit: 'Количество записей в фиде' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." - # login_label: 'Login' + # login_label: 'Login (can not be changed)' name_label: 'Имя' email_label: 'Email' # emailTwoFactor_label: 'Using email (receive a code by email)' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index f006bf3a..aad2e51b 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -102,7 +102,7 @@ config: feed_limit: 'จำนวนไอเทมที่เก็บ' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." - # login_label: 'Login' + # login_label: 'Login (can not be changed)' name_label: 'ชื่อ' email_label: 'อีเมล' # emailTwoFactor_label: 'Using email (receive a code by email)' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 3920266d..c23461f6 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -102,7 +102,7 @@ config: feed_limit: 'RSS içeriğinden talep edilecek makale limiti' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." - # login_label: 'Login' + # login_label: 'Login (can not be changed)' name_label: 'İsim' email_label: 'E-posta' # emailTwoFactor_label: 'Using email (receive a code by email)' -- cgit v1.2.3 From eeae34375d41a5c30c60c1ad47fe8beffd9d4f3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Benoist?= Date: Wed, 12 Jun 2019 17:44:28 +0200 Subject: Typo --- src/Wallabag/CoreBundle/Resources/translations/messages.da.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index bf0c860e..884a67ba 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -102,7 +102,7 @@ config: # feed_limit: 'Number of items in the feed' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." - # login_label: 'Login (can not be changed) (can not be changed)' + # login_label: 'Login (can not be changed)' name_label: 'Navn' email_label: 'Emailadresse' two_factor: -- cgit v1.2.3 From a2f4efe6d2a90d8a2b84a275f48a07dc8aa0a84f Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 21 Jun 2019 12:46:53 +0200 Subject: Use Twig 2.0 `mnapoli/piwik-twig-extension` locked Twig to the 1.10 version. The new version is compatible with Twig 2.0 --- .../CoreBundle/Controller/FeedController.php | 2 +- src/Wallabag/CoreBundle/Twig/WallabagExtension.php | 23 +++++++++++++++------- src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php | 15 +++++++------- 3 files changed, 25 insertions(+), 15 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Controller/FeedController.php b/src/Wallabag/CoreBundle/Controller/FeedController.php index 8d422a90..9f671735 100644 --- a/src/Wallabag/CoreBundle/Controller/FeedController.php +++ b/src/Wallabag/CoreBundle/Controller/FeedController.php @@ -176,7 +176,7 @@ class FeedController extends Controller $pagerAdapter = new DoctrineORMAdapter($qb->getQuery(), true, false); $entries = new Pagerfanta($pagerAdapter); - $perPage = $user->getConfig()->getFeedLimit() ?: $this->getParameter('wallabag_core.Feed_limit'); + $perPage = $user->getConfig()->getFeedLimit() ?: $this->getParameter('wallabag_core.feed_limit'); $entries->setMaxPerPage($perPage); $url = $this->generateUrl( diff --git a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php index 536185d4..02f17f50 100644 --- a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php +++ b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php @@ -4,10 +4,14 @@ namespace Wallabag\CoreBundle\Twig; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Translation\TranslatorInterface; +use Twig\Extension\AbstractExtension; +use Twig\Extension\GlobalsInterface; +use Twig\TwigFilter; +use Twig\TwigFunction; use Wallabag\CoreBundle\Repository\EntryRepository; use Wallabag\CoreBundle\Repository\TagRepository; -class WallabagExtension extends \Twig_Extension implements \Twig_Extension_GlobalsInterface +class WallabagExtension extends AbstractExtension implements GlobalsInterface { private $tokenStorage; private $entryRepository; @@ -24,21 +28,26 @@ class WallabagExtension extends \Twig_Extension implements \Twig_Extension_Globa $this->translator = $translator; } + public function getGlobals() + { + return []; + } + public function getFilters() { return [ - new \Twig_SimpleFilter('removeWww', [$this, 'removeWww']), - new \Twig_SimpleFilter('removeScheme', [$this, 'removeScheme']), - new \Twig_SimpleFilter('removeSchemeAndWww', [$this, 'removeSchemeAndWww']), + new TwigFilter('removeWww', [$this, 'removeWww']), + new TwigFilter('removeScheme', [$this, 'removeScheme']), + new TwigFilter('removeSchemeAndWww', [$this, 'removeSchemeAndWww']), ]; } public function getFunctions() { return [ - new \Twig_SimpleFunction('count_entries', [$this, 'countEntries']), - new \Twig_SimpleFunction('count_tags', [$this, 'countTags']), - new \Twig_SimpleFunction('display_stats', [$this, 'displayStats']), + new TwigFunction('count_entries', [$this, 'countEntries']), + new TwigFunction('count_tags', [$this, 'countTags']), + new TwigFunction('display_stats', [$this, 'displayStats']), ]; } diff --git a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php index 2797efde..e131deb6 100644 --- a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php +++ b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php @@ -4,6 +4,7 @@ namespace Wallabag\UserBundle\Mailer; use Scheb\TwoFactorBundle\Mailer\AuthCodeMailerInterface; use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface; +use Twig\Environment; /** * Custom mailer for TwoFactorBundle email. @@ -56,14 +57,14 @@ class AuthCodeMailer implements AuthCodeMailerInterface /** * Initialize the auth code mailer with the SwiftMailer object. * - * @param \Swift_Mailer $mailer - * @param \Twig_Environment $twig - * @param string $senderEmail - * @param string $senderName - * @param string $supportUrl wallabag support url - * @param string $wallabagUrl wallabag instance url + * @param \Swift_Mailer $mailer + * @param Environment $twig + * @param string $senderEmail + * @param string $senderName + * @param string $supportUrl wallabag support url + * @param string $wallabagUrl wallabag instance url */ - public function __construct(\Swift_Mailer $mailer, \Twig_Environment $twig, $senderEmail, $senderName, $supportUrl, $wallabagUrl) + public function __construct(\Swift_Mailer $mailer, Environment $twig, $senderEmail, $senderName, $supportUrl, $wallabagUrl) { $this->mailer = $mailer; $this->twig = $twig; -- cgit v1.2.3 From ac5844a68e6384af447c67d9e5638795a02c9d99 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 21 Jun 2019 12:54:52 +0200 Subject: Typo --- src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php index e131deb6..b25ba685 100644 --- a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php +++ b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php @@ -22,7 +22,7 @@ class AuthCodeMailer implements AuthCodeMailerInterface /** * Twig to render the html's email. * - * @var \Twig_Environment + * @var Environment */ private $twig; -- cgit v1.2.3 From 34be2d5de44ade2a78be73decc0b90a2c1bca720 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 26 Jun 2019 22:31:47 +0200 Subject: Add ability to import/export tagging rules - Add missing translations - Add some tests - Add `/api/taggingrule/export` API endpoint - Add baggy theme - Add error message when importing tagging rules failed - Also fix all translations (I think we are good now) --- .../Controller/TaggingRuleRestController.php | 39 ++++++++++ .../ApiBundle/Resources/config/routing_rest.yml | 5 ++ .../CoreBundle/Controller/ConfigController.php | 62 +++++++++++++++ src/Wallabag/CoreBundle/Entity/TaggingRule.php | 10 +++ .../CoreBundle/Form/Type/TaggingRuleImportType.php | 29 +++++++ .../Resources/translations/messages.da.yml | 12 +++ .../Resources/translations/messages.de.yml | 21 +++++ .../Resources/translations/messages.en.yml | 11 +++ .../Resources/translations/messages.es.yml | 12 +++ .../Resources/translations/messages.fa.yml | 12 +++ .../Resources/translations/messages.fr.yml | 11 +++ .../Resources/translations/messages.it.yml | 13 ++++ .../Resources/translations/messages.oc.yml | 13 ++++ .../Resources/translations/messages.pl.yml | 13 ++++ .../Resources/translations/messages.pt.yml | 13 ++++ .../Resources/translations/messages.ro.yml | 19 ++++- .../Resources/translations/messages.ru.yml | 60 ++++++++++++++- .../Resources/translations/messages.th.yml | 15 ++++ .../Resources/translations/messages.tr.yml | 48 ++++++++++-- .../views/themes/baggy/Config/index.html.twig | 28 +++++++ .../views/themes/material/Config/index.html.twig | 89 +++++++++++++++++----- 21 files changed, 502 insertions(+), 33 deletions(-) create mode 100644 src/Wallabag/ApiBundle/Controller/TaggingRuleRestController.php create mode 100644 src/Wallabag/CoreBundle/Form/Type/TaggingRuleImportType.php (limited to 'src/Wallabag') diff --git a/src/Wallabag/ApiBundle/Controller/TaggingRuleRestController.php b/src/Wallabag/ApiBundle/Controller/TaggingRuleRestController.php new file mode 100644 index 00000000..2496298a --- /dev/null +++ b/src/Wallabag/ApiBundle/Controller/TaggingRuleRestController.php @@ -0,0 +1,39 @@ +validateAuthentication(); + + $data = SerializerBuilder::create()->build()->serialize( + $this->getUser()->getConfig()->getTaggingRules(), + 'json', + SerializationContext::create()->setGroups(['export_tagging_rule']) + ); + + return Response::create( + $data, + 200, + [ + 'Content-type' => 'application/json', + 'Content-Disposition' => 'attachment; filename="tagging_rules_' . $this->getUser()->getUsername() . '.json"', + 'Content-Transfer-Encoding' => 'UTF-8', + ] + ); + } +} diff --git a/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml b/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml index 06e62c37..98efeeb1 100644 --- a/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml +++ b/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml @@ -13,6 +13,11 @@ tag: resource: "WallabagApiBundle:TagRest" name_prefix: api_ +tagging_rule: + type: rest + resource: "WallabagApiBundle:TaggingRuleRest" + name_prefix: api_ + annotation: type: rest resource: "WallabagApiBundle:AnnotationRest" diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index cea41303..0db90ba4 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -2,11 +2,14 @@ namespace Wallabag\CoreBundle\Controller; +use JMS\Serializer\SerializationContext; +use JMS\Serializer\SerializerBuilder; use PragmaRX\Recovery\Recovery as BackupCodes; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Validator\Constraints\Locale as LocaleConstraint; @@ -15,6 +18,7 @@ use Wallabag\CoreBundle\Entity\TaggingRule; use Wallabag\CoreBundle\Form\Type\ChangePasswordType; use Wallabag\CoreBundle\Form\Type\ConfigType; use Wallabag\CoreBundle\Form\Type\FeedType; +use Wallabag\CoreBundle\Form\Type\TaggingRuleImportType; use Wallabag\CoreBundle\Form\Type\TaggingRuleType; use Wallabag\CoreBundle\Form\Type\UserInformationType; use Wallabag\CoreBundle\Tools\Utils; @@ -140,6 +144,37 @@ class ConfigController extends Controller return $this->redirect($this->generateUrl('config') . '#set5'); } + // handle tagging rules import + $taggingRulesImportform = $this->createForm(TaggingRuleImportType::class); + $taggingRulesImportform->handleRequest($request); + + if ($taggingRulesImportform->isSubmitted() && $taggingRulesImportform->isValid()) { + $message = 'flashes.config.notice.tagging_rules_not_imported'; + $file = $taggingRulesImportform->get('file')->getData(); + + if (null !== $file && $file->isValid() && \in_array($file->getClientMimeType(), ['application/json', 'application/octet-stream'], true)) { + $content = json_decode(file_get_contents($file->getPathname()), true); + + if (\is_array($content)) { + foreach ($content as $rule) { + $taggingRule = new TaggingRule(); + $taggingRule->setRule($rule['rule']); + $taggingRule->setTags($rule['tags']); + $taggingRule->setConfig($config); + $em->persist($taggingRule); + } + + $em->flush(); + + $message = 'flashes.config.notice.tagging_rules_imported'; + } + } + + $this->addFlash('notice', $message); + + return $this->redirect($this->generateUrl('config') . '#set5'); + } + return $this->render('WallabagCoreBundle:Config:index.html.twig', [ 'form' => [ 'config' => $configForm->createView(), @@ -147,6 +182,7 @@ class ConfigController extends Controller 'pwd' => $pwdForm->createView(), 'user' => $userForm->createView(), 'new_tagging_rule' => $newTaggingRule->createView(), + 'import_tagging_rule' => $taggingRulesImportform->createView(), ], 'feed' => [ 'username' => $user->getUsername(), @@ -492,6 +528,32 @@ class ConfigController extends Controller return $this->redirect($request->headers->get('referer', $this->generateUrl('homepage'))); } + /** + * Export tagging rules for the logged in user. + * + * @Route("/tagging-rule/export", name="export_tagging_rule") + * + * @return Response + */ + public function exportTaggingRulesAction() + { + $data = SerializerBuilder::create()->build()->serialize( + $this->getUser()->getConfig()->getTaggingRules(), + 'json', + SerializationContext::create()->setGroups(['export_tagging_rule']) + ); + + return Response::create( + $data, + 200, + [ + 'Content-type' => 'application/json', + 'Content-Disposition' => 'attachment; filename="tagging_rules_' . $this->getUser()->getUsername() . '.json"', + 'Content-Transfer-Encoding' => 'UTF-8', + ] + ); + } + /** * Remove all tags for given tags and a given user and cleanup orphan tags. * diff --git a/src/Wallabag/CoreBundle/Entity/TaggingRule.php b/src/Wallabag/CoreBundle/Entity/TaggingRule.php index c1be3165..eac53fa3 100644 --- a/src/Wallabag/CoreBundle/Entity/TaggingRule.php +++ b/src/Wallabag/CoreBundle/Entity/TaggingRule.php @@ -3,12 +3,16 @@ namespace Wallabag\CoreBundle\Entity; use Doctrine\ORM\Mapping as ORM; +use JMS\Serializer\Annotation\Exclude; +use JMS\Serializer\Annotation\Groups; +use JMS\Serializer\Annotation\XmlRoot; use Symfony\Bridge\RulerZ\Validator\Constraints as RulerZAssert; use Symfony\Component\Validator\Constraints as Assert; /** * Tagging rule. * + * @XmlRoot("tagging_rule") * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\TaggingRuleRepository") * @ORM\Table(name="`tagging_rule`") * @ORM\Entity @@ -34,6 +38,8 @@ class TaggingRule * allowed_operators={">", "<", ">=", "<=", "=", "is", "!=", "and", "not", "or", "matches", "notmatches"} * ) * @ORM\Column(name="rule", type="string", nullable=false) + * + * @Groups({"export_tagging_rule"}) */ private $rule; @@ -42,10 +48,14 @@ class TaggingRule * * @Assert\NotBlank() * @ORM\Column(name="tags", type="simple_array", nullable=false) + * + * @Groups({"export_tagging_rule"}) */ private $tags = []; /** + * @Exclude + * * @ORM\ManyToOne(targetEntity="Wallabag\CoreBundle\Entity\Config", inversedBy="taggingRules") */ private $config; diff --git a/src/Wallabag/CoreBundle/Form/Type/TaggingRuleImportType.php b/src/Wallabag/CoreBundle/Form/Type/TaggingRuleImportType.php new file mode 100644 index 00000000..c6a8c0b8 --- /dev/null +++ b/src/Wallabag/CoreBundle/Form/Type/TaggingRuleImportType.php @@ -0,0 +1,29 @@ +add('file', FileType::class, [ + 'label' => 'config.form_rules.file_label', + 'required' => true, + ]) + ->add('import', SubmitType::class, [ + 'label' => 'config.form_rules.import_submit', + ]) + ; + } + + public function getBlockPrefix() + { + return 'upload_tagging_rule_file'; + } +} diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index 5c4ca29c..fab05835 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -140,6 +140,15 @@ config: # edit_rule_label: 'edit' # rule_label: 'Rule' # tags_label: 'Tags' + # card: + # new_tagging_rule: Create a tagging rule + # import_tagging_rules: Import tagging rules + # import_tagging_rules_detail: You have to select the JSON file you previously exported. + # export_tagging_rules: Export tagging rules + # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them. + # file_label: JSON file + # import_submit: Import + # export: Export # faq: # title: 'FAQ' # tagging_rules_definition_title: 'What does « tagging rules » mean?' @@ -602,6 +611,9 @@ flashes: # tags_reset: Tags reset # entries_reset: Entries reset # archived_reset: Archived entries deleted + # otp_enabled: Two-factor authentication enabled + # tagging_rules_imported: Tagging rules imported + # tagging_rules_not_imported: Error while importing tagging rules entry: notice: # entry_already_saved: 'Entry already saved on %date%' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index a21bd0f1..6ba464d0 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -140,6 +140,15 @@ config: edit_rule_label: 'bearbeiten' rule_label: 'Regel' tags_label: 'Tags' + # card: + # new_tagging_rule: Create a tagging rule + # import_tagging_rules: Import tagging rules + # import_tagging_rules_detail: You have to select the JSON file you previously exported. + # export_tagging_rules: Export tagging rules + # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them. + # file_label: JSON file + # import_submit: Import + # export: Export faq: title: 'FAQ' tagging_rules_definition_title: 'Was bedeuten die "Tagging-Regeln"?' @@ -172,6 +181,15 @@ config: and: 'Eine Regel UND eine andere' matches: 'Testet, ob eine Variable auf eine Suche zutrifft (Groß- und Kleinschreibung wird nicht berücksichtigt).
    Beispiel: title matches "Fußball"' notmatches: 'Testet, ob ein Titel nicht auf eine Suche zutrifft (Groß- und Kleinschreibung wird nicht berücksichtigt).
    Beispiel: title notmatches "Fußball"' + otp: + # page_title: Two-factor authentication + # app: + # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. + # two_factor_code_description_2: 'You can scan that QR Code with your app:' + # two_factor_code_description_3: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' + # two_factor_code_description_4: 'Test an OTP code from your configured app:' + # cancel: Cancel + # enable: Enable entry: default_title: 'Titel des Eintrags' @@ -593,6 +611,9 @@ flashes: tags_reset: Tags zurücksetzen entries_reset: Einträge zurücksetzen archived_reset: Archiverte Einträge zurücksetzen + # otp_enabled: Two-factor authentication enabled + # tagging_rules_imported: Tagging rules imported + # tagging_rules_not_imported: Error while importing tagging rules entry: notice: entry_already_saved: 'Eintrag bereits am %date% gespeichert' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 2f310246..a7c32f11 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -140,6 +140,15 @@ config: edit_rule_label: 'edit' rule_label: 'Rule' tags_label: 'Tags' + card: + new_tagging_rule: Create a tagging rule + import_tagging_rules: Import tagging rules + import_tagging_rules_detail: You have to select the JSON file you previously exported. + export_tagging_rules: Export tagging rules + export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them. + file_label: JSON file + import_submit: Import + export: Export faq: title: 'FAQ' tagging_rules_definition_title: 'What does « tagging rules » mean?' @@ -603,6 +612,8 @@ flashes: entries_reset: Entries reset archived_reset: Archived entries deleted otp_enabled: Two-factor authentication enabled + tagging_rules_imported: Tagging rules imported + tagging_rules_not_imported: Error while importing tagging rules entry: notice: entry_already_saved: 'Entry already saved on %date%' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index c194041a..093c5857 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -140,6 +140,15 @@ config: edit_rule_label: 'editar' rule_label: 'Regla' tags_label: 'Etiquetas' + # card: + # new_tagging_rule: Create a tagging rule + # import_tagging_rules: Import tagging rules + # import_tagging_rules_detail: You have to select the JSON file you previously exported. + # export_tagging_rules: Export tagging rules + # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them. + # file_label: JSON file + # import_submit: Import + # export: Export faq: title: 'Preguntas frecuentes' tagging_rules_definition_title: '¿Qué significa « reglas de etiquetado automático »?' @@ -602,6 +611,9 @@ flashes: tags_reset: Etiquetas reiniciadas entries_reset: Artículos reiniciados # archived_reset: Archived entries deleted + # otp_enabled: Two-factor authentication enabled + # tagging_rules_imported: Tagging rules imported + # tagging_rules_not_imported: Error while importing tagging rules entry: notice: entry_already_saved: 'Artículo ya guardado el %fecha%' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index 9aef7dde..00caa0ac 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -140,6 +140,15 @@ config: # edit_rule_label: 'edit' rule_label: 'قانون' tags_label: 'برچسب‌ها' + # card: + # new_tagging_rule: Create a tagging rule + # import_tagging_rules: Import tagging rules + # import_tagging_rules_detail: You have to select the JSON file you previously exported. + # export_tagging_rules: Export tagging rules + # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them. + # file_label: JSON file + # import_submit: Import + # export: Export faq: title: 'پرسش‌های متداول' tagging_rules_definition_title: 'برچسب‌گذاری خودکار یعنی چه؟' @@ -602,6 +611,9 @@ flashes: # tags_reset: Tags reset # entries_reset: Entries reset # archived_reset: Archived entries deleted + # otp_enabled: Two-factor authentication enabled + # tagging_rules_imported: Tagging rules imported + # tagging_rules_not_imported: Error while importing tagging rules entry: notice: entry_already_saved: 'این مقاله در تاریخ %date% ذخیره شده بود' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 9848ed9a..ca66acde 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -140,6 +140,15 @@ config: edit_rule_label: "éditer" rule_label: "Règle" tags_label: "Tags" + card: + new_tagging_rule: Créer une règle + import_tagging_rules: Importer des règles + import_tagging_rules_detail: Vous devez sélectionné un fichier JSON que vous avez précédemment exporté. + export_tagging_rules: Exporter les règles + export_tagging_rules_detail: Un fichier JSON sera téléchargé et vous pourrez l'utiliser pour ré-importer les règles ou comme sauvegarde. + file_label: Fichier JSON + import_submit: Importer + export: Export faq: title: "FAQ" tagging_rules_definition_title: "Que signifient les règles de tag automatiques ?" @@ -604,6 +613,8 @@ flashes: entries_reset: "Articles supprimés" archived_reset: "Articles archivés supprimés" otp_enabled: "Authentification à double-facteur activée" + tagging_rules_imported: Règles bien importées + tagging_rules_not_imported: Impossible d'importer les règles entry: notice: entry_already_saved: "Article déjà sauvegardé le %date%" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index efbf062b..85720ef8 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -105,6 +105,7 @@ config: # login_label: 'Login (can not be changed)' name_label: 'Nome' email_label: 'E-mail' + two_factor: # emailTwoFactor_label: 'Using email (receive a code by email)' # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' # table_method: Method @@ -139,6 +140,15 @@ config: edit_rule_label: 'modifica' rule_label: 'Regola' tags_label: 'Etichetta' + # card: + # new_tagging_rule: Create a tagging rule + # import_tagging_rules: Import tagging rules + # import_tagging_rules_detail: You have to select the JSON file you previously exported. + # export_tagging_rules: Export tagging rules + # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them. + # file_label: JSON file + # import_submit: Import + # export: Export faq: title: 'FAQ' tagging_rules_definition_title: 'Cosa significa « regole di etichettatura » ?' @@ -601,6 +611,9 @@ flashes: tags_reset: Reset etichette entries_reset: Reset articoli # archived_reset: Archived entries deleted + # otp_enabled: Two-factor authentication enabled + # tagging_rules_imported: Tagging rules imported + # tagging_rules_not_imported: Error while importing tagging rules entry: notice: entry_already_saved: 'Contenuto già salvato in data %date%' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 86ce4644..18d1173b 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -105,6 +105,7 @@ config: # login_label: 'Login (can not be changed)' name_label: 'Nom' email_label: 'Adreça de corrièl' + two_factor: # emailTwoFactor_label: 'Using email (receive a code by email)' # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' # table_method: Method @@ -139,6 +140,15 @@ config: edit_rule_label: 'modificar' rule_label: 'Règla' tags_label: 'Etiquetas' + # card: + # new_tagging_rule: Create a tagging rule + # import_tagging_rules: Import tagging rules + # import_tagging_rules_detail: You have to select the JSON file you previously exported. + # export_tagging_rules: Export tagging rules + # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them. + # file_label: JSON file + # import_submit: Import + # export: Export faq: title: 'FAQ' tagging_rules_definition_title: "Qué significa las règlas d'etiquetas automaticas ?" @@ -601,6 +611,9 @@ flashes: tags_reset: Etiquetas levadas entries_reset: Articles levats archived_reset: Articles archivat suprimits + # otp_enabled: Two-factor authentication enabled + # tagging_rules_imported: Tagging rules imported + # tagging_rules_not_imported: Error while importing tagging rules entry: notice: entry_already_saved: 'Article ja salvagardat lo %date%' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 9ebe0236..6528a562 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -105,6 +105,7 @@ config: # login_label: 'Login (can not be changed)' name_label: 'Nazwa' email_label: 'Adres email' + two_factor: # emailTwoFactor_label: 'Using email (receive a code by email)' # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' # table_method: Method @@ -139,6 +140,15 @@ config: edit_rule_label: 'edytuj' rule_label: 'Reguła' tags_label: 'Tagi' + # card: + # new_tagging_rule: Create a tagging rule + # import_tagging_rules: Import tagging rules + # import_tagging_rules_detail: You have to select the JSON file you previously exported. + # export_tagging_rules: Export tagging rules + # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them. + # file_label: JSON file + # import_submit: Import + # export: Export faq: title: 'FAQ' tagging_rules_definition_title: 'Co oznaczają « reguły tagowania » ?' @@ -601,6 +611,9 @@ flashes: tags_reset: Zresetuj tagi entries_reset: Zresetuj wpisy archived_reset: Zarchiwizowane wpisy usunięte + # otp_enabled: Two-factor authentication enabled + # tagging_rules_imported: Tagging rules imported + # tagging_rules_not_imported: Error while importing tagging rules entry: notice: entry_already_saved: 'Wpis już został dodany %date%' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index d310e016..3f1c7a68 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -105,6 +105,7 @@ config: # login_label: 'Login (can not be changed)' name_label: 'Nome' email_label: 'E-mail' + two_factor: # emailTwoFactor_label: 'Using email (receive a code by email)' # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' # table_method: Method @@ -139,6 +140,15 @@ config: edit_rule_label: 'editar' rule_label: 'Regras' tags_label: 'Tags' + # card: + # new_tagging_rule: Create a tagging rule + # import_tagging_rules: Import tagging rules + # import_tagging_rules_detail: You have to select the JSON file you previously exported. + # export_tagging_rules: Export tagging rules + # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them. + # file_label: JSON file + # import_submit: Import + # export: Export faq: title: 'FAQ' tagging_rules_definition_title: 'O que as « regras de tags » significam?' @@ -601,6 +611,9 @@ flashes: # tags_reset: Tags reset # entries_reset: Entries reset # archived_reset: Archived entries deleted + # otp_enabled: Two-factor authentication enabled + # tagging_rules_imported: Tagging rules imported + # tagging_rules_not_imported: Error while importing tagging rules entry: notice: entry_already_saved: 'Entrada já foi salva em %date%' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index c11ff0b8..d82e9377 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -105,6 +105,7 @@ config: # login_label: 'Login (can not be changed)' name_label: 'Nume' email_label: 'E-mail' + two_factor: # emailTwoFactor_label: 'Using email (receive a code by email)' # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' # table_method: Method @@ -139,6 +140,15 @@ config: # edit_rule_label: 'edit' # rule_label: 'Rule' # tags_label: 'Tags' + # card: + # new_tagging_rule: Create a tagging rule + # import_tagging_rules: Import tagging rules + # import_tagging_rules_detail: You have to select the JSON file you previously exported. + # export_tagging_rules: Export tagging rules + # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them. + # file_label: JSON file + # import_submit: Import + # export: Export # faq: # title: 'FAQ' # tagging_rules_definition_title: 'What does « tagging rules » mean?' @@ -429,9 +439,9 @@ tag: rename: # placeholder: 'You can update tag name.' -# export: -# footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' -# unknown: 'Unknown' +export: + # footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' + # unknown: 'Unknown' import: # page_title: 'Import' @@ -601,6 +611,9 @@ flashes: # tags_reset: Tags reset # entries_reset: Entries reset # archived_reset: Archived entries deleted + # otp_enabled: Two-factor authentication enabled + # tagging_rules_imported: Tagging rules imported + # tagging_rules_not_imported: Error while importing tagging rules entry: notice: # entry_already_saved: 'Entry already saved on %date%' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index 9fe75369..23d31333 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -80,6 +80,7 @@ config: redirect_current_page: 'На текущую страницу' pocket_consumer_key_label: "Ключ от Pocket для импорта контента" android_configuration: "Настройте Ваше Android приложение" + # android_instruction: "Touch here to prefill your Android application" help_theme: "wallabag настраиваемый, здесь Вы можете выбрать тему." help_items_per_page: "Вы можете выбрать количество отображаемых записей на странице." help_reading_speed: "wallabag посчитает сколько времени занимает чтение каждой записи. Вы можете определить здесь, как быстро вы читаете. wallabag пересчитает время чтения для каждой записи." @@ -97,12 +98,14 @@ config: unread: 'непрочитанные' starred: 'помеченные' archive: 'архивные' + # all: 'All' feed_limit: 'Количество записей в фиде' form_user: # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." # login_label: 'Login (can not be changed)' name_label: 'Имя' email_label: 'Email' + two_factor: # emailTwoFactor_label: 'Using email (receive a code by email)' # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' # table_method: Method @@ -123,6 +126,7 @@ config: annotations: "Удалить все аннотации" tags: "Удалить все теги" entries: "Удалить все записи" + # archived: Remove ALL archived entries confirm: "Вы уверены? (Данные будут БЕЗВОЗВРАТНО удалены, эти действия необратимы)" form_password: description: "Здесь Вы можете поменять своя пароль. Ваш пароль должен быть длиннее 8 символов." @@ -136,6 +140,15 @@ config: edit_rule_label: 'изменить' rule_label: 'Правило' tags_label: 'теги' + # card: + # new_tagging_rule: Create a tagging rule + # import_tagging_rules: Import tagging rules + # import_tagging_rules_detail: You have to select the JSON file you previously exported. + # export_tagging_rules: Export tagging rules + # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them. + # file_label: JSON file + # import_submit: Import + # export: Export faq: title: 'FAQ' tagging_rules_definition_title: 'Что значит "правило тегирования"?' @@ -167,6 +180,7 @@ config: or: 'Одно правило ИЛИ другое' and: 'Одно правило И другое' matches: 'Тесты, в которых тема соответствует поиску (без учета регистра). Пример: title matches "футбол" ' + # notmatches: 'Tests that a subject doesn''t match match a search (case-insensitive).
    Example: title notmatches "football"' otp: # page_title: Two-factor authentication # app: @@ -187,6 +201,7 @@ entry: filtered_tags: 'Отфильтрованные по тегу:' filtered_search: 'Отфильтрованные по поиску:' untagged: 'Записи без тегов' + # all: 'All entries' list: number_on_the_page: '{0} Записей не обнаружено.|{1} Одна запись.|]1,Inf[ Найдено %count% записей.' reading_time: 'расчетное время чтения' @@ -208,6 +223,8 @@ entry: unread_label: 'Непрочитанная' preview_picture_label: 'Есть картинка предварительного просмотра' preview_picture_help: 'Картинка предварительного просмотра' + # is_public_label: 'Has a public link' + # is_public_help: 'Public link' language_label: 'Язык' http_status_label: 'статус HTTP' reading_time: @@ -246,6 +263,8 @@ entry: original_article: 'оригинал' annotations_on_the_entry: '{0} Нет аннотации|{1} Одна аннотация|]1,Inf[ %count% аннотаций' created_at: 'Дата создания' + # published_at: 'Publication date' + # published_by: 'Published by' # provided_by: 'Provided by' new: page_title: 'Сохранить новую запись' @@ -259,10 +278,12 @@ entry: title_label: 'Название' url_label: 'Ссылка' # origin_url_label: 'Origin url (from where you found that entry)' - is_public_label: 'Публичная' save_label: 'Сохранить' public: shared_by_wallabag: "Запись была опубликована wallabag" + confirm: + # delete: "Are you sure you want to remove that article?" + # delete_tag: "Are you sure you want to remove that tag from that article?" metadata: # reading_time: "Estimated reading time" # reading_time_minutes_short: "%readingTime% min" @@ -418,9 +439,9 @@ tag: rename: # placeholder: 'You can update tag name.' -# export: -# footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' -# unknown: 'Unknown' +export: + # footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' + # unknown: 'Unknown' import: page_title: 'Импорт' @@ -548,6 +569,28 @@ user: delete: "Удалить" delete_confirm: "Вы уверены?" back_to_list: "Назад к списку" + search: + # placeholder: Filter by login or email + +site_credential: + # page_title: Site credentials management + # new_site_credential: Create a credential + # edit_site_credential: Edit an existing credential + # description: "Here you can manage all credentials for sites which required them (create, edit and delete), like a paywall, an authentication, etc." + # list: + # actions: Actions + # edit_action: Edit + # yes: Yes + # no: No + # create_new_one: Create a new credential + # form: + # username_label: 'Login' + # host_label: 'Host (subdomain.example.org, .example.org, etc.)' + # password_label: 'Password' + # save: Save + # delete: Delete + # delete_confirm: Are you sure? + # back_to_list: Back to list error: page_title: "Произошла ошибка" @@ -567,6 +610,10 @@ flashes: annotations_reset: "Аннотации сброшены" tags_reset: "Теги сброшены" entries_reset: "Записи сброшены" + # archived_reset: Archived entries deleted + # otp_enabled: Two-factor authentication enabled + # tagging_rules_imported: Tagging rules imported + # tagging_rules_not_imported: Error while importing tagging rules entry: notice: entry_already_saved: 'Запись была сохранена ранее %date%' @@ -603,3 +650,8 @@ flashes: added: 'Пользователь "%username%" добавлен' updated: 'Пользователь "%username%" обновлен' deleted: 'Пользователь "%username%" удален' + site_credential: + notice: + # added: 'Site credential for "%host%" added' + # updated: 'Site credential for "%host%" updated' + # deleted: 'Site credential for "%host%" deleted' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index 672dcbf0..d7f47904 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -105,6 +105,7 @@ config: # login_label: 'Login (can not be changed)' name_label: 'ชื่อ' email_label: 'อีเมล' + two_factor: # emailTwoFactor_label: 'Using email (receive a code by email)' # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' # table_method: Method @@ -139,6 +140,15 @@ config: edit_rule_label: 'ปรับแก้' rule_label: 'ข้อบังคับ' tags_label: 'แท็ก' + # card: + # new_tagging_rule: Create a tagging rule + # import_tagging_rules: Import tagging rules + # import_tagging_rules_detail: You have to select the JSON file you previously exported. + # export_tagging_rules: Export tagging rules + # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them. + # file_label: JSON file + # import_submit: Import + # export: Export faq: title: 'FAQ' tagging_rules_definition_title: 'ข้อบังคับการแท็กคืออะไร?' @@ -255,6 +265,7 @@ entry: created_at: 'วันที่สร้าง' published_at: 'วันที่ประกาศ' published_by: 'ประกาศโดย' + # provided_by: 'Provided by' new: page_title: 'บันทึกรายการใหม่' placeholder: 'http://website.com' @@ -266,6 +277,7 @@ entry: page_title: 'แก้ไขรายการ' title_label: 'หัวข้อ' url_label: 'Url' + # origin_url_label: 'Origin url (from where you found that entry)' save_label: 'บันทึก' public: shared_by_wallabag: "บทความนี้จะมีการแชร์โดย %username% กับ wallabag" @@ -599,6 +611,9 @@ flashes: tags_reset: รีเซ็ตแท็ก entries_reset: รีเซ็ตรายการ archived_reset: การลบเอกสารของรายการ + # otp_enabled: Two-factor authentication enabled + # tagging_rules_imported: Tagging rules imported + # tagging_rules_not_imported: Error while importing tagging rules entry: notice: entry_already_saved: 'รายการพร้อมบันทึกที่ %date%' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index c2ad854d..a444cadb 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -105,6 +105,7 @@ config: # login_label: 'Login (can not be changed)' name_label: 'İsim' email_label: 'E-posta' + two_factor: # emailTwoFactor_label: 'Using email (receive a code by email)' # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' # table_method: Method @@ -139,6 +140,15 @@ config: # edit_rule_label: 'edit' rule_label: 'Kural' tags_label: 'Etiketler' + # card: + # new_tagging_rule: Create a tagging rule + # import_tagging_rules: Import tagging rules + # import_tagging_rules_detail: You have to select the JSON file you previously exported. + # export_tagging_rules: Export tagging rules + # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them. + # file_label: JSON file + # import_submit: Import + # export: Export faq: title: 'S.S.S.' tagging_rules_definition_title: '« etiketleme kuralları » ne anlama geliyor?' @@ -213,6 +223,8 @@ entry: unread_label: 'Okunmayan' preview_picture_label: 'Resim önizlemesi varsa' preview_picture_help: 'Resim önizlemesi' + # is_public_label: 'Has a public link' + # is_public_help: 'Public link' language_label: 'Dil' # http_status_label: 'HTTP status' reading_time: @@ -427,9 +439,9 @@ tag: rename: # placeholder: 'You can update tag name.' -# export: -# footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' -# unknown: 'Unknown' +export: + # footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' + # unknown: 'Unknown' import: page_title: 'İçe Aktar' @@ -560,6 +572,26 @@ user: search: # placeholder: Filter by username or email +site_credential: + # page_title: Site credentials management + # new_site_credential: Create a credential + # edit_site_credential: Edit an existing credential + # description: "Here you can manage all credentials for sites which required them (create, edit and delete), like a paywall, an authentication, etc." + # list: + # actions: Actions + # edit_action: Edit + # yes: Yes + # no: No + # create_new_one: Create a new credential + # form: + # username_label: 'Login' + # host_label: 'Host (subdomain.example.org, .example.org, etc.)' + # password_label: 'Password' + # save: Save + # delete: Delete + # delete_confirm: Are you sure? + # back_to_list: Back to list + error: # page_title: An error occurred @@ -571,13 +603,17 @@ flashes: password_not_updated_demo: "In demonstration mode, you can't change password for this user." user_updated: 'Bilgiler güncellendi' feed_updated: 'RSS bilgiler güncellendi' - tagging_rules_updated: 'Tagging rules updated' - tagging_rules_deleted: 'Tagging rule deleted' - feed_token_updated: 'RSS token updated' + # tagging_rules_updated: 'Tagging rules updated' + # tagging_rules_deleted: 'Tagging rule deleted' + # feed_token_updated: 'RSS token updated' + # feed_token_revoked: 'RSS token revoked' # annotations_reset: Annotations reset # tags_reset: Tags reset # entries_reset: Entries reset # archived_reset: Archived entries deleted + # otp_enabled: Two-factor authentication enabled + # tagging_rules_imported: Tagging rules imported + # tagging_rules_not_imported: Error while importing tagging rules entry: notice: entry_already_saved: 'Entry already saved on %date%' 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 eba4539f..f719bea2 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 @@ -291,6 +291,34 @@ {{ form_rest(form.new_tagging_rule) }} + +
    +

    {{ 'config.form_rules.card.import_tagging_rules'|trans }}

    +

    {{ 'config.form_rules.card.import_tagging_rules_detail'|trans }}

    +
    + + {{ form_start(form.import_tagging_rule) }} + {{ form_errors(form.import_tagging_rule) }} + +
    +
    + {{ form_label(form.import_tagging_rule.file) }} + {{ form_errors(form.import_tagging_rule.file) }} + {{ form_widget(form.import_tagging_rule.file) }} +
    +
    + + {{ form_rest(form.import_tagging_rule) }} + + + {% if app.user.config.taggingRules is not empty %} +
    +

    {{ 'config.form_rules.card.export_tagging_rules'|trans }}

    +

    {{ 'config.form_rules.card.export_tagging_rules_detail'|trans }}

    +

    {{ 'config.form_rules.export'|trans }}

    +
    + {% endif %} +

    {{ 'config.form_rules.faq.title'|trans }}

    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 990546e8..d8e9694d 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 @@ -307,28 +307,77 @@
    {% endif %} - {{ form_start(form.new_tagging_rule) }} - {{ form_errors(form.new_tagging_rule) }} - -
    -
    - {{ form_label(form.new_tagging_rule.rule) }} - {{ form_errors(form.new_tagging_rule.rule) }} - {{ form_widget(form.new_tagging_rule.rule) }} +
      +
    • +
      +
      + {{ 'config.form_rules.card.new_tagging_rule'|trans }} + + {{ form_start(form.new_tagging_rule) }} + {{ form_errors(form.new_tagging_rule) }} + +
      +
      + {{ form_label(form.new_tagging_rule.rule) }} + {{ form_errors(form.new_tagging_rule.rule) }} + {{ form_widget(form.new_tagging_rule.rule) }} +
      +
      + +
      +
      + {{ form_label(form.new_tagging_rule.tags) }} + {{ form_errors(form.new_tagging_rule.tags) }} + {{ form_widget(form.new_tagging_rule.tags) }} +
      +
      + + {{ form_widget(form.new_tagging_rule.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} + {{ form_rest(form.new_tagging_rule) }} + +
      -
    - -
    -
    - {{ form_label(form.new_tagging_rule.tags) }} - {{ form_errors(form.new_tagging_rule.tags) }} - {{ form_widget(form.new_tagging_rule.tags) }} + +
  • +
    +
    + {{ 'config.form_rules.card.import_tagging_rules'|trans }} +

    {{ 'config.form_rules.card.import_tagging_rules_detail'|trans }}

    + {{ form_start(form.import_tagging_rule) }} + {{ form_errors(form.import_tagging_rule) }} +
    +
    + {{ form_errors(form.import_tagging_rule.file) }} +
    + {{ form.import_tagging_rule.file.vars.label|trans }} + {{ form_widget(form.import_tagging_rule.file) }} +
    +
    + +
    +
    +
    + + {{ form_widget(form.import_tagging_rule.import, { 'attr': {'class': 'btn waves-effect waves-light'} }) }} + + {{ form_rest(form.import_tagging_rule) }} + +
    -
  • - - {{ form_widget(form.new_tagging_rule.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} - {{ form_rest(form.new_tagging_rule) }} - + + {% if app.user.config.taggingRules is not empty %} +
  • +
    +
    + {{ 'config.form_rules.card.export_tagging_rules'|trans }} +

    {{ 'config.form_rules.card.export_tagging_rules_detail'|trans }}

    +
    +

    {{ 'config.form_rules.export'|trans }}

    +
    +
    +
  • + {% endif %} +
    -- cgit v1.2.3 From 41022cb289f5d08418ccb2d7050098c4ee3721e4 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 8 Jul 2019 14:45:45 +0200 Subject: Add ability to manually define the reading speed Instead of using a select, let the user decide its own speed. --- src/Wallabag/CoreBundle/DataFixtures/ConfigFixtures.php | 6 +++--- src/Wallabag/CoreBundle/Form/Type/ConfigType.php | 11 +++-------- src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php | 4 ++-- .../CoreBundle/Resources/translations/messages.da.yml | 6 +----- .../CoreBundle/Resources/translations/messages.de.yml | 6 +----- .../CoreBundle/Resources/translations/messages.en.yml | 6 +----- .../CoreBundle/Resources/translations/messages.es.yml | 6 +----- .../CoreBundle/Resources/translations/messages.fa.yml | 6 +----- .../CoreBundle/Resources/translations/messages.fr.yml | 6 +----- .../CoreBundle/Resources/translations/messages.it.yml | 6 +----- .../CoreBundle/Resources/translations/messages.oc.yml | 6 +----- .../CoreBundle/Resources/translations/messages.pl.yml | 6 +----- .../CoreBundle/Resources/translations/messages.pt.yml | 6 +----- .../CoreBundle/Resources/translations/messages.ro.yml | 6 +----- .../CoreBundle/Resources/translations/messages.ru.yml | 6 +----- .../CoreBundle/Resources/translations/messages.th.yml | 6 +----- .../CoreBundle/Resources/translations/messages.tr.yml | 6 +----- .../Resources/views/themes/baggy/Entry/entries.html.twig | 2 +- .../Resources/views/themes/baggy/Entry/entry.html.twig | 2 +- .../views/themes/material/Entry/_reading_time.html.twig | 2 +- 20 files changed, 25 insertions(+), 86 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/DataFixtures/ConfigFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/ConfigFixtures.php index c54e9f2c..5e914965 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ConfigFixtures.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ConfigFixtures.php @@ -19,7 +19,7 @@ class ConfigFixtures extends Fixture implements DependentFixtureInterface $adminConfig->setTheme('material'); $adminConfig->setItemsPerPage(30); - $adminConfig->setReadingSpeed(1); + $adminConfig->setReadingSpeed(200); $adminConfig->setLanguage('en'); $adminConfig->setPocketConsumerKey('xxxxx'); $adminConfig->setActionMarkAsRead(0); @@ -32,7 +32,7 @@ class ConfigFixtures extends Fixture implements DependentFixtureInterface $bobConfig = new Config($this->getReference('bob-user')); $bobConfig->setTheme('default'); $bobConfig->setItemsPerPage(10); - $bobConfig->setReadingSpeed(1); + $bobConfig->setReadingSpeed(200); $bobConfig->setLanguage('fr'); $bobConfig->setPocketConsumerKey(null); $bobConfig->setActionMarkAsRead(1); @@ -45,7 +45,7 @@ class ConfigFixtures extends Fixture implements DependentFixtureInterface $emptyConfig = new Config($this->getReference('empty-user')); $emptyConfig->setTheme('material'); $emptyConfig->setItemsPerPage(10); - $emptyConfig->setReadingSpeed(1); + $emptyConfig->setReadingSpeed(200); $emptyConfig->setLanguage('en'); $emptyConfig->setPocketConsumerKey(null); $emptyConfig->setActionMarkAsRead(0); diff --git a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php index 1714ce74..6901fa08 100644 --- a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php +++ b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php @@ -4,6 +4,7 @@ namespace Wallabag\CoreBundle\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Symfony\Component\Form\Extension\Core\Type\IntegerType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -37,19 +38,13 @@ class ConfigType extends AbstractType 'choices' => array_flip($this->themes), 'label' => 'config.form_settings.theme_label', ]) - ->add('items_per_page', null, [ + ->add('items_per_page', IntegerType::class, [ 'label' => 'config.form_settings.items_per_page_label', 'property_path' => 'itemsPerPage', ]) - ->add('reading_speed', ChoiceType::class, [ + ->add('reading_speed', IntegerType::class, [ 'label' => 'config.form_settings.reading_speed.label', 'property_path' => 'readingSpeed', - 'choices' => [ - 'config.form_settings.reading_speed.100_word' => '0.5', - 'config.form_settings.reading_speed.200_word' => '1', - 'config.form_settings.reading_speed.300_word' => '1.5', - 'config.form_settings.reading_speed.400_word' => '2', - ], ]) ->add('action_mark_as_read', ChoiceType::class, [ 'label' => 'config.form_settings.action_mark_as_read.label', diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php index 37d0640a..8a575b68 100644 --- a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php @@ -54,8 +54,8 @@ class EntryFilterType extends AbstractType $lower = $values['value']['left_number'][0]; $upper = $values['value']['right_number'][0]; - $min = (int) ($lower * $this->user->getConfig()->getReadingSpeed()); - $max = (int) ($upper * $this->user->getConfig()->getReadingSpeed()); + $min = (int) ($lower * $this->user->getConfig()->getReadingSpeed() / 200); + $max = (int) ($upper * $this->user->getConfig()->getReadingSpeed() / 200); if (null === $lower && null === $upper) { // no value? no filter diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index 5c4ca29c..065d281c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -68,12 +68,8 @@ config: items_per_page_label: 'Poster pr. side' language_label: 'Sprog' reading_speed: - # label: 'Reading speed' + # label: 'Reading speed (words per minute)' # help_message: 'You can use online tools to estimate your reading speed:' - # 100_word: 'I read ~100 words per minute' - # 200_word: 'I read ~200 words per minute' - # 300_word: 'I read ~300 words per minute' - # 400_word: 'I read ~400 words per minute' action_mark_as_read: # label: 'Where do you want to be redirected to after marking an article as read?' # redirect_homepage: 'To the homepage' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index a21bd0f1..ef909978 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -68,12 +68,8 @@ config: items_per_page_label: 'Einträge pro Seite' language_label: 'Sprache' reading_speed: - label: 'Lesegeschwindigkeit' + label: 'Lesegeschwindigkeit (Wörter pro Minute)' help_message: 'Du kannst Online-Tools nutzen, um deine Lesegeschwindigkeit herauszufinden.' - 100_word: 'Ich lese ~100 Wörter pro Minute' - 200_word: 'Ich lese ~200 Wörter pro Minute' - 300_word: 'Ich lese ~300 Wörter pro Minute' - 400_word: 'Ich lese ~400 Wörter pro Minute' action_mark_as_read: label: 'Wohin soll nach dem Gelesenmarkieren eines Artikels weitergeleitet werden?' redirect_homepage: 'Zur Homepage' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 2f310246..dc12015f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -68,12 +68,8 @@ config: items_per_page_label: 'Items per page' language_label: 'Language' reading_speed: - label: 'Reading speed' + label: 'Reading speed (words per minute)' help_message: 'You can use online tools to estimate your reading speed:' - 100_word: 'I read ~100 words per minute' - 200_word: 'I read ~200 words per minute' - 300_word: 'I read ~300 words per minute' - 400_word: 'I read ~400 words per minute' action_mark_as_read: label: 'What to do after removing, starring or marking as read an article?' redirect_homepage: 'Go to the homepage' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index c194041a..6eb5498d 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -68,12 +68,8 @@ config: items_per_page_label: 'Número de artículos por página' language_label: 'Idioma' reading_speed: - label: 'Velocidad de lectura' + label: 'Velocidad de lectura (palabras por minuto)' help_message: 'Puede utilizar herramientas en línea para calcular su velocidad de lectura:' - 100_word: 'Leo ~100 palabras por minuto' - 200_word: 'Leo ~200 palabras por minuto' - 300_word: 'Leo ~300 palabras por minuto' - 400_word: 'Leo ~400 palabras por minuto' action_mark_as_read: label: '¿Dónde quieres ser redirigido después de marcar un artículo como leído?' redirect_homepage: 'A la página de inicio' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index 9aef7dde..659331c6 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -68,12 +68,8 @@ config: items_per_page_label: 'تعداد مقاله در هر صفحه' language_label: 'زبان' reading_speed: - label: 'سرعت خواندن' + # label: 'Reading speed (words per minute)' help_message: 'سرعت خواندن‌تان را با ابزارهای آنلاین تخمین بزنید:' - 100_word: 'من تقریباً ۱۰۰ واژه را در دقیقه می‌خوانم' - 200_word: 'من تقریباً ۲۰۰ واژه را در دقیقه می‌خوانم' - 300_word: 'من تقریباً ۳۰۰ واژه را در دقیقه می‌خوانم' - 400_word: 'من تقریباً ۴۰۰ واژه را در دقیقه می‌خوانم' action_mark_as_read: # label: 'Where do you want to be redirected to after marking an article as read?' # redirect_homepage: 'To the homepage' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 9848ed9a..f19d8c4c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -68,12 +68,8 @@ config: items_per_page_label: "Nombre d’articles par page" language_label: "Langue" reading_speed: - label: "Vitesse de lecture" + label: "Vitesse de lecture (mots par minute)" help_message: "Vous pouvez utiliser un outil en ligne pour estimer votre vitesse de lecture :" - 100_word: "Je lis environ 100 mots par minute" - 200_word: "Je lis environ 200 mots par minute" - 300_word: "Je lis environ 300 mots par minute" - 400_word: "Je lis environ 400 mots par minute" action_mark_as_read: label: "Que faire lorsqu'un article est supprimé, marqué comme lu ou marqué comme favoris ?" redirect_homepage: "Retourner à la page d’accueil" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index efbf062b..700a37d2 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -68,12 +68,8 @@ config: items_per_page_label: 'Elementi per pagina' language_label: 'Lingua' reading_speed: - label: 'Velocità di lettura' + label: 'Velocità di lettura (parole al minuto)' help_message: 'Puoi utilizzare degli strumenti online per valutare la tua velocità di lettura:' - 100_word: 'Leggo ~100 parole al minuto' - 200_word: 'Leggo ~200 parole al minuto' - 300_word: 'Leggo ~300 parole al minuto' - 400_word: 'Leggo ~400 parole al minuto' action_mark_as_read: label: "Dove vuoi essere reindirizzato dopo aver segnato l'articolo come già letto?" redirect_homepage: 'Alla homepage' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 86ce4644..023aa2e5 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -68,12 +68,8 @@ config: items_per_page_label: "Nombre d'articles per pagina" language_label: 'Lenga' reading_speed: - label: 'Velocitat de lectura' + label: 'Velocitat de lectura (mots per minuta)' help_message: 'Podètz utilizar una aisina en linha per estimar vòstra velocitat de lectura :' - 100_word: "Legissi a l'entorn de 100 mots per minuta" - 200_word: "Legissi a l'entorn de 200 mots per minuta" - 300_word: "Legissi a l'entorn de 300 mots per minuta" - 400_word: "Legissi a l'entorn de 400 mots per minuta" action_mark_as_read: label: 'Ont volètz èsser menat aprèp aver marcat un article coma legit ?' redirect_homepage: "A la pagina d’acuèlh" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 9ebe0236..876db24a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -68,12 +68,8 @@ config: items_per_page_label: 'Ilość elementów na stronie' language_label: 'Język' reading_speed: - label: 'Prędkość czytania' + label: 'Prędkość czytania (słów na minutę)' help_message: 'Możesz skorzystać z narzędzi online do określenia twojej prędkości czytania:' - 100_word: 'Czytam ~100 słów na minutę' - 200_word: 'Czytam ~200 słów na minutę' - 300_word: 'Czytam ~300 słów na minutę' - 400_word: 'Czytam ~400 słów na minutę' action_mark_as_read: label: 'Gdzie zostaniesz przekierowany po oznaczeniu artukuły jako przeczytanego' redirect_homepage: 'do strony głównej' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index d310e016..786288c1 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -68,12 +68,8 @@ config: items_per_page_label: 'Itens por página' language_label: 'Idioma' reading_speed: - label: 'Velocidade de leitura' + label: 'Velocidade de leitura (palavras por minuto)' help_message: 'Você pode usar ferramentas online para estimar sua velocidade de leitura:' - 100_word: 'Posso ler ~100 palavras por minuto' - 200_word: 'Posso ler ~200 palavras por minuto' - 300_word: 'Posso ler ~300 palavras por minuto' - 400_word: 'Posso ler ~400 palavras por minuto' action_mark_as_read: # label: 'Where do you want to be redirected to after marking an article as read?' # redirect_homepage: 'To the homepage' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index c11ff0b8..0d8904fe 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -68,12 +68,8 @@ config: items_per_page_label: 'Articole pe pagină' language_label: 'Limbă' reading_speed: - # label: 'Reading speed' + # label: 'Reading speed (words per minute)' # help_message: 'You can use online tools to estimate your reading speed:' - # 100_word: 'I read ~100 words per minute' - # 200_word: 'I read ~200 words per minute' - # 300_word: 'I read ~300 words per minute' - # 400_word: 'I read ~400 words per minute' action_mark_as_read: # label: 'Where do you want to be redirected to after marking an article as read?' # redirect_homepage: 'To the homepage' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index 9fe75369..04daf855 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -68,12 +68,8 @@ config: items_per_page_label: 'Записей на странице' language_label: 'Язык' reading_speed: - label: 'Скорость чтения' + label: 'Скорость чтения (слов в минуту)' help_message: 'Вы можете использовать онлайн-инструменты для оценки скорости чтения:' - 100_word: 'Я читаю ~100 слов в минуту' - 200_word: 'Я читаю ~200 слов в минуту' - 300_word: 'Я читаю ~300 слов в минуту' - 400_word: 'Я читаю ~400 слов в минуту' action_mark_as_read: label: 'Куда Вы хотите быть перенаправлены, после пометки записи, как прочитанная?' redirect_homepage: 'На домашнюю страницу' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index 672dcbf0..66642029 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -68,12 +68,8 @@ config: items_per_page_label: 'ไอเทมต่อหน้า' language_label: 'ภาษา' reading_speed: - label: 'การอ่านแบบด่วน' + label: 'การอ่านแบบด่วน (คำต่อนาที)' help_message: 'คุณสามารถใช้เครื่องมือออนไลน์เพื่อประเมินการอ่านแบบด่วน:' - 100_word: 'ฉันอ่าน ~100 คำต่อนาที' - 200_word: 'ฉันอ่าน ~200 คำต่อนาท' - 300_word: 'ฉันอ่าน ~300 คำต่อนาท' - 400_word: 'ฉันอ่าน ~400 คำต่อนาท' action_mark_as_read: label: 'คุณต้องการเปลี่ยนทิศทางหลังจากระบุเครื่องหมายรายการอ่านที่ไหน?' redirect_homepage: 'ไปยังโฮมเพจ' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index c2ad854d..6ee723f1 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -68,12 +68,8 @@ config: items_per_page_label: 'Sayfa başına makale sayısı' language_label: 'Dil' reading_speed: - # label: 'Reading speed' + # label: 'Reading speed (words per minute)' # help_message: 'You can use online tools to estimate your reading speed:' - # 100_word: 'I read ~100 words per minute' - # 200_word: 'I read ~200 words per minute' - # 300_word: 'I read ~300 words per minute' - # 400_word: 'I read ~400 words per minute' action_mark_as_read: # label: 'Where do you want to be redirected to after marking an article as read?' # redirect_homepage: 'To the homepage' 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 6c5d2601..d8b39160 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 @@ -46,7 +46,7 @@

    {{ entry.title | striptags | truncate(80, true, '…') | default('entry.default_title'|trans) | raw }}

    - {% set readingTime = entry.readingTime / app.user.config.readingSpeed %} + {% set readingTime = entry.readingTime / app.user.config.readingSpeed * 200 %}
    {% if readingTime > 0 %} 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 e87ba201..7616cf4c 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 @@ -62,7 +62,7 @@ {% endif %} - {% set readingTime = entry.readingTime / app.user.config.readingSpeed %} + {% set readingTime = entry.readingTime / app.user.config.readingSpeed * 200 %} {% if readingTime > 0 %} {{ 'entry.list.reading_time_minutes_short'|trans({'%readingTime%': readingTime|round}) }} {% else %} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_reading_time.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_reading_time.html.twig index 6ba18768..b7167e95 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_reading_time.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_reading_time.html.twig @@ -1,4 +1,4 @@ -{% set readingTime = entry.readingTime / app.user.config.readingSpeed %} +{% set readingTime = entry.readingTime / app.user.config.readingSpeed * 200 %} timer {% if readingTime > 0 %} {{ 'entry.list.reading_time_minutes_short'|trans({'%readingTime%': readingTime|round}) }} -- cgit v1.2.3 From 66fa0c26ab74467645e2cc63a4f48ef82e3f5748 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 9 Jul 2019 13:22:50 +0200 Subject: Copy client info to clipboard From the listing page and the create summary page, you can now copy client info to the clipboard using dedicated buttons. --- .../Resources/translations/messages.da.yml | 1 + .../Resources/translations/messages.de.yml | 1 + .../Resources/translations/messages.en.yml | 1 + .../Resources/translations/messages.es.yml | 1 + .../Resources/translations/messages.fa.yml | 1 + .../Resources/translations/messages.fr.yml | 1 + .../Resources/translations/messages.it.yml | 1 + .../Resources/translations/messages.oc.yml | 1 + .../Resources/translations/messages.pl.yml | 1 + .../Resources/translations/messages.pt.yml | 1 + .../Resources/translations/messages.ro.yml | 1 + .../Resources/translations/messages.ru.yml | 1 + .../Resources/translations/messages.th.yml | 1 + .../Resources/translations/messages.tr.yml | 1 + .../common/Developer/client_parameters.html.twig | 28 ++++++++++++++++++---- .../views/themes/common/Developer/index.html.twig | 15 ++++++++---- 16 files changed, 48 insertions(+), 9 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index 2db283ae..c504bddc 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -518,6 +518,7 @@ developer: # redirect_uris_label: 'Redirect URIs' # save_label: 'Create a new client' # action_back: 'Back' + # copy_to_clipboard: Copy to clipboard # client_parameter: # page_title: 'API clients management > Client parameters' # page_description: 'Here are your client parameters.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index db01272f..b2d1a09d 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -518,6 +518,7 @@ developer: redirect_uris_label: 'Weiterleitungs-URIs' save_label: 'Neuen Client erstellen' action_back: 'Zurück' + # copy_to_clipboard: Copy to clipboard client_parameter: page_title: 'API-Client-Verwaltung > Client-Parameter' page_description: 'Dies sind deine Client-Parameter.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 6d006310..6874e924 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -518,6 +518,7 @@ developer: redirect_uris_label: 'Redirect URIs (optional)' save_label: 'Create a new client' action_back: 'Back' + copy_to_clipboard: Copy to clipboard client_parameter: page_title: 'API clients management > Client parameters' page_description: 'Here are your client parameters.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 0eb74396..13e96e0f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -518,6 +518,7 @@ developer: redirect_uris_label: 'URIs de redirección' save_label: 'Crear un nuevo cliente' action_back: 'Volver' + # copy_to_clipboard: Copy to clipboard client_parameter: page_title: 'Gestión de clientes API > Parámetros del cliente' page_description: 'Aquí están los parámetros del cliente.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index 35afdbf4..425d3a6a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -518,6 +518,7 @@ developer: # redirect_uris_label: 'Redirect URIs' # save_label: 'Create a new client' # action_back: 'بازگشت' + # copy_to_clipboard: Copy to clipboard # client_parameter: # page_title: 'API clients management > Client parameters' # page_description: 'Here are your client parameters.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 8a79b02f..2c1a91a8 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -518,6 +518,7 @@ developer: redirect_uris_label: "Adresses de redirection (optionnel)" save_label: "Créer un nouveau client" action_back: "Retour" + copy_to_clipboard: Copier dans le presse-papier client_parameter: page_title: "Gestion des clients API > Les paramètres de votre client" page_description: "Voilà les paramètres de votre client" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 859bbb14..b8b37301 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -518,6 +518,7 @@ developer: redirect_uris_label: 'Redirect URI' save_label: 'Crea un nuovo client' action_back: 'Indietro' + # copy_to_clipboard: Copy to clipboard client_parameter: page_title: 'Gestione client API > Parametri Client' page_description: 'Questi sono i tuoi parametri del client.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 7d928613..c887fe29 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -518,6 +518,7 @@ developer: redirect_uris_label: 'URLs de redireccion' save_label: 'Crear un novèl client' action_back: 'Retorn' + # copy_to_clipboard: Copy to clipboard client_parameter: page_title: 'Gestion dels clients API > Los paramètres de vòstre client' page_description: 'Vaquí los paramètres de vòstre client.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 8e7ad7f2..3a2073d3 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -518,6 +518,7 @@ developer: redirect_uris_label: 'Przekieruj adresy URI' save_label: 'Stwórz nowego klienta' action_back: 'Cofnij' + # copy_to_clipboard: Copy to clipboard client_parameter: page_title: 'Zarządzanie klientami API > Parametry klienta' page_description: 'Tutaj znajdują się parametry klienta.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index ee45c085..50bc246c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -518,6 +518,7 @@ developer: redirect_uris_label: 'URIs de redirecionamento' save_label: 'Criar um novo cliente' action_back: 'Voltar' + # copy_to_clipboard: Copy to clipboard client_parameter: # page_title: 'API clients management > Parâmetros de clientes' page_description: 'Aqui estão os parâmetros de seus clientes.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index edfc77a2..a0da3299 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -518,6 +518,7 @@ developer: # redirect_uris_label: 'Redirect URIs' # save_label: 'Create a new client' # action_back: 'Back' + # copy_to_clipboard: Copy to clipboard # client_parameter: # page_title: 'API clients management > Client parameters' # page_description: 'Here are your client parameters.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index c99da444..7aedc290 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -518,6 +518,7 @@ developer: redirect_uris_label: 'Ссылка перенаправления (опционально)' save_label: 'Создать нового клиента' action_back: 'Назад' + # copy_to_clipboard: Copy to clipboard client_parameter: page_title: 'Управление клиентским API > Параметры клиента' page_description: 'Здесь ваши параметры клиента.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index 9927d059..924a85d9 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -518,6 +518,7 @@ developer: redirect_uris_label: 'เส้นทางใหม่ของ URIs (ให้เลือกได้)' save_label: 'สร่้างลูกข่ายใหม' action_back: 'กลับ' + # copy_to_clipboard: Copy to clipboard client_parameter: page_title: 'การจัดการลูกข่ายของ API > พารามิเตอร์ของลูกข่าย' page_description: 'ที่นี้เป็นพารามิเตอร์ของลูกข่ายของคุณ' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 60fa44d5..e81c1974 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -518,6 +518,7 @@ developer: # redirect_uris_label: 'Redirect URIs' # save_label: 'Create a new client' # action_back: 'Back' + # copy_to_clipboard: Copy to clipboard # client_parameter: # page_title: 'API clients management > Client parameters' # page_description: 'Here are your client parameters.' diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/client_parameters.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/client_parameters.html.twig index b498cceb..3a3ba0c9 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/client_parameters.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/client_parameters.html.twig @@ -8,11 +8,29 @@

    {{ 'developer.client_parameter.page_description'|trans }}

    -
      -
    • {{ 'developer.client_parameter.field_name'|trans }}:
      {{ client_name }}
    • -
    • {{ 'developer.client_parameter.field_id'|trans }}:
      {{ client_id }}
    • -
    • {{ 'developer.client_parameter.field_secret'|trans }}:
      {{ client_secret }}
    • -
    + + + + + + + + + + + + + + +
    {{ 'developer.client_parameter.field_name'|trans }}{{ client_name }}
    {{ 'developer.client_parameter.field_id'|trans }} + {{ client_id }} + +
    {{ 'developer.client_parameter.field_secret'|trans }} + {{ client_secret }} + +
    + +
    {{ 'developer.client_parameter.back'|trans }} {{ 'developer.client_parameter.read_howto'|trans }} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/index.html.twig index be04cddb..b83bf96f 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/index.html.twig @@ -33,11 +33,17 @@ - + - + @@ -48,9 +54,10 @@
    {{ 'developer.existing_clients.field_id'|trans }}{{ client.clientId }} + {{ client.clientId }} + +
    {{ 'developer.existing_clients.field_secret'|trans }}{{ client.secret }} + {{ client.secret }} + +
    {{ 'developer.existing_clients.field_uris'|trans }}{{ client.allowedGrantTypes|json_encode() }}
    + +

    {{ 'developer.remove.warn_message_1'|trans({'%name%': client.name }) }}

    +

    {{ 'developer.remove.warn_message_2'|trans({'%name%': client.name }) }}

    - {{ 'developer.remove.warn_message_1'|trans({'%name%': client.name }) }}
    - {{ 'developer.remove.warn_message_2'|trans({'%name%': client.name }) }}
    {{ 'developer.remove.action'|trans({'%name%': client.name }) }}

    -- cgit v1.2.3 From df45126a1475ea2051a8285d89f3693c0bc61cd3 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 9 Jul 2019 15:54:59 +0200 Subject: Update translations Remove log --- src/Wallabag/CoreBundle/Resources/translations/messages.da.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.de.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.en.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.es.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.it.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.th.yml | 2 +- src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index c504bddc..6f381408 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -518,7 +518,7 @@ developer: # redirect_uris_label: 'Redirect URIs' # save_label: 'Create a new client' # action_back: 'Back' - # copy_to_clipboard: Copy to clipboard + # copy_to_clipboard: Copy # client_parameter: # page_title: 'API clients management > Client parameters' # page_description: 'Here are your client parameters.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index b2d1a09d..7efb18aa 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -518,7 +518,7 @@ developer: redirect_uris_label: 'Weiterleitungs-URIs' save_label: 'Neuen Client erstellen' action_back: 'Zurück' - # copy_to_clipboard: Copy to clipboard + # copy_to_clipboard: Copy client_parameter: page_title: 'API-Client-Verwaltung > Client-Parameter' page_description: 'Dies sind deine Client-Parameter.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 6874e924..cf98e408 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -518,7 +518,7 @@ developer: redirect_uris_label: 'Redirect URIs (optional)' save_label: 'Create a new client' action_back: 'Back' - copy_to_clipboard: Copy to clipboard + copy_to_clipboard: Copy client_parameter: page_title: 'API clients management > Client parameters' page_description: 'Here are your client parameters.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 13e96e0f..f1a9c063 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -518,7 +518,7 @@ developer: redirect_uris_label: 'URIs de redirección' save_label: 'Crear un nuevo cliente' action_back: 'Volver' - # copy_to_clipboard: Copy to clipboard + # copy_to_clipboard: Copy client_parameter: page_title: 'Gestión de clientes API > Parámetros del cliente' page_description: 'Aquí están los parámetros del cliente.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index 425d3a6a..66e83e16 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -518,7 +518,7 @@ developer: # redirect_uris_label: 'Redirect URIs' # save_label: 'Create a new client' # action_back: 'بازگشت' - # copy_to_clipboard: Copy to clipboard + # copy_to_clipboard: Copy # client_parameter: # page_title: 'API clients management > Client parameters' # page_description: 'Here are your client parameters.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 2c1a91a8..886f89e4 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -518,7 +518,7 @@ developer: redirect_uris_label: "Adresses de redirection (optionnel)" save_label: "Créer un nouveau client" action_back: "Retour" - copy_to_clipboard: Copier dans le presse-papier + copy_to_clipboard: Copier client_parameter: page_title: "Gestion des clients API > Les paramètres de votre client" page_description: "Voilà les paramètres de votre client" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index b8b37301..3640e0a0 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -518,7 +518,7 @@ developer: redirect_uris_label: 'Redirect URI' save_label: 'Crea un nuovo client' action_back: 'Indietro' - # copy_to_clipboard: Copy to clipboard + # copy_to_clipboard: Copy client_parameter: page_title: 'Gestione client API > Parametri Client' page_description: 'Questi sono i tuoi parametri del client.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index c887fe29..768116bd 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -518,7 +518,7 @@ developer: redirect_uris_label: 'URLs de redireccion' save_label: 'Crear un novèl client' action_back: 'Retorn' - # copy_to_clipboard: Copy to clipboard + # copy_to_clipboard: Copy client_parameter: page_title: 'Gestion dels clients API > Los paramètres de vòstre client' page_description: 'Vaquí los paramètres de vòstre client.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 3a2073d3..909f7058 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -518,7 +518,7 @@ developer: redirect_uris_label: 'Przekieruj adresy URI' save_label: 'Stwórz nowego klienta' action_back: 'Cofnij' - # copy_to_clipboard: Copy to clipboard + # copy_to_clipboard: Copy client_parameter: page_title: 'Zarządzanie klientami API > Parametry klienta' page_description: 'Tutaj znajdują się parametry klienta.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 50bc246c..722ef0db 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -518,7 +518,7 @@ developer: redirect_uris_label: 'URIs de redirecionamento' save_label: 'Criar um novo cliente' action_back: 'Voltar' - # copy_to_clipboard: Copy to clipboard + # copy_to_clipboard: Copy client_parameter: # page_title: 'API clients management > Parâmetros de clientes' page_description: 'Aqui estão os parâmetros de seus clientes.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index a0da3299..380b5233 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -518,7 +518,7 @@ developer: # redirect_uris_label: 'Redirect URIs' # save_label: 'Create a new client' # action_back: 'Back' - # copy_to_clipboard: Copy to clipboard + # copy_to_clipboard: Copy # client_parameter: # page_title: 'API clients management > Client parameters' # page_description: 'Here are your client parameters.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index 7aedc290..a47525c6 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -518,7 +518,7 @@ developer: redirect_uris_label: 'Ссылка перенаправления (опционально)' save_label: 'Создать нового клиента' action_back: 'Назад' - # copy_to_clipboard: Copy to clipboard + # copy_to_clipboard: Copy client_parameter: page_title: 'Управление клиентским API > Параметры клиента' page_description: 'Здесь ваши параметры клиента.' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index 924a85d9..5879c48f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -518,7 +518,7 @@ developer: redirect_uris_label: 'เส้นทางใหม่ของ URIs (ให้เลือกได้)' save_label: 'สร่้างลูกข่ายใหม' action_back: 'กลับ' - # copy_to_clipboard: Copy to clipboard + # copy_to_clipboard: Copy client_parameter: page_title: 'การจัดการลูกข่ายของ API > พารามิเตอร์ของลูกข่าย' page_description: 'ที่นี้เป็นพารามิเตอร์ของลูกข่ายของคุณ' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index e81c1974..d023e368 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -518,7 +518,7 @@ developer: # redirect_uris_label: 'Redirect URIs' # save_label: 'Create a new client' # action_back: 'Back' - # copy_to_clipboard: Copy to clipboard + # copy_to_clipboard: Copy # client_parameter: # page_title: 'API clients management > Client parameters' # page_description: 'Here are your client parameters.' -- cgit v1.2.3 From 879f8eaa1857f250a8defe058f3bcf23d4045508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 10 Jul 2019 09:59:07 +0200 Subject: Fixed typo in wallabag name --- src/Wallabag/CoreBundle/Command/InstallCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index c58ae2b5..50e19f0c 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -54,7 +54,7 @@ class InstallCommand extends ContainerAwareCommand $this->io = new SymfonyStyle($input, $output); - $this->io->title('Wallabag installer'); + $this->io->title('wallabag installer'); $this ->checkRequirements() @@ -63,7 +63,7 @@ class InstallCommand extends ContainerAwareCommand ->setupConfig() ; - $this->io->success('Wallabag has been successfully installed.'); + $this->io->success('wallabag has been successfully installed.'); $this->io->success('You can now configure your web server, see https://doc.wallabag.org'); } -- cgit v1.2.3 From 9a80dcf11e4f3ee4f4a751550afc6469e76b22d9 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 24 Jul 2019 10:29:50 +0200 Subject: Use a custom cookiejar to avoid error when the cookie is badly saved It happens sometimes on wallabag.it, the json inside the cookie is badly saved and the json isn't valid. It generates an exception and avoid people to use the api and import contents. To fix that, we use a dedicated `FileCookieJar`, which extends the default one from Guzzle to fix these issues. Also updated deps --- src/Wallabag/CoreBundle/Helper/FileCookieJar.php | 72 ++++++++++++++++++++++ .../CoreBundle/Resources/config/services.yml | 2 +- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 src/Wallabag/CoreBundle/Helper/FileCookieJar.php (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/FileCookieJar.php b/src/Wallabag/CoreBundle/Helper/FileCookieJar.php new file mode 100644 index 00000000..52c7f5de --- /dev/null +++ b/src/Wallabag/CoreBundle/Helper/FileCookieJar.php @@ -0,0 +1,72 @@ +getExpires() && !$cookie->getDiscard()) { + $json[] = $cookie->toArray(); + } + } + + if (false === file_put_contents($filename, json_encode($json), LOCK_EX)) { + // @codeCoverageIgnoreStart + throw new \RuntimeException("Unable to save file {$filename}"); + // @codeCoverageIgnoreEnd + } + } + + /** + * Load cookies from a JSON formatted file. + * + * Old cookies are kept unless overwritten by newly loaded ones. + * + * @param string $filename cookie file to load + * + * @throws \RuntimeException if the file cannot be loaded + */ + public function load($filename) + { + $json = file_get_contents($filename); + if (false === $json) { + // @codeCoverageIgnoreStart + throw new \RuntimeException("Unable to load file {$filename}"); + // @codeCoverageIgnoreEnd + } + + try { + $data = Utils::jsonDecode($json, true); + } catch (\InvalidArgumentException $e) { + // cookie file is invalid, just ignore the exception and it'll reset the whole cookie file + $data = ''; + } + + if (\is_array($data)) { + foreach (Utils::jsonDecode($json, true) as $cookie) { + $this->setCookie(new SetCookie($cookie)); + } + } elseif (\strlen($data)) { + throw new \RuntimeException("Invalid cookie file: {$filename}"); + } + } +} diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml index 31986951..169b67e5 100644 --- a/src/Wallabag/CoreBundle/Resources/config/services.yml +++ b/src/Wallabag/CoreBundle/Resources/config/services.yml @@ -82,7 +82,7 @@ services: - ["addSubscriber", ["@bd_guzzle_site_authenticator.authenticator_subscriber"]] wallabag_core.guzzle.cookie_jar: - class: GuzzleHttp\Cookie\FileCookieJar + class: Wallabag\CoreBundle\Helper\FileCookieJar arguments: ["%kernel.cache_dir%/cookiejar.json"] wallabag_core.content_proxy: -- cgit v1.2.3 From 51d7f62b316abfc14e770b3108edb0e3f48e38dd Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 24 Jul 2019 16:07:38 +0200 Subject: Add logger to FileCookieJar --- src/Wallabag/CoreBundle/Helper/FileCookieJar.php | 19 +++++++++++++++++++ src/Wallabag/CoreBundle/Resources/config/services.yml | 4 +++- 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/FileCookieJar.php b/src/Wallabag/CoreBundle/Helper/FileCookieJar.php index 52c7f5de..9a63e949 100644 --- a/src/Wallabag/CoreBundle/Helper/FileCookieJar.php +++ b/src/Wallabag/CoreBundle/Helper/FileCookieJar.php @@ -5,6 +5,7 @@ namespace Wallabag\CoreBundle\Helper; use GuzzleHttp\Cookie\FileCookieJar as BaseFileCookieJar; use GuzzleHttp\Cookie\SetCookie; use GuzzleHttp\Utils; +use Psr\Log\LoggerInterface; /** * Overidden Cookie behavior to: @@ -13,6 +14,19 @@ use GuzzleHttp\Utils; */ class FileCookieJar extends BaseFileCookieJar { + private $logger; + + /** + * @param LoggerInterface $logger Only used to log info when something goes wrong + * @param string $cookieFile File to store the cookie data + */ + public function __construct(LoggerInterface $logger, $cookieFile) + { + parent::__construct($cookieFile); + + $this->logger = $logger; + } + /** * Saves the cookies to a file. * @@ -57,6 +71,11 @@ class FileCookieJar extends BaseFileCookieJar try { $data = Utils::jsonDecode($json, true); } catch (\InvalidArgumentException $e) { + $this->logger->error('JSON inside the cookie is broken', [ + 'json' => $json, + 'error_msg' => $e->getMessage(), + ]); + // cookie file is invalid, just ignore the exception and it'll reset the whole cookie file $data = ''; } diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml index 169b67e5..3f3d4de7 100644 --- a/src/Wallabag/CoreBundle/Resources/config/services.yml +++ b/src/Wallabag/CoreBundle/Resources/config/services.yml @@ -83,7 +83,9 @@ services: wallabag_core.guzzle.cookie_jar: class: Wallabag\CoreBundle\Helper\FileCookieJar - arguments: ["%kernel.cache_dir%/cookiejar.json"] + arguments: + - "@logger" + - "%kernel.cache_dir%/cookiejar.json" wallabag_core.content_proxy: class: Wallabag\CoreBundle\Helper\ContentProxy -- cgit v1.2.3 From b0ba7ff446a0416ee2dc22b84c7d413b5968234d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quent=C3=AD?= <33203663+Quenty31@users.noreply.github.com> Date: Fri, 26 Jul 2019 13:16:18 +0200 Subject: Update of Occitan language --- .../Resources/translations/messages.oc.yml | 96 +++++++++++----------- 1 file changed, 48 insertions(+), 48 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 768116bd..cd60566a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -38,7 +38,7 @@ menu: add_new_entry: 'Enregistrar un novèl article' search: 'Cercar' filter_entries: 'Filtrar los articles' - # random_entry: Jump to a random entry from that list + random_entry: "Sautar a un article a l'azard" export: 'Exportar' search_form: input_label: 'Picatz vòstre mot-clau a cercar aquí' @@ -88,7 +88,7 @@ config: no_token: 'Pas cap de geton generat' token_create: 'Creatz vòstre geton' token_reset: 'Reïnicializatz vòstre geton' - # token_revoke: 'Revoke the token' + oken_revoke: 'Revocar lo geton' feed_links: 'URLs de vòstres fluxes RSS' feed_link: unread: 'Pas legits' @@ -97,20 +97,20 @@ config: all: 'Totes' feed_limit: "Nombre d'articles dins un flux" form_user: - # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." - # login_label: 'Login (can not be changed)' + two_factor_description: "L’activacion de l’autentificacion en dos temps indica que recebretz un còdi per corrièl amb un còdi O que vos cal utilizar una aplicacion OTP (coma Google Authenticator, Authy o FreeOTP) per obténer un còdi a usatge unic cada còp qu’i a una connexion pas fisabla. Podètz pas causir las doas opcions." + login_label: 'Identificant (se pòt pas cambiar)' name_label: 'Nom' email_label: 'Adreça de corrièl' two_factor: - # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' - # table_method: Method - # table_state: State - # table_action: Action - # state_enabled: Enabled - # state_disabled: Disabled - # action_email: Use email - # action_app: Use OTP App + emailTwoFactor_label: 'En utilizar lo corrièl (recebre un còdi per corrièl)' + googleTwoFactor_label: 'En utilizar una aplicacion OTP (Dobrir l’aplicacion, coma Google Authenticator, Authy o FreeOTP, per obténer un còdi a usatge unic)' + table_method: Metòde + table_state: Estat + table_action: Accion + state_enabled: Activada + state_disabled: Desactivada + action_email: Utilizar lo corrièl + action_app: Utilizar una aplicacion OTP delete: title: Suprimir mon compte (Mèfi zòna perilhosa) description: Se confirmatz la supression de vòstre compte, TOTES vòstres articles, TOTAS vòstras etiquetas, TOTAS vòstras anotacions e vòstre compte seràn suprimits per totjorn. E aquò es IRREVERSIBLE. Puèi seretz desconnectat. @@ -136,15 +136,15 @@ config: edit_rule_label: 'modificar' rule_label: 'Règla' tags_label: 'Etiquetas' - # card: - # new_tagging_rule: Create a tagging rule - # import_tagging_rules: Import tagging rules - # import_tagging_rules_detail: You have to select the JSON file you previously exported. - # export_tagging_rules: Export tagging rules - # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them. - # file_label: JSON file - # import_submit: Import - # export: Export + card: + new_tagging_rule: Crear una règla d’etiquetatge + import_tagging_rules: Importar de règlas d’etiquetatge + import_tagging_rules_detail: Vos cal causir un fichièr JSON qu’importèretz per abans. + export_tagging_rules: Exportar las règlas d’etiquetatge + export_tagging_rules_detail: Telecargarà un fichièr JSON que podètz utilizar per importar las règlas d’etiquetatge endacòm mai o per las salvagardar. + file_label: fichièr JSON + import_submit: Importar + export: Exportar faq: title: 'FAQ' tagging_rules_definition_title: "Qué significa las règlas d'etiquetas automaticas ?" @@ -178,14 +178,14 @@ config: matches: 'Teste se un subjècte correspond a una recèrca (non sensibla a la cassa).
    Exemple : title matches \"football\"' notmatches: 'Teste se subjècte correspond pas a una recèrca (sensibla a la cassa).
    Example : title notmatches "football"' otp: - # page_title: Two-factor authentication - # app: - # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. - # two_factor_code_description_2: 'You can scan that QR Code with your app:' - # two_factor_code_description_3: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' - # two_factor_code_description_4: 'Test an OTP code from your configured app:' - # cancel: Cancel - # enable: Enable + page_title: Autentificacion en dos temps + app: + two_factor_code_description_1: Avètz pas qu’activat l’autentificacion en dos temps, dobrissètz l’aplicacion OTP e utilizatz aqueste còdi per obténer un senhal unic. Apareisserà aprèp un recargament de pagina. + two_factor_code_description_2: 'Podètz numerizar aqueste còdi QR amb l’aplicacion :' + two_factor_code_description_3: 'Amai, enregistratz aquestes còdis de recuperacion dins un lòc segur, los podètz utilizar se per cas perdatz l’accès a l’aplicacion OTP :' + two_factor_code_description_4: 'Ensajatz un còdi de vòstra aplicacion configurada app :' + cancel: Anullar + enable: Activar entry: default_title: "Títol de l'article" @@ -213,7 +213,7 @@ entry: export_title: 'Exportar' filters: title: 'Filtres' - status_label: 'Estatus' + status_label: 'Estat' archived_label: 'Legits' starred_label: 'Favorits' unread_label: 'Pas legits' @@ -222,7 +222,7 @@ entry: is_public_label: 'Ten un ligam public' is_public_help: 'Ligam public' language_label: 'Lenga' - http_status_label: 'Estatut HTTP' + http_status_label: 'Estat HTTP' reading_time: label: 'Durada de lectura en minutas' from: 'de' @@ -281,10 +281,10 @@ entry: delete: "Sètz segur de voler suprimir aqueste article ?" delete_tag: "Sètz segur de voler levar aquesta etiqueta de l'article ?" metadata: - # reading_time: "Estimated reading time" - # reading_time_minutes_short: "%readingTime% min" - # address: "Address" - # added_on: "Added on" + reading_time: "Temps de lectura estimat" + reading_time_minutes_short: "%readingTime% min" + address: "Adreça" + added_on: "Ajustat a" about: page_title: 'A prepaus' @@ -428,16 +428,16 @@ tag: list: number_on_the_page: "{0} I a pas cap d'etiquetas.|{1} I a una etiqueta.|]1,Inf[ I a %count% etiquetas." see_untagged_entries: "Afichar las entradas sens etiquetas" - # no_untagged_entries: 'There are no untagged entries.' + no_untagged_entries: 'I a pas cap d’article pas etiquetat.' new: add: 'Ajustar' placeholder: "Podètz ajustar mai qu'una etiqueta, separadas per de virgula." rename: - # placeholder: 'You can update tag name.' + placeholder: 'Podètz actualizar lo nom de l’etiqueta.' export: footer_template: '

    Produch per wallabag amb %method%

    Mercés de dobrir una sollicitacion s’avètz de problèmas amb l’afichatge d’aqueste E-Book sus vòstre periferic.

    ' - # unknown: 'Unknown' + unknown: 'Desconegut' import: page_title: 'Importar' @@ -518,7 +518,7 @@ developer: redirect_uris_label: 'URLs de redireccion' save_label: 'Crear un novèl client' action_back: 'Retorn' - # copy_to_clipboard: Copy + copy_to_clipboard: Copiar client_parameter: page_title: 'Gestion dels clients API > Los paramètres de vòstre client' page_description: 'Vaquí los paramètres de vòstre client.' @@ -560,8 +560,8 @@ user: email_label: 'Adreça de corrièl' enabled_label: 'Actiu' last_login_label: 'Darrièra connexion' - # twofactor_email_label: Two factor authentication by email - # twofactor_google_label: Two factor authentication by OTP app + twofactor_email_label: Autentificacion en dos temps per corrièl + twofactor_google_label: Autentificacion en dos temps per aplicacion OTP save: 'Enregistrar' delete: 'Suprimir' delete_confirm: 'Sètz segur ?' @@ -603,14 +603,14 @@ flashes: tagging_rules_updated: 'Règlas misa a jorn' tagging_rules_deleted: 'Règla suprimida' feed_token_updated: 'Geton RSS mes a jorn' - # feed_token_revoked: 'RSS token revoked' + feed_token_revoked: 'Geton RSS revocat' annotations_reset: Anotacions levadas tags_reset: Etiquetas levadas entries_reset: Articles levats archived_reset: Articles archivat suprimits - # otp_enabled: Two-factor authentication enabled - # tagging_rules_imported: Tagging rules imported - # tagging_rules_not_imported: Error while importing tagging rules + otp_enabled: Autentificacion en dos temps activada + tagging_rules_imported: Règlas d’etiquetatge importadas + tagging_rules_not_imported: Error en important las règlas d’etiquetatge entry: notice: entry_already_saved: 'Article ja salvagardat lo %date%' @@ -624,11 +624,11 @@ flashes: entry_starred: 'Article ajustat dins los favorits' entry_unstarred: 'Article quitat dels favorits' entry_deleted: 'Article suprimit' - # no_random_entry: 'No article with these criterias was found' + no_random_entry: 'Cap d’article pas trobat amb aquestes critèris' tag: notice: tag_added: 'Etiqueta ajustada' - # tag_renamed: 'Tag renamed' + tag_renamed: 'Etiqueta renomenada' import: notice: failed: "L'importacion a fracassat, mercés de tornar ensajar." -- cgit v1.2.3 From 62665a32bb15ea2330e840c11adc2b5a0c9cb854 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 26 Jul 2019 13:22:48 +0200 Subject: Upgrade to 4.0 --- .../Resources/views/themes/baggy/Config/otp_app.html.twig | 2 +- .../Resources/views/themes/material/Config/otp_app.html.twig | 2 +- .../UserBundle/Resources/views/Authentication/form.html.twig | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/otp_app.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/otp_app.html.twig index 0919646e..1d3685ae 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/otp_app.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/otp_app.html.twig @@ -35,7 +35,7 @@
    - +
    diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/otp_app.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/otp_app.html.twig index 7875d787..6f405d7f 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/otp_app.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/otp_app.html.twig @@ -39,7 +39,7 @@
    - +
    diff --git a/src/Wallabag/UserBundle/Resources/views/Authentication/form.html.twig b/src/Wallabag/UserBundle/Resources/views/Authentication/form.html.twig index 47a5cb78..c16a6eaf 100644 --- a/src/Wallabag/UserBundle/Resources/views/Authentication/form.html.twig +++ b/src/Wallabag/UserBundle/Resources/views/Authentication/form.html.twig @@ -16,14 +16,14 @@ {% endif %}
    - +
    {% if displayTrustedOption %}
    - +
    {% endif %}
    @@ -31,7 +31,7 @@
    {{ 'security.login.cancel'|trans }}
    -- cgit v1.2.3 From d1dbe10e8460b7117c98ee1e02735602887fd3a4 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Mon, 5 Aug 2019 23:29:55 +1000 Subject: Update language in Entry model, and add index Fixes #4080 Signed-off-by: Olivier Mehani --- src/Wallabag/CoreBundle/Entity/Entry.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 4d5e6fc9..eb185b8c 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -28,7 +28,8 @@ use Wallabag\UserBundle\Entity\User; * @ORM\Index(name="created_at", columns={"created_at"}), * @ORM\Index(name="uid", columns={"uid"}), * @ORM\Index(name="hashed_url_user_id", columns={"user_id", "hashed_url"}, options={"lengths"={null, 40}}), - * @ORM\Index(name="hashed_given_url_user_id", columns={"user_id", "hashed_given_url"}, options={"lengths"={null, 40}}) + * @ORM\Index(name="hashed_given_url_user_id", columns={"user_id", "hashed_given_url"}, options={"lengths"={null, 40}}), + * @ORM\Index(name="user_language", columns={"language", "user_id"}) * } * ) * @ORM\HasLifecycleCallbacks() @@ -221,7 +222,7 @@ class Entry /** * @var string * - * @ORM\Column(name="language", type="text", nullable=true) + * @ORM\Column(name="language", type="string", length=20, nullable=true) * * @Groups({"entries_for_user", "export_all"}) */ -- cgit v1.2.3 From 5071c8c9cf4d3fcb79851e3ea089593c81cd3b02 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Tue, 6 Aug 2019 22:39:12 +1000 Subject: Add index on starred entries Fixes #4079 Signed-off-by: Olivier Mehani --- src/Wallabag/CoreBundle/Entity/Entry.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index eb185b8c..593ff01d 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -29,7 +29,8 @@ use Wallabag\UserBundle\Entity\User; * @ORM\Index(name="uid", columns={"uid"}), * @ORM\Index(name="hashed_url_user_id", columns={"user_id", "hashed_url"}, options={"lengths"={null, 40}}), * @ORM\Index(name="hashed_given_url_user_id", columns={"user_id", "hashed_given_url"}, options={"lengths"={null, 40}}), - * @ORM\Index(name="user_language", columns={"language", "user_id"}) + * @ORM\Index(name="user_language", columns={"language", "user_id"}), + * @ORM\Index(name="user_starred", columns={"user_id", "is_starred", "starred_at"}) * } * ) * @ORM\HasLifecycleCallbacks() -- cgit v1.2.3 From 588de419e043bc1d8876552809607721cb256094 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Wed, 7 Aug 2019 21:44:00 +1000 Subject: Add user_archived index Signed-off-by: Olivier Mehani --- src/Wallabag/CoreBundle/Entity/Entry.php | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 593ff01d..49f19cfa 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -30,6 +30,7 @@ use Wallabag\UserBundle\Entity\User; * @ORM\Index(name="hashed_url_user_id", columns={"user_id", "hashed_url"}, options={"lengths"={null, 40}}), * @ORM\Index(name="hashed_given_url_user_id", columns={"user_id", "hashed_given_url"}, options={"lengths"={null, 40}}), * @ORM\Index(name="user_language", columns={"language", "user_id"}), + * @ORM\Index(name="user_archived", columns={"user_id", "is_archived", "archived_at"}), * @ORM\Index(name="user_starred", columns={"user_id", "is_starred", "starred_at"}) * } * ) -- cgit v1.2.3 From 2b0f4e86b27fec39f5e172fbeba9ce033aef2e79 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Wed, 7 Aug 2019 22:02:37 +1000 Subject: Add user_created index Signed-off-by: Olivier Mehani --- src/Wallabag/CoreBundle/Entity/Entry.php | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 49f19cfa..4acec261 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -31,6 +31,7 @@ use Wallabag\UserBundle\Entity\User; * @ORM\Index(name="hashed_given_url_user_id", columns={"user_id", "hashed_given_url"}, options={"lengths"={null, 40}}), * @ORM\Index(name="user_language", columns={"language", "user_id"}), * @ORM\Index(name="user_archived", columns={"user_id", "is_archived", "archived_at"}), + * @ORM\Index(name="user_created", columns={"user_id", "created_at"}), * @ORM\Index(name="user_starred", columns={"user_id", "is_starred", "starred_at"}) * } * ) -- cgit v1.2.3 From 0810c75e0bd2aa008d69da819a7c51207f159854 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 8 Aug 2019 09:36:03 +0200 Subject: Add `tag_label` & `config_feed_token` index --- src/Wallabag/CoreBundle/Entity/Config.php | 7 ++++++- src/Wallabag/CoreBundle/Entity/Tag.php | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php index c6e65d66..5181d91d 100644 --- a/src/Wallabag/CoreBundle/Entity/Config.php +++ b/src/Wallabag/CoreBundle/Entity/Config.php @@ -11,7 +11,12 @@ use Wallabag\UserBundle\Entity\User; * Config. * * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\ConfigRepository") - * @ORM\Table(name="`config`") + * @ORM\Table( + * name="`config`", + * indexes={ + * @ORM\Index(name="config_feed_token", columns={"feed_token"}, options={"lengths"={255}}), + * } + * ) * @ORM\Entity */ class Config diff --git a/src/Wallabag/CoreBundle/Entity/Tag.php b/src/Wallabag/CoreBundle/Entity/Tag.php index 95c47bbd..3ccb20a5 100644 --- a/src/Wallabag/CoreBundle/Entity/Tag.php +++ b/src/Wallabag/CoreBundle/Entity/Tag.php @@ -16,6 +16,9 @@ use JMS\Serializer\Annotation\XmlRoot; * @ORM\Table( * name="`tag`", * options={"collate"="utf8mb4_bin", "charset"="utf8mb4"}, + * indexes={ + * @ORM\Index(name="tag_label", columns={"label"}, options={"lengths"={255}}), + * } * ) * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\TagRepository") * @ExclusionPolicy("all") -- cgit v1.2.3 From 1576905e0357ef96cd852ea3c1ff4216af195c34 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 8 Aug 2019 15:19:53 +0200 Subject: Rename internal settings table In fact it's not _just_ a rename. We are now able to use our own entity with the CraueConfigBundle which allow us to enforce a custom length on string field and avoid error with utf8mb4 on MySQL. To fix that issue before we were in need to fork CraueConfigBundle to hard apply these length changes. The recent 2.3.0 release fix that issue. That's why we are in need to rename the table (getting rid of the bundle name from it) Also updating deps: - Updating symfony/polyfill-mbstring (v1.11.0 => v1.12.0) - Updating symfony/polyfill-ctype (v1.11.0 => v1.12.0) - Updating symfony/polyfill-php70 (v1.11.0 => v1.12.0) - Updating symfony/polyfill-util (v1.11.0 => v1.12.0) - Updating symfony/polyfill-php56 (v1.11.0 => v1.12.0) - Updating symfony/polyfill-intl-icu (v1.11.0 => v1.12.0) - Updating symfony/polyfill-apcu (v1.11.0 => v1.12.0) - Updating j0k3r/graby-site-config (1.0.88 => 1.0.89) - Updating php-http/message (1.7.2 => 1.8.0) - Updating symfony/polyfill-php73 (v1.11.0 => v1.12.0) - Updating symfony/http-client (v4.3.2 => v4.3.3) - Updating symfony/polyfill-php72 (v1.11.0 => v1.12.0) - Updating symfony/polyfill-intl-idn (v1.11.0 => v1.12.0) - Updating symfony/mime (v4.3.2 => v4.3.3) - Updating craue/config-bundle (dev-utf8mb4 46cfd37 => 2.3.0) - Updating masterminds/html5 (2.6.0 => 2.7.0) - Updating nette/di (v3.0.0 => v3.0.1) - Updating symfony/polyfill-iconv (v1.11.0 => v1.12.0) - Updating wallabag/php-mobi (1.0.1 => 1.1.0) --- src/Wallabag/CoreBundle/Command/InstallCommand.php | 6 ++-- .../DataFixtures/InternalSettingFixtures.php | 38 ++++++++++++++++++++++ .../CoreBundle/DataFixtures/SettingFixtures.php | 38 ---------------------- src/Wallabag/CoreBundle/Entity/Config.php | 1 - src/Wallabag/CoreBundle/Entity/InternalSetting.php | 36 ++++++++++++++++++++ 5 files changed, 77 insertions(+), 42 deletions(-) create mode 100644 src/Wallabag/CoreBundle/DataFixtures/InternalSettingFixtures.php delete mode 100644 src/Wallabag/CoreBundle/DataFixtures/SettingFixtures.php create mode 100644 src/Wallabag/CoreBundle/Entity/InternalSetting.php (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index 50e19f0c..f73e0696 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -2,7 +2,6 @@ namespace Wallabag\CoreBundle\Command; -use Craue\ConfigBundle\Entity\Setting; use FOS\UserBundle\Event\UserEvent; use FOS\UserBundle\FOSUserEvents; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; @@ -13,6 +12,7 @@ use Symfony\Component\Console\Output\BufferedOutput; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\Question; use Symfony\Component\Console\Style\SymfonyStyle; +use Wallabag\CoreBundle\Entity\InternalSetting; class InstallCommand extends ContainerAwareCommand { @@ -276,10 +276,10 @@ class InstallCommand extends ContainerAwareCommand $em = $this->getContainer()->get('doctrine.orm.entity_manager'); // cleanup before insert new stuff - $em->createQuery('DELETE FROM CraueConfigBundle:Setting')->execute(); + $em->createQuery('DELETE FROM WallabagCoreBundle:InternalSetting')->execute(); foreach ($this->getContainer()->getParameter('wallabag_core.default_internal_settings') as $setting) { - $newSetting = new Setting(); + $newSetting = new InternalSetting(); $newSetting->setName($setting['name']); $newSetting->setValue($setting['value']); $newSetting->setSection($setting['section']); diff --git a/src/Wallabag/CoreBundle/DataFixtures/InternalSettingFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/InternalSettingFixtures.php new file mode 100644 index 00000000..b052d1d5 --- /dev/null +++ b/src/Wallabag/CoreBundle/DataFixtures/InternalSettingFixtures.php @@ -0,0 +1,38 @@ +container = $container; + } + + /** + * {@inheritdoc} + */ + public function load(ObjectManager $manager) + { + foreach ($this->container->getParameter('wallabag_core.default_internal_settings') as $setting) { + $newSetting = new InternalSetting(); + $newSetting->setName($setting['name']); + $newSetting->setValue($setting['value']); + $newSetting->setSection($setting['section']); + $manager->persist($newSetting); + } + + $manager->flush(); + } +} diff --git a/src/Wallabag/CoreBundle/DataFixtures/SettingFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/SettingFixtures.php deleted file mode 100644 index cc7d1f59..00000000 --- a/src/Wallabag/CoreBundle/DataFixtures/SettingFixtures.php +++ /dev/null @@ -1,38 +0,0 @@ -container = $container; - } - - /** - * {@inheritdoc} - */ - public function load(ObjectManager $manager) - { - foreach ($this->container->getParameter('wallabag_core.default_internal_settings') as $setting) { - $newSetting = new Setting(); - $newSetting->setName($setting['name']); - $newSetting->setValue($setting['value']); - $newSetting->setSection($setting['section']); - $manager->persist($newSetting); - } - - $manager->flush(); - } -} diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php index 5181d91d..35be9655 100644 --- a/src/Wallabag/CoreBundle/Entity/Config.php +++ b/src/Wallabag/CoreBundle/Entity/Config.php @@ -17,7 +17,6 @@ use Wallabag\UserBundle\Entity\User; * @ORM\Index(name="config_feed_token", columns={"feed_token"}, options={"lengths"={255}}), * } * ) - * @ORM\Entity */ class Config { diff --git a/src/Wallabag/CoreBundle/Entity/InternalSetting.php b/src/Wallabag/CoreBundle/Entity/InternalSetting.php new file mode 100644 index 00000000..df8bd3be --- /dev/null +++ b/src/Wallabag/CoreBundle/Entity/InternalSetting.php @@ -0,0 +1,36 @@ + Date: Wed, 21 Aug 2019 19:20:26 +0200 Subject: material-design-icons-iconfont upgraded from 3.0.3 to 5.0.1 --- .../CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig | 2 +- .../CoreBundle/Resources/views/themes/material/Entry/entry.html.twig | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Wallabag') 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 7616cf4c..5809c8d4 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 @@ -70,7 +70,7 @@ {% endif %}
    - comment {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }} + comment {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }} {% if entry.originUrl is not empty %} launch 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 15b4d82f..2b249b73 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 @@ -250,13 +250,13 @@ {% endif %}
  • - link + link {{ entry.domainName|removeWww }}
  • - comment + comment {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}
  • {% if entry.originUrl is not empty %} -- cgit v1.2.3 From af7b22a3be35fff69b877ff68f9a12b1b73b421e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 19 Sep 2019 14:23:06 +0200 Subject: Fixed default value for reading speed --- src/Wallabag/CoreBundle/DependencyInjection/Configuration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php index a9791f6b..7ae73371 100644 --- a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php +++ b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php @@ -30,7 +30,7 @@ class Configuration implements ConfigurationInterface ->defaultValue(50) ->end() ->integerNode('reading_speed') - ->defaultValue(1) + ->defaultValue(200) ->end() ->scalarNode('version') ->end() -- cgit v1.2.3 From 90d28270d5ad0ce80b3b6dbaba432d5483b1e6e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 27 Sep 2019 16:20:35 +0200 Subject: Fixed some :fr: typos --- src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 886f89e4..6fb856f2 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -71,7 +71,7 @@ config: label: "Vitesse de lecture (mots par minute)" help_message: "Vous pouvez utiliser un outil en ligne pour estimer votre vitesse de lecture :" action_mark_as_read: - label: "Que faire lorsqu'un article est supprimé, marqué comme lu ou marqué comme favoris ?" + label: "Que faire lorsqu'un article est supprimé, marqué comme lu ou marqué comme favori ?" redirect_homepage: "Retourner à la page d’accueil" redirect_current_page: "Rester sur la page actuelle" pocket_consumer_key_label: "Clé d’authentification Pocket pour importer les données" @@ -322,7 +322,7 @@ howto: tab_menu: add_link: "Ajouter un lien" shortcuts: "Utiliser les raccourcis" - page_description: "Il y a plusieurs façon d’enregistrer un article :" + page_description: "Il y a plusieurs façons d’enregistrer un article :" top_menu: browser_addons: "Extensions de navigateur" mobile_apps: "Applications smartphone" -- cgit v1.2.3 From 3824f0dc3c1bab6f3860d11bc0167e7d6ec78ba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 30 Sep 2019 11:46:08 +0200 Subject: Fixed translation for 2FA --- src/Wallabag/UserBundle/Resources/views/Authentication/form.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/UserBundle/Resources/views/Authentication/form.html.twig b/src/Wallabag/UserBundle/Resources/views/Authentication/form.html.twig index c16a6eaf..e15ed255 100644 --- a/src/Wallabag/UserBundle/Resources/views/Authentication/form.html.twig +++ b/src/Wallabag/UserBundle/Resources/views/Authentication/form.html.twig @@ -12,7 +12,7 @@ {# Authentication errors #} {% if authenticationError %} -

    {{ authenticationError|trans(authenticationErrorData) }}

    +

    {{ authenticationError|trans(authenticationErrorData, 'SchebTwoFactorBundle') }}

    {% endif %}
    -- cgit v1.2.3 From 0ff962829a377299d4c078cb950d01a378943489 Mon Sep 17 00:00:00 2001 From: Sofia Lescano Date: Sat, 5 Oct 2019 21:03:19 +0200 Subject: Update spanish translations --- .../Resources/translations/messages.es.yml | 216 ++++++++++----------- .../Resources/translations/validators.es.yml | 6 +- 2 files changed, 111 insertions(+), 111 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index f1a9c063..b7cdd261 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -32,13 +32,13 @@ menu: save_link: 'Guardar un enlace' back_to_unread: 'Volver a los artículos sin leer' users_management: 'Configuración de usuarios' - # site_credentials: 'Site credentials' + site_credentials: 'Credenciales del sitio' quickstart: "Inicio rápido" top: add_new_entry: 'Añadir un nuevo artículo' search: 'Buscar' filter_entries: 'Filtrar los artículos' - # random_entry: Jump to a random entry from that list + random_entry: 'Ir a un artículo aleatório de esta lista' export: 'Exportar' search_form: input_label: 'Introduzca su búsqueda aquí' @@ -47,7 +47,7 @@ footer: wallabag: elsewhere: 'Lleva wallabag contigo' social: 'Social' - powered_by: 'funciona con' + powered_by: 'impulsado por' about: 'Acerca de' stats: Desde el %user_creation% has leído %nb_archives% artículos. ¡Eso hace unos %per_day% por día! @@ -76,41 +76,41 @@ config: redirect_current_page: 'A la página actual' pocket_consumer_key_label: Clave de consumidor para importar contenidos de Pocket android_configuration: Configura tu aplicación Android - # android_instruction: "Touch here to prefill your Android application" + android_instruction: "Toca aquí para prellenar tu aplicación Android" help_theme: "wallabag es personalizable. Puedes elegir tu tema preferido aquí." help_items_per_page: "Puedes cambiar el número de artículos mostrados en cada página." help_reading_speed: "wallabag calcula un tiempo de lectura para cada artículo. Puedes definir aquí, gracias a esta lista, si eres un lector rápido o lento. wallabag recalculará el tiempo de lectura para cada artículo." help_language: "Puedes cambiar el idioma de la interfaz de wallabag." help_pocket_consumer_key: "Requerido para la importación desde Pocket. Puedes crearla en tu cuenta de Pocket." form_feed: - description: 'Los feeds RSS de wallabag permiten leer los artículos guardados con su lector RSS favorito. Primero necesitas generar un token.' + description: 'Los feeds RSS de wallabag permiten leer los artículos guardados con tu lector RSS favorito. Primero necesitas generar un token.' token_label: 'Token RSS' no_token: 'Sin token' token_create: 'Crear token' token_reset: 'Reiniciar token' - # token_revoke: 'Revoke the token' + token_revoke: 'Revocar token' feed_links: 'URLs de feeds RSS' feed_link: - unread: 'sin leer' - starred: 'favoritos' - archive: 'archivados' - # all: 'All' + unread: 'Sin leer' + starred: 'Favoritos' + archive: 'Archivados' + all: 'Todos' feed_limit: 'Límite de artículos en feed RSS' form_user: - # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." - # login_label: 'Login (can not be changed)' + two_factor_description: "Activar la autenticación de dos pasos significa que recibirás un correo electrónico con un código o que necesitarás usar una aplicación OTP (como Google Authenticator, Authy or FreeOTP) para conseguir un código de utilización única en cada nueva conexión no confiable. No puedes usar los dos métodos." + login_label: 'Nombre de usuario (no se puede cambiar)' name_label: 'Nombre' - email_label: 'Dirección de e-mail' + email_label: 'Dirección de correo electrónico' two_factor: - # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' - # table_method: Method - # table_state: State - # table_action: Action - # state_enabled: Enabled - # state_disabled: Disabled - # action_email: Use email - # action_app: Use OTP App + emailTwoFactor_label: 'Usando el correo electrónico (recibe un código por correo electrónico)' + googleTwoFactor_label: 'Usando una aplicación OTP (abre la aplicación, por ejemplo Google Authenticator, Authy o FreeOTP, para conseguir un código de utilización única)' + table_method: 'Método' + table_state: 'Estado' + table_action: 'Acción' + state_enabled: 'Activado' + state_disabled: 'Desactivado' + action_email: 'Usar correo electrónico' + action_app: 'Usar aplicación OTP' delete: title: Eliminar mi cuenta (Zona peligrosa) description: Si eliminas tu cuenta, TODOS tus artículos, TODAS tus etiquetas, TODAS tus anotaciones y tu cuenta serán eliminadas de forma PERMANENTE (no se puede deshacer). Después serás desconectado. @@ -122,7 +122,7 @@ config: annotations: Eliminar TODAS las anotaciones tags: Eliminar TODAS las etiquetas entries: Eliminar TODOS los artículos - # archived: Remove ALL archived entries + archived: Eliminar TODOS los artículos archivados confirm: ¿Estás completamente seguro? (NO SE PUEDE DESHACER) form_password: description: "Puedes cambiar la contraseña aquí. Tu nueva contraseña debe tener al menos 8 caracteres." @@ -136,15 +136,15 @@ config: edit_rule_label: 'editar' rule_label: 'Regla' tags_label: 'Etiquetas' - # card: - # new_tagging_rule: Create a tagging rule - # import_tagging_rules: Import tagging rules - # import_tagging_rules_detail: You have to select the JSON file you previously exported. - # export_tagging_rules: Export tagging rules - # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them. - # file_label: JSON file - # import_submit: Import - # export: Export + card: + new_tagging_rule: Crear una regla de etiquetado + import_tagging_rules: Importar reglas de etiquetado + import_tagging_rules_detail: Debes seleccionar un archivo JSON exportado previamente. + export_tagging_rules: Exportar reglas de etiquetado + export_tagging_rules_detail: Un archivo JSON será descargado y este podrá ser utilizado para volver a importar las reglas de etiquetado o como copia de seguridad. + file_label: Archivo JSON + import_submit: Importar + export: Exportar faq: title: 'Preguntas frecuentes' tagging_rules_definition_title: '¿Qué significa « reglas de etiquetado automático »?' @@ -175,17 +175,17 @@ config: not_equal_to: 'Diferente de…' or: 'Una regla U otra' and: 'Una regla Y la otra' - matches: 'Prueba si un sujeto corresponde a una búsqueda (insensible a mayusculas).
    Ejemplo : title matches "fútbol"' - # notmatches: 'Tests that a subject doesn''t match match a search (case-insensitive).
    Example: title notmatches "football"' + matches: 'Prueba si un sujeto corresponde a una búsqueda (insensible a mayúsculas).
    Ejemplo : title matches "fútbol"' + notmatches: 'Prueba si subject no corresponde a una búsqueda (insensible a mayúsculas).
    Example: title notmatches "fútbol"' otp: - # page_title: Two-factor authentication - # app: - # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. - # two_factor_code_description_2: 'You can scan that QR Code with your app:' - # two_factor_code_description_3: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' - # two_factor_code_description_4: 'Test an OTP code from your configured app:' - # cancel: Cancel - # enable: Enable + page_title: Autenticación de dos pasos + app: + two_factor_code_description_1: Acabas de activar la autenticación en dos factores con OTP, abre tu aplicación OTP y consigue un código de utilización única. Desaparecerá al volver a cargar la página. + two_factor_code_description_2: 'Puedes escanear el código QR con tu aplicación:' + two_factor_code_description_3: 'No olvides guardar los códigos de seguridad en un lugar seguro, los puedes utilizar en caso de que pierdas el accesso a tu aplicación OTP:' + two_factor_code_description_4: 'Prueba un código generado por tu aplicación OTP:' + cancel: Cancelar + enable: Activar entry: default_title: 'Título del artículo' @@ -219,8 +219,8 @@ entry: unread_label: 'Sin leer' preview_picture_label: 'Tiene imagen de previsualización' preview_picture_help: 'Imagen de previsualización' - # is_public_label: 'Has a public link' - # is_public_help: 'Public link' + is_public_label: 'Tiene un enlace público' + is_public_help: 'Enlace público' language_label: 'Idioma' http_status_label: 'Código de estado HTTP' reading_time: @@ -247,7 +247,7 @@ entry: delete: 'Eliminar' add_a_tag: 'Añadir una etiqueta' share_content: 'Compartir' - share_email_label: 'e-mail' + share_email_label: 'Correo electrónico' public_link: 'enlace público' delete_public_link: 'eliminar enlace público' export: 'Exportar' @@ -259,9 +259,9 @@ entry: original_article: 'original' annotations_on_the_entry: '{0} Sin anotaciones|{1} Una anotación|]1,Inf[ %count% anotaciones' created_at: 'Fecha de creación' - # published_at: 'Publication date' - # published_by: 'Published by' - # provided_by: 'Provided by' + published_at: 'Fecha de publicación' + published_by: 'Publicado por' + provided_by: 'Proporcionado por' new: page_title: 'Guardar un nuevo artículo' placeholder: 'http://sitioweb.com' @@ -273,18 +273,18 @@ entry: page_title: 'Editar un artículo' title_label: 'Título' url_label: 'URL' - # origin_url_label: 'Origin url (from where you found that entry)' + origin_url_label: 'URL de origen (de dónde has encontrado este artículo)' save_label: 'Guardar' public: shared_by_wallabag: "Este artículo se ha compartido con wallabag" confirm: - # delete: "Are you sure you want to remove that article?" - # delete_tag: "Are you sure you want to remove that tag from that article?" + delete: "¿Estás seguro de que quieres eliminar este artículo?" + delete_tag: "¿Estás seguro de que quieres eliminar esta etiqueta de este artículo?" metadata: - # reading_time: "Estimated reading time" - # reading_time_minutes_short: "%readingTime% min" - # address: "Address" - # added_on: "Added on" + reading_time: "Tiempo de lectura estimado" + reading_time_minutes_short: "%readingTime% min" + address: "Dirección" + added_on: "Añadido el" about: page_title: 'Acerca de' @@ -306,14 +306,14 @@ about: bug_reports: 'Reporte de errores' support: 'en GitHub' helping: - description: 'wallabag es software libre y gratuito. Usted puede ayudarnos :' + description: 'wallabag es software libre y gratuito. Usted puede ayudarnos:' by_contributing: 'contribuyendo al proyecto :' by_contributing_2: 'nuestras necesidades están en un ticket' by_paypal: 'vía Paypal' contributors: description: 'Gracias a los colaboradores de la aplicación web de wallabag' third_party: - description: 'Aquí está la lista de bibliotecas de terceros utilizadas por wallabag (con sus licencias) :' + description: 'Aquí está la lista de bibliotecas de terceros utilizadas por wallabag (con sus licencias):' package: 'Paquete' license: 'Licencia' @@ -361,7 +361,7 @@ howto: article_title: Atajos de teclado disponibles en el artículo open_original: Abrir la URL original de un artículo toggle_favorite: Marcar como favorito / no favorito el artículo - toggle_archive: marcar como leído / no leído el artículo + toggle_archive: Marcar como leído / no leído el artículo delete: Borrar el artículo material_title: Atajos de teclado disponibles solo en el tema Material add_link: Añadir un nuevo artículo @@ -420,7 +420,7 @@ quickstart: title: 'Apoyo' description: 'Si necesitas ayuda, estamos a tu disposición.' github: 'En GitHub' - email: 'Por e-mail' + email: 'Por correo electrónico' gitter: 'En Gitter' tag: @@ -428,16 +428,16 @@ tag: list: number_on_the_page: '{0} No hay ninguna etiqueta.|{1} Hay una etiqueta.|]1,Inf[ Hay %count% etiquetas.' see_untagged_entries: 'Ver artículos sin etiquetas' - # no_untagged_entries: 'There are no untagged entries.' + no_untagged_entries: 'No hay artículos sin etiquetas.' new: add: 'Añadir' placeholder: 'Puedes añadir varias etiquetas, separadas por una coma.' rename: - # placeholder: 'You can update tag name.' + placeholder: 'Puedes actualizar el nombre de la etiqueta.' -# export: -# footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' -# unknown: 'Unknown' +export: + footer_template: '

    Producido por wallabag con %method%

    Por favor abre un ticket si tienes algún problema con la visualización de este E-Book en tu dispositivo.

    ' + unknown: 'Desconocido' import: page_title: 'Importar' @@ -457,7 +457,7 @@ import: admin_message: 'Debe definir %keyurls%una clave del API Pocket%keyurle%.' user_message: 'El administrador de su servidor debe definir una clave del API Pocket.' authorize_message: 'Puede importar sus datos desde su cuenta de Pocket. Sólo tiene que hacer clic el botón para autorizar que wallabag se conecte a getpocket.com.' - connect_to_pocket: 'Conectar a Pocket e importar los datos' + connect_to_pocket: 'Conectarse a Pocket e importar los datos' wallabag_v1: page_title: 'Importar > Wallabag v1' description: 'Importa todos tus artículos de wallabag v1. En la configuración de wallabag v1, haga clic en "Exportar JSON" dentro de la sección "Exportar datos de wallabag". Obtendrás un archivo llamado "wallabag-export-1-xxxx-xx-xx.json".' @@ -467,11 +467,11 @@ import: description: 'Importa todos tus artículos de wallabag v2. En la sección Todos los artículos, en la barra lateral, haga clic en "JSON". Obtendrás un archivo llamado "All articles.json".' readability: page_title: 'Importar > Readability' - description: 'Importa todos tus artículos de Readability. En la página de herramientas (https://www.readability.com/tools/), haga clic en "Exportar tus datos" en la sección "Exportar datos". Recibirás un e-mail para descargar un JSON (que no tiene extensión .json).' + description: 'Importa todos tus artículos de Readability. En la página de herramientas (https://www.readability.com/tools/), haga clic en "Exportar tus datos" en la sección "Exportar datos". Recibirás un correo electrónico para descargar un JSON (que no tiene extensión .json).' how_to: 'Seleccione el archivo exportado de Readability y haga clic en el botón para subirlo e importarlo.' worker: enabled: "La importación se realiza de forma asíncrona. Una vez que la tarea de importación ha comenzado, un trabajador externo se encargará de los artículos uno a uno. El servicio actual es:" - download_images_warning: "Tienes activado descargar imágenes de los artículos. Esto justo con la importación clásica de artículos puede tardar mucho tiempo en ser procesado (o incluso fallar). Recomendamos encarecidamente habilitar la importación asíncrona para evitar errores." + download_images_warning: "Tienes activado descargar imágenes de los artículos. Esto junto con la importación clásica de artículos puede tardar mucho tiempo en ser procesado (o incluso fallar). Recomendamos encarecidamente habilitar la importación asíncrona para evitar errores." firefox: page_title: 'Importar > Firefox' description: "Importa todos tus marcadores de Firefox. En la ventana de marcadores (Ctrl+Mayus+O), en \"Importar y respaldar\", elige \"Copiar...\". Obtendrás un archivo .json." @@ -518,7 +518,7 @@ developer: redirect_uris_label: 'URIs de redirección' save_label: 'Crear un nuevo cliente' action_back: 'Volver' - # copy_to_clipboard: Copy + copy_to_clipboard: 'Copiar' client_parameter: page_title: 'Gestión de clientes API > Parámetros del cliente' page_description: 'Aquí están los parámetros del cliente.' @@ -530,14 +530,14 @@ developer: howto: page_title: 'Gestión de clientes API > Cómo crear mi primera aplicación' description: - paragraph_1: 'Los siguientes comandos hacen uso de la biblioteca HTTPie. Compruebe que está instalada en su sistema antes de usarla.' + paragraph_1: 'Los siguientes comandos hacen uso de la biblioteca HTTPie. Comprueba que está instalada en tu sistema antes de usarla.' paragraph_2: 'Necesitas un token para establecer la comunicación entre una aplicación de terceros y la API de wallabag.' paragraph_3: 'Para crear este token, necesitas crear un nuevo cliente.' - paragraph_4: 'Ahora crea tu token (reemplace client_id, client_secret, username y password con los valores generados):' + paragraph_4: 'Ahora crea tu token (reemplaza client_id, client_secret, username y password con los valores generados):' paragraph_5: 'Este API devolverá una respuesta como esta:' paragraph_6: 'El access_token es útil para llamar a los métodos del API. Por ejemplo:' paragraph_7: 'Esta llamada devolverá todos los artículos de tu usuario.' - paragraph_8: 'Si quiere ver todos los métodos del API, puede verlos en nuestra documentación del API.' + paragraph_8: 'Si quieres ver todos los métodos del API, puedes verlos en nuestra documentación del API.' back: 'Volver' user: @@ -557,37 +557,37 @@ user: password_label: 'Contraseña' repeat_new_password_label: 'Confirmar la contraseña' plain_password_label: '????' - email_label: 'E-mail' + email_label: 'Correo electrónico' enabled_label: 'Activado' last_login_label: 'Último inicio de sesión' - # twofactor_email_label: Two factor authentication by email - # twofactor_google_label: Two factor authentication by OTP app + twofactor_email_label: 'Autenticación de dos pasos por correo electrónico' + twofactor_google_label: 'Autenticación de dos pasos por aplicación OTP' save: Guardar delete: Eliminar delete_confirm: ¿Estás seguro? back_to_list: Volver a la lista search: - # placeholder: Filter by username or email + placeholder: 'Filtrar por nombre de usuario o correo electrónico' site_credential: - # page_title: Site credentials management - # new_site_credential: Create a credential - # edit_site_credential: Edit an existing credential - # description: "Here you can manage all credentials for sites which required them (create, edit and delete), like a paywall, an authentication, etc." - # list: - # actions: Actions - # edit_action: Edit - # yes: Yes - # no: No - # create_new_one: Create a new credential - # form: - # username_label: 'Username' - # host_label: 'Host (subdomain.example.org, .example.org, etc.)' - # password_label: 'Password' - # save: Save - # delete: Delete - # delete_confirm: Are you sure? - # back_to_list: Back to list + page_title: 'Gestión de credenciales del sitio' + new_site_credential: 'Crear una credencial' + edit_site_credential: 'Editar una credencial existente' + description: "Aquí puedes gestionar todas las credenciales para los sitios que las necesiten (crear, editar y borrar), como un paywall, una autenticación, etc." + list: + actions: 'Acciones' + edit_action: 'Editar' + yes: 'Sí' + no: 'No' + create_new_one: 'Crear una nueva credencial' + form: + username_label: 'Nombre de usuario' + host_label: 'Host (subdominio.ejemplo.org, .ejemplo.org, etc.)' + password_label: 'Contraseña' + save: 'Guardar' + delete: 'Borrar' + delete_confirm: '¿Estás seguro?' + back_to_list: 'Volver a la lista' error: page_title: Ha ocurrido un error @@ -603,14 +603,14 @@ flashes: tagging_rules_updated: 'Regla de etiquetado actualizada' tagging_rules_deleted: 'Regla de etiquetado eliminada' feed_token_updated: 'Token RSS actualizado' - # feed_token_revoked: 'RSS token revoked' + feed_token_revoked: 'Token RSS revocado' annotations_reset: Anotaciones reiniciadas tags_reset: Etiquetas reiniciadas entries_reset: Artículos reiniciados - # archived_reset: Archived entries deleted - # otp_enabled: Two-factor authentication enabled - # tagging_rules_imported: Tagging rules imported - # tagging_rules_not_imported: Error while importing tagging rules + archived_reset: Artículos archivados borrados + otp_enabled: Autenticación de dos pasos activada + tagging_rules_imported: Reglas de etiquetado importadas + tagging_rules_not_imported: Un error se ha producico en la importación de las reglas de etiquetado entry: notice: entry_already_saved: 'Artículo ya guardado el %fecha%' @@ -624,11 +624,11 @@ flashes: entry_starred: 'Artículo marcado como favorito' entry_unstarred: 'Artículo desmarcado como favorito' entry_deleted: 'Artículo eliminado' - # no_random_entry: 'No article with these criterias was found' + no_random_entry: 'Ningún artículo con esos criterios fue encontrado' tag: notice: tag_added: 'Etiqueta añadida' - # tag_renamed: 'Tag renamed' + tag_renamed: 'Etiqueta renombrada' import: notice: failed: 'Importación fallida, por favor, inténtelo de nuevo.' @@ -640,15 +640,15 @@ flashes: rabbit_enabled_not_installed: RabbitMQ está activado para gestionar la importación asíncrona pero parece que no se puede conectar. Por favor, comprueba la configuración de RabbitMQ. developer: notice: - client_created: 'Creado el cliente %name%.' - client_deleted: 'Eliminado el cliente %name%' + client_created: 'El cliente %name% ha sido creado.' + client_deleted: 'El cliente %name% ha sido eliminado' user: notice: - added: 'Añadido el usuario "%username%"' - updated: 'Actualizado el usuario "%username%"' - deleted: 'Eliminado el usuario "%username%"' + added: 'El usuario "%username%" ha sido añadido' + updated: 'El usuario "%username%" ha sido actualizado' + deleted: 'El usuario "%username%" ha sido eliminado' site_credential: notice: - # added: 'Site credential for "%host%" added' - # updated: 'Site credential for "%host%" updated' - # deleted: 'Site credential for "%host%" deleted' + added: 'Credenciales del sitio añadidas para "%host%"' + updated: 'Credenciales del sitio actualizadas para "%host%"' + deleted: 'Credenciales del sitio eliminadas para "%host%"' diff --git a/src/Wallabag/CoreBundle/Resources/translations/validators.es.yml b/src/Wallabag/CoreBundle/Resources/translations/validators.es.yml index ba34ee76..ea6575eb 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/validators.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/validators.es.yml @@ -1,7 +1,7 @@ validator: password_must_match: 'Las contraseñas no coinciden' - password_too_short: 'La contraseña debe tener al menos 8 carácteres' - password_wrong_value: 'Entrada equivocada para su contraseña actual' + password_too_short: 'La contraseña debe tener al menos 8 caracteres' + password_wrong_value: 'La contraseña actual es incorrecta' item_per_page_too_high: 'Esto matará la aplicación' feed_limit_too_high: 'Esto matará la aplicación' - # quote_length_too_high: 'The quote is too long. It should have {{ limit }} characters or less.' + quote_length_too_high: 'La cita es demasiado larga. Debe tener {{ limit }} caracteres o menos.' -- cgit v1.2.3 From 7ed081fbceab04b3611d53954a15076498824176 Mon Sep 17 00:00:00 2001 From: Sofia Lescano Date: Sat, 5 Oct 2019 23:51:03 +0200 Subject: Updating portuguese translations --- .../Resources/translations/messages.pt.yml | 384 ++++++++++----------- .../Resources/translations/validators.pt.yml | 2 +- 2 files changed, 193 insertions(+), 193 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 722ef0db..47e7b4db 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -19,26 +19,26 @@ menu: unread: 'Não lido' starred: 'Destacado' archive: 'Arquivo' - all_articles: 'Todas as entradas' + all_articles: 'Todos os artigos' config: 'Configurações' tags: 'Tags' internal_settings: 'Configurações Internas' import: 'Importar' - howto: 'How to' - # developer: 'API clients management' + howto: 'Ajuda' + developer: 'Gestão dos clientes API' logout: 'Sair' about: 'Sobre' search: 'Pesquisa' save_link: 'Salvar um link' back_to_unread: 'Voltar para os artigos não lidos' users_management: 'Gestão de Usuários' - # site_credentials: 'Site credentials' + site_credentials: 'Credenciais do site' quickstart: "Começo Rápido" top: - add_new_entry: 'Adicionar uma nova entrada' + add_new_entry: 'Adicionar um novo artigo' search: 'Pesquisa' - filter_entries: 'Filtrar entradas' - # random_entry: Jump to a random entry from that list + filter_entries: 'Filtrar os artigos' + random_entry: Ir para um artigo aleatório desta lista export: 'Exportar' search_form: input_label: 'Digite aqui sua pesquisa' @@ -52,7 +52,7 @@ footer: stats: 'Desde %user_creation% você leu %nb_archives% artigos. Isso é %per_day% por dia!' config: - page_title: 'Config' + page_title: 'Configurações' tab_menu: settings: 'Configurações' feed: 'RSS' @@ -60,7 +60,7 @@ config: password: 'Senha' rules: 'Regras de tags' new_user: 'Adicionar um usuário' - # reset: 'Reset area' + reset: 'Reiniciar minha conta' form: save: 'Salvar' form_settings: @@ -71,80 +71,80 @@ config: label: 'Velocidade de leitura (palavras por minuto)' help_message: 'Você pode usar ferramentas online para estimar sua velocidade de leitura:' action_mark_as_read: - # label: 'Where do you want to be redirected to after marking an article as read?' - # redirect_homepage: 'To the homepage' - # redirect_current_page: 'To the current page' + label: 'Para onde você deseja ser redirecionado após marcar um artigo como lido?' + redirect_homepage: 'Para a página inicial' + redirect_current_page: 'Ficar na página atual' pocket_consumer_key_label: 'Chave do consumidor do Pocket para importar conteúdo' - # android_configuration: Configure your Android application - # android_instruction: "Touch here to prefill your Android application" - # help_theme: "wallabag is customizable. You can choose your prefered theme here." - # help_items_per_page: "You can change the number of articles displayed on each page." - # help_reading_speed: "wallabag calculates a reading time for each article. You can define here, thanks to this list, if you are a fast or a slow reader. wallabag will recalculate the reading time for each article." - # help_language: "You can change the language of wallabag interface." - # help_pocket_consumer_key: "Required for Pocket import. You can create it in your Pocket account." + android_configuration: Configure seu aplicativo Android + android_instruction: "Toque aqui para preencher seu aplicativo Android" + help_theme: "wallabag é personalizável. Você pode escolher o seu tema preferido aqui." + help_items_per_page: "Você pode alterar o número de artigos exibidos em cada página." + help_reading_speed: "wallabag calcula um tempo de leitura para cada artigo. Você pode definir aqui, graças a esta lista, se você é um leitor rápido ou lento. O wallabag recalcula o tempo de leitura de cada artigo." + help_language: "Você pode alterar o idioma da interface de wallabag." + help_pocket_consumer_key: "Necessário para importação desde Pocket. Você pode creá-lo na sua conta de Pocket." form_feed: description: 'Feeds RSS providos pelo wallabag permitem que você leia seus artigos salvos em seu leitor de RSS favorito. Você precisa gerar um token primeiro.' token_label: 'Token RSS' no_token: 'Nenhum Token' token_create: 'Criar seu token' token_reset: 'Gerar novamente seu token' - # token_revoke: 'Revoke the token' + token_revoke: 'Revocar token' feed_links: 'Links RSS' feed_link: unread: 'Não lido' starred: 'Destacado' archive: 'Arquivado' - # all: 'All' + all: 'Todos' feed_limit: 'Número de itens no feed' form_user: - # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." - # login_label: 'Login (can not be changed)' + two_factor_description: "Ativar a autenticação de dois fatores significa que você vai receber um e-mail com um código OU que você vai precisar usar um aplicativo OTP (como Google Authenticator, Authy ou FreeOTP) para conseguir um código de utilização única em cada nova conexão não confiável. Você não pode escolher as duas opções." + login_label: 'Nome de usuário (não pode ser mudado)' name_label: 'Nome' email_label: 'E-mail' two_factor: - # emailTwoFactor_label: 'Using email (receive a code by email)' - # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' - # table_method: Method - # table_state: State - # table_action: Action - # state_enabled: Enabled - # state_disabled: Disabled - # action_email: Use email - # action_app: Use OTP App + emailTwoFactor_label: 'Usando e-mail (receber um código por e-mail)' + googleTwoFactor_label: 'Usando um aplicativo OTP (abra o aplicativo, como Google Authenticator, Authy ou FreeOTP, para conseguir um código de usagem único)' + table_method: Método + table_state: Estado + table_action: Ação + state_enabled: Ativado + state_disabled: Desativado + action_email: Usar e-mail + action_app: Usar aplicação OTP delete: - # title: Delete my account (a.k.a danger zone) - # description: If you remove your account, ALL your articles, ALL your tags, ALL your annotations and your account will be PERMANENTLY removed (it can't be UNDONE). You'll then be logged out. - # confirm: Are you really sure? (THIS CAN'T BE UNDONE) - # button: Delete my account + title: Apagar minha conta (Zona de perigo) + description: Se você apaga sua conta, TODOS os seus artigos, TODOS os seus tags, TODAS suas anotações e sua conta serão PERMANENTEMENTE removidos (NÃO pode ser DESFEITO). Depois da operação você será desconectado. + confirm: Tem certeza? (ISSO NÃO PODE SER DESFEITO) + button: Apagar minha conta reset: - # title: Reset area (a.k.a danger zone) - # description: By hiting buttons below you'll have ability to remove some informations from your account. Be aware that these actions are IRREVERSIBLE. - # annotations: Remove ALL annotations - # tags: Remove ALL tags - # entries: Remove ALL entries - # archived: Remove ALL archived entries - # confirm: Are you really really sure? (THIS CAN'T BE UNDONE) + title: Reiniciar minha conta (Zona de perigo) + description: Apertando os botões aqui em baixo você poderá remover informações da sua conta. Saiba que eessas ações sao IRREVERSIVEIS. + annotations: Remover TODAS as anotações + tags: Remover TODOS os tags + entries: Remover TODOS os artigos + archived: Remover TODOS os artigos arquivados + confirm: Tem certeza? (ISSO NÃO PODE SER DESFEITO) form_password: - # description: "You can change your password here. Your new password should by at least 8 characters long." + description: "Você pode mudar a sua senha aqui. A nova senha deve ter pelo menos 8 caracteres." old_password_label: 'Senha atual' new_password_label: 'Nova senha' repeat_new_password_label: 'Repita a nova senha' form_rules: - if_label: 'if' + if_label: 'se' then_tag_as_label: 'então coloque a tag' delete_rule_label: 'apagar' edit_rule_label: 'editar' rule_label: 'Regras' tags_label: 'Tags' - # card: - # new_tagging_rule: Create a tagging rule - # import_tagging_rules: Import tagging rules - # import_tagging_rules_detail: You have to select the JSON file you previously exported. - # export_tagging_rules: Export tagging rules - # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them. - # file_label: JSON file - # import_submit: Import - # export: Export + card: + new_tagging_rule: Criar uma regra de tag + import_tagging_rules: Importar regras de tags + import_tagging_rules_detail: Você precisa selecionar o arquivo JSON exportado previamente. + export_tagging_rules: Exportar regras de tags + export_tagging_rules_detail: Isso vai baixar um arquivo JSON que você poderá usar para importar regras de marcação em outro local ou fazer uma cópia de segurança delas. + file_label: Arquivo JSON + import_submit: Importar + export: Exportar faq: title: 'FAQ' tagging_rules_definition_title: 'O que as « regras de tags » significam?' @@ -153,18 +153,18 @@ config: how_to_use_them_description: 'Vamos dizer que você deseja adicionar a tag « leitura rápida » quando o tempo de leitura for menor que 3 minutos.
    Neste caso, você deve « readingTime <= 3 » no campo Regra e « leitura rápida » no campo Tags.
    Diversas tags podem ser adicionadas simultâneamente separando-as com vírgula: « leitura rápida, precisa ser lido »
    Regras complexas podem ser escritas usando os seguintes operadores pré-definidos: if « readingTime >= 5 AND domainName = "github.com" » então adicione a tag « leitura longa, github »' variables_available_title: 'Quais variáveis e operadores eu posso usar para escrever regras?' variables_available_description: 'As seguintes variáveis e operadores podem ser usados para criar regras de tags:' - meaning: 'Meaning' + meaning: 'Significado' variable_description: label: 'Variável' - title: 'Título da entrada' - url: 'URL da entrada' - isArchived: 'Se a entrada está arquivada ou não' - isDestacado: 'Se a entrada está destacada ou não' - content: 'O conteúdo da entrada' - language: 'O idioma da entrada' - mimetype: 'O mime-type da entrada' - readingTime: 'O tempo estimado de leitura da entrada, em minutos' - domainName: 'O domínio da entrada' + title: 'Título do artigo' + url: 'URL do artigo' + isArchived: 'Se o artigo está arquivado ou não' + isDestacado: 'Se o artigo está destacado ou não' + content: 'O conteúdo do artigo' + language: 'O idioma do artigo' + mimetype: 'O mime-type do artigo' + readingTime: 'O tempo estimado de leitura do artigo, em minutos' + domainName: 'O domínio do artigo' operator_description: label: 'Operador' less_than: 'Menor que...' @@ -175,31 +175,31 @@ config: not_equal_to: 'Diferente de...' or: 'Uma regra OU outra' and: 'Uma regra E outra' - matches: 'Testa que um assunto corresponde a uma pesquisa (maiúscula ou minúscula).
    Exemplo: título corresponde a "futebol"' - # notmatches: 'Tests that a subject doesn''t match match a search (case-insensitive).
    Example: title notmatches "football"' + matches: 'Testa que um assunto corresponde a uma pesquisa (maiúscula ou minúscula).
    Exemplo: title matches "futebol"' + notmatches: 'Testa que um assunto não corresponde a uma search (maiúscula ou minúscula).
    Exemplo: title notmatches "futebol"' otp: - # page_title: Two-factor authentication - # app: - # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload. - # two_factor_code_description_2: 'You can scan that QR Code with your app:' - # two_factor_code_description_3: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:' - # two_factor_code_description_4: 'Test an OTP code from your configured app:' - # cancel: Cancel - # enable: Enable + page_title: Autenticação de dois fatores + app: + two_factor_code_description_1: Você acaba de ativar a autenticação de dois fatores com aplicativo OTP, abra seu aplicativo OTP e consegua um código de usagem único. Vai desaparecer ao recargar a página. + two_factor_code_description_2: 'Você pode escanear este código QR com seu aplicativo:' + two_factor_code_description_3: 'Não esqueça de guardar os códigos de segurança em um lugar seguro, você poderá usá-los se você perder o acesso ao seu aplicativo OTP:' + two_factor_code_description_4: 'Teste um código gerado pelo seu aplicativo OTP:' + cancel: Cancelar + enable: Ativar entry: - default_title: 'Título da entrada' + default_title: 'Título do artigo' page_titles: - unread: 'Entradas não lidas' - starred: 'Entradas destacadas' - archived: 'Entradas arquivadas' - filtered: 'Entradas filtradas' + unread: 'Artigos não lidos' + starred: 'Artigos destacados' + archived: 'Artigos arquivados' + filtered: 'Artigos filtrados' filtered_tags: 'Filtrar por tags:' - # filtered_search: 'Filtered by search:' + filtered_search: 'Filtrar por busca:' untagged: 'Entradas sem tags' - # all: 'All entries' + all: 'Todos os artigos' list: - number_on_the_page: '{0} Não existem entradas.|{1} Existe uma entrada.|]1,Inf[ Existem %count% entradas.' + number_on_the_page: '{0} Não existem artigos.|{1} Existe um artigo.|]1,Inf[ Existem %count% artigos.' reading_time: 'tempo estimado de leitura' reading_time_minutes: 'tempo estimado de leitura: %readingTime% min' reading_time_less_one_minute: 'tempo estimado de leitura: < 1 min' @@ -217,12 +217,12 @@ entry: archived_label: 'Arquivado' starred_label: 'Destacado' unread_label: 'Não Lido' - preview_picture_label: 'Possui uma imagem de preview' - preview_picture_help: 'Imagem de preview' - # is_public_label: 'Has a public link' - # is_public_help: 'Public link' + preview_picture_label: 'Possui uma imagem de pré-visualização' + preview_picture_help: 'Imagem de pré-visualização' + is_public_label: 'Tem um link público' + is_public_help: 'Link público' language_label: 'Idioma' - # http_status_label: 'HTTP status' + http_status_label: 'Código de estado HTTP' reading_time: label: 'Tempo de leitura em minutos' from: 'de' @@ -241,11 +241,11 @@ entry: back_to_homepage: 'Voltar' set_as_read: 'Marcar como lido' set_as_unread: 'Marcar como não lido' - set_as_starred: 'Alternar destaque' + set_as_starred: 'Marcar como destacado' view_original_article: 'Artigo original' re_fetch_content: 'Recapturar o conteúdo' delete: 'Apagar' - add_a_tag: 'Adicionar uma tag' + add_a_tag: 'Adicionar um tag' share_content: 'Compartilhar' share_email_label: 'E-mail' public_link: 'link público' @@ -259,32 +259,32 @@ entry: original_article: 'original' annotations_on_the_entry: '{0} Sem anotações|{1} Uma anotação|]1,Inf[ %nbAnnotations% anotações' created_at: 'Data de criação' - # published_at: 'Publication date' - # published_by: 'Published by' - # provided_by: 'Provided by' + published_at: 'Data de publicação' + published_by: 'Publicado por' + provided_by: 'Fornecido por' new: - page_title: 'Salvar nova entrada' + page_title: 'Salvar novo artigo' placeholder: 'http://website.com' form_new: url_label: Url search: - # placeholder: 'What are you looking for?' + placeholder: 'O que você está procurando?' edit: - page_title: 'Editar uma entrada' + page_title: 'Editar um artigo' title_label: 'Título' url_label: 'Url' - # origin_url_label: 'Origin url (from where you found that entry)' + origin_url_label: 'URL de origem url (onde você encontrou este artigo)' save_label: 'Salvar' public: shared_by_wallabag: "Este artigo foi compartilhado pelo wallabag" confirm: - # delete: "Are you sure you want to remove that article?" - # delete_tag: "Are you sure you want to remove that tag from that article?" + delete: Tem certeza de que deseja remover este artigo?" + delete_tag: "Tem certeza de que deseja remover este tag deste artigo?" metadata: - # reading_time: "Estimated reading time" - # reading_time_minutes_short: "%readingTime% min" - # address: "Address" - # added_on: "Added on" + reading_time: "Tempo estimado de leitura" + reading_time_minutes_short: "%readingTime% min" + address: "Endereço" + added_on: "Adicionado o" about: page_title: 'Sobre' @@ -306,7 +306,7 @@ about: bug_reports: 'Informar bugs' support: 'no GitHub' helping: - description: 'wallabag é livre e software livre. Você pode nos ajudar:' + description: 'wallabag é um software livre e gratuito. Você pode nos ajudar:' by_contributing: 'contribuindo com o projeto:' by_contributing_2: 'uma lista de todas as nossas necessidades' by_paypal: 'via Paypal' @@ -321,11 +321,11 @@ howto: page_title: 'How to' page_description: 'Existem diferentes formas de salvar um artigo:' tab_menu: - # add_link: "Add a link" - # shortcuts: "Use shortcuts" + add_link: "Adicionar um link" + shortcuts: "Usar atalhos" top_menu: browser_addons: 'Extensões de navegadores' - mobile_apps: "App's móveis" + mobile_apps: "Aplicativos móveis" bookmarklet: 'Bookmarklet' form: description: 'Obrigado por este formulário' @@ -340,34 +340,34 @@ howto: ios: 'na iTunes Store' windows: 'na Microsoft Store' bookmarklet: - description: 'Arraste e solve este link na sua barra de favoritos:' + description: 'Arraste e solte este link na sua barra de favoritos:' shortcuts: - # page_description: Here are the shortcuts available in wallabag. - # shortcut: Shortcut - # action: Action - # all_pages_title: Shortcuts available in all pages - # go_unread: Go to unread - # go_starred: Go to starred - # go_archive: Go to archive - # go_all: Go to all entries - # go_tags: Go to tags - # go_config: Go to config - # go_import: Go to import - # go_developers: Go to developers - # go_howto: Go to howto (this page!) - # go_logout: Logout - # list_title: Shortcuts available in listing pages - # search: Display the search form - # article_title: Shortcuts available in entry view - # open_original: Open original URL of the entry - # toggle_favorite: Toggle star status for the entry - # toggle_archive: Toggle read status for the entry - # delete: Delete the entry - # material_title: Shortcuts available with Material theme only - # add_link: Add a new link - # hide_form: Hide the current form (search or new link) - # arrows_navigation: Navigate through articles - # open_article: Display the selected entry + page_description: Aqui estão os atalhos disponíveis no wallabag. + shortcut: Atalho + action: Ação + all_pages_title: Atalhos disponíveis em todas as páginas + go_unread: Ir para não lidos + go_starred: Ir para favoritos + go_archive: Ir para arquivados + go_all: Ir a todos os artigos + go_tags: Ir para tags + go_config: Ir para configuração + go_import: Ir para importar + go_developers: Ir para desenvolvedores + go_howto: Ir para ajuda (esta página) + go_logout: Ir para sair + list_title: Atalhos disponíveis em páginas de listagem + search: Exibir o formulário de pesquisa + article_title: Atalhos disponíveis no artigo + open_original: Abrir URL original do artigo + toggle_favorite: Marcar o artigo como destacado / não destacado + toggle_archive: Marcar artigo como lido / não lido + delete: Apagar o artigo + material_title: Atalhos disponíveis apenas com o tema Material + add_link: Adicionar um novo artigo + hide_form: Ocultar o formulário atual (pesquisa ou novo artigo) + arrows_navigation: Navegar pelo artigos + open_article: Exibir o artigo selecionado quickstart: page_title: 'Começo Rápido' @@ -401,8 +401,8 @@ quickstart: pocket: 'Migrar do Pocket' wallabag_v1: 'Migrar do wallabag v1' wallabag_v2: 'Migrar do wallabag v2' - readability: 'Migrate from Readability' - instapaper: 'Migrate from Instapaper' + readability: 'Migrar do Readability' + instapaper: 'Migrar do Instapaper' developer: title: 'Desenvolvedores' description: 'Nós também agradecemos os desenvolvedores: Docker, API, traduções, etc.' @@ -413,7 +413,7 @@ quickstart: description: "Existem muitas funcionalidades no wallabag. Não hesite em ler o manual para conhecê-las e aprender como usá-las." annotate: 'Anotar seu artigo' export: 'Converter seu artigo em ePUB ou PDF' - search_filters: 'veja coo você pode encontrar um artigo usanndo o motor de busca e filtros' + search_filters: 'veja como você pode encontrar um artigo usando o motor de busca e filtros' fetching_errors: 'O que eu posso fazer quando um artigo encontra erros na recuperação?' all_docs: 'E outros muitos artigos!' support: @@ -428,25 +428,25 @@ tag: list: number_on_the_page: '{0} Não existem tags.|{1} Uma tag.|]1,Inf[ Existem %count% tags.' see_untagged_entries: 'Ver entradas sem tags' - # no_untagged_entries: 'There are no untagged entries.' + no_untagged_entries: 'Não há entradas sem tags.' new: - # add: 'Add' - # placeholder: 'You can add several tags, separated by a comma.' + add: 'Adicionar' + placeholder: 'Você pode adicionar varios tags, separados por vírgulas.' rename: - # placeholder: 'You can update tag name.' + placeholder: 'Você pode atualizar o nome do tag.' -# export: -# footer_template: '

    Produced by wallabag with %method%

    Please open an issue if you have trouble with the display of this E-Book on your device.

    ' -# unknown: 'Unknown' +export: + footer_template: '

    Producido por wallabag com %method%

    Por favor abra um bolheto se você tiver problemas com a exibição deste E-Book no seu dispositivo.

    ' + unknown: 'Desconhecido' import: page_title: 'Importar' - page_description: 'Bem-vindo ao importador do wallabag. Por favo selecione o serviço do qual deseja migrar.' + page_description: 'Bem-vindo ao importador do wallabag. Por favor selecione o serviço do qual deseja migrar.' action: import_contents: 'Importar conteúdos' form: mark_as_read_title: 'Marcar todos como lidos?' - mark_as_read_label: 'Marcar todas as entradas importadas como lidas' + mark_as_read_label: 'Marcar todos os artigos importados como lidos' file_label: 'Arquivo' save_label: 'Carregar arquivo' pocket: @@ -471,7 +471,7 @@ import: how_to: 'Por favor, selecione sua exportação do Readability e clique no botão abaixo para importá-la.' worker: enabled: "A importação é feita assíncronamente. Uma vez que a tarefa de importação é iniciada, um trabalho externo pode executar tarefas uma por vez. O serviço atual é:" - # download_images_warning: "You enabled downloading images for your articles. Combined with classic import it can take ages to proceed (or maybe failed). We strongly recommend to enable asynchronous import to avoid errors." + download_images_warning: "Você ativou o donwload de imagens para os seus artigos. Combinado com a importação clásica isso pode demorar muito tempo (ou mesmo falhar). Nós recomendamos fortemente que você ative a importação assíncrona para evitar erros." firefox: page_title: 'Importar > Firefox' description: "Com este importador você importa todos os favoritos de seu Firefox. Somente vá até seus favoritos (Ctrl+Maj+O), e em \"Importar e Backup\" e escolha \"Backup...\". Você terá então um arquivo .json." @@ -485,12 +485,12 @@ import: description: 'Este importador pode importar todos os artigos do seu Instapaper. Nas página de configurações (https://www.instapaper.com/user), clique em "Download .CSV file" na seção "Export". Um arquivo CSV será baixado (algo como "instapaper-export.csv").' how_to: 'Por favor, selecione sua exportação do seu Instapaper e clique no botão abaixo para importá-la.' pinboard: - # page_title: "Import > Pinboard" - # description: 'This importer will import all your Instapaper articles. On the backup (https://pinboard.in/settings/backup) page, click on "JSON" in the "Bookmarks" section. A JSON file will be downloaded (like "pinboard_export").' - # how_to: 'Please select your Pinboard export and click on the below button to upload and import it.' + page_title: "Importar > Pinboard" + description: 'Este importador pode importar todos os artigos do seu Pinboard. Na página de cópia de segurança (https://pinboard.in/settings/backup), clique em "JSON" na seção "Bookmarks". Um arquivo JSON será baixado (algo como "pinboard_export").' + how_to: 'Por favor selecione a sua exportação Pinboard e clique no botão em baixo para carregá-lo e importá-lo.' developer: - # page_title: 'API clients management' + page_title: 'Gestão dos clientes API' welcome_message: 'Bem-vindo a API do wallabag' documentation: 'Documentação' how_to_first_app: 'Como criar minha primeira aplicação' @@ -511,24 +511,24 @@ developer: warn_message_2: 'Se você remover isso, todo o aplicativo configurado com este cliente não poderá se autenticar no seu wallabag.' action: 'Remover este cliente' client: - # page_title: 'API clients management > Novo cliente' + page_title: 'Gestão de clientes API > Novo cliente' page_description: 'Você está prestes a criar um novo cliente. Por favor preencha o campo abaixo para a URI de redirecionamento de sua aplicação.' form: name_label: 'Nome do cliente' redirect_uris_label: 'URIs de redirecionamento' save_label: 'Criar um novo cliente' action_back: 'Voltar' - # copy_to_clipboard: Copy + copy_to_clipboard: Copiar client_parameter: - # page_title: 'API clients management > Parâmetros de clientes' + page_title: 'Gestão de clientes API > Parâmetros de clientes' page_description: 'Aqui estão os parâmetros de seus clientes.' field_name: 'Nome do cliente' field_id: 'ID do cliente' field_secret: 'Chave do cliente' back: 'Voltar' - read_howto: 'Leia o how-to "Criar minha primeira aplicação"' + read_howto: 'Leia o guia "Criar minha primeira aplicação"' howto: - # page_title: 'API clients management > Criar minha primeira aplicação' + page_title: 'Gestão de clientes API > Criar minha primeira aplicação' description: paragraph_1: 'Os seguintes comandos fazem uso da biblioteca HTTPie. Tenha certeza que ela está instalada em seu servidor antes de usá-la.' paragraph_2: 'Você precisa de um token para a comunicação entre sua aplicação terceira e a API do wallabag.' @@ -560,37 +560,37 @@ user: email_label: 'E-mail' enabled_label: 'Habilitado' last_login_label: 'Último login' - # twofactor_email_label: Two factor authentication by email - # twofactor_google_label: Two factor authentication by OTP app + twofactor_email_label: Autenticação de dois fatores por e-mail + twofactor_google_label: Autenticação de dois fatores por aplicativo OTP save: 'Salvar' delete: 'Apagar' delete_confirm: 'Tem certeza?' back_to_list: 'Voltar para a lista' search: - # placeholder: Filter by username or email + placeholder: Filtrar por nome de usuário ou e-mail site_credential: - # page_title: Site credentials management - # new_site_credential: Create a credential - # edit_site_credential: Edit an existing credential - # description: "Here you can manage all credentials for sites which required them (create, edit and delete), like a paywall, an authentication, etc." + page_title: Gerenciamento de credenciais do site + new_site_credential: Criar uma credencial + edit_site_credential: Editar uma credencial existente + description: "Aqui você pode gerenciar todas as credenciais para os sites que precisam delas (criar, editar e apagar), como um paywall, uma autenticação, etc." list: actions: 'Ações' edit_action: 'Editar' yes: 'Sim' no: 'Não' - # create_new_one: Create a new credential + create_new_one: Criar uma nova credencial form: - # username_label: 'Username' - # host_label: 'Host (subdomain.example.org, .example.org, etc.)' - # password_label: 'Password' + username_label: 'Nome de usuário' + host_label: 'Host (subdominio.exemplo.org, .exemplo.org, etc.)' + password_label: 'Senha' save: 'Salvar' delete: 'Apagar' delete_confirm: 'Tem certeza?' back_to_list: 'Voltar para a lista' error: - # page_title: An error occurred + page_title: Um erro ocorreu flashes: config: @@ -598,37 +598,37 @@ flashes: config_saved: 'Configiração salva.' password_updated: 'Senha atualizada' password_not_updated_demo: 'Em modo de demonstração, você não pode alterar a senha deste usuário.' - # user_updated: 'Information updated' + user_updated: 'Informação atualizada' feed_updated: 'Informação de RSS atualizada' tagging_rules_updated: 'Regras de tags atualizadas' tagging_rules_deleted: 'Regra de tag apagada' feed_token_updated: 'Token RSS atualizado' - # feed_token_revoked: 'RSS token revoked' - # annotations_reset: Annotations reset - # tags_reset: Tags reset - # entries_reset: Entries reset - # archived_reset: Archived entries deleted - # otp_enabled: Two-factor authentication enabled - # tagging_rules_imported: Tagging rules imported - # tagging_rules_not_imported: Error while importing tagging rules + feed_token_revoked: 'Token RSS revogado' + annotations_reset: Anotações reinicializadas + tags_reset: Tags reinicializados + entries_reset: Artigos reinicializados + archived_reset: Artigos arquivados apagados + otp_enabled: Autenticação de dois fatores ativada + tagging_rules_imported: Regras de tags importadas + tagging_rules_not_imported: Erro ao importar regras de tags entry: notice: - entry_already_saved: 'Entrada já foi salva em %date%' - entry_saved: 'Entrada salva' - entry_saved_failed: 'Failed to save entry' - entry_updated: 'Entrada atualizada' - entry_reloaded: 'Entrada recarregada' - entry_reloaded_failed: 'Falha em recarregar a entrada' - entry_archived: 'Entrada arquivada' - entry_unarchived: 'Entrada desarquivada' - entry_starred: 'Entrada destacada' - entry_unstarred: 'Entrada não destacada' - entry_deleted: 'Entrada apagada' - # no_random_entry: 'No article with these criterias was found' + entry_already_saved: 'Artigo já foi salvo em %date%' + entry_saved: 'Artigo salvo' + entry_saved_failed: 'Artigo salvo mas falha na recuperação do conteúdo' + entry_updated: 'Artigo atualizado' + entry_reloaded: 'Artigo recarregado' + entry_reloaded_failed: 'Artigo em recarregar o artigo' + entry_archived: 'Artigo arquivado' + entry_unarchived: 'Artigo desarquivado' + entry_starred: 'Artigo destacado' + entry_unstarred: 'Artigo não destacado' + entry_deleted: 'Artigo apagado' + no_random_entry: 'Nehum artigo com esses criterios foi encontrado' tag: notice: tag_added: 'Tag adicionada' - # tag_renamed: 'Tag renamed' + tag_renamed: 'Tag renomeado' import: notice: failed: 'Importação falhou, por favor tente novamente.' @@ -649,6 +649,6 @@ flashes: deleted: 'Usuário "%username%" removido' site_credential: notice: - # added: 'Site credential for "%host%" added' - # updated: 'Site credential for "%host%" updated' - # deleted: 'Site credential for "%host%" deleted' + added: 'Credencial do site para "%host%" foi adicionada' + updated: 'Credencial do site pa "%host%" atualizada' + deleted: 'Credencial do site pa "%host%" removida' diff --git a/src/Wallabag/CoreBundle/Resources/translations/validators.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/validators.pt.yml index df2f3f35..1d69af97 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/validators.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/validators.pt.yml @@ -4,4 +4,4 @@ validator: password_wrong_value: 'A senha atual informada está errada' item_per_page_too_high: 'Certamente isso pode matar a aplicação' feed_limit_too_high: 'Certamente isso pode matar a aplicação' - # quote_length_too_high: 'The quote is too long. It should have {{ limit }} characters or less.' + quote_length_too_high: 'A citaçãpo é muito longa. Ela deve ter {{ limit }} caracteres ou menos.' -- cgit v1.2.3 From 652cb58d59c9cb3d1f448914e0568e87eba90b16 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Wed, 9 Oct 2019 00:57:08 +0200 Subject: =?UTF-8?q?=F0=9F=90=9B=20=E2=80=94=20Fix=20duplicated=20icons=20o?= =?UTF-8?q?n=20"Search=20engine"=20and=20"new=20link"=20forms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Resources/views/themes/material/Entry/new_form.html.twig | 4 ++-- .../Resources/views/themes/material/Entry/search_form.html.twig | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/new_form.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/new_form.html.twig index e0d5e794..4cf81167 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/new_form.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/new_form.html.twig @@ -2,14 +2,14 @@ {% if form_errors(form) %} {{ form_errors(form) }} {% endif %} - + {% if form_errors(form.url) %} {{ form_errors(form.url) }} {% endif %} {{ form_widget(form.url, { 'attr': {'autocomplete': 'off', 'placeholder': 'entry.new.placeholder'} }) }} - clear + {{ form_rest(form) }} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/search_form.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/search_form.html.twig index ba1b3aac..0ae8b0b3 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/search_form.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/search_form.html.twig @@ -2,7 +2,7 @@ {% if form_errors(form) %} {{ form_errors(form) }} {% endif %} - + {% if form_errors(form.term) %} {{ form_errors(form.term) }} @@ -11,7 +11,7 @@ {{ form_widget(form.term, { 'attr': {'autocomplete': 'off', 'placeholder': 'entry.search.placeholder'} }) }} - clear + {{ form_rest(form) }} -- cgit v1.2.3 From d8e961bdb58c799dde11e5f5de9405ce0e969d4a Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Wed, 9 Oct 2019 17:13:12 +0200 Subject: =?UTF-8?q?=F0=9F=92=84=20Add=20untagged=20list=20link=20to=20filt?= =?UTF-8?q?er=20menu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #3804 --- src/Wallabag/CoreBundle/Controller/EntryController.php | 4 ++++ .../CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig | 6 ++++++ .../Resources/views/themes/material/Entry/entries.html.twig | 6 ++++++ 3 files changed, 16 insertions(+) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 5c8ecb40..85144a5c 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -567,6 +567,9 @@ class EntryController extends Controller } } + $nbEntriesUntagged = $this->get('wallabag_core.entry_repository') + ->countUntaggedEntriesByUser($this->getUser()->getId()); + return $this->render( 'WallabagCoreBundle:Entry:entries.html.twig', [ 'form' => $form->createView(), @@ -574,6 +577,7 @@ class EntryController extends Controller 'currentPage' => $page, 'searchTerm' => $searchTerm, 'isFiltered' => $form->isSubmitted(), + 'nbEntriesUntagged' => $nbEntriesUntagged, ] ); } 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 d8b39160..b747ed84 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 @@ -117,6 +117,12 @@ ×
    + {% if currentRoute != 'untagged' and nbEntriesUntagged != 0 %} + + {% endif %} +
    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 476d7403..3906e1e0 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 @@ -83,6 +83,12 @@

    {{ 'entry.filters.title'|trans }}

    + {% if currentRoute != 'untagged' and nbEntriesUntagged != 0 %} + + {% endif %} +
    -- cgit v1.2.3 From 7a4c375ebfae5aa43c663b1084acfb68f61b30b8 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Wed, 9 Oct 2019 18:20:26 +0200 Subject: =?UTF-8?q?=E2=9C=A8=20Allow=20custom=20styles=20system=20wide?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Should fix #4060 --- src/Wallabag/CoreBundle/Resources/views/base.html.twig | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/views/base.html.twig b/src/Wallabag/CoreBundle/Resources/views/base.html.twig index c0eecd57..befe2ef2 100644 --- a/src/Wallabag/CoreBundle/Resources/views/base.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/base.html.twig @@ -43,6 +43,7 @@ {% block css %} {% endblock %} + {% block scripts %} -- cgit v1.2.3 From 8d4ed0df0633f43fc2d65fef72c36070113844d1 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 12 Nov 2019 14:18:58 +0100 Subject: Update deps Also CS (because cs-fixer got an update) Package operations: 0 installs, 26 updates, 0 removals - Updating twig/twig (v2.12.1 => v2.12.2) - Updating symfony/symfony (v3.4.33 => v3.4.34) - Updating doctrine/event-manager (v1.0.0 => 1.1.0) - Updating doctrine/collections (v1.6.2 => 1.6.3) - Updating doctrine/cache (v1.8.1 => 1.9.0) - Updating doctrine/persistence (1.1.1 => 1.2.0) - Updating doctrine/inflector (v1.3.0 => 1.3.1) - Updating symfony/mime (v4.3.5 => v4.3.7) - Updating swiftmailer/swiftmailer (v6.2.1 => v6.2.3) - Updating symfony/swiftmailer-bundle (v3.3.0 => v3.3.1) - Updating doctrine/dbal (v2.9.2 => v2.9.3) - Updating doctrine/instantiator (1.2.0 => 1.3.0) - Updating j0k3r/graby-site-config (1.0.93 => 1.0.94) - Updating phpoption/phpoption (1.5.0 => 1.5.2) - Updating symfony/http-client-contracts (v1.1.7 => v1.1.8) - Updating symfony/http-client (v4.3.5 => v4.3.7) - Updating sensiolabs/security-checker (v6.0.2 => v6.0.3) - Updating paragonie/constant_time_encoding (v2.2.3 => v2.3.0) - Updating scheb/two-factor-bundle (v4.7.1 => v4.8.0) - Updating symfony/phpunit-bridge (v4.3.6 => v4.3.7) - Updating composer/xdebug-handler (1.3.3 => 1.4.0) - Updating friendsofphp/php-cs-fixer (v2.15.3 => v2.16.0) - Updating doctrine/data-fixtures (v1.3.2 => 1.3.3) - Updating nette/schema (v1.0.0 => v1.0.1) - Updating nikic/php-parser (v4.2.4 => v4.3.0) - Updating sentry/sentry (2.2.2 => 2.2.4) --- .../Controller/WallabagAnnotationController.php | 10 ---- .../Controller/AnnotationRestController.php | 10 ---- .../ApiBundle/Controller/DeveloperController.php | 4 -- .../ApiBundle/Controller/EntryRestController.php | 2 - .../ApiBundle/Controller/UserRestController.php | 1 - .../CoreBundle/Command/CleanDuplicatesCommand.php | 3 -- .../Command/GenerateUrlHashesCommand.php | 3 -- src/Wallabag/CoreBundle/Command/InstallCommand.php | 4 +- .../CoreBundle/Command/ShowUserCommand.php | 3 -- .../CoreBundle/Controller/ConfigController.php | 21 +-------- .../CoreBundle/Controller/EntryController.php | 53 ++++------------------ .../CoreBundle/Controller/ExportController.php | 1 - .../CoreBundle/Controller/FeedController.php | 4 -- .../Controller/SiteCredentialController.php | 8 ---- .../CoreBundle/Controller/TagController.php | 7 --- src/Wallabag/CoreBundle/Entity/Config.php | 2 - src/Wallabag/CoreBundle/Entity/Entry.php | 12 ----- src/Wallabag/CoreBundle/Entity/Tag.php | 6 --- src/Wallabag/CoreBundle/Entity/TaggingRule.php | 2 - .../Event/Listener/UserLocaleListener.php | 3 -- .../Subscriber/CustomDoctrineORMSubscriber.php | 3 -- .../Event/Subscriber/DownloadImagesSubscriber.php | 8 ---- .../Subscriber/SQLiteCascadeDeleteSubscriber.php | 5 -- .../CoreBundle/Form/Type/EntryFilterType.php | 3 -- .../GrabySiteConfigBuilder.php | 5 -- src/Wallabag/CoreBundle/Helper/ContentProxy.php | 10 ---- src/Wallabag/CoreBundle/Helper/DownloadImages.php | 2 - .../CoreBundle/Helper/HttpClientFactory.php | 8 +--- .../CoreBundle/Helper/PreparePagerForEntries.php | 3 +- src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php | 4 -- src/Wallabag/CoreBundle/Helper/TagsAssigner.php | 1 - src/Wallabag/CoreBundle/Helper/UrlHasher.php | 1 - .../CoreBundle/Repository/EntryRepository.php | 6 +-- .../ImportBundle/Controller/BrowserController.php | 2 - .../ImportBundle/Controller/WallabagController.php | 2 - .../ImportBundle/Import/AbstractImport.php | 14 ------ src/Wallabag/ImportBundle/Import/BrowserImport.php | 4 -- src/Wallabag/ImportBundle/Import/ImportChain.php | 3 +- src/Wallabag/ImportBundle/Import/PocketImport.php | 3 -- .../UserBundle/Controller/ManageController.php | 3 +- src/Wallabag/UserBundle/Entity/User.php | 4 -- src/Wallabag/UserBundle/Form/UserType.php | 7 --- src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php | 12 ++--- 43 files changed, 20 insertions(+), 252 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php b/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php index 3a7421c7..883ce4a8 100644 --- a/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php +++ b/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php @@ -16,8 +16,6 @@ class WallabagAnnotationController extends FOSRestController /** * Retrieve annotations for an entry. * - * @param Entry $entry - * * @see Wallabag\ApiBundle\Controller\WallabagRestController * * @return JsonResponse @@ -39,9 +37,6 @@ class WallabagAnnotationController extends FOSRestController /** * Creates a new annotation. * - * @param Request $request - * @param Entry $entry - * * @return JsonResponse * * @see Wallabag\ApiBundle\Controller\WallabagRestController @@ -79,9 +74,6 @@ class WallabagAnnotationController extends FOSRestController * * @ParamConverter("annotation", class="WallabagAnnotationBundle:Annotation") * - * @param Annotation $annotation - * @param Request $request - * * @return JsonResponse */ public function putAnnotationAction(Annotation $annotation, Request $request) @@ -114,8 +106,6 @@ class WallabagAnnotationController extends FOSRestController * * @ParamConverter("annotation", class="WallabagAnnotationBundle:Annotation") * - * @param Annotation $annotation - * * @return JsonResponse */ public function deleteAnnotationAction(Annotation $annotation) diff --git a/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php b/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php index 28d55ba9..f59431e4 100644 --- a/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php +++ b/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php @@ -20,8 +20,6 @@ class AnnotationRestController extends WallabagRestController * } * ) * - * @param Entry $entry - * * @return JsonResponse */ public function getAnnotationsAction(Entry $entry) @@ -44,9 +42,6 @@ class AnnotationRestController extends WallabagRestController * } * ) * - * @param Request $request - * @param Entry $entry - * * @return JsonResponse */ public function postAnnotationAction(Request $request, Entry $entry) @@ -70,9 +65,6 @@ class AnnotationRestController extends WallabagRestController * * @ParamConverter("annotation", class="WallabagAnnotationBundle:Annotation") * - * @param Annotation $annotation - * @param Request $request - * * @return JsonResponse */ public function putAnnotationAction(Annotation $annotation, Request $request) @@ -96,8 +88,6 @@ class AnnotationRestController extends WallabagRestController * * @ParamConverter("annotation", class="WallabagAnnotationBundle:Annotation") * - * @param Annotation $annotation - * * @return JsonResponse */ public function deleteAnnotationAction(Annotation $annotation) diff --git a/src/Wallabag/ApiBundle/Controller/DeveloperController.php b/src/Wallabag/ApiBundle/Controller/DeveloperController.php index ae7e83da..3224d789 100644 --- a/src/Wallabag/ApiBundle/Controller/DeveloperController.php +++ b/src/Wallabag/ApiBundle/Controller/DeveloperController.php @@ -29,8 +29,6 @@ class DeveloperController extends Controller /** * Create a client (an app). * - * @param Request $request - * * @Route("/developer/client/create", name="developer_create_client") * * @return \Symfony\Component\HttpFoundation\Response @@ -67,8 +65,6 @@ class DeveloperController extends Controller /** * Remove a client. * - * @param Client $client - * * @Route("/developer/client/delete/{id}", requirements={"id" = "\d+"}, name="developer_delete_client") * * @return \Symfony\Component\HttpFoundation\RedirectResponse diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 9f933adb..c09fdaeb 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -822,8 +822,6 @@ class EntryRestController extends WallabagRestController * Retrieve value from the request. * Used for POST & PATCH on a an entry. * - * @param Request $request - * * @return array */ private function retrieveValueFromRequest(Request $request) diff --git a/src/Wallabag/ApiBundle/Controller/UserRestController.php b/src/Wallabag/ApiBundle/Controller/UserRestController.php index 1b10a076..922ab7bb 100644 --- a/src/Wallabag/ApiBundle/Controller/UserRestController.php +++ b/src/Wallabag/ApiBundle/Controller/UserRestController.php @@ -119,7 +119,6 @@ class UserRestController extends WallabagRestController /** * Send user response. * - * @param User $user * @param string $group Used to define with serialized group might be used * @param int $status HTTP Status code to send * diff --git a/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php b/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php index 99170967..64b91520 100644 --- a/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php +++ b/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php @@ -63,9 +63,6 @@ class CleanDuplicatesCommand extends ContainerAwareCommand return 0; } - /** - * @param User $user - */ private function cleanDuplicates(User $user) { $em = $this->getContainer()->get('doctrine.orm.entity_manager'); diff --git a/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php b/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php index 8f2bff11..a0e9221e 100644 --- a/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php +++ b/src/Wallabag/CoreBundle/Command/GenerateUrlHashesCommand.php @@ -54,9 +54,6 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand return 0; } - /** - * @param User $user - */ private function generateHashedUrls(User $user) { $em = $this->getContainer()->get('doctrine.orm.entity_manager'); diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index f73e0696..3aa332f1 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -326,9 +326,7 @@ class InstallCommand extends ContainerAwareCommand if (0 !== $exitCode) { $this->getApplication()->setAutoExit(true); - throw new \RuntimeException( - 'The command "' . $command . "\" generates some errors: \n\n" - . $output->fetch()); + throw new \RuntimeException('The command "' . $command . "\" generates some errors: \n\n" . $output->fetch()); } return $this; diff --git a/src/Wallabag/CoreBundle/Command/ShowUserCommand.php b/src/Wallabag/CoreBundle/Command/ShowUserCommand.php index c95efbf3..87bccf71 100644 --- a/src/Wallabag/CoreBundle/Command/ShowUserCommand.php +++ b/src/Wallabag/CoreBundle/Command/ShowUserCommand.php @@ -46,9 +46,6 @@ class ShowUserCommand extends ContainerAwareCommand return 0; } - /** - * @param User $user - */ private function showUser(User $user) { $this->io->listing([ diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index 0db90ba4..6655ef93 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -26,8 +26,6 @@ use Wallabag\CoreBundle\Tools\Utils; class ConfigController extends Controller { /** - * @param Request $request - * * @Route("/config", name="config") */ public function indexAction(Request $request) @@ -279,8 +277,6 @@ class ConfigController extends Controller /** * Validate OTP code. * - * @param Request $request - * * @Route("/config/otp/app/check", name="config_otp_app_check") */ public function otpAppCheckAction(Request $request) @@ -308,8 +304,6 @@ class ConfigController extends Controller } /** - * @param Request $request - * * @Route("/generate-token", name="generate_token") * * @return RedirectResponse|JsonResponse @@ -336,8 +330,6 @@ class ConfigController extends Controller } /** - * @param Request $request - * * @Route("/revoke-token", name="revoke_token") * * @return RedirectResponse|JsonResponse @@ -366,8 +358,6 @@ class ConfigController extends Controller /** * Deletes a tagging rule and redirect to the config homepage. * - * @param TaggingRule $rule - * * @Route("/tagging-rule/delete/{id}", requirements={"id" = "\d+"}, name="delete_tagging_rule") * * @return RedirectResponse @@ -391,8 +381,6 @@ class ConfigController extends Controller /** * Edit a tagging rule. * - * @param TaggingRule $rule - * * @Route("/tagging-rule/edit/{id}", requirements={"id" = "\d+"}, name="edit_tagging_rule") * * @return RedirectResponse @@ -459,8 +447,6 @@ class ConfigController extends Controller * * @Route("/account/delete", name="delete_account") * - * @param Request $request - * * @throws AccessDeniedHttpException * * @return \Symfony\Component\HttpFoundation\RedirectResponse @@ -491,8 +477,6 @@ class ConfigController extends Controller * * @Route("/config/view-mode", name="switch_view_mode") * - * @param Request $request - * * @return \Symfony\Component\HttpFoundation\RedirectResponse */ public function changeViewModeAction(Request $request) @@ -510,8 +494,7 @@ class ConfigController extends Controller /** * Change the locale for the current user. * - * @param Request $request - * @param string $language + * @param string $language * * @Route("/locale/{language}", name="changeLocale") * @@ -620,8 +603,6 @@ class ConfigController extends Controller /** * Validate that a rule can be edited/deleted by the current user. - * - * @param TaggingRule $rule */ private function validateRuleAction(TaggingRule $rule) { diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 5c8ecb40..cd9e8d27 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -21,8 +21,7 @@ use Wallabag\CoreBundle\Form\Type\SearchEntryType; class EntryController extends Controller { /** - * @param Request $request - * @param int $page + * @param int $page * * @Route("/search/{page}", name="search", defaults={"page" = 1}) * @@ -53,8 +52,6 @@ class EntryController extends Controller } /** - * @param Request $request - * * @Route("/new-entry", name="new_entry") * * @return \Symfony\Component\HttpFoundation\Response @@ -97,8 +94,6 @@ class EntryController extends Controller } /** - * @param Request $request - * * @Route("/bookmarklet", name="bookmarklet") * * @return \Symfony\Component\HttpFoundation\Response @@ -135,9 +130,6 @@ class EntryController extends Controller /** * Edit an entry content. * - * @param Request $request - * @param Entry $entry - * * @Route("/edit/{id}", requirements={"id" = "\d+"}, name="edit") * * @return \Symfony\Component\HttpFoundation\Response @@ -171,8 +163,7 @@ class EntryController extends Controller /** * Shows all entries for current user. * - * @param Request $request - * @param int $page + * @param int $page * * @Route("/all/list/{page}", name="all", defaults={"page" = "1"}) * @@ -186,8 +177,7 @@ class EntryController extends Controller /** * Shows unread entries for current user. * - * @param Request $request - * @param int $page + * @param int $page * * @Route("/unread/list/{page}", name="unread", defaults={"page" = "1"}) * @@ -206,8 +196,7 @@ class EntryController extends Controller /** * Shows read entries for current user. * - * @param Request $request - * @param int $page + * @param int $page * * @Route("/archive/list/{page}", name="archive", defaults={"page" = "1"}) * @@ -221,8 +210,7 @@ class EntryController extends Controller /** * Shows starred entries for current user. * - * @param Request $request - * @param int $page + * @param int $page * * @Route("/starred/list/{page}", name="starred", defaults={"page" = "1"}) * @@ -236,8 +224,7 @@ class EntryController extends Controller /** * Shows untagged articles for current user. * - * @param Request $request - * @param int $page + * @param int $page * * @Route("/untagged/list/{page}", name="untagged", defaults={"page" = "1"}) * @@ -276,8 +263,6 @@ class EntryController extends Controller /** * Shows entry content. * - * @param Entry $entry - * * @Route("/view/{id}", requirements={"id" = "\d+"}, name="view") * * @return \Symfony\Component\HttpFoundation\Response @@ -296,8 +281,6 @@ class EntryController extends Controller * Reload an entry. * Refetch content from the website and make it readable again. * - * @param Entry $entry - * * @Route("/reload/{id}", requirements={"id" = "\d+"}, name="reload_entry") * * @return \Symfony\Component\HttpFoundation\RedirectResponse @@ -330,9 +313,6 @@ class EntryController extends Controller /** * Changes read status for an entry. * - * @param Request $request - * @param Entry $entry - * * @Route("/archive/{id}", requirements={"id" = "\d+"}, name="archive_entry") * * @return \Symfony\Component\HttpFoundation\RedirectResponse @@ -362,9 +342,6 @@ class EntryController extends Controller /** * Changes starred status for an entry. * - * @param Request $request - * @param Entry $entry - * * @Route("/star/{id}", requirements={"id" = "\d+"}, name="star_entry") * * @return \Symfony\Component\HttpFoundation\RedirectResponse @@ -395,8 +372,6 @@ class EntryController extends Controller /** * Deletes entry and redirect to the homepage or the last viewed page. * - * @param Entry $entry - * * @Route("/delete/{id}", requirements={"id" = "\d+"}, name="delete_entry") * * @return \Symfony\Component\HttpFoundation\RedirectResponse @@ -437,8 +412,6 @@ class EntryController extends Controller /** * Get public URL for entry (and generate it if necessary). * - * @param Entry $entry - * * @Route("/share/{id}", requirements={"id" = "\d+"}, name="share") * * @return \Symfony\Component\HttpFoundation\Response @@ -463,8 +436,6 @@ class EntryController extends Controller /** * Disable public sharing for an entry. * - * @param Entry $entry - * * @Route("/share/delete/{id}", requirements={"id" = "\d+"}, name="delete_share") * * @return \Symfony\Component\HttpFoundation\Response @@ -487,8 +458,6 @@ class EntryController extends Controller /** * Ability to view a content publicly. * - * @param Entry $entry - * * @Route("/share/{uid}", requirements={"uid" = ".+"}, name="share_entry") * @Cache(maxage="25200", smaxage="25200", public=true) * @@ -510,9 +479,8 @@ class EntryController extends Controller * Global method to retrieve entries depending on the given type * It returns the response to be send. * - * @param string $type Entries type: unread, starred or archive - * @param Request $request - * @param int $page + * @param string $type Entries type: unread, starred or archive + * @param int $page * * @return \Symfony\Component\HttpFoundation\Response */ @@ -582,7 +550,6 @@ class EntryController extends Controller * Fetch content and update entry. * In case it fails, $entry->getContent will return an error message. * - * @param Entry $entry * @param string $prefixMessage Should be the translation key: entry_saved or entry_reloaded */ private function updateEntry(Entry $entry, $prefixMessage = 'entry_saved') @@ -613,8 +580,6 @@ class EntryController extends Controller /** * Check if the logged user can manage the given entry. - * - * @param Entry $entry */ private function checkUserAction(Entry $entry) { @@ -626,8 +591,6 @@ class EntryController extends Controller /** * Check for existing entry, if it exists, redirect to it with a message. * - * @param Entry $entry - * * @return Entry|bool */ private function checkIfEntryAlreadyExists(Entry $entry) diff --git a/src/Wallabag/CoreBundle/Controller/ExportController.php b/src/Wallabag/CoreBundle/Controller/ExportController.php index 9ff35ff5..282fd733 100644 --- a/src/Wallabag/CoreBundle/Controller/ExportController.php +++ b/src/Wallabag/CoreBundle/Controller/ExportController.php @@ -17,7 +17,6 @@ class ExportController extends Controller /** * Gets one entry content. * - * @param Entry $entry * @param string $format * * @Route("/export/{id}.{format}", name="export_entry", requirements={ diff --git a/src/Wallabag/CoreBundle/Controller/FeedController.php b/src/Wallabag/CoreBundle/Controller/FeedController.php index 9f671735..95c3427b 100644 --- a/src/Wallabag/CoreBundle/Controller/FeedController.php +++ b/src/Wallabag/CoreBundle/Controller/FeedController.php @@ -23,7 +23,6 @@ class FeedController extends Controller * * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_feed_token_converter") * - * @param User $user * @param $page * * @return \Symfony\Component\HttpFoundation\Response @@ -40,7 +39,6 @@ class FeedController extends Controller * * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_feed_token_converter") * - * @param User $user * @param $page * * @return \Symfony\Component\HttpFoundation\Response @@ -57,7 +55,6 @@ class FeedController extends Controller * * @ParamConverter("user", class="WallabagUserBundle:User", converter="username_feed_token_converter") * - * @param User $user * @param $page * * @return \Symfony\Component\HttpFoundation\Response @@ -147,7 +144,6 @@ class FeedController extends Controller * It returns the response to be send. * * @param string $type Entries type: unread, starred or archive - * @param User $user * @param int $page * * @return \Symfony\Component\HttpFoundation\Response diff --git a/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php b/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php index 51bc1d94..4320c5ff 100644 --- a/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php +++ b/src/Wallabag/CoreBundle/Controller/SiteCredentialController.php @@ -36,8 +36,6 @@ class SiteCredentialController extends Controller * * @Route("/new", name="site_credentials_new", methods={"GET", "POST"}) * - * @param Request $request - * * @return \Symfony\Component\HttpFoundation\Response */ public function newAction(Request $request) @@ -76,9 +74,6 @@ class SiteCredentialController extends Controller * * @Route("/{id}/edit", name="site_credentials_edit", methods={"GET", "POST"}) * - * @param Request $request - * @param SiteCredential $siteCredential - * * @return \Symfony\Component\HttpFoundation\Response */ public function editAction(Request $request, SiteCredential $siteCredential) @@ -119,9 +114,6 @@ class SiteCredentialController extends Controller * * @Route("/{id}", name="site_credentials_delete", methods={"DELETE"}) * - * @param Request $request - * @param SiteCredential $siteCredential - * * @return \Symfony\Component\HttpFoundation\RedirectResponse */ public function deleteAction(Request $request, SiteCredential $siteCredential) diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index 90d36d71..a6ad131f 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php @@ -16,9 +16,6 @@ use Wallabag\CoreBundle\Form\Type\RenameTagType; class TagController extends Controller { /** - * @param Request $request - * @param Entry $entry - * * @Route("/new-tag/{entry}", requirements={"entry" = "\d+"}, name="new_tag") * * @return \Symfony\Component\HttpFoundation\Response @@ -103,7 +100,6 @@ class TagController extends Controller } /** - * @param Tag $tag * @param int $page * * @Route("/tag/list/{slug}/{page}", name="tag_entries", defaults={"page" = "1"}) @@ -145,9 +141,6 @@ class TagController extends Controller * Rename a given tag with a new label * Create a new tag with the new name and drop the old one. * - * @param Tag $tag - * @param Request $request - * * @Route("/tag/rename/{slug}", name="tag_rename") * @ParamConverter("tag", options={"mapping": {"slug": "slug"}}) * diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php index 35be9655..fe7942ee 100644 --- a/src/Wallabag/CoreBundle/Entity/Config.php +++ b/src/Wallabag/CoreBundle/Entity/Config.php @@ -371,8 +371,6 @@ class Config } /** - * @param TaggingRule $rule - * * @return Config */ public function addTaggingRule(TaggingRule $rule) diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 4acec261..beda581a 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -550,8 +550,6 @@ class Entry * Set created_at. * Only used when importing data from an other service. * - * @param \DateTime $createdAt - * * @return Entry */ public function setCreatedAt(\DateTime $createdAt) @@ -623,9 +621,6 @@ class Entry return $this->annotations; } - /** - * @param Annotation $annotation - */ public function setAnnotation(Annotation $annotation) { $this->annotations[] = $annotation; @@ -702,9 +697,6 @@ class Entry return $data; } - /** - * @param Tag $tag - */ public function addTag(Tag $tag) { if ($this->tags->contains($tag)) { @@ -725,8 +717,6 @@ class Entry /** * Remove the given tag from the entry (if the tag is associated). - * - * @param Tag $tag */ public function removeTag(Tag $tag) { @@ -874,8 +864,6 @@ class Entry } /** - * @param \Datetime $publishedAt - * * @return Entry */ public function setPublishedAt(\Datetime $publishedAt) diff --git a/src/Wallabag/CoreBundle/Entity/Tag.php b/src/Wallabag/CoreBundle/Entity/Tag.php index 3ccb20a5..9fb2f94f 100644 --- a/src/Wallabag/CoreBundle/Entity/Tag.php +++ b/src/Wallabag/CoreBundle/Entity/Tag.php @@ -104,9 +104,6 @@ class Tag return $this->slug; } - /** - * @param Entry $entry - */ public function addEntry(Entry $entry) { if ($this->entries->contains($entry)) { @@ -117,9 +114,6 @@ class Tag $entry->addTag($this); } - /** - * @param Entry $entry - */ public function removeEntry(Entry $entry) { if (!$this->entries->contains($entry)) { diff --git a/src/Wallabag/CoreBundle/Entity/TaggingRule.php b/src/Wallabag/CoreBundle/Entity/TaggingRule.php index eac53fa3..f7166087 100644 --- a/src/Wallabag/CoreBundle/Entity/TaggingRule.php +++ b/src/Wallabag/CoreBundle/Entity/TaggingRule.php @@ -121,8 +121,6 @@ class TaggingRule /** * Set config. * - * @param Config $config - * * @return TaggingRule */ public function setConfig(Config $config) diff --git a/src/Wallabag/CoreBundle/Event/Listener/UserLocaleListener.php b/src/Wallabag/CoreBundle/Event/Listener/UserLocaleListener.php index dc1db5c7..1b5d61ad 100644 --- a/src/Wallabag/CoreBundle/Event/Listener/UserLocaleListener.php +++ b/src/Wallabag/CoreBundle/Event/Listener/UserLocaleListener.php @@ -25,9 +25,6 @@ class UserLocaleListener $this->session = $session; } - /** - * @param InteractiveLoginEvent $event - */ public function onInteractiveLogin(InteractiveLoginEvent $event) { $user = $event->getAuthenticationToken()->getUser(); diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/CustomDoctrineORMSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/CustomDoctrineORMSubscriber.php index cabb3eca..b8f6e1d6 100644 --- a/src/Wallabag/CoreBundle/Event/Subscriber/CustomDoctrineORMSubscriber.php +++ b/src/Wallabag/CoreBundle/Event/Subscriber/CustomDoctrineORMSubscriber.php @@ -12,9 +12,6 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; */ class CustomDoctrineORMSubscriber extends DoctrineORMSubscriber implements EventSubscriberInterface { - /** - * @param GetFilterConditionEvent $event - */ public function filterDateRange(GetFilterConditionEvent $event) { $expr = $event->getFilterQuery()->getExpressionBuilder(); diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php index 1dd0a1a4..ef8d7d3b 100644 --- a/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php +++ b/src/Wallabag/CoreBundle/Event/Subscriber/DownloadImagesSubscriber.php @@ -35,8 +35,6 @@ class DownloadImagesSubscriber implements EventSubscriberInterface /** * Download images and updated the data into the entry. - * - * @param EntrySavedEvent $event */ public function onEntrySaved(EntrySavedEvent $event) { @@ -69,8 +67,6 @@ class DownloadImagesSubscriber implements EventSubscriberInterface /** * Remove images related to the entry. - * - * @param EntryDeletedEvent $event */ public function onEntryDeleted(EntryDeletedEvent $event) { @@ -88,8 +84,6 @@ class DownloadImagesSubscriber implements EventSubscriberInterface * * @todo If we want to add async download, it should be done in that method * - * @param Entry $entry - * * @return string|false False in case of async */ private function downloadImages(Entry $entry) @@ -106,8 +100,6 @@ class DownloadImagesSubscriber implements EventSubscriberInterface * * @todo If we want to add async download, it should be done in that method * - * @param Entry $entry - * * @return string|false False in case of async */ private function downloadPreviewImage(Entry $entry) diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php index 9c1d8a1d..dcadeedf 100644 --- a/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php +++ b/src/Wallabag/CoreBundle/Event/Subscriber/SQLiteCascadeDeleteSubscriber.php @@ -18,9 +18,6 @@ class SQLiteCascadeDeleteSubscriber implements EventSubscriber { private $doctrine; - /** - * @param \Doctrine\Bundle\DoctrineBundle\Registry $doctrine - */ public function __construct(Registry $doctrine) { $this->doctrine = $doctrine; @@ -39,8 +36,6 @@ class SQLiteCascadeDeleteSubscriber implements EventSubscriber /** * We removed everything related to the upcoming removed entry because SQLite can't handle it on it own. * We do it in the preRemove, because we can't retrieve tags in the postRemove (because the entry id is gone). - * - * @param LifecycleEventArgs $args */ public function preRemove(LifecycleEventArgs $args) { diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php index 8a575b68..17070c59 100644 --- a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php @@ -23,9 +23,6 @@ class EntryFilterType extends AbstractType /** * Repository & user are used to get a list of language entries for this user. - * - * @param EntityRepository $entryRepository - * @param TokenStorageInterface $tokenStorage */ public function __construct(EntityRepository $entryRepository, TokenStorageInterface $tokenStorage) { diff --git a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php index c7502bac..b0be2176 100644 --- a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php +++ b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php @@ -34,11 +34,6 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder /** * GrabySiteConfigBuilder constructor. - * - * @param ConfigBuilder $grabyConfigBuilder - * @param TokenStorage $token - * @param SiteCredentialRepository $credentialRepository - * @param LoggerInterface $logger */ public function __construct(ConfigBuilder $grabyConfigBuilder, TokenStorage $token, SiteCredentialRepository $credentialRepository, LoggerInterface $logger) { diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index 5901df8b..9c6fa8db 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -86,7 +86,6 @@ class ContentProxy /** * Use a Symfony validator to ensure the language is well formatted. * - * @param Entry $entry * @param string $value Language to validate and save */ public function updateLanguage(Entry $entry, $value) @@ -112,7 +111,6 @@ class ContentProxy /** * Use a Symfony validator to ensure the preview picture is a real url. * - * @param Entry $entry * @param string $value URL to validate and save */ public function updatePreviewPicture(Entry $entry, $value) @@ -134,7 +132,6 @@ class ContentProxy /** * Update date. * - * @param Entry $entry * @param string $value Date to validate and save */ public function updatePublishedAt(Entry $entry, $value) @@ -161,8 +158,6 @@ class ContentProxy /** * Helper to extract and save host from entry url. - * - * @param Entry $entry */ public function setEntryDomainName(Entry $entry) { @@ -176,8 +171,6 @@ class ContentProxy * Helper to set a default title using: * - url basename, if applicable * - hostname. - * - * @param Entry $entry */ public function setDefaultEntryTitle(Entry $entry) { @@ -333,7 +326,6 @@ class ContentProxy * Update the origin_url field when a redirection occurs * This field is set if it is empty and new url does not match ignore list. * - * @param Entry $entry * @param string $url */ private function updateOriginUrl(Entry $entry, $url) @@ -441,8 +433,6 @@ class ContentProxy /** * Validate that the given content has at least a title, an html and a url. * - * @param array $content - * * @return bool true if valid otherwise false */ private function validateContent(array $content) diff --git a/src/Wallabag/CoreBundle/Helper/DownloadImages.php b/src/Wallabag/CoreBundle/Helper/DownloadImages.php index 1d361d6d..1d98fd1a 100644 --- a/src/Wallabag/CoreBundle/Helper/DownloadImages.php +++ b/src/Wallabag/CoreBundle/Helper/DownloadImages.php @@ -213,8 +213,6 @@ class DownloadImages /** * Get images urls from the srcset image attribute. * - * @param Crawler $imagesCrawler - * * @return array An array of urls */ private static function getSrcsetUrls(Crawler $imagesCrawler) diff --git a/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php b/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php index b8e95381..ea864acb 100644 --- a/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php +++ b/src/Wallabag/CoreBundle/Helper/HttpClientFactory.php @@ -27,9 +27,7 @@ class HttpClientFactory implements ClientFactory /** * HttpClientFactory constructor. * - * @param \GuzzleHttp\Cookie\CookieJar $cookieJar - * @param string $restrictedAccess This param is a kind of boolean. Values: 0 or 1 - * @param LoggerInterface $logger + * @param string $restrictedAccess This param is a kind of boolean. Values: 0 or 1 */ public function __construct(CookieJar $cookieJar, $restrictedAccess, LoggerInterface $logger) { @@ -40,8 +38,6 @@ class HttpClientFactory implements ClientFactory /** * Adds a subscriber to the HTTP client. - * - * @param SubscriberInterface $subscriber */ public function addSubscriber(SubscriberInterface $subscriber) { @@ -51,8 +47,6 @@ class HttpClientFactory implements ClientFactory /** * Input an array of configuration to be able to create a HttpClient. * - * @param array $config - * * @return HttpClient */ public function createClient(array $config = []) diff --git a/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php b/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php index 04abc6d0..3d56a6d8 100644 --- a/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php +++ b/src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php @@ -20,8 +20,7 @@ class PreparePagerForEntries } /** - * @param AdapterInterface $adapter - * @param User $user If user isn't logged in, we can force it (like for feed) + * @param User $user If user isn't logged in, we can force it (like for feed) * * @return Pagerfanta|null */ diff --git a/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php b/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php index fbdf2ac7..d48e2469 100644 --- a/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php +++ b/src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php @@ -56,8 +56,6 @@ class RuleBasedTagger /** * Apply all the tagging rules defined by a user on its entries. * - * @param User $user - * * @return array A list of modified entries */ public function tagAllForUser(User $user) @@ -109,8 +107,6 @@ class RuleBasedTagger /** * Retrieves the tagging rules for a given user. * - * @param User $user - * * @return array */ private function getRulesForUser(User $user) diff --git a/src/Wallabag/CoreBundle/Helper/TagsAssigner.php b/src/Wallabag/CoreBundle/Helper/TagsAssigner.php index e6b4989f..433b09fe 100644 --- a/src/Wallabag/CoreBundle/Helper/TagsAssigner.php +++ b/src/Wallabag/CoreBundle/Helper/TagsAssigner.php @@ -21,7 +21,6 @@ class TagsAssigner /** * Assign some tags to an entry. * - * @param Entry $entry * @param array|string $tags An array of tag or a string coma separated of tag * @param array $entitiesReady Entities from the EntityManager which are persisted but not yet flushed * It is mostly to fix duplicate tag on import @see http://stackoverflow.com/a/7879164/569101 diff --git a/src/Wallabag/CoreBundle/Helper/UrlHasher.php b/src/Wallabag/CoreBundle/Helper/UrlHasher.php index d123eaba..6753745f 100644 --- a/src/Wallabag/CoreBundle/Helper/UrlHasher.php +++ b/src/Wallabag/CoreBundle/Helper/UrlHasher.php @@ -11,7 +11,6 @@ class UrlHasher * Hash the given url using the given algorithm. * Hashed url are faster to be retrieved in the database than the real url. * - * @param string $url * @param string $algorithm * * @return string diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index d9675982..bfd07937 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -306,7 +306,6 @@ class EntryRepository extends EntityRepository * DELETE et FROM entry_tag et WHERE et.entry_id IN ( SELECT e.id FROM entry e WHERE e.user_id = :userId ) AND et.tag_id = :tagId * * @param int $userId - * @param Tag $tag */ public function removeTag($userId, Tag $tag) { @@ -565,9 +564,8 @@ class EntryRepository extends EntityRepository /** * Return the given QueryBuilder with an orderBy() call. * - * @param QueryBuilder $qb - * @param string $sortBy - * @param string $direction + * @param string $sortBy + * @param string $direction * * @return QueryBuilder */ diff --git a/src/Wallabag/ImportBundle/Controller/BrowserController.php b/src/Wallabag/ImportBundle/Controller/BrowserController.php index 58d2a730..8c2bdfe5 100644 --- a/src/Wallabag/ImportBundle/Controller/BrowserController.php +++ b/src/Wallabag/ImportBundle/Controller/BrowserController.php @@ -13,8 +13,6 @@ abstract class BrowserController extends Controller /** * @Route("/browser", name="import_browser") * - * @param Request $request - * * @return Response */ public function indexAction(Request $request) diff --git a/src/Wallabag/ImportBundle/Controller/WallabagController.php b/src/Wallabag/ImportBundle/Controller/WallabagController.php index d182dd2c..5180006d 100644 --- a/src/Wallabag/ImportBundle/Controller/WallabagController.php +++ b/src/Wallabag/ImportBundle/Controller/WallabagController.php @@ -16,8 +16,6 @@ abstract class WallabagController extends Controller /** * Handle import request. * - * @param Request $request - * * @return Response|RedirectResponse */ public function indexAction(Request $request) diff --git a/src/Wallabag/ImportBundle/Import/AbstractImport.php b/src/Wallabag/ImportBundle/Import/AbstractImport.php index d39d71b6..1b073e99 100644 --- a/src/Wallabag/ImportBundle/Import/AbstractImport.php +++ b/src/Wallabag/ImportBundle/Import/AbstractImport.php @@ -46,8 +46,6 @@ abstract class AbstractImport implements ImportInterface /** * Set RabbitMQ/Redis Producer to send each entry to a queue. * This method should be called when user has enabled RabbitMQ. - * - * @param ProducerInterface $producer */ public function setProducer(ProducerInterface $producer) { @@ -57,8 +55,6 @@ abstract class AbstractImport implements ImportInterface /** * Set current user. * Could the current *connected* user or one retrieve by the consumer. - * - * @param User $user */ public function setUser(User $user) { @@ -112,8 +108,6 @@ abstract class AbstractImport implements ImportInterface /** * Parse one entry. * - * @param array $importedEntry - * * @return Entry */ abstract public function parseEntry(array $importedEntry); @@ -121,8 +115,6 @@ abstract class AbstractImport implements ImportInterface /** * Validate that an entry is valid (like has some required keys, etc.). * - * @param array $importedEntry - * * @return bool */ abstract public function validateEntry(array $importedEntry); @@ -149,8 +141,6 @@ abstract class AbstractImport implements ImportInterface /** * Parse and insert all given entries. - * - * @param array $entries */ protected function parseEntries(array $entries) { @@ -210,8 +200,6 @@ abstract class AbstractImport implements ImportInterface * * Faster parse entries for Producer. * We don't care to make check at this time. They'll be done by the consumer. - * - * @param array $entries */ protected function parseEntriesForProducer(array $entries) { @@ -233,8 +221,6 @@ abstract class AbstractImport implements ImportInterface * Set current imported entry to archived / read. * Implementation is different accross all imports. * - * @param array $importedEntry - * * @return array */ abstract protected function setEntryAsRead(array $importedEntry); diff --git a/src/Wallabag/ImportBundle/Import/BrowserImport.php b/src/Wallabag/ImportBundle/Import/BrowserImport.php index 3987e80f..ea7afd3d 100644 --- a/src/Wallabag/ImportBundle/Import/BrowserImport.php +++ b/src/Wallabag/ImportBundle/Import/BrowserImport.php @@ -148,8 +148,6 @@ abstract class BrowserImport extends AbstractImport /** * Parse and insert all given entries. - * - * @param array $entries */ protected function parseEntries(array $entries) { @@ -199,8 +197,6 @@ abstract class BrowserImport extends AbstractImport * * Faster parse entries for Producer. * We don't care to make check at this time. They'll be done by the consumer. - * - * @param array $entries */ protected function parseEntriesForProducer(array $entries) { diff --git a/src/Wallabag/ImportBundle/Import/ImportChain.php b/src/Wallabag/ImportBundle/Import/ImportChain.php index 9dd77956..e1b5867d 100644 --- a/src/Wallabag/ImportBundle/Import/ImportChain.php +++ b/src/Wallabag/ImportBundle/Import/ImportChain.php @@ -14,8 +14,7 @@ class ImportChain /** * Add an import to the chain. * - * @param ImportInterface $import - * @param string $alias + * @param string $alias */ public function addImport(ImportInterface $import, $alias) { diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index 746120af..24fdaa2b 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php @@ -151,9 +151,6 @@ class PocketImport extends AbstractImport /** * Set the Http client. - * - * @param HttpClient $client - * @param MessageFactory|null $messageFactory */ public function setClient(HttpClient $client, MessageFactory $messageFactory = null) { diff --git a/src/Wallabag/UserBundle/Controller/ManageController.php b/src/Wallabag/UserBundle/Controller/ManageController.php index 63a06206..1122f8f0 100644 --- a/src/Wallabag/UserBundle/Controller/ManageController.php +++ b/src/Wallabag/UserBundle/Controller/ManageController.php @@ -127,8 +127,7 @@ class ManageController extends Controller } /** - * @param Request $request - * @param int $page + * @param int $page * * @Route("/list/{page}", name="user_index", defaults={"page" = 1}) * diff --git a/src/Wallabag/UserBundle/Entity/User.php b/src/Wallabag/UserBundle/Entity/User.php index 43fa6a80..aeab761d 100644 --- a/src/Wallabag/UserBundle/Entity/User.php +++ b/src/Wallabag/UserBundle/Entity/User.php @@ -188,8 +188,6 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI } /** - * @param Entry $entry - * * @return User */ public function addEntry(Entry $entry) @@ -355,8 +353,6 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI } /** - * @param Client $client - * * @return User */ public function addClient(Client $client) diff --git a/src/Wallabag/UserBundle/Form/UserType.php b/src/Wallabag/UserBundle/Form/UserType.php index 026db9a2..03fad971 100644 --- a/src/Wallabag/UserBundle/Form/UserType.php +++ b/src/Wallabag/UserBundle/Form/UserType.php @@ -12,10 +12,6 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class UserType extends AbstractType { - /** - * @param FormBuilderInterface $builder - * @param array $options - */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -50,9 +46,6 @@ class UserType extends AbstractType ; } - /** - * @param OptionsResolver $resolver - */ public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ diff --git a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php index b25ba685..4eea444f 100644 --- a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php +++ b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php @@ -57,12 +57,10 @@ class AuthCodeMailer implements AuthCodeMailerInterface /** * Initialize the auth code mailer with the SwiftMailer object. * - * @param \Swift_Mailer $mailer - * @param Environment $twig - * @param string $senderEmail - * @param string $senderName - * @param string $supportUrl wallabag support url - * @param string $wallabagUrl wallabag instance url + * @param string $senderEmail + * @param string $senderName + * @param string $supportUrl wallabag support url + * @param string $wallabagUrl wallabag instance url */ public function __construct(\Swift_Mailer $mailer, Environment $twig, $senderEmail, $senderName, $supportUrl, $wallabagUrl) { @@ -76,8 +74,6 @@ class AuthCodeMailer implements AuthCodeMailerInterface /** * Send the auth code to the user via email. - * - * @param TwoFactorInterface $user */ public function sendAuthCode(TwoFactorInterface $user): void { -- cgit v1.2.3 From 958e77e6a7c779de11f0f070b70c861c246a959f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 7 Nov 2019 12:17:01 +0100 Subject: Added elCurator import --- .../Resources/translations/messages.da.yml | 3 ++ .../Resources/translations/messages.de.yml | 3 ++ .../Resources/translations/messages.en.yml | 3 ++ .../Resources/translations/messages.es.yml | 3 ++ .../Resources/translations/messages.fa.yml | 3 ++ .../Resources/translations/messages.fr.yml | 3 ++ .../Resources/translations/messages.it.yml | 3 ++ .../Resources/translations/messages.oc.yml | 3 ++ .../Resources/translations/messages.pl.yml | 3 ++ .../Resources/translations/messages.pt.yml | 3 ++ .../Resources/translations/messages.ro.yml | 3 ++ .../Resources/translations/messages.ru.yml | 3 ++ .../Resources/translations/messages.th.yml | 3 ++ .../Resources/translations/messages.tr.yml | 3 ++ .../Controller/ElcuratorController.php | 41 ++++++++++++++++ .../ImportBundle/Import/ElcuratorImport.php | 54 ++++++++++++++++++++++ .../ImportBundle/Resources/config/rabbit.yml | 8 ++++ .../ImportBundle/Resources/config/redis.yml | 21 +++++++++ .../ImportBundle/Resources/config/services.yml | 12 +++++ .../Resources/views/Elcurator/index.html.twig | 3 ++ 20 files changed, 181 insertions(+) create mode 100644 src/Wallabag/ImportBundle/Controller/ElcuratorController.php create mode 100644 src/Wallabag/ImportBundle/Import/ElcuratorImport.php create mode 100644 src/Wallabag/ImportBundle/Resources/views/Elcurator/index.html.twig (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index 6f381408..8573ba72 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -465,6 +465,9 @@ import: # wallabag_v2: # page_title: 'Import > Wallabag v2' # description: 'This importer will import all your wallabag v2 articles. Go to All articles, then, on the export sidebar, click on "JSON". You will have a "All articles.json" file.' + # elcurator: + # page_title: 'Import > elCurator' + # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.' # readability: # page_title: 'Import > Readability' # description: 'This importer will import all your Readability articles. On the tools (https://www.readability.com/tools/) page, click on "Export your data" in the "Data Export" section. You will received an email to download a json (which does not end with .json in fact).' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 7efb18aa..50e67d47 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -465,6 +465,9 @@ import: wallabag_v2: page_title: 'Aus wallabag v2 importieren' description: 'Dieser Import wird all deine Artikel aus wallabag v2 importieren. Gehe auf "Alle Artikel" und dann, in der Exportieren-Seitenleiste auf "JSON". Dabei erhältst du eine "All articles.json"-Datei.' + # elcurator: + # page_title: 'Import > elCurator' + # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.' readability: page_title: 'Aus Readability importieren' description: 'Dieser Import wird all deine Artikel aus Readability importieren. Auf der Tools Seite (https://www.readability.com/tools/) klickst du auf "Exportiere deine Daten" in dem Abschnitt "Datenexport". Du wirst eine E-Mail mit einem Downloadlink zu einer json Datei, die aber nicht auf .json endet, erhalten' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index cf98e408..206d3562 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -465,6 +465,9 @@ import: wallabag_v2: page_title: 'Import > Wallabag v2' description: 'This importer will import all your wallabag v2 articles. Go to All articles, then, on the export sidebar, click on "JSON". You will have a "All articles.json" file.' + elcurator: + page_title: 'Import > elCurator' + description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.' readability: page_title: 'Import > Readability' description: 'This importer will import all your Readability articles. On the tools (https://www.readability.com/tools/) page, click on "Export your data" in the "Data Export" section. You will received an email to download a json (which does not end with .json in fact).' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index b7cdd261..10f5e79a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -465,6 +465,9 @@ import: wallabag_v2: page_title: 'Importar > Wallabag v2' description: 'Importa todos tus artículos de wallabag v2. En la sección Todos los artículos, en la barra lateral, haga clic en "JSON". Obtendrás un archivo llamado "All articles.json".' + # elcurator: + # page_title: 'Import > elCurator' + # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.' readability: page_title: 'Importar > Readability' description: 'Importa todos tus artículos de Readability. En la página de herramientas (https://www.readability.com/tools/), haga clic en "Exportar tus datos" en la sección "Exportar datos". Recibirás un correo electrónico para descargar un JSON (que no tiene extensión .json).' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index 66e83e16..730b7e68 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -465,6 +465,9 @@ import: wallabag_v2: page_title: 'درون‌ریزی > Wallabag v2' description: 'این برنامه همهٔ داده‌های شما را در نسخهٔ ۲ wallabag درون‌ریزی می‌کند. به بخش «همهٔ مقاله‌ها» بروید و در بخش «برون‌ریزی» روی "JSON" کلیک کنید. با این کار شما پرونده‌ای به شکل "All articles.json" دریافت خواهید کرد.' + # elcurator: + # page_title: 'Import > elCurator' + # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.' readability: page_title: 'درون‌ریزی > Readability' # description: 'This importer will import all your Readability articles. On the tools (https://www.readability.com/tools/) page, click on "Export your data" in the "Data Export" section. You will received an email to download a json (which does not end with .json in fact).' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 6fb856f2..1eecd111 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -465,6 +465,9 @@ import: wallabag_v2: page_title: "Importer > wallabag v2" description: "Cet outil va importer tous vos articles d’une autre instance de wallabag v2. Allez dans tous vos articles, puis, sur la barre latérale, cliquez sur « JSON ». Vous allez récupérer un fichier « All articles.json »" + # elcurator: + # page_title: 'Import > elCurator' + # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.' readability: page_title: "Importer > Readability" description: "Cet outil va importer toutes vos données de Readability. Sur la page des outils (https://www.readability.com/tools/), cliquez sur « Export your data » dans la section « Data Export ». Vous allez recevoir un courriel avec un lien pour télécharger le json." diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index 3640e0a0..f1a8e3b1 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -465,6 +465,9 @@ import: wallabag_v2: page_title: 'Importa da > Wallabag v2' description: 'Questo importatore copierà tutti i tuoi dati da un wallabag v2. Vai in "Tutti i contenuti", e, nella barra laterale di esportazione, clicca su "JSON". Otterrai un file "Tutti i contenuti.json' + # elcurator: + # page_title: 'Import > elCurator' + # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.' readability: page_title: 'Importa da > Readability' description: 'Questo importatore copierà tutti i tuoi articoli da Readability. Nella pagina strumenti (https://www.readability.com/tools/), clicca su "Export your data" nella sezione "Data Export". Riceverai una E-mail per scaricare un file json (che tuttavia non termina con .json).' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index cd60566a..89bf8b16 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -465,6 +465,9 @@ import: wallabag_v2: page_title: 'Importar > Wallabag v2' description: "Aquesta aisina importarà totas vòstras donadas d'una instància mai de wallabag v2. Anatz dins totes vòstres articles, puèi, sus la barra laterala, clicatz sus \"JSON\". Traparetz un fichièr \"All articles.json\"." + # elcurator: + # page_title: 'Import > elCurator' + # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.' readability: page_title: 'Importar > Readability' description: "Aquesta aisina importarà totas vòstres articles de Readability. Sus la pagina de l'aisina (https://www.readability.com/tools/), clicatz sus \"Export your data\" dins la seccion \"Data Export\". Recebretz un corrièl per telecargar un json (qu'acaba pas amb un .json de fach)." diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 909f7058..0118ad21 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -465,6 +465,9 @@ import: wallabag_v2: page_title: 'Import > Wallabag v2' description: 'Ten importer, zaimportuje wszystkie twoje artykułu z wallabag v2. Idź do wszystkich artykułów, a następnie na panelu exportu kliknij na "JSON". Otrzymasz plik "All articles.json".' + # elcurator: + # page_title: 'Import > elCurator' + # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.' readability: page_title: 'Import > Readability' description: 'Ten importer, zaimportuje wszystkie twoje artykuły z Readability. Na stronie narzędzi (https://www.readability.com/tools/), kliknij na "Export your data" w sekcji "Data Export". Otrzymach email z plikiem JSON (plik nie będzie zawierał rozszerzenia .json).' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 47e7b4db..d0082cda 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -465,6 +465,9 @@ import: wallabag_v2: page_title: 'Importar > Wallabag v2' description: 'Com este importador você importa todos os seus artigos do wallabag v2. Vá em Todos os artigos e então, na barra lateral de exportação, clique em "JSON". Você irá criar um arquivo "All articles.json".' + # elcurator: + # page_title: 'Import > elCurator' + # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.' readability: page_title: 'Importar > Readability' description: 'Este importador pode importar todos os artigos do Readability. Nas página ferramentas (https://www.readability.com/tools/), clique em "Export your data" na seção "Data Export". Você receberá um e-mail para fazer o download de um json (que de fato não termina com .json).' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index 380b5233..c8e2dfb4 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -465,6 +465,9 @@ import: # wallabag_v2: # page_title: 'Import > Wallabag v2' # description: 'This importer will import all your wallabag v2 articles. Go to All articles, then, on the export sidebar, click on "JSON". You will have a "All articles.json" file.' + # elcurator: + # page_title: 'Import > elCurator' + # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.' # readability: # page_title: 'Import > Readability' # description: 'This importer will import all your Readability articles. On the tools (https://www.readability.com/tools/) page, click on "Export your data" in the "Data Export" section. You will received an email to download a json (which does not end with .json in fact).' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml index a47525c6..41379f90 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml @@ -465,6 +465,9 @@ import: wallabag_v2: page_title: 'Импорт > Wallabag v2' description: 'Функция импорта добавит все ваши записи wallabag v2. Перейдите ко всем статьям, затем на боковой панели экспорта нажмите "JSON". У вас появится файл со всеми записями "All articles.json".' + # elcurator: + # page_title: 'Import > elCurator' + # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.' readability: page_title: 'Импорт > Readability' description: 'Функция импорта добавит все ваши записи для чтения. На странице инструментов (https://www.readability.com/tools/) нажмите "Экспорт ваших данных" в разделе "Экспорт данных". Вы получите электронное письмо для загрузки json (что не заканчивается только .json файлом).' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index 5879c48f..b5a3bcb6 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -465,6 +465,9 @@ import: wallabag_v2: page_title: 'นำเข้าข้อมูล > Wallabag v2' description: 'สำหรับผู้นำเข้าข้อมูลจะ import บทความ wallabag v2 ทั้งหมดของคุณ ไปยังบทความทั้งหมด, ดังนั้น, บน export sidebar, click ที่ "JSON" คุณจะมีไฟล์ "All articles.json"' + # elcurator: + # page_title: 'Import > elCurator' + # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.' readability: page_title: 'นำเข้าข้อมูล > Readability' description: 'สำหรับผู้นำเข้าข้อมูลจะ import บทความ Readability ทั้งหมดของคุณ ไปที่เครื่องมือ (https://www.readability.com/tools/) ของหน้านั้น, click ที่ "Export your data" ในส่วน "Data Export" คุณจะได้รับ email ไป download json (which does not end with .json in fact).' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index d023e368..4aaef781 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml @@ -465,6 +465,9 @@ import: wallabag_v2: page_title: 'İçe Aktar > Wallabag v2' # description: 'This importer will import all your wallabag v2 articles. Go to All articles, then, on the export sidebar, click on "JSON". You will have a "All articles.json" file.' + # elcurator: + # page_title: 'Import > elCurator' + # description: 'This importer will import all your elCurator articles. Go to your preferences in your elCurator account and then, export your content. You will have a JSON file.' readability: page_title: 'İçe Aktar > Readability' # description: 'This importer will import all your Readability articles. On the tools (https://www.readability.com/tools/) page, click on "Export your data" in the "Data Export" section. You will received an email to download a json (which does not end with .json in fact).' diff --git a/src/Wallabag/ImportBundle/Controller/ElcuratorController.php b/src/Wallabag/ImportBundle/Controller/ElcuratorController.php new file mode 100644 index 00000000..174c2c96 --- /dev/null +++ b/src/Wallabag/ImportBundle/Controller/ElcuratorController.php @@ -0,0 +1,41 @@ +get('wallabag_import.elcurator.import'); + + if ($this->get('craue_config')->get('import_with_rabbitmq')) { + $service->setProducer($this->get('old_sound_rabbit_mq.import_elcurator_producer')); + } elseif ($this->get('craue_config')->get('import_with_redis')) { + $service->setProducer($this->get('wallabag_import.producer.redis.elcurator')); + } + + return $service; + } + + /** + * {@inheritdoc} + */ + protected function getImportTemplate() + { + return 'WallabagImportBundle:Elcurator:index.html.twig'; + } +} diff --git a/src/Wallabag/ImportBundle/Import/ElcuratorImport.php b/src/Wallabag/ImportBundle/Import/ElcuratorImport.php new file mode 100644 index 00000000..d1281613 --- /dev/null +++ b/src/Wallabag/ImportBundle/Import/ElcuratorImport.php @@ -0,0 +1,54 @@ + $entry['url'], + 'title' => $entry['title'], + 'created_at' => $entry['created_at'], + 'is_archived' => 0, + 'is_starred' => $entry['is_saved'], + ] + $entry; + } + + /** + * {@inheritdoc} + */ + protected function setEntryAsRead(array $importedEntry) + { + $importedEntry['is_archived'] = 1; + + return $importedEntry; + } +} diff --git a/src/Wallabag/ImportBundle/Resources/config/rabbit.yml b/src/Wallabag/ImportBundle/Resources/config/rabbit.yml index e9ecb846..0bf0e761 100644 --- a/src/Wallabag/ImportBundle/Resources/config/rabbit.yml +++ b/src/Wallabag/ImportBundle/Resources/config/rabbit.yml @@ -48,6 +48,14 @@ services: - "@wallabag_import.wallabag_v2.import" - "@event_dispatcher" - "@logger" + wallabag_import.consumer.amqp.elcurator: + class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer + arguments: + - "@doctrine.orm.entity_manager" + - "@wallabag_user.user_repository" + - "@wallabag_import.elcurator.import" + - "@event_dispatcher" + - "@logger" wallabag_import.consumer.amqp.firefox: class: Wallabag\ImportBundle\Consumer\AMQPEntryConsumer arguments: diff --git a/src/Wallabag/ImportBundle/Resources/config/redis.yml b/src/Wallabag/ImportBundle/Resources/config/redis.yml index 091cdba0..40a6e224 100644 --- a/src/Wallabag/ImportBundle/Resources/config/redis.yml +++ b/src/Wallabag/ImportBundle/Resources/config/redis.yml @@ -126,6 +126,27 @@ services: - "@event_dispatcher" - "@logger" + # elcurator + wallabag_import.queue.redis.elcurator: + class: Simpleue\Queue\RedisQueue + arguments: + - "@wallabag_core.redis.client" + - "wallabag.import.elcurator" + + wallabag_import.producer.redis.elcurator: + class: Wallabag\ImportBundle\Redis\Producer + arguments: + - "@wallabag_import.queue.redis.elcurator" + + wallabag_import.consumer.redis.elcurator: + class: Wallabag\ImportBundle\Consumer\RedisEntryConsumer + arguments: + - "@doctrine.orm.entity_manager" + - "@wallabag_user.user_repository" + - "@wallabag_import.elcurator.import" + - "@event_dispatcher" + - "@logger" + # firefox wallabag_import.queue.redis.firefox: class: Simpleue\Queue\RedisQueue diff --git a/src/Wallabag/ImportBundle/Resources/config/services.yml b/src/Wallabag/ImportBundle/Resources/config/services.yml index 973c0d03..d824da4a 100644 --- a/src/Wallabag/ImportBundle/Resources/config/services.yml +++ b/src/Wallabag/ImportBundle/Resources/config/services.yml @@ -48,6 +48,18 @@ services: tags: - { name: wallabag_import.import, alias: wallabag_v2 } + wallabag_import.elcurator.import: + class: Wallabag\ImportBundle\Import\ElcuratorImport + arguments: + - "@doctrine.orm.entity_manager" + - "@wallabag_core.content_proxy" + - "@wallabag_core.tags_assigner" + - "@event_dispatcher" + calls: + - [ setLogger, [ "@logger" ]] + tags: + - { name: wallabag_import.import, alias: elcurator } + wallabag_import.readability.import: class: Wallabag\ImportBundle\Import\ReadabilityImport arguments: diff --git a/src/Wallabag/ImportBundle/Resources/views/Elcurator/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/Elcurator/index.html.twig new file mode 100644 index 00000000..e3a0d709 --- /dev/null +++ b/src/Wallabag/ImportBundle/Resources/views/Elcurator/index.html.twig @@ -0,0 +1,3 @@ +{% extends "WallabagImportBundle:WallabagV1:index.html.twig" %} + +{% block title %}{{ 'import.elcurator.page_title'|trans }}{% endblock %} -- cgit v1.2.3 From 8197f08266256f55767666b90be47f585c7a6d28 Mon Sep 17 00:00:00 2001 From: adev Date: Sun, 27 Oct 2019 18:51:32 +0100 Subject: API return an error with empty quote Fix #4137 --- src/Wallabag/AnnotationBundle/Entity/Annotation.php | 1 + src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php | 1 + src/Wallabag/ApiBundle/Controller/AnnotationRestController.php | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/AnnotationBundle/Entity/Annotation.php b/src/Wallabag/AnnotationBundle/Entity/Annotation.php index a180d504..ee7c1931 100644 --- a/src/Wallabag/AnnotationBundle/Entity/Annotation.php +++ b/src/Wallabag/AnnotationBundle/Entity/Annotation.php @@ -60,6 +60,7 @@ class Annotation /** * @var string * + * @Assert\NotNull() * @Assert\Length( * max = 10000, * maxMessage = "validator.quote_length_too_high" diff --git a/src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php b/src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php index c73c3ded..aac6445c 100644 --- a/src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php +++ b/src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php @@ -18,6 +18,7 @@ class NewAnnotationType extends AbstractType ]) ->add('quote', null, [ 'empty_data' => null, + 'trim' => false, ]) ->add('ranges', CollectionType::class, [ 'entry_type' => RangeType::class, diff --git a/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php b/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php index f59431e4..e5b3eb27 100644 --- a/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php +++ b/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php @@ -37,7 +37,7 @@ class AnnotationRestController extends WallabagRestController * @ApiDoc( * requirements={ * {"name"="ranges", "dataType"="array", "requirement"="\w+", "description"="The range array for the annotation"}, - * {"name"="quote", "dataType"="string", "required"=false, "description"="Optional, quote for the annotation"}, + * {"name"="quote", "dataType"="string", "required"=true, "description"="Quote for the annotation"}, * {"name"="text", "dataType"="string", "required"=true, "description"=""}, * } * ) -- cgit v1.2.3 From 86c1751186ab71a54e33092cd9fb83c33917f619 Mon Sep 17 00:00:00 2001 From: adev Date: Sun, 24 Nov 2019 10:44:26 +0100 Subject: Optionnal quote because the frontend does not use it --- src/Wallabag/AnnotationBundle/Entity/Annotation.php | 1 - src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php | 2 +- src/Wallabag/ApiBundle/Controller/AnnotationRestController.php | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/AnnotationBundle/Entity/Annotation.php b/src/Wallabag/AnnotationBundle/Entity/Annotation.php index ee7c1931..a180d504 100644 --- a/src/Wallabag/AnnotationBundle/Entity/Annotation.php +++ b/src/Wallabag/AnnotationBundle/Entity/Annotation.php @@ -60,7 +60,6 @@ class Annotation /** * @var string * - * @Assert\NotNull() * @Assert\Length( * max = 10000, * maxMessage = "validator.quote_length_too_high" diff --git a/src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php b/src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php index aac6445c..48bc2c59 100644 --- a/src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php +++ b/src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php @@ -17,7 +17,7 @@ class NewAnnotationType extends AbstractType 'empty_data' => '', ]) ->add('quote', null, [ - 'empty_data' => null, + 'empty_data' => '', 'trim' => false, ]) ->add('ranges', CollectionType::class, [ diff --git a/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php b/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php index e5b3eb27..66693189 100644 --- a/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php +++ b/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php @@ -37,8 +37,8 @@ class AnnotationRestController extends WallabagRestController * @ApiDoc( * requirements={ * {"name"="ranges", "dataType"="array", "requirement"="\w+", "description"="The range array for the annotation"}, - * {"name"="quote", "dataType"="string", "required"=true, "description"="Quote for the annotation"}, - * {"name"="text", "dataType"="string", "required"=true, "description"=""}, + * {"name"="quote", "dataType"="string", "description"="The annotated text"}, + * {"name"="text", "dataType"="string", "required"=true, "description"="Content of annotation"}, * } * ) * -- cgit v1.2.3 From f3d20097cd4046519c921286f0a8a81dbd8c66ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 2 Dec 2019 12:36:05 +0100 Subject: Fixed elCurator check for RabbitMQ / Redis --- src/Wallabag/ImportBundle/Controller/ImportController.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Wallabag') diff --git a/src/Wallabag/ImportBundle/Controller/ImportController.php b/src/Wallabag/ImportBundle/Controller/ImportController.php index fbd7434e..5a7e53d6 100644 --- a/src/Wallabag/ImportBundle/Controller/ImportController.php +++ b/src/Wallabag/ImportBundle/Controller/ImportController.php @@ -43,6 +43,7 @@ class ImportController extends Controller + $this->getTotalMessageInRabbitQueue('chrome') + $this->getTotalMessageInRabbitQueue('instapaper') + $this->getTotalMessageInRabbitQueue('pinboard') + + $this->getTotalMessageInRabbitQueue('elcurator') ; } catch (\Exception $e) { $rabbitNotInstalled = true; @@ -59,6 +60,7 @@ class ImportController extends Controller + $redis->llen('wallabag.import.chrome') + $redis->llen('wallabag.import.instapaper') + $redis->llen('wallabag.import.pinboard') + + $redis->llen('wallabag.import.elcurator') ; } catch (\Exception $e) { $redisNotInstalled = true; -- cgit v1.2.3 From 3f3b5058aab34213107630eddc61c6fe72edd055 Mon Sep 17 00:00:00 2001 From: Liam McMenemie Date: Tue, 31 Dec 2019 21:31:59 +0000 Subject: Change API URL used in dev docs to app.wallabag.it Currently the documentation uses the defunct v2.wallabag.org URL which can be confusing to someone configuring their first API client with wallabag.it. --- .../Resources/views/themes/common/Developer/howto_app.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/howto_app.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/howto_app.html.twig index acbc2c88..dcadfa49 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/howto_app.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Developer/howto_app.html.twig @@ -18,7 +18,7 @@

    {{ 'developer.howto.description.paragraph_3'|trans({'%link%': path('developer_create_client')})|raw }}

    {{ 'developer.howto.description.paragraph_4'|trans }}

    -

    http POST http://v2.wallabag.org/oauth/v2/token \
    +                    
    http POST https://app.wallabag.it/oauth/v2/token \
         grant_type=password \
         client_id=12_5um6nz50ceg4088c0840wwc0kgg44g00kk84og044ggkscso0k \
         client_secret=3qd12zpeaxes8cwg8c0404g888co4wo8kc4gcw0occww8cgw4k \
    @@ -47,7 +47,7 @@ X-Powered-By: PHP/5.5.9-1ubuntu4.13
                     

    {{ 'developer.howto.description.paragraph_6'|trans }}

    -

    http GET http://v2.wallabag.org/api/entries.json \
    +                    
    http GET https://app.wallabag.it/api/entries.json \
         "Authorization:Bearer ZWFjNjA3ZWMwYWVmYzRkYTBlMmQ3NTllYmVhOGJiZDE0ZTg1NjE4MjczOTVlNzM0ZTRlMWQ0MmRlMmYwNTk5Mw"

    {{ 'developer.howto.description.paragraph_7'|trans }}

    -- cgit v1.2.3 From 62682c073be4a1e1484acf77217a09a2f20ccfee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 13 Jan 2020 15:17:06 +0100 Subject: Fixed URL to share entry via twitter --- .../CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig | 2 +- .../CoreBundle/Resources/views/themes/material/Entry/entry.html.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') 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 5809c8d4..4c0f85cc 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 @@ -27,7 +27,7 @@
  • {{ 'entry.view.left_menu.public_link'|trans }}
  • {{ 'entry.view.left_menu.delete_public_link'|trans }}
  • {% endif %} - {% if craue_setting('share_twitter') %}
  • {% endif %} + {% if craue_setting('share_twitter') %}
  • {% endif %} {% if craue_setting('share_mail') %}
  • {% endif %} {% if craue_setting('share_shaarli') %}
  • shaarli
  • {% endif %} {% if craue_setting('share_scuttle') %}
  • scuttle
  • {% endif %} 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 2b249b73..ecd85a84 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 @@ -127,7 +127,7 @@ {% endif %} {% if craue_setting('share_twitter') %}
  • - + twitter
  • -- cgit v1.2.3 From cfd77d1c2abca28c346af4697fb92db98a42f40a Mon Sep 17 00:00:00 2001 From: Simounet Date: Sun, 19 Jan 2020 12:50:08 +0100 Subject: Sticky nav on entry action button click --- .../CoreBundle/Resources/views/themes/material/Entry/entry.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') 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 ecd85a84..8cbed436 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 @@ -8,7 +8,7 @@
    -