div.toolbar(:id => @tiddler.toolbar_id) do
  if !@tiddler.id or @tiddler.id > 0
    a(:class => "button view_toolbar", :href => 'javascript:;',
      :id => @tiddler.toolbar_close_id) do
      _("toolbar_close")
    end
    
    a(:class => "button view_toolbar", :href => 'javascript:;',
      :id => @tiddler.toolbar_close_others_id) do
      _("toolbar_close_others")
    end
  end
  
  if @tiddler.id
    if @tiddler.id > 0
      str = @session[:login] ? _("toolbar_edit") : _("toolbar_source")
      a(:class => "button view_toolbar", :href => 'javascript:;',
        :id => @tiddler.toolbar_edit_id) do
        str
      end
      
      a(:class => "button view_toolbar", :href => 'javascript:;',
        :id => @tiddler.toolbar_permalink_id) do
        _("toolbar_permalink")
      end
    end
  end

  a(:class => "button edit_toolbar", :href => 'javascript:;',
    :id => @tiddler.toolbar_done_id,
    :style => (!@tiddler.id or @tiddler.id > 0) ? "display: none" : "display: inline") do
    _("toolbar_done")
  end
    
  a(:class => "button edit_toolbar", :href => 'javascript:;',
    :id => @tiddler.toolbar_cancel_id,
    :style => (!@tiddler.id or @tiddler.id > 0) ? "display: none" : "display: inline") do
    _("toolbar_cancel")
  end
  
  if !@tiddler.id or @tiddler.id > 0
    a(:class => "button edit_toolbar", :href => 'javascript:;',
      :id => @tiddler.toolbar_delete_id,
       :style => (!@tiddler.id or @tiddler.id > 0) ? "display: none" : "display: inline") do
      _("toolbar_delete")
    end
  end
end
