Reduce page title duplication in Data Processing

Patch https://review.openstack.org/#/c/142802 adds a method of
reducing duplication of page title logic, this patch applies that change
to the project data processing views.

Change-Id: Ie1567e7b9007b50e2b50b6ec0f60d57706e01edf
Partial-Bug: 1413749
This commit is contained in:
Sam Betts 2015-02-10 13:38:44 +00:00
parent f38965ec30
commit 1e4c7d8462
41 changed files with 47 additions and 141 deletions

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Data Processing" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Data Processing - Cluster Templates") %}
{% endblock page_header %}
{% block main %}
<div class="cluster_templates">

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Create Cluster Template" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Create Cluster Template") %}
{% endblock page_header %}
{% block main %}
{% include 'horizon/common/_workflow.html' %}
{% endblock %}

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Create Cluster Template" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Create Cluster Template") %}
{% endblock page_header %}
{% block main %}
{% include 'horizon/common/_workflow.html' %}
{% endblock %}

View File

@ -2,14 +2,10 @@
{% load i18n %}
{% block title %}{% trans "Cluster Template Details" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Cluster Template Details") %}
{% endblock page_header %}
{% block main %}
<div class="row">
<div class="col-sm-12">
{{ tab_group.render }}
</div>
</div>
{% endblock %}
{% endblock %}

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Upload Template" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Upload Template") %}
{% endblock page_header %}
{% block main %}
{% include 'project/data_processing.cluster_templates/_upload_file.html' %}
{% endblock %}
{% endblock %}

View File

@ -41,6 +41,7 @@ class ClusterTemplatesView(tables.DataTableView):
table_class = ct_tables.ClusterTemplatesTable
template_name = (
'project/data_processing.cluster_templates/cluster_templates.html')
page_title = _("Cluster Templates")
def get_data(self):
try:
@ -60,6 +61,7 @@ class ClusterTemplatesView(tables.DataTableView):
class ClusterTemplateDetailsView(tabs.TabView):
tab_group_class = _tabs.ClusterTemplateDetailsTabs
template_name = 'project/data_processing.cluster_templates/details.html'
page_title = _("Cluster Template Details")
def get_context_data(self, **kwargs):
context = super(ClusterTemplateDetailsView, self)\
@ -76,6 +78,7 @@ class UploadFileView(forms.ModalFormView):
'project/data_processing.cluster_templates/upload_file.html')
success_url = reverse_lazy(
'horizon:project:data_processing.cluster_templates:index')
page_title = _("Upload Template")
class CreateClusterTemplateView(workflows.WorkflowView):
@ -84,18 +87,21 @@ class CreateClusterTemplateView(workflows.WorkflowView):
":create-cluster-template")
classes = ("ajax-modal")
template_name = "project/data_processing.cluster_templates/create.html"
page_title = _("Create Cluster Template")
class ConfigureClusterTemplateView(workflows.WorkflowView):
workflow_class = create_flow.ConfigureClusterTemplate
success_url = "horizon:project:data_processing.cluster_templates"
template_name = "project/data_processing.cluster_templates/configure.html"
page_title = _("Configure Cluster Template")
class CopyClusterTemplateView(workflows.WorkflowView):
workflow_class = copy_flow.CopyClusterTemplate
success_url = "horizon:project:data_processing.cluster_templates"
template_name = "project/data_processing.cluster_templates/configure.html"
page_title = _("Copy Cluster Template")
def get_context_data(self, **kwargs):
context = super(CopyClusterTemplateView, self)\

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Data Processing" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Data Processing - Clusters") %}
{% endblock page_header %}
{% block main %}
<div class="cluster_templates">

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Launch Cluster" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Launch Cluster") %}
{% endblock page_header %}
{% block main %}
{% include 'horizon/common/_workflow.html' %}
{% endblock %}

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Launch Cluster" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Launch Cluster") %}
{% endblock page_header %}
{% block main %}
{% include 'horizon/common/_workflow.html' %}
{% endblock %}

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Launch Cluster" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Launch Cluster") %}
{% endblock page_header %}
{% block main %}
{% include 'templates/data_processing.clusters/_create_cluster.html' %}
{% endblock %}

View File

@ -2,14 +2,10 @@
{% load i18n %}
{% block title %}{% trans "Cluster Details" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Cluster Details") %}
{% endblock page_header %}
{% block main %}
<div class="row">
<div class="col-sm-12">
{{ tab_group.render }}
</div>
</div>
{% endblock %}
{% endblock %}

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Scale Cluster" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Scale Cluster") %}
{% endblock page_header %}
{% block main %}
{% include 'horizon/common/_workflow.html' %}
{% endblock %}

