X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/4419f93a01685b9864a6e78cb905c803ec0970b0..24c1d259ba4af084959d70c6a1f355d0a57f1191:/apps/toolbar/templatetags/toolbar_tags.py?ds=sidebyside diff --git a/apps/toolbar/templatetags/toolbar_tags.py b/apps/toolbar/templatetags/toolbar_tags.py index a38ed017..0766677e 100644 --- a/apps/toolbar/templatetags/toolbar_tags.py +++ b/apps/toolbar/templatetags/toolbar_tags.py @@ -1,9 +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(): - groups = models.ButtonGroup.objects.all() - return {'groups': groups} + return {'toolbar_groups': models.ButtonGroup.objects.all().select_related()} + + +@register.inclusion_tag('toolbar/button.html') +def toolbar_button(b): + return {'button': b}