Merge "Navigation + cleanup for details pages"

This commit is contained in:
Jenkins 2015-11-09 20:28:28 +00:00 committed by Gerrit Code Review
commit a8d21c2727
37 changed files with 192 additions and 236 deletions

View File

@ -0,0 +1,26 @@
{% load truncate_filter %}
<ol class="breadcrumb">
{% if breadcrumb %}
{% for name, target in breadcrumb %}
{% if target %}
<li><a href="{{ target }}">{{ name|truncate:20 }}</a></li>
{% else %}
<li class="active">{{ name|truncate:20 }}</li>
{% endif %}
{% endfor %}
{% else %}
{% if panel %}
<li><a href="{{ panel.get_absolute_url }}">{{ panel.name }}</a></li>
{% endif %}
{% endif %}
<li class="active">{{ page_title }}</li>
{% if actions %}
<form class='actions_column pull-right' action='{{ url }}' method="POST">
{% csrf_token %}
{{ actions }}
</form>
{% endif %}
</ol>

View File

@ -0,0 +1,21 @@
{% extends 'base.html' %}
{% load i18n %}
{% load breadcrumb_nav %}
{% block title %}
{{ page_title }}
{% endblock %}
{% block page_header %}
<div class='page-header'>
{% breadcrumb_nav %}
</div>
{% endblock %}
{% block main %}
<div class="row">
<div class="col-sm-12">
{{ tab_group.render }}
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,27 @@
# Copyright 2015 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django import template
register = template.Library()
@register.inclusion_tag('horizon/common/_breadcrumb_nav.html',
takes_context=True)
def breadcrumb_nav(context):
return {'actions': context.get('actions'),
'breadcrumb': context.get('custom_breadcrumb'),
'url': context.get('url'),
'page_title': context['page_title'],
'panel': context.request.horizon['panel'], }

View File

@ -49,7 +49,7 @@ class NetworkPortTests(test.BaseAdminViewTests):
res = self.client.get(reverse(DETAIL_URL, args=[port.id]))
self.assertTemplateUsed(res, 'project/networks/ports/detail.html')
self.assertTemplateUsed(res, 'horizon/common/_detail.html')
self.assertEqual(res.context['port'].id, port.id)
@test.create_stubs({api.neutron: ('port_get',)})

View File

@ -672,7 +672,7 @@ class NetworkSubnetTests(test.BaseAdminViewTests):
args=[subnet.id])
res = self.client.get(url)
self.assertTemplateUsed(res, 'project/networks/subnets/detail.html')
self.assertTemplateUsed(res, 'horizon/common/_detail.html')
self.assertEqual(res.context['subnet'].id, subnet.id)
@test.create_stubs({api.neutron: ('subnet_get',)})

View File

@ -59,13 +59,8 @@ class VolumeSnapshotsViewTests(test.BaseAdminViewTests):
args=[snapshot.id])
res = self.client.get(url)
self.assertContains(res,
"<h1>Volume Snapshot Details: %s</h1>" %
snapshot.name,
1, 200)
self.assertContains(res, "<dd>test snapshot</dd>", 1, 200)
self.assertContains(res, "<dd>%s</dd>" % snapshot.id, 1, 200)
self.assertContains(res, "<dd>Available</dd>", 1, 200)
self.assertTemplateUsed(res, 'horizon/common/_detail.html')
self.assertEqual(res.context['snapshot'].id, snapshot.id)
@test.create_stubs({cinder: ('volume_snapshot_get',
'volume_get')})

View File

@ -1,11 +0,0 @@
{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans "Volume Details" %}{% endblock %}
{% block main %}
<div class="row">
<div class="col-sm-12">
{{ tab_group.render }}
</div>
</div>
{% endblock %}

View File

@ -28,12 +28,9 @@ 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)
table = volumes_tables.VolumesTable(self.request)
context["url"] = self.get_redirect_url()
context["actions"] = table.render_row_actions(context["volume"])
return context

View File

