aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--app/config/config.yml1
-rw-r--r--data/db/wallabag_test.sqlite-journalbin0 -> 7736 bytes
-rw-r--r--src/Wallabag/CoreBundle/Command/InstallCommand.php1
-rw-r--r--src/Wallabag/CoreBundle/DependencyInjection/Configuration.php3
-rw-r--r--src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php1
-rw-r--r--src/Wallabag/CoreBundle/Entity/Config.php31
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/ConfigType.php8
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig8
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig5
9 files changed, 56 insertions, 2 deletions
diff --git a/app/config/config.yml b/app/config/config.yml
index f0885d9d..5265be8a 100644
--- a/app/config/config.yml
+++ b/app/config/config.yml
@@ -44,6 +44,7 @@ wallabag_core:
44 theme: material 44 theme: material
45 language: en 45 language: en
46 rss_limit: 50 46 rss_limit: 50
47 reading_speed: 1
47 48
48wallabag_import: 49wallabag_import:
49 allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain'] 50 allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain']
diff --git a/data/db/wallabag_test.sqlite-journal b/data/db/wallabag_test.sqlite-journal
new file mode 100644
index 00000000..153aa187
--- /dev/null
+++ b/data/db/wallabag_test.sqlite-journal
Binary files differ
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php
index e97ba46a..c9dad0df 100644
--- a/src/Wallabag/CoreBundle/Command/InstallCommand.php
+++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php
@@ -222,6 +222,7 @@ class InstallCommand extends ContainerAwareCommand
222 $config->setTheme($this->getContainer()->getParameter('wallabag_core.theme')); 222 $config->setTheme($this->getContainer()->getParameter('wallabag_core.theme'));
223 $config->setItemsPerPage($this->getContainer()->getParameter('wallabag_core.items_on_page')); 223 $config->setItemsPerPage($this->getContainer()->getParameter('wallabag_core.items_on_page'));
224 $config->setRssLimit($this->getContainer()->getParameter('wallabag_core.rss_limit')); 224 $config->setRssLimit($this->getContainer()->getParameter('wallabag_core.rss_limit'));
225 $config->setReadingSpeed($this->getContainer()->getParameter('wallabag_core.reading_speed'));
225 $config->setLanguage($this->getContainer()->getParameter('wallabag_core.language')); 226 $config->setLanguage($this->getContainer()->getParameter('wallabag_core.language'));
226 227
227 $em->persist($config); 228 $em->persist($config);
diff --git a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
index bc405fdc..5f3c889b 100644
--- a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
+++ b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
@@ -29,6 +29,9 @@ class Configuration implements ConfigurationInterface
29 ->integerNode('rss_limit') 29 ->integerNode('rss_limit')
30 ->defaultValue(50) 30 ->defaultValue(50)
31 ->end() 31 ->end()
32 ->integerNode('reading_speed')
33 ->defaultValue(200)
34 ->end()
32 ->scalarNode('version') 35 ->scalarNode('version')
33 ->end() 36 ->end()
34 ->scalarNode('paypal_url') 37 ->scalarNode('paypal_url')
diff --git a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
index 9b4703e4..84599f0d 100644
--- a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
+++ b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
@@ -19,6 +19,7 @@ class WallabagCoreExtension extends Extension
19 $container->setParameter('wallabag_core.theme', $config['theme']); 19 $container->setParameter('wallabag_core.theme', $config['theme']);
20 $container->setParameter('wallabag_core.language', $config['language']); 20 $container->setParameter('wallabag_core.language', $config['language']);
21 $container->setParameter('wallabag_core.rss_limit', $config['rss_limit']); 21 $container->setParameter('wallabag_core.rss_limit', $config['rss_limit']);
22 $container->setParameter('wallabag_core.reading_speed', $config['reading_speed']);
22 $container->setParameter('wallabag_core.version', $config['version']); 23 $container->setParameter('wallabag_core.version', $config['version']);
23 $container->setParameter('wallabag_core.paypal_url', $config['paypal_url']); 24 $container->setParameter('wallabag_core.paypal_url', $config['paypal_url']);
24 25
diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php
index d3590f35..e1a2090e 100644
--- a/src/Wallabag/CoreBundle/Entity/Config.php
+++ b/src/Wallabag/CoreBundle/Entity/Config.php
@@ -74,6 +74,13 @@ class Config
74 private $rssLimit; 74 private $rssLimit;
75 75
76 /** 76 /**
77 * @var float
78 *
79 * @ORM\Column(name="reading_speed", type="float", nullable=true)
80 */
81 private $readingSpeed;
82
83 /**
77 * @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config") 84 * @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config")
78 */ 85 */
79 private $user; 86 private $user;
@@ -248,6 +255,30 @@ class Config
248 } 255 }
249 256
250 /** 257 /**
258 * Set readingSpeed.
259 *
260 * @param int $readingSpeed
261 *
262 * @return Config
263 */
264 public function setReadingSpeed($readingSpeed)
265 {
266 $this->readingSpeed = $readingSpeed;
267
268 return $this;
269 }
270
271 /**
272 * Get readingSpeed.
273 *
274 * @return int
275 */
276 public function getReadingSpeed()
277 {
278 return $this->readingSpeed;
279 }
280
281 /**
251 * @param TaggingRule $rule 282 * @param TaggingRule $rule
252 * 283 *
253 * @return Config 284 * @return Config
diff --git a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php
index a139f2df..1218a933 100644
--- a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php
@@ -4,6 +4,7 @@ namespace Wallabag\CoreBundle\Form\Type;
4 4
5use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\ChoiceType; 6use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
7use Symfony\Component\Form\Extension\Core\Type\RangeType;
7use Symfony\Component\Form\Extension\Core\Type\SubmitType; 8use Symfony\Component\Form\Extension\Core\Type\SubmitType;
8use Symfony\Component\Form\FormBuilderInterface; 9use Symfony\Component\Form\FormBuilderInterface;
9use Symfony\Component\OptionsResolver\OptionsResolver; 10use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -35,6 +36,13 @@ class ConfigType extends AbstractType
35 'choices_as_values' => true, 36 'choices_as_values' => true,
36 )) 37 ))
37 ->add('items_per_page') 38 ->add('items_per_page')
39 ->add('reading_speed', RangeType::class, array(
40 'attr' => array(
41 'min' => 0.5,
42 'max' => 2,
43 'step' => 0.5,
44 ),
45 ))
38 ->add('language', ChoiceType::class, array( 46 ->add('language', ChoiceType::class, array(
39 'choices' => array_flip($this->languages), 47 'choices' => array_flip($this->languages),
40 'choices_as_values' => true, 48 'choices_as_values' => true,
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 e388f2c8..31931ca2 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
@@ -44,6 +44,14 @@
44 44
45 <div class="row"> 45 <div class="row">
46 <div class="input-field col s12"> 46 <div class="input-field col s12">
47 {{ form_label(form.config.reading_speed) }}
48 {{ form_errors(form.config.reading_speed) }}
49 {{ form_widget(form.config.reading_speed) }}
50 </div>
51 </div>
52
53 <div class="row">
54 <div class="input-field col s12">
47 {{ form_label(form.config.language) }} 55 {{ form_label(form.config.language) }}
48 {{ form_errors(form.config.language) }} 56 {{ form_errors(form.config.language) }}
49 {{ form_widget(form.config.language) }} 57 {{ form_widget(form.config.language) }}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
index c3fd4d28..371992df 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
@@ -50,8 +50,9 @@
50 50
51 <div class="estimatedTime grey-text"> 51 <div class="estimatedTime grey-text">
52 <span class="tool reading-time"> 52 <span class="tool reading-time">
53 {% if entry.readingTime > 0 %} 53 {% set readingTime = entry.readingTime / app.user.config.readingSpeed %}
54 {% trans with {'%readingTime%': entry.readingTime } %}estimated reading time: %readingTime% min{% endtrans %} 54 {% if readingTime > 0 %}
55 {% trans with {'%readingTime%': readingTime } %}estimated reading time: %readingTime% min{% endtrans %}
55 {% else %} 56 {% else %}
56 {% trans with {'%inferior%': '<small class="inferieur">&lt;</small>'} %}estimated reading time: %inferior% 1 min{% endtrans %} 57 {% trans with {'%inferior%': '<small class="inferieur">&lt;</small>'} %}estimated reading time: %inferior% 1 min{% endtrans %}
57 {% endif %} 58 {% endif %}