From b3abb29f2814bafd69095f3ef91bc40cbe5f866c Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Fri, 25 Sep 2015 18:28:20 +0200 Subject: Bug 1204238: Migrate tabular report sorting from YUI to jQuery r=gerv --- template/en/default/filterexceptions.pl | 1 - template/en/default/global/header.html.tmpl | 6 +- template/en/default/reports/report-table.html.tmpl | 176 +++------------------ template/en/default/reports/report.html.tmpl | 5 +- 4 files changed, 32 insertions(+), 156 deletions(-) (limited to 'template') diff --git a/template/en/default/filterexceptions.pl b/template/en/default/filterexceptions.pl index f5f1bd783..f83efaa88 100644 --- a/template/en/default/filterexceptions.pl +++ b/template/en/default/filterexceptions.pl @@ -75,7 +75,6 @@ 'reports/report-table.html.tmpl' => [ '"&$col_vals" IF col_vals', '"&$row_vals" IF row_vals', - 'classes.$row_idx.$col_idx', 'urlbase', 'data.$tbl.$col.$row', ], diff --git a/template/en/default/global/header.html.tmpl b/template/en/default/global/header.html.tmpl index 488828daf..af9c8b686 100644 --- a/template/en/default/global/header.html.tmpl +++ b/template/en/default/global/header.html.tmpl @@ -83,7 +83,11 @@ "js/jquery/ui/jquery-ui-structure-min.css", "js/jquery/ui/jquery-ui-theme-min.css", ] %] -[% style_urls.import(jquery_css, jq_css_urls) FILTER null %] + +[% FOREACH jq_name = jquery_css %] + [% style_urls.push("js/jquery/plugins/$jq_name/${jq_name}-min.css") %] +[% END %] +[% style_urls.import(jq_css_urls) FILTER null %] [%# Add our required jQuery plugins %] [% jquery.push("cookie", "devbridgeAutocomplete") %] diff --git a/template/en/default/reports/report-table.html.tmpl b/template/en/default/reports/report-table.html.tmpl index 57e998b1d..03f3147df 100644 --- a/template/en/default/reports/report-table.html.tmpl +++ b/template/en/default/reports/report-table.html.tmpl @@ -15,6 +15,7 @@ # row_names: array. List of values for the field being plotted as rows. # data: . Data to plot. Only data.$tbl is accessed. # tbl: Name of a hash in data which is the table to be plotted. + # table_id: the incremented number of the table being displayed. #%] [% col_field_disp = field_descs.$col_field || col_field %] @@ -29,177 +30,44 @@ [% urlbase = BLOCK %][% urlbase %]&[% tbl_field FILTER uri %]=[% tbl FILTER uri %][% END %] [% END %] - - [% IF tbl_field %]

[% tbl_disp FILTER email FILTER html %]

[% END %] - - - - - - - - - - -
- - [% col_field_disp FILTER html %] -
- [% row_field_disp FILTER html %] - - - -[% classes = [ [ "t1", "t2" ] , [ "t3", "t4" ] ] %] -[% col_idx = 0 %] -[% row_idx = 0 %] [% total_key = '-total-' %] -
- +[%# Most of these classes are defined in the DataTables plugin itself. %] +
[% IF col_field %] - + [% FOREACH col = col_names %] [% NEXT IF col == "" %] - - [% col_idx = 1 - col_idx %] - + [% END %] - + [% END %] [% FOREACH row = row_names %] - [% row_idx = 1 - row_idx %] - [% FOREACH col = col_names %] [% NEXT IF col == "" %] - - [% col_idx = 1 - col_idx %] - - [% END %] + [% END %] [% END %] + + - [% row_idx = 1 - row_idx %] - + [% FOREACH col = col_names %] [% NEXT IF col == "" %] - - +
- ↓ [% row_field_disp FILTER html %] \ [% col_field_disp FILTER html %] → - [% PROCESS value_display value = col field = col_field %] - [% PROCESS value_display value = col field = col_field %] - Total - Total
+ [% PROCESS value_display value = row field = row_field %] + [% IF data.$tbl.$col.$row AND data.$tbl.$col.$row > 0 %] [% data.$tbl.$col.$row %] [% ELSE %] - . + 0 [% END %]
- Total - Total
-
-
+ [% IF note_multi_select %]

diff --git a/template/en/default/reports/report.html.tmpl b/template/en/default/reports/report.html.tmpl index a9cd96551..9c13351e1 100644 --- a/template/en/default/reports/report.html.tmpl +++ b/template/en/default/reports/report.html.tmpl @@ -57,7 +57,8 @@ [% PROCESS global/header.html.tmpl header_addl_info = time style_urls = ['skins/standard/buglist.css'] - yui = ['datatable'] + jquery = ['datatables'] + jquery_css = ['datatables'] %] [% IF debug %] @@ -75,7 +76,7 @@ [% END %] [% IF format == "table" %] - [% PROCESS "reports/report-table.html.tmpl" %] + [% PROCESS "reports/report-table.html.tmpl" table_id = loop.count %] [% ELSE %] [% IF tbl %]

[% tbl_disp FILTER email FILTER html %]

-- cgit v1.2.3-24-g4f1b