out render :partial => "search_toolbar"

div.title do
  span do
    h @search.search
  end
end

div.tagging(:id => @search.tagging_id) do
  ul do
    li.list_title _("search_result_title")
    @search.tiddlers.each do |tiddler|
      json_data = {
        :current_tiddler => @search.element_id,
        :new_tiddler => tiddler.element_id,
        :title => tiddler.title,
        :color => tiddler.color_name,
        :url => url_for(:action => "view", :id => tiddler.id)
      }.to_json
      
      li do
        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
end

div.viewer do
end

div.tag_clear {}

out search_toolbar_handler(@search)
