Refactor templates a bit
authorDavid Kerkeslager <kerkeslager@gmail.com>
Sun, 28 Feb 2021 01:34:36 +0000 (20:34 -0500)
committerDavid Kerkeslager <kerkeslager@gmail.com>
Sun, 28 Feb 2021 01:34:54 +0000 (20:34 -0500)
setup.py
tickle/templates/tickle/area_breadcrumb.html
tickle/templates/tickle/climb_breadcrumb_trail.html [new file with mode: 0644]
tickle/templates/tickle/route_breadcrumb_trail.html [new file with mode: 0644]

index 997e977..c09cadd 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
 import pathlib
 from setuptools import setup, find_packages
 HERE = pathlib.Path(__file__).parent
-VERSION = '0.0.dev13'
+VERSION = '0.0.dev14'
 PACKAGE_NAME = 'django_predrill_tickle'
 AUTHOR = 'David Kerkeslager'
 AUTHOR_EMAIL = 'david@kerkeslager.com'
index 6ef0850..55681a4 100644 (file)
@@ -1,14 +1,12 @@
 {% if area %}
   {% include 'tickle/area_breadcrumb.html' with area=area.parent is_parent=True %}
-  {% if is_parent %}
-    <span class='tickle-breadcrumb-item'>
+  <span class='tickle-breadcrumb-item'>
+    {% if is_parent %}
       <a href='{% url "tickle:area-detail" pk=area.pk %}'>{{ area.name }}</a>
-    </span>
-  {% else %}
-    <span class='tickle-breadcrumb-item'>
+    {% else %}
       {{ area.name }}
-    </span>
-  {% endif %}
+    {% endif %}
+  </span>
 {% else %}
   <span class='tickle-breadcrumb-item'>
     <a href='{% url "tickle:area-list" %}'>All</a>
diff --git a/tickle/templates/tickle/climb_breadcrumb_trail.html b/tickle/templates/tickle/climb_breadcrumb_trail.html
new file mode 100644 (file)
index 0000000..f08d6c6
--- /dev/null
@@ -0,0 +1,7 @@
+<nav class='tickle-breadcrumb-trail'>
+  {% include 'tickle/area_breadcrumb.html' area=climb.area %}
+
+  {% if is_parent %}
+  {% else %}
+  {% endif %}
+</nav>
diff --git a/tickle/templates/tickle/route_breadcrumb_trail.html b/tickle/templates/tickle/route_breadcrumb_trail.html
new file mode 100644 (file)
index 0000000..cf892ed
--- /dev/null
@@ -0,0 +1,10 @@
+<nav id='tickle-breadcrumb-trail'>
+  {% include 'tickle/area_breadcrumb.html' with area=route.area is_parent=True %}
+  <span class='tickle-breadcrumb-item'>
+    {% if is_parent %}
+      <a href='{% url "tickle:route-detail" pk=route.pk %}'>{{ route.name }}</a>
+    {% else %}
+      {{ route.name }}
+    {% endif %}
+  </span>
+</nav>