diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2018-10-15 08:32:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-15 08:32:59 +0000 |
commit | e673b54f702f274a087e4feff409663d9636e57b (patch) | |
tree | 094dffaffc7f3f9ed1513e939083a922ee00b0cc /src | |
parent | 5bb01c034424b56a0a0ae4bc34ae5bb9a514deba (diff) | |
parent | 84d59603c53878bfba32a8fb846d3c00e756c4f1 (diff) | |
download | wallabag-e673b54f702f274a087e4feff409663d9636e57b.tar.gz wallabag-e673b54f702f274a087e4feff409663d9636e57b.tar.zst wallabag-e673b54f702f274a087e4feff409663d9636e57b.zip |
Merge pull request #3574 from shulard/feature/rename-tags
Allow to rename tags from the web interface.
Diffstat (limited to 'src')
18 files changed, 156 insertions, 5 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index 15f06ff5..d0155c60 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php | |||
@@ -11,6 +11,7 @@ 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/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/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index e1384675..c8500ad3 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml | |||
@@ -399,6 +399,8 @@ tag: | |||
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 bd81c72f..827bf770 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml | |||
@@ -399,6 +399,8 @@ tag: | |||
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 700190a6..e5878f2c 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml | |||
@@ -399,6 +399,8 @@ tag: | |||
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 83645933..2e922358 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml | |||
@@ -399,6 +399,8 @@ tag: | |||
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 edf29654..cf5031d3 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml | |||
@@ -399,6 +399,8 @@ tag: | |||
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 47292116..1563703a 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml | |||
@@ -399,6 +399,8 @@ tag: | |||
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 7aef9694..127b425e 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml | |||
@@ -399,6 +399,8 @@ tag: | |||
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 9b7068c6..e68a91ec 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml | |||
@@ -399,6 +399,8 @@ tag: | |||
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 5c95fe63..c48a885f 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml | |||
@@ -397,6 +397,8 @@ tag: | |||
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 %} |