From 6b7f19880ba5bbcc0632b457404f102c9deac462 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 9 Feb 2013 23:04:24 +0100 Subject: move templates from DATA section to separate files --- cgi/index.pl | 350 ---------------------------------- cgi/templates/layouts/default.html.ep | 223 ++++++++++++++++++++++ cgi/templates/multi.html.ep | 54 ++++++ cgi/templates/not_found.html.ep | 13 ++ cgi/templates/single.html.ep | 49 +++++ 5 files changed, 339 insertions(+), 350 deletions(-) create mode 100644 cgi/templates/layouts/default.html.ep create mode 100644 cgi/templates/multi.html.ep create mode 100644 cgi/templates/not_found.html.ep create mode 100644 cgi/templates/single.html.ep diff --git a/cgi/index.pl b/cgi/index.pl index 1318043..1b49e98 100644 --- a/cgi/index.pl +++ b/cgi/index.pl @@ -151,353 +151,3 @@ app->config( ); app->start(); - -__DATA__ - -@@ layouts/default.html.ep - - - - <%= $title %> - - - - - -<%= content %> - -
- -<% if (my $error = stash 'error') { %> -

- Error: <%= $error %>
-

-<% } %> - -<%= form_for _redirect => begin %> -

- Station name - <%= text_field 'station' %> -
- only display routes via - <%= text_field 'via' %> - (optional) -
- on platforms - <%= text_field 'platforms' %> - (optional) -
- display type - <%= select_field mode => [['combined' => 'multi'], ['platform' => 'single']] %> - <%= submit_button 'Display' %> -

-<% end %> - -
- -
-db-fakedisplay -v<%= $version %> -
- - - - -@@ multi.html.ep -% if (@{$departures}) { - -
-% my $i = 0; -% for my $departure (@{$departures}) { -% $i++; - -
-
-%= $departure->{platform} -
- -
-%= $departure->{time} -
- -
-%= $departure->{train} -
- -
-% my $via_max = @{$departure->{via}}; -% my $via_cur = 0; -% for my $stop (@{$departure->{via}}) { -% $via_cur++; -<%= $stop %><% if ($via_cur < $via_max) { %> - <% } %> -% } -
- -
-%= $departure->{destination} -
- -% if ($departure->{info}) { -
-%= $departure->{info} -
-% } - -
- -% } - -
- -% } -% else { - -

-DB-Fakedisplay displays the next departures at a DB station, just like the big -LC display in the station itself. -

- -% } - -@@ single.html.ep - -% if (@{$departures}) { - -% my $i = 0; -% for my $departure (@{$departures}) { -% $i++; -
-
-%= $departure->{platform} -
-
-%= $departure->{time} -
-
-%= $departure->{train} -
-
-% my $via_max = @{$departure->{via}}; -% my $via_cur = 0; -% for my $stop (@{$departure->{via}}) { -% $via_cur++; -<%= $stop %><% if ($via_cur < $via_max) { %> - <% } %> -% } -
-
-%= $departure->{destination} -
-% if ($departure->{info}) { -
-%= $departure->{info} -
-% } -
-% } - -% } -% else { - -
-
-Bitte Ansage beachten -
-
- -

-DB-Fakedisplay displays the next departures at a DB station, just like the big -LC display in the station itself. -

- -% } - -@@ not_found.html.ep - - - - page not found - - - -
-page not found -
- - diff --git a/cgi/templates/layouts/default.html.ep b/cgi/templates/layouts/default.html.ep new file mode 100644 index 0000000..8d4db7c --- /dev/null +++ b/cgi/templates/layouts/default.html.ep @@ -0,0 +1,223 @@ + + + + <%= $title %> + + + + + +<%= content %> + +
+ +<% if (my $error = stash 'error') { %> +

+ Error: <%= $error %>
+

+<% } %> + +<%= form_for _redirect => begin %> +

+ Station name + <%= text_field 'station' %> +
+ only display routes via + <%= text_field 'via' %> + (optional) +
+ on platforms + <%= text_field 'platforms' %> + (optional) +
+ display type + <%= select_field mode => [['combined' => 'multi'], ['platform' => 'single']] %> + <%= submit_button 'Display' %> +

+<% end %> + +
+ +
+db-fakedisplay +v<%= $version %> +
+ + + diff --git a/cgi/templates/multi.html.ep b/cgi/templates/multi.html.ep new file mode 100644 index 0000000..530de01 --- /dev/null +++ b/cgi/templates/multi.html.ep @@ -0,0 +1,54 @@ +% if (@{$departures}) { + +
+% my $i = 0; +% for my $departure (@{$departures}) { +% $i++; + +
+
+%= $departure->{platform} +
+ +
+%= $departure->{time} +
+ +
+%= $departure->{train} +
+ +
+% my $via_max = @{$departure->{via}}; +% my $via_cur = 0; +% for my $stop (@{$departure->{via}}) { +% $via_cur++; +<%= $stop %><% if ($via_cur < $via_max) { %> - <% } %> +% } +
+ +
+%= $departure->{destination} +
+ +% if ($departure->{info}) { +
+%= $departure->{info} +
+% } + +
+ +% } + +
+ +% } +% else { + +

+DB-Fakedisplay displays the next departures at a DB station, just like the big +LC display in the station itself. +

+ +% } diff --git a/cgi/templates/not_found.html.ep b/cgi/templates/not_found.html.ep new file mode 100644 index 0000000..ca1fb5f --- /dev/null +++ b/cgi/templates/not_found.html.ep @@ -0,0 +1,13 @@ + + + + page not found + + + +
+page not found +
+ + diff --git a/cgi/templates/single.html.ep b/cgi/templates/single.html.ep new file mode 100644 index 0000000..916c5b5 --- /dev/null +++ b/cgi/templates/single.html.ep @@ -0,0 +1,49 @@ +% if (@{$departures}) { + +% my $i = 0; +% for my $departure (@{$departures}) { +% $i++; +
+
+%= $departure->{platform} +
+
+%= $departure->{time} +
+
+%= $departure->{train} +
+
+% my $via_max = @{$departure->{via}}; +% my $via_cur = 0; +% for my $stop (@{$departure->{via}}) { +% $via_cur++; +<%= $stop %><% if ($via_cur < $via_max) { %> - <% } %> +% } +
+
+%= $departure->{destination} +
+% if ($departure->{info}) { +
+%= $departure->{info} +
+% } +
+% } + +% } +% else { + +
+
+Bitte Ansage beachten +
+
+ +

+DB-Fakedisplay displays the next departures at a DB station, just like the big +LC display in the station itself. +

+ +% } -- cgit v1.2.3