Skip to content

Commit

Permalink
Add custom template filter for Data Strategy Tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
thriuin committed Dec 7, 2023
1 parent 2ebdabf commit 202e764
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions search/templatetags/search_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,19 @@ def split(value, key):
@register.filter(name='add_str')
def add_str(value: str, arg1: str):
return value + arg1


@register.filter('ds_status_label')
def ds_status_label(value: str):
if value in ['In Progess', 'En cours']:
return 'label label-primary'
elif value in ['Behind']:
return 'label label-warning'
elif value in ['Completed', 'Terminé']:
return 'label label-success'
elif value in ['Paused', 'En pause']:
return 'label label-info'
else:
return 'label label-default'


0 comments on commit 202e764

Please sign in to comment.