if @permission
  ul do    
    date = nil
    @timeline_tiddlers.each do |tiddler|
      # display updated date
      if date != local_date(tiddler.updated_at)
        date = local_date(tiddler.updated_at)
        li.list_title date
      end
      
      # link to the tiddler
      li.list_link do
        json_data = {
          :current_tiddler => "tiddler_0",
          :new_tiddler => tiddler.element_id,
          :title => tiddler.title,
          :color => tiddler.color_name,
          :url => url_for(:action => "view", :id => tiddler.id)
        }.to_json
        
        a :href => "javascript:;",
          :class => "tiddly_link_existing color_#{tiddler.color_name}",
          :title => tiddler.adjusted_updated_at,
          :onclick => "openTiddler('#{ERB::Util.html_escape(json_data)}')" do
          h tiddler.title
        end
      end
    end
  end
  
  out sidebar_tab_page(@timeline_pages, "timeline_page")
end
