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
This commit is contained in:
Sam Betts 2015-02-10 13:10:49 +00:00
parent 1934a7eaa8
commit 0b93ec500e
5 changed files with 4 additions and 16 deletions

View File

@ -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 %}

View File

@ -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 %}

View File

@ -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 %}

View File

@ -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 %}

View File

@ -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()