Commits

ceshine  committed 459a911

add a tag user_status_tag and a filter argument "tag" for status_format to provide not-translated texts for css styling.

  • Participants
  • Parent commits 1618209

Comments (0)

Files changed (3)

File online_status/__init__.py

-VERSION = (0, 1, 0)
+VERSION = (0, 1, 1)
 
 def get_version():
     version = '%s.%s' % (VERSION[0], VERSION[1])

File online_status/templatetags/online_status_tags.py

     status = status_for_user(user)
     return {'onlinestatus': status,}
 
-
+@register.inclusion_tag('online_status/user_status_tag.html')
+def user_status_tag(user):
+    status = status_for_user(user)
+    return {'onlinestatus': status,}

File online_status/templatetags/status_format.py

             return _('idle')
         else:
             return _('offline')
+    elif arg == "tag":
+        if val == 1:
+            return 'online'
+        elif val == 0:
+            return 'idle'
+        else:
+            return 'offline'
     else:
         return val