Commits

Derek Payton committed 5ab4b02

Pass STATIC_URL to templatetags, added render_recent_activity tag.

Comments (0)

Files changed (1)

activitysync/templatetags/activitysync_extras.py

         'activities': activities,
         'use_date_headers': False,
         'MEDIA_URL': settings.MEDIA_URL,
+        'STATIC_URL': settings.STATIC_URL,
     }
 
 @register.inclusion_tag('activitysync/activities_tag.html')
         'activities': activities,
         'use_date_headers': True,
         'MEDIA_URL': settings.MEDIA_URL,
+        'STATIC_URL': settings.STATIC_URL,
     }
 
+@register.inclusion_tag('activitysync/activities_tag.html')
+def render_recent_activity(limit=20, use_date_headers=False):
+    activities = Activity.objects.all()[:limit]
+    return {
+        'activities': activities,
+        'use_date_headers': use_date_headers,
+        'MEDIA_URL': settings.MEDIA_URL,
+        'STATIC_URL': settings.STATIC_URL,
+    }