Loading lib/Travelynx.pm +14 −3 Original line number Diff line number Diff line Loading @@ -761,6 +761,19 @@ sub startup { } )->rows; } elsif ( $key eq 'comment' ) { $journey->{user_data}{comment} = $value; $rows = $db->update( 'journeys', { user_data => JSON->new->encode( $journey->{user_data} ), }, { id => $journey_id, } )->rows; } else { die("Invalid key $key\n"); } Loading Loading @@ -2228,9 +2241,7 @@ sub startup { messages => $entry->{messages}, route => $entry->{route}, edited => $entry->{edited}, comment => $entry->{user_data} ? $entry->{user_data}{comment} : undef, user_data => $entry->{user_data}, }; if ( $opt{verbose} ) { Loading lib/Travelynx/Controller/Traveling.pm +19 −0 Original line number Diff line number Diff line Loading @@ -608,6 +608,20 @@ sub edit_journey { } } } for my $key (qw(comment)) { if ( defined $self->param($key) and ( not $journey->{user_data} or $journey->{user_data}{$key} ne $self->param($key) ) ) { $error = $self->update_journey_part( $db, $journey->{id}, $key, $self->param($key) ); if ($error) { last; } } } if ( not $error ) { $journey = $self->get_journey( Loading @@ -631,6 +645,11 @@ sub edit_journey { $key => $journey->{$key}->strftime('%d.%m.%Y %H:%M') ); } } for my $key (qw(comment)) { if ( $journey->{user_data} and $journey->{user_data}{$key} ) { $self->param( $key => $journey->{user_data}{$key} ); } } $self->render( 'edit_journey', Loading templates/edit_journey.html.ep +6 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,12 @@ %= text_field 'rt_arrival', id => 'real_arrival', class => 'validate', pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9] +[0-9][0-9]:[0-9][0-9]' </td> </tr> <tr> <th scope="row">Kommentar</th> <td> %= text_field 'comment' </td> </tr> </table> </div> </div> Loading templates/journey.html.ep +9 −9 Original line number Diff line number Diff line Loading @@ -121,15 +121,7 @@ % } </td> </tr> % if ($journey->{comment}) { <tr> <th scope="row">Kommentar</th> <td> <%= $journey->{comment} %> </td> </tr> % } % else { % if ($journey->{messages} and @{$journey->{messages}}) { <tr> <th scope="row">Meldungen</th> <td> Loading @@ -140,6 +132,14 @@ </td> </tr> % } % if ($journey->{user_data} and $journey->{user_data}{comment}) { <tr> <th scope="row">Kommentar</th> <td> <%= $journey->{user_data}{comment} %> </td> </tr> % } <tr> <th scope="row">Route</th> <td> Loading Loading
lib/Travelynx.pm +14 −3 Original line number Diff line number Diff line Loading @@ -761,6 +761,19 @@ sub startup { } )->rows; } elsif ( $key eq 'comment' ) { $journey->{user_data}{comment} = $value; $rows = $db->update( 'journeys', { user_data => JSON->new->encode( $journey->{user_data} ), }, { id => $journey_id, } )->rows; } else { die("Invalid key $key\n"); } Loading Loading @@ -2228,9 +2241,7 @@ sub startup { messages => $entry->{messages}, route => $entry->{route}, edited => $entry->{edited}, comment => $entry->{user_data} ? $entry->{user_data}{comment} : undef, user_data => $entry->{user_data}, }; if ( $opt{verbose} ) { Loading
lib/Travelynx/Controller/Traveling.pm +19 −0 Original line number Diff line number Diff line Loading @@ -608,6 +608,20 @@ sub edit_journey { } } } for my $key (qw(comment)) { if ( defined $self->param($key) and ( not $journey->{user_data} or $journey->{user_data}{$key} ne $self->param($key) ) ) { $error = $self->update_journey_part( $db, $journey->{id}, $key, $self->param($key) ); if ($error) { last; } } } if ( not $error ) { $journey = $self->get_journey( Loading @@ -631,6 +645,11 @@ sub edit_journey { $key => $journey->{$key}->strftime('%d.%m.%Y %H:%M') ); } } for my $key (qw(comment)) { if ( $journey->{user_data} and $journey->{user_data}{$key} ) { $self->param( $key => $journey->{user_data}{$key} ); } } $self->render( 'edit_journey', Loading
templates/edit_journey.html.ep +6 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,12 @@ %= text_field 'rt_arrival', id => 'real_arrival', class => 'validate', pattern => '[0-9][0-9]?[.][0-9][0-9]?[.][0-9][0-9][0-9][0-9] +[0-9][0-9]:[0-9][0-9]' </td> </tr> <tr> <th scope="row">Kommentar</th> <td> %= text_field 'comment' </td> </tr> </table> </div> </div> Loading
templates/journey.html.ep +9 −9 Original line number Diff line number Diff line Loading @@ -121,15 +121,7 @@ % } </td> </tr> % if ($journey->{comment}) { <tr> <th scope="row">Kommentar</th> <td> <%= $journey->{comment} %> </td> </tr> % } % else { % if ($journey->{messages} and @{$journey->{messages}}) { <tr> <th scope="row">Meldungen</th> <td> Loading @@ -140,6 +132,14 @@ </td> </tr> % } % if ($journey->{user_data} and $journey->{user_data}{comment}) { <tr> <th scope="row">Kommentar</th> <td> <%= $journey->{user_data}{comment} %> </td> </tr> % } <tr> <th scope="row">Route</th> <td> Loading