from django import template

register = template.Library()


@register.simple_tag(takes_context=True)
def active_view(context, view_name, active_css_class="active"):
    active_view_name = context.get("active_view")
    return active_css_class if view_name == active_view_name else ""
