aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle')
-rw-r--r--src/Wallabag/CoreBundle/Controller/ConfigController.php79
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/IgnoreOriginUserRuleFixtures.php36
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/IgnoreOriginUserRuleType.php37
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.da.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.de.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.en.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.es.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml6
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.it.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.th.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml3
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig27
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig49
19 files changed, 264 insertions, 7 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php
index 56efe82b..3efc7bb3 100644
--- a/src/Wallabag/CoreBundle/Controller/ConfigController.php
+++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php
@@ -14,10 +14,13 @@ use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
14use Symfony\Component\Routing\Annotation\Route; 14use Symfony\Component\Routing\Annotation\Route;
15use Symfony\Component\Validator\Constraints\Locale as LocaleConstraint; 15use Symfony\Component\Validator\Constraints\Locale as LocaleConstraint;
16use Wallabag\CoreBundle\Entity\Config; 16use Wallabag\CoreBundle\Entity\Config;
17use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
18use Wallabag\CoreBundle\Entity\RuleInterface;
17use Wallabag\CoreBundle\Entity\TaggingRule; 19use Wallabag\CoreBundle\Entity\TaggingRule;
18use Wallabag\CoreBundle\Form\Type\ChangePasswordType; 20use Wallabag\CoreBundle\Form\Type\ChangePasswordType;
19use Wallabag\CoreBundle\Form\Type\ConfigType; 21use Wallabag\CoreBundle\Form\Type\ConfigType;
20use Wallabag\CoreBundle\Form\Type\FeedType; 22use Wallabag\CoreBundle\Form\Type\FeedType;
23use Wallabag\CoreBundle\Form\Type\IgnoreOriginUserRuleType;
21use Wallabag\CoreBundle\Form\Type\TaggingRuleImportType; 24use Wallabag\CoreBundle\Form\Type\TaggingRuleImportType;
22use Wallabag\CoreBundle\Form\Type\TaggingRuleType; 25use Wallabag\CoreBundle\Form\Type\TaggingRuleType;
23use Wallabag\CoreBundle\Form\Type\UserInformationType; 26use Wallabag\CoreBundle\Form\Type\UserInformationType;
@@ -173,6 +176,40 @@ class ConfigController extends Controller
173 return $this->redirect($this->generateUrl('config') . '#set5'); 176 return $this->redirect($this->generateUrl('config') . '#set5');
174 } 177 }
175 178
179 // handle ignore origin rules
180 $ignoreOriginUserRule = new IgnoreOriginUserRule();
181 $action = $this->generateUrl('config') . '#set6';
182
183 if ($request->query->has('ignore-origin-user-rule')) {
184 $ignoreOriginUserRule = $this->getDoctrine()
185 ->getRepository('WallabagCoreBundle:IgnoreOriginUserRule')
186 ->find($request->query->get('ignore-origin-user-rule'));
187
188 if ($this->getUser()->getId() !== $ignoreOriginUserRule->getConfig()->getUser()->getId()) {
189 return $this->redirect($action);
190 }
191
192 $action = $this->generateUrl('config', [
193 'ignore-origin-user-rule' => $ignoreOriginUserRule->getId(),
194 ]) . '#set6';
195 }
196
197 $newIgnoreOriginUserRule = $this->createForm(IgnoreOriginUserRuleType::class, $ignoreOriginUserRule, ['action' => $action]);
198 $newIgnoreOriginUserRule->handleRequest($request);
199
200 if ($newIgnoreOriginUserRule->isSubmitted() && $newIgnoreOriginUserRule->isValid()) {
201 $ignoreOriginUserRule->setConfig($config);
202 $em->persist($ignoreOriginUserRule);
203 $em->flush();
204
205 $this->addFlash(
206 'notice',
207 'flashes.config.notice.ignore_origin_rules_updated'
208 );
209
210 return $this->redirect($this->generateUrl('config') . '#set6');
211 }
212
176 return $this->render('WallabagCoreBundle:Config:index.html.twig', [ 213 return $this->render('WallabagCoreBundle:Config:index.html.twig', [
177 'form' => [ 214 'form' => [
178 'config' => $configForm->createView(), 215 'config' => $configForm->createView(),
@@ -181,6 +218,7 @@ class ConfigController extends Controller
181 'user' => $userForm->createView(), 218 'user' => $userForm->createView(),
182 'new_tagging_rule' => $newTaggingRule->createView(), 219 'new_tagging_rule' => $newTaggingRule->createView(),
183 'import_tagging_rule' => $taggingRulesImportform->createView(), 220 'import_tagging_rule' => $taggingRulesImportform->createView(),
221 'new_ignore_origin_user_rule' => $newIgnoreOriginUserRule->createView(),
184 ], 222 ],
185 'feed' => [ 223 'feed' => [
186 'username' => $user->getUsername(), 224 'username' => $user->getUsername(),
@@ -448,6 +486,43 @@ class ConfigController extends Controller
448 } 486 }
449 487
450 /** 488 /**
489 * Deletes an ignore origin rule and redirect to the config homepage.
490 *
491 * @Route("/ignore-origin-user-rule/delete/{id}", requirements={"id" = "\d+"}, name="delete_ignore_origin_rule")
492 *
493 * @return RedirectResponse
494 */
495 public function deleteIgnoreOriginRuleAction(IgnoreOriginUserRule $rule)
496 {
497 $this->validateRuleAction($rule);
498
499 $em = $this->getDoctrine()->getManager();
500 $em->remove($rule);
501 $em->flush();
502
503 $this->addFlash(
504 'notice',
505 'flashes.config.notice.ignore_origin_rules_deleted'
506 );
507
508 return $this->redirect($this->generateUrl('config') . '#set6');
509 }
510
511 /**
512 * Edit an ignore origin rule.
513 *
514 * @Route("/ignore-origin-user-rule/edit/{id}", requirements={"id" = "\d+"}, name="edit_ignore_origin_rule")
515 *
516 * @return RedirectResponse
517 */
518 public function editIgnoreOriginRuleAction(IgnoreOriginUserRule $rule)
519 {
520 $this->validateRuleAction($rule);
521
522 return $this->redirect($this->generateUrl('config') . '?ignore-origin-user-rule=' . $rule->getId() . '#set6');
523 }
524
525 /**
451 * Remove all annotations OR tags OR entries for the current user. 526 * Remove all annotations OR tags OR entries for the current user.
452 * 527 *
453 * @Route("/reset/{type}", requirements={"id" = "annotations|tags|entries"}, name="config_reset") 528 * @Route("/reset/{type}", requirements={"id" = "annotations|tags|entries"}, name="config_reset")
@@ -659,10 +734,10 @@ class ConfigController extends Controller
659 /** 734 /**
660 * Validate that a rule can be edited/deleted by the current user. 735 * Validate that a rule can be edited/deleted by the current user.
661 */ 736 */
662 private function validateRuleAction(TaggingRule $rule) 737 private function validateRuleAction(RuleInterface $rule)
663 { 738 {
664 if ($this->getUser()->getId() !== $rule->getConfig()->getUser()->getId()) { 739 if ($this->getUser()->getId() !== $rule->getConfig()->getUser()->getId()) {
665 throw $this->createAccessDeniedException('You can not access this tagging rule.'); 740 throw $this->createAccessDeniedException('You can not access this rule.');
666 } 741 }
667 } 742 }
668 743
diff --git a/src/Wallabag/CoreBundle/DataFixtures/IgnoreOriginUserRuleFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/IgnoreOriginUserRuleFixtures.php
new file mode 100644
index 00000000..679eff7d
--- /dev/null
+++ b/src/Wallabag/CoreBundle/DataFixtures/IgnoreOriginUserRuleFixtures.php
@@ -0,0 +1,36 @@
1<?php
2
3namespace Wallabag\CoreBundle\DataFixtures;
4
5use Doctrine\Bundle\FixturesBundle\Fixture;
6use Doctrine\Common\DataFixtures\DependentFixtureInterface;
7use Doctrine\Common\Persistence\ObjectManager;
8use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
9use Wallabag\UserBundle\DataFixtures\UserFixtures;
10
11class IgnoreOriginUserRuleFixtures extends Fixture implements DependentFixtureInterface
12{
13 /**
14 * {@inheritdoc}
15 */
16 public function load(ObjectManager $manager)
17 {
18 $rule = new IgnoreOriginUserRule();
19 $rule->setRule('host = "example.fr"');
20 $rule->setConfig($this->getReference('admin-user')->getConfig());
21
22 $manager->persist($rule);
23
24 $manager->flush();
25 }
26
27 /**
28 * {@inheritdoc}
29 */
30 public function getDependencies()
31 {
32 return [
33 UserFixtures::class,
34 ];
35 }
36}
diff --git a/src/Wallabag/CoreBundle/Form/Type/IgnoreOriginUserRuleType.php b/src/Wallabag/CoreBundle/Form/Type/IgnoreOriginUserRuleType.php
new file mode 100644
index 00000000..b9110f17
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Form/Type/IgnoreOriginUserRuleType.php
@@ -0,0 +1,37 @@
1<?php
2
3namespace Wallabag\CoreBundle\Form\Type;
4
5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\SubmitType;
7use Symfony\Component\Form\Extension\Core\Type\TextType;
8use Symfony\Component\Form\FormBuilderInterface;
9use Symfony\Component\OptionsResolver\OptionsResolver;
10
11class IgnoreOriginUserRuleType extends AbstractType
12{
13 public function buildForm(FormBuilderInterface $builder, array $options)
14 {
15 $builder
16 ->add('rule', TextType::class, [
17 'required' => true,
18 'label' => 'config.form_rules.rule_label',
19 ])
20 ->add('save', SubmitType::class, [
21 'label' => 'config.form.save',
22 ])
23 ;
24 }
25
26 public function configureOptions(OptionsResolver $resolver)
27 {
28 $resolver->setDefaults([
29 'data_class' => 'Wallabag\CoreBundle\Entity\IgnoreOriginUserRule',
30 ]);
31 }
32
33 public function getBlockPrefix()
34 {
35 return 'ignore_origin_user_rule';
36 }
37}
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
index 4d525979..92440c92 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
@@ -59,6 +59,7 @@ config:
59 user_info: 'Brugeroplysninger' 59 user_info: 'Brugeroplysninger'
60 password: 'Adgangskode' 60 password: 'Adgangskode'
61 # rules: 'Tagging rules' 61 # rules: 'Tagging rules'
62 # ignore_origin: 'Ignore origin rules'
62 new_user: 'Tilføj bruger' 63 new_user: 'Tilføj bruger'
63 # reset: 'Reset area' 64 # reset: 'Reset area'
64 form: 65 form:
@@ -617,6 +618,8 @@ flashes:
617 # otp_disabled: Two-factor authentication disabled 618 # otp_disabled: Two-factor authentication disabled
618 # tagging_rules_imported: Tagging rules imported 619 # tagging_rules_imported: Tagging rules imported
619 # tagging_rules_not_imported: Error while importing tagging rules 620 # tagging_rules_not_imported: Error while importing tagging rules
621 # ignore_origin_rules_deleted: 'Ignore origin rule deleted'
622 # ignore_origin_rules_updated: 'Ignore origin rule updated'
620 entry: 623 entry:
621 notice: 624 notice:
622 # entry_already_saved: 'Entry already saved on %date%' 625 # 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 cd70c99f..7a9382cb 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
@@ -59,6 +59,7 @@ config:
59 user_info: 'Benutzerinformation' 59 user_info: 'Benutzerinformation'
60 password: 'Kennwort' 60 password: 'Kennwort'
61 rules: 'Tagging-Regeln' 61 rules: 'Tagging-Regeln'
62 # ignore_origin: 'Ignore origin rules'
62 new_user: 'Benutzer hinzufügen' 63 new_user: 'Benutzer hinzufügen'
63 reset: 'Zurücksetzen' 64 reset: 'Zurücksetzen'
64 form: 65 form:
@@ -617,6 +618,8 @@ flashes:
617 # otp_disabled: Two-factor authentication disabled 618 # otp_disabled: Two-factor authentication disabled
618 # tagging_rules_imported: Tagging rules imported 619 # tagging_rules_imported: Tagging rules imported
619 # tagging_rules_not_imported: Error while importing tagging rules 620 # tagging_rules_not_imported: Error while importing tagging rules
621 # ignore_origin_rules_deleted: 'Ignore origin rule deleted'
622 # ignore_origin_rules_updated: 'Ignore origin rule updated'
620 entry: 623 entry:
621 notice: 624 notice:
622 entry_already_saved: 'Eintrag bereits am %date% gespeichert' 625 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 1bc32423..b16662c3 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
@@ -59,6 +59,7 @@ config:
59 user_info: 'User information' 59 user_info: 'User information'
60 password: 'Password' 60 password: 'Password'
61 rules: 'Tagging rules' 61 rules: 'Tagging rules'
62 ignore_origin: 'Ignore origin rules'
62 new_user: 'Add a user' 63 new_user: 'Add a user'
63 reset: 'Reset area' 64 reset: 'Reset area'
64 form: 65 form:
@@ -617,6 +618,8 @@ flashes:
617 otp_disabled: Two-factor authentication disabled 618 otp_disabled: Two-factor authentication disabled
618 tagging_rules_imported: Tagging rules imported 619 tagging_rules_imported: Tagging rules imported
619 tagging_rules_not_imported: Error while importing tagging rules 620 tagging_rules_not_imported: Error while importing tagging rules
621 ignore_origin_rules_deleted: 'Ignore origin rule deleted'
622 ignore_origin_rules_updated: 'Ignore origin rule updated'
620 entry: 623 entry:
621 notice: 624 notice:
622 entry_already_saved: 'Entry already saved on %date%' 625 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 bced72e9..3e77afd6 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
@@ -59,6 +59,7 @@ config:
59 user_info: 'Información de usuario' 59 user_info: 'Información de usuario'
60 password: 'Contraseña' 60 password: 'Contraseña'
61 rules: 'Reglas de etiquetado automáticas' 61 rules: 'Reglas de etiquetado automáticas'
62 # ignore_origin: 'Ignore origin rules'
62 new_user: 'Añadir un usuario' 63 new_user: 'Añadir un usuario'
63 reset: 'Reiniciar mi cuenta' 64 reset: 'Reiniciar mi cuenta'
64 form: 65 form:
@@ -617,6 +618,8 @@ flashes:
617 # otp_disabled: Two-factor authentication disabled 618 # otp_disabled: Two-factor authentication disabled
618 tagging_rules_imported: Reglas de etiquetado importadas 619 tagging_rules_imported: Reglas de etiquetado importadas
619 tagging_rules_not_imported: Un error se ha producico en la importación de las reglas de etiquetado 620 tagging_rules_not_imported: Un error se ha producico en la importación de las reglas de etiquetado
621 # ignore_origin_rules_deleted: 'Ignore origin rule deleted'
622 # ignore_origin_rules_updated: 'Ignore origin rule updated'
620 entry: 623 entry:
621 notice: 624 notice:
622 entry_already_saved: 'Artículo ya guardado el %fecha%' 625 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 0704204a..38c252f7 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
@@ -59,6 +59,7 @@ config:
59 user_info: 'اطلاعات کاربر' 59 user_info: 'اطلاعات کاربر'
60 password: 'رمز' 60 password: 'رمز'
61 rules: 'برچسب‌گذاری خودکار' 61 rules: 'برچسب‌گذاری خودکار'
62 # ignore_origin: 'Ignore origin rules'
62 new_user: 'افزودن کاربر' 63 new_user: 'افزودن کاربر'
63 # reset: 'Reset area' 64 # reset: 'Reset area'
64 form: 65 form:
@@ -617,6 +618,8 @@ flashes:
617 # otp_disabled: Two-factor authentication disabled 618 # otp_disabled: Two-factor authentication disabled
618 # tagging_rules_imported: Tagging rules imported 619 # tagging_rules_imported: Tagging rules imported
619 # tagging_rules_not_imported: Error while importing tagging rules 620 # tagging_rules_not_imported: Error while importing tagging rules
621 # ignore_origin_rules_deleted: 'Ignore origin rule deleted'
622 # ignore_origin_rules_updated: 'Ignore origin rule updated'
620 entry: 623 entry:
621 notice: 624 notice:
622 entry_already_saved: 'این مقاله در تاریخ %date% ذخیره شده بود' 625 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 5d5878eb..b12dd9ca 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
@@ -59,6 +59,7 @@ config:
59 user_info: "Mon compte" 59 user_info: "Mon compte"
60 password: "Mot de passe" 60 password: "Mot de passe"
61 rules: "Règles de tag automatiques" 61 rules: "Règles de tag automatiques"
62 ignore_origin: "Règles d'omission d'origine"
62 new_user: "Créer un compte" 63 new_user: "Créer un compte"
63 reset: "Réinitialisation" 64 reset: "Réinitialisation"
64 form: 65 form:
@@ -618,6 +619,11 @@ flashes:
618 otp_disabled: "Authentification à double-facteur désactivée" 619 otp_disabled: "Authentification à double-facteur désactivée"
619 tagging_rules_imported: Règles bien importées 620 tagging_rules_imported: Règles bien importées
620 tagging_rules_not_imported: Impossible d'importer les règles 621 tagging_rules_not_imported: Impossible d'importer les règles
622<<<<<<< HEAD
623=======
624 ignore_origin_rules_deleted: "Règle d'omission d'origine supprimée"
625 ignore_origin_rules_updated: "Règle d'omission d'origine mise à jour"
626>>>>>>> 4c595340... fixup! Add new Ignore Origin rules tab, update ConfigController
621 entry: 627 entry:
622 notice: 628 notice:
623 entry_already_saved: "Article déjà sauvegardé le %date%" 629 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 23e72f20..eb44318b 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
@@ -59,6 +59,7 @@ config:
59 user_info: 'Informazioni utente' 59 user_info: 'Informazioni utente'
60 password: 'Password' 60 password: 'Password'
61 rules: 'Regole di etichettatura' 61 rules: 'Regole di etichettatura'
62 # ignore_origin: 'Ignore origin rules'
62 new_user: 'Aggiungi utente' 63 new_user: 'Aggiungi utente'
63 reset: 'Area di reset' 64 reset: 'Area di reset'
64 form: 65 form:
@@ -617,6 +618,8 @@ flashes:
617 # otp_disabled: Two-factor authentication disabled 618 # otp_disabled: Two-factor authentication disabled
618 # tagging_rules_imported: Tagging rules imported 619 # tagging_rules_imported: Tagging rules imported
619 # tagging_rules_not_imported: Error while importing tagging rules 620 # tagging_rules_not_imported: Error while importing tagging rules
621 # ignore_origin_rules_deleted: 'Ignore origin rule deleted'
622 # ignore_origin_rules_updated: 'Ignore origin rule updated'
620 entry: 623 entry:
621 notice: 624 notice:
622 entry_already_saved: 'Contenuto già salvato in data %date%' 625 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 6ddff6ea..165186b1 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
@@ -59,6 +59,7 @@ config:
59 user_info: 'Mon compte' 59 user_info: 'Mon compte'
60 password: 'Senhal' 60 password: 'Senhal'
61 rules: "Règlas d'etiquetas automaticas" 61 rules: "Règlas d'etiquetas automaticas"
62 # ignore_origin: 'Ignore origin rules'
62 new_user: 'Crear un compte' 63 new_user: 'Crear un compte'
63 reset: 'Zòna de reïnicializacion' 64 reset: 'Zòna de reïnicializacion'
64 form: 65 form:
@@ -617,6 +618,8 @@ flashes:
617 # otp_disabled: Two-factor authentication disabled 618 # otp_disabled: Two-factor authentication disabled
618 tagging_rules_imported: Règlas d’etiquetatge importadas 619 tagging_rules_imported: Règlas d’etiquetatge importadas
619 tagging_rules_not_imported: Error en important las règlas d’etiquetatge 620 tagging_rules_not_imported: Error en important las règlas d’etiquetatge
621 # ignore_origin_rules_deleted: 'Ignore origin rule deleted'
622 # ignore_origin_rules_updated: 'Ignore origin rule updated'
620 entry: 623 entry:
621 notice: 624 notice:
622 entry_already_saved: 'Article ja salvagardat lo %date%' 625 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 770477c9..fbf64f30 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
@@ -59,6 +59,7 @@ config:
59 user_info: 'Informacje o użytkowniku' 59 user_info: 'Informacje o użytkowniku'
60 password: 'Hasło' 60 password: 'Hasło'
61 rules: 'Zasady tagowania' 61 rules: 'Zasady tagowania'
62 # ignore_origin: 'Ignore origin rules'
62 new_user: 'Dodaj użytkownika' 63 new_user: 'Dodaj użytkownika'
63 reset: 'Reset' 64 reset: 'Reset'
64 form: 65 form:
@@ -617,6 +618,8 @@ flashes:
617 # otp_disabled: Two-factor authentication disabled 618 # otp_disabled: Two-factor authentication disabled
618 # tagging_rules_imported: Tagging rules imported 619 # tagging_rules_imported: Tagging rules imported
619 # tagging_rules_not_imported: Error while importing tagging rules 620 # tagging_rules_not_imported: Error while importing tagging rules
621 # ignore_origin_rules_deleted: 'Ignore origin rule deleted'
622 # ignore_origin_rules_updated: 'Ignore origin rule updated'
620 entry: 623 entry:
621 notice: 624 notice:
622 entry_already_saved: 'Wpis już został dodany %date%' 625 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 d993cb05..93910d4b 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
@@ -59,6 +59,7 @@ config:
59 user_info: 'Informação do Usuário' 59 user_info: 'Informação do Usuário'
60 password: 'Senha' 60 password: 'Senha'
61 rules: 'Regras de tags' 61 rules: 'Regras de tags'
62 # ignore_origin: 'Ignore origin rules'
62 new_user: 'Adicionar um usuário' 63 new_user: 'Adicionar um usuário'
63 reset: 'Reiniciar minha conta' 64 reset: 'Reiniciar minha conta'
64 form: 65 form:
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
index bc8b72e0..5984d229 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
@@ -59,6 +59,7 @@ config:
59 user_info: 'Informații despre utilizator' 59 user_info: 'Informații despre utilizator'
60 password: 'Parolă' 60 password: 'Parolă'
61 # rules: 'Tagging rules' 61 # rules: 'Tagging rules'
62 # ignore_origin: 'Ignore origin rules'
62 new_user: 'Crează un utilizator' 63 new_user: 'Crează un utilizator'
63 # reset: 'Reset area' 64 # reset: 'Reset area'
64 form: 65 form:
@@ -616,6 +617,8 @@ flashes:
616 # otp_disabled: Two-factor authentication disabled 617 # otp_disabled: Two-factor authentication disabled
617 # tagging_rules_imported: Tagging rules imported 618 # tagging_rules_imported: Tagging rules imported
618 # tagging_rules_not_imported: Error while importing tagging rules 619 # tagging_rules_not_imported: Error while importing tagging rules
620 # ignore_origin_rules_deleted: 'Ignore origin rule deleted'
621 # ignore_origin_rules_updated: 'Ignore origin rule updated'
619 entry: 622 entry:
620 notice: 623 notice:
621 # entry_already_saved: 'Entry already saved on %date%' 624 # 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 2f7f55e5..a138ee5d 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ru.yml
@@ -59,6 +59,7 @@ config:
59 user_info: 'Информация о пользователе' 59 user_info: 'Информация о пользователе'
60 password: 'Пароль' 60 password: 'Пароль'
61 rules: 'Правила настройки простановки тегов' 61 rules: 'Правила настройки простановки тегов'
62 # ignore_origin: 'Ignore origin rules'
62 new_user: 'Добавить пользователя' 63 new_user: 'Добавить пользователя'
63 reset: 'Сброс данных' 64 reset: 'Сброс данных'
64 form: 65 form:
@@ -616,6 +617,8 @@ flashes:
616 # otp_disabled: Two-factor authentication disabled 617 # otp_disabled: Two-factor authentication disabled
617 # tagging_rules_imported: Tagging rules imported 618 # tagging_rules_imported: Tagging rules imported
618 # tagging_rules_not_imported: Error while importing tagging rules 619 # tagging_rules_not_imported: Error while importing tagging rules
620 # ignore_origin_rules_deleted: 'Ignore origin rule deleted'
621 # ignore_origin_rules_updated: 'Ignore origin rule updated'
619 entry: 622 entry:
620 notice: 623 notice:
621 entry_already_saved: 'Запись была сохранена ранее %date%' 624 entry_already_saved: 'Запись была сохранена ранее %date%'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml
index 48e1c34a..b786a73d 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml
@@ -59,6 +59,7 @@ config:
59 user_info: 'ข้อมูลผู้ใช้' 59 user_info: 'ข้อมูลผู้ใช้'
60 password: 'รหัสผ่าน' 60 password: 'รหัสผ่าน'
61 rules: 'การแท็กข้อบังคับ' 61 rules: 'การแท็กข้อบังคับ'
62 # ignore_origin: 'Ignore origin rules'
62 new_user: 'เพิ่มผู้ใช้' 63 new_user: 'เพิ่มผู้ใช้'
63 reset: 'รีเซ็ตพื้นที่ ' 64 reset: 'รีเซ็ตพื้นที่ '
64 form: 65 form:
@@ -616,6 +617,8 @@ flashes:
616 # otp_disabled: Two-factor authentication disabled 617 # otp_disabled: Two-factor authentication disabled
617 # tagging_rules_imported: Tagging rules imported 618 # tagging_rules_imported: Tagging rules imported
618 # tagging_rules_not_imported: Error while importing tagging rules 619 # tagging_rules_not_imported: Error while importing tagging rules
620 # ignore_origin_rules_deleted: 'Ignore origin rule deleted'
621 # ignore_origin_rules_updated: 'Ignore origin rule updated'
619 entry: 622 entry:
620 notice: 623 notice:
621 entry_already_saved: 'รายการพร้อมบันทึกที่ %date%' 624 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 19029c0b..a317c2f5 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
@@ -59,6 +59,7 @@ config:
59 user_info: 'Kullanıcı bilgileri' 59 user_info: 'Kullanıcı bilgileri'
60 password: 'Şifre' 60 password: 'Şifre'
61 rules: 'Etiketleme kuralları' 61 rules: 'Etiketleme kuralları'
62 # ignore_origin: 'Ignore origin rules'
62 new_user: 'Bir kullanıcı ekle' 63 new_user: 'Bir kullanıcı ekle'
63 # reset: 'Reset area' 64 # reset: 'Reset area'
64 form: 65 form:
@@ -616,6 +617,8 @@ flashes:
616 # otp_disabled: Two-factor authentication disabled 617 # otp_disabled: Two-factor authentication disabled
617 # tagging_rules_imported: Tagging rules imported 618 # tagging_rules_imported: Tagging rules imported
618 # tagging_rules_not_imported: Error while importing tagging rules 619 # tagging_rules_not_imported: Error while importing tagging rules
620 # ignore_origin_rules_deleted: 'Ignore origin rule deleted'
621 # ignore_origin_rules_updated: 'Ignore origin rule updated'
619 entry: 622 entry:
620 notice: 623 notice:
621 entry_already_saved: 'Entry already saved on %date%' 624 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 eb395eac..f182fda4 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
@@ -404,6 +404,33 @@
404 </div> 404 </div>
405 </div> 405 </div>
406 406
407 <h2>{{ 'config.tab_menu.ignore_origin'|trans }}</h2>
408
409 <ul>
410 {% for ignore_origin_rule in app.user.config.ignoreOriginRules %}
411 <li>
412 {{ 'config.form_rules.if_label'|trans }}
413 « {{ ignore_origin_rule.rule }} »
414 <a href="{{ path('edit_ignore_origin_rule', {id: ignore_origin_rule.id}) }}" title="{{ 'config.form_rules.edit_rule_label'|trans }}" class="tool mode_edit">✎</a>
415 <a href="{{ path('delete_ignore_origin_rule', {id: ignore_origin_rule.id}) }}" title="{{ 'config.form_rules.delete_rule_label'|trans }}" class="tool delete icon-trash icon"></a>
416 </li>
417 {% endfor %}
418 </ul>
419
420 {{ form_start(form.new_ignore_origin_user_rule) }}
421 {{ form_errors(form.new_ignore_origin_user_rule) }}
422
423 <fieldset class="w500p inline">
424 <div class="row">
425 {{ form_label(form.new_ignore_origin_user_rule.rule) }}
426 {{ form_errors(form.new_ignore_origin_user_rule.rule) }}
427 {{ form_widget(form.new_ignore_origin_user_rule.rule) }}
428 </div>
429 </fieldset>
430
431 {{ form_rest(form.new_ignore_origin_user_rule) }}
432 </form>
433
407 <h2>{{ 'config.reset.title'|trans }}</h2> 434 <h2>{{ 'config.reset.title'|trans }}</h2>
408 <fieldset class="w500p inline"> 435 <fieldset class="w500p inline">
409 <p>{{ 'config.reset.description'|trans }}</p> 436 <p>{{ 'config.reset.description'|trans }}</p>
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 c2e92ad1..faf9a424 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
@@ -16,7 +16,8 @@
16 <li class="tab col s12 m6 l3"><a href="#set3">{{ 'config.tab_menu.user_info'|trans }}</a></li> 16 <li class="tab col s12 m6 l3"><a href="#set3">{{ 'config.tab_menu.user_info'|trans }}</a></li>
17 <li class="tab col s12 m6 l3"><a href="#set4">{{ 'config.tab_menu.password'|trans }}</a></li> 17 <li class="tab col s12 m6 l3"><a href="#set4">{{ 'config.tab_menu.password'|trans }}</a></li>
18 <li class="tab col s12 m6 l3"><a href="#set5">{{ 'config.tab_menu.rules'|trans }}</a></li> 18 <li class="tab col s12 m6 l3"><a href="#set5">{{ 'config.tab_menu.rules'|trans }}</a></li>
19 <li class="tab col s12 m6 l3"><a href="#set6">{{ 'config.tab_menu.reset'|trans }}</a></li> 19 <li class="tab col s12 m6 l3"><a href="#set6">{{ 'config.tab_menu.ignore_origin'|trans }}</a></li>
20 <li class="tab col s12 m6 l3"><a href="#set7">{{ 'config.tab_menu.reset'|trans }}</a></li>
20 </ul> 21 </ul>
21 </div> 22 </div>
22 23
@@ -294,11 +295,11 @@
294 « {{ tagging_rule.rule }} » 295 « {{ tagging_rule.rule }} »
295 {{ 'config.form_rules.then_tag_as_label'|trans }} 296 {{ 'config.form_rules.then_tag_as_label'|trans }}
296 « {{ tagging_rule.tags|join(', ') }} » 297 « {{ tagging_rule.tags|join(', ') }} »
297 <a href="{{ path('edit_tagging_rule', {id: tagging_rule.id}) }}" title="{{ 'config.form_rules.edit_rule_label'|trans }}"> 298 <a href="{{ path('edit_tagging_rule', {id: tagging_rule.id}) }}" title="{{ 'config.form_rules.edit_rule_label'|trans }}" class="mode_edit">
298 <i class="tool grey-text mode_edit material-icons">mode_edit</i> 299 <i class="tool grey-text material-icons">mode_edit</i>
299 </a> 300 </a>
300 <a href="{{ path('delete_tagging_rule', {id: tagging_rule.id}) }}" title="{{ 'config.form_rules.delete_rule_label'|trans }}"> 301 <a href="{{ path('delete_tagging_rule', {id: tagging_rule.id}) }}" title="{{ 'config.form_rules.delete_rule_label'|trans }}" class="delete">
301 <i class="tool grey-text delete material-icons">delete</i> 302 <i class="tool grey-text material-icons">delete</i>
302 </a> 303 </a>
303 </li> 304 </li>
304 {% endfor %} 305 {% endfor %}
@@ -466,6 +467,44 @@
466 </div> 467 </div>
467 468
468 <div id="set6" class="col s12"> 469 <div id="set6" class="col s12">
470 {% if app.user.config.ignoreOriginRules is not empty %}
471 <div class="row">
472 <div class="input-field col s12">
473 <ul>
474 {% for ignore_origin_rule in app.user.config.ignoreOriginRules %}
475 <li>
476 {{ 'config.form_rules.if_label'|trans }}
477 « {{ ignore_origin_rule.rule }} »
478 <a href="{{ path('edit_ignore_origin_rule', {id: ignore_origin_rule.id}) }}" title="{{ 'config.form_rules.edit_rule_label'|trans }}" class="mode_edit">
479 <i class="tool grey-text material-icons">mode_edit</i>
480 </a>
481 <a href="{{ path('delete_ignore_origin_rule', {id: ignore_origin_rule.id}) }}" title="{{ 'config.form_rules.delete_rule_label'|trans }}" class="delete">
482 <i class="tool grey-text material-icons">delete</i>
483 </a>
484 </li>
485 {% endfor %}
486 </ul>
487 </div>
488 </div>
489 {% endif %}
490
491 {{ form_start(form.new_ignore_origin_user_rule) }}
492 {{ form_errors(form.new_ignore_origin_user_rule) }}
493
494 <div class="row">
495 <div class="input-field col s12">
496 {{ form_label(form.new_ignore_origin_user_rule.rule) }}
497 {{ form_errors(form.new_ignore_origin_user_rule.rule) }}
498 {{ form_widget(form.new_ignore_origin_user_rule.rule) }}
499 </div>
500 </div>
501
502 {{ form_widget(form.new_ignore_origin_user_rule.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
503 {{ form_rest(form.new_ignore_origin_user_rule) }}
504 </form>
505 </div>
506
507 <div id="set7" class="col s12">
469 <div class="row"> 508 <div class="row">
470 <h5>{{ 'config.reset.title'|trans }}</h5> 509 <h5>{{ 'config.reset.title'|trans }}</h5>
471 <p>{{ 'config.reset.description'|trans }}</p> 510 <p>{{ 'config.reset.description'|trans }}</p>