change id for tag in navbar plugins

This commit is contained in:
Oliver Gorwits
2013-03-10 18:29:57 +00:00
parent f513000f08
commit b818d4156f
3 changed files with 4 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ register 'register_template_path' => sub {
register 'register_navbar_item' => sub {
my ($self, $config) = plugin_args(@_);
if (!length $config->{id}
if (!length $config->{tag}
or !length $config->{path}
or !length $config->{label}) {
@@ -39,7 +39,7 @@ register 'register_navbar_item' => sub {
}
foreach my $item (@{ setting('navbar_items') }) {
if ($item->{id} eq $config->{id}) {
if ($item->{tag} eq $config->{tag}) {
$item = $config;
return;
}

View File

@@ -6,7 +6,7 @@ use Dancer::Plugin::DBIC;
use App::Netdisco::Web::Plugin;
register_navbar_item({
id => 'inventory',
tag => 'inventory',
path => '/inventory',
label => 'Inventory',
});

View File

@@ -52,7 +52,7 @@
[% IF session.user %]
<ul class="nav">
[% FOREACH ni IN settings.navbar_items %]
<li[% ' class="active"' IF vars.nav == ni.id %]>
<li[% ' class="active"' IF vars.nav == ni.tag %]>
<a href="[% uri_for(ni.path) %]">[% ni.label | html_entity %]</a>
</li>
[% END %]