@ -298,11 +298,9 @@ class ImageViewTests(test.TestCase):
args=[image.id]))
self.assertTemplateUsed(res,
'project/images/images/detail.html')
'horizon/common/_detail.html')
self.assertEqual(res.context['image'].name, image.name)
self.assertEqual(res.context['image'].protected, image.protected)
self.assertContains(res, "<h1>Image Details: %s</h1>" % image.name,
1, 200)
@test.create_stubs({api.glance: ('image_get',)})
def test_image_detail_custom_props_get(self):
@ -343,7 +341,7 @@ class ImageViewTests(test.TestCase):
reverse('horizon:project:images:images:detail',
args=[image.id]))
self.assertTemplateUsed(res,
'project/images/images/detail.html')
'horizon/common/_detail.html')
self.assertEqual(res.context['image'].protected, image.protected)
@test.create_stubs({api.glance: ('image_get',)})

View File

@ -117,8 +117,8 @@ class UpdateView(forms.ModalFormView):
class DetailView(tabs.TabView):
tab_group_class = project_tabs.ImageDetailTabs
template_name = 'project/images/images/detail.html'
page_title = _("Image Details: {{ image.name }}")
template_name = 'horizon/common/_detail.html'
page_title = _("{{ image.name }}")
def get_context_data(self, **kwargs):
context = super(DetailView, self).get_context_data(**kwargs)

View File

@ -1,10 +1,6 @@
{% load i18n sizeformat %}
<h3>{% trans "Image Overview" %}</h3>
<div class="info row detail">
<h4>{% trans "Information" %}</h4>
<hr class="header_rule">
<div class="detail">
<dl class="dl-horizontal">
<dt>{% trans "Name" %}</dt>
<dd>{{ image.name|default:_("None") }}</dd>
@ -37,9 +33,7 @@
<dd>{% trans "Never updated" %} }}</dd>
{% endif %}
</dl>
</div>
<div class="specs row detail">
<h4>{% trans "Specs" %}</h4>
<hr class="header_rule">
<dl class="dl-horizontal">
@ -62,9 +56,7 @@
<dd>{{ image.min_ram|mb_float_format }}</dd>
{% endif %}
</dl>
</div>
<div class="properties row detail">
<h4>{% trans "Custom Properties" %}</h4>
<hr class="header_rule">
<dl class="dl-horizontal">

View File

@ -1,12 +0,0 @@
{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans "Image Details"%}{% endblock %}
{% block main %}
<div class="row">
<div class="col-sm-12">
{{ tab_group.render }}
</div>
</div>
{% endblock %}

View File

@ -1,11 +1,7 @@
{% load i18n sizeformat %}
{% load url from future %}
<h3>{% trans "Instance Overview" %}</h3>
<div class="status detail">
<h4>{% trans "Information" %}</h4>
<hr class="header_rule">
<div class="detail">
<dl class="dl-horizontal">
<dt>{% trans "Name" %}</dt>
<dd>{{ instance.name }}</dd>
@ -24,10 +20,8 @@
<dd>{{ instance.host_server|default:_("-") }}</dd>
{% endif %}
</dl>
</div>
{% if instance.fault %}
<div class="status detail">
{% if instance.fault %}
<h4>{% trans "Fault" %}</h4>
<hr class="header_rule">
<dl class="dl-horizontal">
@ -40,10 +34,8 @@
<dt>{% trans "Created" %}</dt>
<dd>{{ instance.fault.created|parse_isotime }}</dd>
</dl>
</div>
{% endif %}
{% endif %}
<div class="specs detail">
<h4>{% trans "Specs" %}</h4>
<hr class="header_rule">
<dl class="dl-horizontal">
@ -67,9 +59,7 @@
<dd>{% trans "Not available" %}</dd>
{% endif %}
</dl>
</div>
<div class="addresses detail">
<h4>{% trans "IP Addresses" %}</h4>
<hr class="header_rule">
<dl class="dl-horizontal">
@ -82,9 +72,7 @@
</dd>
{% endfor %}
</dl>
</div>
<div class="security_groups detail">
<h4>{% trans "Security Groups" %}</h4>
<hr class="header_rule">
<dl class="dl-horizontal">
@ -103,9 +91,7 @@
{% trans "Not available" %}
{% endfor %}
</dl>
</div>
<div class="meta detail">
<h4>{% trans "Metadata" %}</h4>
<hr class="header_rule">
<dl class="dl-horizontal">
@ -130,9 +116,7 @@
{% endfor %}
{% endwith %}
</dl>
</div>
<div class="volumes detail">
<h4>{% trans "Volumes Attached" %}</h4>
<hr class="header_rule">
<dl class="dl-horizontal">

