div(:id => "sidebar_tabs") do
  if @permission
    cache :action => "sidebar" do
      div.txt_main_tab do
        div.tabset do
          a(:id => "tab_timeline", :class => "tab tab_selected", :href => 'javascript:;') {
            _("tab_timeline")
          }.strip_newline
          
          a(:id => "tab_colors", :class => "tab tab_unselected", :href => 'javascript:;') {
            _("tab_colors")
          }.strip_newline
          
          a(:id => "tab_tags", :class => "tab tab_unselected", :href => 'javascript:;') {
            _("tab_tags")
          }.strip_newline
        end
        
        div.tab_contents(:id => "tab_contents") do
          div(:id => "sidebar_timeline") do
            render :partial => "sidebar_timeline"
          end
          
          div(:id => "sidebar_colors", :style => "display: none") do
            render :partial => "sidebar_colors"
          end
          
          div(:id => "sidebar_tags", :style => "display: none") do
            render :partial => "sidebar_tags"
          end
        end
      end
      
      div(:id => "sidebar_loading", :style => "display: none") do
        div do
          img :class => "loading", :src => "/images/spinner.gif", :alt => "..."
          span.loading { _("loading") }
        end
      end
      
      out sidebar_tabs_handler
    end
  end
end
