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