View File

@ -1,11 +0,0 @@
{% extends 'base.html' %}
{% load i18n sizeformat %}
{% block title %}{% trans "Instance Details" %}{% endblock %}
{% block main %}
<div class="row">
<div class="col-sm-12">
{{ tab_group.render }}
</div>
</div>
{% endblock %}

View File

@ -290,9 +290,9 @@ class DecryptPasswordView(forms.ModalFormView):
class DetailView(tabs.TabView):
tab_group_class = project_tabs.InstanceDetailTabs
template_name = 'project/instances/detail.html'
template_name = 'horizon/common/_detail.html'
redirect_url = 'horizon:project:instances:index'
page_title = _("Instance Details: {{ instance.name }}")
page_title = "{{ instance.name|default:instance.id }}"
image_url = 'horizon:project:images:images:detail'
volume_url = 'horizon:project:volumes:volumes:detail'

View File

@ -52,7 +52,7 @@ class NetworkPortTests(test.TestCase):
res = self.client.get(reverse(DETAIL_URL, args=[port.id]))
self.assertTemplateUsed(res, 'project/networks/ports/detail.html')
self.assertTemplateUsed(res, 'horizon/common/_detail.html')
self.assertEqual(res.context['port'].id, port.id)
@test.create_stubs({api.neutron: ('port_get',)})

View File

@ -35,8 +35,8 @@ STATUS_DICT = dict(project_tables.STATUS_DISPLAY_CHOICES)
class DetailView(tabs.TabView):
tab_group_class = project_tabs.PortDetailTabs
template_name = 'project/networks/ports/detail.html'
page_title = _("Port Details")
template_name = 'horizon/common/_detail.html'
page_title = "{{ port.name|default:port.id }}"
@memoized.memoized_method
def get_data(self):
@ -60,11 +60,32 @@ class DetailView(tabs.TabView):
return port
@memoized.memoized_method
def get_network(self, network_id):
try:
network = api.neutron.network_get(self.request, network_id)
except Exception:
network = {}
msg = _('Unable to retrieve network details.')
exceptions.handle(self.request, msg)
return network
def get_context_data(self, **kwargs):
context = super(DetailView, self).get_context_data(**kwargs)
port = self.get_data()
network = self.get_network(port.network_id)
port.network_name = network.get('name')
network_nav = port.network_name or port.network_id
table = project_tables.PortsTable(self.request,
network_id=port.network_id)
# TODO(robcresswell) Add URL for "Ports" crumb after bug/1416838
breadcrumb = [
("Networks", self.get_redirect_url()),
(network_nav, reverse('horizon:project:networks:detail',
args=(port.network_id,))),
("Ports",), ]
context["custom_breadcrumb"] = breadcrumb
context["port"] = port
context["url"] = self.get_redirect_url()
context["actions"] = table.render_row_actions(port)

View File

