Browse Source

Allow check names to wrap at underscores

pull/178/head
Pēteris Caune 7 years ago
parent
commit
f119883d67
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
2 changed files with 8 additions and 1 deletions
  1. +7
    -0
      hc/front/templatetags/hc_extras.py
  2. +1
    -1
      templates/front/my_checks_desktop.html

+ 7
- 0
hc/front/templatetags/hc_extras.py View File

@ -81,3 +81,10 @@ def num_down_title(num_down):
return "%d down – %s" % (num_down, settings.SITE_NAME)
else:
return settings.SITE_NAME
@register.filter
def break_underscore(s):
if len(s) > 30:
s = s.replace("_", "_\u200b")
return s

+ 1
- 1
templates/front/my_checks_desktop.html View File

@ -59,7 +59,7 @@
data-tags="{{ check.tags }}"
data-url="{% url 'hc-update-name' check.code %}"
class="my-checks-name {% if not check.name %}unnamed{% endif %}">
<div>{{ check.name|default:"unnamed" }}</div>
<div>{{ check.name|default:"unnamed"|break_underscore }}</div>
{% for tag in check.tags_list %}
<span class="label label-tag">{{ tag }}</span>
{% endfor %}


Loading…
Cancel
Save