From 187785b28d7cfeb3fb4f87b67d71bc3dcf1f1354 Mon Sep 17 00:00:00 2001 From: John Postlethwait Date: Wed, 6 Jun 2012 14:36:59 -0700 Subject: [PATCH] Adding block links in table cells. Fixes bug #999303 Change-Id: I09a379fbe8afd042a43db99c974c7a8d104de3d3 --- horizon/tables/base.py | 2 ++ horizon/tests/table_tests.py | 2 +- openstack_dashboard/static/dashboard/css/style.css | 9 ++++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/horizon/tables/base.py b/horizon/tables/base.py index bf44b4b2a..940fab6cc 100644 --- a/horizon/tables/base.py +++ b/horizon/tables/base.py @@ -214,6 +214,8 @@ class Column(html.HTMLElement): self.classes.append("sortable") if self.hidden: self.classes.append("hide") + if self.link is not None: + self.classes.append('anchor') def __unicode__(self): return unicode(self.verbose_name) diff --git a/horizon/tests/table_tests.py b/horizon/tests/table_tests.py index df224db37..701fee1fa 100644 --- a/horizon/tests/table_tests.py +++ b/horizon/tests/table_tests.py @@ -341,7 +341,7 @@ class DataTableTests(test.TestCase): self.assertEqual(row3.cells['optional'].value, "N/A") # classes self.assertEqual(value_col.get_final_attrs().get('class', ""), - "green blue sortable") + "green blue sortable anchor") # status cell_status = row.cells['status'].status self.assertEqual(cell_status, True) diff --git a/openstack_dashboard/static/dashboard/css/style.css b/openstack_dashboard/static/dashboard/css/style.css index 560c106b7..89205e48c 100644 --- a/openstack_dashboard/static/dashboard/css/style.css +++ b/openstack_dashboard/static/dashboard/css/style.css @@ -372,6 +372,10 @@ a.current_item:hover h3, a.current_item:hover h4 { .table th.header:hover { background-color: #e8e8e8; } +.table tbody td.anchor a { + display: block; + padding: 8px; +} .table tr.table_caption th.header:hover { background-color: transparent; cursor: default; @@ -396,6 +400,9 @@ a.current_item:hover h3, a.current_item:hover h4 { th { background: #f1f1f1; } +td.anchor { + padding: 0; +} small { @@ -555,7 +562,7 @@ table form { font-family: "anivers"; } -#monitoring h3{ +#monitoring h3 { font-size: 14px; font-weight: normal; float: left;