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
No known key found for this signature in database
GPG Key ID: E28D7679E9A9EDE2
3 changed files with
3 additions and
13 deletions
-
hc/front/templatetags/hc_extras.py
-
templates/front/details_events.html
-
templates/front/log.html
|
|
@ -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: |
|
|
|
|
|
@ -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 %} |
|
|
|
|
|
@ -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 %} |
|
|
|