Rewrite of navigation controller to reduce re-render counter.

This commit is contained in:
Martin Edenhofer 2014-08-26 14:00:17 +02:00
parent 561570834f
commit a2aa99e9fd
2 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,20 @@
<% for item in @items: %>
<% if item.child: %>
<li class="dropdown <% if @open_tab[item.target] : %>open<% end %>">
<a href="<%= item.target %>" class="dropdown-toggle" data-toggle="dropdown"><%- @T( item.name ) %> <b class="caret"></b></a>
<ul class="dropdown-menu">
<% for item in item.child: %>
<% if item.divider: %>
<li class="divider"></li>
<% end %>
<% if item.navheader: %>
<li class="dropdown-header"><%- @T( item.navheader ) %></li>
<% end %>
<li class="<% if @active_tab[item.target] : %>active<% end %>"><a href="<%= item.target %>"><%- @T( item.name ) %><% if item['count'] isnt undefined: %><span class="badge count"><%= item['count'] %></span><% end %></a></li>
<% end %>
</ul>
</li>
<% else: %>
<li class="<% if @active_tab[item.target] : %>active<% end %>"><a href="<%= item.target %>"><%- @T( item.name ) %></a></li>
<% end %>
<% end %>

View file

@ -0,0 +1,20 @@
<% for item in @items: %>
<% if item.child: %>
<li class="dropdown <% if @open_tab[item.target] : %>open<% end %> navbar-private">
<a href="<%= item.target %>" class="dropdown-toggle" data-toggle="dropdown"><%- @T( item.name ) %> <b class="caret"></b></a>
<ul class="dropdown-menu">
<% for item in item.child: %>
<% if item.divider: %>
<li class="divider"></li>
<% end %>
<% if item.navheader: %>
<li class="dropdown-header"><%- @T( item.navheader ) %></li>
<% end %>
<li class="<% if @active_tab[item.target] : %>active<% end %>"><a href="<%= item.target %>"><%- @T( item.name ) %><% if item['count'] isnt undefined: %><span class="badge count"><%= item['count'] %>)</span><% end %></a></li>
<% end %>
</ul>
</li>
<% else: %>
<li class="<% if @active_tab[item.target] : %>active<% end %>"><a href="<%= item.target %>"><%- @T( item.name ) %></a></li>
<% end %>
<% end %>