From 0b93ec500eeff0c64e8f4748c0d951445a18f98b Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Tue, 10 Feb 2015 13:10:49 +0000 Subject: [PATCH] Reduce page title duplication in Admin Flavors Patch https://review.openstack.org/#/c/142802/15 adds a method of reducing duplication of page title logic, this patch applies that change to the admin flavors view. Change-Id: I2a75ec719b4e126775cd763caeee0266b87944a5 Partial-Bug: 1413749 --- .../dashboards/admin/flavors/templates/flavors/create.html | 4 ---- .../dashboards/admin/flavors/templates/flavors/index.html | 4 ---- .../dashboards/admin/flavors/templates/flavors/update.html | 4 ---- .../admin/flavors/templates/flavors/update_metadata.html | 4 ---- openstack_dashboard/dashboards/admin/flavors/views.py | 4 ++++ 5 files changed, 4 insertions(+), 16 deletions(-) diff --git a/openstack_dashboard/dashboards/admin/flavors/templates/flavors/create.html b/openstack_dashboard/dashboards/admin/flavors/templates/flavors/create.html index 1af7ceb2f6..21815588f6 100644 --- a/openstack_dashboard/dashboards/admin/flavors/templates/flavors/create.html +++ b/openstack_dashboard/dashboards/admin/flavors/templates/flavors/create.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Create Flavor" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Create Flavor") %} -{% endblock page_header %} - {% block main %} {% include 'horizon/common/_workflow.html' %} {% endblock %} diff --git a/openstack_dashboard/dashboards/admin/flavors/templates/flavors/index.html b/openstack_dashboard/dashboards/admin/flavors/templates/flavors/index.html index 3a306e57ac..832b6fa33e 100644 --- a/openstack_dashboard/dashboards/admin/flavors/templates/flavors/index.html +++ b/openstack_dashboard/dashboards/admin/flavors/templates/flavors/index.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Flavors" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Flavors") %} -{% endblock page_header %} - {% block main %} {{ table.render }} {% endblock %} diff --git a/openstack_dashboard/dashboards/admin/flavors/templates/flavors/update.html b/openstack_dashboard/dashboards/admin/flavors/templates/flavors/update.html index c65abac1c5..aa99735350 100644 --- a/openstack_dashboard/dashboards/admin/flavors/templates/flavors/update.html +++ b/openstack_dashboard/dashboards/admin/flavors/templates/flavors/update.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Edit Flavor" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Edit Flavor") %} -{% endblock page_header %} - {% block main %} {% include 'horizon/common/_workflow.html' %} {% endblock %} diff --git a/openstack_dashboard/dashboards/admin/flavors/templates/flavors/update_metadata.html b/openstack_dashboard/dashboards/admin/flavors/templates/flavors/update_metadata.html index 5e63ad99a5..f0b6c66489 100755 --- a/openstack_dashboard/dashboards/admin/flavors/templates/flavors/update_metadata.html +++ b/openstack_dashboard/dashboards/admin/flavors/templates/flavors/update_metadata.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Update Flavor Metadata" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Update Flavor Metadata") %} -{% endblock page_header %} - {% block main %} {% include 'admin/flavors/_update_metadata.html' %} {% endblock %} diff --git a/openstack_dashboard/dashboards/admin/flavors/views.py b/openstack_dashboard/dashboards/admin/flavors/views.py index 64556064b1..fec58e5983 100644 --- a/openstack_dashboard/dashboards/admin/flavors/views.py +++ b/openstack_dashboard/dashboards/admin/flavors/views.py @@ -44,6 +44,7 @@ INDEX_URL = "horizon:admin:flavors:index" class IndexView(tables.DataTableView): table_class = project_tables.FlavorsTable template_name = 'admin/flavors/index.html' + page_title = _("Flavors") def get_data(self): request = self.request @@ -62,11 +63,13 @@ class IndexView(tables.DataTableView): class CreateView(workflows.WorkflowView): workflow_class = flavor_workflows.CreateFlavor template_name = 'admin/flavors/create.html' + page_title = _("Create Flavor") class UpdateView(workflows.WorkflowView): workflow_class = flavor_workflows.UpdateFlavor template_name = 'admin/flavors/update.html' + page_title = _("Edit Flavor") def get_initial(self): flavor_id = self.kwargs['id'] @@ -91,6 +94,7 @@ class UpdateMetadataView(forms.ModalFormView): template_name = "admin/flavors/update_metadata.html" form_class = project_forms.UpdateMetadataForm success_url = reverse_lazy('horizon:admin:flavors:index') + page_title = _("Update Flavor Metadata") def get_initial(self): extra_specs_dict = self.get_object()