diff options
Diffstat (limited to 'src/Wallabag')
53 files changed, 318 insertions, 60 deletions
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 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\ApiBundle\Controller; | 3 | namespace Wallabag\ApiBundle\Controller; |
4 | 4 | ||
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | 5 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
7 | use Symfony\Component\HttpFoundation\Request; | 6 | use Symfony\Component\HttpFoundation\Request; |
7 | use Symfony\Component\Routing\Annotation\Route; | ||
8 | use Wallabag\ApiBundle\Entity\Client; | 8 | use Wallabag\ApiBundle\Entity\Client; |
9 | use Wallabag\ApiBundle\Form\Type\ClientType; | 9 | use Wallabag\ApiBundle\Form\Type\ClientType; |
10 | 10 | ||
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 0b4e74a0..5882aaee 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php | |||
@@ -79,7 +79,7 @@ class EntryRestController extends WallabagRestController | |||
79 | * parameters={ | 79 | * parameters={ |
80 | * {"name"="archive", "dataType"="integer", "required"=false, "format"="1 or 0, all entries by default", "description"="filter by archived status."}, | 80 | * {"name"="archive", "dataType"="integer", "required"=false, "format"="1 or 0, all entries by default", "description"="filter by archived status."}, |
81 | * {"name"="starred", "dataType"="integer", "required"=false, "format"="1 or 0, all entries by default", "description"="filter by starred status."}, | 81 | * {"name"="starred", "dataType"="integer", "required"=false, "format"="1 or 0, all entries by default", "description"="filter by starred status."}, |
82 | * {"name"="sort", "dataType"="string", "required"=false, "format"="'created' or 'updated', default 'created'", "description"="sort entries by date."}, | 82 | * {"name"="sort", "dataType"="string", "required"=false, "format"="'created' or 'updated' or 'archived', default 'created'", "description"="sort entries by date."}, |
83 | * {"name"="order", "dataType"="string", "required"=false, "format"="'asc' or 'desc', default 'desc'", "description"="order of sort."}, | 83 | * {"name"="order", "dataType"="string", "required"=false, "format"="'asc' or 'desc', default 'desc'", "description"="order of sort."}, |
84 | * {"name"="page", "dataType"="integer", "required"=false, "format"="default '1'", "description"="what page you want."}, | 84 | * {"name"="page", "dataType"="integer", "required"=false, "format"="default '1'", "description"="what page you want."}, |
85 | * {"name"="perPage", "dataType"="integer", "required"=false, "format"="default'30'", "description"="results per page."}, | 85 | * {"name"="perPage", "dataType"="integer", "required"=false, "format"="default'30'", "description"="results per page."}, |
@@ -358,7 +358,7 @@ class EntryRestController extends WallabagRestController | |||
358 | } | 358 | } |
359 | 359 | ||
360 | if (null !== $data['isArchived']) { | 360 | if (null !== $data['isArchived']) { |
361 | $entry->setArchived((bool) $data['isArchived']); | 361 | $entry->updateArchived((bool) $data['isArchived']); |
362 | } | 362 | } |
363 | 363 | ||
364 | if (null !== $data['isStarred']) { | 364 | if (null !== $data['isStarred']) { |
@@ -474,7 +474,7 @@ class EntryRestController extends WallabagRestController | |||
474 | } | 474 | } |
475 | 475 | ||
476 | if (null !== $data['isArchived']) { | 476 | if (null !== $data['isArchived']) { |
477 | $entry->setArchived((bool) $data['isArchived']); | 477 | $entry->updateArchived((bool) $data['isArchived']); |
478 | } | 478 | } |
479 | 479 | ||
480 | if (null !== $data['isStarred']) { | 480 | if (null !== $data['isStarred']) { |
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index b999c539..be6feb7c 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php | |||
@@ -2,12 +2,13 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\CoreBundle\Controller; | 3 | namespace Wallabag\CoreBundle\Controller; |
4 | 4 | ||
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | 5 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
7 | use Symfony\Component\HttpFoundation\JsonResponse; | 6 | use Symfony\Component\HttpFoundation\JsonResponse; |
8 | use Symfony\Component\HttpFoundation\RedirectResponse; | 7 | use Symfony\Component\HttpFoundation\RedirectResponse; |
9 | use Symfony\Component\HttpFoundation\Request; | 8 | use Symfony\Component\HttpFoundation\Request; |
10 | use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; | 9 | use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; |
10 | use Symfony\Component\Routing\Annotation\Route; | ||
11 | use Symfony\Component\Validator\Constraints\Locale as LocaleConstraint; | ||
11 | use Wallabag\CoreBundle\Entity\Config; | 12 | use Wallabag\CoreBundle\Entity\Config; |
12 | use Wallabag\CoreBundle\Entity\TaggingRule; | 13 | use Wallabag\CoreBundle\Entity\TaggingRule; |
13 | use Wallabag\CoreBundle\Form\Type\ChangePasswordType; | 14 | use Wallabag\CoreBundle\Form\Type\ChangePasswordType; |
@@ -330,6 +331,27 @@ class ConfigController extends Controller | |||
330 | } | 331 | } |
331 | 332 | ||
332 | /** | 333 | /** |
334 | * Change the locale for the current user. | ||
335 | * | ||
336 | * @param Request $request | ||
337 | * @param string $language | ||
338 | * | ||
339 | * @Route("/locale/{language}", name="changeLocale") | ||
340 | * | ||
341 | * @return \Symfony\Component\HttpFoundation\RedirectResponse | ||
342 | */ | ||
343 | public function setLocaleAction(Request $request, $language = null) | ||
344 | { | ||
345 | $errors = $this->get('validator')->validate($language, (new LocaleConstraint())); | ||
346 | |||
347 | if (0 === \count($errors)) { | ||
348 | $request->getSession()->set('_locale', $language); | ||
349 | } | ||
350 | |||
351 | return $this->redirect($request->headers->get('referer', $this->generateUrl('homepage'))); | ||
352 | } | ||
353 | |||
354 | /** | ||
333 | * Remove all tags for given tags and a given user and cleanup orphan tags. | 355 | * Remove all tags for given tags and a given user and cleanup orphan tags. |
334 | * | 356 | * |
335 | * @param array $tags | 357 | * @param array $tags |
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index b7fdea27..ac372a33 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php | |||
@@ -5,9 +5,9 @@ namespace Wallabag\CoreBundle\Controller; | |||
5 | use Pagerfanta\Adapter\DoctrineORMAdapter; | 5 | use Pagerfanta\Adapter\DoctrineORMAdapter; |
6 | use Pagerfanta\Exception\OutOfRangeCurrentPageException; | 6 | use Pagerfanta\Exception\OutOfRangeCurrentPageException; |
7 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; | 7 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; |
8 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
9 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | 8 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
10 | use Symfony\Component\HttpFoundation\Request; | 9 | use Symfony\Component\HttpFoundation\Request; |
10 | use Symfony\Component\Routing\Annotation\Route; | ||
11 | use Symfony\Component\Routing\Generator\UrlGeneratorInterface; | 11 | use Symfony\Component\Routing\Generator\UrlGeneratorInterface; |
12 | use Wallabag\CoreBundle\Entity\Entry; | 12 | use Wallabag\CoreBundle\Entity\Entry; |
13 | use Wallabag\CoreBundle\Event\EntryDeletedEvent; | 13 | use Wallabag\CoreBundle\Event\EntryDeletedEvent; |
@@ -532,11 +532,9 @@ class EntryController extends Controller | |||
532 | switch ($type) { | 532 | switch ($type) { |
533 | case 'search': | 533 | case 'search': |
534 | $qb = $repository->getBuilderForSearchByUser($this->getUser()->getId(), $searchTerm, $currentRoute); | 534 | $qb = $repository->getBuilderForSearchByUser($this->getUser()->getId(), $searchTerm, $currentRoute); |
535 | |||
536 | break; | 535 | break; |
537 | case 'untagged': | 536 | case 'untagged': |
538 | $qb = $repository->getBuilderForUntaggedByUser($this->getUser()->getId()); | 537 | $qb = $repository->getBuilderForUntaggedByUser($this->getUser()->getId()); |
539 | |||
540 | break; | 538 | break; |
541 | case 'starred': | 539 | case 'starred': |
542 | $qb = $repository->getBuilderForStarredByUser($this->getUser()->getId()); | 540 | $qb = $repository->getBuilderForStarredByUser($this->getUser()->getId()); |
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 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\CoreBundle\Controller; | 3 | namespace Wallabag\CoreBundle\Controller; |
4 | 4 | ||
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | 5 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
7 | use Symfony\Component\HttpFoundation\Request; | 6 | use Symfony\Component\HttpFoundation\Request; |
8 | use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; | 7 | use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; |
8 | use Symfony\Component\Routing\Annotation\Route; | ||
9 | use Wallabag\CoreBundle\Entity\Entry; | 9 | use Wallabag\CoreBundle\Entity\Entry; |
10 | 10 | ||
11 | /** | 11 | /** |
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; | |||
7 | use Pagerfanta\Exception\OutOfRangeCurrentPageException; | 7 | use Pagerfanta\Exception\OutOfRangeCurrentPageException; |
8 | use Pagerfanta\Pagerfanta; | 8 | use Pagerfanta\Pagerfanta; |
9 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; | 9 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; |
10 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
11 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | 10 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
12 | use Symfony\Component\HttpFoundation\Request; | 11 | use Symfony\Component\HttpFoundation\Request; |
13 | use Symfony\Component\HttpFoundation\Response; | 12 | use Symfony\Component\HttpFoundation\Response; |
13 | use Symfony\Component\Routing\Annotation\Route; | ||
14 | use Symfony\Component\Routing\Generator\UrlGeneratorInterface; | 14 | use Symfony\Component\Routing\Generator\UrlGeneratorInterface; |
15 | use Wallabag\CoreBundle\Entity\Tag; | 15 | use Wallabag\CoreBundle\Entity\Tag; |
16 | use Wallabag\UserBundle\Entity\User; | 16 | 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 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\CoreBundle\Controller; | 3 | namespace Wallabag\CoreBundle\Controller; |
4 | 4 | ||
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; | ||
6 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
7 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | 5 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
8 | use Symfony\Component\HttpFoundation\Request; | 6 | use Symfony\Component\HttpFoundation\Request; |
7 | use Symfony\Component\Routing\Annotation\Route; | ||
9 | use Wallabag\CoreBundle\Entity\SiteCredential; | 8 | use Wallabag\CoreBundle\Entity\SiteCredential; |
10 | use Wallabag\UserBundle\Entity\User; | 9 | use Wallabag\UserBundle\Entity\User; |
11 | 10 | ||
@@ -19,8 +18,7 @@ class SiteCredentialController extends Controller | |||
19 | /** | 18 | /** |
20 | * Lists all User entities. | 19 | * Lists all User entities. |
21 | * | 20 | * |
22 | * @Route("/", name="site_credentials_index") | 21 | * @Route("/", name="site_credentials_index", methods={"GET"}) |
23 | * @Method("GET") | ||
24 | */ | 22 | */ |
25 | public function indexAction() | 23 | public function indexAction() |
26 | { | 24 | { |
@@ -36,8 +34,7 @@ class SiteCredentialController extends Controller | |||
36 | /** | 34 | /** |
37 | * Creates a new site credential entity. | 35 | * Creates a new site credential entity. |
38 | * | 36 | * |
39 | * @Route("/new", name="site_credentials_new") | 37 | * @Route("/new", name="site_credentials_new", methods={"GET", "POST"}) |
40 | * @Method({"GET", "POST"}) | ||
41 | * | 38 | * |
42 | * @param Request $request | 39 | * @param Request $request |
43 | * | 40 | * |
@@ -77,8 +74,7 @@ class SiteCredentialController extends Controller | |||
77 | /** | 74 | /** |
78 | * Displays a form to edit an existing site credential entity. | 75 | * Displays a form to edit an existing site credential entity. |
79 | * | 76 | * |
80 | * @Route("/{id}/edit", name="site_credentials_edit") | 77 | * @Route("/{id}/edit", name="site_credentials_edit", methods={"GET", "POST"}) |
81 | * @Method({"GET", "POST"}) | ||
82 | * | 78 | * |
83 | * @param Request $request | 79 | * @param Request $request |
84 | * @param SiteCredential $siteCredential | 80 | * @param SiteCredential $siteCredential |
@@ -121,8 +117,7 @@ class SiteCredentialController extends Controller | |||
121 | /** | 117 | /** |
122 | * Deletes a site credential entity. | 118 | * Deletes a site credential entity. |
123 | * | 119 | * |
124 | * @Route("/{id}", name="site_credentials_delete") | 120 | * @Route("/{id}", name="site_credentials_delete", methods={"DELETE"}) |
125 | * @Method("DELETE") | ||
126 | * | 121 | * |
127 | * @param Request $request | 122 | * @param Request $request |
128 | * @param SiteCredential $siteCredential | 123 | * @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 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\CoreBundle\Controller; | 3 | namespace Wallabag\CoreBundle\Controller; |
4 | 4 | ||
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | 5 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
6 | use Symfony\Component\Routing\Annotation\Route; | ||
7 | 7 | ||
8 | class StaticController extends Controller | 8 | class StaticController extends Controller |
9 | { | 9 | { |
diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index b6d28e59..d0155c60 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php | |||
@@ -5,12 +5,13 @@ namespace Wallabag\CoreBundle\Controller; | |||
5 | use Pagerfanta\Adapter\ArrayAdapter; | 5 | use Pagerfanta\Adapter\ArrayAdapter; |
6 | use Pagerfanta\Exception\OutOfRangeCurrentPageException; | 6 | use Pagerfanta\Exception\OutOfRangeCurrentPageException; |
7 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; | 7 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; |
8 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
9 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | 8 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
10 | use Symfony\Component\HttpFoundation\Request; | 9 | use Symfony\Component\HttpFoundation\Request; |
10 | use Symfony\Component\Routing\Annotation\Route; | ||
11 | use Wallabag\CoreBundle\Entity\Entry; | 11 | use Wallabag\CoreBundle\Entity\Entry; |
12 | use Wallabag\CoreBundle\Entity\Tag; | 12 | use Wallabag\CoreBundle\Entity\Tag; |
13 | use Wallabag\CoreBundle\Form\Type\NewTagType; | 13 | use Wallabag\CoreBundle\Form\Type\NewTagType; |
14 | use Wallabag\CoreBundle\Form\Type\RenameTagType; | ||
14 | 15 | ||
15 | class TagController extends Controller | 16 | class TagController extends Controller |
16 | { | 17 | { |
@@ -87,8 +88,14 @@ class TagController extends Controller | |||
87 | $tags = $this->get('wallabag_core.tag_repository') | 88 | $tags = $this->get('wallabag_core.tag_repository') |
88 | ->findAllFlatTagsWithNbEntries($this->getUser()->getId()); | 89 | ->findAllFlatTagsWithNbEntries($this->getUser()->getId()); |
89 | 90 | ||
91 | $renameForms = []; | ||
92 | foreach ($tags as $tag) { | ||
93 | $renameForms[$tag['id']] = $this->createForm(RenameTagType::class, new Tag())->createView(); | ||
94 | } | ||
95 | |||
90 | return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [ | 96 | return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [ |
91 | 'tags' => $tags, | 97 | 'tags' => $tags, |
98 | 'renameForms' => $renameForms, | ||
92 | ]); | 99 | ]); |
93 | } | 100 | } |
94 | 101 | ||
@@ -130,4 +137,48 @@ class TagController extends Controller | |||
130 | 'tag' => $tag, | 137 | 'tag' => $tag, |
131 | ]); | 138 | ]); |
132 | } | 139 | } |
140 | |||
141 | /** | ||
142 | * Rename a given tag with a new label | ||
143 | * Create a new tag with the new name and drop the old one. | ||
144 | * | ||
145 | * @param Tag $tag | ||
146 | * @param Request $request | ||
147 | * | ||
148 | * @Route("/tag/rename/{slug}", name="tag_rename") | ||
149 | * @ParamConverter("tag", options={"mapping": {"slug": "slug"}}) | ||
150 | * | ||
151 | * @return \Symfony\Component\HttpFoundation\Response | ||
152 | */ | ||
153 | public function renameTagAction(Tag $tag, Request $request) | ||
154 | { | ||
155 | $form = $this->createForm(RenameTagType::class, new Tag()); | ||
156 | $form->handleRequest($request); | ||
157 | |||
158 | if ($form->isSubmitted() && $form->isValid()) { | ||
159 | $entries = $this->get('wallabag_core.entry_repository')->findAllByTagId( | ||
160 | $this->getUser()->getId(), | ||
161 | $tag->getId() | ||
162 | ); | ||
163 | foreach ($entries as $entry) { | ||
164 | $this->get('wallabag_core.tags_assigner')->assignTagsToEntry( | ||
165 | $entry, | ||
166 | $form->get('label')->getData() | ||
167 | ); | ||
168 | $entry->removeTag($tag); | ||
169 | } | ||
170 | |||
171 | $em = $this->getDoctrine()->getManager(); | ||
172 | $em->flush(); | ||
173 | } | ||
174 | |||
175 | $this->get('session')->getFlashBag()->add( | ||
176 | 'notice', | ||
177 | 'flashes.tag.notice.tag_renamed' | ||
178 | ); | ||
179 | |||
180 | $redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'), '', true); | ||
181 | |||
182 | return $this->redirect($redirectUrl); | ||
183 | } | ||
133 | } | 184 | } |
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 | |||
98 | $entry6->setMimetype('text/html'); | 98 | $entry6->setMimetype('text/html'); |
99 | $entry6->setTitle('test title entry6'); | 99 | $entry6->setTitle('test title entry6'); |
100 | $entry6->setContent('This is my content /o/'); | 100 | $entry6->setContent('This is my content /o/'); |
101 | $entry6->setArchived(true); | 101 | $entry6->updateArchived(true); |
102 | $entry6->setLanguage('de'); | 102 | $entry6->setLanguage('de'); |
103 | $entry6->addTag($this->getReference('bar-tag')); | 103 | $entry6->addTag($this->getReference('bar-tag')); |
104 | 104 | ||
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 | |||
@@ -87,6 +87,15 @@ class Entry | |||
87 | private $isArchived = false; | 87 | private $isArchived = false; |
88 | 88 | ||
89 | /** | 89 | /** |
90 | * @var \DateTime | ||
91 | * | ||
92 | * @ORM\Column(name="archived_at", type="datetime", nullable=true) | ||
93 | * | ||
94 | * @Groups({"entries_for_user", "export_all"}) | ||
95 | */ | ||
96 | private $archivedAt = null; | ||
97 | |||
98 | /** | ||
90 | * @var bool | 99 | * @var bool |
91 | * | 100 | * |
92 | * @Exclude | 101 | * @Exclude |
@@ -336,6 +345,44 @@ class Entry | |||
336 | } | 345 | } |
337 | 346 | ||
338 | /** | 347 | /** |
348 | * update isArchived and archive_at fields. | ||
349 | * | ||
350 | * @param bool $isArchived | ||
351 | * | ||
352 | * @return Entry | ||
353 | */ | ||
354 | public function updateArchived($isArchived = false) | ||
355 | { | ||
356 | $this->setArchived($isArchived); | ||
357 | $this->setArchivedAt(null); | ||
358 | if ($this->isArchived()) { | ||
359 | $this->setArchivedAt(new \DateTime()); | ||
360 | } | ||
361 | |||
362 | return $this; | ||
363 | } | ||
364 | |||
365 | /** | ||
366 | * @return \DateTime|null | ||
367 | */ | ||
368 | public function getArchivedAt() | ||
369 | { | ||
370 | return $this->archivedAt; | ||
371 | } | ||
372 | |||
373 | /** | ||
374 | * @param \DateTime|null $archivedAt | ||
375 | * | ||
376 | * @return Entry | ||
377 | */ | ||
378 | public function setArchivedAt($archivedAt = null) | ||
379 | { | ||
380 | $this->archivedAt = $archivedAt; | ||
381 | |||
382 | return $this; | ||
383 | } | ||
384 | |||
385 | /** | ||
339 | * Get isArchived. | 386 | * Get isArchived. |
340 | * | 387 | * |
341 | * @return bool | 388 | * @return bool |
@@ -357,7 +404,7 @@ class Entry | |||
357 | 404 | ||
358 | public function toggleArchive() | 405 | public function toggleArchive() |
359 | { | 406 | { |
360 | $this->isArchived = $this->isArchived() ^ 1; | 407 | $this->updateArchived($this->isArchived() ^ 1); |
361 | 408 | ||
362 | return $this; | 409 | return $this; |
363 | } | 410 | } |
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; | |||
6 | use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; | 6 | use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; |
7 | 7 | ||
8 | /** | 8 | /** |
9 | * Stores the locale of the user in the session after the | 9 | * Stores the locale of the user in the session after the login. |
10 | * login. This can be used by the LocaleListener afterwards. | 10 | * If no locale are defined (if user doesn't change it from the login screen), override it with the user's config one. |
11 | * | ||
12 | * This can be used by the LocaleListener afterwards. | ||
11 | * | 13 | * |
12 | * @see http://symfony.com/doc/master/cookbook/session/locale_sticky_session.html | 14 | * @see http://symfony.com/doc/master/cookbook/session/locale_sticky_session.html |
13 | */ | 15 | */ |
@@ -30,7 +32,7 @@ class UserLocaleListener | |||
30 | { | 32 | { |
31 | $user = $event->getAuthenticationToken()->getUser(); | 33 | $user = $event->getAuthenticationToken()->getUser(); |
32 | 34 | ||
33 | if (null !== $user->getConfig()->getLanguage()) { | 35 | if (null !== $user->getConfig()->getLanguage() && null === $this->session->get('_locale')) { |
34 | $this->session->set('_locale', $user->getConfig()->getLanguage()); | 36 | $this->session->set('_locale', $user->getConfig()->getLanguage()); |
35 | } | 37 | } |
36 | } | 38 | } |
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 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\CoreBundle\Form\Type; | ||
4 | |||
5 | use Symfony\Component\Form\AbstractType; | ||
6 | use Symfony\Component\Form\Extension\Core\Type\TextType; | ||
7 | use Symfony\Component\Form\FormBuilderInterface; | ||
8 | use Symfony\Component\OptionsResolver\OptionsResolver; | ||
9 | |||
10 | class RenameTagType extends AbstractType | ||
11 | { | ||
12 | public function buildForm(FormBuilderInterface $builder, array $options) | ||
13 | { | ||
14 | $builder | ||
15 | ->add('label', TextType::class, [ | ||
16 | 'required' => true, | ||
17 | 'attr' => [ | ||
18 | 'placeholder' => 'tag.rename.placeholder', | ||
19 | ], | ||
20 | ]) | ||
21 | ; | ||
22 | } | ||
23 | |||
24 | public function configureOptions(OptionsResolver $resolver) | ||
25 | { | ||
26 | $resolver->setDefaults([ | ||
27 | 'data_class' => 'Wallabag\CoreBundle\Entity\Tag', | ||
28 | ]); | ||
29 | } | ||
30 | |||
31 | public function getBlockPrefix() | ||
32 | { | ||
33 | return 'tag'; | ||
34 | } | ||
35 | } | ||
diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 83379998..93c630c0 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php | |||
@@ -50,7 +50,7 @@ class EntryRepository extends EntityRepository | |||
50 | public function getBuilderForArchiveByUser($userId) | 50 | public function getBuilderForArchiveByUser($userId) |
51 | { | 51 | { |
52 | return $this | 52 | return $this |
53 | ->getSortedQueryBuilderByUser($userId) | 53 | ->getSortedQueryBuilderByUser($userId, 'archivedAt', 'desc') |
54 | ->andWhere('e.isArchived = true') | 54 | ->andWhere('e.isArchived = true') |
55 | ; | 55 | ; |
56 | } | 56 | } |
@@ -189,6 +189,8 @@ class EntryRepository extends EntityRepository | |||
189 | $qb->orderBy('e.id', $order); | 189 | $qb->orderBy('e.id', $order); |
190 | } elseif ('updated' === $sort) { | 190 | } elseif ('updated' === $sort) { |
191 | $qb->orderBy('e.updatedAt', $order); | 191 | $qb->orderBy('e.updatedAt', $order); |
192 | } elseif ('archived' === $sort) { | ||
193 | $qb->orderBy('e.archivedAt', $order); | ||
192 | } | 194 | } |
193 | 195 | ||
194 | $pagerAdapter = new DoctrineORMAdapter($qb, true, false); | 196 | $pagerAdapter = new DoctrineORMAdapter($qb, true, false); |
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: | |||
181 | 181 | ||
182 | wallabag_core.exception_controller: | 182 | wallabag_core.exception_controller: |
183 | class: Wallabag\CoreBundle\Controller\ExceptionController | 183 | class: Wallabag\CoreBundle\Controller\ExceptionController |
184 | public: true | ||
184 | arguments: | 185 | arguments: |
185 | - '@twig' | 186 | - '@twig' |
186 | - '%kernel.debug%' | 187 | - '%kernel.debug%' |
@@ -218,3 +219,31 @@ services: | |||
218 | arguments: | 219 | arguments: |
219 | - "%wallabag_core.site_credentials.encryption_key_path%" | 220 | - "%wallabag_core.site_credentials.encryption_key_path%" |
220 | - "@logger" | 221 | - "@logger" |
222 | |||
223 | wallabag_core.command.clean_duplicates: | ||
224 | class: Wallabag\CoreBundle\Command\CleanDuplicatesCommand | ||
225 | tags: ['console.command'] | ||
226 | |||
227 | wallabag_core.command.export: | ||
228 | class: Wallabag\CoreBundle\Command\ExportCommand | ||
229 | tags: ['console.command'] | ||
230 | |||
231 | wallabag_core.command.install: | ||
232 | class: Wallabag\CoreBundle\Command\InstallCommand | ||
233 | tags: ['console.command'] | ||
234 | |||
235 | wallabag_core.command.list_user: | ||
236 | class: Wallabag\CoreBundle\Command\ListUserCommand | ||
237 | tags: ['console.command'] | ||
238 | |||
239 | wallabag_core.command.reload_entry: | ||
240 | class: Wallabag\CoreBundle\Command\ReloadEntryCommand | ||
241 | tags: ['console.command'] | ||
242 | |||
243 | wallabag_core.command.show_user: | ||
244 | class: Wallabag\CoreBundle\Command\ShowUserCommand | ||
245 | tags: ['console.command'] | ||
246 | |||
247 | wallabag_core.command.tag_all: | ||
248 | class: Wallabag\CoreBundle\Command\TagAllCommand | ||
249 | tags: ['console.command'] | ||
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index e3ff21f1..c6a1ff05 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml | |||
@@ -399,6 +399,8 @@ tag: | |||
399 | new: | 399 | new: |
400 | # add: 'Add' | 400 | # add: 'Add' |
401 | # placeholder: 'You can add several tags, separated by a comma.' | 401 | # placeholder: 'You can add several tags, separated by a comma.' |
402 | rename: | ||
403 | # placeholder: 'You can update tag name.' | ||
402 | 404 | ||
403 | # export: | 405 | # export: |
404 | # footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>' | 406 | # footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>' |
@@ -585,6 +587,7 @@ flashes: | |||
585 | tag: | 587 | tag: |
586 | notice: | 588 | notice: |
587 | # tag_added: 'Tag added' | 589 | # tag_added: 'Tag added' |
590 | # tag_renamed: 'Tag renamed' | ||
588 | import: | 591 | import: |
589 | notice: | 592 | notice: |
590 | # failed: 'Import failed, please try again.' | 593 | # 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: | |||
399 | new: | 399 | new: |
400 | add: 'Hinzufügen' | 400 | add: 'Hinzufügen' |
401 | placeholder: 'Du kannst verschiedene Tags, getrennt von einem Komma, hinzufügen.' | 401 | placeholder: 'Du kannst verschiedene Tags, getrennt von einem Komma, hinzufügen.' |
402 | rename: | ||
403 | # placeholder: 'You can update tag name.' | ||
402 | 404 | ||
403 | export: | 405 | export: |
404 | footer_template: '<div style="text-align:center;"><p>Generiert von wallabag mit Hilfe von %method%</p><p>Bitte öffne <a href="https://github.com/wallabag/wallabag/issues">ein Ticket</a> wenn du ein Problem mit der Darstellung von diesem E-Book auf deinem Gerät hast.</p></div>' | 406 | footer_template: '<div style="text-align:center;"><p>Generiert von wallabag mit Hilfe von %method%</p><p>Bitte öffne <a href="https://github.com/wallabag/wallabag/issues">ein Ticket</a> wenn du ein Problem mit der Darstellung von diesem E-Book auf deinem Gerät hast.</p></div>' |
@@ -585,6 +587,7 @@ flashes: | |||
585 | tag: | 587 | tag: |
586 | notice: | 588 | notice: |
587 | tag_added: 'Tag hinzugefügt' | 589 | tag_added: 'Tag hinzugefügt' |
590 | #tag_renamed: 'Tag renamed' | ||
588 | import: | 591 | import: |
589 | notice: | 592 | notice: |
590 | failed: 'Import fehlgeschlagen, bitte erneut probieren.' | 593 | 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 169ae728..e13987ae 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml | |||
@@ -399,6 +399,8 @@ tag: | |||
399 | new: | 399 | new: |
400 | add: 'Add' | 400 | add: 'Add' |
401 | placeholder: 'You can add several tags, separated by a comma.' | 401 | placeholder: 'You can add several tags, separated by a comma.' |
402 | rename: | ||
403 | placeholder: 'You can update tag name.' | ||
402 | 404 | ||
403 | export: | 405 | export: |
404 | footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>' | 406 | footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>' |
@@ -585,6 +587,7 @@ flashes: | |||
585 | tag: | 587 | tag: |
586 | notice: | 588 | notice: |
587 | tag_added: 'Tag added' | 589 | tag_added: 'Tag added' |
590 | tag_renamed: 'Tag renamed' | ||
588 | import: | 591 | import: |
589 | notice: | 592 | notice: |
590 | failed: 'Import failed, please try again.' | 593 | 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 039a1867..ef4b278a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml | |||
@@ -399,6 +399,8 @@ tag: | |||
399 | new: | 399 | new: |
400 | add: 'Añadir' | 400 | add: 'Añadir' |
401 | placeholder: 'Puedes añadir varias etiquetas, separadas por una coma.' | 401 | placeholder: 'Puedes añadir varias etiquetas, separadas por una coma.' |
402 | rename: | ||
403 | # placeholder: 'You can update tag name.' | ||
402 | 404 | ||
403 | # export: | 405 | # export: |
404 | # footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>' | 406 | # footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>' |
@@ -585,6 +587,7 @@ flashes: | |||
585 | tag: | 587 | tag: |
586 | notice: | 588 | notice: |
587 | tag_added: 'Etiqueta añadida' | 589 | tag_added: 'Etiqueta añadida' |
590 | # tag_renamed: 'Tag renamed' | ||
588 | import: | 591 | import: |
589 | notice: | 592 | notice: |
590 | failed: 'Importación fallida, por favor, inténtelo de nuevo.' | 593 | 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 b3f2eb58..a13b6668 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml | |||
@@ -399,6 +399,8 @@ tag: | |||
399 | new: | 399 | new: |
400 | # add: 'Add' | 400 | # add: 'Add' |
401 | # placeholder: 'You can add several tags, separated by a comma.' | 401 | # placeholder: 'You can add several tags, separated by a comma.' |
402 | rename: | ||
403 | # placeholder: 'You can update tag name.' | ||
402 | 404 | ||
403 | # export: | 405 | # export: |
404 | # footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>' | 406 | # footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>' |
@@ -585,6 +587,7 @@ flashes: | |||
585 | tag: | 587 | tag: |
586 | notice: | 588 | notice: |
587 | tag_added: 'برچسب افزوده شد' | 589 | tag_added: 'برچسب افزوده شد' |
590 | # tag_renamed: 'Tag renamed' | ||
588 | import: | 591 | import: |
589 | notice: | 592 | notice: |
590 | failed: 'درونریزی شکست خورد. لطفاً دوباره تلاش کنید.' | 593 | failed: 'درونریزی شکست خورد. لطفاً دوباره تلاش کنید.' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 5cdd836e..2d4d0acd 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml | |||
@@ -399,6 +399,8 @@ tag: | |||
399 | new: | 399 | new: |
400 | add: "Ajouter" | 400 | add: "Ajouter" |
401 | placeholder: "Vous pouvez ajouter plusieurs tags, séparés par une virgule." | 401 | placeholder: "Vous pouvez ajouter plusieurs tags, séparés par une virgule." |
402 | rename: | ||
403 | placeholder: 'Vous pouvez changer le nom de votre tag.' | ||
402 | 404 | ||
403 | export: | 405 | export: |
404 | footer_template: '<div style="text-align:center;"><p>Généré par wallabag with %method%</p><p>Merci d''ouvrir <a href="https://github.com/wallabag/wallabag/issues">un ticket</a> si vous rencontrez des soucis d''affichage avec ce document sur votre support.</p></div>' | 406 | footer_template: '<div style="text-align:center;"><p>Généré par wallabag with %method%</p><p>Merci d''ouvrir <a href="https://github.com/wallabag/wallabag/issues">un ticket</a> si vous rencontrez des soucis d''affichage avec ce document sur votre support.</p></div>' |
@@ -585,6 +587,7 @@ flashes: | |||
585 | tag: | 587 | tag: |
586 | notice: | 588 | notice: |
587 | tag_added: "Tag ajouté" | 589 | tag_added: "Tag ajouté" |
590 | tag_renamed: "Tag renommé" | ||
588 | import: | 591 | import: |
589 | notice: | 592 | notice: |
590 | failed: "L’import a échoué, veuillez ré-essayer" | 593 | 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 83b3edcd..e854c323 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml | |||
@@ -399,6 +399,8 @@ tag: | |||
399 | new: | 399 | new: |
400 | add: 'Aggiungi' | 400 | add: 'Aggiungi' |
401 | placeholder: 'Puoi aggiungere varie etichette, separate da una virgola.' | 401 | placeholder: 'Puoi aggiungere varie etichette, separate da una virgola.' |
402 | rename: | ||
403 | # placeholder: 'You can update tag name.' | ||
402 | 404 | ||
403 | # export: | 405 | # export: |
404 | # footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>' | 406 | # footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>' |
@@ -585,6 +587,7 @@ flashes: | |||
585 | tag: | 587 | tag: |
586 | notice: | 588 | notice: |
587 | tag_added: 'Etichetta aggiunta' | 589 | tag_added: 'Etichetta aggiunta' |
590 | # tag_renamed: 'Tag renamed' | ||
588 | import: | 591 | import: |
589 | notice: | 592 | notice: |
590 | failed: 'Importazione fallita, riprova.' | 593 | 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: | |||
399 | new: | 399 | new: |
400 | add: 'Ajustar' | 400 | add: 'Ajustar' |
401 | placeholder: "Podètz ajustar mai qu'una etiqueta, separadas per de virgula." | 401 | placeholder: "Podètz ajustar mai qu'una etiqueta, separadas per de virgula." |
402 | rename: | ||
403 | # placeholder: 'You can update tag name.' | ||
402 | 404 | ||
403 | export: | 405 | export: |
404 | footer_template: '<div style="text-align:center;"><p>Produch per wallabag amb %method%</p><p>Mercés de dobrir <a href="https://github.com/wallabag/wallabag/issues">una sollicitacion</a> s’avètz de problèmas amb l’afichatge d’aqueste E-Book sus vòstre periferic.</p></div>' | 406 | footer_template: '<div style="text-align:center;"><p>Produch per wallabag amb %method%</p><p>Mercés de dobrir <a href="https://github.com/wallabag/wallabag/issues">una sollicitacion</a> s’avètz de problèmas amb l’afichatge d’aqueste E-Book sus vòstre periferic.</p></div>' |
@@ -585,6 +587,7 @@ flashes: | |||
585 | tag: | 587 | tag: |
586 | notice: | 588 | notice: |
587 | tag_added: 'Etiqueta ajustada' | 589 | tag_added: 'Etiqueta ajustada' |
590 | # tag_renamed: 'Tag renamed' | ||
588 | import: | 591 | import: |
589 | notice: | 592 | notice: |
590 | failed: "L'importacion a fracassat, mercés de tornar ensajar." | 593 | 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: | |||
399 | new: | 399 | new: |
400 | add: 'Dodaj' | 400 | add: 'Dodaj' |
401 | placeholder: 'Możesz dodać kilka tagów, oddzielając je przecinkami.' | 401 | placeholder: 'Możesz dodać kilka tagów, oddzielając je przecinkami.' |
402 | rename: | ||
403 | # placeholder: 'You can update tag name.' | ||
402 | 404 | ||
403 | export: | 405 | export: |
404 | footer_template: '<div style="text-align:center;"><p>Stworzone przez wallabag z %method%</p><p>Proszę zgłoś <a href="https://github.com/wallabag/wallabag/issues">sprawę</a>, jeżeli masz problem z wyświetleniem tego e-booka na swoim urządzeniu.</p></div>' | 406 | footer_template: '<div style="text-align:center;"><p>Stworzone przez wallabag z %method%</p><p>Proszę zgłoś <a href="https://github.com/wallabag/wallabag/issues">sprawę</a>, jeżeli masz problem z wyświetleniem tego e-booka na swoim urządzeniu.</p></div>' |
@@ -585,6 +587,7 @@ flashes: | |||
585 | tag: | 587 | tag: |
586 | notice: | 588 | notice: |
587 | tag_added: 'Tag dodany' | 589 | tag_added: 'Tag dodany' |
590 | # tag_renamed: 'Tag renamed' | ||
588 | import: | 591 | import: |
589 | notice: | 592 | notice: |
590 | failed: 'Nieudany import, prosimy spróbować ponownie.' | 593 | 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 58d2d058..db5830d2 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml | |||
@@ -399,6 +399,8 @@ tag: | |||
399 | new: | 399 | new: |
400 | # add: 'Add' | 400 | # add: 'Add' |
401 | # placeholder: 'You can add several tags, separated by a comma.' | 401 | # placeholder: 'You can add several tags, separated by a comma.' |
402 | rename: | ||
403 | # placeholder: 'You can update tag name.' | ||
402 | 404 | ||
403 | # export: | 405 | # export: |
404 | # footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>' | 406 | # footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>' |
@@ -585,6 +587,7 @@ flashes: | |||
585 | tag: | 587 | tag: |
586 | notice: | 588 | notice: |
587 | tag_added: 'Tag adicionada' | 589 | tag_added: 'Tag adicionada' |
590 | # tag_renamed: 'Tag renamed' | ||
588 | import: | 591 | import: |
589 | notice: | 592 | notice: |
590 | failed: 'Importação falhou, por favor tente novamente.' | 593 | 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 564fed94..e7daf880 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml | |||
@@ -399,6 +399,8 @@ tag: | |||
399 | new: | 399 | new: |
400 | # add: 'Add' | 400 | # add: 'Add' |
401 | # placeholder: 'You can add several tags, separated by a comma.' | 401 | # placeholder: 'You can add several tags, separated by a comma.' |
402 | rename: | ||
403 | # placeholder: 'You can update tag name.' | ||
402 | 404 | ||
403 | # export: | 405 | # export: |
404 | # footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>' | 406 | # footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>' |
@@ -585,6 +587,7 @@ flashes: | |||
585 | tag: | 587 | tag: |
586 | notice: | 588 | notice: |
587 | # tag_added: 'Tag added' | 589 | # tag_added: 'Tag added' |
590 | # tag_renamed: 'Tag renamed' | ||
588 | import: | 591 | import: |
589 | notice: | 592 | notice: |
590 | # failed: 'Import failed, please try again.' | 593 | # 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: | |||
387 | new: | 387 | new: |
388 | add: 'Добавить' | 388 | add: 'Добавить' |
389 | placeholder: 'Вы можете добавить несколько тегов, разделенных запятой.' | 389 | placeholder: 'Вы можете добавить несколько тегов, разделенных запятой.' |
390 | rename: | ||
391 | # placeholder: 'You can update tag name.' | ||
390 | 392 | ||
391 | import: | 393 | import: |
392 | page_title: 'Импорт' | 394 | page_title: 'Импорт' |
@@ -547,6 +549,7 @@ flashes: | |||
547 | tag: | 549 | tag: |
548 | notice: | 550 | notice: |
549 | tag_added: 'Тег добавлен' | 551 | tag_added: 'Тег добавлен' |
552 | # tag_renamed: 'Tag renamed' | ||
550 | import: | 553 | import: |
551 | notice: | 554 | notice: |
552 | failed: 'Во время импорта произошла ошибка, повторите попытку.' | 555 | failed: 'Во время импорта произошла ошибка, повторите попытку.' |
@@ -564,4 +567,4 @@ flashes: | |||
564 | notice: | 567 | notice: |
565 | added: 'Пользователь "%username%" добавлен' | 568 | added: 'Пользователь "%username%" добавлен' |
566 | updated: 'Пользователь "%username%" обновлен' | 569 | updated: 'Пользователь "%username%" обновлен' |
567 | deleted: 'Пользователь "%username%" удален' \ No newline at end of file | 570 | 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: | |||
397 | new: | 397 | new: |
398 | add: 'เพิ่ม' | 398 | add: 'เพิ่ม' |
399 | placeholder: 'คุณสามารถเพิ่มได้หลายแท็ก, จากการแบ่งโดย comma' | 399 | placeholder: 'คุณสามารถเพิ่มได้หลายแท็ก, จากการแบ่งโดย comma' |
400 | rename: | ||
401 | # placeholder: 'You can update tag name.' | ||
400 | 402 | ||
401 | export: | 403 | export: |
402 | footer_template: '<div style="text-align:center;"><p>ผลิตโดย wallabag กับ %method%</p><p>ให้ทำการเปิด <a href="https://github.com/wallabag/wallabag/issues">ฉบับนี้</a> ถ้าคุณมีข้อบกพร่องif you have trouble with the display of this E-Book on your device.</p></div>' | 404 | footer_template: '<div style="text-align:center;"><p>ผลิตโดย wallabag กับ %method%</p><p>ให้ทำการเปิด <a href="https://github.com/wallabag/wallabag/issues">ฉบับนี้</a> ถ้าคุณมีข้อบกพร่องif you have trouble with the display of this E-Book on your device.</p></div>' |
@@ -583,6 +585,7 @@ flashes: | |||
583 | tag: | 585 | tag: |
584 | notice: | 586 | notice: |
585 | tag_added: 'แท็กที่เพิ่ม' | 587 | tag_added: 'แท็กที่เพิ่ม' |
588 | # tag_renamed: 'Tag renamed' | ||
586 | import: | 589 | import: |
587 | notice: | 590 | notice: |
588 | failed: 'นำข้อมูลเข้าล้มเหลว, ลองใหม่อีกครั้ง' | 591 | failed: 'นำข้อมูลเข้าล้มเหลว, ลองใหม่อีกครั้ง' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index 4c71f0b9..edb1ce7c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml | |||
@@ -397,6 +397,8 @@ tag: | |||
397 | new: | 397 | new: |
398 | # add: 'Add' | 398 | # add: 'Add' |
399 | # placeholder: 'You can add several tags, separated by a comma.' | 399 | # placeholder: 'You can add several tags, separated by a comma.' |
400 | rename: | ||
401 | # placeholder: 'You can update tag name.' | ||
400 | 402 | ||
401 | # export: | 403 | # export: |
402 | # footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>' | 404 | # footer_template: '<div style="text-align:center;"><p>Produced by wallabag with %method%</p><p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p></div>' |
@@ -563,6 +565,7 @@ flashes: | |||
563 | tag: | 565 | tag: |
564 | notice: | 566 | notice: |
565 | tag_added: 'Etiket eklendi' | 567 | tag_added: 'Etiket eklendi' |
568 | # tag_renamed: 'Tag renamed' | ||
566 | import: | 569 | import: |
567 | notice: | 570 | notice: |
568 | # failed: 'Import failed, please try again.' | 571 | # failed: 'Import failed, please try again.' |
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 @@ | |||
10 | <ul> | 10 | <ul> |
11 | {% for tag in tags %} | 11 | {% for tag in tags %} |
12 | <li id="tag-{{ tag.id|e }}"> | 12 | <li id="tag-{{ tag.id|e }}"> |
13 | <a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{tag.label}} ({{ tag.nbEntries }})</a> | 13 | <a href="{{ path('tag_entries', {'slug': tag.slug}) }}" data-handle="tag-link">{{ tag.label }} ({{ tag.nbEntries }})</a> |
14 | <a rel="alternate" type="application/rss+xml" href="{{ path('tag_rss', {'username': app.user.username, 'token': app.user.config.rssToken, 'slug': tag.slug}) }}" class="right"> | 14 | |
15 | <i class="material-icons md-24">rss_feed</i> | 15 | {% if renameForms is defined and renameForms[tag.id] is defined %} |
16 | <form class="card-tag-form hidden" data-handle="tag-rename-form" action="{{ path('tag_rename', {'slug': tag.slug})}}" method="POST"> | ||
17 | {{ form_widget(renameForms[tag.id].label, {'attr': {'value': tag.label}}) }} | ||
18 | {{ form_rest(renameForms[tag.id]) }} | ||
19 | </form> | ||
20 | <a class="card-tag-rename" data-handler="tag-rename" href="javascript:void(0);"> | ||
21 | <i class="material-icons">mode_edit</i> | ||
16 | </a> | 22 | </a> |
23 | {% endif %} | ||
24 | {% if app.user.config.rssToken %} | ||
25 | <a rel="alternate" type="application/rss+xml" href="{{ path('tag_rss', {'username': app.user.username, 'token': app.user.config.rssToken, 'slug': tag.slug}) }}" class="right"> | ||
26 | <i class="material-icons md-24">rss_feed</i> | ||
27 | </a> | ||
28 | {% endif %} | ||
17 | </li> | 29 | </li> |
18 | {% endfor %} | 30 | {% endfor %} |
19 | </ul> | 31 | </ul> |
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 @@ | |||
13 | <ul class="card-tag-labels"> | 13 | <ul class="card-tag-labels"> |
14 | {% for tag in tags %} | 14 | {% for tag in tags %} |
15 | <li title="{{tag.label}} ({{ tag.nbEntries }})" id="tag-{{ tag.id }}"> | 15 | <li title="{{tag.label}} ({{ tag.nbEntries }})" id="tag-{{ tag.id }}"> |
16 | <a href="{{ path('tag_entries', {'slug': tag.slug}) }}" class="card-tag-link">{{tag.label}} ({{ tag.nbEntries }})</a> | 16 | <a href="{{ path('tag_entries', {'slug': tag.slug}) }}" class="card-tag-link" data-handle="tag-link"> |
17 | {{ tag.label }} ({{ tag.nbEntries }}) | ||
18 | </a> | ||
19 | {% if renameForms is defined and renameForms[tag.id] is defined %} | ||
20 | <form class="card-tag-form hidden" data-handle="tag-rename-form" action="{{ path('tag_rename', {'slug': tag.slug})}}" method="POST"> | ||
21 | {{ form_widget(renameForms[tag.id].label, {'attr': {'value': tag.label}}) }} | ||
22 | {{ form_rest(renameForms[tag.id]) }} | ||
23 | </form> | ||
24 | <a class="card-tag-rename" data-handler="tag-rename" href="javascript:void(0);"> | ||
25 | <i class="material-icons">mode_edit</i> | ||
26 | </a> | ||
27 | {% endif %} | ||
17 | {% if app.user.config.rssToken %} | 28 | {% if app.user.config.rssToken %} |
18 | <a rel="alternate" type="application/rss+xml" href="{{ path('tag_rss', {'username': app.user.username, 'token': app.user.config.rssToken, 'slug': tag.slug}) }}" class="card-tag-rss"><i class="material-icons">rss_feed</i></a> | 29 | <a rel="alternate" type="application/rss+xml" href="{{ path('tag_rss', {'username': app.user.username, 'token': app.user.config.rssToken, 'slug': tag.slug}) }}" class="card-tag-rss"><i class="material-icons">rss_feed</i></a> |
19 | {% endif %} | 30 | {% endif %} |
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 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\ImportBundle\Controller; | 3 | namespace Wallabag\ImportBundle\Controller; |
4 | 4 | ||
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | 5 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
7 | use Symfony\Component\HttpFoundation\Request; | 6 | use Symfony\Component\HttpFoundation\Request; |
8 | use Symfony\Component\HttpFoundation\Response; | 7 | use Symfony\Component\HttpFoundation\Response; |
8 | use Symfony\Component\Routing\Annotation\Route; | ||
9 | use Wallabag\ImportBundle\Form\Type\UploadImportType; | 9 | use Wallabag\ImportBundle\Form\Type\UploadImportType; |
10 | 10 | ||
11 | abstract class BrowserController extends Controller | 11 | 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 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\ImportBundle\Controller; | 3 | namespace Wallabag\ImportBundle\Controller; |
4 | 4 | ||
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
6 | use Symfony\Component\HttpFoundation\Request; | 5 | use Symfony\Component\HttpFoundation\Request; |
6 | use Symfony\Component\Routing\Annotation\Route; | ||
7 | 7 | ||
8 | class ChromeController extends BrowserController | 8 | class ChromeController extends BrowserController |
9 | { | 9 | { |
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 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\ImportBundle\Controller; | 3 | namespace Wallabag\ImportBundle\Controller; |
4 | 4 | ||
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
6 | use Symfony\Component\HttpFoundation\Request; | 5 | use Symfony\Component\HttpFoundation\Request; |
6 | use Symfony\Component\Routing\Annotation\Route; | ||
7 | 7 | ||
8 | class FirefoxController extends BrowserController | 8 | class FirefoxController extends BrowserController |
9 | { | 9 | { |
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 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\ImportBundle\Controller; | 3 | namespace Wallabag\ImportBundle\Controller; |
4 | 4 | ||
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | 5 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
6 | use Symfony\Component\Routing\Annotation\Route; | ||
7 | 7 | ||
8 | class ImportController extends Controller | 8 | class ImportController extends Controller |
9 | { | 9 | { |
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 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\ImportBundle\Controller; | 3 | namespace Wallabag\ImportBundle\Controller; |
4 | 4 | ||
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | 5 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
7 | use Symfony\Component\HttpFoundation\Request; | 6 | use Symfony\Component\HttpFoundation\Request; |
7 | use Symfony\Component\Routing\Annotation\Route; | ||
8 | use Wallabag\ImportBundle\Form\Type\UploadImportType; | 8 | use Wallabag\ImportBundle\Form\Type\UploadImportType; |
9 | 9 | ||
10 | class InstapaperController extends Controller | 10 | 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 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\ImportBundle\Controller; | 3 | namespace Wallabag\ImportBundle\Controller; |
4 | 4 | ||
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | 5 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
7 | use Symfony\Component\HttpFoundation\Request; | 6 | use Symfony\Component\HttpFoundation\Request; |
7 | use Symfony\Component\Routing\Annotation\Route; | ||
8 | use Wallabag\ImportBundle\Form\Type\UploadImportType; | 8 | use Wallabag\ImportBundle\Form\Type\UploadImportType; |
9 | 9 | ||
10 | class PinboardController extends Controller | 10 | 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 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\ImportBundle\Controller; | 3 | namespace Wallabag\ImportBundle\Controller; |
4 | 4 | ||
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | 5 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
7 | use Symfony\Component\Form\Extension\Core\Type\CheckboxType; | 6 | use Symfony\Component\Form\Extension\Core\Type\CheckboxType; |
8 | use Symfony\Component\HttpFoundation\Request; | 7 | use Symfony\Component\HttpFoundation\Request; |
8 | use Symfony\Component\Routing\Annotation\Route; | ||
9 | use Symfony\Component\Routing\Generator\UrlGeneratorInterface; | 9 | use Symfony\Component\Routing\Generator\UrlGeneratorInterface; |
10 | 10 | ||
11 | class PocketController extends Controller | 11 | 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 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\ImportBundle\Controller; | 3 | namespace Wallabag\ImportBundle\Controller; |
4 | 4 | ||
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | 5 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
7 | use Symfony\Component\HttpFoundation\Request; | 6 | use Symfony\Component\HttpFoundation\Request; |
7 | use Symfony\Component\Routing\Annotation\Route; | ||
8 | use Wallabag\ImportBundle\Form\Type\UploadImportType; | 8 | use Wallabag\ImportBundle\Form\Type\UploadImportType; |
9 | 9 | ||
10 | class ReadabilityController extends Controller | 10 | 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 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\ImportBundle\Controller; | 3 | namespace Wallabag\ImportBundle\Controller; |
4 | 4 | ||
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
6 | use Symfony\Component\HttpFoundation\Request; | 5 | use Symfony\Component\HttpFoundation\Request; |
6 | use Symfony\Component\Routing\Annotation\Route; | ||
7 | 7 | ||
8 | class WallabagV1Controller extends WallabagController | 8 | class WallabagV1Controller extends WallabagController |
9 | { | 9 | { |
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 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\ImportBundle\Controller; | 3 | namespace Wallabag\ImportBundle\Controller; |
4 | 4 | ||
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
6 | use Symfony\Component\HttpFoundation\Request; | 5 | use Symfony\Component\HttpFoundation\Request; |
6 | use Symfony\Component\Routing\Annotation\Route; | ||
7 | 7 | ||
8 | class WallabagV2Controller extends WallabagController | 8 | class WallabagV2Controller extends WallabagController |
9 | { | 9 | { |
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 | |||
133 | ); | 133 | ); |
134 | } | 134 | } |
135 | 135 | ||
136 | $entry->setArchived($data['is_archived']); | 136 | $entry->updateArchived($data['is_archived']); |
137 | 137 | ||
138 | if (!empty($data['created_at'])) { | 138 | if (!empty($data['created_at'])) { |
139 | $dt = new \DateTime(); | 139 | $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 | |||
135 | ); | 135 | ); |
136 | } | 136 | } |
137 | 137 | ||
138 | $entry->setArchived($importedEntry['is_archived']); | 138 | $entry->updateArchived($importedEntry['is_archived']); |
139 | $entry->setStarred($importedEntry['is_starred']); | 139 | $entry->setStarred($importedEntry['is_starred']); |
140 | 140 | ||
141 | $this->em->persist($entry); | 141 | $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 | |||
119 | ); | 119 | ); |
120 | } | 120 | } |
121 | 121 | ||
122 | $entry->setArchived($data['is_archived']); | 122 | $entry->updateArchived($data['is_archived']); |
123 | $entry->setStarred($data['is_starred']); | 123 | $entry->setStarred($data['is_starred']); |
124 | $entry->setCreatedAt(new \DateTime($data['created_at'])); | 124 | $entry->setCreatedAt(new \DateTime($data['created_at'])); |
125 | 125 | ||
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 | |||
194 | $this->fetchContent($entry, $url); | 194 | $this->fetchContent($entry, $url); |
195 | 195 | ||
196 | // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted | 196 | // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted |
197 | $entry->setArchived(1 === $importedEntry['status'] || $this->markAsRead); | 197 | $entry->updateArchived(1 === $importedEntry['status'] || $this->markAsRead); |
198 | 198 | ||
199 | // 0 or 1 - 1 If the item is starred | 199 | // 0 or 1 - 1 If the item is starred |
200 | $entry->setStarred(1 === $importedEntry['favorite']); | 200 | $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 | |||
111 | // update entry with content (in case fetching failed, the given entry will be return) | 111 | // update entry with content (in case fetching failed, the given entry will be return) |
112 | $this->fetchContent($entry, $data['url'], $data); | 112 | $this->fetchContent($entry, $data['url'], $data); |
113 | 113 | ||
114 | $entry->setArchived($data['is_archived']); | 114 | $entry->updateArchived($data['is_archived']); |
115 | $entry->setStarred($data['is_starred']); | 115 | $entry->setStarred($data['is_starred']); |
116 | $entry->setCreatedAt(new \DateTime($data['created_at'])); | 116 | $entry->setCreatedAt(new \DateTime($data['created_at'])); |
117 | 117 | ||
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 | |||
122 | $entry->setPreviewPicture($importedEntry['preview_picture']); | 122 | $entry->setPreviewPicture($importedEntry['preview_picture']); |
123 | } | 123 | } |
124 | 124 | ||
125 | $entry->setArchived($data['is_archived']); | 125 | $entry->updateArchived($data['is_archived']); |
126 | $entry->setStarred($data['is_starred']); | 126 | $entry->setStarred($data['is_starred']); |
127 | 127 | ||
128 | if (!empty($data['created_at'])) { | 128 | if (!empty($data['created_at'])) { |
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: | |||
112 | - [ setLogger, [ "@logger" ]] | 112 | - [ setLogger, [ "@logger" ]] |
113 | tags: | 113 | tags: |
114 | - { name: wallabag_import.import, alias: chrome } | 114 | - { name: wallabag_import.import, alias: chrome } |
115 | |||
116 | wallabag_import.command.import: | ||
117 | class: Wallabag\ImportBundle\Command\ImportCommand | ||
118 | tags: ['console.command'] | ||
119 | |||
120 | wallabag_import.command.redis_worker: | ||
121 | class: Wallabag\ImportBundle\Command\RedisWorkerCommand | ||
122 | 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; | |||
7 | use Pagerfanta\Adapter\DoctrineORMAdapter; | 7 | use Pagerfanta\Adapter\DoctrineORMAdapter; |
8 | use Pagerfanta\Exception\OutOfRangeCurrentPageException; | 8 | use Pagerfanta\Exception\OutOfRangeCurrentPageException; |
9 | use Pagerfanta\Pagerfanta; | 9 | use Pagerfanta\Pagerfanta; |
10 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; | ||
11 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
12 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | 10 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
13 | use Symfony\Component\HttpFoundation\Request; | 11 | use Symfony\Component\HttpFoundation\Request; |
12 | use Symfony\Component\Routing\Annotation\Route; | ||
14 | use Wallabag\UserBundle\Entity\User; | 13 | use Wallabag\UserBundle\Entity\User; |
15 | use Wallabag\UserBundle\Form\SearchUserType; | 14 | use Wallabag\UserBundle\Form\SearchUserType; |
16 | 15 | ||
@@ -22,8 +21,7 @@ class ManageController extends Controller | |||
22 | /** | 21 | /** |
23 | * Creates a new User entity. | 22 | * Creates a new User entity. |
24 | * | 23 | * |
25 | * @Route("/new", name="user_new") | 24 | * @Route("/new", name="user_new", methods={"GET", "POST"}) |
26 | * @Method({"GET", "POST"}) | ||
27 | */ | 25 | */ |
28 | public function newAction(Request $request) | 26 | public function newAction(Request $request) |
29 | { | 27 | { |
@@ -60,8 +58,7 @@ class ManageController extends Controller | |||
60 | /** | 58 | /** |
61 | * Displays a form to edit an existing User entity. | 59 | * Displays a form to edit an existing User entity. |
62 | * | 60 | * |
63 | * @Route("/{id}/edit", name="user_edit") | 61 | * @Route("/{id}/edit", name="user_edit", methods={"GET", "POST"}) |
64 | * @Method({"GET", "POST"}) | ||
65 | */ | 62 | */ |
66 | public function editAction(Request $request, User $user) | 63 | public function editAction(Request $request, User $user) |
67 | { | 64 | { |
@@ -93,8 +90,7 @@ class ManageController extends Controller | |||
93 | /** | 90 | /** |
94 | * Deletes a User entity. | 91 | * Deletes a User entity. |
95 | * | 92 | * |
96 | * @Route("/{id}", name="user_delete") | 93 | * @Route("/{id}", name="user_delete", methods={"DELETE"}) |
97 | * @Method("DELETE") | ||
98 | */ | 94 | */ |
99 | public function deleteAction(Request $request, User $user) | 95 | public function deleteAction(Request $request, User $user) |
100 | { | 96 | { |
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; | |||
6 | use FOS\UserBundle\Event\UserEvent; | 6 | use FOS\UserBundle\Event\UserEvent; |
7 | use FOS\UserBundle\FOSUserEvents; | 7 | use FOS\UserBundle\FOSUserEvents; |
8 | use Symfony\Component\EventDispatcher\EventSubscriberInterface; | 8 | use Symfony\Component\EventDispatcher\EventSubscriberInterface; |
9 | use Symfony\Component\HttpFoundation\Session\Session; | ||
9 | use Wallabag\CoreBundle\Entity\Config; | 10 | use Wallabag\CoreBundle\Entity\Config; |
10 | 11 | ||
11 | /** | 12 | /** |
@@ -22,8 +23,9 @@ class CreateConfigListener implements EventSubscriberInterface | |||
22 | private $readingSpeed; | 23 | private $readingSpeed; |
23 | private $actionMarkAsRead; | 24 | private $actionMarkAsRead; |
24 | private $listMode; | 25 | private $listMode; |
26 | private $session; | ||
25 | 27 | ||
26 | public function __construct(EntityManager $em, $theme, $itemsOnPage, $rssLimit, $language, $readingSpeed, $actionMarkAsRead, $listMode) | 28 | public function __construct(EntityManager $em, $theme, $itemsOnPage, $rssLimit, $language, $readingSpeed, $actionMarkAsRead, $listMode, Session $session) |
27 | { | 29 | { |
28 | $this->em = $em; | 30 | $this->em = $em; |
29 | $this->theme = $theme; | 31 | $this->theme = $theme; |
@@ -33,6 +35,7 @@ class CreateConfigListener implements EventSubscriberInterface | |||
33 | $this->readingSpeed = $readingSpeed; | 35 | $this->readingSpeed = $readingSpeed; |
34 | $this->actionMarkAsRead = $actionMarkAsRead; | 36 | $this->actionMarkAsRead = $actionMarkAsRead; |
35 | $this->listMode = $listMode; | 37 | $this->listMode = $listMode; |
38 | $this->session = $session; | ||
36 | } | 39 | } |
37 | 40 | ||
38 | public static function getSubscribedEvents() | 41 | public static function getSubscribedEvents() |
@@ -52,7 +55,7 @@ class CreateConfigListener implements EventSubscriberInterface | |||
52 | $config->setTheme($this->theme); | 55 | $config->setTheme($this->theme); |
53 | $config->setItemsPerPage($this->itemsOnPage); | 56 | $config->setItemsPerPage($this->itemsOnPage); |
54 | $config->setRssLimit($this->rssLimit); | 57 | $config->setRssLimit($this->rssLimit); |
55 | $config->setLanguage($this->language); | 58 | $config->setLanguage($this->session->get('_locale', $this->language)); |
56 | $config->setReadingSpeed($this->readingSpeed); | 59 | $config->setReadingSpeed($this->readingSpeed); |
57 | $config->setActionMarkAsRead($this->actionMarkAsRead); | 60 | $config->setActionMarkAsRead($this->actionMarkAsRead); |
58 | $config->setListMode($this->listMode); | 61 | $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: | |||
33 | - "%wallabag_core.reading_speed%" | 33 | - "%wallabag_core.reading_speed%" |
34 | - "%wallabag_core.action_mark_as_read%" | 34 | - "%wallabag_core.action_mark_as_read%" |
35 | - "%wallabag_core.list_mode%" | 35 | - "%wallabag_core.list_mode%" |
36 | - "@session" | ||
36 | tags: | 37 | tags: |
37 | - { name: kernel.event_subscriber } | 38 | - { name: kernel.event_subscriber } |
38 | 39 | ||
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 @@ | |||
3 | {{ form_start(form, {'method': 'post', 'action': path('fos_user_registration_register'), 'attr': {'class': 'fos_user_registration_register'}}) }} | 3 | {{ form_start(form, {'method': 'post', 'action': path('fos_user_registration_register'), 'attr': {'class': 'fos_user_registration_register'}}) }} |
4 | <div class="card-content"> | 4 | <div class="card-content"> |
5 | <div class="row"> | 5 | <div class="row"> |
6 | |||
7 | {{ form_widget(form._token) }} | 6 | {{ form_widget(form._token) }} |
8 | 7 | ||
9 | {% for flashMessage in app.session.flashbag.get('notice') %} | 8 | {% 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..b53f8746 100644 --- a/src/Wallabag/UserBundle/Resources/views/layout.html.twig +++ b/src/Wallabag/UserBundle/Resources/views/layout.html.twig | |||
@@ -15,6 +15,11 @@ | |||
15 | {% block fos_user_content %} | 15 | {% block fos_user_content %} |
16 | {% endblock fos_user_content %} | 16 | {% endblock fos_user_content %} |
17 | </div> | 17 | </div> |
18 | <div class="center"> | ||
19 | <a href="{{ path('changeLocale', {'language': 'de'}) }}">Deutsch</a> – | ||
20 | <a href="{{ path('changeLocale', {'language': 'en'}) }}">English</a> – | ||
21 | <a href="{{ path('changeLocale', {'language': 'fr'}) }}">Français</a> | ||
22 | </div> | ||
18 | </div> | 23 | </div> |
19 | </main> | 24 | </main> |
20 | {% endblock %} | 25 | {% endblock %} |