Skip to content

Commit

Permalink
confirm before delete
Browse files Browse the repository at this point in the history
  • Loading branch information
kfl62 committed Feb 2, 2009
1 parent fba0748 commit 2855cc3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/locales/ro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ ro:
edit: "Editare"
save: "Salvare"
remove: "Ştergere"
remove_confirm: "!!! Atenţie se va şterge înregistrarea !!!"
cancel: "Renunţare"
show: "Detalii"
paginate:
Expand Down
4 changes: 3 additions & 1 deletion lib/forms/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ def image_tag_for_link(src,options ={})
options[:alt] = options[:title] = t('activerecord.attributes.crud.' + s)
options[:size] ||= "13x13"
options[:style] ||= "cursor : pointer; vertical-align : middle;"
options[:onclick] = "TrstWindow.#{s}(#{options.delete(:arg1)}, #{options.delete(:arg2)}); return false;"
options[:onclick] = "TrstWindow.#{s}(#{options[:arg1]}, #{options[:arg2]}); return false;"
options[:onclick] = "if (confirm('#{t('activerecord.attributes.crud.remove_confirm')}')) {TrstWindow.#{s}(#{options[:arg1]}, #{options[:arg2]}); return false} else {return false;}" if s == "remove"
options.delete_if { |k,v| k.to_s.include? "arg"}
html += image_tag("db_#{s}.png", options)
}
html
Expand Down

0 comments on commit 2855cc3

Please sign in to comment.