* Now is more DRY, the JS code and the HTML code are in one place * It works even without JS Signed-off-by: volpino <fox91@anche.no>
12 lines
390 B
Python
12 lines
390 B
Python
from django import template
|
|
from django.core.urlresolvers import reverse
|
|
|
|
register = template.Library()
|
|
|
|
|
|
@register.inclusion_tag('euscan/_favourite.html', takes_context=True)
|
|
def favourite_buttons(context, subj, *args):
|
|
context["favourite_url"] = reverse("favourite_%s" % subj, args=args)
|
|
context["unfavourite_url"] = reverse("unfavourite_%s" % subj, args=args)
|
|
return context
|