diff --git a/tailbone/templates/reports/base.mako b/tailbone/templates/reports/base.mako index 5833b0ec..cc379506 100644 --- a/tailbone/templates/reports/base.mako +++ b/tailbone/templates/reports/base.mako @@ -1,3 +1,4 @@ -## -*- coding: utf-8 -*- -<%inherit file="/base.mako" /> +## -*- coding: utf-8; -*- +<%inherit file="/page.mako" /> + ${parent.body()} diff --git a/tailbone/views/departments.py b/tailbone/views/departments.py index a0212d63..3e876c66 100644 --- a/tailbone/views/departments.py +++ b/tailbone/views/departments.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2022 Lance Edgar +# Copyright © 2010-2023 Lance Edgar # # This file is part of Rattail. # @@ -218,6 +218,19 @@ class DepartmentView(MasterView): .distinct()\ .order_by(model.Department.name) + if self.get_use_buefy(): + + def normalize(dept): + return { + 'uuid': dept.uuid, + 'number': dept.number, + 'name': dept.name, + } + + return self.json_response([normalize(d) for d in data]) + + # nb. the rest of this is legacy / not buefy + def configure(g): g.configure(include=[ g.name, diff --git a/tailbone/views/reports.py b/tailbone/views/reports.py index 70e4d7e6..7bcc05da 100644 --- a/tailbone/views/reports.py +++ b/tailbone/views/reports.py @@ -101,7 +101,7 @@ class OrderingWorksheet(View): response.headers['Content-Disposition'] = 'attachment; filename=ordering.html' response.text = body return response - return {} + return {'use_buefy': self.get_use_buefy()} def write_report(self, vendor, departments, preferred_only): """