From 7c272820b07f955d84270b07978c122ec17b1679 Mon Sep 17 00:00:00 2001
From: Anton Sarukhanov <code@ant.sr>
Date: Thu, 7 Apr 2016 19:55:09 -0400
Subject: [PATCH] template cleanup

---
 config.py              |  1 +
 templates/about.html   | 31 +++++++++++++++++++++++++++
 templates/map.html     | 48 ++----------------------------------------
 templates/welcome.html | 18 ++++++++++++++++
 4 files changed, 52 insertions(+), 46 deletions(-)
 create mode 100644 templates/about.html
 create mode 100644 templates/welcome.html

diff --git a/config.py b/config.py
index b02d6bb..39ce767 100644
--- a/config.py
+++ b/config.py
@@ -43,6 +43,7 @@ class Config(object):
     # Map display parameters
     MAP_ERROR_TILE_URL = 'http://tiles.antsar-static.com/generic/tile-blank-black.png'
     MAP_TILE_URL = 'http://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png'
+    MAP_DATA_ATTRIBUTION = '<a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors and <a href="http://cartodb.com/attributions">CartoDB</a>'
     MAP_TILE_SUBDOMAINS = ['a', 'b', 'c']
     MAP_TILESET = 'rutgers-black'
     MAP_LAT_PADDING = 0.03
diff --git a/templates/about.html b/templates/about.html
new file mode 100644
index 0000000..add748a
--- /dev/null
+++ b/templates/about.html
@@ -0,0 +1,31 @@
+<h2>About PyBusMap</h2>
+<p>
+    This map displays real-time vehicle locations and arrival predictions
+    for public transit systems which are tracked by NextBus.
+</p>
+<p>
+    Built by <a href="https://ant.sr">Anton Sarukhanov</a>. Open source
+    and MIT licensed.
+    <a href="https://git.xhost.io/anton/pybusmap">Fork it</a>.
+</p>
+<p>
+    <a href="http://leafletjs.com"
+        title="A JS library for interactive maps">Leaflet</a>
+        - A JavaScript library for interactive maps.
+</p>
+<p>
+    Map Data &copy; {{ config['MAP_DATA_ATTRIBUTION']|safe }}.
+</p>
+<p>
+    Transit Data &copy; {{ agency.title }} and/or NextBus.
+</p>
+<p>
+    Data sourced from the <a href="http://nextbus.com">Nextbus</a> API.
+</p>
+<p>
+    NextBus&trade; is a trademark of NextBus Inc.
+</p>
+<p class="legalese">
+    Not guaranteed to be correct.
+    Refer to your travel agency for official schedules and/or predictions.
+</p>
diff --git a/templates/map.html b/templates/map.html
index e808ae4..f3c95ee 100644
--- a/templates/map.html
+++ b/templates/map.html
@@ -14,55 +14,11 @@
     <div id="map" class="{% if embed %}embed{% endif %}"></div>
     <div class="dialog" id="about">
         <div class="close" id="close-about"><a href="javascript:void(0);">&times;</a></div>
-        <h2>About PyBusMap</h2>
-        <p>
-            This map displays real-time vehicle locations and arrival predictions
-            for public transit systems which are tracked by NextBus.
-        </p>
-        <p>
-            Built by <a href="https://ant.sr">Anton Sarukhanov</a>. Open source
-            and MIT licensed.
-            <a href="https://git.xhost.io/anton/pybusmap">Fork it</a>.
-        </p>
-        <p>
-            <a href="http://leafletjs.com"
-                title="A JS library for interactive maps">Leaflet</a>
-                - A JavaScript library for interactive maps.
-        </p>
-        <p>
-            Map Data &copy; {{ config['MAP_DATA_ATTRIBUTION']|safe }}.
-        </p>
-        <p>
-            Transit Data &copy; {{ agency.title }} and/or NextBus.
-        </p>
-        <p>
-            Data sourced from the <a href="http://nextbus.com">Nextbus</a> API.
-        </p>
-        <p>
-            NextBus&trade; is a trademark of NextBus Inc.
-        </p>
+        {% include "about.html" %}
     </div>
     <div class="dialog" id="welcome">
         <div class="close" id="close-welcome"><a href="javascript:void(0);">&times;</a></div>
-        <h2>Welcome to PyBusMap</h2>
-        <p>
-            Hi! This is PyBusMap. It's a map of buses tracked by NextBus. It has
-            predictions for bus arrival times, and real-time vehicle locations.
-        </p>
-        <p>
-            To see upcoming buses for a stop, click the stop flag <img height="20px" src="static/img/stop27x60.png" alt="stop-icon">.
-        </p>
-        <p>
-            To see upcoming stops for a bus, click the bus <img height="20px" src="static/img/bus.png" alt="bus-icon">.
-        </p>
-        <h1>
-            <a href="javascript:void(0);" onclick="$('#welcome').hide();">Let's Go!</a>
-        </h1>
-        <p class="legalese">
-            Nothing displayed here is guaranteed to be correct. The creator of this
-            map takes no responsibility for you catching a bus, missing a bus, or
-            interacting with a bus in any other way.
-        </p>
+        {% include "welcome.html" %}
     </div>
     <div id="msg">
         <span id="msg-zoomForVehicles">Zoom in to see vehicles.</span>
diff --git a/templates/welcome.html b/templates/welcome.html
new file mode 100644
index 0000000..4740d15
--- /dev/null
+++ b/templates/welcome.html
@@ -0,0 +1,18 @@
+<h2>Welcome to PyBusMap</h2>
+<p>
+    Hi! This is PyBusMap. It's a map of buses tracked by NextBus. It has
+    predictions for bus arrival times, and real-time vehicle locations.
+</p>
+<p>
+    To see upcoming buses for a stop, click the stop flag <img height="20px" src="static/img/stop27x60.png" alt="stop-icon">.
+</p>
+<p>
+    To see upcoming stops for a bus, click the bus <img height="20px" src="static/img/bus.png" alt="bus-icon">.
+</p>
+<h1>
+    <a href="javascript:void(0);" onclick="$('#welcome').hide();">Let's Go!</a>
+</h1>
+<p class="legalese">
+    Not guaranteed to be correct.
+    Refer to your travel agency for official schedules and/or predictions.
+</p>
-- 
GitLab