bornhack-website/src/utils/templatetags/bornhack.py
Thomas Steen Rasmussen 33383e6559
Event feedback (#451)
* 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>
2020-02-22 14:50:09 +01:00

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>")