@ -99,8 +99,8 @@ class UpdateView(workflows.WorkflowView):
class DetailView(tabs.TabView):
tab_group_class = project_tabs.SubnetDetailTabs
template_name = 'project/networks/subnets/detail.html'
page_title = _("Subnet Details")
template_name = 'horizon/common/_detail.html'
page_title = "{{ subnet.name|default:subnet.id }}"
@memoized.memoized_method
def get_data(self):
@ -128,11 +128,32 @@ class DetailView(tabs.TabView):
return subnet
@memoized.memoized_method
def get_network(self, network_id):
try:
network = api.neutron.network_get(self.request, network_id)
except Exception:
network = {}
msg = _('Unable to retrieve network details.')
exceptions.handle(self.request, msg)
return network
def get_context_data(self, **kwargs):
context = super(DetailView, self).get_context_data(**kwargs)
subnet = self.get_data()
network = self.get_network(subnet.network_id)
subnet.network_name = network.get('name')
network_nav = subnet.network_name or subnet.network_id
table = project_tables.SubnetsTable(self.request,
network_id=subnet.network_id)
# TODO(robcresswell) Add URL for "Subnets" crumb after bug/1416838
breadcrumb = [
("Networks", self.get_redirect_url()),
(network_nav, reverse('horizon:project:networks:detail',
args=(subnet.network_id,))),
("Subnets",), ]
context["custom_breadcrumb"] = breadcrumb
context["subnet"] = subnet
context["url"] = self.get_redirect_url()
context["actions"] = table.render_row_actions(subnet)

View File

@ -7,6 +7,8 @@
<dd>{{ port.name|default:_("None") }}</dd>
<dt>{% trans "ID" %}</dt>
<dd>{{ port.id|default:_("None") }}</dd>
<dt>{% trans "Network Name" %}</dt>
<dd>{{ port.network_name|default:_("None") }}</dd>
{% url 'horizon:project:networks:detail' port.network_id as network_url %}
<dt>{% trans "Network ID" %}</dt>
<dd><a href="{{ network_url }}">{{ port.network_id|default:_("None") }}</a></dd>
@ -19,9 +21,12 @@
<dt>{% trans "Admin State" %}</dt>
<dd>{{ port.admin_state_label|default:_("None") }}</dd>
{% if port.mac_state %}
<dt>{% trans "MAC Learning State" %}</dt>
<dd>{{ port.mac_state }}</dd>
<dt>{% trans "MAC Learning State" %}</dt>
<dd>{{ port.mac_state }}</dd>
{% endif %}
</dl>
<dl class="dl-horizontal">
<h4>{% trans "Fixed IP" %}</h4>
<hr class="header_rule">
{% if port.fixed_ips.items|length > 1 %}
@ -35,6 +40,9 @@
{% else %}
<dd>{% trans "None" %}</dd>
{% endif %}
</dl>
<dl class="dl-horizontal">
<h4>{% trans "Attached Device" %}</h4>
<hr class="header_rule">
{% if port.device_id|length > 1 or port.device_owner %}
@ -45,6 +53,9 @@
{% else %}
<dd>{% trans "No attached device" %}</dd>
{% endif %}
</dl>
<dl class="dl-horizontal">
<h4>{% trans "Binding" %}</h4>
<hr class="header_rule">
{% if port.binding__vnic_type %}

View File

@ -1,11 +0,0 @@
{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans "Port Details"%}{% endblock %}
{% block main %}
<div id="row">
<div class="col-sm-12">
{{ tab_group.render }}
</div>
</div>
{% endblock %}

View File

@ -1,16 +1,14 @@
{% load i18n sizeformat %}
{% load url from future %}
<h3>{% trans "Subnet Overview" %}</h3>
<div class="info row detail">
<h4>{% trans "Subnet" %}</h4>
<hr class="header_rule">
<div class="detail">
<dl class="dl-horizontal">
<dt>{% trans "Name" %}</dt>
<dd>{{ subnet.name|default:_("None") }}</dd>
<dt>{% trans "ID" %}</dt>
<dd>{{ subnet.id|default:_("None") }}</dd>
<dt>{% trans "Network Name" %}</dt>
<dd>{{ subnet.network_name|default:_("None") }}</dd>
{% url 'horizon:project:networks:detail' subnet.network_id as network_url %}
<dt>{% trans "Network ID" %}</dt>
<dd><a href="{{ network_url }}">{{ subnet.network_id|default:_("None") }}</a></dd>

