Make report-table styles prettier
parent
84dfe3918c
commit
bf83ef7a98
|
@ -129,6 +129,11 @@ if ($action eq "wrap")
|
||||||
$vars->{imagebase} = http_build_query($a);
|
$vars->{imagebase} = http_build_query($a);
|
||||||
$a = { %$ARGS };
|
$a = { %$ARGS };
|
||||||
delete $a->{$_} for qw(query_format action ctype format width height measure);
|
delete $a->{$_} for qw(query_format action ctype format width height measure);
|
||||||
|
for (keys %$a)
|
||||||
|
{
|
||||||
|
delete $a->{$_} if $a->{$_} eq '';
|
||||||
|
}
|
||||||
|
$vars->{switchparams} = $a;
|
||||||
$vars->{switchbase} = http_build_query($a);
|
$vars->{switchbase} = http_build_query($a);
|
||||||
}
|
}
|
||||||
elsif ($action eq "plot")
|
elsif ($action eq "plot")
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
id="svg8"
|
||||||
|
version="1.1"
|
||||||
|
viewBox="0 0 116.86519 32.210506"
|
||||||
|
height="32.210506mm"
|
||||||
|
preserveAspectRatio="none"
|
||||||
|
width="116.86519mm">
|
||||||
|
<g
|
||||||
|
transform="translate(483.18298,-59.147989)"
|
||||||
|
id="layer1">
|
||||||
|
<path
|
||||||
|
id="path819"
|
||||||
|
d="M -483.05357,59.630952 -366.4472,90.875534"
|
||||||
|
style="fill:none;fill-rule:evenodd;stroke:#000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 782 B |
|
@ -53,21 +53,6 @@ END; %]
|
||||||
<h2>[% tbl_disp FILTER email FILTER html %]</h2>
|
<h2>[% tbl_disp FILTER email FILTER html %]</h2>
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
</td>
|
|
||||||
<td align="center">
|
|
||||||
<strong>[% col_field_disp FILTER html %]</strong>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td valign="middle">
|
|
||||||
<strong>[% row_field_disp FILTER html %]</strong>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
|
|
||||||
[% classes = [ [ "t1", "t2" ] , [ "t3", "t4" ] ] %]
|
[% classes = [ [ "t1", "t2" ] , [ "t3", "t4" ] ] %]
|
||||||
[% col_idx = 0 %]
|
[% col_idx = 0 %]
|
||||||
[% row_idx = 0 %]
|
[% row_idx = 0 %]
|
||||||
|
@ -76,14 +61,30 @@ END; %]
|
||||||
<table class="report" border="1" style="border-collapse: collapse">
|
<table class="report" border="1" style="border-collapse: collapse">
|
||||||
[% IF col_field %]
|
[% IF col_field %]
|
||||||
<tr>
|
<tr>
|
||||||
<td class="[% classes.$row_idx.$col_idx %]">
|
<td class="[% classes.$row_idx.$col_idx %]"><div style="position: relative; height: 100%">
|
||||||
</td>
|
<img style="position: absolute; left: 0; top: 0; width: 100%; height: 100%" src="skins/standard/global/diag.svg" />
|
||||||
|
<table>
|
||||||
|
<tr><td></td><td><strong>[% col_field_disp FILTER html %]</strong></td></tr>
|
||||||
|
<tr><td><strong>[% row_field_disp FILTER html %]</strong></td><td></td></tr>
|
||||||
|
</table>
|
||||||
|
</div></td>
|
||||||
[% FOREACH col = col_names %]
|
[% FOREACH col = col_names %]
|
||||||
[% col_idx = 1 - col_idx %]
|
[% col_idx = 1 - col_idx %]
|
||||||
<td class="[% classes.$row_idx.$col_idx %]"[% ' colspan="3"' IF measure == 'times' %]>
|
<td class="[% classes.$row_idx.$col_idx %]"[% ' colspan="3"' IF measure == 'times' %]>
|
||||||
[% PROCESS value_display value = col field = col_field %]
|
[% PROCESS value_display value = col field = col_field %]
|
||||||
</td>
|
</td>
|
||||||
[% END %]
|
[% END %]
|
||||||
|
[% IF col_names.size > 1 %]
|
||||||
|
<td class="ttotal"[% ' colspan="3"' IF measure == 'times' %]>
|
||||||
|
Total
|
||||||
|
</td>
|
||||||
|
[% END %]
|
||||||
|
</tr>
|
||||||
|
[% ELSE %]
|
||||||
|
<tr>
|
||||||
|
<td class="[% classes.$row_idx.$col_idx %]">
|
||||||
|
<strong>[% row_field_disp FILTER html %]</strong>
|
||||||
|
</td>
|
||||||
<td class="ttotal"[% ' colspan="3"' IF measure == 'times' %]>
|
<td class="ttotal"[% ' colspan="3"' IF measure == 'times' %]>
|
||||||
Total
|
Total
|
||||||
</td>
|
</td>
|
||||||
|
@ -160,10 +161,6 @@ END; %]
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
[% BLOCK value_display %]
|
[% BLOCK value_display %]
|
||||||
[% SET disp_value = value %]
|
[% SET disp_value = value %]
|
||||||
[% IF field == 'assigned_to' OR field == 'reporter' OR field == 'qa_contact' %]
|
[% IF field == 'assigned_to' OR field == 'reporter' OR field == 'qa_contact' %]
|
||||||
|
|
|
@ -17,14 +17,14 @@
|
||||||
#
|
#
|
||||||
# Contributor(s): Gervase Markham <gerv@gerv.net>
|
# Contributor(s): Gervase Markham <gerv@gerv.net>
|
||||||
#%]
|
#%]
|
||||||
|
|
||||||
[%# INTERFACE:
|
[%# INTERFACE:
|
||||||
# col_field: string. Name of the field being plotted as columns.
|
# col_field: string. Name of the field being plotted as columns.
|
||||||
# row_field: string. Name of the field being plotted as rows.
|
# row_field: string. Name of the field being plotted as rows.
|
||||||
# tbl_field: string. Name of the field being plotted as tables.
|
# tbl_field: string. Name of the field being plotted as tables.
|
||||||
# tbl_names: array. List of values for the field being plotted as tables.
|
# tbl_names: array. List of values for the field being plotted as tables.
|
||||||
# time: integer. Seconds since the epoch.
|
# time: integer. Seconds since the epoch.
|
||||||
# data: <depends on format>. Data to plot.
|
# data: <depends on format>. Data to plot.
|
||||||
# format: string. Format of the individual reports.
|
# format: string. Format of the individual reports.
|
||||||
# width: integer. For image charts, height of the image.
|
# width: integer. For image charts, height of the image.
|
||||||
# height: integer. For image charts, width of the image.
|
# height: integer. For image charts, width of the image.
|
||||||
|
@ -41,10 +41,9 @@
|
||||||
[% tbl_field_disp = field_descs.$tbl_field || tbl_field %]
|
[% tbl_field_disp = field_descs.$tbl_field || tbl_field %]
|
||||||
[% col_field_disp = field_descs.$col_field || col_field %]
|
[% col_field_disp = field_descs.$col_field || col_field %]
|
||||||
[% row_field_disp = field_descs.$row_field || row_field %]
|
[% row_field_disp = field_descs.$row_field || row_field %]
|
||||||
[% switchbase = switchbase FILTER html %]
|
|
||||||
|
|
||||||
[% title = BLOCK %]
|
[% title = BLOCK %]
|
||||||
Report:
|
Report:
|
||||||
[% IF tbl_field %]
|
[% IF tbl_field %]
|
||||||
[% tbl_field_disp FILTER html %]
|
[% tbl_field_disp FILTER html %]
|
||||||
[% END %]
|
[% END %]
|
||||||
|
@ -58,12 +57,12 @@
|
||||||
|
|
||||||
[% time = time FILTER time('%Y-%m-%d %H:%M:%S') FILTER html %]
|
[% time = time FILTER time('%Y-%m-%d %H:%M:%S') FILTER html %]
|
||||||
|
|
||||||
[% PROCESS global/header.html.tmpl
|
[% PROCESS global/header.html.tmpl
|
||||||
style = "
|
style = "
|
||||||
.t1 { background-color: #ffffff } /* white */
|
.t1 { background-color: #ffffff } /* white */
|
||||||
.t2 { background-color: #dfefff } /* light blue */
|
.t2 { background-color: #dfefff } /* light blue */
|
||||||
.t3 { background-color: #dddddd } /* grey */
|
.t3 { background-color: #ffffff } /* white */
|
||||||
.t4 { background-color: #c3d3ed } /* darker blue */
|
.t4 { background-color: #dfefff } /* light blue */
|
||||||
.ttotal { background-color: #cfffdf } /* light green */
|
.ttotal { background-color: #cfffdf } /* light green */
|
||||||
"
|
"
|
||||||
style_urls = ['skins/standard/reports.css']
|
style_urls = ['skins/standard/reports.css']
|
||||||
|
@ -74,9 +73,9 @@
|
||||||
<p>[% query FILTER html %]</p>
|
<p>[% query FILTER html %]</p>
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
||||||
<div align="center">
|
<div>
|
||||||
|
|
||||||
[% FOREACH tbl = tbl_names %]
|
[% FOREACH tbl = tbl_names %]
|
||||||
[% IF tbl == "-total-" %]
|
[% IF tbl == "-total-" %]
|
||||||
[% tbl_disp = "Total" %]
|
[% tbl_disp = "Total" %]
|
||||||
[% ELSE %]
|
[% ELSE %]
|
||||||
|
@ -89,7 +88,7 @@
|
||||||
[% IF tbl %]
|
[% IF tbl %]
|
||||||
<h2>[% tbl_disp FILTER email FILTER html %]</h2>
|
<h2>[% tbl_disp FILTER email FILTER html %]</h2>
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
||||||
[% imageurl = BLOCK %]report.cgi?[% imagebase FILTER html %]&format=
|
[% imageurl = BLOCK %]report.cgi?[% imagebase FILTER html %]&format=
|
||||||
[% format FILTER url_quote %]&ctype=png&action=plot&
|
[% format FILTER url_quote %]&ctype=png&action=plot&
|
||||||
[% IF tbl_field %]
|
[% IF tbl_field %]
|
||||||
|
@ -102,91 +101,93 @@
|
||||||
[% END %]
|
[% END %]
|
||||||
[% END %]
|
[% END %]
|
||||||
[% END %]
|
[% END %]
|
||||||
[% END %]width=[% width %]&height=[% height %]
|
[% END %]width=[% width %]&height=[% height %]
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
||||||
<img alt="Graphical report results" src="[% imageurl %]"
|
<img alt="Graphical report results" src="[% imageurl %]"
|
||||||
width="[% width %]" height="[% height %]">
|
width="[% width %]" height="[% height %]">
|
||||||
[% END %]
|
[% END %]
|
||||||
<br />
|
<br />
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
||||||
<table>
|
<form method="GET" action="?">
|
||||||
|
<input type="hidden" name="action" value="wrap" />
|
||||||
|
[% FOR k = switchparams.keys.sort %]
|
||||||
|
<input type="hidden" name="[% k | html %]" value="[% switchparams.$k | html %]" />
|
||||||
|
[% END %]
|
||||||
|
<table class="admin_table">
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
Format:
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
[% formats = [
|
||||||
|
{ name => "pie", description => "Pie" },
|
||||||
|
{ name => "bar", description => "Bar" },
|
||||||
|
{ name => "line", description => "Line" },
|
||||||
|
{ name => "table", description => "Table" }
|
||||||
|
] %]
|
||||||
|
<select name="format" style="width: 100%; border: 0; margin-top: 2px">
|
||||||
|
[% FOR f = formats %]
|
||||||
|
<option value="[% f.name | html %]"[% IF f.name == format %] selected="selected"[% END %]>[% f.description | html %]</option>
|
||||||
|
[% END %]
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
Show:
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
[% measure_descs = {
|
||||||
|
rtime => 'Remaining time'
|
||||||
|
etime => 'Estimated time'
|
||||||
|
wtime => 'Actual time'
|
||||||
|
times => 'Estimated/Actual/Remaining'
|
||||||
|
count => "Number of $terms.bugs"
|
||||||
|
} %]
|
||||||
|
<select name="measure" style="width: 100%; border: 0; margin-top: 2px">
|
||||||
|
[% FOR m = measure_descs.keys.sort %]
|
||||||
|
<option value="[% m %]"[% IF measure == m %] selected="selected"[% END %]>[% measure_descs.$m %]</option>
|
||||||
|
[% END %]
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
[% IF format != "table" %]
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
[% formats = [ { name => "pie", description => "Pie" },
|
Width:
|
||||||
{ name => "bar", description => "Bar" },
|
</td>
|
||||||
{ name => "line", description => "Line" },
|
<td>
|
||||||
{ name => "table", description => "Table" } ] %]
|
<input type="text" name="width" value="[% width %]" />
|
||||||
|
</td>
|
||||||
[% formaturl = "report.cgi?$switchbase&width=$width" _
|
</tr>
|
||||||
"&height=$height&action=wrap" %]
|
<tr>
|
||||||
[% FOREACH other_format = formats %]
|
<td>
|
||||||
[% NEXT IF other_format.name == "pie" AND row_field AND col_field %]
|
Height:
|
||||||
[% UNLESS other_format.name == format %]
|
</td>
|
||||||
<a href="[% formaturl %]&format=[% other_format.name %]&measure=[% measure %]">
|
<td>
|
||||||
[% END %]
|
<input type="text" name="height" value="[% height %]" />
|
||||||
[% other_format.description FILTER html %]
|
</td>
|
||||||
[% "</a>" UNLESS other_format.name == format %] |
|
</tr>
|
||||||
[% END %]
|
[% END %]
|
||||||
<a href="[% formaturl %]&measure=[% measure %]&ctype=csv&format=table">CSV</a>
|
<tr>
|
||||||
|
<td colspan="2" style="text-align: center">
|
||||||
|
<input type="submit" value="Apply Format" />
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
[% IF format != "table" %]
|
|
||||||
<td>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
|
|
||||||
[% sizeurl = BLOCK %]report.cgi?
|
|
||||||
[% switchbase %]&action=wrap&format=[% format FILTER html %]&measure=[% measure FILTER html %][% END %]
|
|
||||||
<td align="center">
|
|
||||||
<a href="[% sizeurl %]&width=[% width %]&height=
|
|
||||||
[% height + 100 %]">Taller</a><br />
|
|
||||||
<a href="[% sizeurl %]&width=[% width - 100 %]&height=
|
|
||||||
[% height %]">Thinner</a> *
|
|
||||||
<a href="[% sizeurl %]&width=[% width + 100 %]&height=
|
|
||||||
[% height %]">Fatter</a> <br />
|
|
||||||
<a href="[% sizeurl %]&width=[% width %]&height=
|
|
||||||
[% height - 100 %]">Shorter</a><br />
|
|
||||||
</td>
|
|
||||||
[% END %]
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
</form>
|
||||||
<table><tr><td>
|
<div style="margin-top: 1em">
|
||||||
[% measure_descs = {
|
<input type="button" onclick="window.location.href='query.cgi?[% switchbase | html %]
|
||||||
rtime => 'Remaining time'
|
[%- IF format == "table" -%]&format=report-table
|
||||||
etime => 'Estimated time'
|
[%- ELSE -%]&chart_format=[% format %]&format=report-graph&cumulate=[% cumulate %]
|
||||||
wtime => 'Actual time'
|
[%- END -%]'" value="Edit this report" />
|
||||||
times => 'Estimated/Actual/Remaining'
|
|
||||||
count => "Number of $terms.bugs"
|
|
||||||
} %]
|
|
||||||
[% FOR m = measure_descs.keys.sort %]
|
|
||||||
[% IF m != 'times' || format == 'table' %]
|
|
||||||
[%+ IF measure != m %]<a href="[% formaturl %]&format=[% format %]&measure=[% m %]">[% END %]
|
|
||||||
[% measure_descs.$m %]
|
|
||||||
[% IF measure != m %]</a>[% END %]
|
|
||||||
[% IF NOT loop.last %] | [% END %]
|
|
||||||
[% END %]
|
|
||||||
[% END %]
|
|
||||||
</td></tr></table>
|
|
||||||
|
|
||||||
|
|
||||||
<p>
|
|
||||||
[% IF format == "table" %]
|
|
||||||
<a href="query.cgi?[% switchbase %]&format=report-table">Edit
|
|
||||||
this report</a>
|
|
||||||
[% ELSE %]
|
|
||||||
<a href="query.cgi?[% switchbase %]&chart_format=
|
|
||||||
[% format %]&format=report-graph&cumulate=[% cumulate %]">
|
|
||||||
Edit this report
|
|
||||||
</a>
|
|
||||||
[% END %]
|
|
||||||
[% IF saved_report_id %]
|
[% IF saved_report_id %]
|
||||||
| <a href="report.cgi?action=del&saved_report_id=[% saved_report_id FILTER uri %]&token=
|
| <a href="report.cgi?action=del&saved_report_id=[% saved_report_id FILTER uri %]&token=
|
||||||
[%~ issue_hash_token(['delete_report', saved_report_id]) FILTER uri %]">Forget this report</a>
|
[%~ issue_hash_token(['delete_report', saved_report_id]) FILTER uri %]">Forget this report</a>
|
||||||
[% ELSE %]
|
[% ELSE %]
|
||||||
<form method="get" action="report.cgi">
|
<form method="get" action="report.cgi" style="display: inline">
|
||||||
<input type="submit" id="remember" value="Remember report" /> as
|
<input type="submit" id="remember" value="Remember report" /> as
|
||||||
<input type="hidden" name="query" value="[% switchbase %]&format=[% format FILTER html %]&action=wrap" />
|
<input type="hidden" name="query" value="[% switchbase %]&format=[% format FILTER html %]&action=wrap" />
|
||||||
<input type="hidden" name="action" value="add" />
|
<input type="hidden" name="action" value="add" />
|
||||||
|
@ -194,8 +195,8 @@
|
||||||
<input type="text" id="name" name="name" size="20" value="" maxlength="64" />
|
<input type="text" id="name" name="name" size="20" value="" maxlength="64" />
|
||||||
</form>
|
</form>
|
||||||
[% END %]
|
[% END %]
|
||||||
</p>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
[% PROCESS global/footer.html.tmpl %]
|
[% PROCESS global/footer.html.tmpl %]
|
||||||
|
|
Loading…
Reference in New Issue