From a88c80143b4d0e220c5c4b00e1571fd5819435d7 Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Tue, 10 Feb 2015 13:22:10 +0000 Subject: [PATCH] Reduce page title duplication in Admin Images Patch https://review.openstack.org/#/c/142802 adds a method of reducing duplication of page title logic, this patch applies that change to the admin images views. Change-Id: I53941fadee5338b20ee9c958edc9105757b42b0d Partial-Bug: 1413749 --- .../dashboards/admin/images/templates/images/create.html | 4 ---- .../dashboards/admin/images/templates/images/index.html | 4 ---- .../dashboards/admin/images/templates/images/update.html | 4 ---- .../admin/images/templates/images/update_metadata.html | 4 ---- openstack_dashboard/dashboards/admin/images/views.py | 4 ++++ 5 files changed, 4 insertions(+), 16 deletions(-) diff --git a/openstack_dashboard/dashboards/admin/images/templates/images/create.html b/openstack_dashboard/dashboards/admin/images/templates/images/create.html index dbd5ef7c33..506f0f51ce 100644 --- a/openstack_dashboard/dashboards/admin/images/templates/images/create.html +++ b/openstack_dashboard/dashboards/admin/images/templates/images/create.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Create An Image" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Create An Image") %} -{% endblock page_header %} - {% block main %} {% include 'admin/images/_create.html' %} {% endblock %} diff --git a/openstack_dashboard/dashboards/admin/images/templates/images/index.html b/openstack_dashboard/dashboards/admin/images/templates/images/index.html index b82d337752..951371931c 100644 --- a/openstack_dashboard/dashboards/admin/images/templates/images/index.html +++ b/openstack_dashboard/dashboards/admin/images/templates/images/index.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Images" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Images") %} -{% endblock page_header %} - {% block main %} {{ table.render }} {% endblock %} diff --git a/openstack_dashboard/dashboards/admin/images/templates/images/update.html b/openstack_dashboard/dashboards/admin/images/templates/images/update.html index e81c679bf9..14876aa63f 100644 --- a/openstack_dashboard/dashboards/admin/images/templates/images/update.html +++ b/openstack_dashboard/dashboards/admin/images/templates/images/update.html @@ -3,10 +3,6 @@ {% block title %}{% trans "Update Image" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Update Image") %} -{% endblock page_header %} - {% block main %} {% include 'admin/images/_update.html' %} {% endblock %} diff --git a/openstack_dashboard/dashboards/admin/images/templates/images/update_metadata.html b/openstack_dashboard/dashboards/admin/images/templates/images/update_metadata.html index 937fa56166..e6515c6deb 100644 --- a/openstack_dashboard/dashboards/admin/images/templates/images/update_metadata.html +++ b/openstack_dashboard/dashboards/admin/images/templates/images/update_metadata.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Update Image Metadata" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Update Image Metadata") %} -{% endblock page_header %} - {% block main %} {% include 'admin/images/_update_metadata.html' %} {% endblock %} diff --git a/openstack_dashboard/dashboards/admin/images/views.py b/openstack_dashboard/dashboards/admin/images/views.py index 58cce865e8..742c30d55c 100644 --- a/openstack_dashboard/dashboards/admin/images/views.py +++ b/openstack_dashboard/dashboards/admin/images/views.py @@ -42,6 +42,7 @@ LOG = logging.getLogger(__name__) class IndexView(tables.DataTableView): table_class = project_tables.AdminImagesTable template_name = 'admin/images/index.html' + page_title = _("Images") def has_prev_data(self, table): return self._prev @@ -108,12 +109,14 @@ class CreateView(views.CreateView): template_name = 'admin/images/create.html' form_class = project_forms.AdminCreateImageForm success_url = reverse_lazy('horizon:admin:images:index') + page_title = _("Create An Image") class UpdateView(views.UpdateView): template_name = 'admin/images/update.html' form_class = project_forms.AdminUpdateImageForm success_url = reverse_lazy('horizon:admin:images:index') + page_title = _("Update Image") class DetailView(views.DetailView): @@ -125,6 +128,7 @@ class UpdateMetadataView(forms.ModalFormView): template_name = "admin/images/update_metadata.html" form_class = project_forms.UpdateMetadataForm success_url = reverse_lazy('horizon:admin:images:index') + page_title = _("Update Image Metadata") def get_initial(self): image = self.get_object()