div.editor_parent(:id => @tiddler.editor_id,
                  :style => (!@tiddler.id or @tiddler.id > 0) ? "display: none" : "display: block") do
  div.editor :onclick => "stopEvent(event)", :ondblclick => "stopEvent(event)" do
    input :type => "text", :id => @tiddler.editor_title_id,
          :name => "tiddler[title]", :autocomplete => "off",
          :onclick => "stopEvent", :ondblclick => "stopEvent",
          :value => ERB::Util.html_escape(@tiddler.title)
  end
  
  div.editor :onclick => "stopEvent(event)", :ondblclick => "stopEvent(event)" do
    fieldset.fieldset_fix do
      div do
        textarea(:id => @tiddler.editor_content_id,
                 :name => "tiddler[content]", :rows => textarea_rows(@tiddler),
                 :onclick => "stopEvent", :ondblclick => "stopEvent") do
          h @tiddler.content
        end
      end
    end
  end
  
  table.editor_opt :onclick => "stopEvent(event)", :ondblclick => "stopEvent(event)" do
    tr do
      th do
        label(:for => "aliases") { _("aliases_label") + ":" }
      end
      td do
        input :type => "text", :id => "aliases", :name => "aliases", :size => 25,
              :value => ERB::Util.html_escape(@tiddler.alias_names_str)
      end
      
      td do
        "&nbsp;"
      end
    
      th do
        span(:id => @tiddler.colorbox_id, :class => colorbox_class(@tiddler)) { "&nbsp;" }
      end
      td do
        select :name => "tiddler[color]", :id => @tiddler.color_select_id,
               :onchange => "colorBoxChange('#{@tiddler.colorbox_id}', '#{@tiddler.color_select_id}')" do
          color_options_for_select(@tiddler.color)
        end
      end
    end
    
    tr do
      th do
        label(:for => "tags") { _("tags_label") + ":" }
      end
      td do
        input :type => "text", :id => "tags", :name => "tags", :size => 25,
              :value => ERB::Util.html_escape(@tiddler.tag_names_str)
      end
      
      td do
        "&nbsp;"
      end
      
      th do
        if @tiddler.autolink?
          input :type => "checkbox", :name => "tiddler[autolink]", :value => 1,
                :checked => "checked"
        else
          input :type => "checkbox", :name => "tiddler[autolink]", :value => 1
        end
      end
      td do
        span { _("autolink_label") }
      end
    end
  end
    
  div.editor_footer do
    _("editor_footer")
  end
  
  if @tiddler.id and @tiddler.id > 0
    input :type => "hidden", :name => "id", :value => @tiddler.id
  end
  input :type => "hidden", :name => "digest", :value => @tiddler.digest
  
  input :type => "submit", :id => @tiddler.editor_submit_id, :style => "display: none"
end
