Merge pull request #1400 from wallabag/v2-fix-1357

fix #1357, truncate domain name if it's too loooong
This commit is contained in:
Jeremy Benoist 2015-08-25 07:51:55 +02:00
commit c6da9bea71
3 changed files with 10 additions and 5 deletions

View file

@ -12,3 +12,8 @@ services:
class: Doctrine\Common\Cache\FilesystemCache class: Doctrine\Common\Cache\FilesystemCache
arguments: arguments:
- %kernel.cache_dir%/doctrine/metadata - %kernel.cache_dir%/doctrine/metadata
twig.extension.text:
class: Twig_Extensions_Extension_Text
tags:
- { name: twig.extension }

View file

@ -37,7 +37,7 @@
<li><a title="{% trans %}delete{% endtrans %}" class="tool delete icon-trash icon" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{% trans %}delete{% endtrans %}</span></a></li> <li><a title="{% trans %}delete{% endtrans %}" class="tool delete icon-trash icon" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{% trans %}delete{% endtrans %}</span></a></li>
<li><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %} : {{ entry.title|e }}" class="tool link icon-link icon"><span>{{ entry.domainName }}</span></a></li> <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %} : {{ entry.title|e }}" class="tool link icon-link icon"><span>{{ entry.domainName }}</span></a></li>
</ul> </ul>
<p>{{ entry.content|striptags|slice(0, 300) }}...</p> <p>{{ entry.content|striptags|slice(0, 300) }}&hellip;</p>
</div> </div>
{% endfor %} {% endfor %}
{% endif %} {% endif %}

View file

@ -40,16 +40,16 @@
{% else %} {% else %}
<div class="estimatedTime grey-text"><span class="tool reading-time">{% trans %}estimated reading time: {% endtrans %} <small class="inferieur">&lt;</small> 1 min</span></div> <div class="estimatedTime grey-text"><span class="tool reading-time">{% trans %}estimated reading time: {% endtrans %} <small class="inferieur">&lt;</small> 1 min</span></div>
{% endif %} {% endif %}
<p>{{ entry.content|striptags|slice(0, 300) }}...</p> <p>{{ entry.content|striptags|slice(0, 300) }}&hellip;</p>
</div> </div>
<div class="card-action"> <div class="card-action">
<span class="bold"><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %}: {{ entry.title|e }}" class="tool original grey-text"><span>{{ entry.domainName }}</span></a></bold> <span class="bold"><a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %}: {{ entry.title|e }} - {{ entry.domainName }}" class="tool original grey-text"><span>{{ entry.domainName | truncate(18) }}</span></a></bold>
<ul class="tools links right"> <ul class="tools links right">
<li> <li>
<a title="{% trans %}Toggle mark as read{% endtrans %}" class="tool grey-text {% if entry.isArchived == 0 %}mdi-action-done{% else %}mdi-content-redo{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"></a> <a title="{% trans %}Toggle mark as read{% endtrans %}" class="tool grey-text {% if entry.isArchived == 0 %}mdi-action-done{% else %}mdi-content-redo{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"></a>
<a title="{% trans %}toggle favorite{% endtrans %}" class="tool grey-text {% if entry.isStarred == 0 %}mdi-action-favorite-outline{% else %}mdi-action-favorite{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"></a> <a title="{% trans %}Toggle favorite{% endtrans %}" class="tool grey-text {% if entry.isStarred == 0 %}mdi-action-favorite-outline{% else %}mdi-action-favorite{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"></a>
<a title="{% trans %}delete{% endtrans %}" class="tool grey-text delete mdi-action-delete " href="{{ path('delete_entry', { 'id': entry.id }) }}"></a> <a title="{% trans %}Delete{% endtrans %}" class="tool grey-text delete mdi-action-delete " href="{{ path('delete_entry', { 'id': entry.id }) }}"></a>
</li> </li>
</ul> </ul>
</div> </div>