diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/templatetags/flags.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/main/templatetags/flags.py b/main/templatetags/flags.py new file mode 100644 index 0000000..22f524c --- /dev/null +++ b/main/templatetags/flags.py @@ -0,0 +1,13 @@ +from django import template + +register = template.Library() + + +@register.simple_tag +def country_flag(country): + if not country: + return '' + return '<span class="fam-flag fam-flag-%s" title="%s"></span> ' % ( + country.code.lower(), country.name) + +# vim: set ts=4 sw=4 et: |