From 848e8c8ccd3774b2047fe1a0c576bbc23a80f082 Mon Sep 17 00:00:00 2001 From: FreneticScribbler Date: Sat, 17 Oct 2020 17:59:23 +0100 Subject: [PATCH] Remove lingering use of 'page-header' BS removed that style --- RIGS/rigboard.py | 4 +++- RIGS/templates/eventauthorisation.html | 11 ----------- assets/templates/asset_detail.html | 6 ------ assets/templates/cable_type_list.html | 11 ++++------- assets/views.py | 10 ++++++++++ templates/base.html | 4 ++-- 6 files changed, 19 insertions(+), 27 deletions(-) diff --git a/RIGS/rigboard.py b/RIGS/rigboard.py index 69147e03..c3c9594f 100644 --- a/RIGS/rigboard.py +++ b/RIGS/rigboard.py @@ -310,8 +310,10 @@ class EventAuthorise(generic.UpdateView): def get_context_data(self, **kwargs): context = super(EventAuthorise, self).get_context_data(**kwargs) context['event'] = self.event - context['tos_url'] = settings.TERMS_OF_HIRE_URL + context['page_title'] = "{}: {}".format(self.event.display_id, self.event.name) + if self.event.dry_hire: + context['page_title'] += ' Dry Hire' return context def get(self, request, *args, **kwargs): diff --git a/RIGS/templates/eventauthorisation.html b/RIGS/templates/eventauthorisation.html index 6375822d..896968ff 100644 --- a/RIGS/templates/eventauthorisation.html +++ b/RIGS/templates/eventauthorisation.html @@ -17,18 +17,7 @@ {% endblock %} -{% block title %} - {% if event.is_rig %}N{{ event.pk|stringformat:"05d" }}{% else %}{{ event.pk }}{% endif %} | {{ event.name }} -{% endblock %} - {% block content %} - -
{% include 'partials/client_eventdetails.html' %}
diff --git a/assets/templates/asset_detail.html b/assets/templates/asset_detail.html index 2ddecf22..35dedfcc 100644 --- a/assets/templates/asset_detail.html +++ b/assets/templates/asset_detail.html @@ -1,13 +1,7 @@ {% extends 'base_assets.html' %} {% load widget_tweaks %} -{% block title %}Asset {{ object.asset_id }}{% endblock %} {% block content %} - - -
{% include 'partials/asset_detail_form.html' %} diff --git a/assets/templates/cable_type_list.html b/assets/templates/cable_type_list.html index 3b282f2d..f9f49ade 100644 --- a/assets/templates/cable_type_list.html +++ b/assets/templates/cable_type_list.html @@ -1,15 +1,12 @@ {% extends 'base_assets.html' %} -{% block title %}Supplier List{% endblock %} {% load paginator from filters %} +{% load button from filters %} {% load widget_tweaks %} {% block content %} - -
-
- New +
+
+ {% button 'new' 'cable_type_create' %}
diff --git a/assets/views.py b/assets/views.py index 5a4f2c8c..3e4144ef 100644 --- a/assets/views.py +++ b/assets/views.py @@ -102,6 +102,11 @@ class AssetDetail(LoginRequiredMixin, AssetIDUrlMixin, generic.DetailView): model = models.Asset template_name = 'asset_detail.html' + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context["page_title"] = "Asset {}".format(self.object.display_id) + return context + class AssetEdit(LoginRequiredMixin, AssetIDUrlMixin, generic.UpdateView): template_name = 'asset_form.html' @@ -298,6 +303,11 @@ class CableTypeList(generic.ListView): paginate_by = 40 # ordering = ['__str__'] + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context["page_title"] = "Cable Type List" + return context + class CableTypeDetail(generic.DetailView): model = models.CableType diff --git a/templates/base.html b/templates/base.html index 0b6bd286..32f36911 100644 --- a/templates/base.html +++ b/templates/base.html @@ -7,7 +7,7 @@ xml:lang="{% firstof LANGUAGE_CODE 'en' %}" lang="{% firstof LANGUAGE_CODE 'en' %}"> - {% block title %}{{page_title}}{% endblock %} | Rig Information Gathering System + {% block title %}{{page_title|striptags}}{% endblock %} | Rig Information Gathering System @@ -71,7 +71,7 @@ {% endif %} {% endblock %} {% if page_title and not request.is_ajax %} -

{{page_title}}

+

{{page_title|safe}}

{% endif %} {% block content %}{% endblock %}