dispatch {
subdispatch sub () {
$self->_build_request_obj_from($_[+PSGI_ENV]);
+ my $base_title = 'BackPAN.org';
[
sub (/) {
$self->html_response({ body => $self->index_page_content });
my $release_rs = $self->releases($_[1]);
if ( $release_rs->count ) {
my $body = $self->releases_page_content($release_rs)
- ->select('#nav-releases')->add_to_attribute(class => 'active');
+ ->select('#nav-releases')->add_to_attribute(class => 'active')
+ ->select('title')->replace_content(join q{ - }, 'Releases', $base_title);
return $self->html_response({ body => $body });
}
else {
my $dist_rs = $self->dists($_[1]);
if ( $dist_rs->count ) {
my $body = $self->dists_page_content($dist_rs)
- ->select('#nav-dists')->add_to_attribute(class => 'active');
+ ->select('#nav-dists')->add_to_attribute(class => 'active')
+ ->select('title')->replace_content(join q{ - }, 'Distributions', $base_title);
return $self->html_response({ body => $body });
}
else {
sub ( /distribution/*|/distribution/*/ + ?* ) {
if ( my $dist = $self->get_dist($_[1]) ) {
- my $body = $self->dist_info_page_content($dist, $_[2]);
+ my $body = $self->dist_info_page_content($dist, $_[2])
+ ->select('title')->replace_content(join q{ - }, $self->format_dist_name($dist->name), $base_title);
return $self->html_response({ body => $body });
}
else {
sub ( /authors|/authors/ + ?* ) {
if ( my $authors = $self->authors($_[1]) ) {
my $body = $self->authors_page_content($authors)
- ->select('#nav-authors')->add_to_attribute(class => 'active');
+ ->select('#nav-authors')->add_to_attribute(class => 'active')
+ ->select('title')->replace_content(join q{ - }, 'Authors', $base_title);
return $self->html_response({ body => $body });
}
else {
my $body = $self->dists_page_content($dist_rs)
->select('#q')->add_to_attribute(
value => $query_str
- );
+ )
+ ->select('title')->replace_content(join q{ - }, 'Search', $base_title);
return $self->html_response({ body => $body });
}
else {
404 => 'root/html/error_404.html';
enable 'HTTPExceptions';
enable 'Head';
- enable 'AccessLog',
- format => 'combined',
- logger => sub { get_logger('accesslog')->info(@_) };
- enable 'Log4perl', conf => 'log/log.conf';
+ #enable 'AccessLog',
+ # format => 'combined',
+ # logger => sub { get_logger('accesslog')->info(@_) };
+ #enable 'Log4perl', conf => 'log/log.conf';
$app;
};
}