I think this is the right pattern for fixing the problem
--- a/openstack_dashboard/dashboards/admin/volumes/templates/volumes/volumes/detail.html +++ b/openstack_dashboard/dashboards/admin/volumes/templates/volumes/volumes/detail.html @@ -3,7 +3,7 @@ {% block title %}{% trans "Volume Details" %}{% endblock %}
{% block page_header %} - {% include "horizon/common/_page_header.html" with title=_("Volume Details: ")|add:volume.name|default:_("Volume Details:") %} + {% include "horizon/common/_page_header.html" with title=page_title %} {% endblock page_header %}
{% block main %} diff --git a/openstack_dashboard/dashboards/admin/volumes/volumes/views.py b/openstack_dashboard/dashboards/admin/volumes/volumes/views.py index be19286..34145ac 100644 --- a/openstack_dashboard/dashboards/admin/volumes/volumes/views.py +++ b/openstack_dashboard/dashboards/admin/volumes/volumes/views.py @@ -28,6 +28,12 @@ from openstack_dashboard.dashboards.project.volumes.volumes \ class DetailView(volumes_views.DetailView): template_name = "admin/volumes/volumes/detail.html"
+ def get_context_data(self, **kwargs): + context = super(DetailView, self).get_context_data(**kwargs) + volume = context["volume"] + context["page_title"] = _("Volume Details: %s") % volume.name + return context + def get_redirect_url(self): return reverse('horizon:admin:volumes:index')
I think this is the right pattern for fixing the problem
--- a/openstack_ dashboard/ dashboards/ admin/volumes/ templates/ volumes/ volumes/ detail. html dashboard/ dashboards/ admin/volumes/ templates/ volumes/ volumes/ detail. html
+++ b/openstack_
@@ -3,7 +3,7 @@
{% block title %}{% trans "Volume Details" %}{% endblock %}
{% block page_header %} common/ _page_header. html" with title=_("Volume Details: ")|add: volume. name|default: _("Volume Details:") %} common/ _page_header. html" with title=page_title %}
- {% include "horizon/
+ {% include "horizon/
{% endblock page_header %}
{% block main %} dashboard/ dashboards/ admin/volumes/ volumes/ views.py b/openstack_ dashboard/ dashboards/ admin/volumes/ volumes/ views.py dashboard/ dashboards/ admin/volumes/ volumes/ views.py dashboard/ dashboards/ admin/volumes/ volumes/ views.py dashboard. dashboards. project. volumes. volumes \ volumes_ views.DetailVie w): volumes/ volumes/ detail. html"
diff --git a/openstack_
index be19286..34145ac 100644
--- a/openstack_
+++ b/openstack_
@@ -28,6 +28,12 @@ from openstack_
class DetailView(
template_name = "admin/
+ def get_context_ data(self, **kwargs): context_ data(** kwargs) "page_title" ] = _("Volume Details: %s") % volume.name url(self) : 'horizon: admin:volumes: index')
+ context = super(DetailView, self).get_
+ volume = context["volume"]
+ context[
+ return context
+
def get_redirect_
return reverse(