luci/modules/luci-base/luasrc/view/cbi/tabcontainer.htm
Jo-Philipp Wich 76e9c0305e luci-base: rework ui tabbing code
- Instantiate tab menus on the client side
 - Simplify server side markup generation
 - Show error indicators in cbi tabs

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-12-10 13:41:34 +01:00

14 lines
478 B
HTML

<% for _, tab in ipairs(self.tab_names) do data = self.tabs[tab] %>
<div class="cbi-tabcontainer"<%=
attr("id", "container.%s.%s.%s" %{ self.config, section, tab }) ..
attr("data-tab", tab) ..
attr("data-tab-title", data.title) ..
attr("data-tab-active", tostring(tab == self.selected_tab))
%>>
<% if data.description then %>
<div class="cbi-tab-descr"><%=data.description%></div>
<% end %>
<% self:render_tab(tab, section, scope or {}) %>
</div>
<% end %>