View File

@ -1,11 +0,0 @@
{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans "Subnet Details"%}{% endblock %}
{% block main %}
<div id="row">
<div class="col-sm-12">
{{ tab_group.render }}
</div>
</div>
{% endblock %}

View File

@ -922,7 +922,7 @@ class NetworkSubnetTests(test.TestCase):
args=[subnet.id])
res = self.client.get(url)
self.assertTemplateUsed(res, 'project/networks/subnets/detail.html')
self.assertTemplateUsed(res, 'horizon/common/_detail.html')
self.assertEqual(res.context['subnet'].id, subnet.id)
@test.create_stubs({api.neutron: ('subnet_get',)})

View File

@ -99,14 +99,8 @@ class VolumeBackupsViewTests(test.TestCase):
args=[backup.id])
res = self.client.get(url)
self.assertContains(res,
"<h1>Volume Backup Details: %s</h1>" %
backup.name,
1, 200)
self.assertContains(res, "<dd>%s</dd>" % backup.name, 1, 200)
self.assertContains(res, "<dd>%s</dd>" % backup.id, 1, 200)
self.assertContains(res, "<dd>Available</dd>", 1, 200)
self.assertContains(res, "<dt>Volume</dt>", 1, 200)
self.assertTemplateUsed(res, 'horizon/common/_detail.html')
self.assertEqual(res.context['backup'].id, backup.id)
@test.create_stubs({api.cinder: ('volume_backup_get',)})
def test_volume_backup_detail_get_with_exception(self):
@ -140,14 +134,8 @@ class VolumeBackupsViewTests(test.TestCase):
args=[backup.id])
res = self.client.get(url)
self.assertContains(res,
"<h1>Volume Backup Details: %s</h1>" %
backup.name,
1, 200)
self.assertContains(res, "<dd>%s</dd>" % backup.name, 1, 200)
self.assertContains(res, "<dd>%s</dd>" % backup.id, 1, 200)
self.assertContains(res, "<dd>Available</dd>", 1, 200)
self.assertContains(res, "<dt>Volume</dt>", 0, 200)
self.assertTemplateUsed(res, 'horizon/common/_detail.html')
self.assertEqual(res.context['backup'].id, backup.id)
@test.create_stubs({api.cinder: ('volume_list',
'volume_backup_restore',)})

View File

@ -50,8 +50,8 @@ class CreateBackupView(forms.ModalFormView):
class BackupDetailView(tabs.TabView):
tab_group_class = backup_tabs.BackupDetailTabs
template_name = 'project/volumes/backups/detail.html'
page_title = _("Volume Backup Details: {{ backup.name }}")
template_name = 'horizon/common/_detail.html'
page_title = "{{ backup.name|default:backup.id }}"
def get_context_data(self, **kwargs):
context = super(BackupDetailView, self).get_context_data(**kwargs)

View File

@ -151,13 +151,8 @@ class VolumeSnapshotsViewTests(test.TestCase):
args=[snapshot.id])
res = self.client.get(url)
self.assertContains(res,
"<h1>Volume Snapshot Details: %s</h1>" %
snapshot.name,
1, 200)
self.assertContains(res, "<dd>test snapshot</dd>", 1, 200)
self.assertContains(res, "<dd>%s</dd>" % snapshot.id, 1, 200)
self.assertContains(res, "<dd>Available</dd>", 1, 200)
self.assertTemplateUsed(res, 'horizon/common/_detail.html')
self.assertEqual(res.context['snapshot'].id, snapshot.id)
@test.create_stubs({api.cinder: ('volume_snapshot_get',)})
def test_volume_snapshot_detail_get_with_exception(self):

View File

