diff --git a/openstack_dashboard/dashboards/identity/domains/templates/domains/index.html b/openstack_dashboard/dashboards/identity/domains/templates/domains/index.html index 78fecfa6e5..aa127d7938 100644 --- a/openstack_dashboard/dashboards/identity/domains/templates/domains/index.html +++ b/openstack_dashboard/dashboards/identity/domains/templates/domains/index.html @@ -3,7 +3,7 @@ {% block title %}{% trans "Domains" %}{% endblock %} {% block page_header %} - {% include "horizon/common/_domain_page_header.html" with title=_("Domains") %} + {% include "horizon/common/_domain_page_header.html" with title=page_title %} {% endblock page_header %} {% block main %} diff --git a/openstack_dashboard/dashboards/identity/domains/views.py b/openstack_dashboard/dashboards/identity/domains/views.py index fca4359fb3..1c95d6d070 100644 --- a/openstack_dashboard/dashboards/identity/domains/views.py +++ b/openstack_dashboard/dashboards/identity/domains/views.py @@ -33,6 +33,7 @@ from openstack_dashboard.dashboards.identity.domains \ class IndexView(tables.DataTableView): table_class = project_tables.DomainsTable template_name = constants.DOMAINS_INDEX_VIEW_TEMPLATE + page_title = _("Domains") def get_data(self): domains = [] diff --git a/openstack_dashboard/dashboards/identity/groups/templates/groups/create.html b/openstack_dashboard/dashboards/identity/groups/templates/groups/create.html index 8810517c3d..1c6a409b99 100644 --- a/openstack_dashboard/dashboards/identity/groups/templates/groups/create.html +++ b/openstack_dashboard/dashboards/identity/groups/templates/groups/create.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Create Group" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Create Group") %} -{% endblock page_header %} - {% block main %} {% include 'identity/groups/_create.html' %} {% endblock %} diff --git a/openstack_dashboard/dashboards/identity/groups/templates/groups/index.html b/openstack_dashboard/dashboards/identity/groups/templates/groups/index.html index 1c45b9d3ff..ddacaef325 100644 --- a/openstack_dashboard/dashboards/identity/groups/templates/groups/index.html +++ b/openstack_dashboard/dashboards/identity/groups/templates/groups/index.html @@ -3,7 +3,7 @@ {% block title %}{% trans "Groups" %}{% endblock %} {% block page_header %} - {% include "horizon/common/_domain_page_header.html" with title=_("Groups") %} + {% include "horizon/common/_domain_page_header.html" with title=page_title %} {% endblock page_header %} {% block main %} diff --git a/openstack_dashboard/dashboards/identity/groups/templates/groups/update.html b/openstack_dashboard/dashboards/identity/groups/templates/groups/update.html index 7b2ec826c3..815b7ba102 100644 --- a/openstack_dashboard/dashboards/identity/groups/templates/groups/update.html +++ b/openstack_dashboard/dashboards/identity/groups/templates/groups/update.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Update Group" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Update Group") %} -{% endblock page_header %} - {% block main %} {% include 'identity/groups/_update.html' %} {% endblock %} diff --git a/openstack_dashboard/dashboards/identity/groups/views.py b/openstack_dashboard/dashboards/identity/groups/views.py index 4b9097576a..68059bc543 100644 --- a/openstack_dashboard/dashboards/identity/groups/views.py +++ b/openstack_dashboard/dashboards/identity/groups/views.py @@ -35,6 +35,7 @@ from openstack_dashboard.dashboards.identity.groups \ class IndexView(tables.DataTableView): table_class = project_tables.GroupsTable template_name = constants.GROUPS_INDEX_VIEW_TEMPLATE + page_title = _("Groups") def get_data(self): groups = [] @@ -61,6 +62,7 @@ class CreateView(forms.ModalFormView): submit_url = "horizon:identity:groups:create" submit_label = _("Create Group") success_url = reverse_lazy(constants.GROUPS_INDEX_URL) + page_title = _("Create Group") class UpdateView(forms.ModalFormView): @@ -71,6 +73,7 @@ class UpdateView(forms.ModalFormView): submit_url = "horizon:identity:groups:update" submit_label = _("Update Group") success_url = reverse_lazy(constants.GROUPS_INDEX_URL) + page_title = _("Update Group") @memoized.memoized_method def get_object(self): diff --git a/openstack_dashboard/dashboards/identity/projects/templates/projects/index.html b/openstack_dashboard/dashboards/identity/projects/templates/projects/index.html index 1391c3c0bf..7f714bf82b 100644 --- a/openstack_dashboard/dashboards/identity/projects/templates/projects/index.html +++ b/openstack_dashboard/dashboards/identity/projects/templates/projects/index.html @@ -3,7 +3,7 @@ {% block title %}{% trans "Projects" %}{% endblock %} {% block page_header %} - {% include "horizon/common/_domain_page_header.html" with title=_("Projects") %} + {% include "horizon/common/_domain_page_header.html" with title=page_title %} {% endblock page_header %} {% block main %} diff --git a/openstack_dashboard/dashboards/identity/projects/templates/projects/usage.html b/openstack_dashboard/dashboards/identity/projects/templates/projects/usage.html index 767df022eb..26988d012d 100644 --- a/openstack_dashboard/dashboards/identity/projects/templates/projects/usage.html +++ b/openstack_dashboard/dashboards/identity/projects/templates/projects/usage.html @@ -3,7 +3,7 @@ {% block title %}{% trans "Project Usage Overview" %}{% endblock %} {% block page_header %} - {% include "horizon/common/_domain_page_header.html" with title=_("Project Usage") %} + {% include "horizon/common/_domain_page_header.html" with title=page_title %} {% endblock %} {% block main %} diff --git a/openstack_dashboard/dashboards/identity/projects/views.py b/openstack_dashboard/dashboards/identity/projects/views.py index e122a4c6fa..3754f309d3 100644 --- a/openstack_dashboard/dashboards/identity/projects/views.py +++ b/openstack_dashboard/dashboards/identity/projects/views.py @@ -68,6 +68,7 @@ class TenantContextMixin(object): class IndexView(tables.DataTableView): table_class = project_tables.TenantsTable template_name = 'identity/projects/index.html' + page_title = _("Projects") def has_more_data(self, table): return self._more @@ -116,6 +117,7 @@ class ProjectUsageView(usage.UsageView): template_name = 'identity/projects/usage.html' csv_response_class = project_views.ProjectUsageCsvRenderer csv_template_name = 'project/overview/usage.csv' + page_title = _("Project Usage") def get_data(self): super(ProjectUsageView, self).get_data() diff --git a/openstack_dashboard/dashboards/identity/roles/templates/roles/create.html b/openstack_dashboard/dashboards/identity/roles/templates/roles/create.html index 9447ab2e0a..1240d73abb 100644 --- a/openstack_dashboard/dashboards/identity/roles/templates/roles/create.html +++ b/openstack_dashboard/dashboards/identity/roles/templates/roles/create.html @@ -2,11 +2,6 @@ {% load i18n %} {% block title %}{% trans "Create Role" %}{% endblock %} -{% block page_header %} - {# to make searchable false, just remove it from the include statement #} - {% include "horizon/common/_page_header.html" with title=_("Create Role") %} -{% endblock page_header %} - {% block main %} {% include 'identity/roles/_create.html' %} {% endblock %} diff --git a/openstack_dashboard/dashboards/identity/roles/templates/roles/index.html b/openstack_dashboard/dashboards/identity/roles/templates/roles/index.html index 6a61c97970..7545a2d482 100644 --- a/openstack_dashboard/dashboards/identity/roles/templates/roles/index.html +++ b/openstack_dashboard/dashboards/identity/roles/templates/roles/index.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Roles" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Roles") %} -{% endblock page_header %} - {% block main %} {{ table.render }} {% endblock %} diff --git a/openstack_dashboard/dashboards/identity/roles/templates/roles/update.html b/openstack_dashboard/dashboards/identity/roles/templates/roles/update.html index b64a3ec9d9..ef1a4bb51f 100644 --- a/openstack_dashboard/dashboards/identity/roles/templates/roles/update.html +++ b/openstack_dashboard/dashboards/identity/roles/templates/roles/update.html @@ -2,11 +2,6 @@ {% load i18n %} {% block title %}{% trans "Update Role" %}{% endblock %} -{% block page_header %} - {# to make searchable false, just remove it from the include statement #} - {% include "horizon/common/_page_header.html" with title=_("Update Role") %} -{% endblock page_header %} - {% block main %} {% include 'identity/roles/_update.html' %} {% endblock %} diff --git a/openstack_dashboard/dashboards/identity/roles/views.py b/openstack_dashboard/dashboards/identity/roles/views.py index 74ec729d99..abc1bcb660 100644 --- a/openstack_dashboard/dashboards/identity/roles/views.py +++ b/openstack_dashboard/dashboards/identity/roles/views.py @@ -34,6 +34,7 @@ from openstack_dashboard.dashboards.identity.roles \ class IndexView(tables.DataTableView): table_class = project_tables.RolesTable template_name = 'identity/roles/index.html' + page_title = _("Roles") def get_data(self): roles = [] @@ -58,6 +59,7 @@ class UpdateView(forms.ModalFormView): submit_label = _("Update Role") submit_url = "horizon:identity:roles:update" success_url = reverse_lazy('horizon:identity:roles:index') + page_title = _("Update Role") @memoized.memoized_method def get_object(self): @@ -89,3 +91,4 @@ class CreateView(forms.ModalFormView): submit_label = _("Create Role") submit_url = reverse_lazy("horizon:identity:roles:create") success_url = reverse_lazy('horizon:identity:roles:index') + page_title = _("Create Role") diff --git a/openstack_dashboard/dashboards/identity/users/templates/users/create.html b/openstack_dashboard/dashboards/identity/users/templates/users/create.html index 5b1644a73b..f330497ee1 100644 --- a/openstack_dashboard/dashboards/identity/users/templates/users/create.html +++ b/openstack_dashboard/dashboards/identity/users/templates/users/create.html @@ -2,11 +2,6 @@ {% load i18n %} {% block title %}{% trans "Create User" %}{% endblock %} -{% block page_header %} - {# to make searchable false, just remove it from the include statement #} - {% include "horizon/common/_page_header.html" with title=_("Create User") %} -{% endblock page_header %} - {% block main %} {% include 'identity/users/_create.html' %} {% endblock %} diff --git a/openstack_dashboard/dashboards/identity/users/templates/users/detail.html b/openstack_dashboard/dashboards/identity/users/templates/users/detail.html index b6309b0228..96fa9a8d42 100644 --- a/openstack_dashboard/dashboards/identity/users/templates/users/detail.html +++ b/openstack_dashboard/dashboards/identity/users/templates/users/detail.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "User Details" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=page_title %} -{% endblock page_header %} - {% block main %}
@@ -13,4 +9,3 @@
{% endblock %} - diff --git a/openstack_dashboard/dashboards/identity/users/templates/users/index.html b/openstack_dashboard/dashboards/identity/users/templates/users/index.html index 53c327d8c0..95dce3ea96 100644 --- a/openstack_dashboard/dashboards/identity/users/templates/users/index.html +++ b/openstack_dashboard/dashboards/identity/users/templates/users/index.html @@ -3,7 +3,7 @@ {% block title %}{% trans "Users" %}{% endblock %} {% block page_header %} - {% include "horizon/common/_domain_page_header.html" with title=_("Users") %} + {% include "horizon/common/_domain_page_header.html" with title=page_title %} {% endblock page_header %} {% block main %} diff --git a/openstack_dashboard/dashboards/identity/users/templates/users/update.html b/openstack_dashboard/dashboards/identity/users/templates/users/update.html index e689fd3840..22cf852a74 100644 --- a/openstack_dashboard/dashboards/identity/users/templates/users/update.html +++ b/openstack_dashboard/dashboards/identity/users/templates/users/update.html @@ -2,11 +2,6 @@ {% load i18n %} {% block title %}{% trans "Update User" %}{% endblock %} -{% block page_header %} - {# to make searchable false, just remove it from the include statement #} - {% include "horizon/common/_page_header.html" with title=_("Update User") %} -{% endblock page_header %} - {% block main %} {% include 'identity/users/_update.html' %} {% endblock %} diff --git a/openstack_dashboard/dashboards/identity/users/views.py b/openstack_dashboard/dashboards/identity/users/views.py index 5eca9e7b15..e2ac23bfca 100644 --- a/openstack_dashboard/dashboards/identity/users/views.py +++ b/openstack_dashboard/dashboards/identity/users/views.py @@ -23,13 +23,13 @@ from django.core.urlresolvers import reverse_lazy from django.utils.decorators import method_decorator # noqa from django.utils.translation import ugettext_lazy as _ from django.views.decorators.debug import sensitive_post_parameters # noqa -from django.views import generic from horizon import exceptions from horizon import forms from horizon import messages from horizon import tables from horizon.utils import memoized +from horizon import views from openstack_dashboard import api from openstack_dashboard import policy @@ -43,6 +43,7 @@ from openstack_dashboard.dashboards.identity.users \ class IndexView(tables.DataTableView): table_class = project_tables.UsersTable template_name = 'identity/users/index.html' + page_title = _("Users") def get_data(self): users = [] @@ -78,6 +79,7 @@ class UpdateView(forms.ModalFormView): submit_label = _("Update User") submit_url = "horizon:identity:users:update" success_url = reverse_lazy('horizon:identity:users:index') + page_title = _("Update User") @method_decorator(sensitive_post_parameters('password', 'confirm_password')) @@ -131,6 +133,7 @@ class CreateView(forms.ModalFormView): submit_label = _("Create User") submit_url = reverse_lazy("horizon:identity:users:create") success_url = reverse_lazy('horizon:identity:users:index') + page_title = _("Create User") @method_decorator(sensitive_post_parameters('password', 'confirm_password')) @@ -159,8 +162,9 @@ class CreateView(forms.ModalFormView): 'role_id': getattr(default_role, "id", None)} -class DetailView(generic.TemplateView): +class DetailView(views.HorizonTemplateView): template_name = 'identity/users/detail.html' + page_title = _("User Details: {{ user.name }}") def get_context_data(self, **kwargs): context = super(DetailView, self).get_context_data(**kwargs) @@ -179,7 +183,6 @@ class DetailView(generic.TemplateView): context["user"] = user context["domain_id"] = domain_id context["domain_name"] = domain_name - context["page_title"] = _("User Details: %s") % user.name context["url"] = self.get_redirect_url() context["actions"] = table.render_row_actions(user) return context