Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
travelynx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
derf
travelynx
Commits
13e59b3a
Commit
13e59b3a
authored
5 years ago
by
Birte Kristina Friesel
Browse files
Options
Downloads
Patches
Plain Diff
add journey: make realtime data optional (default to schedule data)
Closes #25
parent
ff2a3afe
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/Travelynx/Controller/Traveling.pm
+3
-0
3 additions, 0 deletions
lib/Travelynx/Controller/Traveling.pm
t/02-registration.t
+30
-0
30 additions, 0 deletions
t/02-registration.t
templates/add_journey.html.ep
+4
-4
4 additions, 4 deletions
templates/add_journey.html.ep
with
37 additions
and
4 deletions
lib/Travelynx/Controller/Traveling.pm
+
3
−
0
View file @
13e59b3a
...
...
@@ -800,6 +800,9 @@ sub add_journey_form {
}
}
$opt
{
rt_departure
}
//
=
$opt
{
sched_departure
};
$opt
{
rt_arrival
}
//
=
$opt
{
sched_arrival
};
for
my
$key
(
qw(dep_station arr_station cancelled comment)
)
{
$opt
{
$key
}
=
$self
->
param
(
$key
);
}
...
...
This diff is collapsed.
Click to expand it.
t/02-registration.t
+
30
−
0
View file @
13e59b3a
...
...
@@ -267,5 +267,35 @@ $t->get_ok('/history/2018')->status_is(200)->content_like(qr{124 km})
->
content_like
(
qr{Bei Abfahrt: 00:09 Stunden}
)
->
content_like
(
qr{Bei Ankunft: 00:26 Stunden}
);
$csrf_token
=
$t
->
ua
->
get
('
/journey/add
')
->
res
->
dom
->
at
('
input[name=csrf_token]
')
->
attr
('
value
');
$t
->
post_ok
(
'
/journey/add
'
=>
form
=>
{
csrf_token
=>
$csrf_token
,
action
=>
'
save
',
train
=>
'
ICE 1
',
dep_station
=>
'
EE
',
sched_departure
=>
'
17.11.2018 15:42
',
rt_departure
=>
'',
arr_station
=>
'
BL
',
sched_arrival
=>
'
17.11.2018 19:42
',
rt_arrival
=>
'',
}
);
$t
->
status_is
(
302
)
->
header_is
(
location
=>
'
/journey/3
'
);
$t
->
get_ok
('
/history/2018/11
')
->
status_is
(
200
)
->
content_like
(
qr{513 km}
)
->
content_like
(
qr{05:15 Stunden}
)
->
content_like
(
qr{nach Fahrplan: 04:58}
)
->
content_like
(
qr{00:00 Stunden}
)
->
content_like
(
qr{Bei Abfahrt: 00:09 Stunden}
)
->
content_like
(
qr{Bei Ankunft: 00:26 Stunden}
);
$t
->
get_ok
('
/history/2018
')
->
status_is
(
200
)
->
content_like
(
qr{576 km}
)
->
content_like
(
qr{06:13 Stunden}
)
->
content_like
(
qr{nach Fahrplan: 05:56}
)
->
content_like
(
qr{00:00 Stunden}
)
->
content_like
(
qr{Bei Abfahrt: 00:09 Stunden}
)
->
content_like
(
qr{Bei Ankunft: 00:26 Stunden}
);
$t
->
app
->
pg
->
db
->
query
('
drop schema travelynx_test_02 cascade
');
done_testing
();
This diff is collapsed.
Click to expand it.
templates/add_journey.html.ep
+
4
−
4
View file @
13e59b3a
...
...
@@ -58,8 +58,8 @@
<label for="sched_departure">Geplante Abfahrt</label>
</div>
<div class="input-field col s12">
%= text_field 'rt_departure', id => 'rt_departure', class => 'validate',
required => undef,
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]'
<label for="rt_departure">Tatsächliche Abfahrt</label>
%= text_field 'rt_departure', id => 'rt_departure', 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]'
<label for="rt_departure">Tatsächliche Abfahrt
(wenn leer: pünktlich)
</label>
</div>
</div>
<div class="row">
...
...
@@ -72,8 +72,8 @@
<label for="sched_arrival">Geplante Ankunft</label>
</div>
<div class="input-field col s12">
%= text_field 'rt_arrival', id => 'rt_arrival', class => 'validate',
required => undef,
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]'
<label for="rt_arrival">Tatsächliche Ankunft</label>
%= text_field 'rt_arrival', id => 'rt_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]'
<label for="rt_arrival">Tatsächliche Ankunft
(wenn leer: pünktlich)
</label>
</div>
</div>
<div class="row">
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment