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:
parent
1934a7eaa8
commit
0b93ec500e
@ -2,10 +2,6 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% block title %}{% trans "Create Flavor" %}{% endblock %}
|
{% block title %}{% trans "Create Flavor" %}{% endblock %}
|
||||||
|
|
||||||
{% block page_header %}
|
|
||||||
{% include "horizon/common/_page_header.html" with title=_("Create Flavor") %}
|
|
||||||
{% endblock page_header %}
|
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
{% include 'horizon/common/_workflow.html' %}
|
{% include 'horizon/common/_workflow.html' %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -2,10 +2,6 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% block title %}{% trans "Flavors" %}{% endblock %}
|
{% block title %}{% trans "Flavors" %}{% endblock %}
|
||||||
|
|
||||||
{% block page_header %}
|
|
||||||
{% include "horizon/common/_page_header.html" with title=_("Flavors") %}
|
|
||||||
{% endblock page_header %}
|
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
{{ table.render }}
|
{{ table.render }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -2,10 +2,6 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% block title %}{% trans "Edit Flavor" %}{% endblock %}
|
{% block title %}{% trans "Edit Flavor" %}{% endblock %}
|
||||||
|
|
||||||
{% block page_header %}
|
|
||||||
{% include "horizon/common/_page_header.html" with title=_("Edit Flavor") %}
|
|
||||||
{% endblock page_header %}
|
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
{% include 'horizon/common/_workflow.html' %}
|
{% include 'horizon/common/_workflow.html' %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -2,10 +2,6 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% block title %}{% trans "Update Flavor Metadata" %}{% endblock %}
|
{% 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 %}
|
{% block main %}
|
||||||
{% include 'admin/flavors/_update_metadata.html' %}
|
{% include 'admin/flavors/_update_metadata.html' %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -44,6 +44,7 @@ INDEX_URL = "horizon:admin:flavors:index"
|
|||||||
class IndexView(tables.DataTableView):
|
class IndexView(tables.DataTableView):
|
||||||
table_class = project_tables.FlavorsTable
|
table_class = project_tables.FlavorsTable
|
||||||
template_name = 'admin/flavors/index.html'
|
template_name = 'admin/flavors/index.html'
|
||||||
|
page_title = _("Flavors")
|
||||||
|
|
||||||
def get_data(self):
|
def get_data(self):
|
||||||
request = self.request
|
request = self.request
|
||||||
@ -62,11 +63,13 @@ class IndexView(tables.DataTableView):
|
|||||||
class CreateView(workflows.WorkflowView):
|
class CreateView(workflows.WorkflowView):
|
||||||
workflow_class = flavor_workflows.CreateFlavor
|
workflow_class = flavor_workflows.CreateFlavor
|
||||||
template_name = 'admin/flavors/create.html'
|
template_name = 'admin/flavors/create.html'
|
||||||
|
page_title = _("Create Flavor")
|
||||||
|
|
||||||
|
|
||||||
class UpdateView(workflows.WorkflowView):
|
class UpdateView(workflows.WorkflowView):
|
||||||
workflow_class = flavor_workflows.UpdateFlavor
|
workflow_class = flavor_workflows.UpdateFlavor
|
||||||
template_name = 'admin/flavors/update.html'
|
template_name = 'admin/flavors/update.html'
|
||||||
|
page_title = _("Edit Flavor")
|
||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
flavor_id = self.kwargs['id']
|
flavor_id = self.kwargs['id']
|
||||||
@ -91,6 +94,7 @@ class UpdateMetadataView(forms.ModalFormView):
|
|||||||
template_name = "admin/flavors/update_metadata.html"
|
template_name = "admin/flavors/update_metadata.html"
|
||||||
form_class = project_forms.UpdateMetadataForm
|
form_class = project_forms.UpdateMetadataForm
|
||||||
success_url = reverse_lazy('horizon:admin:flavors:index')
|
success_url = reverse_lazy('horizon:admin:flavors:index')
|
||||||
|
page_title = _("Update Flavor Metadata")
|
||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
extra_specs_dict = self.get_object()
|
extra_specs_dict = self.get_object()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user