Source

django-activitysync / activitysync / templatetags / activitysync_extras.py

Full commit
from django import template
from django.conf import settings
from activitysync.models import Activity

register = template.Library()

@register.inclusion_tag('activitysync/activities_tag.html')
def render_activities(activities):
    return {
        'activities': activities,
        'use_date_headers': False,
        'MEDIA_URL': settings.MEDIA_URL,
        'STATIC_URL': settings.STATIC_URL,
    }

@register.inclusion_tag('activitysync/activities_tag.html')
def render_activities_with_date_headers(activities):
    return {
        '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,
    }