diff options
author | Angelo Naselli <anaselli@linux.it> | 2014-12-12 11:29:47 +0100 |
---|---|---|
committer | Angelo Naselli <anaselli@linux.it> | 2014-12-12 11:29:47 +0100 |
commit | ddde08c747358f9256e3022bd9c9c1e2fb60850f (patch) | |
tree | 66aa39c247f0b1398bd38e0b5d911a3d736265e0 | |
parent | cbf74f004888f056bc39d1d67004620cb31f194f (diff) | |
download | manatools-ddde08c747358f9256e3022bd9c9c1e2fb60850f.tar manatools-ddde08c747358f9256e3022bd9c9c1e2fb60850f.tar.gz manatools-ddde08c747358f9256e3022bd9c9c1e2fb60850f.tar.bz2 manatools-ddde08c747358f9256e3022bd9c9c1e2fb60850f.tar.xz manatools-ddde08c747358f9256e3022bd9c9c1e2fb60850f.zip |
Better output formatting
-rw-r--r-- | lib/AdminPanel/Rpmdragora/gui.pm | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/AdminPanel/Rpmdragora/gui.pm b/lib/AdminPanel/Rpmdragora/gui.pm index 38bec25f..171b5e03 100644 --- a/lib/AdminPanel/Rpmdragora/gui.pm +++ b/lib/AdminPanel/Rpmdragora/gui.pm @@ -155,9 +155,9 @@ sub get_description { my $descr = ($pkg->{description} || $update_descr->{description} || '<i>'. $loc->N("No description").'</i>'); - $descr =~ s|\n|<br /> |g; + $descr =~ s|\n|<br />|g; - return "<br /> " . $descr; + return $descr . "<br />"; } sub get_string_from_keywords { @@ -189,8 +189,10 @@ sub get_string_from_keywords { $s); } else { $s .= $loc->N("This is an official package supported by Mageia") . "\n" if member('official', @media_types); - return $s; + return $s if $s; } + + return; } sub get_main_text { @@ -200,7 +202,7 @@ sub get_main_text { my $notice = MDK::Common::Func::if_($txt, format_field($loc->N("Notice: ")) . $txt); ensure_utf8($notice); - my $hdr = "<h2>" . format_header(join(' - ', $name, $summary)) . "</h2>"; + my $hdr = "<h2>" . format_header(join(' - ', $name, $summary)) . "</h2>\n"; ensure_utf8($hdr); my $update = MDK::Common::Func::if_($is_update, # is it an update? @@ -210,8 +212,8 @@ sub get_main_text { ensure_utf8($update); my $main_text = $hdr; - $main_text .= "<br /> " . $notice if $notice; - $main_text .= "<br /> " . $update if $update; + $main_text .= " " . $notice . "<br/>" if $notice; + $main_text .= " " . $update . "<br/>" if $update; return $main_text; } @@ -1219,9 +1221,8 @@ sub setInfoOnWidget { my @data = get_info($pkgname, $options); for(@{$data[0]}){ if(ref $_ ne "ARRAY"){ - $info_text .= "<br />" . $_; + $info_text .= $_ . "<br /> "; }else{ - $info_text .= "<br />"; for my $subitem(@{$_}) { $info_text .= "<br />" . "<br /> " . $subitem; } |