From e7860b2aeacb6eb84c6d594df384e2a075971cd2 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sat, 7 Jan 2012 19:36:26 +0000 Subject: [PATCH] make table cells clickable with hyperlink callback --- Netdisco/lib/Netdisco/Web.pm | 6 +++++- Netdisco/public/css/style.css | 8 ++++++++ Netdisco/views/content/vlan.tt | 4 ++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Netdisco/lib/Netdisco/Web.pm b/Netdisco/lib/Netdisco/Web.pm index 2b0ce191..0a9d1f83 100644 --- a/Netdisco/lib/Netdisco/Web.pm +++ b/Netdisco/lib/Netdisco/Web.pm @@ -35,11 +35,15 @@ ajax '/ajax/content/search/vlan' => sub { results => $set, columns => [ { key => 'dns', label => 'Device' }, - { key => [qw/vlan description/], label => 'Description' }, + { key => 'vlan.description', label => 'Description' }, { key => 'model', label => 'Model' }, { key => 'os', label => 'OS' }, { key => 'vendor', label => 'Vendor' }, ], + hyperlink => sub { + my $row = shift; + return '/device?q=' . $row->ip; + }, }, { layout => undef }; }; diff --git a/Netdisco/public/css/style.css b/Netdisco/public/css/style.css index 3f1fe4a4..e974e106 100644 --- a/Netdisco/public/css/style.css +++ b/Netdisco/public/css/style.css @@ -32,3 +32,11 @@ .nd_search { margin-top: 15px; } + +.nd_linkcell { + text-decoration: none !important; + color: #404040; + display: block; + padding: 0px; + height: 100%; +} diff --git a/Netdisco/views/content/vlan.tt b/Netdisco/views/content/vlan.tt index 0d3bca92..576b0778 100644 --- a/Netdisco/views/content/vlan.tt +++ b/Netdisco/views/content/vlan.tt @@ -11,10 +11,10 @@ [% FOREACH col IN columns %] [% SET val = row %] - [% FOREACH method IN col.key %] + [% FOREACH method IN col.key.split('\.') %] [% SET val = val.$method %] [% END %] - [% val %] + [% val %] [% END %] [% END %]