class Tabulous::BootstrapRenderer

Public Instance Methods

tabs_html() click to toggle source
# File lib/tabulous/renderers/bootstrap_renderer.rb, line 6
    def tabs_html
      <<-HTML.strip_heredoc
        <ul class="nav nav-tabs">
          #{ tab_list_html }
        </ul>
      HTML
    end

Protected Instance Methods

tab_html(tab) click to toggle source
# File lib/tabulous/renderers/bootstrap_renderer.rb, line 16
def tab_html(tab)
  return '' unless tab.visible?(@view)
  html = ''
  klass = ''
  klass << 'active' if tab.active?(@view)
  klass << ' disabled' unless tab.enabled?(@view)
  klass << ' dropdown' if tab.subtabs.any?
  klass.strip!
  if klass.empty?
    html << '<li>'
  else
    html << %Q{<li class="#{klass}">}
  end
  if tab.subtabs.empty?
    html << tab_link(tab)
  else
    html << tab_link_with_subtabs(tab)
  end
  html << "</li>"
  html
end