Reduce page title duplication in settings and test

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 settings and the test panel views.

Change-Id: I4af59bb3c051dcd24e46aacd91c49b8fcc6c10c7
Partial-Bug: 1413749
This commit is contained in:
Sam Betts
2015-02-10 14:25:08 +00:00
parent 8d49a2eeb2
commit 49f844024a
6 changed files with 10 additions and 14 deletions

View File

@@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "Change Password" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("Change Password") %}
{% endblock page_header %}
{% block main %}
{% include "settings/password/_change.html" %}
{% endblock %}

View File

@@ -12,6 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from django.utils.translation import ugettext_lazy as _
from horizon import forms
from openstack_dashboard.dashboards.settings.password \
@@ -21,3 +23,4 @@ from openstack_dashboard.dashboards.settings.password \
class PasswordView(forms.ModalFormView):
form_class = pass_forms.PasswordForm
template_name = 'settings/password/change.html'
page_title = _("Change Password")

View File

@@ -2,10 +2,6 @@
{% load i18n %}
{% block title %}{% trans "User Settings" %}{% endblock %}
{% block page_header %}
{% include "horizon/common/_page_header.html" with title=_("User Settings") %}
{% endblock page_header %}
{% block main %}
{% include "settings/user/_settings.html" %}
{% endblock %}

View File

@@ -13,6 +13,7 @@
# under the License.
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from horizon import forms
from horizon.utils import functions as utils
@@ -22,6 +23,7 @@ from openstack_dashboard.dashboards.settings.user import forms as user_forms
class UserSettingsView(forms.ModalFormView):
form_class = user_forms.UserSettingsForm
template_name = 'settings/user/settings.html'
page_title = _("User Settings")
def get_initial(self):
return {

View File

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

View File

@@ -10,8 +10,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from django.views.generic import TemplateView # noqa
from django.utils.translation import ugettext_lazy as _
from horizon import views
class IndexView(TemplateView):
class IndexView(views.HorizonTemplateView):
template_name = 'admin/plugin_panel/index.html'
page_title = _("Plugin-based Panel")