Browse Source

Drop the `trunc` template filter, Django has a built in `truncatechars` that does the same thing.

pull/193/head
Pēteris Caune 6 years ago
parent
commit
0a50962f2b
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
3 changed files with 3 additions and 13 deletions
  1. +0
    -5
      hc/front/templatetags/hc_extras.py
  2. +1
    -6
      templates/front/details_events.html
  3. +2
    -2
      templates/front/log.html

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

@ -70,11 +70,6 @@ def sortchecks(checks, key):
return checks
@register.filter
def trunc(s):
return s[:150]
@register.filter
def num_down_title(num_down):
if num_down:


+ 1
- 6
templates/front/details_events.html View File

@ -19,11 +19,6 @@
<td class="details">
{% if event.scheme == "email" %}
{{ event.ua }}
<span class="ua-body">
{% if event.body %}
- {{ event.body|trunc }}
{% endif %}
</span>
{% else %}
{{ event.scheme|upper }}
{{ event.method }}
@ -32,7 +27,7 @@
{% endif %}
<span class="ua-body">
{% if event.ua %}
- {{ event.ua }}
- {{ event.ua|truncatechars:80 }}
{% endif %}
</span>
{% endif %}


+ 2
- 2
templates/front/log.html View File

@ -55,7 +55,7 @@
{{ event.ua }}
<span class="ua-body">
{% if event.body %}
- {{ event.body|trunc }}
- {{ event.body|truncatechars:150 }}
{% endif %}
</span>
{% else %}
@ -69,7 +69,7 @@
- {{ event.ua }}
{% endif %}
{% if event.body %}
- {{ event.body|trunc }}
- {{ event.body|truncatechars:150 }}
{% endif %}
</span>
{% endif %}


Loading…
Cancel
Save