Generate PDFs from Power Test Records (#594)

* Add new block to base_print.xml for additional styles from downstream templates

* Fix page totals on exports by adding <namedString> element

* Add new print template for power test records

* Add a generated name property to power tests to allow for export

* Add new routes for print export for power tests

* Add print button to power test records view page

* Address linting errors
This commit is contained in:
Joe Banks
2024-10-15 22:48:47 +01:00
committed by GitHub
parent 3123d3899c
commit 6c8eb380fd
6 changed files with 190 additions and 0 deletions

View File

@@ -232,6 +232,16 @@ class RAPrint(PrintView):
return context
class PowerPrint(PrintView):
model = models.PowerTestRecord
template_name = 'hs/power_print.xml'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['filename'] = f"PowerTestRecord_for_{context['object'].event.display_id}.pdf"
return context
class EventCheckIn(generic.CreateView, ModalURLMixin):
model = models.EventCheckIn
template_name = 'hs/eventcheckin_form.html'