Allow choosing report from simple list, when generating new

refs #6619
This commit is contained in:
Lance Edgar 2019-05-08 13:00:09 -05:00
parent 3cb803ffe3
commit fadf540422
2 changed files with 26 additions and 0 deletions

View file

@ -31,10 +31,21 @@
<%def name="extra_styles()">
<style type="text/css">
% if use_form:
#report-description {
margin-top: 2em;
margin-left: 2em;
}
% else:
.report-selection {
margin-left: 10em;
margin-top: 3em;
}
.report-selection h3 {
margin-top: 2em;
}
% endif
</style>
</%def>
@ -48,6 +59,7 @@
<div style="display: flex; justify-content: space-between;">
% if use_form:
<div class="form-wrapper">
<p>Please select the type of report you wish to generate.</p>
@ -57,6 +69,18 @@
</div>
</div><!-- form-wrapper -->
% else:
<div>
<p>Please select the type of report you wish to generate.</p>
<div class="report-selection">
% for key, report in reports.items():
<h3>${h.link_to(report.name, url('generate_specific_report', type_key=key))}</h3>
<p>${report.__doc__}</p>
% endfor
</div>
</div>
% endif
<ul id="context-menu">
${self.context_menu_items()}

View file

@ -319,6 +319,8 @@ class GenerateReport(View):
'reports': reports,
'report_descriptions': dict([(r.type_key, r.__doc__)
for r in reports.values()]),
'use_form': self.rattail_config.getbool('tailbone', 'reporting.choosing_uses_form',
default=True),
}
def generate(self):