aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--src/Wallabag/ApiBundle/Controller/TaggingRuleRestController.php39
-rw-r--r--src/Wallabag/ApiBundle/Resources/config/routing_rest.yml5
-rw-r--r--src/Wallabag/CoreBundle/Controller/ConfigController.php62
-rw-r--r--src/Wallabag/CoreBundle/Entity/TaggingRule.php10
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/TaggingRuleImportType.php29
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.da.yml12
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.de.yml21
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.en.yml11
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.es.yml12
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml12
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml11
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.it.yml13
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml13
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml13
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml13
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml19
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml60
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.th.yml15
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml48
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig28
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig89
-rw-r--r--tests/Wallabag/ApiBundle/Controller/TaggingRuleRestControllerTest.php15
-rw-r--r--tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php64
-rw-r--r--tests/Wallabag/CoreBundle/fixtures/tagging_rules_admin.json4
25 files changed, 586 insertions, 33 deletions
diff --git a/.gitignore b/.gitignore
index 49ff72c6..553b0e94 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,6 +32,7 @@ web/uploads/
32# Build 32# Build
33/app/build 33/app/build
34/build 34/build
35/coverage
35 36
36# Composer PHAR 37# Composer PHAR
37/composer.phar 38/composer.phar
diff --git a/src/Wallabag/ApiBundle/Controller/TaggingRuleRestController.php b/src/Wallabag/ApiBundle/Controller/TaggingRuleRestController.php
new file mode 100644
index 00000000..2496298a
--- /dev/null
+++ b/src/Wallabag/ApiBundle/Controller/TaggingRuleRestController.php
@@ -0,0 +1,39 @@
1<?php
2
3namespace Wallabag\ApiBundle\Controller;
4
5use JMS\Serializer\SerializationContext;
6use JMS\Serializer\SerializerBuilder;
7use Nelmio\ApiDocBundle\Annotation\ApiDoc;
8use Symfony\Component\HttpFoundation\Response;
9
10class TaggingRuleRestController extends WallabagRestController
11{
12 /**
13 * Export all tagging rules as a json file.
14 *
15 * @ApiDoc()
16 *
17 * @return Response
18 */
19 public function getTaggingruleExportAction()
20 {
21 $this->validateAuthentication();
22
23 $data = SerializerBuilder::create()->build()->serialize(
24 $this->getUser()->getConfig()->getTaggingRules(),
25 'json',
26 SerializationContext::create()->setGroups(['export_tagging_rule'])
27 );
28
29 return Response::create(
30 $data,
31 200,
32 [
33 'Content-type' => 'application/json',
34 'Content-Disposition' => 'attachment; filename="tagging_rules_' . $this->getUser()->getUsername() . '.json"',
35 'Content-Transfer-Encoding' => 'UTF-8',
36 ]
37 );
38 }
39}
diff --git a/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml b/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml
index 06e62c37..98efeeb1 100644
--- a/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml
+++ b/src/Wallabag/ApiBundle/Resources/config/routing_rest.yml
@@ -13,6 +13,11 @@ tag:
13 resource: "WallabagApiBundle:TagRest" 13 resource: "WallabagApiBundle:TagRest"
14 name_prefix: api_ 14 name_prefix: api_
15 15
16tagging_rule:
17 type: rest
18 resource: "WallabagApiBundle:TaggingRuleRest"
19 name_prefix: api_
20
16annotation: 21annotation:
17 type: rest 22 type: rest
18 resource: "WallabagApiBundle:AnnotationRest" 23 resource: "WallabagApiBundle:AnnotationRest"
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php
index cea41303..0db90ba4 100644
--- a/src/Wallabag/CoreBundle/Controller/ConfigController.php
+++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php
@@ -2,11 +2,14 @@
2 2
3namespace Wallabag\CoreBundle\Controller; 3namespace Wallabag\CoreBundle\Controller;
4 4
5use JMS\Serializer\SerializationContext;
6use JMS\Serializer\SerializerBuilder;
5use PragmaRX\Recovery\Recovery as BackupCodes; 7use PragmaRX\Recovery\Recovery as BackupCodes;
6use Symfony\Bundle\FrameworkBundle\Controller\Controller; 8use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7use Symfony\Component\HttpFoundation\JsonResponse; 9use Symfony\Component\HttpFoundation\JsonResponse;
8use Symfony\Component\HttpFoundation\RedirectResponse; 10use Symfony\Component\HttpFoundation\RedirectResponse;
9use Symfony\Component\HttpFoundation\Request; 11use Symfony\Component\HttpFoundation\Request;
12use Symfony\Component\HttpFoundation\Response;
10use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; 13use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
11use Symfony\Component\Routing\Annotation\Route; 14use Symfony\Component\Routing\Annotation\Route;
12use Symfony\Component\Validator\Constraints\Locale as LocaleConstraint; 15use Symfony\Component\Validator\Constraints\Locale as LocaleConstraint;
@@ -15,6 +18,7 @@ use Wallabag\CoreBundle\Entity\TaggingRule;
15use Wallabag\CoreBundle\Form\Type\ChangePasswordType; 18use Wallabag\CoreBundle\Form\Type\ChangePasswordType;
16use Wallabag\CoreBundle\Form\Type\ConfigType; 19use Wallabag\CoreBundle\Form\Type\ConfigType;
17use Wallabag\CoreBundle\Form\Type\FeedType; 20use Wallabag\CoreBundle\Form\Type\FeedType;
21use Wallabag\CoreBundle\Form\Type\TaggingRuleImportType;
18use Wallabag\CoreBundle\Form\Type\TaggingRuleType; 22use Wallabag\CoreBundle\Form\Type\TaggingRuleType;
19use Wallabag\CoreBundle\Form\Type\UserInformationType; 23use Wallabag\CoreBundle\Form\Type\UserInformationType;
20use Wallabag\CoreBundle\Tools\Utils; 24use Wallabag\CoreBundle\Tools\Utils;
@@ -140,6 +144,37 @@ class ConfigController extends Controller
140 return $this->redirect($this->generateUrl('config') . '#set5'); 144 return $this->redirect($this->generateUrl('config') . '#set5');
141 } 145 }
142 146
147 // handle tagging rules import
148 $taggingRulesImportform = $this->createForm(TaggingRuleImportType::class);
149 $taggingRulesImportform->handleRequest($request);
150
151 if ($taggingRulesImportform->isSubmitted() && $taggingRulesImportform->isValid()) {
152 $message = 'flashes.config.notice.tagging_rules_not_imported';
153 $file = $taggingRulesImportform->get('file')->getData();
154
155 if (null !== $file && $file->isValid() && \in_array($file->getClientMimeType(), ['application/json', 'application/octet-stream'], true)) {
156 $content = json_decode(file_get_contents($file->getPathname()), true);
157
158 if (\is_array($content)) {
159 foreach ($content as $rule) {
160 $taggingRule = new TaggingRule();
161 $taggingRule->setRule($rule['rule']);
162 $taggingRule->setTags($rule['tags']);
163 $taggingRule->setConfig($config);
164 $em->persist($taggingRule);
165 }
166
167 $em->flush();
168
169 $message = 'flashes.config.notice.tagging_rules_imported';
170 }
171 }
172
173 $this->addFlash('notice', $message);
174
175 return $this->redirect($this->generateUrl('config') . '#set5');
176 }
177
143 return $this->render('WallabagCoreBundle:Config:index.html.twig', [ 178 return $this->render('WallabagCoreBundle:Config:index.html.twig', [
144 'form' => [ 179 'form' => [
145 'config' => $configForm->createView(), 180 'config' => $configForm->createView(),
@@ -147,6 +182,7 @@ class ConfigController extends Controller
147 'pwd' => $pwdForm->createView(), 182 'pwd' => $pwdForm->createView(),
148 'user' => $userForm->createView(), 183 'user' => $userForm->createView(),
149 'new_tagging_rule' => $newTaggingRule->createView(), 184 'new_tagging_rule' => $newTaggingRule->createView(),
185 'import_tagging_rule' => $taggingRulesImportform->createView(),
150 ], 186 ],
151 'feed' => [ 187 'feed' => [
152 'username' => $user->getUsername(), 188 'username' => $user->getUsername(),
@@ -493,6 +529,32 @@ class ConfigController extends Controller
493 } 529 }
494 530
495 /** 531 /**
532 * Export tagging rules for the logged in user.
533 *
534 * @Route("/tagging-rule/export", name="export_tagging_rule")
535 *
536 * @return Response
537 */
538 public function exportTaggingRulesAction()
539 {
540 $data = SerializerBuilder::create()->build()->serialize(
541 $this->getUser()->getConfig()->getTaggingRules(),
542 'json',
543 SerializationContext::create()->setGroups(['export_tagging_rule'])
544 );
545
546 return Response::create(
547 $data,
548 200,
549 [
550 'Content-type' => 'application/json',
551 'Content-Disposition' => 'attachment; filename="tagging_rules_' . $this->getUser()->getUsername() . '.json"',
552 'Content-Transfer-Encoding' => 'UTF-8',
553 ]
554 );
555 }
556
557 /**
496 * Remove all tags for given tags and a given user and cleanup orphan tags. 558 * Remove all tags for given tags and a given user and cleanup orphan tags.
497 * 559 *
498 * @param array $tags 560 * @param array $tags
diff --git a/src/Wallabag/CoreBundle/Entity/TaggingRule.php b/src/Wallabag/CoreBundle/Entity/TaggingRule.php
index c1be3165..eac53fa3 100644
--- a/src/Wallabag/CoreBundle/Entity/TaggingRule.php
+++ b/src/Wallabag/CoreBundle/Entity/TaggingRule.php
@@ -3,12 +3,16 @@
3namespace Wallabag\CoreBundle\Entity; 3namespace Wallabag\CoreBundle\Entity;
4 4
5use Doctrine\ORM\Mapping as ORM; 5use Doctrine\ORM\Mapping as ORM;
6use JMS\Serializer\Annotation\Exclude;
7use JMS\Serializer\Annotation\Groups;
8use JMS\Serializer\Annotation\XmlRoot;
6use Symfony\Bridge\RulerZ\Validator\Constraints as RulerZAssert; 9use Symfony\Bridge\RulerZ\Validator\Constraints as RulerZAssert;
7use Symfony\Component\Validator\Constraints as Assert; 10use Symfony\Component\Validator\Constraints as Assert;
8 11
9/** 12/**
10 * Tagging rule. 13 * Tagging rule.
11 * 14 *
15 * @XmlRoot("tagging_rule")
12 * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\TaggingRuleRepository") 16 * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\TaggingRuleRepository")
13 * @ORM\Table(name="`tagging_rule`") 17 * @ORM\Table(name="`tagging_rule`")
14 * @ORM\Entity 18 * @ORM\Entity
@@ -34,6 +38,8 @@ class TaggingRule
34 * allowed_operators={">", "<", ">=", "<=", "=", "is", "!=", "and", "not", "or", "matches", "notmatches"} 38 * allowed_operators={">", "<", ">=", "<=", "=", "is", "!=", "and", "not", "or", "matches", "notmatches"}
35 * ) 39 * )
36 * @ORM\Column(name="rule", type="string", nullable=false) 40 * @ORM\Column(name="rule", type="string", nullable=false)
41 *
42 * @Groups({"export_tagging_rule"})
37 */ 43 */
38 private $rule; 44 private $rule;
39 45
@@ -42,10 +48,14 @@ class TaggingRule
42 * 48 *
43 * @Assert\NotBlank() 49 * @Assert\NotBlank()
44 * @ORM\Column(name="tags", type="simple_array", nullable=false) 50 * @ORM\Column(name="tags", type="simple_array", nullable=false)
51 *
52 * @Groups({"export_tagging_rule"})
45 */ 53 */
46 private $tags = []; 54 private $tags = [];
47 55
48 /** 56 /**
57 * @Exclude
58 *
49 * @ORM\ManyToOne(targetEntity="Wallabag\CoreBundle\Entity\Config", inversedBy="taggingRules") 59 * @ORM\ManyToOne(targetEntity="Wallabag\CoreBundle\Entity\Config", inversedBy="taggingRules")
50 */ 60 */
51 private $config; 61 private $config;
diff --git a/src/Wallabag/CoreBundle/Form/Type/TaggingRuleImportType.php b/src/Wallabag/CoreBundle/Form/Type/TaggingRuleImportType.php
new file mode 100644
index 00000000..c6a8c0b8
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Form/Type/TaggingRuleImportType.php
@@ -0,0 +1,29 @@
1<?php
2
3namespace Wallabag\CoreBundle\Form\Type;
4
5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\FileType;
7use Symfony\Component\Form\Extension\Core\Type\SubmitType;
8use Symfony\Component\Form\FormBuilderInterface;
9
10class TaggingRuleImportType extends AbstractType
11{
12 public function buildForm(FormBuilderInterface $builder, array $options)
13 {
14 $builder
15 ->add('file', FileType::class, [
16 'label' => 'config.form_rules.file_label',
17 'required' => true,
18 ])
19 ->add('import', SubmitType::class, [
20 'label' => 'config.form_rules.import_submit',
21 ])
22 ;
23 }
24
25 public function getBlockPrefix()
26 {
27 return 'upload_tagging_rule_file';
28 }
29}
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
index 065d281c..2db283ae 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
@@ -136,6 +136,15 @@ config:
136 # edit_rule_label: 'edit' 136 # edit_rule_label: 'edit'
137 # rule_label: 'Rule' 137 # rule_label: 'Rule'
138 # tags_label: 'Tags' 138 # tags_label: 'Tags'
139 # card:
140 # new_tagging_rule: Create a tagging rule
141 # import_tagging_rules: Import tagging rules
142 # import_tagging_rules_detail: You have to select the JSON file you previously exported.
143 # export_tagging_rules: Export tagging rules
144 # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them.
145 # file_label: JSON file
146 # import_submit: Import
147 # export: Export
139 # faq: 148 # faq:
140 # title: 'FAQ' 149 # title: 'FAQ'
141 # tagging_rules_definition_title: 'What does « tagging rules » mean?' 150 # tagging_rules_definition_title: 'What does « tagging rules » mean?'
@@ -598,6 +607,9 @@ flashes:
598 # tags_reset: Tags reset 607 # tags_reset: Tags reset
599 # entries_reset: Entries reset 608 # entries_reset: Entries reset
600 # archived_reset: Archived entries deleted 609 # archived_reset: Archived entries deleted
610 # otp_enabled: Two-factor authentication enabled
611 # tagging_rules_imported: Tagging rules imported
612 # tagging_rules_not_imported: Error while importing tagging rules
601 entry: 613 entry:
602 notice: 614 notice:
603 # entry_already_saved: 'Entry already saved on %date%' 615 # entry_already_saved: 'Entry already saved on %date%'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
index ef909978..db01272f 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
@@ -136,6 +136,15 @@ config:
136 edit_rule_label: 'bearbeiten' 136 edit_rule_label: 'bearbeiten'
137 rule_label: 'Regel' 137 rule_label: 'Regel'
138 tags_label: 'Tags' 138 tags_label: 'Tags'
139 # card:
140 # new_tagging_rule: Create a tagging rule
141 # import_tagging_rules: Import tagging rules
142 # import_tagging_rules_detail: You have to select the JSON file you previously exported.
143 # export_tagging_rules: Export tagging rules
144 # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them.
145 # file_label: JSON file
146 # import_submit: Import
147 # export: Export
139 faq: 148 faq:
140 title: 'FAQ' 149 title: 'FAQ'
141 tagging_rules_definition_title: 'Was bedeuten die "Tagging-Regeln"?' 150 tagging_rules_definition_title: 'Was bedeuten die "Tagging-Regeln"?'
@@ -168,6 +177,15 @@ config:
168 and: 'Eine Regel UND eine andere' 177 and: 'Eine Regel UND eine andere'
169 matches: 'Testet, ob eine <i>Variable</i> auf eine <i>Suche</i> zutrifft (Groß- und Kleinschreibung wird nicht berücksichtigt).<br />Beispiel: <code>title matches "Fußball"</code>' 178 matches: 'Testet, ob eine <i>Variable</i> auf eine <i>Suche</i> zutrifft (Groß- und Kleinschreibung wird nicht berücksichtigt).<br />Beispiel: <code>title matches "Fußball"</code>'
170 notmatches: 'Testet, ob ein <i>Titel</i> nicht auf eine <i>Suche</i> zutrifft (Groß- und Kleinschreibung wird nicht berücksichtigt).<br />Beispiel: <code>title notmatches "Fußball"</code>' 179 notmatches: 'Testet, ob ein <i>Titel</i> nicht auf eine <i>Suche</i> zutrifft (Groß- und Kleinschreibung wird nicht berücksichtigt).<br />Beispiel: <code>title notmatches "Fußball"</code>'
180 otp:
181 # page_title: Two-factor authentication
182 # app:
183 # two_factor_code_description_1: You just enabled the OTP two factor authentication, open your OTP app and use that code to get a one time password. It'll disapear after a page reload.
184 # two_factor_code_description_2: 'You can scan that QR Code with your app:'
185 # two_factor_code_description_3: 'Also, save these backup codes in a safe place, you can use them in case you lose access to your OTP app:'
186 # two_factor_code_description_4: 'Test an OTP code from your configured app:'
187 # cancel: Cancel
188 # enable: Enable
171 189
172entry: 190entry:
173 default_title: 'Titel des Eintrags' 191 default_title: 'Titel des Eintrags'
@@ -589,6 +607,9 @@ flashes:
589 tags_reset: Tags zurücksetzen 607 tags_reset: Tags zurücksetzen
590 entries_reset: Einträge zurücksetzen 608 entries_reset: Einträge zurücksetzen
591 archived_reset: Archiverte Einträge zurücksetzen 609 archived_reset: Archiverte Einträge zurücksetzen
610 # otp_enabled: Two-factor authentication enabled
611 # tagging_rules_imported: Tagging rules imported
612 # tagging_rules_not_imported: Error while importing tagging rules
592 entry: 613 entry:
593 notice: 614 notice:
594 entry_already_saved: 'Eintrag bereits am %date% gespeichert' 615 entry_already_saved: 'Eintrag bereits am %date% gespeichert'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
index dc12015f..6d006310 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
@@ -136,6 +136,15 @@ config:
136 edit_rule_label: 'edit' 136 edit_rule_label: 'edit'
137 rule_label: 'Rule' 137 rule_label: 'Rule'
138 tags_label: 'Tags' 138 tags_label: 'Tags'
139 card:
140 new_tagging_rule: Create a tagging rule
141 import_tagging_rules: Import tagging rules
142 import_tagging_rules_detail: You have to select the JSON file you previously exported.
143 export_tagging_rules: Export tagging rules
144 export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them.
145 file_label: JSON file
146 import_submit: Import
147 export: Export
139 faq: 148 faq:
140 title: 'FAQ' 149 title: 'FAQ'
141 tagging_rules_definition_title: 'What does « tagging rules » mean?' 150 tagging_rules_definition_title: 'What does « tagging rules » mean?'
@@ -599,6 +608,8 @@ flashes:
599 entries_reset: Entries reset 608 entries_reset: Entries reset
600 archived_reset: Archived entries deleted 609 archived_reset: Archived entries deleted
601 otp_enabled: Two-factor authentication enabled 610 otp_enabled: Two-factor authentication enabled
611 tagging_rules_imported: Tagging rules imported
612 tagging_rules_not_imported: Error while importing tagging rules
602 entry: 613 entry:
603 notice: 614 notice:
604 entry_already_saved: 'Entry already saved on %date%' 615 entry_already_saved: 'Entry already saved on %date%'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
index 6eb5498d..0eb74396 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
@@ -136,6 +136,15 @@ config:
136 edit_rule_label: 'editar' 136 edit_rule_label: 'editar'
137 rule_label: 'Regla' 137 rule_label: 'Regla'
138 tags_label: 'Etiquetas' 138 tags_label: 'Etiquetas'
139 # card:
140 # new_tagging_rule: Create a tagging rule
141 # import_tagging_rules: Import tagging rules
142 # import_tagging_rules_detail: You have to select the JSON file you previously exported.
143 # export_tagging_rules: Export tagging rules
144 # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them.
145 # file_label: JSON file
146 # import_submit: Import
147 # export: Export
139 faq: 148 faq:
140 title: 'Preguntas frecuentes' 149 title: 'Preguntas frecuentes'
141 tagging_rules_definition_title: '¿Qué significa « reglas de etiquetado automático »?' 150 tagging_rules_definition_title: '¿Qué significa « reglas de etiquetado automático »?'
@@ -598,6 +607,9 @@ flashes:
598 tags_reset: Etiquetas reiniciadas 607 tags_reset: Etiquetas reiniciadas
599 entries_reset: Artículos reiniciados 608 entries_reset: Artículos reiniciados
600 # archived_reset: Archived entries deleted 609 # archived_reset: Archived entries deleted
610 # otp_enabled: Two-factor authentication enabled
611 # tagging_rules_imported: Tagging rules imported
612 # tagging_rules_not_imported: Error while importing tagging rules
601 entry: 613 entry:
602 notice: 614 notice:
603 entry_already_saved: 'Artículo ya guardado el %fecha%' 615 entry_already_saved: 'Artículo ya guardado el %fecha%'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
index 659331c6..35afdbf4 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
@@ -136,6 +136,15 @@ config:
136 # edit_rule_label: 'edit' 136 # edit_rule_label: 'edit'
137 rule_label: 'قانون' 137 rule_label: 'قانون'
138 tags_label: 'برچسب‌ها' 138 tags_label: 'برچسب‌ها'
139 # card:
140 # new_tagging_rule: Create a tagging rule
141 # import_tagging_rules: Import tagging rules
142 # import_tagging_rules_detail: You have to select the JSON file you previously exported.
143 # export_tagging_rules: Export tagging rules
144 # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them.
145 # file_label: JSON file
146 # import_submit: Import
147 # export: Export
139 faq: 148 faq:
140 title: 'پرسش‌های متداول' 149 title: 'پرسش‌های متداول'
141 tagging_rules_definition_title: 'برچسب‌گذاری خودکار یعنی چه؟' 150 tagging_rules_definition_title: 'برچسب‌گذاری خودکار یعنی چه؟'
@@ -598,6 +607,9 @@ flashes:
598 # tags_reset: Tags reset 607 # tags_reset: Tags reset
599 # entries_reset: Entries reset 608 # entries_reset: Entries reset
600 # archived_reset: Archived entries deleted 609 # archived_reset: Archived entries deleted
610 # otp_enabled: Two-factor authentication enabled
611 # tagging_rules_imported: Tagging rules imported
612 # tagging_rules_not_imported: Error while importing tagging rules
601 entry: 613 entry:
602 notice: 614 notice:
603 entry_already_saved: 'این مقاله در تاریخ %date% ذخیره شده بود' 615 entry_already_saved: 'این مقاله در تاریخ %date% ذخیره شده بود'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
index f19d8c4c..8a79b02f 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
@@ -136,6 +136,15 @@ config:
136 edit_rule_label: "éditer" 136 edit_rule_label: "éditer"
137 rule_label: "Règle" 137 rule_label: "Règle"
138 tags_label: "Tags" 138 tags_label: "Tags"
139 card:
140 new_tagging_rule: Créer une règle
141 import_tagging_rules: Importer des règles
142 import_tagging_rules_detail: Vous devez sélectionné un fichier JSON que vous avez précédemment exporté.
143 export_tagging_rules: Exporter les règles
144 export_tagging_rules_detail: Un fichier JSON sera téléchargé et vous pourrez l'utiliser pour ré-importer les règles ou comme sauvegarde.
145 file_label: Fichier JSON
146 import_submit: Importer
147 export: Export
139 faq: 148 faq:
140 title: "FAQ" 149 title: "FAQ"
141 tagging_rules_definition_title: "Que signifient les règles de tag automatiques ?" 150 tagging_rules_definition_title: "Que signifient les règles de tag automatiques ?"
@@ -600,6 +609,8 @@ flashes:
600 entries_reset: "Articles supprimés" 609 entries_reset: "Articles supprimés"
601 archived_reset: "Articles archivés supprimés" 610 archived_reset: "Articles archivés supprimés"
602 otp_enabled: "Authentification à double-facteur activée" 611 otp_enabled: "Authentification à double-facteur activée"
612 tagging_rules_imported: Règles bien importées
613 tagging_rules_not_imported: Impossible d'importer les règles
603 entry: 614 entry:
604 notice: 615 notice:
605 entry_already_saved: "Article déjà sauvegardé le %date%" 616 entry_already_saved: "Article déjà sauvegardé le %date%"
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
index 700a37d2..859bbb14 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
@@ -101,6 +101,7 @@ config:
101 # login_label: 'Login (can not be changed)' 101 # login_label: 'Login (can not be changed)'
102 name_label: 'Nome' 102 name_label: 'Nome'
103 email_label: 'E-mail' 103 email_label: 'E-mail'
104 two_factor:
104 # emailTwoFactor_label: 'Using email (receive a code by email)' 105 # emailTwoFactor_label: 'Using email (receive a code by email)'
105 # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' 106 # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)'
106 # table_method: Method 107 # table_method: Method
@@ -135,6 +136,15 @@ config:
135 edit_rule_label: 'modifica' 136 edit_rule_label: 'modifica'
136 rule_label: 'Regola' 137 rule_label: 'Regola'
137 tags_label: 'Etichetta' 138 tags_label: 'Etichetta'
139 # card:
140 # new_tagging_rule: Create a tagging rule
141 # import_tagging_rules: Import tagging rules
142 # import_tagging_rules_detail: You have to select the JSON file you previously exported.
143 # export_tagging_rules: Export tagging rules
144 # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them.
145 # file_label: JSON file
146 # import_submit: Import
147 # export: Export
138 faq: 148 faq:
139 title: 'FAQ' 149 title: 'FAQ'
140 tagging_rules_definition_title: 'Cosa significa « regole di etichettatura » ?' 150 tagging_rules_definition_title: 'Cosa significa « regole di etichettatura » ?'
@@ -597,6 +607,9 @@ flashes:
597 tags_reset: Reset etichette 607 tags_reset: Reset etichette
598 entries_reset: Reset articoli 608 entries_reset: Reset articoli
599 # archived_reset: Archived entries deleted 609 # archived_reset: Archived entries deleted
610 # otp_enabled: Two-factor authentication enabled
611 # tagging_rules_imported: Tagging rules imported
612 # tagging_rules_not_imported: Error while importing tagging rules
600 entry: 613 entry:
601 notice: 614 notice:
602 entry_already_saved: 'Contenuto già salvato in data %date%' 615 entry_already_saved: 'Contenuto già salvato in data %date%'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
index 023aa2e5..7d928613 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
@@ -101,6 +101,7 @@ config:
101 # login_label: 'Login (can not be changed)' 101 # login_label: 'Login (can not be changed)'
102 name_label: 'Nom' 102 name_label: 'Nom'
103 email_label: 'Adreça de corrièl' 103 email_label: 'Adreça de corrièl'
104 two_factor:
104 # emailTwoFactor_label: 'Using email (receive a code by email)' 105 # emailTwoFactor_label: 'Using email (receive a code by email)'
105 # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' 106 # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)'
106 # table_method: Method 107 # table_method: Method
@@ -135,6 +136,15 @@ config:
135 edit_rule_label: 'modificar' 136 edit_rule_label: 'modificar'
136 rule_label: 'Règla' 137 rule_label: 'Règla'
137 tags_label: 'Etiquetas' 138 tags_label: 'Etiquetas'
139 # card:
140 # new_tagging_rule: Create a tagging rule
141 # import_tagging_rules: Import tagging rules
142 # import_tagging_rules_detail: You have to select the JSON file you previously exported.
143 # export_tagging_rules: Export tagging rules
144 # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them.
145 # file_label: JSON file
146 # import_submit: Import
147 # export: Export
138 faq: 148 faq:
139 title: 'FAQ' 149 title: 'FAQ'
140 tagging_rules_definition_title: "Qué significa las règlas d'etiquetas automaticas ?" 150 tagging_rules_definition_title: "Qué significa las règlas d'etiquetas automaticas ?"
@@ -597,6 +607,9 @@ flashes:
597 tags_reset: Etiquetas levadas 607 tags_reset: Etiquetas levadas
598 entries_reset: Articles levats 608 entries_reset: Articles levats
599 archived_reset: Articles archivat suprimits 609 archived_reset: Articles archivat suprimits
610 # otp_enabled: Two-factor authentication enabled
611 # tagging_rules_imported: Tagging rules imported
612 # tagging_rules_not_imported: Error while importing tagging rules
600 entry: 613 entry:
601 notice: 614 notice:
602 entry_already_saved: 'Article ja salvagardat lo %date%' 615 entry_already_saved: 'Article ja salvagardat lo %date%'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
index 876db24a..8e7ad7f2 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
@@ -101,6 +101,7 @@ config:
101 # login_label: 'Login (can not be changed)' 101 # login_label: 'Login (can not be changed)'
102 name_label: 'Nazwa' 102 name_label: 'Nazwa'
103 email_label: 'Adres email' 103 email_label: 'Adres email'
104 two_factor:
104 # emailTwoFactor_label: 'Using email (receive a code by email)' 105 # emailTwoFactor_label: 'Using email (receive a code by email)'
105 # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' 106 # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)'
106 # table_method: Method 107 # table_method: Method
@@ -135,6 +136,15 @@ config:
135 edit_rule_label: 'edytuj' 136 edit_rule_label: 'edytuj'
136 rule_label: 'Reguła' 137 rule_label: 'Reguła'
137 tags_label: 'Tagi' 138 tags_label: 'Tagi'
139 # card:
140 # new_tagging_rule: Create a tagging rule
141 # import_tagging_rules: Import tagging rules
142 # import_tagging_rules_detail: You have to select the JSON file you previously exported.
143 # export_tagging_rules: Export tagging rules
144 # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them.
145 # file_label: JSON file
146 # import_submit: Import
147 # export: Export
138 faq: 148 faq:
139 title: 'FAQ' 149 title: 'FAQ'
140 tagging_rules_definition_title: 'Co oznaczają « reguły tagowania » ?' 150 tagging_rules_definition_title: 'Co oznaczają « reguły tagowania » ?'
@@ -597,6 +607,9 @@ flashes:
597 tags_reset: Zresetuj tagi 607 tags_reset: Zresetuj tagi
598 entries_reset: Zresetuj wpisy 608 entries_reset: Zresetuj wpisy
599 archived_reset: Zarchiwizowane wpisy usunięte 609 archived_reset: Zarchiwizowane wpisy usunięte
610 # otp_enabled: Two-factor authentication enabled
611 # tagging_rules_imported: Tagging rules imported
612 # tagging_rules_not_imported: Error while importing tagging rules
600 entry: 613 entry:
601 notice: 614 notice:
602 entry_already_saved: 'Wpis już został dodany %date%' 615 entry_already_saved: 'Wpis już został dodany %date%'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
index 786288c1..ee45c085 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
@@ -101,6 +101,7 @@ config:
101 # login_label: 'Login (can not be changed)' 101 # login_label: 'Login (can not be changed)'
102 name_label: 'Nome' 102 name_label: 'Nome'
103 email_label: 'E-mail' 103 email_label: 'E-mail'
104 two_factor:
104 # emailTwoFactor_label: 'Using email (receive a code by email)' 105 # emailTwoFactor_label: 'Using email (receive a code by email)'
105 # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' 106 # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)'
106 # table_method: Method 107 # table_method: Method
@@ -135,6 +136,15 @@ config:
135 edit_rule_label: 'editar' 136 edit_rule_label: 'editar'
136 rule_label: 'Regras' 137 rule_label: 'Regras'
137 tags_label: 'Tags' 138 tags_label: 'Tags'
139 # card:
140 # new_tagging_rule: Create a tagging rule
141 # import_tagging_rules: Import tagging rules
142 # import_tagging_rules_detail: You have to select the JSON file you previously exported.
143 # export_tagging_rules: Export tagging rules
144 # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them.
145 # file_label: JSON file
146 # import_submit: Import
147 # export: Export
138 faq: 148 faq:
139 title: 'FAQ' 149 title: 'FAQ'
140 tagging_rules_definition_title: 'O que as « regras de tags » significam?' 150 tagging_rules_definition_title: 'O que as « regras de tags » significam?'
@@ -597,6 +607,9 @@ flashes:
597 # tags_reset: Tags reset 607 # tags_reset: Tags reset
598 # entries_reset: Entries reset 608 # entries_reset: Entries reset
599 # archived_reset: Archived entries deleted 609 # archived_reset: Archived entries deleted
610 # otp_enabled: Two-factor authentication enabled
611 # tagging_rules_imported: Tagging rules imported
612 # tagging_rules_not_imported: Error while importing tagging rules
600 entry: 613 entry:
601 notice: 614 notice:
602 entry_already_saved: 'Entrada já foi salva em %date%' 615 entry_already_saved: 'Entrada já foi salva em %date%'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
index 0d8904fe..edfc77a2 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
@@ -101,6 +101,7 @@ config:
101 # login_label: 'Login (can not be changed)' 101 # login_label: 'Login (can not be changed)'
102 name_label: 'Nume' 102 name_label: 'Nume'
103 email_label: 'E-mail' 103 email_label: 'E-mail'
104 two_factor:
104 # emailTwoFactor_label: 'Using email (receive a code by email)' 105 # emailTwoFactor_label: 'Using email (receive a code by email)'
105 # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' 106 # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)'
106 # table_method: Method 107 # table_method: Method
@@ -135,6 +136,15 @@ config:
135 # edit_rule_label: 'edit' 136 # edit_rule_label: 'edit'
136 # rule_label: 'Rule' 137 # rule_label: 'Rule'
137 # tags_label: 'Tags' 138 # tags_label: 'Tags'
139 # card:
140 # new_tagging_rule: Create a tagging rule
141 # import_tagging_rules: Import tagging rules
142 # import_tagging_rules_detail: You have to select the JSON file you previously exported.
143 # export_tagging_rules: Export tagging rules
144 # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them.
145 # file_label: JSON file
146 # import_submit: Import
147 # export: Export
138 # faq: 148 # faq:
139 # title: 'FAQ' 149 # title: 'FAQ'
140 # tagging_rules_definition_title: 'What does « tagging rules » mean?' 150 # tagging_rules_definition_title: 'What does « tagging rules » mean?'
@@ -425,9 +435,9 @@ tag:
425 rename: 435 rename:
426 # placeholder: 'You can update tag name.' 436 # placeholder: 'You can update tag name.'
427 437
428# export: 438export:
429# 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>' 439 # 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>'
430# unknown: 'Unknown' 440 # unknown: 'Unknown'
431 441
432import: 442import:
433 # page_title: 'Import' 443 # page_title: 'Import'
@@ -597,6 +607,9 @@ flashes:
597 # tags_reset: Tags reset 607 # tags_reset: Tags reset
598 # entries_reset: Entries reset 608 # entries_reset: Entries reset
599 # archived_reset: Archived entries deleted 609 # archived_reset: Archived entries deleted
610 # otp_enabled: Two-factor authentication enabled
611 # tagging_rules_imported: Tagging rules imported
612 # tagging_rules_not_imported: Error while importing tagging rules
600 entry: 613 entry:
601 notice: 614 notice:
602 # entry_already_saved: 'Entry already saved on %date%' 615 # entry_already_saved: 'Entry already saved on %date%'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml
index 04daf855..c99da444 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml
@@ -76,6 +76,7 @@ config:
76 redirect_current_page: 'На текущую страницу' 76 redirect_current_page: 'На текущую страницу'
77 pocket_consumer_key_label: "Ключ от Pocket для импорта контента" 77 pocket_consumer_key_label: "Ключ от Pocket для импорта контента"
78 android_configuration: "Настройте Ваше Android приложение" 78 android_configuration: "Настройте Ваше Android приложение"
79 # android_instruction: "Touch here to prefill your Android application"
79 help_theme: "wallabag настраиваемый, здесь Вы можете выбрать тему." 80 help_theme: "wallabag настраиваемый, здесь Вы можете выбрать тему."
80 help_items_per_page: "Вы можете выбрать количество отображаемых записей на странице." 81 help_items_per_page: "Вы можете выбрать количество отображаемых записей на странице."
81 help_reading_speed: "wallabag посчитает сколько времени занимает чтение каждой записи. Вы можете определить здесь, как быстро вы читаете. wallabag пересчитает время чтения для каждой записи." 82 help_reading_speed: "wallabag посчитает сколько времени занимает чтение каждой записи. Вы можете определить здесь, как быстро вы читаете. wallabag пересчитает время чтения для каждой записи."
@@ -93,12 +94,14 @@ config:
93 unread: 'непрочитанные' 94 unread: 'непрочитанные'
94 starred: 'помеченные' 95 starred: 'помеченные'
95 archive: 'архивные' 96 archive: 'архивные'
97 # all: 'All'
96 feed_limit: 'Количество записей в фиде' 98 feed_limit: 'Количество записей в фиде'
97 form_user: 99 form_user:
98 # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option." 100 # two_factor_description: "Enabling two factor authentication means you'll receive an email with a code OR need to use an OTP app (like Google Authenticator, Authy or FreeOTP) to get a one time code on every new untrusted connection. You can't choose both option."
99 # login_label: 'Login (can not be changed)' 101 # login_label: 'Login (can not be changed)'
100 name_label: 'Имя' 102 name_label: 'Имя'
101 email_label: 'Email' 103 email_label: 'Email'
104 two_factor:
102 # emailTwoFactor_label: 'Using email (receive a code by email)' 105 # emailTwoFactor_label: 'Using email (receive a code by email)'
103 # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' 106 # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)'
104 # table_method: Method 107 # table_method: Method
@@ -119,6 +122,7 @@ config:
119 annotations: "Удалить все аннотации" 122 annotations: "Удалить все аннотации"
120 tags: "Удалить все теги" 123 tags: "Удалить все теги"
121 entries: "Удалить все записи" 124 entries: "Удалить все записи"
125 # archived: Remove ALL archived entries
122 confirm: "Вы уверены? (Данные будут БЕЗВОЗВРАТНО удалены, эти действия необратимы)" 126 confirm: "Вы уверены? (Данные будут БЕЗВОЗВРАТНО удалены, эти действия необратимы)"
123 form_password: 127 form_password:
124 description: "Здесь Вы можете поменять своя пароль. Ваш пароль должен быть длиннее 8 символов." 128 description: "Здесь Вы можете поменять своя пароль. Ваш пароль должен быть длиннее 8 символов."
@@ -132,6 +136,15 @@ config:
132 edit_rule_label: 'изменить' 136 edit_rule_label: 'изменить'
133 rule_label: 'Правило' 137 rule_label: 'Правило'
134 tags_label: 'теги' 138 tags_label: 'теги'
139 # card:
140 # new_tagging_rule: Create a tagging rule
141 # import_tagging_rules: Import tagging rules
142 # import_tagging_rules_detail: You have to select the JSON file you previously exported.
143 # export_tagging_rules: Export tagging rules
144 # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them.
145 # file_label: JSON file
146 # import_submit: Import
147 # export: Export
135 faq: 148 faq:
136 title: 'FAQ' 149 title: 'FAQ'
137 tagging_rules_definition_title: 'Что значит "правило тегирования"?' 150 tagging_rules_definition_title: 'Что значит "правило тегирования"?'
@@ -163,6 +176,7 @@ config:
163 or: 'Одно правило ИЛИ другое' 176 or: 'Одно правило ИЛИ другое'
164 and: 'Одно правило И другое' 177 and: 'Одно правило И другое'
165 matches: 'Тесты, в которых <i> тема </i> соответствует <i> поиску </i> (без учета регистра). Пример: <code> title matches "футбол" </code>' 178 matches: 'Тесты, в которых <i> тема </i> соответствует <i> поиску </i> (без учета регистра). Пример: <code> title matches "футбол" </code>'
179 # notmatches: 'Tests that a <i>subject</i> doesn''t match match a <i>search</i> (case-insensitive).<br />Example: <code>title notmatches "football"</code>'
166 otp: 180 otp:
167 # page_title: Two-factor authentication 181 # page_title: Two-factor authentication
168 # app: 182 # app:
@@ -183,6 +197,7 @@ entry:
183 filtered_tags: 'Отфильтрованные по тегу:' 197 filtered_tags: 'Отфильтрованные по тегу:'
184 filtered_search: 'Отфильтрованные по поиску:' 198 filtered_search: 'Отфильтрованные по поиску:'
185 untagged: 'Записи без тегов' 199 untagged: 'Записи без тегов'
200 # all: 'All entries'
186 list: 201 list:
187 number_on_the_page: '{0} Записей не обнаружено.|{1} Одна запись.|]1,Inf[ Найдено %count% записей.' 202 number_on_the_page: '{0} Записей не обнаружено.|{1} Одна запись.|]1,Inf[ Найдено %count% записей.'
188 reading_time: 'расчетное время чтения' 203 reading_time: 'расчетное время чтения'
@@ -204,6 +219,8 @@ entry:
204 unread_label: 'Непрочитанная' 219 unread_label: 'Непрочитанная'
205 preview_picture_label: 'Есть картинка предварительного просмотра' 220 preview_picture_label: 'Есть картинка предварительного просмотра'
206 preview_picture_help: 'Картинка предварительного просмотра' 221 preview_picture_help: 'Картинка предварительного просмотра'
222 # is_public_label: 'Has a public link'
223 # is_public_help: 'Public link'
207 language_label: 'Язык' 224 language_label: 'Язык'
208 http_status_label: 'статус HTTP' 225 http_status_label: 'статус HTTP'
209 reading_time: 226 reading_time:
@@ -242,6 +259,8 @@ entry:
242 original_article: 'оригинал' 259 original_article: 'оригинал'
243 annotations_on_the_entry: '{0} Нет аннотации|{1} Одна аннотация|]1,Inf[ %count% аннотаций' 260 annotations_on_the_entry: '{0} Нет аннотации|{1} Одна аннотация|]1,Inf[ %count% аннотаций'
244 created_at: 'Дата создания' 261 created_at: 'Дата создания'
262 # published_at: 'Publication date'
263 # published_by: 'Published by'
245 # provided_by: 'Provided by' 264 # provided_by: 'Provided by'
246 new: 265 new:
247 page_title: 'Сохранить новую запись' 266 page_title: 'Сохранить новую запись'
@@ -255,10 +274,12 @@ entry:
255 title_label: 'Название' 274 title_label: 'Название'
256 url_label: 'Ссылка' 275 url_label: 'Ссылка'
257 # origin_url_label: 'Origin url (from where you found that entry)' 276 # origin_url_label: 'Origin url (from where you found that entry)'
258 is_public_label: 'Публичная'
259 save_label: 'Сохранить' 277 save_label: 'Сохранить'
260 public: 278 public:
261 shared_by_wallabag: "Запись была опубликована <a href='%wallabag_instance%'>wallabag</a>" 279 shared_by_wallabag: "Запись была опубликована <a href='%wallabag_instance%'>wallabag</a>"
280 confirm:
281 # delete: "Are you sure you want to remove that article?"
282 # delete_tag: "Are you sure you want to remove that tag from that article?"
262 metadata: 283 metadata:
263 # reading_time: "Estimated reading time" 284 # reading_time: "Estimated reading time"
264 # reading_time_minutes_short: "%readingTime% min" 285 # reading_time_minutes_short: "%readingTime% min"
@@ -414,9 +435,9 @@ tag:
414 rename: 435 rename:
415 # placeholder: 'You can update tag name.' 436 # placeholder: 'You can update tag name.'
416 437
417# export: 438export:
418# 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>' 439 # 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>'
419# unknown: 'Unknown' 440 # unknown: 'Unknown'
420 441
421import: 442import:
422 page_title: 'Импорт' 443 page_title: 'Импорт'
@@ -544,6 +565,28 @@ user:
544 delete: "Удалить" 565 delete: "Удалить"
545 delete_confirm: "Вы уверены?" 566 delete_confirm: "Вы уверены?"
546 back_to_list: "Назад к списку" 567 back_to_list: "Назад к списку"
568 search:
569 # placeholder: Filter by login or email
570
571site_credential:
572 # page_title: Site credentials management
573 # new_site_credential: Create a credential
574 # edit_site_credential: Edit an existing credential
575 # description: "Here you can manage all credentials for sites which required them (create, edit and delete), like a paywall, an authentication, etc."
576 # list:
577 # actions: Actions
578 # edit_action: Edit
579 # yes: Yes
580 # no: No
581 # create_new_one: Create a new credential
582 # form:
583 # username_label: 'Login'
584 # host_label: 'Host (subdomain.example.org, .example.org, etc.)'
585 # password_label: 'Password'
586 # save: Save
587 # delete: Delete
588 # delete_confirm: Are you sure?
589 # back_to_list: Back to list
547 590
548error: 591error:
549 page_title: "Произошла ошибка" 592 page_title: "Произошла ошибка"
@@ -563,6 +606,10 @@ flashes:
563 annotations_reset: "Аннотации сброшены" 606 annotations_reset: "Аннотации сброшены"
564 tags_reset: "Теги сброшены" 607 tags_reset: "Теги сброшены"
565 entries_reset: "Записи сброшены" 608 entries_reset: "Записи сброшены"
609 # archived_reset: Archived entries deleted
610 # otp_enabled: Two-factor authentication enabled
611 # tagging_rules_imported: Tagging rules imported
612 # tagging_rules_not_imported: Error while importing tagging rules
566 entry: 613 entry:
567 notice: 614 notice:
568 entry_already_saved: 'Запись была сохранена ранее %date%' 615 entry_already_saved: 'Запись была сохранена ранее %date%'
@@ -599,3 +646,8 @@ flashes:
599 added: 'Пользователь "%username%" добавлен' 646 added: 'Пользователь "%username%" добавлен'
600 updated: 'Пользователь "%username%" обновлен' 647 updated: 'Пользователь "%username%" обновлен'
601 deleted: 'Пользователь "%username%" удален' 648 deleted: 'Пользователь "%username%" удален'
649 site_credential:
650 notice:
651 # added: 'Site credential for "%host%" added'
652 # updated: 'Site credential for "%host%" updated'
653 # deleted: 'Site credential for "%host%" deleted'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml
index 66642029..9927d059 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml
@@ -101,6 +101,7 @@ config:
101 # login_label: 'Login (can not be changed)' 101 # login_label: 'Login (can not be changed)'
102 name_label: 'ชื่อ' 102 name_label: 'ชื่อ'
103 email_label: 'อีเมล' 103 email_label: 'อีเมล'
104 two_factor:
104 # emailTwoFactor_label: 'Using email (receive a code by email)' 105 # emailTwoFactor_label: 'Using email (receive a code by email)'
105 # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' 106 # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)'
106 # table_method: Method 107 # table_method: Method
@@ -135,6 +136,15 @@ config:
135 edit_rule_label: 'ปรับแก้' 136 edit_rule_label: 'ปรับแก้'
136 rule_label: 'ข้อบังคับ' 137 rule_label: 'ข้อบังคับ'
137 tags_label: 'แท็ก' 138 tags_label: 'แท็ก'
139 # card:
140 # new_tagging_rule: Create a tagging rule
141 # import_tagging_rules: Import tagging rules
142 # import_tagging_rules_detail: You have to select the JSON file you previously exported.
143 # export_tagging_rules: Export tagging rules
144 # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them.
145 # file_label: JSON file
146 # import_submit: Import
147 # export: Export
138 faq: 148 faq:
139 title: 'FAQ' 149 title: 'FAQ'
140 tagging_rules_definition_title: 'ข้อบังคับการแท็กคืออะไร?' 150 tagging_rules_definition_title: 'ข้อบังคับการแท็กคืออะไร?'
@@ -251,6 +261,7 @@ entry:
251 created_at: 'วันที่สร้าง' 261 created_at: 'วันที่สร้าง'
252 published_at: 'วันที่ประกาศ' 262 published_at: 'วันที่ประกาศ'
253 published_by: 'ประกาศโดย' 263 published_by: 'ประกาศโดย'
264 # provided_by: 'Provided by'
254 new: 265 new:
255 page_title: 'บันทึกรายการใหม่' 266 page_title: 'บันทึกรายการใหม่'
256 placeholder: 'http://website.com' 267 placeholder: 'http://website.com'
@@ -262,6 +273,7 @@ entry:
262 page_title: 'แก้ไขรายการ' 273 page_title: 'แก้ไขรายการ'
263 title_label: 'หัวข้อ' 274 title_label: 'หัวข้อ'
264 url_label: 'Url' 275 url_label: 'Url'
276 # origin_url_label: 'Origin url (from where you found that entry)'
265 save_label: 'บันทึก' 277 save_label: 'บันทึก'
266 public: 278 public:
267 shared_by_wallabag: "บทความนี้จะมีการแชร์โดย %username% กับ <a href='%wallabag_instance%'>wallabag</a>" 279 shared_by_wallabag: "บทความนี้จะมีการแชร์โดย %username% กับ <a href='%wallabag_instance%'>wallabag</a>"
@@ -595,6 +607,9 @@ flashes:
595 tags_reset: รีเซ็ตแท็ก 607 tags_reset: รีเซ็ตแท็ก
596 entries_reset: รีเซ็ตรายการ 608 entries_reset: รีเซ็ตรายการ
597 archived_reset: การลบเอกสารของรายการ 609 archived_reset: การลบเอกสารของรายการ
610 # otp_enabled: Two-factor authentication enabled
611 # tagging_rules_imported: Tagging rules imported
612 # tagging_rules_not_imported: Error while importing tagging rules
598 entry: 613 entry:
599 notice: 614 notice:
600 entry_already_saved: 'รายการพร้อมบันทึกที่ %date%' 615 entry_already_saved: 'รายการพร้อมบันทึกที่ %date%'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
index 6ee723f1..60fa44d5 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
@@ -101,6 +101,7 @@ config:
101 # login_label: 'Login (can not be changed)' 101 # login_label: 'Login (can not be changed)'
102 name_label: 'İsim' 102 name_label: 'İsim'
103 email_label: 'E-posta' 103 email_label: 'E-posta'
104 two_factor:
104 # emailTwoFactor_label: 'Using email (receive a code by email)' 105 # emailTwoFactor_label: 'Using email (receive a code by email)'
105 # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)' 106 # googleTwoFactor_label: 'Using an OTP app (open the app, like Google Authenticator, Authy or FreeOTP, to get a one time code)'
106 # table_method: Method 107 # table_method: Method
@@ -135,6 +136,15 @@ config:
135 # edit_rule_label: 'edit' 136 # edit_rule_label: 'edit'
136 rule_label: 'Kural' 137 rule_label: 'Kural'
137 tags_label: 'Etiketler' 138 tags_label: 'Etiketler'
139 # card:
140 # new_tagging_rule: Create a tagging rule
141 # import_tagging_rules: Import tagging rules
142 # import_tagging_rules_detail: You have to select the JSON file you previously exported.
143 # export_tagging_rules: Export tagging rules
144 # export_tagging_rules_detail: This will download a JSON file that you can use to import tagging rules elsewhere or to backup them.
145 # file_label: JSON file
146 # import_submit: Import
147 # export: Export
138 faq: 148 faq:
139 title: 'S.S.S.' 149 title: 'S.S.S.'
140 tagging_rules_definition_title: '« etiketleme kuralları » ne anlama geliyor?' 150 tagging_rules_definition_title: '« etiketleme kuralları » ne anlama geliyor?'
@@ -209,6 +219,8 @@ entry:
209 unread_label: 'Okunmayan' 219 unread_label: 'Okunmayan'
210 preview_picture_label: 'Resim önizlemesi varsa' 220 preview_picture_label: 'Resim önizlemesi varsa'
211 preview_picture_help: 'Resim önizlemesi' 221 preview_picture_help: 'Resim önizlemesi'
222 # is_public_label: 'Has a public link'
223 # is_public_help: 'Public link'
212 language_label: 'Dil' 224 language_label: 'Dil'
213 # http_status_label: 'HTTP status' 225 # http_status_label: 'HTTP status'
214 reading_time: 226 reading_time:
@@ -423,9 +435,9 @@ tag:
423 rename: 435 rename:
424 # placeholder: 'You can update tag name.' 436 # placeholder: 'You can update tag name.'
425 437
426# export: 438export:
427# 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>' 439 # 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>'
428# unknown: 'Unknown' 440 # unknown: 'Unknown'
429 441
430import: 442import:
431 page_title: 'İçe Aktar' 443 page_title: 'İçe Aktar'
@@ -556,6 +568,26 @@ user:
556 search: 568 search:
557 # placeholder: Filter by username or email 569 # placeholder: Filter by username or email
558 570
571site_credential:
572 # page_title: Site credentials management
573 # new_site_credential: Create a credential
574 # edit_site_credential: Edit an existing credential
575 # description: "Here you can manage all credentials for sites which required them (create, edit and delete), like a paywall, an authentication, etc."
576 # list:
577 # actions: Actions
578 # edit_action: Edit
579 # yes: Yes
580 # no: No
581 # create_new_one: Create a new credential
582 # form:
583 # username_label: 'Login'
584 # host_label: 'Host (subdomain.example.org, .example.org, etc.)'
585 # password_label: 'Password'
586 # save: Save
587 # delete: Delete
588 # delete_confirm: Are you sure?
589 # back_to_list: Back to list
590
559error: 591error:
560 # page_title: An error occurred 592 # page_title: An error occurred
561 593
@@ -567,13 +599,17 @@ flashes:
567 password_not_updated_demo: "In demonstration mode, you can't change password for this user." 599 password_not_updated_demo: "In demonstration mode, you can't change password for this user."
568 user_updated: 'Bilgiler güncellendi' 600 user_updated: 'Bilgiler güncellendi'
569 feed_updated: 'RSS bilgiler güncellendi' 601 feed_updated: 'RSS bilgiler güncellendi'
570 tagging_rules_updated: 'Tagging rules updated' 602 # tagging_rules_updated: 'Tagging rules updated'
571 tagging_rules_deleted: 'Tagging rule deleted' 603 # tagging_rules_deleted: 'Tagging rule deleted'
572 feed_token_updated: 'RSS token updated' 604 # feed_token_updated: 'RSS token updated'
605 # feed_token_revoked: 'RSS token revoked'
573 # annotations_reset: Annotations reset 606 # annotations_reset: Annotations reset
574 # tags_reset: Tags reset 607 # tags_reset: Tags reset
575 # entries_reset: Entries reset 608 # entries_reset: Entries reset
576 # archived_reset: Archived entries deleted 609 # archived_reset: Archived entries deleted
610 # otp_enabled: Two-factor authentication enabled
611 # tagging_rules_imported: Tagging rules imported
612 # tagging_rules_not_imported: Error while importing tagging rules
577 entry: 613 entry:
578 notice: 614 notice:
579 entry_already_saved: 'Entry already saved on %date%' 615 entry_already_saved: 'Entry already saved on %date%'
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig
index eba4539f..f719bea2 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig
@@ -291,6 +291,34 @@
291 291
292 {{ form_rest(form.new_tagging_rule) }} 292 {{ form_rest(form.new_tagging_rule) }}
293 </form> 293 </form>
294
295 <div class="row">
296 <h3>{{ 'config.form_rules.card.import_tagging_rules'|trans }}</h3>
297 <p>{{ 'config.form_rules.card.import_tagging_rules_detail'|trans }}</p>
298 </div>
299
300 {{ form_start(form.import_tagging_rule) }}
301 {{ form_errors(form.import_tagging_rule) }}
302
303 <fieldset class="w500p inline">
304 <div class="row">
305 {{ form_label(form.import_tagging_rule.file) }}
306 {{ form_errors(form.import_tagging_rule.file) }}
307 {{ form_widget(form.import_tagging_rule.file) }}
308 </div>
309 </fieldset>
310
311 {{ form_rest(form.import_tagging_rule) }}
312 </form>
313
314 {% if app.user.config.taggingRules is not empty %}
315 <div class="row">
316 <h3>{{ 'config.form_rules.card.export_tagging_rules'|trans }}</h3>
317 <p>{{ 'config.form_rules.card.export_tagging_rules_detail'|trans }}</p>
318 <p><a href="{{ path('export_tagging_rule') }}" class="waves-effect waves-light btn">{{ 'config.form_rules.export'|trans }}</a></p>
319 </div>
320 {% endif %}
321
294 <div class="row"> 322 <div class="row">
295 <div class="input-field col s12"> 323 <div class="input-field col s12">
296 <h3>{{ 'config.form_rules.faq.title'|trans }}</h3> 324 <h3>{{ 'config.form_rules.faq.title'|trans }}</h3>
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig
index 990546e8..d8e9694d 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig
@@ -307,28 +307,77 @@
307 </div> 307 </div>
308 {% endif %} 308 {% endif %}
309 309
310 {{ form_start(form.new_tagging_rule) }} 310 <ul class="row">
311 {{ form_errors(form.new_tagging_rule) }} 311 <li class="col l6 m6 s12">
312 312 <div class="card">
313 <div class="row"> 313 <div class="card-content">
314 <div class="input-field col s12"> 314 <span class="card-title">{{ 'config.form_rules.card.new_tagging_rule'|trans }}</span>
315 {{ form_label(form.new_tagging_rule.rule) }} 315
316 {{ form_errors(form.new_tagging_rule.rule) }} 316 {{ form_start(form.new_tagging_rule) }}
317 {{ form_widget(form.new_tagging_rule.rule) }} 317 {{ form_errors(form.new_tagging_rule) }}
318
319 <div class="row">
320 <div class="input-field col s12">
321 {{ form_label(form.new_tagging_rule.rule) }}
322 {{ form_errors(form.new_tagging_rule.rule) }}
323 {{ form_widget(form.new_tagging_rule.rule) }}
324 </div>
325 </div>
326
327 <div class="row">
328 <div class="input-field col s12">
329 {{ form_label(form.new_tagging_rule.tags) }}
330 {{ form_errors(form.new_tagging_rule.tags) }}
331 {{ form_widget(form.new_tagging_rule.tags) }}
332 </div>
333 </div>
334
335 {{ form_widget(form.new_tagging_rule.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
336 {{ form_rest(form.new_tagging_rule) }}
337 </form>
338 </div>
318 </div> 339 </div>
319 </div> 340 </li>
320 341 <li class="col l6 m6 s12">
321 <div class="row"> 342 <div class="card z-depth-1">
322 <div class="input-field col s12"> 343 <div class="card-content">
323 {{ form_label(form.new_tagging_rule.tags) }} 344 <span class="card-title">{{ 'config.form_rules.card.import_tagging_rules'|trans }}</span>
324 {{ form_errors(form.new_tagging_rule.tags) }} 345 <p>{{ 'config.form_rules.card.import_tagging_rules_detail'|trans }}</p>
325 {{ form_widget(form.new_tagging_rule.tags) }} 346 {{ form_start(form.import_tagging_rule) }}
347 {{ form_errors(form.import_tagging_rule) }}
348 <div class="row">
349 <div class="file-field input-field col s12">
350 {{ form_errors(form.import_tagging_rule.file) }}
351 <div class="btn">
352 <span>{{ form.import_tagging_rule.file.vars.label|trans }}</span>
353 {{ form_widget(form.import_tagging_rule.file) }}
354 </div>
355 <div class="file-path-wrapper">
356 <input class="file-path validate" type="text">
357 </div>
358 </div>
359 </div>
360
361 {{ form_widget(form.import_tagging_rule.import, { 'attr': {'class': 'btn waves-effect waves-light'} }) }}
362
363 {{ form_rest(form.import_tagging_rule) }}
364 </form>
365 </div>
326 </div> 366 </div>
327 </div> 367 </li>
328 368 {% if app.user.config.taggingRules is not empty %}
329 {{ form_widget(form.new_tagging_rule.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} 369 <li class="col l6 m6 s12">
330 {{ form_rest(form.new_tagging_rule) }} 370 <div class="card z-depth-1">
331 </form> 371 <div class="card-content">
372 <span class="card-title">{{ 'config.form_rules.card.export_tagging_rules'|trans }}</span>
373 <p>{{ 'config.form_rules.card.export_tagging_rules_detail'|trans }}</p>
374 <br/>
375 <p><a href="{{ path('export_tagging_rule') }}" class="waves-effect waves-light btn">{{ 'config.form_rules.export'|trans }}</a></p>
376 </div>
377 </div>
378 </li>
379 {% endif %}
380 </ul>
332 381
333 <div class="row"> 382 <div class="row">
334 <div class="input-field col s12"> 383 <div class="input-field col s12">
diff --git a/tests/Wallabag/ApiBundle/Controller/TaggingRuleRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/TaggingRuleRestControllerTest.php
new file mode 100644
index 00000000..b6477256
--- /dev/null
+++ b/tests/Wallabag/ApiBundle/Controller/TaggingRuleRestControllerTest.php
@@ -0,0 +1,15 @@
1<?php
2
3namespace Tests\Wallabag\ApiBundle\Controller;
4
5use Tests\Wallabag\ApiBundle\WallabagApiTestCase;
6
7class TaggingRuleRestControllerTest extends WallabagApiTestCase
8{
9 public function testExportEntry()
10 {
11 $this->client->request('GET', '/api/taggingrule/export');
12 $this->assertSame(200, $this->client->getResponse()->getStatusCode());
13 $this->assertSame('application/json', $this->client->getResponse()->headers->get('Content-Type'));
14 }
15}
diff --git a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php
index 2c428fa0..46c90075 100644
--- a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php
+++ b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php
@@ -2,6 +2,7 @@
2 2
3namespace Tests\Wallabag\CoreBundle\Controller; 3namespace Tests\Wallabag\CoreBundle\Controller;
4 4
5use Symfony\Component\HttpFoundation\File\UploadedFile;
5use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; 6use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
6use Wallabag\AnnotationBundle\Entity\Annotation; 7use Wallabag\AnnotationBundle\Entity\Annotation;
7use Wallabag\CoreBundle\Entity\Config; 8use Wallabag\CoreBundle\Entity\Config;
@@ -1097,4 +1098,67 @@ class ConfigControllerTest extends WallabagCoreTestCase
1097 $this->assertFalse($user->isGoogleTwoFactor()); 1098 $this->assertFalse($user->isGoogleTwoFactor());
1098 $this->assertEmpty($user->getBackupCodes()); 1099 $this->assertEmpty($user->getBackupCodes());
1099 } 1100 }
1101
1102 public function testExportTaggingRule()
1103 {
1104 $this->logInAs('admin');
1105 $client = $this->getClient();
1106
1107 ob_start();
1108 $crawler = $client->request('GET', '/tagging-rule/export');
1109 ob_end_clean();
1110
1111 $this->assertSame(200, $client->getResponse()->getStatusCode());
1112
1113 $headers = $client->getResponse()->headers;
1114 $this->assertSame('application/json', $headers->get('content-type'));
1115 $this->assertSame('attachment; filename="tagging_rules_admin.json"', $headers->get('content-disposition'));
1116 $this->assertSame('UTF-8', $headers->get('content-transfer-encoding'));
1117
1118 $content = json_decode($client->getResponse()->getContent(), true);
1119
1120 $this->assertCount(4, $content);
1121 $this->assertSame('content matches "spurs"', $content[0]['rule']);
1122 $this->assertSame('sport', $content[0]['tags'][0]);
1123 }
1124
1125 public function testImportTagginfRuleBadFile()
1126 {
1127 $this->logInAs('admin');
1128 $client = $this->getClient();
1129
1130 $crawler = $client->request('GET', '/config');
1131 $form = $crawler->filter('form[name=upload_tagging_rule_file] > button[type=submit]')->form();
1132
1133 $data = [
1134 'upload_tagging_rule_file[file]' => '',
1135 ];
1136
1137 $client->submit($form, $data);
1138
1139 $this->assertSame(302, $client->getResponse()->getStatusCode());
1140 }
1141
1142 public function testImportTagginfRuleFile()
1143 {
1144 $this->logInAs('admin');
1145 $client = $this->getClient();
1146
1147 $crawler = $client->request('GET', '/config');
1148 $form = $crawler->filter('form[name=upload_tagging_rule_file] > button[type=submit]')->form();
1149
1150 $file = new UploadedFile(__DIR__ . '/../fixtures/tagging_rules_admin.json', 'tagging_rules_admin.json');
1151
1152 $data = [
1153 'upload_tagging_rule_file[file]' => $file,
1154 ];
1155
1156 $client->submit($form, $data);
1157 $this->assertSame(302, $client->getResponse()->getStatusCode());
1158
1159 $user = $client->getContainer()->get('fos_user.user_manager.test')->findUserBy(['username' => 'admin']);
1160 $taggingRules = $user->getConfig()->getTaggingRules()->toArray();
1161 $this->assertCount(5, $taggingRules);
1162 $this->assertSame('title matches "football"', $taggingRules[4]->getRule());
1163 }
1100} 1164}
diff --git a/tests/Wallabag/CoreBundle/fixtures/tagging_rules_admin.json b/tests/Wallabag/CoreBundle/fixtures/tagging_rules_admin.json
new file mode 100644
index 00000000..a54824e2
--- /dev/null
+++ b/tests/Wallabag/CoreBundle/fixtures/tagging_rules_admin.json
@@ -0,0 +1,4 @@
1[{
2 "rule": "title matches \"football\"",
3 "tags": ["football"]
4}]