X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/9bbfcaec3e58c99635b5abe7484e44b41e60d5fc..995d7d01ab2f1a0a378fcf180f069845a454689a:/apps/toolbar/templatetags/toolbar_tags.py diff --git a/apps/toolbar/templatetags/toolbar_tags.py b/apps/toolbar/templatetags/toolbar_tags.py index e69de29b..0766677e 100644 --- a/apps/toolbar/templatetags/toolbar_tags.py +++ b/apps/toolbar/templatetags/toolbar_tags.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# +# This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +from django import template +from toolbar import models + +register = template.Library() + + +@register.inclusion_tag('toolbar/toolbar.html') +def toolbar(): + return {'toolbar_groups': models.ButtonGroup.objects.all().select_related()} + + +@register.inclusion_tag('toolbar/button.html') +def toolbar_button(b): + return {'button': b}