store estimated reading time / filters on reading time

This commit is contained in:
Nicolas Lœuillet
2015-08-07 22:20:30 +02:00
parent fedaf00537
commit 2686457448
20 changed files with 433 additions and 279 deletions

View File

@ -21,11 +21,12 @@
{% if entries is empty %}
<div class="messages warning"><p>{% trans %}No articles found.{% endtrans %}</p></div>
{% else %}
<div><form>{{ form_rest(form) }}<button class="btn waves-effect waves-light" type="submit" id="submit-filter" value="filter">Filter</button></form></div>
{% for entry in entries %}
<div id="entry-{{ entry.id|e }}" class="entrie">
<div id="entry-{{ entry.id|e }}" class="entry">
<h2><a href="{{ path('view', { 'id': entry.id }) }}">{{ entry.title|raw }}</a></h2>
{% if entry.content| readingTime > 0 %}
<div class="estimatedTime"><span class="tool reading-time">{% trans %}estimated reading time :{% endtrans %} {{ entry.content| readingTime }} min</span></div>
{% if entry.readingTime > 0 %}
<div class="estimatedTime"><span class="tool reading-time">{% trans %}estimated reading time :{% endtrans %} {{ entry.readingTime }} min</span></div>
{% else %}
<div class="estimatedTime"><span class="tool reading-time">{% trans %}estimated reading time :{% endtrans %} <small class="inferieur">&lt;</small> 1 min</span></div>
{% endif %}

View File

@ -17,8 +17,8 @@
<pubDate>{{ entry.createdAt|date('D, d M Y H:i:s') }}</pubDate>
<description>
<![CDATA[
{%- if entry.content|readingTime > 0 -%}
{% trans %}estimated reading time :{% endtrans %} {{ entry.content|readingTime }} min
{%- if entry.readingTime > 0 -%}
{% trans %}estimated reading time :{% endtrans %} {{ entry.readingTime }} min
{%- else -%}
{% trans %}estimated reading time :{% endtrans %} &lt; 1 min
{%- endif %}