View File

@ -37,6 +37,7 @@ LOG = logging.getLogger(__name__)
class ClustersView(tables.DataTableView):
table_class = c_tables.ClustersTable
template_name = 'project/data_processing.clusters/clusters.html'
page_title = _("Clusters")
def get_data(self):
try:
@ -55,6 +56,7 @@ class ClustersView(tables.DataTableView):
class ClusterDetailsView(tabs.TabView):
tab_group_class = _tabs.ClusterDetailsTabs
template_name = 'project/data_processing.clusters/details.html'
page_title = _("Cluster Details")
def get_context_data(self, **kwargs):
context = super(ClusterDetailsView, self)\
@ -68,12 +70,14 @@ class CreateClusterView(workflows.WorkflowView):
"horizon:project:data_processing.clusters:create-cluster"
classes = ("ajax-modal")
template_name = "project/data_processing.clusters/create.html"
page_title = _("Launch Cluster")
class ConfigureClusterView(workflows.WorkflowView):
workflow_class = create_flow.ConfigureCluster
success_url = "horizon:project:data_processing.clusters"
template_name = "project/data_processing.clusters/configure.html"
page_title = _("Configure Cluster")
class ScaleClusterView(workflows.WorkflowView):
@ -81,6 +85,7 @@ class ScaleClusterView(workflows.WorkflowView):
success_url = "horizon:project:data_processing.clusters"
classes = ("ajax-modal")
template_name = "project/data_processing.clusters/scale.html"
page_title = _("Scale Cluster")
def get_context_data(self, **kwargs):
context = super(ScaleClusterView, self)\

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Edit Image Tags" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Edit Image Tags") %}
{% endblock page_header %}
{% block main %}
{% include 'project/data_processing.data_image_registry/_edit_tags.html' %}
{% endblock %}
{% endblock %}

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Data Processing" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Image Registry") %}
{% endblock page_header %}
{% block main %}
<div class="image_registry">

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Register Image" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Register Image") %}
{% endblock page_header %}
{% block main %}
{% include 'project/data_processing.data_image_registry/_register_image.html' %}
{% endblock %}
{% endblock %}

View File

@ -38,6 +38,7 @@ class ImageRegistryView(tables.DataTableView):
table_class = ImageRegistryTable
template_name = (
'project/data_processing.data_image_registry/image_registry.html')
page_title = _("Image Registry")
def get_data(self):
try:
@ -81,6 +82,7 @@ class EditTagsView(forms.ModalFormView):
'project/data_processing.data_image_registry/edit_tags.html')
success_url = reverse_lazy(
'horizon:project:data_processing.data_image_registry:index')
page_title = _("Edit Image Tags")
def get_context_data(self, **kwargs):
context = super(EditTagsView, self).get_context_data(**kwargs)
@ -114,6 +116,7 @@ class RegisterImageView(forms.ModalFormView):
'project/data_processing.data_image_registry/register_image.html')
success_url = reverse_lazy(
'horizon:project:data_processing.data_image_registry:index')
page_title = _("Register Image")
def get_context_data(self, **kwargs):
context = super(RegisterImageView, self).get_context_data(**kwargs)

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Data Processing Plugin Details" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Data Processing Plugin Details") %}
{% endblock page_header %}
{% block main %}
<div class="row">
<div class="col-sm-12">

View File

@ -2,14 +2,10 @@
{% load i18n %}
{% block title %}{% trans "Data Processing" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Data Processing Plugins") %}
{% endblock page_header %}
{% block main %}
<div class="plugins">
{{ plugins_table.render }}
</div>
{% endblock %}
{% endblock %}

View File

@ -31,6 +31,7 @@ LOG = logging.getLogger(__name__)
class PluginsView(tables.DataTableView):
table_class = p_tables.PluginsTable
template_name = 'project/data_processing.data_plugins/plugins.html'
page_title = _("Data Processing Plugins")
def get_data(self):
try:
@ -45,3 +46,4 @@ class PluginsView(tables.DataTableView):
class PluginDetailsView(tabs.TabView):
tab_group_class = p_tabs.PluginDetailsTabs
template_name = 'project/data_processing.data_plugins/details.html'
page_title = _("Data Processing Plugin Details")

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Create Data Source" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Create Data Source") %}
{% endblock page_header %}
{% block main %}
{% include 'horizon/common/_workflow.html' %}
{% endblock %}

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Data Processing" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Data Sources") %}
{% endblock page_header %}
{% block main %}
<div class="data_sources">

View File

@ -2,14 +2,10 @@
{% load i18n %}
{% block title %}{% trans "Data Source Details" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Data Source Details") %}
{% endblock page_header %}
{% block main %}
<div class="row">
<div class="col-sm-12">
{{ tab_group.render }}
</div>
</div>
{% endblock %}
{% endblock %}

View File

@ -35,6 +35,7 @@ LOG = logging.getLogger(__name__)
class DataSourcesView(tables.DataTableView):
table_class = ds_tables.DataSourcesTable
template_name = 'project/data_processing.data_sources/data_sources.html'
page_title = _("Data Sources")
def get_data(self):
try:
@ -52,8 +53,10 @@ class CreateDataSourceView(workflows.WorkflowView):
"horizon:project:data_processing.data-sources:create-data-source"
classes = ("ajax-modal")
template_name = "project/data_processing.data_sources/create.html"
page_title = _("Create Data Source")
class DataSourceDetailsView(tabs.TabView):
tab_group_class = _tabs.DataSourceDetailsTabs
template_name = 'project/data_processing.data_sources/details.html'
page_title = _("Data Source Details")

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Create Job Binary" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Create Job Binary") %}
{% endblock page_header %}
{% block main %}
{% include 'project/data_processing.job_binaries/_create.html' %}
{% endblock %}
{% endblock %}

View File

@ -2,14 +2,10 @@
{% load i18n %}
{% block title %}{% trans "Job Binary Details" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Job Binary Details") %}
{% endblock page_header %}
{% block main %}
<div class="row">
<div class="col-sm-12">
{{ tab_group.render }}
</div>
</div>
{% endblock %}
{% endblock %}

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Data Processing" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Job Binaries") %}
{% endblock page_header %}
{% block main %}
<style type="text/css">
#id_job_binary_url {

View File

@ -40,6 +40,7 @@ LOG = logging.getLogger(__name__)
class JobBinariesView(tables.DataTableView):
table_class = jb_tables.JobBinariesTable
template_name = 'project/data_processing.job_binaries/job_binaries.html'
page_title = _("Job Binaries")
def get_data(self):
try:
@ -57,11 +58,13 @@ class CreateJobBinaryView(forms.ModalFormView):
'horizon:project:data_processing.job_binaries:index')
classes = ("ajax-modal")
template_name = "project/data_processing.job_binaries/create.html"
page_title = _("Create Job Binary")
class JobBinaryDetailsView(tabs.TabView):
tab_group_class = _tabs.JobBinaryDetailsTabs
template_name = 'project/data_processing.job_binaries/details.html'
page_title = _("Job Binary Details")
def get_context_data(self, **kwargs):
context = super(JobBinaryDetailsView, self)\

View File

@ -2,14 +2,10 @@
{% load i18n %}
{% block title %}{% trans "Job Execution Details" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Job Execution Details") %}
{% endblock page_header %}
{% block main %}
<div class="row">
<div class="col-sm-12">
{{ tab_group.render }}
</div>
</div>
{% endblock %}
{% endblock %}

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Data Processing" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Job Executions") %}
{% endblock page_header %}
{% block main %}
<div class="job_executions">

View File

@ -36,6 +36,7 @@ class JobExecutionsView(tables.DataTableView):
table_class = je_tables.JobExecutionsTable
template_name = (
'project/data_processing.job_executions/job_executions.html')
page_title = _("Job Executions")
def get_data(self):
try:
@ -60,3 +61,4 @@ class JobExecutionsView(tables.DataTableView):
class JobExecutionDetailsView(tabs.TabView):
tab_group_class = _tabs.JobExecutionDetailsTabs
template_name = 'project/data_processing.job_executions/details.html'
page_title = _("Job Execution Details")

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Create Job" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Create Job") %}
{% endblock page_header %}
{% block main %}
{% include 'horizon/common/_workflow.html' %}
{% endblock %}

View File

@ -2,14 +2,10 @@
{% load i18n %}
{% block title %}{% trans "Job Details" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Job Details") %}
{% endblock page_header %}
{% block main %}
<div class="row">
<div class="col-sm-12">
{{ tab_group.render }}
</div>
</div>
{% endblock %}
{% endblock %}

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Data Processing" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Jobs") %}
{% endblock page_header %}
{% block main %}
<style type="text/css">
.job_origin_main, .job_origin_lib {

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Launch Job" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Launch Job") %}
{% endblock page_header %}
{% block main %}
{% include 'horizon/common/_workflow.html' %}
{% endblock %}
{% endblock %}

