diff options
Diffstat (limited to 'src/Wallabag')
67 files changed, 423 insertions, 190 deletions
diff --git a/src/Wallabag/AnnotationBundle/DataFixtures/ORM/LoadAnnotationData.php b/src/Wallabag/AnnotationBundle/DataFixtures/AnnotationFixtures.php index 20e07fa3..ed46cea9 100644 --- a/src/Wallabag/AnnotationBundle/DataFixtures/ORM/LoadAnnotationData.php +++ b/src/Wallabag/AnnotationBundle/DataFixtures/AnnotationFixtures.php | |||
@@ -1,13 +1,15 @@ | |||
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace Wallabag\AnnotationBundle\DataFixtures\ORM; | 3 | namespace Wallabag\AnnotationBundle\DataFixtures; |
4 | 4 | ||
5 | use Doctrine\Common\DataFixtures\AbstractFixture; | 5 | use Doctrine\Bundle\FixturesBundle\Fixture; |
6 | use Doctrine\Common\DataFixtures\OrderedFixtureInterface; | 6 | use Doctrine\Common\DataFixtures\DependentFixtureInterface; |
7 | use Doctrine\Common\Persistence\ObjectManager; | 7 | use Doctrine\Common\Persistence\ObjectManager; |
8 | use Wallabag\AnnotationBundle\Entity\Annotation; | 8 | use Wallabag\AnnotationBundle\Entity\Annotation; |
9 | use Wallabag\CoreBundle\DataFixtures\EntryFixtures; | ||
10 | use Wallabag\UserBundle\DataFixtures\UserFixtures; | ||
9 | 11 | ||
10 | class LoadAnnotationData extends AbstractFixture implements OrderedFixtureInterface | 12 | class AnnotationFixtures extends Fixture implements DependentFixtureInterface |
11 | { | 13 | { |
12 | /** | 14 | /** |
13 | * {@inheritdoc} | 15 | * {@inheritdoc} |
@@ -38,8 +40,11 @@ class LoadAnnotationData extends AbstractFixture implements OrderedFixtureInterf | |||
38 | /** | 40 | /** |
39 | * {@inheritdoc} | 41 | * {@inheritdoc} |
40 | */ | 42 | */ |
41 | public function getOrder() | 43 | public function getDependencies() |
42 | { | 44 | { |
43 | return 35; | 45 | return [ |
46 | EntryFixtures::class, | ||
47 | UserFixtures::class, | ||
48 | ]; | ||
44 | } | 49 | } |
45 | } | 50 | } |
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 b2bad406..f792aaf2 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php | |||
@@ -80,7 +80,7 @@ class EntryRestController extends WallabagRestController | |||
80 | * parameters={ | 80 | * parameters={ |
81 | * {"name"="archive", "dataType"="integer", "required"=false, "format"="1 or 0, all entries by default", "description"="filter by archived status."}, | 81 | * {"name"="archive", "dataType"="integer", "required"=false, "format"="1 or 0, all entries by default", "description"="filter by archived status."}, |
82 | * {"name"="starred", "dataType"="integer", "required"=false, "format"="1 or 0, all entries by default", "description"="filter by starred status."}, | 82 | * {"name"="starred", "dataType"="integer", "required"=false, "format"="1 or 0, all entries by default", "description"="filter by starred status."}, |
83 | * {"name"="sort", "dataType"="string", "required"=false, "format"="'created' or 'updated', default 'created'", "description"="sort entries by date."}, | 83 | * {"name"="sort", "dataType"="string", "required"=false, "format"="'created' or 'updated' or 'archived', default 'created'", "description"="sort entries by date."}, |
84 | * {"name"="order", "dataType"="string", "required"=false, "format"="'asc' or 'desc', default 'desc'", "description"="order of sort."}, | 84 | * {"name"="order", "dataType"="string", "required"=false, "format"="'asc' or 'desc', default 'desc'", "description"="order of sort."}, |
85 | * {"name"="page", "dataType"="integer", "required"=false, "format"="default '1'", "description"="what page you want."}, | 85 | * {"name"="page", "dataType"="integer", "required"=false, "format"="default '1'", "description"="what page you want."}, |
86 | * {"name"="perPage", "dataType"="integer", "required"=false, "format"="default'30'", "description"="results per page."}, | 86 | * {"name"="perPage", "dataType"="integer", "required"=false, "format"="default'30'", "description"="results per page."}, |
@@ -363,7 +363,7 @@ class EntryRestController extends WallabagRestController | |||
363 | } | 363 | } |
364 | 364 | ||
365 | if (null !== $data['isArchived']) { | 365 | if (null !== $data['isArchived']) { |
366 | $entry->setArchived((bool) $data['isArchived']); | 366 | $entry->updateArchived((bool) $data['isArchived']); |
367 | } | 367 | } |
368 | 368 | ||
369 | if (null !== $data['isStarred']) { | 369 | if (null !== $data['isStarred']) { |
@@ -479,7 +479,7 @@ class EntryRestController extends WallabagRestController | |||
479 | } | 479 | } |
480 | 480 | ||
481 | if (null !== $data['isArchived']) { | 481 | if (null !== $data['isArchived']) { |
482 | $entry->setArchived((bool) $data['isArchived']); | 482 | $entry->updateArchived((bool) $data['isArchived']); |
483 | } | 483 | } |
484 | 484 | ||
485 | if (null !== $data['isStarred']) { | 485 | if (null !== $data['isStarred']) { |
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; | |||
8 | /** | 8 | /** |
9 | * @ORM\Table("oauth2_access_tokens") | 9 | * @ORM\Table("oauth2_access_tokens") |
10 | * @ORM\Entity | 10 | * @ORM\Entity |
11 | * @ORM\AttributeOverrides({ | ||
12 | * @ORM\AttributeOverride(name="token", | ||
13 | * column=@ORM\Column( | ||
14 | * name = "token", | ||
15 | * type = "string", | ||
16 | * length = 191 | ||
17 | * ) | ||
18 | * ), | ||
19 | * @ORM\AttributeOverride(name="scope", | ||
20 | * column=@ORM\Column( | ||
21 | * name = "scope", | ||
22 | * type = "string", | ||
23 | * length = 191 | ||
24 | * ) | ||
25 | * ) | ||
26 | * }) | ||
11 | */ | 27 | */ |
12 | class AccessToken extends BaseAccessToken | 28 | class AccessToken extends BaseAccessToken |
13 | { | 29 | { |
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; | |||
8 | /** | 8 | /** |
9 | * @ORM\Table("oauth2_auth_codes") | 9 | * @ORM\Table("oauth2_auth_codes") |
10 | * @ORM\Entity | 10 | * @ORM\Entity |
11 | * @ORM\AttributeOverrides({ | ||
12 | * @ORM\AttributeOverride(name="token", | ||
13 | * column=@ORM\Column( | ||
14 | * name = "token", | ||
15 | * type = "string", | ||
16 | * length = 191 | ||
17 | * ) | ||
18 | * ), | ||
19 | * @ORM\AttributeOverride(name="scope", | ||
20 | * column=@ORM\Column( | ||
21 | * name = "scope", | ||
22 | * type = "string", | ||
23 | * length = 191 | ||
24 | * ) | ||
25 | * ) | ||
26 | * }) | ||
11 | */ | 27 | */ |
12 | class AuthCode extends BaseAuthCode | 28 | class AuthCode extends BaseAuthCode |
13 | { | 29 | { |
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; | |||
8 | /** | 8 | /** |
9 | * @ORM\Table("oauth2_refresh_tokens") | 9 | * @ORM\Table("oauth2_refresh_tokens") |
10 | * @ORM\Entity | 10 | * @ORM\Entity |
11 | * @ORM\AttributeOverrides({ | ||
12 | * @ORM\AttributeOverride(name="token", | ||
13 | * column=@ORM\Column( | ||
14 | * name = "token", | ||
15 | * type = "string", | ||
16 | * length = 191 | ||
17 | * ) | ||
18 | * ), | ||
19 | * @ORM\AttributeOverride(name="scope", | ||
20 | * column=@ORM\Column( | ||
21 | * name = "scope", | ||
22 | * type = "string", | ||
23 | * length = 191 | ||
24 | * ) | ||
25 | * ) | ||
26 | * }) | ||
11 | */ | 27 | */ |
12 | class RefreshToken extends BaseRefreshToken | 28 | class RefreshToken extends BaseRefreshToken |
13 | { | 29 | { |
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 9e9dbe49..9ff35ff5 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/LoadConfigData.php b/src/Wallabag/CoreBundle/DataFixtures/ConfigFixtures.php index 3d4d5def..c54e9f2c 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ConfigFixtures.php | |||
@@ -1,13 +1,14 @@ | |||
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace Wallabag\CoreBundle\DataFixtures\ORM; | 3 | namespace Wallabag\CoreBundle\DataFixtures; |
4 | 4 | ||
5 | use Doctrine\Common\DataFixtures\AbstractFixture; | 5 | use Doctrine\Bundle\FixturesBundle\Fixture; |
6 | use Doctrine\Common\DataFixtures\OrderedFixtureInterface; | 6 | use Doctrine\Common\DataFixtures\DependentFixtureInterface; |
7 | use Doctrine\Common\Persistence\ObjectManager; | 7 | use Doctrine\Common\Persistence\ObjectManager; |
8 | use Wallabag\CoreBundle\Entity\Config; | 8 | use Wallabag\CoreBundle\Entity\Config; |
9 | use Wallabag\UserBundle\DataFixtures\UserFixtures; | ||
9 | 10 | ||
10 | class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface | 11 | class ConfigFixtures extends Fixture implements DependentFixtureInterface |
11 | { | 12 | { |
12 | /** | 13 | /** |
13 | * {@inheritdoc} | 14 | * {@inheritdoc} |
@@ -60,8 +61,10 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface | |||
60 | /** | 61 | /** |
61 | * {@inheritdoc} | 62 | * {@inheritdoc} |
62 | */ | 63 | */ |
63 | public function getOrder() | 64 | public function getDependencies() |
64 | { | 65 | { |
65 | return 20; | 66 | return [ |
67 | UserFixtures::class, | ||
68 | ]; | ||
66 | } | 69 | } |
67 | } | 70 | } |
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php b/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php index 8e7a1d2a..024fcfdc 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php | |||
@@ -1,13 +1,14 @@ | |||
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace Wallabag\CoreBundle\DataFixtures\ORM; | 3 | namespace Wallabag\CoreBundle\DataFixtures; |
4 | 4 | ||
5 | use Doctrine\Common\DataFixtures\AbstractFixture; | 5 | use Doctrine\Bundle\FixturesBundle\Fixture; |
6 | use Doctrine\Common\DataFixtures\OrderedFixtureInterface; | 6 | use Doctrine\Common\DataFixtures\DependentFixtureInterface; |
7 | use Doctrine\Common\Persistence\ObjectManager; | 7 | use Doctrine\Common\Persistence\ObjectManager; |
8 | use Wallabag\CoreBundle\Entity\Entry; | 8 | use Wallabag\CoreBundle\Entity\Entry; |
9 | use Wallabag\UserBundle\DataFixtures\UserFixtures; | ||
9 | 10 | ||
10 | class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface | 11 | class EntryFixtures extends Fixture implements DependentFixtureInterface |
11 | { | 12 | { |
12 | /** | 13 | /** |
13 | * {@inheritdoc} | 14 | * {@inheritdoc} |
@@ -127,8 +128,11 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface | |||
127 | /** | 128 | /** |
128 | * {@inheritdoc} | 129 | * {@inheritdoc} |
129 | */ | 130 | */ |
130 | public function getOrder() | 131 | public function getDependencies() |
131 | { | 132 | { |
132 | return 30; | 133 | return [ |
134 | UserFixtures::class, | ||
135 | TagFixtures::class, | ||
136 | ]; | ||
133 | } | 137 | } |
134 | } | 138 | } |
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php b/src/Wallabag/CoreBundle/DataFixtures/SettingFixtures.php index 3fe88e7f..cc7d1f59 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/SettingFixtures.php | |||
@@ -1,15 +1,14 @@ | |||
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace Wallabag\CoreBundle\DataFixtures\ORM; | 3 | namespace Wallabag\CoreBundle\DataFixtures; |
4 | 4 | ||
5 | use Craue\ConfigBundle\Entity\Setting; | 5 | use Craue\ConfigBundle\Entity\Setting; |
6 | use Doctrine\Common\DataFixtures\AbstractFixture; | 6 | use Doctrine\Bundle\FixturesBundle\Fixture; |
7 | use Doctrine\Common\DataFixtures\OrderedFixtureInterface; | ||
8 | use Doctrine\Common\Persistence\ObjectManager; | 7 | use Doctrine\Common\Persistence\ObjectManager; |
9 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; | 8 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; |
10 | use Symfony\Component\DependencyInjection\ContainerInterface; | 9 | use Symfony\Component\DependencyInjection\ContainerInterface; |
11 | 10 | ||
12 | class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface, ContainerAwareInterface | 11 | class SettingFixtures extends Fixture implements ContainerAwareInterface |
13 | { | 12 | { |
14 | /** | 13 | /** |
15 | * @var ContainerInterface | 14 | * @var ContainerInterface |
@@ -36,12 +35,4 @@ class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface | |||
36 | 35 | ||
37 | $manager->flush(); | 36 | $manager->flush(); |
38 | } | 37 | } |
39 | |||
40 | /** | ||
41 | * {@inheritdoc} | ||
42 | */ | ||
43 | public function getOrder() | ||
44 | { | ||
45 | return 29; | ||
46 | } | ||
47 | } | 38 | } |
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php b/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php index 866f55a4..c73173e8 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSiteCredentialData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php | |||
@@ -1,13 +1,14 @@ | |||
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace Wallabag\CoreBundle\DataFixtures\ORM; | 3 | namespace Wallabag\CoreBundle\DataFixtures; |
4 | 4 | ||
5 | use Doctrine\Common\DataFixtures\AbstractFixture; | 5 | use Doctrine\Bundle\FixturesBundle\Fixture; |
6 | use Doctrine\Common\DataFixtures\OrderedFixtureInterface; | 6 | use Doctrine\Common\DataFixtures\DependentFixtureInterface; |
7 | use Doctrine\Common\Persistence\ObjectManager; | 7 | use Doctrine\Common\Persistence\ObjectManager; |
8 | use Wallabag\CoreBundle\Entity\SiteCredential; | 8 | use Wallabag\CoreBundle\Entity\SiteCredential; |
9 | use Wallabag\UserBundle\DataFixtures\UserFixtures; | ||
9 | 10 | ||
10 | class LoadSiteCredentialData extends AbstractFixture implements OrderedFixtureInterface | 11 | class SiteCredentialFixtures extends Fixture implements DependentFixtureInterface |
11 | { | 12 | { |
12 | /** | 13 | /** |
13 | * {@inheritdoc} | 14 | * {@inheritdoc} |
@@ -27,8 +28,10 @@ class LoadSiteCredentialData extends AbstractFixture implements OrderedFixtureIn | |||
27 | /** | 28 | /** |
28 | * {@inheritdoc} | 29 | * {@inheritdoc} |
29 | */ | 30 | */ |
30 | public function getOrder() | 31 | public function getDependencies() |
31 | { | 32 | { |
32 | return 50; | 33 | return [ |
34 | UserFixtures::class, | ||
35 | ]; | ||
33 | } | 36 | } |
34 | } | 37 | } |
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php b/src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php index 485445c1..58a0d799 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php | |||
@@ -1,13 +1,12 @@ | |||
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace Wallabag\CoreBundle\DataFixtures\ORM; | 3 | namespace Wallabag\CoreBundle\DataFixtures; |
4 | 4 | ||
5 | use Doctrine\Common\DataFixtures\AbstractFixture; | 5 | use Doctrine\Bundle\FixturesBundle\Fixture; |
6 | use Doctrine\Common\DataFixtures\OrderedFixtureInterface; | ||
7 | use Doctrine\Common\Persistence\ObjectManager; | 6 | use Doctrine\Common\Persistence\ObjectManager; |
8 | use Wallabag\CoreBundle\Entity\Tag; | 7 | use Wallabag\CoreBundle\Entity\Tag; |
9 | 8 | ||
10 | class LoadTagData extends AbstractFixture implements OrderedFixtureInterface | 9 | class TagFixtures extends Fixture |
11 | { | 10 | { |
12 | /** | 11 | /** |
13 | * {@inheritdoc} | 12 | * {@inheritdoc} |
@@ -33,12 +32,4 @@ class LoadTagData extends AbstractFixture implements OrderedFixtureInterface | |||
33 | 32 | ||
34 | $manager->flush(); | 33 | $manager->flush(); |
35 | } | 34 | } |
36 | |||
37 | /** | ||
38 | * {@inheritdoc} | ||
39 | */ | ||
40 | public function getOrder() | ||
41 | { | ||
42 | return 25; | ||
43 | } | ||
44 | } | 35 | } |
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php b/src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php index 55abd63c..78ff314a 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php | |||
@@ -1,13 +1,13 @@ | |||
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace Wallabag\CoreBundle\DataFixtures\ORM; | 3 | namespace Wallabag\CoreBundle\DataFixtures; |
4 | 4 | ||
5 | use Doctrine\Common\DataFixtures\AbstractFixture; | 5 | use Doctrine\Bundle\FixturesBundle\Fixture; |
6 | use Doctrine\Common\DataFixtures\OrderedFixtureInterface; | 6 | use Doctrine\Common\DataFixtures\DependentFixtureInterface; |
7 | use Doctrine\Common\Persistence\ObjectManager; | 7 | use Doctrine\Common\Persistence\ObjectManager; |
8 | use Wallabag\CoreBundle\Entity\TaggingRule; | 8 | use Wallabag\CoreBundle\Entity\TaggingRule; |
9 | 9 | ||
10 | class LoadTaggingRuleData extends AbstractFixture implements OrderedFixtureInterface | 10 | class TaggingRuleFixtures extends Fixture implements DependentFixtureInterface |
11 | { | 11 | { |
12 | /** | 12 | /** |
13 | * {@inheritdoc} | 13 | * {@inheritdoc} |
@@ -49,8 +49,10 @@ class LoadTaggingRuleData extends AbstractFixture implements OrderedFixtureInter | |||
49 | /** | 49 | /** |
50 | * {@inheritdoc} | 50 | * {@inheritdoc} |
51 | */ | 51 | */ |
52 | public function getOrder() | 52 | public function getDependencies() |
53 | { | 53 | { |
54 | return 40; | 54 | return [ |
55 | ConfigFixtures::class, | ||
56 | ]; | ||
55 | } | 57 | } |
56 | } | 58 | } |
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 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\CoreBundle\Doctrine\DBAL\Driver; | ||
4 | |||
5 | use Doctrine\DBAL\Connection; | ||
6 | use Doctrine\DBAL\Driver\PDOPgSql\Driver; | ||
7 | use Wallabag\CoreBundle\Doctrine\DBAL\Schema\CustomPostgreSqlSchemaManager; | ||
8 | |||
9 | /** | ||
10 | * This custom driver allow to use a different schema manager | ||
11 | * So we can fix the PostgreSQL 10 problem. | ||
12 | * | ||
13 | * @see https://github.com/wallabag/wallabag/issues/3479 | ||
14 | * @see https://github.com/doctrine/dbal/issues/2868 | ||
15 | */ | ||
16 | class CustomPostgreSQLDriver extends Driver | ||
17 | { | ||
18 | /** | ||
19 | * {@inheritdoc} | ||
20 | */ | ||
21 | public function getSchemaManager(Connection $conn) | ||
22 | { | ||
23 | return new CustomPostgreSqlSchemaManager($conn); | ||
24 | } | ||
25 | } | ||
diff --git a/src/Wallabag/CoreBundle/Doctrine/DBAL/Schema/CustomPostgreSqlSchemaManager.php b/src/Wallabag/CoreBundle/Doctrine/DBAL/Schema/CustomPostgreSqlSchemaManager.php deleted file mode 100644 index 439ae17d..00000000 --- a/src/Wallabag/CoreBundle/Doctrine/DBAL/Schema/CustomPostgreSqlSchemaManager.php +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\CoreBundle\Doctrine\DBAL\Schema; | ||
4 | |||
5 | use Doctrine\DBAL\Schema\PostgreSqlSchemaManager; | ||
6 | use Doctrine\DBAL\Schema\Sequence; | ||
7 | |||
8 | /** | ||
9 | * This custom schema manager fix the PostgreSQL 10 problem. | ||
10 | * | ||
11 | * @see https://github.com/wallabag/wallabag/issues/3479 | ||
12 | * @see https://github.com/doctrine/dbal/issues/2868 | ||
13 | */ | ||
14 | class CustomPostgreSqlSchemaManager extends PostgreSqlSchemaManager | ||
15 | { | ||
16 | /** | ||
17 | * {@inheritdoc} | ||
18 | */ | ||
19 | protected function _getPortableSequenceDefinition($sequence) | ||
20 | { | ||
21 | $sequenceName = $sequence['relname']; | ||
22 | if ('public' !== $sequence['schemaname']) { | ||
23 | $sequenceName = $sequence['schemaname'] . '.' . $sequence['relname']; | ||
24 | } | ||
25 | |||
26 | $query = 'SELECT min_value, increment_by FROM ' . $this->_platform->quoteIdentifier($sequenceName); | ||
27 | |||
28 | // the `method_exists` is only to avoid test to fail: | ||
29 | // DAMA\DoctrineTestBundle\Doctrine\DBAL\StaticConnection doesn't support the `getServerVersion` | ||
30 | if (method_exists($this->_conn->getWrappedConnection(), 'getServerVersion') && (float) ($this->_conn->getWrappedConnection()->getServerVersion()) >= 10) { | ||
31 | $query = "SELECT min_value, increment_by FROM pg_sequences WHERE schemaname = 'public' AND sequencename = " . $this->_conn->quote($sequenceName); | ||
32 | } | ||
33 | |||
34 | $data = $this->_conn->fetchAll($query); | ||
35 | |||
36 | return new Sequence($sequenceName, $data[0]['increment_by'], $data[0]['min_value']); | ||
37 | } | ||
38 | } | ||
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 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\CoreBundle\Doctrine; | 3 | namespace Wallabag\CoreBundle\Doctrine; |
4 | 4 | ||
5 | use Doctrine\DBAL\Migrations\AbstractMigration; | ||
6 | use Doctrine\DBAL\Schema\Schema; | 5 | use Doctrine\DBAL\Schema\Schema; |
6 | use Doctrine\Migrations\AbstractMigration; | ||
7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; | 7 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; |
8 | use Symfony\Component\DependencyInjection\ContainerInterface; | 8 | use Symfony\Component\DependencyInjection\ContainerInterface; |
9 | 9 | ||
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/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 @@ | |||
3 | namespace Wallabag\CoreBundle\Entity; | 3 | namespace Wallabag\CoreBundle\Entity; |
4 | 4 | ||
5 | use Doctrine\ORM\Mapping as ORM; | 5 | use Doctrine\ORM\Mapping as ORM; |
6 | use KPhoen\RulerZBundle\Validator\Constraints as RulerZAssert; | 6 | use Symfony\Bridge\RulerZ\Validator\Constraints as RulerZAssert; |
7 | use Symfony\Component\Validator\Constraints as Assert; | 7 | use Symfony\Component\Validator\Constraints as Assert; |
8 | 8 | ||
9 | /** | 9 | /** |
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 cebce714..8b6cf443 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 | } |
@@ -193,6 +193,8 @@ class EntryRepository extends EntityRepository | |||
193 | $qb->orderBy('e.id', $order); | 193 | $qb->orderBy('e.id', $order); |
194 | } elseif ('updated' === $sort) { | 194 | } elseif ('updated' === $sort) { |
195 | $qb->orderBy('e.updatedAt', $order); | 195 | $qb->orderBy('e.updatedAt', $order); |
196 | } elseif ('archived' === $sort) { | ||
197 | $qb->orderBy('e.archivedAt', $order); | ||
196 | } | 198 | } |
197 | 199 | ||
198 | $pagerAdapter = new DoctrineORMAdapter($qb, true, false); | 200 | $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 97eb874d..4cf69916 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml | |||
@@ -404,6 +404,8 @@ tag: | |||
404 | new: | 404 | new: |
405 | # add: 'Add' | 405 | # add: 'Add' |
406 | # placeholder: 'You can add several tags, separated by a comma.' | 406 | # placeholder: 'You can add several tags, separated by a comma.' |
407 | rename: | ||
408 | # placeholder: 'You can update tag name.' | ||
407 | 409 | ||
408 | # export: | 410 | # export: |
409 | # 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>' | 411 | # 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>' |
@@ -591,6 +593,7 @@ flashes: | |||
591 | tag: | 593 | tag: |
592 | notice: | 594 | notice: |
593 | # tag_added: 'Tag added' | 595 | # tag_added: 'Tag added' |
596 | # tag_renamed: 'Tag renamed' | ||
594 | import: | 597 | import: |
595 | notice: | 598 | notice: |
596 | # failed: 'Import failed, please try again.' | 599 | # 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 0cf3b138..10981788 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml | |||
@@ -404,6 +404,8 @@ tag: | |||
404 | new: | 404 | new: |
405 | add: 'Hinzufügen' | 405 | add: 'Hinzufügen' |
406 | placeholder: 'Du kannst verschiedene Tags, getrennt von einem Komma, hinzufügen.' | 406 | placeholder: 'Du kannst verschiedene Tags, getrennt von einem Komma, hinzufügen.' |
407 | rename: | ||
408 | # placeholder: 'You can update tag name.' | ||
407 | 409 | ||
408 | export: | 410 | export: |
409 | 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>' | 411 | 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>' |
@@ -591,6 +593,7 @@ flashes: | |||
591 | tag: | 593 | tag: |
592 | notice: | 594 | notice: |
593 | tag_added: 'Tag hinzugefügt' | 595 | tag_added: 'Tag hinzugefügt' |
596 | #tag_renamed: 'Tag renamed' | ||
594 | import: | 597 | import: |
595 | notice: | 598 | notice: |
596 | failed: 'Import fehlgeschlagen, bitte erneut probieren.' | 599 | 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 6085be14..95e10faf 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml | |||
@@ -404,6 +404,8 @@ tag: | |||
404 | new: | 404 | new: |
405 | add: 'Add' | 405 | add: 'Add' |
406 | placeholder: 'You can add several tags, separated by a comma.' | 406 | placeholder: 'You can add several tags, separated by a comma.' |
407 | rename: | ||
408 | placeholder: 'You can update tag name.' | ||
407 | 409 | ||
408 | export: | 410 | export: |
409 | 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>' | 411 | 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>' |
@@ -591,6 +593,7 @@ flashes: | |||
591 | tag: | 593 | tag: |
592 | notice: | 594 | notice: |
593 | tag_added: 'Tag added' | 595 | tag_added: 'Tag added' |
596 | tag_renamed: 'Tag renamed' | ||
594 | import: | 597 | import: |
595 | notice: | 598 | notice: |
596 | failed: 'Import failed, please try again.' | 599 | 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 f2a8fb89..c95bee5b 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml | |||
@@ -404,6 +404,8 @@ tag: | |||
404 | new: | 404 | new: |
405 | add: 'Añadir' | 405 | add: 'Añadir' |
406 | placeholder: 'Puedes añadir varias etiquetas, separadas por una coma.' | 406 | placeholder: 'Puedes añadir varias etiquetas, separadas por una coma.' |
407 | rename: | ||
408 | # placeholder: 'You can update tag name.' | ||
407 | 409 | ||
408 | # export: | 410 | # export: |
409 | # 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>' | 411 | # 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>' |
@@ -591,6 +593,7 @@ flashes: | |||
591 | tag: | 593 | tag: |
592 | notice: | 594 | notice: |
593 | tag_added: 'Etiqueta añadida' | 595 | tag_added: 'Etiqueta añadida' |
596 | # tag_renamed: 'Tag renamed' | ||
594 | import: | 597 | import: |
595 | notice: | 598 | notice: |
596 | failed: 'Importación fallida, por favor, inténtelo de nuevo.' | 599 | 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 a5cbd7ec..4fde53dd 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml | |||
@@ -404,6 +404,8 @@ tag: | |||
404 | new: | 404 | new: |
405 | # add: 'Add' | 405 | # add: 'Add' |
406 | # placeholder: 'You can add several tags, separated by a comma.' | 406 | # placeholder: 'You can add several tags, separated by a comma.' |
407 | rename: | ||
408 | # placeholder: 'You can update tag name.' | ||
407 | 409 | ||
408 | # export: | 410 | # export: |
409 | # 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>' | 411 | # 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>' |
@@ -591,6 +593,7 @@ flashes: | |||
591 | tag: | 593 | tag: |
592 | notice: | 594 | notice: |
593 | tag_added: 'برچسب افزوده شد' | 595 | tag_added: 'برچسب افزوده شد' |
596 | # tag_renamed: 'Tag renamed' | ||
594 | import: | 597 | import: |
595 | notice: | 598 | notice: |
596 | failed: 'درونریزی شکست خورد. لطفاً دوباره تلاش کنید.' | 599 | failed: 'درونریزی شکست خورد. لطفاً دوباره تلاش کنید.' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index a36d84ae..edf3ac35 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml | |||
@@ -404,6 +404,8 @@ tag: | |||
404 | new: | 404 | new: |
405 | add: "Ajouter" | 405 | add: "Ajouter" |
406 | placeholder: "Vous pouvez ajouter plusieurs tags, séparés par une virgule." | 406 | placeholder: "Vous pouvez ajouter plusieurs tags, séparés par une virgule." |
407 | rename: | ||
408 | placeholder: 'Vous pouvez changer le nom de votre tag.' | ||
407 | 409 | ||
408 | export: | 410 | export: |
409 | 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>' | 411 | 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>' |
@@ -591,6 +593,7 @@ flashes: | |||
591 | tag: | 593 | tag: |
592 | notice: | 594 | notice: |
593 | tag_added: "Tag ajouté" | 595 | tag_added: "Tag ajouté" |
596 | tag_renamed: "Tag renommé" | ||
594 | import: | 597 | import: |
595 | notice: | 598 | notice: |
596 | failed: "L’import a échoué, veuillez ré-essayer" | 599 | 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 1649c0e4..f178ddbf 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml | |||
@@ -404,6 +404,8 @@ tag: | |||
404 | new: | 404 | new: |
405 | add: 'Aggiungi' | 405 | add: 'Aggiungi' |
406 | placeholder: 'Puoi aggiungere varie etichette, separate da una virgola.' | 406 | placeholder: 'Puoi aggiungere varie etichette, separate da una virgola.' |
407 | rename: | ||
408 | # placeholder: 'You can update tag name.' | ||
407 | 409 | ||
408 | # export: | 410 | # export: |
409 | # 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>' | 411 | # 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>' |
@@ -591,6 +593,7 @@ flashes: | |||
591 | tag: | 593 | tag: |
592 | notice: | 594 | notice: |
593 | tag_added: 'Etichetta aggiunta' | 595 | tag_added: 'Etichetta aggiunta' |
596 | # tag_renamed: 'Tag renamed' | ||
594 | import: | 597 | import: |
595 | notice: | 598 | notice: |
596 | failed: 'Importazione fallita, riprova.' | 599 | 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 e2298f1f..a1220f52 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml | |||
@@ -404,6 +404,8 @@ tag: | |||
404 | new: | 404 | new: |
405 | add: 'Ajustar' | 405 | add: 'Ajustar' |
406 | placeholder: "Podètz ajustar mai qu'una etiqueta, separadas per de virgula." | 406 | placeholder: "Podètz ajustar mai qu'una etiqueta, separadas per de virgula." |
407 | rename: | ||
408 | # placeholder: 'You can update tag name.' | ||
407 | 409 | ||
408 | export: | 410 | export: |
409 | 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>' | 411 | 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>' |
@@ -591,6 +593,7 @@ flashes: | |||
591 | tag: | 593 | tag: |
592 | notice: | 594 | notice: |
593 | tag_added: 'Etiqueta ajustada' | 595 | tag_added: 'Etiqueta ajustada' |
596 | # tag_renamed: 'Tag renamed' | ||
594 | import: | 597 | import: |
595 | notice: | 598 | notice: |
596 | failed: "L'importacion a fracassat, mercés de tornar ensajar." | 599 | 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 a5712733..b6f7faf7 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml | |||
@@ -404,6 +404,8 @@ tag: | |||
404 | new: | 404 | new: |
405 | add: 'Dodaj' | 405 | add: 'Dodaj' |
406 | placeholder: 'Możesz dodać kilka tagów, oddzielając je przecinkami.' | 406 | placeholder: 'Możesz dodać kilka tagów, oddzielając je przecinkami.' |
407 | rename: | ||
408 | placeholder: 'Możesz zaktualizować nazwę taga.' | ||
407 | 409 | ||
408 | export: | 410 | export: |
409 | 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>' | 411 | 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>' |
@@ -591,6 +593,7 @@ flashes: | |||
591 | tag: | 593 | tag: |
592 | notice: | 594 | notice: |
593 | tag_added: 'Tag dodany' | 595 | tag_added: 'Tag dodany' |
596 | tag_renamed: 'Nazwa taga zmieniona' | ||
594 | import: | 597 | import: |
595 | notice: | 598 | notice: |
596 | failed: 'Nieudany import, prosimy spróbować ponownie.' | 599 | 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 1ccf49e1..78df254f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml | |||
@@ -404,6 +404,8 @@ tag: | |||
404 | new: | 404 | new: |
405 | # add: 'Add' | 405 | # add: 'Add' |
406 | # placeholder: 'You can add several tags, separated by a comma.' | 406 | # placeholder: 'You can add several tags, separated by a comma.' |
407 | rename: | ||
408 | # placeholder: 'You can update tag name.' | ||
407 | 409 | ||
408 | # export: | 410 | # export: |
409 | # 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>' | 411 | # 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>' |
@@ -591,6 +593,7 @@ flashes: | |||
591 | tag: | 593 | tag: |
592 | notice: | 594 | notice: |
593 | tag_added: 'Tag adicionada' | 595 | tag_added: 'Tag adicionada' |
596 | # tag_renamed: 'Tag renamed' | ||
594 | import: | 597 | import: |
595 | notice: | 598 | notice: |
596 | failed: 'Importação falhou, por favor tente novamente.' | 599 | 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 6c0e18e1..8312ca15 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml | |||
@@ -404,6 +404,8 @@ tag: | |||
404 | new: | 404 | new: |
405 | # add: 'Add' | 405 | # add: 'Add' |
406 | # placeholder: 'You can add several tags, separated by a comma.' | 406 | # placeholder: 'You can add several tags, separated by a comma.' |
407 | rename: | ||
408 | # placeholder: 'You can update tag name.' | ||
407 | 409 | ||
408 | # export: | 410 | # export: |
409 | # 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>' | 411 | # 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>' |
@@ -591,6 +593,7 @@ flashes: | |||
591 | tag: | 593 | tag: |
592 | notice: | 594 | notice: |
593 | # tag_added: 'Tag added' | 595 | # tag_added: 'Tag added' |
596 | # tag_renamed: 'Tag renamed' | ||
594 | import: | 597 | import: |
595 | notice: | 598 | notice: |
596 | # failed: 'Import failed, please try again.' | 599 | # 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 48753b55..f14aad12 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml | |||
@@ -392,6 +392,8 @@ tag: | |||
392 | new: | 392 | new: |
393 | add: 'Добавить' | 393 | add: 'Добавить' |
394 | placeholder: 'Вы можете добавить несколько тегов, разделенных запятой.' | 394 | placeholder: 'Вы можете добавить несколько тегов, разделенных запятой.' |
395 | rename: | ||
396 | # placeholder: 'You can update tag name.' | ||
395 | 397 | ||
396 | # export: | 398 | # export: |
397 | # 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>' | 399 | # 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>' |
@@ -556,6 +558,7 @@ flashes: | |||
556 | tag: | 558 | tag: |
557 | notice: | 559 | notice: |
558 | tag_added: 'Тег добавлен' | 560 | tag_added: 'Тег добавлен' |
561 | # tag_renamed: 'Tag renamed' | ||
559 | import: | 562 | import: |
560 | notice: | 563 | notice: |
561 | failed: 'Во время импорта произошла ошибка, повторите попытку.' | 564 | failed: 'Во время импорта произошла ошибка, повторите попытку.' |
@@ -573,4 +576,4 @@ flashes: | |||
573 | notice: | 576 | notice: |
574 | added: 'Пользователь "%username%" добавлен' | 577 | added: 'Пользователь "%username%" добавлен' |
575 | updated: 'Пользователь "%username%" обновлен' | 578 | updated: 'Пользователь "%username%" обновлен' |
576 | deleted: 'Пользователь "%username%" удален' \ No newline at end of file | 579 | deleted: 'Пользователь "%username%" удален' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index 5524b1f1..7dbb1399 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml | |||
@@ -402,6 +402,8 @@ tag: | |||
402 | new: | 402 | new: |
403 | add: 'เพิ่ม' | 403 | add: 'เพิ่ม' |
404 | placeholder: 'คุณสามารถเพิ่มได้หลายแท็ก, จากการแบ่งโดย comma' | 404 | placeholder: 'คุณสามารถเพิ่มได้หลายแท็ก, จากการแบ่งโดย comma' |
405 | rename: | ||
406 | # placeholder: 'You can update tag name.' | ||
405 | 407 | ||
406 | export: | 408 | export: |
407 | 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>' | 409 | 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>' |
@@ -589,6 +591,7 @@ flashes: | |||
589 | tag: | 591 | tag: |
590 | notice: | 592 | notice: |
591 | tag_added: 'แท็กที่เพิ่ม' | 593 | tag_added: 'แท็กที่เพิ่ม' |
594 | # tag_renamed: 'Tag renamed' | ||
592 | import: | 595 | import: |
593 | notice: | 596 | notice: |
594 | failed: 'นำข้อมูลเข้าล้มเหลว, ลองใหม่อีกครั้ง' | 597 | failed: 'นำข้อมูลเข้าล้มเหลว, ลองใหม่อีกครั้ง' |
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml index e2156d47..b4bc04d0 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml | |||
@@ -402,6 +402,8 @@ tag: | |||
402 | new: | 402 | new: |
403 | # add: 'Add' | 403 | # add: 'Add' |
404 | # placeholder: 'You can add several tags, separated by a comma.' | 404 | # placeholder: 'You can add several tags, separated by a comma.' |
405 | rename: | ||
406 | # placeholder: 'You can update tag name.' | ||
405 | 407 | ||
406 | # export: | 408 | # export: |
407 | # 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>' | 409 | # 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>' |
@@ -569,6 +571,7 @@ flashes: | |||
569 | tag: | 571 | tag: |
570 | notice: | 572 | notice: |
571 | tag_added: 'Etiket eklendi' | 573 | tag_added: 'Etiket eklendi' |
574 | # tag_renamed: 'Tag renamed' | ||
572 | import: | 575 | import: |
573 | notice: | 576 | notice: |
574 | # failed: 'Import failed, please try again.' | 577 | # 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 4678ae0c..804bc6cd 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 5a18c7c0..df1d6666 100644 --- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php +++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php | |||
@@ -147,7 +147,7 @@ class InstapaperImport extends AbstractImport | |||
147 | ); | 147 | ); |
148 | } | 148 | } |
149 | 149 | ||
150 | $entry->setArchived($importedEntry['is_archived']); | 150 | $entry->updateArchived($importedEntry['is_archived']); |
151 | $entry->setStarred($importedEntry['is_starred']); | 151 | $entry->setStarred($importedEntry['is_starred']); |
152 | 152 | ||
153 | $this->em->persist($entry); | 153 | $this->em->persist($entry); |
diff --git a/src/Wallabag/ImportBundle/Import/PinboardImport.php b/src/Wallabag/ImportBundle/Import/PinboardImport.php index 995d1f2c..202eb1b3 100644 --- a/src/Wallabag/ImportBundle/Import/PinboardImport.php +++ b/src/Wallabag/ImportBundle/Import/PinboardImport.php | |||
@@ -131,7 +131,7 @@ class PinboardImport extends AbstractImport | |||
131 | ); | 131 | ); |
132 | } | 132 | } |
133 | 133 | ||
134 | $entry->setArchived($data['is_archived']); | 134 | $entry->updateArchived($data['is_archived']); |
135 | $entry->setStarred($data['is_starred']); | 135 | $entry->setStarred($data['is_starred']); |
136 | $entry->setCreatedAt(new \DateTime($data['created_at'])); | 136 | $entry->setCreatedAt(new \DateTime($data['created_at'])); |
137 | 137 | ||
diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index d3643389..f2e59183 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php | |||
@@ -206,7 +206,7 @@ class PocketImport extends AbstractImport | |||
206 | $this->fetchContent($entry, $url); | 206 | $this->fetchContent($entry, $url); |
207 | 207 | ||
208 | // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted | 208 | // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted |
209 | $entry->setArchived(1 === $importedEntry['status'] || $this->markAsRead); | 209 | $entry->updateArchived(1 === $importedEntry['status'] || $this->markAsRead); |
210 | 210 | ||
211 | // 0 or 1 - 1 If the item is starred | 211 | // 0 or 1 - 1 If the item is starred |
212 | $entry->setStarred(1 === $importedEntry['favorite']); | 212 | $entry->setStarred(1 === $importedEntry['favorite']); |
diff --git a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php index a5f3798e..c5abf189 100644 --- a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php +++ b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php | |||
@@ -123,7 +123,7 @@ class ReadabilityImport extends AbstractImport | |||
123 | // update entry with content (in case fetching failed, the given entry will be return) | 123 | // update entry with content (in case fetching failed, the given entry will be return) |
124 | $this->fetchContent($entry, $data['url'], $data); | 124 | $this->fetchContent($entry, $data['url'], $data); |
125 | 125 | ||
126 | $entry->setArchived($data['is_archived']); | 126 | $entry->updateArchived($data['is_archived']); |
127 | $entry->setStarred($data['is_starred']); | 127 | $entry->setStarred($data['is_starred']); |
128 | $entry->setCreatedAt(new \DateTime($data['created_at'])); | 128 | $entry->setCreatedAt(new \DateTime($data['created_at'])); |
129 | 129 | ||
diff --git a/src/Wallabag/ImportBundle/Import/WallabagImport.php b/src/Wallabag/ImportBundle/Import/WallabagImport.php index 350d0600..c3a142b9 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagImport.php +++ b/src/Wallabag/ImportBundle/Import/WallabagImport.php | |||
@@ -134,7 +134,7 @@ abstract class WallabagImport extends AbstractImport | |||
134 | $entry->setPreviewPicture($importedEntry['preview_picture']); | 134 | $entry->setPreviewPicture($importedEntry['preview_picture']); |
135 | } | 135 | } |
136 | 136 | ||
137 | $entry->setArchived($data['is_archived']); | 137 | $entry->updateArchived($data['is_archived']); |
138 | $entry->setStarred($data['is_starred']); | 138 | $entry->setStarred($data['is_starred']); |
139 | 139 | ||
140 | if (!empty($data['created_at'])) { | 140 | 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/DataFixtures/ORM/LoadUserData.php b/src/Wallabag/UserBundle/DataFixtures/UserFixtures.php index 26dbda3b..1e375e09 100644 --- a/src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php +++ b/src/Wallabag/UserBundle/DataFixtures/UserFixtures.php | |||
@@ -1,13 +1,12 @@ | |||
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace Wallabag\UserBundle\DataFixtures\ORM; | 3 | namespace Wallabag\UserBundle\DataFixtures; |
4 | 4 | ||
5 | use Doctrine\Common\DataFixtures\AbstractFixture; | 5 | use Doctrine\Bundle\FixturesBundle\Fixture; |
6 | use Doctrine\Common\DataFixtures\OrderedFixtureInterface; | ||
7 | use Doctrine\Common\Persistence\ObjectManager; | 6 | use Doctrine\Common\Persistence\ObjectManager; |
8 | use Wallabag\UserBundle\Entity\User; | 7 | use Wallabag\UserBundle\Entity\User; |
9 | 8 | ||
10 | class LoadUserData extends AbstractFixture implements OrderedFixtureInterface | 9 | class UserFixtures extends Fixture |
11 | { | 10 | { |
12 | /** | 11 | /** |
13 | * {@inheritdoc} | 12 | * {@inheritdoc} |
@@ -50,12 +49,4 @@ class LoadUserData extends AbstractFixture implements OrderedFixtureInterface | |||
50 | 49 | ||
51 | $manager->flush(); | 50 | $manager->flush(); |
52 | } | 51 | } |
53 | |||
54 | /** | ||
55 | * {@inheritdoc} | ||
56 | */ | ||
57 | public function getOrder() | ||
58 | { | ||
59 | return 10; | ||
60 | } | ||
61 | } | 52 | } |
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 f97e9870..a47b31d0 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 %} |