Comment 1 for bug 1394573

Revision history for this message
Doug Fish (drfish) wrote :

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')