From 49dc9b43e111ea4f5f8f2de623fe76d48825db30 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Tue, 2 Jan 2024 15:57:56 +0000 Subject: [PATCH] Bug 35682: WIP Attemp to move colors from terminal into nice HTML You need to manually set version in Koha.pm to something before the test dbrev here. Version systempreference also needs to match the above (no action needed if testing for the first time) --- C4/Installer.pm | 12 +++++++++++- .../intranet-tmpl/prog/en/modules/installer/step3.tt | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/C4/Installer.pm b/C4/Installer.pm index 7e248a17aa..9f8fb03eee 100644 --- a/C4/Installer.pm +++ b/C4/Installer.pm @@ -26,6 +26,7 @@ use YAML::XS; use File::Slurp qw( read_file ); use DBI; +use HTML::FromANSI (); use C4::Context; use Koha::Schema; use Koha; @@ -818,8 +819,17 @@ sub generate_output_db_entry { push @output, sprintf "\t%s", $line; } } + my @coutput; + foreach my $line ( @output ) { - return \@output; + my $h = HTML::FromANSI->new( + font_face => '', + style => '', + ); + $h->add_text( color('bold blue'), 'hi' ); + push @coutput, $h->ansi2html($line); + } + return \@coutput; } sub get_atomic_updates { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt index 3198cddd9d..c55f4d1ab4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt @@ -381,7 +381,7 @@