diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc index 37f73fcee2..2afc8e3b3f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc @@ -64,9 +64,7 @@ [% IF ( showsql || execute || editsql || save_successful ) %] [% UNLESS ( errors ) # Unless there are errors saving a report %] -
- Run report -
+
[% INCLUDE 'throttled-button.inc' element_type='link' id='runreport' href='/cgi-bin/koha/reports/guided_reports.pl?id=' _ id _ '&op=run' classes='btn btn-default' label=t('Run report') %]
[% IF templates.count %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/throttled-button.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/throttled-button.inc new file mode 100644 index 0000000000..f48e5aa8c6 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/throttled-button.inc @@ -0,0 +1,23 @@ +[%# USAGE [ INCLUDE 'throttled-button.inc' element_type='button' classes='btn btn-primary' label=t('Run report') attrs={ name => 'op', value => 'cud-run' } ] %] + +[% DEFAULT element_type = 'link' %] +[% DEFAULT ready_icon = 'fa fa-play' %] +[% DEFAULT active_icon = 'fa fa-spinner fa-spin' %] +[% DEFAULT classes = 'btn btn-default' %] +[% DEFAULT href = '#' %] + +[%# Common attributes shared by both button and link %] +[% BLOCK common_attrs %]class="[% classes | html %]"[% IF id %]id="[% id | html %]"[% END %] data-state="ready" data-throttled-button [% IF attrs %][% FOREACH key IN attrs.keys %][% key | html %]="[% attrs.$key | html %]"[% END %][% END %][% END %] + +[%# Inner content shared by both button and link %] +[% BLOCK inner_content %] + + + [% UNLESS icon_only %][% label | html %][% END %] +[% END %] + +[% IF element_type == 'button' -%] + +[%- ELSE -%] + [% PROCESS inner_content %] +[%- END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt index 6db54eef82..2140829318 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt @@ -379,8 +379,13 @@
[%# There should be no space between these two buttons, it would render badly %] - Run + [% INCLUDE 'throttled-button.inc' element_type='link' href='/cgi-bin/koha/reports/guided_reports.pl?id=' _ savedreport.id _ '&op=run' classes='btn btn-default btn-xs' label=t('Run') attrs={ role => 'button' } %]