Percentage complete works

Ain't half slow though!
This commit is contained in:
2021-07-16 04:05:55 +01:00
parent dbaab5cf8c
commit 2698798035
5 changed files with 37 additions and 22 deletions

View File

@@ -191,21 +191,6 @@ def linkornone(target, namespace=None, autoescape=True):
return "None"
@register.simple_tag
def user_has_qualification(user, item, depth):
if tmodels.TrainingItem.user_has_qualification(item, user, depth) is not None:
return mark_safe("<span class='fas fa-check text-success'></span>")
else:
return mark_safe("<span class='fas fa-hourglass-start text-warning'></span>")
@register.simple_tag
def user_level_if_present(user, level):
return tmodels.TrainingLevelQualification.objects.filter(trainee=user, level=level).first()
@register.simple_tag
def percentage_complete(level, user):
return level.percentage_complete(user)
@register.inclusion_tag('partials/button.html')
def button(type, url=None, pk=None, clazz="", icon=None, text="", id=None, style=None):
if type == 'edit':