diff --git a/manila_ui/dashboards/project/shares/security_services/views.py b/manila_ui/dashboards/project/shares/security_services/views.py index d94965c7..fc814392 100644 --- a/manila_ui/dashboards/project/shares/security_services/views.py +++ b/manila_ui/dashboards/project/shares/security_services/views.py @@ -32,6 +32,7 @@ class UpdateView(forms.ModalFormView): template_name = "project/shares/security_services/update.html" form_class = sec_services_forms.Update success_url = 'horizon:project:shares:index' + page_title = _('Edit Security Service') def get_success_url(self): return reverse(self.success_url) @@ -65,6 +66,7 @@ class CreateView(forms.ModalFormView): template_name = ('project/shares/security_services' '/create_security_service.html') success_url = 'horizon:project:shares:index' + page_title = _('Create a Security Service') def get_success_url(self): return reverse(self.success_url) @@ -75,6 +77,7 @@ class AddSecurityServiceView(forms.ModalFormView): template_name = ('project/shares/security_services' '/add_security_service.html') success_url = 'horizon:project:shares:index' + page_title = _('Add Security Service') def get_object(self): if not hasattr(self, "_object"): @@ -110,6 +113,9 @@ class Detail(tabs.TabView): context["sec_service"] = sec_service sec_service_display_name = sec_service.name or sec_service.id context["sec_service_display_name"] = sec_service_display_name + context["page_title"] = _("Security Service Details: " + "%(service_display_name)s") % \ + {'service_display_name': sec_service_display_name} return context def get_data(self): diff --git a/manila_ui/dashboards/project/shares/share_networks/views.py b/manila_ui/dashboards/project/shares/share_networks/views.py index aa577aca..bc550a47 100644 --- a/manila_ui/dashboards/project/shares/share_networks/views.py +++ b/manila_ui/dashboards/project/shares/share_networks/views.py @@ -36,6 +36,7 @@ class Update(workflows.WorkflowView): workflow_class = share_net_workflows.UpdateShareNetworkWorkflow template_name = "project/shares/share_networks/share_network_update.html" success_url = 'horizon:project:shares:index' + page_title = _('Update Share Network') def get_initial(self): return {'id': self.kwargs["share_network_id"]} @@ -50,6 +51,7 @@ class Create(forms.ModalFormView): form_class = share_net_forms.Create template_name = 'project/shares/share_networks/create_share_network.html' success_url = 'horizon:project:shares:index' + page_title = _('Create Share Network') def get_success_url(self): return reverse(self.success_url) @@ -65,6 +67,9 @@ class Detail(tabs.TabView): share_network_display_name = share_network.name or share_network.id context["share_network"] = share_network context["share_network_display_name"] = share_network_display_name + context["page_title"] = _("Share Network Details: " + "%(network_display_name)s") % \ + {'network_display_name': share_network_display_name} return context def get_data(self): diff --git a/manila_ui/dashboards/project/shares/shares/views.py b/manila_ui/dashboards/project/shares/shares/views.py index 5439f96e..3edc2019 100644 --- a/manila_ui/dashboards/project/shares/shares/views.py +++ b/manila_ui/dashboards/project/shares/shares/views.py @@ -64,6 +64,9 @@ class DetailView(tabs.TabView): share_display_name = share.name or share.id context["share"] = share context["share_display_name"] = share_display_name + context["page_title"] = _("Share Details: " + "%(share_display_name)s") % \ + {'share_display_name': share_display_name} return context @memoized.memoized_method @@ -88,6 +91,7 @@ class CreateView(forms.ModalFormView): form_class = share_form.CreateForm template_name = 'project/shares/shares/create.html' success_url = reverse_lazy("horizon:project:shares:index") + page_title = _('Create a Share') def get_context_data(self, **kwargs): context = super(CreateView, self).get_context_data(**kwargs) @@ -102,6 +106,7 @@ class UpdateView(forms.ModalFormView): form_class = share_form.UpdateForm template_name = 'project/shares/shares/update.html' success_url = reverse_lazy("horizon:project:shares:index") + page_title = _('Edit Share') def get_object(self): if not hasattr(self, "_object"): @@ -130,6 +135,7 @@ class UpdateMetadataView(forms.ModalFormView): form_class = share_form.UpdateMetadataForm template_name = 'project/shares/shares/update_metadata.html' success_url = reverse_lazy("horizon:project:shares:index") + page_title = _('Edit Share Metadata') def get_object(self): if not hasattr(self, "_object"): @@ -156,6 +162,7 @@ class UpdateMetadataView(forms.ModalFormView): class AddRuleView(forms.ModalFormView): form_class = share_form.AddRule template_name = 'project/shares/shares/rule_add.html' + page_title = _('Add Rule') def get_object(self): if not hasattr(self, "_object"): @@ -193,6 +200,9 @@ class ManageRulesView(tables.DataTableView): share = manila.share_get(self.request, self.kwargs['share_id']) context['share_display_name'] = share.name or share.id context["share"] = self.get_data() + context["page_title"] = _("Share Rules: " + "%(share_display_name)s") % \ + {'share_display_name': context['share_display_name']} return context @memoized.memoized_method diff --git a/manila_ui/dashboards/project/shares/snapshots/views.py b/manila_ui/dashboards/project/shares/snapshots/views.py index 47fb98f9..6804d4e0 100644 --- a/manila_ui/dashboards/project/shares/snapshots/views.py +++ b/manila_ui/dashboards/project/shares/snapshots/views.py @@ -40,6 +40,9 @@ class SnapshotDetailView(tabs.TabView): snapshot_display_name = snapshot.name or snapshot.id context["snapshot"] = snapshot context["snapshot_display_name"] = snapshot_display_name + context["page_title"] = _("Snapshot Details: " + "%(snapshot_display_name)s") % \ + {'snapshot_display_name': snapshot_display_name} return context @memoized.memoized_method @@ -65,6 +68,7 @@ class CreateSnapshotView(forms.ModalFormView): form_class = snapshot_forms.CreateSnapshotForm template_name = 'project/shares/snapshots/create_snapshot.html' success_url = reverse_lazy("horizon:project:shares:index") + page_title = _('Create Share Snapshot') def get_context_data(self, **kwargs): context = super(CreateSnapshotView, self).get_context_data(**kwargs) diff --git a/manila_ui/dashboards/project/shares/templates/shares/index.html b/manila_ui/dashboards/project/shares/templates/shares/index.html index 7bdae081..7ee65323 100644 --- a/manila_ui/dashboards/project/shares/templates/shares/index.html +++ b/manila_ui/dashboards/project/shares/templates/shares/index.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Shares" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Shares") %} -{% endblock page_header %} - {% block main %}
diff --git a/manila_ui/dashboards/project/shares/templates/shares/security_services/add_security_service.html b/manila_ui/dashboards/project/shares/templates/shares/security_services/add_security_service.html index e9a853e3..42ba935f 100644 --- a/manila_ui/dashboards/project/shares/templates/shares/security_services/add_security_service.html +++ b/manila_ui/dashboards/project/shares/templates/shares/security_services/add_security_service.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Create Security Service" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Add Security Service") %} -{% endblock page_header %} - {% block main %} {% include 'project/shares/security_services/_add_security_service.html' %} {% endblock %} diff --git a/manila_ui/dashboards/project/shares/templates/shares/security_services/create_security_service.html b/manila_ui/dashboards/project/shares/templates/shares/security_services/create_security_service.html index 7a6715b4..ace9c337 100644 --- a/manila_ui/dashboards/project/shares/templates/shares/security_services/create_security_service.html +++ b/manila_ui/dashboards/project/shares/templates/shares/security_services/create_security_service.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Create Security Service" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Create a Security Service") %} -{% endblock page_header %} - {% block main %} {% include 'project/shares/security_services/_create_security_service.html' %} {% endblock %} diff --git a/manila_ui/dashboards/project/shares/templates/shares/security_services/detail.html b/manila_ui/dashboards/project/shares/templates/shares/security_services/detail.html index eba7d59b..e43eeb07 100644 --- a/manila_ui/dashboards/project/shares/templates/shares/security_services/detail.html +++ b/manila_ui/dashboards/project/shares/templates/shares/security_services/detail.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Security Service Details" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Security Service Details: ")|add:sec_service_display_name|default:_("Security Service Details:") %} -{% endblock page_header %} - {% block main %}
diff --git a/manila_ui/dashboards/project/shares/templates/shares/security_services/update.html b/manila_ui/dashboards/project/shares/templates/shares/security_services/update.html index e8bb8b4c..61247a2f 100644 --- a/manila_ui/dashboards/project/shares/templates/shares/security_services/update.html +++ b/manila_ui/dashboards/project/shares/templates/shares/security_services/update.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Edit Security Service" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Edit Security Service") %} -{% endblock page_header %} - {% block main %} {% include 'project/shares/security_services/_update.html' %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/manila_ui/dashboards/project/shares/templates/shares/share_networks/create_share_network.html b/manila_ui/dashboards/project/shares/templates/shares/share_networks/create_share_network.html index 687e6551..f750449f 100644 --- a/manila_ui/dashboards/project/shares/templates/shares/share_networks/create_share_network.html +++ b/manila_ui/dashboards/project/shares/templates/shares/share_networks/create_share_network.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Create Share Network" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Create Share Network") %} -{% endblock page_header %} - {% block main %} {% include 'project/shares/share_networks/_create_share_network.html' %} {% endblock %} diff --git a/manila_ui/dashboards/project/shares/templates/shares/share_networks/detail.html b/manila_ui/dashboards/project/shares/templates/shares/share_networks/detail.html index 862e0ba8..00f595fb 100644 --- a/manila_ui/dashboards/project/shares/templates/shares/share_networks/detail.html +++ b/manila_ui/dashboards/project/shares/templates/shares/share_networks/detail.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Share Details" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Share Network Details: ")|add:share_network_display_name|default:_("Share Network Details:") %} -{% endblock page_header %} - {% block main %}
diff --git a/manila_ui/dashboards/project/shares/templates/shares/share_networks/share_network_update.html b/manila_ui/dashboards/project/shares/templates/shares/share_networks/share_network_update.html index 06ea945b..2044796a 100644 --- a/manila_ui/dashboards/project/shares/templates/shares/share_networks/share_network_update.html +++ b/manila_ui/dashboards/project/shares/templates/shares/share_networks/share_network_update.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Update share network" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Update Share Network") %} -{% endblock page_header %} - {% block main %} {% include 'horizon/common/_workflow.html' %} {% endblock %} diff --git a/manila_ui/dashboards/project/shares/templates/shares/shares/create.html b/manila_ui/dashboards/project/shares/templates/shares/shares/create.html index 3be314f6..41a37c26 100644 --- a/manila_ui/dashboards/project/shares/templates/shares/shares/create.html +++ b/manila_ui/dashboards/project/shares/templates/shares/shares/create.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Create Share" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Create a Share") %} -{% endblock page_header %} - {% block main %} {% include 'project/shares/shares/_create.html' %} {% endblock %} diff --git a/manila_ui/dashboards/project/shares/templates/shares/shares/detail.html b/manila_ui/dashboards/project/shares/templates/shares/shares/detail.html index e651d488..00f595fb 100644 --- a/manila_ui/dashboards/project/shares/templates/shares/shares/detail.html +++ b/manila_ui/dashboards/project/shares/templates/shares/shares/detail.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Share Details" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Share Details: ")|add:share_display_name|default:_("Share Details:") %} -{% endblock page_header %} - {% block main %}
diff --git a/manila_ui/dashboards/project/shares/templates/shares/shares/manage_rules.html b/manila_ui/dashboards/project/shares/templates/shares/shares/manage_rules.html index 93a892f7..fed2c700 100644 --- a/manila_ui/dashboards/project/shares/templates/shares/shares/manage_rules.html +++ b/manila_ui/dashboards/project/shares/templates/shares/shares/manage_rules.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Share Rules" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Share Rules: ")|add:share_display_name|default:_("Share Details:") %} -{% endblock page_header %} - {% block main %} {{ table.render }} {% endblock %} diff --git a/manila_ui/dashboards/project/shares/templates/shares/shares/rule_add.html b/manila_ui/dashboards/project/shares/templates/shares/shares/rule_add.html index ca592494..ef804953 100644 --- a/manila_ui/dashboards/project/shares/templates/shares/shares/rule_add.html +++ b/manila_ui/dashboards/project/shares/templates/shares/shares/rule_add.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Add Rule" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Add Rule") %} -{% endblock page_header %} - {% block main %} {% include 'project/shares/shares/_rule_add.html' %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/manila_ui/dashboards/project/shares/templates/shares/shares/update.html b/manila_ui/dashboards/project/shares/templates/shares/shares/update.html index 07da0624..ce313a8d 100644 --- a/manila_ui/dashboards/project/shares/templates/shares/shares/update.html +++ b/manila_ui/dashboards/project/shares/templates/shares/shares/update.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Edit Share" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Edit Share") %} -{% endblock page_header %} - {% block main %} {% include 'project/shares/shares/_update.html' %} {% endblock %} diff --git a/manila_ui/dashboards/project/shares/templates/shares/shares/update_metadata.html b/manila_ui/dashboards/project/shares/templates/shares/shares/update_metadata.html index 2e2edbaf..86fec56e 100644 --- a/manila_ui/dashboards/project/shares/templates/shares/shares/update_metadata.html +++ b/manila_ui/dashboards/project/shares/templates/shares/shares/update_metadata.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Edit Share Metadata" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Edit Share Metadata") %} -{% endblock page_header %} - {% block main %} {% include 'project/shares/shares/_update_metadata.html' %} {% endblock %} diff --git a/manila_ui/dashboards/project/shares/templates/shares/snapshots/create_snapshot.html b/manila_ui/dashboards/project/shares/templates/shares/snapshots/create_snapshot.html index 58fdbe10..316c660d 100644 --- a/manila_ui/dashboards/project/shares/templates/shares/snapshots/create_snapshot.html +++ b/manila_ui/dashboards/project/shares/templates/shares/snapshots/create_snapshot.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Create Share Snapshot" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Create Share Snapshot") %} -{% endblock page_header %} - {% block main %} {% include 'project/shares/snapshots/_create_snapshot.html' %} {% endblock %} diff --git a/manila_ui/dashboards/project/shares/templates/shares/snapshots/snapshot_detail.html b/manila_ui/dashboards/project/shares/templates/shares/snapshots/snapshot_detail.html index f77cb1b7..fcd788ab 100644 --- a/manila_ui/dashboards/project/shares/templates/shares/snapshots/snapshot_detail.html +++ b/manila_ui/dashboards/project/shares/templates/shares/snapshots/snapshot_detail.html @@ -2,10 +2,6 @@ {% load i18n %} {% block title %}{% trans "Snapshot Details" %}{% endblock %} -{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Snapshot Details: ")|add:snapshot_display_name|default:_("Snapshot Details:") %} -{% endblock page_header %} - {% block main %}
diff --git a/manila_ui/dashboards/project/shares/views.py b/manila_ui/dashboards/project/shares/views.py index b5a2ab1b..7a43eb42 100644 --- a/manila_ui/dashboards/project/shares/views.py +++ b/manila_ui/dashboards/project/shares/views.py @@ -18,7 +18,7 @@ Views for managing shares. """ - +from django.utils.translation import ugettext_lazy as _ from horizon import tabs from manila_ui.dashboards.project.shares.security_services \ @@ -43,3 +43,4 @@ class ShareTabs(tabs.TabGroup): class IndexView(tabs.TabbedTableView): tab_group_class = ShareTabs template_name = "project/shares/index.html" + page_title = _("Shares")