add title elements

(cherry picked from commit 5d8f6467dc00f03957784230983ed730ec421291)
Signed-off-by: Birte Kristina Friesel <derf@finalrewind.org>
This commit is contained in:
Cassidy Dingenskirchen 2024-01-22 18:53:27 +01:00 committed by Birte Kristina Friesel
parent 88866b3a29
commit 5b3cfd3355
No known key found for this signature in database
GPG key ID: 19E6E524EBB177BA
4 changed files with 20 additions and 7 deletions

View file

@ -154,6 +154,7 @@ sub profile {
$self->render( $self->render(
'profile', 'profile',
title => "travelynx: $name",
name => $name, name => $name,
uid => $user->{id}, uid => $user->{id},
privacy => $user, privacy => $user,
@ -313,6 +314,7 @@ sub journey_details {
} }
$self->render( $self->render(
'journey', 'journey',
title => "travelynx: $title",
error => undef, error => undef,
journey => $journey, journey => $journey,
with_map => 1, with_map => 1,
@ -470,6 +472,7 @@ sub user_status {
any => { any => {
template => 'user_status', template => 'user_status',
name => $name, name => $name,
title => "travelynx: $tw_data{title}",
privacy => $user, privacy => $user,
journey => $status, journey => $status,
twitter => \%tw_data, twitter => \%tw_data,

View file

@ -8,25 +8,25 @@ use Mojo::Base 'Mojolicious::Controller';
sub about { sub about {
my ($self) = @_; my ($self) = @_;
$self->render('about'); $self->render('about', title => 'Über travelynx');
} }
sub changelog { sub changelog {
my ($self) = @_; my ($self) = @_;
$self->render('changelog'); $self->render('changelog', title => 'travelynx: Changelog');
} }
sub imprint { sub imprint {
my ($self) = @_; my ($self) = @_;
$self->render('imprint'); $self->render('imprint', title => 'travelynx: Impressum');
} }
sub legend { sub legend {
my ($self) = @_; my ($self) = @_;
$self->render('legend'); $self->render('legend', title => 'travelynx: Legende' );
} }
sub offline { sub offline {

View file

@ -144,6 +144,7 @@ sub settings {
$self->param( tweet => 1 ); $self->param( tweet => 1 );
} }
$self->stash ( title => 'travelynx × träwelling' );
$self->render( $self->render(
'traewelling', 'traewelling',
traewelling => $traewelling, traewelling => $traewelling,

View file

@ -1185,7 +1185,7 @@ sub cancelled {
sub history { sub history {
my ($self) = @_; my ($self) = @_;
$self->render( template => 'history' ); $self->render( template => 'history', title => 'travelynx: History' );
} }
sub commute { sub commute {
@ -1293,6 +1293,7 @@ sub commute {
journeys_by_month => \%journeys_by_month, journeys_by_month => \%journeys_by_month,
count_by_month => \%count_by_month, count_by_month => \%count_by_month,
total_journeys => $total, total_journeys => $total,
title => 'travelynx: Reisen nach Station',
months => [ months => [
qw(Januar Februar März April Mai Juni Juli August September Oktober November Dezember) qw(Januar Februar März April Mai Juni Juli August September Oktober November Dezember)
], ],
@ -1390,6 +1391,7 @@ sub map_history {
template => 'history_map', template => 'history_map',
year => $year, year => $year,
with_map => 1, with_map => 1,
title => 'travelynx: Karte',
%{$res} %{$res}
); );
} }
@ -1515,7 +1517,7 @@ sub year_in_review {
$self->render( $self->render(
'year_in_review', 'year_in_review',
title => "travelynx Jahresrückblick $year", title => "travelynx: Jahresrückblick $year",
year => $year, year => $year,
stats => $stats, stats => $stats,
review => $review, review => $review,
@ -1586,6 +1588,7 @@ sub yearly_history {
}, },
any => { any => {
template => 'history_by_year', template => 'history_by_year',
title => "travelynx: $year",
journeys => [@journeys], journeys => [@journeys],
year => $year, year => $year,
have_review => $with_review, have_review => $with_review,
@ -1649,6 +1652,8 @@ sub monthly_history {
month => $month month => $month
); );
my $month_name = $months[ $month - 1 ];
$self->respond_to( $self->respond_to(
json => { json => {
json => { json => {
@ -1658,10 +1663,11 @@ sub monthly_history {
}, },
any => { any => {
template => 'history_by_month', template => 'history_by_month',
title => "travelynx: $month_name $year",
journeys => [@journeys], journeys => [@journeys],
year => $year, year => $year,
month => $month, month => $month,
month_name => $months[ $month - 1 ], month_name => $month_name,
statistics => $stats statistics => $stats
} }
); );
@ -1736,6 +1742,9 @@ sub journey_details {
$self->render( $self->render(
'journey', 'journey',
title => sprintf( 'travelynx: %s %s %s am %s',
$journey->{type}, $journey->{line} // '', $journey->{no},
$journey->{sched_arrival}->strftime('%d.%m.%Y, %H:%M') ),
error => undef, error => undef,
journey => $journey, journey => $journey,
journey_visibility => $visibility, journey_visibility => $visibility,