From d1faa8f67a74b6203d8534f612111f88b9705c51 Mon Sep 17 00:00:00 2001 From: David Kerkeslager Date: Fri, 26 Feb 2021 13:12:38 -0500 Subject: [PATCH] Use base templates --- tickle/templates/tickle/area_breadcrumb.html | 14 ++-- tickle/templates/tickle/area_detail.html | 70 ++++++++++---------- tickle/templates/tickle/area_list.html | 23 ++++--- tickle/templates/tickle/base.html | 28 ++++++++ tickle/templates/tickle/boulder_detail.html | 28 ++++---- tickle/templates/tickle/route_detail.html | 44 ++++++------ 6 files changed, 124 insertions(+), 83 deletions(-) create mode 100644 tickle/templates/tickle/base.html diff --git a/tickle/templates/tickle/area_breadcrumb.html b/tickle/templates/tickle/area_breadcrumb.html index 6255c21..5f52d9e 100644 --- a/tickle/templates/tickle/area_breadcrumb.html +++ b/tickle/templates/tickle/area_breadcrumb.html @@ -1,7 +1,11 @@ -{% if area.parent %} - {% include 'tickle/area_breadcrumb.html' with area=area.parent %} > +{% if area %} + {% include 'tickle/area_breadcrumb.html' with area=area.parent is_parent=True %} + > + {% if is_parent %} + {{ area.name }} + {% else %} + {{ area.name }} + {% endif %} {% else %} - All > + All {% endif %} - -{{ area.name }} diff --git a/tickle/templates/tickle/area_detail.html b/tickle/templates/tickle/area_detail.html index 3e4d4a5..6880397 100644 --- a/tickle/templates/tickle/area_detail.html +++ b/tickle/templates/tickle/area_detail.html @@ -1,40 +1,40 @@ - - - - {% if area.parent %} - {% include 'tickle/area_breadcrumb.html' with area=area.parent %} - {% endif %} +{% extends 'tickle/base.html' %} -

{{ area.name }}

+{% block tickle_title_name %}{{ area.name }}{% endblock %} +{% block tickle_header_name %}{{ area.name }}{% endblock %} - {% if area.children.count > 0 %} - - {% endif %} +{% block tickle_nav %} + {% include 'tickle/area_breadcrumb.html' %} +{% endblock %} -
- {{ area.notes }} -
+{% block tickle_main %} + {% if area.children.count > 0 %} + + {% endif %} - {% if area.boulders.count > 0 %} - Boulders - - {% endif %} +
+ {{ area.notes }} +
- {% if area.routes.count > 0 %} - Routes - - {% endif %} - - + {% if area.boulders.count > 0 %} + Boulders + + {% endif %} + + {% if area.routes.count > 0 %} + Routes + + {% endif %} +{% endblock %} diff --git a/tickle/templates/tickle/area_list.html b/tickle/templates/tickle/area_list.html index 3cdadae..9b1fa73 100644 --- a/tickle/templates/tickle/area_list.html +++ b/tickle/templates/tickle/area_list.html @@ -1,11 +1,12 @@ - - - -

All Areas

- - - +{% extends 'tickle/base.html' %} + +{% block tickle_title_name %}All Areas{% endblock %} +{% block tickle_header_name %}All Areas{% endblock %} + +{% block tickle_main %} + +{% endblock %} diff --git a/tickle/templates/tickle/base.html b/tickle/templates/tickle/base.html new file mode 100644 index 0000000..1359846 --- /dev/null +++ b/tickle/templates/tickle/base.html @@ -0,0 +1,28 @@ + + + + + + + + {% block tickle_title_name %}{% endblock %} + + + + + +
+

{% block tickle_header_name %}{% endblock %}

+ {% block tickle_extra_header %}{% endblock %} +
+ +
+ {% block tickle_main %}{% endblock %} +
+ + + + diff --git a/tickle/templates/tickle/boulder_detail.html b/tickle/templates/tickle/boulder_detail.html index b3e2e0d..51e8977 100644 --- a/tickle/templates/tickle/boulder_detail.html +++ b/tickle/templates/tickle/boulder_detail.html @@ -1,12 +1,16 @@ - - - - - {% include 'tickle/area_breadcrumb.html' with area=boulder.area %} -
-

{{ boulder.name }}

-
{{ boulder.difficulty }}
-
{{ boulder.notes }}
-
- - +{% extends 'tickle/base.html' %} + +{% block tickle_title_name %}{{ boulder.name }}{% endblock %} +{% block tickle_header_name %}{{ boulder.name }}{% endblock %} + +{% block tickle_nav %} + {% include 'tickle/area_breadcrumb.html' with area=boulder.area is_parent=True %} +{% endblock %} + +{% block tickle_extra_header %} +

{{ boulder.difficulty }}

+{% endblock %} + +{% block tickle_main %} +
{{ boulder.notes }}
+{% endblock %} diff --git a/tickle/templates/tickle/route_detail.html b/tickle/templates/tickle/route_detail.html index 114504b..6b6ad52 100644 --- a/tickle/templates/tickle/route_detail.html +++ b/tickle/templates/tickle/route_detail.html @@ -1,22 +1,26 @@ - - +{% extends 'tickle/base.html' %} - - {% include 'tickle/area_breadcrumb.html' with area=route.area %} -
-

{{ route.name }}

-
{{ route.difficulty }}
-
{{ route.notes }}
+{% block tickle_title_name %}{{ route.name }}{% endblock %} +{% block tickle_header_name %}{{ route.name }}{% endblock %} - {% if route.pitches.count == 1 %} - {% include 'tickle/pitch_list_item.html' with pitch=route.pitches.first %} - {% else %} - - {% endif %} -
- - +{% block tickle_nav %} + {% include 'tickle/area_breadcrumb.html' with area=route.area is_parent=True %} +{% endblock %} + +{% block tickle_extra_header %} +

{{ route.difficulty }}

+{% endblock %} + +{% block tickle_main %} +
{{ route.notes }}
+ + {% if route.pitches.count == 1 %} + {% include 'tickle/pitch_list_item.html' with pitch=route.pitches.first %} + {% else %} + + {% endif %} +{% endblock %} -- 2.20.1