Improved layout of package page

This commit is contained in:
Yorhel 2016-10-06 14:43:07 +02:00
parent d2d48920f4
commit 72e26a0614
2 changed files with 42 additions and 33 deletions

View file

@ -392,43 +392,41 @@ sub pkg_info {
# Latest version of this package determines last modification date of the page. # Latest version of this package determines last modification date of the page.
$self->setLastMod($vers->[0]{released}); $self->setLastMod($vers->[0]{released});
# TODO: A "previous" link would be nice... my $title = "$sys->{name}".($sys->{release}?" $sys->{release}":"")." / $pkg->{category} / $pkg->{name}";
my $next = sub { $self->htmlHeader(title => "$title $sel->{version}");
use utf8;
if($more) {
p class => 'pagination';
a href => "/pkg/$sys->{short}/$pkg->{category}/$pkg->{name}/$sel->{version}?s=$mans->[199]{name}", 'next »';
end;
}
};
my $title = "$sys->{name}".($sys->{release}?" $sys->{release}":"")." / $pkg->{category} / $pkg->{name} $sel->{version}";
$self->htmlHeader(title => $title);
h1 $title; h1 $title;
h2 'Versions'; div id => 'pkgversions';
ul id => 'packages'; h2 'Versions';
for(@$vers) { ul;
li; for(@$vers) {
txt "$_->{released} "; li;
a href => "/pkg/$sys->{short}/$pkg->{category}/$pkg->{name}/$_->{version}", $_->{version} if $_ != $sel; a href => "/pkg/$sys->{short}/$pkg->{category}/$pkg->{name}/$_->{version}", $_->{version} if $_ != $sel;
b " $_->{version}" if $_ == $sel; b " $_->{version}" if $_ == $sel;
end; i " $_->{released}";
} end;
}
end;
end; end;
div id => 'pkgmans';
h2 "Manuals for version $sel->{version}"; h2 "Manuals for version $sel->{version}";
$next->(); ul;
ul id => 'manuals'; for(@$mans) {
for(@$mans) { li;
li; a href => "/$_->{name}/".substr($_->{hash},0,8), "$_->{name}($_->{section})";
a href => "/$_->{name}/".substr($_->{hash},0,8), "$_->{name}($_->{section})"; b " $_->{locale}" if $_->{locale};
b " $_->{locale}" if $_->{locale}; i " $_->{filename}";
i " $_->{filename}"; end;
}
end;
if($more) {
use utf8;
p class => 'pagination';
a href => "/pkg/$sys->{short}/$pkg->{category}/$pkg->{name}/$sel->{version}?s=$mans->[199]{name}", 'next »';
end; end;
} }
end; end;
$next->();
$self->htmlFooter; $self->htmlFooter;
} }
@ -624,7 +622,7 @@ sub htmlHeader {
html; html;
head; head;
Link rel => 'stylesheet', type => 'text/css', href => '/man.css'; Link rel => 'stylesheet', type => 'text/css', href => '/man.css?2';
title $o{title}.' - manned.org'; title $o{title}.' - manned.org';
end 'head'; end 'head';
body; body;

View file

@ -77,9 +77,20 @@ i.grayedout { color: #aaa; font-size: 13px; }
#searchres i { color: #aaa; font-size: 13px; } #searchres i { color: #aaa; font-size: 13px; }
#searchres a { padding-right: 2px } #searchres a { padding-right: 2px }
#manuals { margin: 20px 0; -webkit-column-width: 500px; -moz-column-width: 500px; column-width: 500px } #pkgversions { margin-top: 10px }
#manuals li { display: block; } #pkgversions h2 { margin: 0 }
#manuals i { color: #aaa; font-size: 13px; } #pkgversions { float: left; padding: 0 10px; }
#pkgversions ul { margin: 10px 0; padding-right: 10px; border-right: 1px dashed #468 }
#pkgversions li { display: block; }
#pkgversions i { color: #aaa; font-size: 13px; }
#pkgversions a { padding-right: 2px }
#pkgmans { margin-top: 10px }
#pkgmans h2 { margin: 0 }
#pkgmans { float: left }
#pkgmans ul { margin: 10px 0 }
#pkgmans li { display: block; }
#pkgmans i { color: #aaa; font-size: 13px; }
#footer { height: 60px; clear: both; padding: 4px 10px; color: #f8f8f8; margin: 0 0 -20px 0; #footer { height: 60px; clear: both; padding: 4px 10px; color: #f8f8f8; margin: 0 0 -20px 0;
border-top: 1px solid #888; font-size: 13px; background: url('images/gradients.png') 0 -37px repeat-x; border-top: 1px solid #888; font-size: 13px; background: url('images/gradients.png') 0 -37px repeat-x;