]> code.kerkeslager.com Git - tickle/commitdiff
Don't recurse through the areas on the area list
authorDavid Kerkeslager <kerkeslager@gmail.com>
Sat, 27 Feb 2021 03:04:39 +0000 (22:04 -0500)
committerDavid Kerkeslager <kerkeslager@gmail.com>
Sat, 27 Feb 2021 03:05:35 +0000 (22:05 -0500)
setup.py
tickle/templates/tickle/area_detail.html
tickle/templates/tickle/area_list.html
tickle/templates/tickle/area_list_item.html [deleted file]

index 90a944a5c403e19d31588420e4f29b99825356c2..be8e5c6665e3bb27d92ed889b14c29bd02f0a68a 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.7'
+VERSION = '0.0.8'
 PACKAGE_NAME = 'django_predrill_tickle'
 AUTHOR = 'David Kerkeslager'
 AUTHOR_EMAIL = 'david@kerkeslager.com'
index bd487772120fd568a91c0c283cb18fd743167d38..8fd2142e1d4a84fd427d0deba2ad1c7e54a3e47b 100644 (file)
@@ -9,9 +9,9 @@
 
 {% block tickle_main %}
   {% if area.children.count > 0 %}
-    <ul>
+    <ul class='tickle-area-list'>
       {% for child in area.children.all %}
-        {% include 'tickle/area_list_item.html' with area=child %}
+        <li><a href='{% url "tickle:area-detail" pk=child.pk %}'>{{ child.name }}</a></li>
       {% endfor %}
     </ul>
   {% endif %}
index 9b1fa73621dae6c90187441906881fe54e3b6a07..3dd870b28b103ba61691a999dfd40f0b80b21bce 100644 (file)
@@ -4,9 +4,39 @@
 {% block tickle_header_name %}All Areas{% endblock %}
 
 {% block tickle_main %}
-  <ul>
+  <ul class='tickle-area-list'>
     {% for area in area_list %}
-      {% include 'tickle/area_list_item.html' %}
+      <li>
+        <header>
+          <a href='{% url "tickle:area-detail" pk=area.pk %}'>{{ area.name }}</a>
+        </header>
+
+        {% if area.children.count > 0 %}
+          <ul>
+            {% for child in area.children.all %}
+              <li><a href='{% url "tickle:area-detail" pk=area.pk %}'>{{ area.name }}</a></li>
+            {% endfor %}
+          </ul>
+        {% endif %}
+
+        {% if area.boulders.count > 0 %}
+          Boulders
+          <ul>
+            {% for boulder in area.boulders.all %}
+              <li>{% include 'tickle/boulder_list_item.html' %}</li>
+            {% endfor %}
+          </ul>
+        {% endif %}
+
+        {% if area.routes.count > 0 %}
+          Routes
+          <ul>
+            {% for route in area.routes.all %}
+              <li>{% include 'tickle/route_list_item.html' %}</li>
+            {% endfor %}
+          </ul>
+        {% endif %}
+      </li>
     {% endfor %}
   </ul>
 {% endblock %}
diff --git a/tickle/templates/tickle/area_list_item.html b/tickle/templates/tickle/area_list_item.html
deleted file mode 100644 (file)
index 9545c53..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<li>
-  <header>
-    <a href='{% url "tickle:area-detail" pk=area.pk %}'>{{ area.name }}</a>
-  </header>
-  {% if area.children.count > 0 %}
-    <ul>
-      {% for child in area.children.all %}
-        {% include 'tickle/area_list_item.html' with area=child %}
-      {% endfor %}
-    </ul>
-  {% endif %}
-
-  {% if area.boulders.count > 0 %}
-    Boulders
-    <ul>
-      {% for boulder in area.boulders.all %}
-        <li>{% include 'tickle/boulder_list_item.html' %}</li>
-      {% endfor %}
-    </ul>
-  {% endif %}
-
-  {% if area.routes.count > 0 %}
-    Routes
-    <ul>
-      {% for route in area.routes.all %}
-        <li>{% include 'tickle/route_list_item.html' %}</li>
-      {% endfor %}
-    </ul>
-  {% endif %}
-</li>