@ -67,8 +67,8 @@ class UpdateView(forms.ModalFormView):
class DetailView(tabs.TabView):
tab_group_class = vol_snapshot_tabs.SnapshotDetailTabs
template_name = 'project/volumes/snapshots/detail.html'
page_title = _("Volume Snapshot Details: {{ snapshot.name }}")
template_name = 'horizon/common/_detail.html'
page_title = "{{ snapshot.name|default:snapshot.id }}"
def get_context_data(self, **kwargs):
context = super(DetailView, self).get_context_data(**kwargs)

View File

@ -1,13 +1,7 @@
{% load i18n sizeformat parse_date %}
{% load url from future %}
<h3>
{% blocktrans with backup_display_name=backup.display_name %}Volume Backup Overview: {{ backup_display_name }}{% endblocktrans %}
</h3>
<div class="info row detail">
<h4>{% trans "Information" %}</h4>
<hr class="header_rule">
<div class="detail">
<dl class="dl-horizontal">
<dt>{% trans "Name" %}</dt>
<dd>{{ backup.name }}</dd>
@ -28,9 +22,7 @@
</dd>
{% endif %}
</dl>
</div>
<div class="specs row detail">
<h4>{% trans "Specs" %}</h4>
<hr class="header_rule">
<dl class="dl-horizontal">
@ -39,10 +31,7 @@
<dt>{% trans "Created" %}</dt>
<dd>{{ backup.created_at|parse_date }}</dd>
</dl>
</div>
<div class="status row detail">
<h4>{% trans "Metadata" %}</h4>
<hr class="header_rule">
<dl class="dl-horizontal">

View File

@ -1,11 +0,0 @@
{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans "Volume Backup Details" %}{% endblock %}
{% block main %}
<div class="row">
<div class="col-sm-12">
{{ tab_group.render }}
</div>
</div>
{% endblock %}

View File

@ -1,11 +1,7 @@
{% load i18n sizeformat parse_date %}
{% load url from future %}
<h3>{% trans "Volume Snapshot Overview" %}</h3>
<div class="info row detail">
<h4>{% trans "Information" %}</h4>
<hr class="header_rule">
<div class="detail">
<dl class="dl-horizontal">
<dt>{% trans "Name" %}</dt>
<dd>{{ snapshot.name }}</dd>
@ -28,9 +24,7 @@
</a>
</dd>
</dl>
</div>
<div class="specs row detail">
<h4>{% trans "Specs" %}</h4>
<hr class="header_rule">
<dl class="dl-horizontal">

View File

@ -1,11 +0,0 @@
{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans "Volume Snapshot Details" %}{% endblock %}
{% block main %}
<div class="row">
<div class="col-sm-12">
{{ tab_group.render }}
</div>
</div>
{% endblock %}

View File

@ -1,11 +1,7 @@
{% load i18n sizeformat parse_date %}
{% load url from future %}
<h3>{% trans "Volume Overview" %}</h3>
<div class="info row detail">
<h4>{% trans "Information" %}</h4>
<hr class="header_rule">
<div class="detail">
<dl class="dl-horizontal">
<dt>{% trans "Name" %}</dt>
<dd>{{ volume.name }}</dd>
@ -18,9 +14,7 @@
<dt>{% trans "Status" %}</dt>
<dd>{{ volume.status_label|capfirst }}</dd>
</dl>
</div>
<div class="specs row detail">
<h4>{% trans "Specs" %}</h4>
<hr class="header_rule">
<dl class="dl-horizontal">
@ -29,9 +23,7 @@
<dt>{% trans "Created" context "Created time" %}</dt>
<dd>{{ volume.created_at|parse_date }}</dd>
</dl>
</div>
<div class="status row detail">
<h4>{% trans "Attachments" %}</h4>
<hr class="header_rule">
<dl class="dl-horizontal">
@ -48,10 +40,8 @@
<dd><em>{% trans "Not attached" %}</em></dd>
{% endfor %}
</dl>
</div>
{% if volume.volume_image_metadata %}
<div class="status row detail">
<h4>{% trans "Volume Source" %}</h4>
<hr class="header_rule">
<dl class="dl-horizontal">
@ -61,10 +51,8 @@
<a href="{{ image_url }}">{{ volume.volume_image_metadata.image_name }}</a>
</dd>
</dl>
</div>
{% endif %}
<div class="status row detail">
<h4>{% trans "Metadata" %}</h4>
<hr class="header_rule">
<dl class="dl-horizontal">
@ -77,10 +65,8 @@
<dd>{% trans "None" %}</dd>
{% endif %}
</dl>
</div>
{% if volume.transfer %}
<div class="status row detail">
<h4>{% trans "Volume Transfer" %}</h4>
<hr class="header_rule">
<dl>
@ -95,5 +81,5 @@
<dt>{% trans "Created" context "Created time" %}</dt>
<dd>{{ volume.transfer.created_at|parse_date }}</dd>
</dl>
</div>
{% endif %}
</div>

