theme: material
language: en
rss_limit: 50
+ reading_speed: 1
wallabag_import:
allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain']
$config->setTheme($this->getContainer()->getParameter('wallabag_core.theme'));
$config->setItemsPerPage($this->getContainer()->getParameter('wallabag_core.items_on_page'));
$config->setRssLimit($this->getContainer()->getParameter('wallabag_core.rss_limit'));
+ $config->setReadingSpeed($this->getContainer()->getParameter('wallabag_core.reading_speed'));
$config->setLanguage($this->getContainer()->getParameter('wallabag_core.language'));
$em->persist($config);
->integerNode('rss_limit')
->defaultValue(50)
->end()
+ ->integerNode('reading_speed')
+ ->defaultValue(200)
+ ->end()
->scalarNode('version')
->end()
->scalarNode('paypal_url')
$container->setParameter('wallabag_core.theme', $config['theme']);
$container->setParameter('wallabag_core.language', $config['language']);
$container->setParameter('wallabag_core.rss_limit', $config['rss_limit']);
+ $container->setParameter('wallabag_core.reading_speed', $config['reading_speed']);
$container->setParameter('wallabag_core.version', $config['version']);
$container->setParameter('wallabag_core.paypal_url', $config['paypal_url']);
*/
private $rssLimit;
+ /**
+ * @var float
+ *
+ * @ORM\Column(name="reading_speed", type="float", nullable=true)
+ */
+ private $readingSpeed;
+
/**
* @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config")
*/
return $this->rssLimit;
}
+ /**
+ * Set readingSpeed.
+ *
+ * @param int $readingSpeed
+ *
+ * @return Config
+ */
+ public function setReadingSpeed($readingSpeed)
+ {
+ $this->readingSpeed = $readingSpeed;
+
+ return $this;
+ }
+
+ /**
+ * Get readingSpeed.
+ *
+ * @return int
+ */
+ public function getReadingSpeed()
+ {
+ return $this->readingSpeed;
+ }
+
/**
* @param TaggingRule $rule
*
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
+use Symfony\Component\Form\Extension\Core\Type\RangeType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
'choices_as_values' => true,
))
->add('items_per_page')
+ ->add('reading_speed', RangeType::class, array(
+ 'attr' => array(
+ 'min' => 0.5,
+ 'max' => 2,
+ 'step' => 0.5,
+ ),
+ ))
->add('language', ChoiceType::class, array(
'choices' => array_flip($this->languages),
'choices_as_values' => true,
</div>
</div>
+ <div class="row">
+ <div class="input-field col s12">
+ {{ form_label(form.config.reading_speed) }}
+ {{ form_errors(form.config.reading_speed) }}
+ {{ form_widget(form.config.reading_speed) }}
+ </div>
+ </div>
+
<div class="row">
<div class="input-field col s12">
{{ form_label(form.config.language) }}
<div class="estimatedTime grey-text">
<span class="tool reading-time">
- {% if entry.readingTime > 0 %}
- {% trans with {'%readingTime%': entry.readingTime } %}estimated reading time: %readingTime% min{% endtrans %}
+ {% set readingTime = entry.readingTime / app.user.config.readingSpeed %}
+ {% if readingTime > 0 %}
+ {% trans with {'%readingTime%': readingTime } %}estimated reading time: %readingTime% min{% endtrans %}
{% else %}
{% trans with {'%inferior%': '<small class="inferieur"><</small>'} %}estimated reading time: %inferior% 1 min{% endtrans %}
{% endif %}