* Event feedback functionality and related commits: * blackness and isort and flake8 - this branch does not have pre-commit so I forgot :/ * finish backoffice management of eventfeedback * add username to eventfeedback detail panel when viewed in backoffice * Add feedback url to elm schedule. Fix access when user is anonymous. Remove print statement. * one prefetch_related call to rule them all Co-authored-by: Víðir Valberg Guðmundsson <valberg@orn.li>
19 lines
514 B
Python
19 lines
514 B
Python
from django import template
|
|
from django.utils.safestring import mark_safe
|
|
|
|
register = template.Library()
|
|
|
|
|
|
@register.filter(name="zip")
|
|
def zip_lists(a, b):
|
|
return zip(a, b)
|
|
|
|
|
|
@register.filter()
|
|
def truefalseicon(value):
|
|
""" A templatetag to show a green checkbox or red x depending on True/False value """
|
|
if value:
|
|
return mark_safe("<span class='text-success glyphicon glyphicon-ok'></span>")
|
|
else:
|
|
return mark_safe("<span class='text-danger glyphicon glyphicon-remove'></span>")
|