Trim long tag by next whole word instead of ellipsis.

This commit is contained in:
voussoir 2017-05-01 20:18:28 -07:00
parent 9302bd627d
commit c71a45191e

View file

@ -149,11 +149,13 @@
{% set tags = photo.sorted_tags() %}
{% for tag in tags %}
<li>
{% set display_name=tag.qualified_name() %}
{% set qualified_name=tag.qualified_name() %}
{% set display_name=qualified_name %}
{% if display_name|length > 30 %}
{% set display_name = '...' + display_name[-27:] %}
{% set display_name = display_name[-30:] %}
{% set display_name = display_name.split(".", 1)[1] %}
{% endif %}
<a class="tag_object" href="/search?tag_musts={{tag.name}}">{{display_name}}</a><!--
<a class="tag_object" href="/search?tag_musts={{tag.name}}" title="{{qualified_name}}">{{display_name}}</a><!--
--><button
class="remove_tag_button"
onclick="remove_photo_tag('{{photo.id}}', '{{tag.name}}', receive_callback);">