From: David Kerkeslager Date: Fri, 26 Feb 2021 17:33:07 +0000 (-0500) Subject: Fleshing out area templates, add boulder/route detail templates X-Git-Url: https://code.kerkeslager.com/?p=tickle;a=commitdiff_plain;h=7a1199f776bc3907acf55eeda787d1e288163e88 Fleshing out area templates, add boulder/route detail templates --- diff --git a/tickle/templates/tickle/area_breadcrumb.html b/tickle/templates/tickle/area_breadcrumb.html new file mode 100644 index 0000000..6255c21 --- /dev/null +++ b/tickle/templates/tickle/area_breadcrumb.html @@ -0,0 +1,7 @@ +{% if area.parent %} + {% include 'tickle/area_breadcrumb.html' with area=area.parent %} > +{% else %} + All > +{% endif %} + +{{ area.name }} diff --git a/tickle/templates/tickle/area_detail.html b/tickle/templates/tickle/area_detail.html index b951f76..3e4d4a5 100644 --- a/tickle/templates/tickle/area_detail.html +++ b/tickle/templates/tickle/area_detail.html @@ -1,6 +1,10 @@ + {% if area.parent %} + {% include 'tickle/area_breadcrumb.html' with area=area.parent %} + {% endif %} +

{{ area.name }}

{% if area.children.count > 0 %} @@ -11,11 +15,15 @@ {% endif %} +
+ {{ area.notes }} +
+ {% if area.boulders.count > 0 %} Boulders {% endif %} @@ -24,7 +32,7 @@ Routes {% endif %} diff --git a/tickle/templates/tickle/area_list_item.html b/tickle/templates/tickle/area_list_item.html index de6bfcc..9545c53 100644 --- a/tickle/templates/tickle/area_list_item.html +++ b/tickle/templates/tickle/area_list_item.html @@ -14,7 +14,7 @@ Boulders {% endif %} @@ -23,7 +23,7 @@ Routes {% endif %} diff --git a/tickle/templates/tickle/boulder_detail.html b/tickle/templates/tickle/boulder_detail.html new file mode 100644 index 0000000..b3e2e0d --- /dev/null +++ b/tickle/templates/tickle/boulder_detail.html @@ -0,0 +1,12 @@ + + + + + {% include 'tickle/area_breadcrumb.html' with area=boulder.area %} +
+

{{ boulder.name }}

+
{{ boulder.difficulty }}
+
{{ boulder.notes }}
+
+ + diff --git a/tickle/templates/tickle/boulder_list_item.html b/tickle/templates/tickle/boulder_list_item.html new file mode 100644 index 0000000..8b9b5c7 --- /dev/null +++ b/tickle/templates/tickle/boulder_list_item.html @@ -0,0 +1 @@ +{{ boulder.name }} diff --git a/tickle/templates/tickle/pitch_list_item.html b/tickle/templates/tickle/pitch_list_item.html new file mode 100644 index 0000000..70e4155 --- /dev/null +++ b/tickle/templates/tickle/pitch_list_item.html @@ -0,0 +1,17 @@ +{% if route.pitches.count > 1 %} +
+

+ P{{ pitch.order }} + + {% if pitch.name %} + {{ pitch.name }} + {% endif %} +

+ +
{{ pitch.difficulty }}
+
+{% endif %} + +{% if pitch.notes %} +
{{ pitch.notes }}
+{% endif %} diff --git a/tickle/templates/tickle/route_detail.html b/tickle/templates/tickle/route_detail.html new file mode 100644 index 0000000..114504b --- /dev/null +++ b/tickle/templates/tickle/route_detail.html @@ -0,0 +1,22 @@ + + + + + {% include 'tickle/area_breadcrumb.html' with area=route.area %} +
+

{{ route.name }}

+
{{ route.difficulty }}
+
{{ route.notes }}
+ + {% if route.pitches.count == 1 %} + {% include 'tickle/pitch_list_item.html' with pitch=route.pitches.first %} + {% else %} + + {% endif %} +
+ + diff --git a/tickle/templates/tickle/route_list_item.html b/tickle/templates/tickle/route_list_item.html new file mode 100644 index 0000000..8c9e101 --- /dev/null +++ b/tickle/templates/tickle/route_list_item.html @@ -0,0 +1 @@ +{{ route.name }} diff --git a/tickle/views.py b/tickle/views.py index 859cfdb..bef2129 100644 --- a/tickle/views.py +++ b/tickle/views.py @@ -15,11 +15,11 @@ class AttemptListView(ListView): attempt_list = AttemptListView.as_view() class BoulderDetailView(DetailView): - pass + model = models.Boulder boulder_detail = BoulderDetailView.as_view() class RouteDetailView(DetailView): - pass + model = models.Route route_detail = RouteDetailView.as_view() class TodoListView(ListView):