Add feature for generating new report of arbitrary type and params
This commit is contained in:
parent
13bba63382
commit
a139d9c844
6 changed files with 327 additions and 12 deletions
|
@ -60,7 +60,11 @@
|
|||
% endif
|
||||
% elif index_title:
|
||||
<span class="global">»</span>
|
||||
<span class="global">${index_title}</span>
|
||||
% if index_url:
|
||||
${h.link_to(index_title, index_url, class_='global')}
|
||||
% else:
|
||||
<span class="global">${index_title}</span>
|
||||
% endif
|
||||
% endif
|
||||
|
||||
<div class="feedback">
|
||||
|
|
65
tailbone/templates/reports/choose.mako
Normal file
65
tailbone/templates/reports/choose.mako
Normal file
|
@ -0,0 +1,65 @@
|
|||
## -*- coding: utf-8; -*-
|
||||
<%inherit file="/base.mako" />
|
||||
|
||||
<%def name="title()">${index_title}</%def>
|
||||
|
||||
<%def name="content_title()"></%def>
|
||||
|
||||
<%def name="extra_javascript()">
|
||||
<script type="text/javascript">
|
||||
|
||||
var report_descriptions = ${json.dumps(report_descriptions)|n};
|
||||
|
||||
function show_description(key) {
|
||||
var desc = report_descriptions[key];
|
||||
$('#report-description').text(desc);
|
||||
}
|
||||
|
||||
$(function() {
|
||||
|
||||
var report_type = $('select[name="report_type"]');
|
||||
|
||||
report_type.change(function(event) {
|
||||
show_description(report_type.val());
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</%def>
|
||||
|
||||
<%def name="extra_styles()">
|
||||
<style type="text/css">
|
||||
|
||||
#report-description {
|
||||
margin-top: 2em;
|
||||
margin-left: 2em;
|
||||
}
|
||||
|
||||
</style>
|
||||
</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
% if request.has_perm('report_output.list'):
|
||||
${h.link_to("View Generated Reports", url('report_output'))}
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
|
||||
<div class="form-wrapper">
|
||||
<p>Please select the type of report you wish to generate.</p>
|
||||
|
||||
<div style="display: flex;">
|
||||
${form.render()|n}
|
||||
<div id="report-description"></div>
|
||||
</div>
|
||||
|
||||
</div><!-- form-wrapper -->
|
||||
|
||||
<ul id="context-menu">
|
||||
${self.context_menu_items()}
|
||||
</ul>
|
||||
|
||||
</div>
|
26
tailbone/templates/reports/generate.mako
Normal file
26
tailbone/templates/reports/generate.mako
Normal file
|
@ -0,0 +1,26 @@
|
|||
## -*- coding: utf-8; -*-
|
||||
<%inherit file="/base.mako" />
|
||||
|
||||
<%def name="title()">${index_title} » ${report.name}</%def>
|
||||
|
||||
<%def name="content_title()">${report.name}</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
% if request.has_perm('report_output.list'):
|
||||
${h.link_to("View Generated Reports", url('report_output'))}
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
|
||||
<div class="form-wrapper">
|
||||
<p style="padding: 1em;">${report.__doc__}</p>
|
||||
${form.render()|n}
|
||||
</div><!-- form-wrapper -->
|
||||
|
||||
<ul id="context-menu">
|
||||
${self.context_menu_items()}
|
||||
</ul>
|
||||
|
||||
</div>
|
11
tailbone/templates/reports/generated/index.mako
Normal file
11
tailbone/templates/reports/generated/index.mako
Normal file
|
@ -0,0 +1,11 @@
|
|||
## -*- coding: utf-8; -*-
|
||||
<%inherit file="/master/index.mako" />
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
${parent.context_menu_items()}
|
||||
% if request.has_perm('{}.generate'.format(permission_prefix)):
|
||||
<li>${h.link_to("Generate new Report", url('generate_report'))}</li>
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
Loading…
Add table
Add a link
Reference in a new issue