fix tags
This commit is contained in:
parent
3477fc639b
commit
9be23e36d1
@ -1,5 +1,6 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load static %}
|
||||
{% load core_tags %}
|
||||
|
||||
{% block title %}AI Task Manager - Home{% endblock %}
|
||||
|
||||
@ -69,7 +70,7 @@
|
||||
<td>{{ item.description|default:"" }}</td>
|
||||
<td>
|
||||
{% if item.tags %}
|
||||
{% for tag in item.tags.split:','|slice:":3" %}
|
||||
{% for tag in item.tags|split:","|slice:":3" %}
|
||||
<span class="badge bg-secondary">{{ tag }}</span>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
<p class="card-text small">{{ item.description|default:""|truncatewords:15 }}</p>
|
||||
{% if item.tags %}
|
||||
<div class="tags">
|
||||
{% for tag in item.tags.split:','|slice:":3" %}
|
||||
{% for tag in item.tags|split:","|slice:":3" %}
|
||||
<span class="badge bg-secondary">{{ tag }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
Binary file not shown.
@ -5,3 +5,15 @@ register = template.Library()
|
||||
@register.filter
|
||||
def get_item(dictionary, key):
|
||||
return dictionary.get(key)
|
||||
|
||||
|
||||
@register.filter
|
||||
def get_obj_attr(obj, attr):
|
||||
return getattr(obj, attr, None)
|
||||
|
||||
@register.filter
|
||||
def split(value, key):
|
||||
"""
|
||||
Returns the value turned into a list.
|
||||
"""
|
||||
return value.split(key)
|
||||
Loading…
x
Reference in New Issue
Block a user