fix tags
This commit is contained in:
parent
3477fc639b
commit
9be23e36d1
@ -1,5 +1,6 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% load static %}
|
{% load static %}
|
||||||
|
{% load core_tags %}
|
||||||
|
|
||||||
{% block title %}AI Task Manager - Home{% endblock %}
|
{% block title %}AI Task Manager - Home{% endblock %}
|
||||||
|
|
||||||
@ -69,7 +70,7 @@
|
|||||||
<td>{{ item.description|default:"" }}</td>
|
<td>{{ item.description|default:"" }}</td>
|
||||||
<td>
|
<td>
|
||||||
{% if item.tags %}
|
{% 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>
|
<span class="badge bg-secondary">{{ tag }}</span>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@ -35,7 +35,7 @@
|
|||||||
<p class="card-text small">{{ item.description|default:""|truncatewords:15 }}</p>
|
<p class="card-text small">{{ item.description|default:""|truncatewords:15 }}</p>
|
||||||
{% if item.tags %}
|
{% if item.tags %}
|
||||||
<div class="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>
|
<span class="badge bg-secondary">{{ tag }}</span>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Binary file not shown.
@ -5,3 +5,15 @@ register = template.Library()
|
|||||||
@register.filter
|
@register.filter
|
||||||
def get_item(dictionary, key):
|
def get_item(dictionary, key):
|
||||||
return dictionary.get(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