@register.simple_tag
def get_state_flags(unit):
 flags = []
 if unit.fuzzy:
  flags.append((_(u'Message needs review'), u'question-circle text-danger'))
 elif (not unit.translated):
  flags.append((_(u'Message is not translated'), u'times-circle text-danger'))
 elif unit.has_failing_check:
  flags.append((_(u'Message has failing checks'), u'exclamation-circle text-warning'))
 elif unit.translated:
  flags.append((_(u'Message is translated'), u'check-circle text-success'))
 if unit.has_comment:
  flags.append((_(u'Message has comments'), u'comment text-info'))
 return mark_safe(u'\n'.join([FLAG_TEMPLATE.format(*flag) for flag in flags]))

@ register . simple_tag def get_state_flags ( unit ) : flags = [ ] if unit . fuzzy : flags . append ( ( _ ( u'Message needs review' ) , u'question-circle text-danger' ) ) elif ( not unit . translated ) : flags . append ( ( _ ( u'Message is not translated' ) , u'times-circle text-danger' ) ) elif unit . has_failing_check : flags . append ( ( _ ( u'Message has failing checks' ) , u'exclamation-circle text-warning' ) ) elif unit . translated : flags . append ( ( _ ( u'Message is translated' ) , u'check-circle text-success' ) ) if unit . has_comment : flags . append ( ( _ ( u'Message has comments' ) , u'comment text-info' ) ) return mark_safe ( u'\n' . join ( [ FLAG_TEMPLATE . format ( * flag ) for flag in flags ] ) )
returns state flags .