From 978c7b03c2a333eb48b9d223c3a010a35211d1ac Mon Sep 17 00:00:00 2001
From: Daniel Friesel <derf@finalrewind.org>
Date: Wed, 15 Feb 2023 20:01:43 +0100
Subject: journey: add share button

---
 templates/journey.html.ep | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

(limited to 'templates')

diff --git a/templates/journey.html.ep b/templates/journey.html.ep
index a5e04a0..50dcb3e 100644
--- a/templates/journey.html.ep
+++ b/templates/journey.html.ep
@@ -230,6 +230,20 @@
 		%= include '_map', station_coordinates => stash('station_coordinates'), polyline_groups => stash('polyline_groups')
 	% }
 	% if (not stash('readonly')) {
+		% if (stash('with_share')) {
+			<div class="row">
+				<div class="col s12 m6 l6">
+				</div>
+				<div class="col s12 m6 l6 center-align">
+					<a class="btn waves-effect waves-light action-share"
+						data-url="<%= url_for('public_journey', name => current_user()->{name}, id => $journey->{id} )->to_abs->scheme('https'); %>"
+						data-text="<%= stash('share_text') %>"
+						>
+						<i class="material-icons left" aria-hidden="true">share</i> Teilen
+					</a>
+				</div>
+			</div>
+		% }
 		<div class="row hide-on-small-only">
 			<div class="col s12 m6 l6 center-align">
 				<a class="waves-effect waves-light red btn action-delete"
-- 
cgit v1.2.3