cache_if !Tiddler.cannot_save_titles.include?(@tiddler.title) && !@conflict,
         :action => "view", :id => @tiddler.id do

  out tiddler_form @tiddler
  
  out render :partial => "toolbar"
  
  div(:class => tiddler_title_class(@tiddler)) do
    span tiddler_title(@tiddler)
    span do
      img :id => @tiddler.loading_id, :src => "/images/spinner.gif",
          :alt => "...", :style => "display: none"
    end
  end
  
  if !@tiddler.id or @tiddler.id > 0
    div.subtitle(:id => @tiddler.subtitle_id) do
      span do
        @tiddler.author
      end
      span do
        tiddler_date(@tiddler)
      end
    end
  
    div.tagged(:id => @tiddler.tagged_id) do
      ul do
        if @tiddler.tags.empty?
          li.list_title _("no_tags")
        else
          li.list_title _("tags_title") + ":"
          @tiddler.tags.sort_by {|t| t.name }.each do |tag|
            json_data = {
              :current_tiddler => @tiddler.element_id,
              :tag_element => tag.element_id,
              :tag_name => tag.name,
              :url => url_for(:action => "view_tag", :id => tag.id)
            }.to_json
            
            li do
              a.button(:href => "javascript:;",
                       :onclick => "openTag('#{ERB::Util.html_escape(json_data)}')") do
                h(tag.name)
              end
            end
          end
        end
      end
    end
  end
  
  if !@tiddler.id or @tiddler.id > 0
    div.viewer(:id => @tiddler.viewer_id) do
      @tiddler.rendered_content(WikiRenderer.instance)
    end
  end
  
  div.tag_clear {}
  
  if @conflict
    out render :partial => "conflict"
  end
  
  out render :partial => "editor"
  
  out end_tiddler_form
  
  out tiddler_event_listener @tiddler
  
end  # cache_if
