From cbf74f004888f056bc39d1d67004620cb31f194f Mon Sep 17 00:00:00 2001 From: Angelo Naselli Date: Thu, 11 Dec 2014 23:21:55 +0100 Subject: Fixed output in pacakge details --- lib/AdminPanel/Rpmdragora/gui.pm | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'lib/AdminPanel/Rpmdragora/gui.pm') diff --git a/lib/AdminPanel/Rpmdragora/gui.pm b/lib/AdminPanel/Rpmdragora/gui.pm index 150c697c..38bec25f 100644 --- a/lib/AdminPanel/Rpmdragora/gui.pm +++ b/lib/AdminPanel/Rpmdragora/gui.pm @@ -197,25 +197,23 @@ sub get_main_text { my ($medium, $fullname, $name, $summary, $is_update, $update_descr) = @_; my $txt = get_string_from_keywords($medium, $fullname); - my $notice = MDK::Common::Func::if_($txt, format_field($loc->N("Notice: ")) . $txt . "\n") || ""; + my $notice = MDK::Common::Func::if_($txt, format_field($loc->N("Notice: ")) . $txt); ensure_utf8($notice); - my $hdr = format_header(join(' - ', $name, $summary)) . "\n"; + my $hdr = "

" . format_header(join(' - ', $name, $summary)) . "

"; ensure_utf8($hdr); my $update = MDK::Common::Func::if_($is_update, # is it an update? - format_field($loc->N("Importance: ")) . format_update_field($update_descr->{importance}) . "\n", - format_field($loc->N("Reason for update: ")) . format_update_field(rpm_description($update_descr->{pre})) . "\n", - ) || ""; + format_field($loc->N("Importance: ")) . format_update_field($update_descr->{importance}), + format_field($loc->N("Reason for update: ")) . format_update_field(rpm_description($update_descr->{pre})), + ); ensure_utf8($update); - # TODO Too many lines - join( - "\n", - $hdr, - $notice, - $update - ); + my $main_text = $hdr; + $main_text .= "
   " . $notice if $notice; + $main_text .= "
   " . $update if $update; + + return $main_text; } sub get_details { @@ -361,7 +359,9 @@ sub _format_pkg_simplifiedinfo { @changelog = $pkg->{changelog} ? @{$pkg->{changelog}} : ( $loc->N("(Not available)") ); } utf8::encode(\@changelog); - $changelog_link .= "\n\n". join("", @changelog); + + $changelog_link .= "
   " . join("
   ", @changelog); + $changelog_link =~ s|\n||g; AdminPanel::rpmdragora::remove_wait_msg($wait); } push @$s, join("\n\n", $changelog_link, "\n"); @@ -369,7 +369,7 @@ sub _format_pkg_simplifiedinfo { my $deps_link = format_link(format_field($loc->N("New dependencies:")), $hidden_info{new_deps} ); if ($options->{new_deps}) { if ($upkg->id) { # If not installed - $deps_link .= "\n\n". join("\n", @{get_new_deps($urpm, $upkg)}); + $deps_link .= "
   " . join("
   ", @{get_new_deps($urpm, $upkg)}); # push @$s, get_new_deps($urpm, $upkg); } } @@ -1214,7 +1214,7 @@ sub setInfoOnWidget { $infoWidget->setValue(""); - my $info_text ="

" . $loc->N("Informations") . "

"; + my $info_text = ""; my @data = get_info($pkgname, $options); for(@{$data[0]}){ -- cgit v1.2.1