summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/db-fakedisplay5
-rw-r--r--share/multi-lcd.html122
2 files changed, 126 insertions, 1 deletions
diff --git a/bin/db-fakedisplay b/bin/db-fakedisplay
index f9ce899..32e342c 100755
--- a/bin/db-fakedisplay
+++ b/bin/db-fakedisplay
@@ -33,7 +33,10 @@ if ( $mode eq 'single' and not $template_file ) {
( $station, @platforms ) = @ARGV;
$template_file //= dist_file( 'db-fakedisplay', 'multi-lcd.html' );
-$template = HTML::Template->new( filename => $template_file );
+$template = HTML::Template->new(
+ filename => $template_file,
+ loop_context_vars => 1
+);
if ( not defined $station ) {
show_help(1);
diff --git a/share/multi-lcd.html b/share/multi-lcd.html
new file mode 100644
index 0000000..466cb07
--- /dev/null
+++ b/share/multi-lcd.html
@@ -0,0 +1,122 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+ <title></title>
+ <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
+ <style type="text/css">
+
+ div.outer {
+ border: 0.2em solid #000066;
+ width: 55em;
+ }
+
+ div.display {
+ background-color: #0000ff;
+ color: white;
+ font-family: Sans-Serif;
+ font-weight: bold;
+ position: relative;
+ margin-bottom: 0;
+ margin-top: 0;
+ padding-top: 0;
+ padding-bottom: 0;
+ width: 55em;
+ height: 1.4em;
+ }
+
+ div.display div {
+ overflow: hidden;
+ position: absolute;
+ height: 100%;
+ }
+
+ div.time {
+ left: 0;
+ width: 6%;
+ font-size: 95%;
+ }
+
+ div.train {
+ left: 5%;
+ width: 9%;
+ background-color: white;
+ color: #0000ff;
+ font-size: 95%;
+ }
+
+ div.via {
+ left: 15%;
+ width: 35%;
+ }
+
+ div.via span {
+ margin-right: 0.4em;
+ font-size: 80%;
+ }
+
+ div.destination {
+ left: 50%;
+ width: 25%;
+ font-size: 120%;
+ }
+
+ div.platform {
+ left: 75%;
+ width: 5%;
+ }
+
+ div.info {
+ left: 80%;
+ width: 20%;
+ background-color: white;
+ color: #0000ff;
+ font-size: 80%;
+ line-height: 150%;
+ }
+
+ div.separator {
+ border-bottom: 0.1em solid #000066;
+ }
+
+ </style>
+</head>
+<body>
+
+<div class="outer">
+<TMPL_LOOP departures>
+
+<div class="display <TMPL_IF __even__>separator</TMPL_IF>">
+<div class="platform">
+<TMPL_VAR platform>
+</div>
+
+<div class="time">
+<TMPL_VAR time>
+</div>
+<div class="train">
+<TMPL_VAR train>
+</div>
+<div class="via">
+<TMPL_LOOP via>
+<span><TMPL_VAR stop></span>
+<TMPL_UNLESS __last__> - </TMPL_UNLESS>
+</TMPL_LOOP>
+</div>
+<div class="destination">
+<TMPL_VAR destination>
+</div>
+<TMPL_IF info>
+<div class="info">
+<TMPL_VAR info>
+</div>
+</TMPL_IF>
+
+</div> <!-- display -->
+
+</TMPL_LOOP>
+
+</div> <!-- outer -->
+
+</body>
+</html>