summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/_checked_in.html.ep20
-rw-r--r--templates/account.html.ep15
-rw-r--r--templates/use_external_links.html.ep72
3 files changed, 102 insertions, 5 deletions
diff --git a/templates/_checked_in.html.ep b/templates/_checked_in.html.ep
index d882501..2c37bbc 100644
--- a/templates/_checked_in.html.ep
+++ b/templates/_checked_in.html.ep
@@ -1,3 +1,4 @@
+% my $user = current_user();
<div class="autorefresh">
<div class="card">
<div class="card-content">
@@ -102,7 +103,12 @@
% }
</div>
<div style="float: right; text-align: right;">
- <b><%= $journey->{arr_name} %></b><br/>
+ % if ($user->{sb_template}) {
+ <b><a href="<%= resolve_sb_template($user->{sb_template}, name => $journey->{arr_name}, eva => $journey->{arr_eva}) %>" class="unmarked"><%= $journey->{arr_name} %></a></b><br/>
+ % }
+ % else {
+ <b><%= $journey->{arr_name} %></b><br/>
+ % }
% if ($journey->{real_arrival}->epoch) {
<b><%= $journey->{real_arrival}->strftime('%H:%M') %></b>
% if ($journey->{real_arrival}->epoch != $journey->{sched_arrival}->epoch) {
@@ -250,14 +256,14 @@
% }
<a class="action-share blue-text right"
style="margin-right: 0;"
- % if (current_user()->{is_public} & 0x04 and $journey->{comment}) {
+ % if ($user->{is_public} & 0x04 and $journey->{comment}) {
data-text="<%= $journey->{comment} %> (@ <%= $journey->{train_type} %> <%= $journey->{train_no} %> → <%= $journey->{arr_name} %>) #travelynx"
% }
% else {
data-text="Ich bin gerade <%= $attrib %> <%= $journey->{train_type} %> <%= $journey->{train_no} %> nach <%= $journey->{arr_name} %> #travelynx"
% }
- % if (current_user()->{is_public} & 0x02) {
- data-url="<%= url_for('/status')->to_abs->scheme('https') %>/<%= current_user->{name} %>/<%= $journey->{sched_departure}->epoch %>"
+ % if ($user->{is_public} & 0x02) {
+ data-url="<%= url_for('/status')->to_abs->scheme('https') %>/<%= $user->{name} %>/<%= $journey->{sched_departure}->epoch %>"
% }
>
<i class="material-icons left" aria-hidden="true">share</i> Teilen
@@ -309,7 +315,11 @@
<tbody>
% for my $station (@{$journey->{route_after}}) {
% my $is_dest = ($journey->{arr_name} and $station->[0] eq $journey->{arr_name});
- <tr><td><a style="<%= $is_dest? 'font-weight: bold;' : '' %>" class="action-checkout" data-station="<%= $station->[0] %>"><%= $station->[0] %>
+ <tr><td>
+ % if ($user->{sb_template}) {
+ <a href="<%= resolve_sb_template($user->{sb_template}, name => $station->[0], eva => $station->[1]{eva}) %>"><i class="material-icons tiny">info</i></a>
+ % }
+ <a style="<%= $is_dest? 'font-weight: bold;' : '' %>" class="action-checkout" data-station="<%= $station->[0] %>"><%= $station->[0] %>
% if ($station->[2] and $station->[2] eq 'cancelled') {
<span style="float: right;">entfällt</span>
% }
diff --git a/templates/account.html.ep b/templates/account.html.ep
index bce4dcb..7658237 100644
--- a/templates/account.html.ep
+++ b/templates/account.html.ep
@@ -25,6 +25,9 @@
% elsif ($success eq 'use_history') {
<span class="card-title">Einstellungen zu vorgeschlagenen Verbindungen geändert</span>
% }
+ % elsif ($success eq 'external') {
+ <span class="card-title">Einstellungen zu externen Diensten geändert</span>
+ % }
% elsif ($success eq 'webhook') {
<span class="card-title">Web Hook aktualisiert</span>
% }
@@ -145,6 +148,18 @@
</td>
</tr>
<tr>
+ <th scope="row">Externe Dienste</th>
+ <td>
+ <a href="/account/services"><i class="material-icons">edit</i></a>
+ % if ($acc->{sb_name}) {
+ Abfahrtstafel: <%= $acc->{sb_name} %>
+ % }
+ % else {
+ <span style="color: #999999;">Keine</span>
+ % }
+ </td>
+ </tr>
+ <tr>
<th scope="row">Registriert am</th>
<td><%= $acc->{registered_at}->strftime('%d.%m.%Y %H:%M') %></td>
</tr>
diff --git a/templates/use_external_links.html.ep b/templates/use_external_links.html.ep
new file mode 100644
index 0000000..f1c8c81
--- /dev/null
+++ b/templates/use_external_links.html.ep
@@ -0,0 +1,72 @@
+<h1>Externe Dienste</h1>
+<div class="row">
+ <div class="col s12">
+ <p>
+ Travelynx kann an geeigneten Stellen Links zu externen Diensten
+ (z.B. Abfahrstafeln oder Informationen zum gerade genutzten Zug)
+ einbinden. Hier lässt sich konfigurieren, welcher Dienst für welche
+ Art von Informationen genutzt wird.
+ <p/>
+ </div>
+</div>
+<h2>Abfahrtstafel</h2>
+%= form_for '/account/services' => (method => 'POST') => begin
+ %= csrf_field
+ <div class="row">
+ <div class="col s12">
+ Angaben zu anderen an einer Station verkehrenden Verkehrsmitteln
+ </div>
+ </div>
+ <div class="row">
+ <div class="input-field col s12">
+ <div>
+ <label>
+ %= radio_button stationboard => '0'
+ <span>Keine</span>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="input-field col s12">
+ <div>
+ <label>
+ %= radio_button stationboard => '1'
+ <span><a href="https://dbf.finalrewind.org/">DBF</a></span>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="input-field col s12">
+ <div>
+ <label>
+ %= radio_button stationboard => '2'
+ <span><a href="https://marudor.de/">marudor.de</a></span>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="input-field col s12">
+ <div>
+ <label>
+ %= radio_button stationboard => '3'
+ <span><a href="https://nvm.finalrewind.org/">NVM</a></span>
+ </label>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col s3 m3 l3">
+ </div>
+ <div class="col s6 m6 l6 center-align">
+ <button class="btn waves-effect waves-light" type="submit" name="action" value="save">
+ Speichern
+ <i class="material-icons right">send</i>
+ </button>
+ </div>
+ <div class="col s3 m3 l3">
+ </div>
+ </div>
+%= end