View File

@ -38,6 +38,7 @@ LOG = logging.getLogger(__name__)
class JobsView(tables.DataTableView):
table_class = _tables.JobsTable
template_name = 'project/data_processing.jobs/jobs.html'
page_title = _("Jobs")
def get_data(self):
try:
@ -58,11 +59,13 @@ class CreateJobView(workflows.WorkflowView):
success_url = "horizon:project:data_processing.jobs:create-job"
classes = ("ajax-modal")
template_name = "project/data_processing.jobs/create.html"
page_title = _("Create Job")
class JobDetailsView(tabs.TabView):
tab_group_class = _tabs.JobDetailsTabs
template_name = 'project/data_processing.jobs/details.html'
page_title = _("Job Details")
def get_context_data(self, **kwargs):
context = super(JobDetailsView, self).get_context_data(**kwargs)
@ -77,6 +80,7 @@ class LaunchJobView(workflows.WorkflowView):
success_url = "horizon:project:data_processing.jobs"
classes = ("ajax-modal")
template_name = "project/data_processing.jobs/launch.html"
page_title = _("Launch Job")
def get(self, request, *args, **kwargs):
if request.is_ajax():
@ -97,6 +101,7 @@ class LaunchJobNewClusterView(workflows.WorkflowView):
success_url = "horizon:project:data_processing.jobs"
classes = ("ajax-modal")
template_name = "project/data_processing.jobs/launch.html"
page_title = _("Launch Job")
def get_context_data(self, **kwargs):
context = super(LaunchJobNewClusterView, self).\
@ -109,6 +114,7 @@ class ChoosePluginView(workflows.WorkflowView):
success_url = "horizon:project:data_processing.jobs"
classes = ("ajax-modal")
template_name = "project/data_processing.jobs/launch.html"
page_title = _("Launch Job")
def get_context_data(self, **kwargs):
context = super(ChoosePluginView, self).get_context_data(**kwargs)

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Create Node Group Template" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Create Node Group Template") %}
{% endblock page_header %}
{% block main %}
{% include 'horizon/common/_workflow.html' %}
{% endblock %}

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Create Node Group Template" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Create Node Group Template") %}
{% endblock page_header %}
{% block main %}
{% include 'horizon/common/_workflow.html' %}
{% endblock %}

View File

@ -2,14 +2,10 @@
{% load i18n %}
{% block title %}{% trans "Nodegroup Template Details" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Node Group Template Details") %}
{% endblock page_header %}
{% block main %}
<div class="row">
<div class="col-sm-12">
{{ tab_group.render }}
</div>
</div>
{% endblock %}
{% endblock %}

View File

@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Data Processing" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Node Group Templates") %}
{% endblock page_header %}
{% block main %}
<div class="nodegroup_templates">

View File

@ -38,6 +38,7 @@ class NodegroupTemplatesView(tables.DataTableView):
table_class = _tables.NodegroupTemplatesTable
template_name = (
'project/data_processing.nodegroup_templates/nodegroup_templates.html')
page_title = _("Node Group Templates")
def get_data(self):
try:
@ -57,6 +58,7 @@ class NodegroupTemplatesView(tables.DataTableView):
class NodegroupTemplateDetailsView(tabs.TabView):
tab_group_class = _tabs.NodegroupTemplateDetailsTabs
template_name = 'project/data_processing.nodegroup_templates/details.html'
page_title = _("Node Group Template Details")
def get_context_data(self, **kwargs):
context = super(NodegroupTemplateDetailsView, self)\
@ -74,6 +76,7 @@ class CreateNodegroupTemplateView(workflows.WorkflowView):
"create-nodegroup-template")
classes = ("ajax-modal")
template_name = "project/data_processing.nodegroup_templates/create.html"
page_title = _("Create Node Group Template")
class ConfigureNodegroupTemplateView(workflows.WorkflowView):
@ -81,6 +84,7 @@ class ConfigureNodegroupTemplateView(workflows.WorkflowView):
success_url = "horizon:project:data_processing.nodegroup_templates"
template_name = (
"project/data_processing.nodegroup_templates/configure.html")
page_title = _("Create Node Group Template")
class CopyNodegroupTemplateView(workflows.WorkflowView):