diff --git a/openstack_dashboard/dashboards/project/access_and_security/api_access/views.py b/openstack_dashboard/dashboards/project/access_and_security/api_access/views.py index d0aff4646e..d71bb1a84c 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/api_access/views.py +++ b/openstack_dashboard/dashboards/project/access_and_security/api_access/views.py @@ -21,11 +21,11 @@ from django import http from django import shortcuts from django.template.loader import render_to_string from django.utils.translation import ugettext_lazy as _ -from django.views import generic from horizon import exceptions from horizon import forms from horizon import messages +from horizon import views from openstack_dashboard import api @@ -133,8 +133,9 @@ def download_rc_file(request): return shortcuts.redirect(request.build_absolute_uri()) -class CredentialsView(forms.ModalFormMixin, generic.TemplateView): +class CredentialsView(forms.ModalFormMixin, views.HorizonTemplateView): template_name = 'project/access_and_security/api_access/credentials.html' + page_title = _("User Credentials Details") def get_context_data(self, **kwargs): context = super(CredentialsView, self).get_context_data(**kwargs) diff --git a/openstack_dashboard/dashboards/project/access_and_security/keypairs/views.py b/openstack_dashboard/dashboards/project/access_and_security/keypairs/views.py index 7052ba7779..3361199d25 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/keypairs/views.py +++ b/openstack_dashboard/dashboards/project/access_and_security/keypairs/views.py @@ -24,12 +24,12 @@ from django.core.urlresolvers import reverse_lazy from django import http from django.template.defaultfilters import slugify # noqa from django.utils.translation import ugettext_lazy as _ -from django.views.generic import TemplateView # noqa from django.views.generic import View # noqa from horizon import exceptions from horizon import forms from horizon.utils import memoized +from horizon import views from openstack_dashboard import api @@ -41,6 +41,7 @@ class CreateView(forms.ModalFormView): form_class = project_forms.CreateKeypair template_name = 'project/access_and_security/keypairs/create.html' success_url = 'horizon:project:access_and_security:keypairs:download' + page_title = _("Create Key Pair") def get_success_url(self): return reverse(self.success_url, @@ -51,13 +52,15 @@ class ImportView(forms.ModalFormView): form_class = project_forms.ImportKeypair template_name = 'project/access_and_security/keypairs/import.html' success_url = reverse_lazy('horizon:project:access_and_security:index') + page_title = _("Import Key Pair") def get_object_id(self, keypair): return keypair.name -class DetailView(TemplateView): +class DetailView(views.HorizonTemplateView): template_name = 'project/access_and_security/keypairs/detail.html' + page_title = _("Key Pair Details") @memoized.memoized_method def _get_data(self): @@ -75,15 +78,16 @@ class DetailView(TemplateView): def get_context_data(self, **kwargs): """Gets the context data for keypair.""" context = super(DetailView, self).get_context_data(**kwargs) - context['page_title'] = _("Key Pair Details") context['keypair'] = self._get_data() return context -class DownloadView(TemplateView): +class DownloadView(views.HorizonTemplateView): + template_name = 'project/access_and_security/keypairs/download.html' + page_title = _("Download Key Pair") + def get_context_data(self, keypair_name=None): return {'keypair_name': keypair_name} - template_name = 'project/access_and_security/keypairs/download.html' class GenerateView(View): diff --git a/openstack_dashboard/dashboards/project/access_and_security/security_groups/views.py b/openstack_dashboard/dashboards/project/access_and_security/security_groups/views.py index aa3f499c80..6bf2e6bd7f 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/security_groups/views.py +++ b/openstack_dashboard/dashboards/project/access_and_security/security_groups/views.py @@ -71,6 +71,7 @@ class UpdateView(forms.ModalFormView): form_class = project_forms.UpdateGroup template_name = 'project/access_and_security/security_groups/update.html' success_url = reverse_lazy('horizon:project:access_and_security:index') + page_title = _("Edit Security Group") @memoized.memoized_method def get_object(self): @@ -97,6 +98,7 @@ class UpdateView(forms.ModalFormView): class AddRuleView(forms.ModalFormView): form_class = project_forms.AddRule template_name = 'project/access_and_security/security_groups/add_rule.html' + page_title = _("Add Rule") def get_success_url(self): sg_id = self.kwargs['security_group_id'] @@ -137,3 +139,4 @@ class CreateView(forms.ModalFormView): form_class = project_forms.CreateGroup template_name = 'project/access_and_security/security_groups/create.html' success_url = reverse_lazy('horizon:project:access_and_security:index') + page_title = _("Create Security Group") diff --git a/openstack_dashboard/dashboards/project/access_and_security/templates/access_and_security/api_access/credentials.html b/openstack_dashboard/dashboards/project/access_and_security/templates/access_and_security/api_access/credentials.html index b0fd58e374..249dc10ac7 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/templates/access_and_security/api_access/credentials.html +++ b/openstack_dashboard/dashboards/project/access_and_security/templates/access_and_security/api_access/credentials.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "User Credentials" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("User Credentials Details") %} -{% endblock page_header %} - {% block main %} {% include 'project/access_and_security/api_access/_credentials.html' %} {% endblock %} diff --git a/openstack_dashboard/dashboards/project/access_and_security/templates/access_and_security/index.html b/openstack_dashboard/dashboards/project/access_and_security/templates/access_and_security/index.html index 14d51ac320..87b81a797e 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/templates/access_and_security/index.html +++ b/openstack_dashboard/dashboards/project/access_and_security/templates/access_and_security/index.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Access & Security" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Access & Security") %} -{% endblock page_header %} - {% block main %}
diff --git a/openstack_dashboard/dashboards/project/access_and_security/templates/access_and_security/keypairs/create.html b/openstack_dashboard/dashboards/project/access_and_security/templates/access_and_security/keypairs/create.html index e950bf46ea..cbeeb0e395 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/templates/access_and_security/keypairs/create.html +++ b/openstack_dashboard/dashboards/project/access_and_security/templates/access_and_security/keypairs/create.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Create Key Pair" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Create Key Pair") %} -{% endblock page_header %} - {% block main %} {% include 'project/access_and_security/keypairs/_create.html' %} {% endblock %} diff --git a/openstack_dashboard/dashboards/project/access_and_security/templates/access_and_security/keypairs/detail.html b/openstack_dashboard/dashboards/project/access_and_security/templates/access_and_security/keypairs/detail.html index 024ecba5bd..4a2365013f 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/templates/access_and_security/keypairs/detail.html +++ b/openstack_dashboard/dashboards/project/access_and_security/templates/access_and_security/keypairs/detail.html @@ -2,9 +2,6 @@ {% load i18n sizeformat %} {% block title %}{% trans "Key Pair Details" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=page_title %} -{% endblock page_header %} {% block main %}
diff --git a/openstack_dashboard/dashboards/project/access_and_security/templates/access_and_security/keypairs/download.html b/openstack_dashboard/dashboards/project/access_and_security/templates/access_and_security/keypairs/download.html index 769cdfc80e..9eac85b817 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/templates/access_and_security/keypairs/download.html +++ b/openstack_dashboard/dashboards/project/access_and_security/templates/access_and_security/keypairs/download.html @@ -3,10 +3,6 @@ {% load url from future %} {% block title %}{% blocktrans %}Download Key Pair{% endblocktrans %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Download Key Pair") %} -{% endblock page_header %} - {% block main %}