View File

@ -1,11 +0,0 @@
{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans "Volume Details" %}{% endblock %}
{% block main %}
<div class="row">
<div class="col-sm-12">
{{ tab_group.render }}
</div>
</div>
{% endblock %}

View File

@ -1115,18 +1115,8 @@ class VolumeViewTests(test.TestCase):
args=[volume.id])
res = self.client.get(url)
self.assertContains(res, "<h1>Volume Details: Volume name</h1>",
1, 200)
self.assertContains(res, "<dd>Volume name</dd>", 1, 200)
self.assertContains(res, "<dd>%s</dd>" % volume.id, 1, 200)
self.assertContains(res, "<dd>Available</dd>", 1, 200)
self.assertContains(res, "<dd>40 GB</dd>", 1, 200)
self.assertContains(res,
("<a href=\"/project/instances/1/\">%s</a>"
% server.name),
1,
200)
self.assertTemplateUsed(res, 'horizon/common/_detail.html')
self.assertEqual(res.context['volume'].id, volume.id)
self.assertNoMessages()
@test.create_stubs({cinder: ('volume_get',

View File

@ -47,8 +47,8 @@ from openstack_dashboard.dashboards.project.volumes \
class DetailView(tabs.TabView):
tab_group_class = project_tabs.VolumeDetailTabs
template_name = 'project/volumes/volumes/detail.html'
page_title = _("Volume Details: {{ volume.name }}")
template_name = 'horizon/common/_detail.html'
page_title = "{{ volume.name|default:volume.id }}"
def get_context_data(self, **kwargs):
context = super(DetailView, self).get_context_data(**kwargs)

View File

@ -1155,7 +1155,7 @@ div .flavor_table {
}
.header_rule {
margin: 0 0 10px;
margin: 0 0 8px;
}
.item_detail .detail_section {
@ -1887,15 +1887,27 @@ a:hover.link-popover { text-decoration: none; }
}
/**** Details Override ****/
.detail ul {
padding-left: 0;
.page-header > .breadcrumb {
font-size: $font-size-h3;
margin-bottom: 0;
.actions_column {
padding: 0;
}
}
.detail dt {
text-align: left;
.detail {
ul {
padding-left: 0;
}
dt, dd {
text-align: left;
line-height: $line-height-small;
}
}
input::-ms-clear, input::-ms-reveal{
input::-ms-clear, input::-ms-reveal {
display: none;
}

View File

@ -772,13 +772,13 @@ $badge-border-radius: 10px !default;
//##
$breadcrumb-padding-vertical: 8px !default;
$breadcrumb-padding-horizontal: 15px !default;
$breadcrumb-padding-horizontal: 10px !default;
//** Breadcrumb background color
$breadcrumb-bg: #f5f5f5 !default;
$breadcrumb-bg: $body-bg !default;
//** Breadcrumb text color
$breadcrumb-color: #ccc !default;
$breadcrumb-color: $gray !default;
//** Text color of current page in the breadcrumb
$breadcrumb-active-color: $gray-light !default;
$breadcrumb-active-color: $gray !default;
//** Textual separator for between breadcrumb elements
$breadcrumb-separator: "/" !default;