From 7b40767428ac5c04ba80d95c7c90b049c73c7f36 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 7 Jul 2012 14:36:49 +0000 Subject: [PATCH] Deprecated :confirm => 'Text' option. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9937 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 10 ++++++++++ app/views/admin/projects.html.erb | 2 +- app/views/attachments/_links.html.erb | 2 +- app/views/auth_sources/index.html.erb | 6 +----- app/views/context_menus/issues.html.erb | 2 +- app/views/context_menus/time_entries.html.erb | 2 +- app/views/custom_fields/_index.html.erb | 5 +---- app/views/documents/show.html.erb | 2 +- app/views/enumerations/index.html.erb | 5 +---- app/views/files/index.html.erb | 2 +- app/views/groups/index.html.erb | 2 +- app/views/issue_statuses/index.html.erb | 7 ++----- app/views/issues/_action_menu.html.erb | 2 +- app/views/issues/_relations.html.erb | 2 +- app/views/issues/index.html.erb | 3 +-- app/views/messages/show.html.erb | 4 ++-- app/views/my/blocks/_timelog.html.erb | 2 +- app/views/news/show.html.erb | 8 ++------ app/views/projects/settings/_activities.html.erb | 2 +- app/views/projects/settings/_boards.html.erb | 2 +- app/views/projects/settings/_issue_categories.html.erb | 2 +- app/views/projects/settings/_members.html.erb | 2 +- app/views/projects/settings/_repositories.html.erb | 5 +---- app/views/projects/settings/_versions.html.erb | 2 +- app/views/queries/index.html.erb | 2 +- app/views/repositories/_related_issues.html.erb | 2 +- app/views/roles/index.html.erb | 5 +---- app/views/timelog/_list.html.erb | 2 +- app/views/trackers/index.html.erb | 5 +---- app/views/users/edit.html.erb | 2 +- app/views/users/index.html.erb | 2 +- app/views/versions/show.html.erb | 3 +-- app/views/wiki/show.html.erb | 2 +- 33 files changed, 45 insertions(+), 63 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9963408fb..d118e04d6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -985,6 +985,16 @@ module ApplicationHelper html.html_safe end + def delete_link(url, options={}) + options = { + :method => :delete, + :data => {:confirm => l(:text_are_you_sure)}, + :class => 'icon icon-del' + }.merge(options) + + link_to l(:button_delete), url, options + end + def back_url_hidden_field_tag back_url = params[:back_url] || request.env['HTTP_REFERER'] back_url = CGI.unescape(back_url.to_s) diff --git a/app/views/admin/projects.html.erb b/app/views/admin/projects.html.erb index 1d8bcc002..c2da70cbe 100644 --- a/app/views/admin/projects.html.erb +++ b/app/views/admin/projects.html.erb @@ -31,7 +31,7 @@ <%= checked_image project.is_public? %> <%= format_date(project.created_on) %> - <%= link_to(l(:button_archive), { :controller => 'projects', :action => 'archive', :id => project, :status => params[:status] }, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-lock') unless project.archived? %> + <%= link_to(l(:button_archive), { :controller => 'projects', :action => 'archive', :id => project, :status => params[:status] }, :data => {:confirm => l(:text_are_you_sure)}, :method => :post, :class => 'icon icon-lock') unless project.archived? %> <%= link_to(l(:button_unarchive), { :controller => 'projects', :action => 'unarchive', :id => project, :status => params[:status] }, :method => :post, :class => 'icon icon-unlock') if project.archived? && (project.parent.nil? || !project.parent.archived?) %> <%= link_to(l(:button_copy), { :controller => 'projects', :action => 'copy', :id => project }, :class => 'icon icon-copy') %> <%= link_to(l(:button_delete), project_path(project), :method => :delete, :class => 'icon icon-del') %> diff --git a/app/views/attachments/_links.html.erb b/app/views/attachments/_links.html.erb index f77cfb1eb..d2ab22ced 100644 --- a/app/views/attachments/_links.html.erb +++ b/app/views/attachments/_links.html.erb @@ -10,7 +10,7 @@ (<%= number_to_human_size attachment.filesize %>) <% if options[:deletable] %> <%= link_to image_tag('delete.png'), attachment_path(attachment), - :confirm => l(:text_are_you_sure), + :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :class => 'delete', :title => l(:button_delete) %> diff --git a/app/views/auth_sources/index.html.erb b/app/views/auth_sources/index.html.erb index 3ce5c090c..045207a28 100644 --- a/app/views/auth_sources/index.html.erb +++ b/app/views/auth_sources/index.html.erb @@ -21,11 +21,7 @@ <%= h source.users.count %> <%= link_to l(:button_test), {:action => 'test_connection', :id => source}, :class => 'icon icon-test' %> - <%= link_to l(:button_delete), { :action => 'destroy', :id => source }, - :method => :delete, - :confirm => l(:text_are_you_sure), - :class => 'icon icon-del', - :disabled => source.users.any? %> + <%= delete_link auth_source_path(source) %> <% end %> diff --git a/app/views/context_menus/issues.html.erb b/app/views/context_menus/issues.html.erb index 75b0a7652..f90cbf0e5 100644 --- a/app/views/context_menus/issues.html.erb +++ b/app/views/context_menus/issues.html.erb @@ -136,7 +136,7 @@ :class => 'icon-copy', :disabled => !@can[:move] %> <% end %>
  • <%= context_menu_link l(:button_delete), issues_path(:ids => @issues.collect(&:id), :back_url => @back), - :method => :delete, :confirm => issues_destroy_confirmation_message(@issues), :class => 'icon-del', :disabled => !@can[:delete] %>
  • + :method => :delete, :data => {:confirm => issues_destroy_confirmation_message(@issues)}, :class => 'icon-del', :disabled => !@can[:delete] %> <%= call_hook(:view_issues_context_menu_end, {:issues => @issues, :can => @can, :back => @back }) %> diff --git a/app/views/context_menus/time_entries.html.erb b/app/views/context_menus/time_entries.html.erb index 43e31145e..10dbcafd2 100644 --- a/app/views/context_menus/time_entries.html.erb +++ b/app/views/context_menus/time_entries.html.erb @@ -28,6 +28,6 @@
  • <%= context_menu_link l(:button_delete), {:controller => 'timelog', :action => 'destroy', :ids => @time_entries.collect(&:id), :back_url => @back}, - :method => :delete, :confirm => l(:text_time_entries_destroy_confirmation), :class => 'icon-del', :disabled => !@can[:delete] %> + :method => :delete, :data => {:confirm => l(:text_time_entries_destroy_confirmation)}, :class => 'icon-del', :disabled => !@can[:delete] %>
  • diff --git a/app/views/custom_fields/_index.html.erb b/app/views/custom_fields/_index.html.erb index 3740987ca..79fc09ae5 100644 --- a/app/views/custom_fields/_index.html.erb +++ b/app/views/custom_fields/_index.html.erb @@ -22,10 +22,7 @@ <% end %> <%= reorder_links('custom_field', {:action => 'update', :id => custom_field}, :put) %> - <%= link_to(l(:button_delete), custom_field_path(custom_field), - :method => :delete, - :confirm => l(:text_are_you_sure), - :class => 'icon icon-del') %> + <%= delete_link custom_field_path(custom_field) %> <% end; reset_cycle %> diff --git a/app/views/documents/show.html.erb b/app/views/documents/show.html.erb index f65d5ae88..2a430040d 100644 --- a/app/views/documents/show.html.erb +++ b/app/views/documents/show.html.erb @@ -1,7 +1,7 @@
    <% if User.current.allowed_to?(:manage_documents, @project) %> <%= link_to l(:button_edit), edit_document_path(@document), :class => 'icon icon-edit', :accesskey => accesskey(:edit) %> -<%= link_to l(:button_delete), document_path(@document), :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del' %> +<%= delete_link document_path(@document) %> <% end %>
    diff --git a/app/views/enumerations/index.html.erb b/app/views/enumerations/index.html.erb index d7522bc93..153c8b5e3 100644 --- a/app/views/enumerations/index.html.erb +++ b/app/views/enumerations/index.html.erb @@ -20,10 +20,7 @@ <%= checked_image enumeration.active? %> <%= reorder_links('enumeration', {:action => 'update', :id => enumeration}, :put) %> - <%= link_to l(:button_delete), enumeration_path(enumeration), - :method => :delete, - :confirm => l(:text_are_you_sure), - :class => 'icon icon-del' %> + <%= delete_link enumeration_path(enumeration) %> <% end %> diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb index 397ca5c65..5077dbd8f 100644 --- a/app/views/files/index.html.erb +++ b/app/views/files/index.html.erb @@ -34,7 +34,7 @@ <%= file.digest %> <%= link_to(image_tag('delete.png'), attachment_path(file), - :confirm => l(:text_are_you_sure), :method => :delete) if delete_allowed %> + :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %> <% end diff --git a/app/views/groups/index.html.erb b/app/views/groups/index.html.erb index 418563abd..aee3a092b 100644 --- a/app/views/groups/index.html.erb +++ b/app/views/groups/index.html.erb @@ -16,7 +16,7 @@ <%= link_to h(group), edit_group_path(group) %> <%= group.users.size %> - <%= link_to l(:button_delete), group, :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del' %> + <%= delete_link group %> <% end %> diff --git a/app/views/issue_statuses/index.html.erb b/app/views/issue_statuses/index.html.erb index 430e873f2..dea9fb3cb 100644 --- a/app/views/issue_statuses/index.html.erb +++ b/app/views/issue_statuses/index.html.erb @@ -1,6 +1,6 @@
    <%= link_to l(:label_issue_status_new), new_issue_status_path, :class => 'icon icon-add' %> -<%= link_to(l(:label_update_issue_done_ratios), update_issue_done_ratio_issue_statuses_path, :class => 'icon icon-multiple', :method => 'post', :confirm => l(:text_are_you_sure)) if Issue.use_status_for_done_ratio? %> +<%= link_to(l(:label_update_issue_done_ratios), update_issue_done_ratio_issue_statuses_path, :class => 'icon icon-multiple', :method => 'post', :data => {:confirm => l(:text_are_you_sure)}) if Issue.use_status_for_done_ratio? %>

    <%=l(:label_issue_status_plural)%>

    @@ -27,10 +27,7 @@ <%= checked_image status.is_closed? %> <%= reorder_links('issue_status', {:action => 'update', :id => status}, :put) %> - <%= link_to(l(:button_delete), issue_status_path(status), - :method => :delete, - :confirm => l(:text_are_you_sure), - :class => 'icon icon-del') %> + <%= delete_link issue_status_path(status) %> <% end %> diff --git a/app/views/issues/_action_menu.html.erb b/app/views/issues/_action_menu.html.erb index 4d0503117..f532fb292 100644 --- a/app/views/issues/_action_menu.html.erb +++ b/app/views/issues/_action_menu.html.erb @@ -3,5 +3,5 @@ <%= link_to l(:button_log_time), new_issue_time_entry_path(@issue), :class => 'icon icon-time-add' if User.current.allowed_to?(:log_time, @project) %> <%= watcher_tag(@issue, User.current) %> <%= link_to_if_authorized l(:button_copy), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue}, :class => 'icon icon-copy' %> -<%= link_to l(:button_delete), issue_path(@issue), :confirm => issues_destroy_confirmation_message(@issue), :method => :delete, :class => 'icon icon-del' if User.current.allowed_to?(:delete_issues, @project) %> +<%= link_to l(:button_delete), issue_path(@issue), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'icon icon-del' if User.current.allowed_to?(:delete_issues, @project) %> diff --git a/app/views/issues/_relations.html.erb b/app/views/issues/_relations.html.erb index 0b503fc6c..350c00cfb 100644 --- a/app/views/issues/_relations.html.erb +++ b/app/views/issues/_relations.html.erb @@ -23,7 +23,7 @@ image_tag('link_break.png'), { :url => {:controller => 'issue_relations', :action => 'destroy', :id => relation}, :method => :delete, - :confirm => l(:text_are_you_sure) }, + :data => {:confirm => l(:text_are_you_sure)} }, :title => l(:label_relation_delete) ) if authorize_for('issue_relations', 'destroy') %> diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index ac9da57dc..8e9b81fdc 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -1,8 +1,7 @@
    <% if !@query.new_record? && @query.editable_by?(User.current) %> <%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %> - <%= link_to l(:button_delete), query_path(@query), :confirm => l(:text_are_you_sure), - :method => :delete, :class => 'icon icon-del' %> + <%= delete_link query_path(@query) %> <% end %>
    diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb index d0857cf46..639dc2e7c 100644 --- a/app/views/messages/show.html.erb +++ b/app/views/messages/show.html.erb @@ -17,7 +17,7 @@ l(:button_delete), {:action => 'destroy', :id => @topic}, :method => :post, - :confirm => l(:text_are_you_sure), + :data => {:confirm => l(:text_are_you_sure)}, :class => 'icon icon-del' ) if @message.destroyable_by?(User.current) %> @@ -52,7 +52,7 @@ image_tag('delete.png'), {:action => 'destroy', :id => message}, :method => :post, - :confirm => l(:text_are_you_sure), + :data => {:confirm => l(:text_are_you_sure)}, :title => l(:button_delete) ) if message.destroyable_by?(User.current) %> diff --git a/app/views/my/blocks/_timelog.html.erb b/app/views/my/blocks/_timelog.html.erb index 12a88ac02..a1fe39b15 100644 --- a/app/views/my/blocks/_timelog.html.erb +++ b/app/views/my/blocks/_timelog.html.erb @@ -39,7 +39,7 @@ entries_by_day = entries.group_by(&:spent_on) <%= link_to image_tag('edit.png'), {:controller => 'timelog', :action => 'edit', :id => entry}, :title => l(:button_edit) %> <%= link_to image_tag('delete.png'), {:controller => 'timelog', :action => 'destroy', :id => entry}, - :confirm => l(:text_are_you_sure), + :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %> <% end -%> diff --git a/app/views/news/show.html.erb b/app/views/news/show.html.erb index cb332f88c..fba61835d 100644 --- a/app/views/news/show.html.erb +++ b/app/views/news/show.html.erb @@ -5,11 +5,7 @@ :class => 'icon icon-edit', :accesskey => accesskey(:edit), :onclick => 'Element.show("edit-news"); return false;') if User.current.allowed_to?(:manage_news, @project) %> -<%= link_to(l(:button_delete), - news_path(@news), - :confirm => l(:text_are_you_sure), - :method => :delete, - :class => 'icon icon-del') if User.current.allowed_to?(:manage_news, @project) %> +<%= delete_link news_path(@news) if User.current.allowed_to?(:manage_news, @project) %>

    <%= avatar(@news.author, :size => "24") %><%=h @news.title %>

    @@ -46,7 +42,7 @@ <% next if comment.new_record? %>
    <%= link_to_if_authorized image_tag('delete.png'), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment}, - :confirm => l(:text_are_you_sure), :method => :delete, :title => l(:button_delete) %> + :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %>

    <%= avatar(comment.author, :size => "24") %><%= authoring comment.created_on, comment.author %>

    <%= textilizable(comment.comments) %> diff --git a/app/views/projects/settings/_activities.html.erb b/app/views/projects/settings/_activities.html.erb index 0331cc8ac..8c9a6121c 100644 --- a/app/views/projects/settings/_activities.html.erb +++ b/app/views/projects/settings/_activities.html.erb @@ -34,7 +34,7 @@
    <%= link_to(l(:button_reset), project_enumerations_path(@project), :method => :delete, - :confirm => l(:text_are_you_sure), + :data => {:confirm => l(:text_are_you_sure)}, :class => 'icon icon-del') %>
    diff --git a/app/views/projects/settings/_boards.html.erb b/app/views/projects/settings/_boards.html.erb index 66a838a4e..c4b84ab99 100644 --- a/app/views/projects/settings/_boards.html.erb +++ b/app/views/projects/settings/_boards.html.erb @@ -20,7 +20,7 @@ <% if User.current.allowed_to?(:manage_boards, @project) %> <%= link_to l(:button_edit), edit_project_board_path(@project, board), :class => 'icon icon-edit' %> - <%= link_to l(:button_delete), project_board_path(@project, board), :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del' %> + <%= delete_link project_board_path(@project, board) %> <% end %> diff --git a/app/views/projects/settings/_issue_categories.html.erb b/app/views/projects/settings/_issue_categories.html.erb index f5ea6d0db..e88a85d50 100644 --- a/app/views/projects/settings/_issue_categories.html.erb +++ b/app/views/projects/settings/_issue_categories.html.erb @@ -14,7 +14,7 @@ <% if User.current.allowed_to?(:manage_categories, @project) %> <%= link_to l(:button_edit), edit_issue_category_path(category), :class => 'icon icon-edit' %> - <%= link_to l(:button_delete), issue_category_path(category), :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del' %> + <%= delete_link issue_category_path(category) %> <% end %> diff --git a/app/views/projects/settings/_members.html.erb b/app/views/projects/settings/_members.html.erb index 6bb07c69a..8ce9cf3de 100644 --- a/app/views/projects/settings/_members.html.erb +++ b/app/views/projects/settings/_members.html.erb @@ -41,7 +41,7 @@ l(:button_delete), { :url => membership_path(member), :method => :delete, - :confirm => (!User.current.admin? && member.include?(User.current) ? l(:text_own_membership_delete_confirmation) : nil) }, + :data => {:confirm => (!User.current.admin? && member.include?(User.current) ? l(:text_own_membership_delete_confirmation) : nil)} }, :title => l(:button_delete), :class => 'icon icon-del' ) if member.deletable? %> diff --git a/app/views/projects/settings/_repositories.html.erb b/app/views/projects/settings/_repositories.html.erb index c2581b38c..d72c9edad 100644 --- a/app/views/projects/settings/_repositories.html.erb +++ b/app/views/projects/settings/_repositories.html.erb @@ -22,10 +22,7 @@ :class => 'icon icon-user') %> <%= link_to(l(:button_edit), edit_repository_path(repository), :class => 'icon icon-edit') %> - <%= link_to(l(:button_delete), repository_path(repository), - :confirm => l(:text_are_you_sure), - :method => :delete, - :class => 'icon icon-del') %> + <%= delete_link repository_path(repository) %> <% end %> diff --git a/app/views/projects/settings/_versions.html.erb b/app/views/projects/settings/_versions.html.erb index 306670587..778803bf3 100644 --- a/app/views/projects/settings/_versions.html.erb +++ b/app/views/projects/settings/_versions.html.erb @@ -21,7 +21,7 @@ <% if version.project == @project && User.current.allowed_to?(:manage_versions, @project) %> <%= link_to l(:button_edit), edit_version_path(version), :class => 'icon icon-edit' %> - <%= link_to l(:button_delete), version_path(version), :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del' %> + <%= delete_link version_path(version) %> <% end %> diff --git a/app/views/queries/index.html.erb b/app/views/queries/index.html.erb index b03ac6216..41051758e 100644 --- a/app/views/queries/index.html.erb +++ b/app/views/queries/index.html.erb @@ -17,7 +17,7 @@ <% if query.editable_by?(User.current) %> <%= link_to l(:button_edit), edit_query_path(query), :class => 'icon icon-edit' %> - <%= link_to l(:button_delete), query_path(query), :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del' %> + <%= delete_link query_path(query) %> <% end %> diff --git a/app/views/repositories/_related_issues.html.erb b/app/views/repositories/_related_issues.html.erb index a7aee5d39..d5e57cb72 100644 --- a/app/views/repositories/_related_issues.html.erb +++ b/app/views/repositories/_related_issues.html.erb @@ -16,7 +16,7 @@ :id => @project, :repository_id => @repository.identifier_param, :rev => @changeset.identifier, :issue_id => issue}, :method => :delete, - :confirm => l(:text_are_you_sure), + :data => {:confirm => l(:text_are_you_sure)}, }, :title => l(:label_relation_delete)) if manage_allowed %> diff --git a/app/views/roles/index.html.erb b/app/views/roles/index.html.erb index 9d3c46c14..30cef5330 100644 --- a/app/views/roles/index.html.erb +++ b/app/views/roles/index.html.erb @@ -20,10 +20,7 @@ <% end %> - <%= link_to(l(:button_delete), role_path(role), - :method => :delete, - :confirm => l(:text_are_you_sure), - :class => 'icon icon-del') unless role.builtin? %> + <%= delete_link role_path(role) unless role.builtin? %> <% end %> diff --git a/app/views/timelog/_list.html.erb b/app/views/timelog/_list.html.erb index e916756c9..ccbf7369e 100644 --- a/app/views/timelog/_list.html.erb +++ b/app/views/timelog/_list.html.erb @@ -40,7 +40,7 @@ <%= link_to image_tag('edit.png'), {:controller => 'timelog', :action => 'edit', :id => entry, :project_id => nil}, :title => l(:button_edit) %> <%= link_to image_tag('delete.png'), {:controller => 'timelog', :action => 'destroy', :id => entry, :project_id => nil}, - :confirm => l(:text_are_you_sure), + :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %> <% end -%> diff --git a/app/views/trackers/index.html.erb b/app/views/trackers/index.html.erb index ef48bdc9e..0515ae335 100644 --- a/app/views/trackers/index.html.erb +++ b/app/views/trackers/index.html.erb @@ -18,10 +18,7 @@ <% unless tracker.workflows.count > 0 %><%= l(:text_tracker_no_workflow) %> (<%= link_to l(:button_edit), {:controller => 'workflows', :action => 'edit', :tracker_id => tracker} %>)<% end %> <%= reorder_links('tracker', {:action => 'update', :id => tracker}, :put) %> - <%= link_to(l(:button_delete), tracker_path(tracker), - :method => :delete, - :confirm => l(:text_are_you_sure), - :class => 'icon icon-del') %> + <%= delete_link tracker_path(tracker) %> <% end %> diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index b56f12c27..fa4f38a64 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -1,7 +1,7 @@
    <%= link_to l(:label_profile), user_path(@user), :class => 'icon icon-user' %> <%= change_status_link(@user) %> -<%= link_to(l(:button_delete), @user, :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del') if User.current != @user %> +<%= delete_link user_path(@user) if User.current != @user %>

    <%= link_to l(:label_user_plural), users_path %> » <%=h @user.login %>

    diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index d59617941..a477a5c90 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -46,7 +46,7 @@ <%= format_time(user.last_login_on) unless user.last_login_on.nil? %> <%= change_status_link(user) %> - <%= link_to(l(:button_delete), user_path(user), :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del') unless User.current == user %> + <%= delete_link user_path(user) unless User.current == user %> <% end -%> diff --git a/app/views/versions/show.html.erb b/app/views/versions/show.html.erb index f44e3f272..2e104bd39 100644 --- a/app/views/versions/show.html.erb +++ b/app/views/versions/show.html.erb @@ -1,8 +1,7 @@
    <%= link_to(l(:button_edit), edit_version_path(@version), :class => 'icon icon-edit') if User.current.allowed_to?(:manage_versions, @version.project) %> <%= link_to_if_authorized(l(:button_edit_associated_wikipage, :page_title => @version.wiki_page_title), {:controller => 'wiki', :action => 'edit', :project_id => @version.project, :id => Wiki.titleize(@version.wiki_page_title)}, :class => 'icon icon-edit') unless @version.wiki_page_title.blank? || @version.project.wiki.nil? %> -<%= link_to(l(:button_delete), version_path(@version, :back_url => url_for(:controller => 'versions', :action => 'index', :project_id => @version.project)), - :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del') if User.current.allowed_to?(:manage_versions, @version.project) %> +<%= delete_link version_path(@version, :back_url => url_for(:controller => 'versions', :action => 'index', :project_id => @version.project)) if User.current.allowed_to?(:manage_versions, @version.project) %> <%= call_hook(:view_versions_show_contextual, { :version => @version, :project => @project }) %>
    diff --git a/app/views/wiki/show.html.erb b/app/views/wiki/show.html.erb index 0ef8fc869..08763a335 100644 --- a/app/views/wiki/show.html.erb +++ b/app/views/wiki/show.html.erb @@ -5,7 +5,7 @@ <%= link_to_if_authorized(l(:button_lock), {:action => 'protect', :id => @page.title, :protected => 1}, :method => :post, :class => 'icon icon-lock') if !@page.protected? %> <%= link_to_if_authorized(l(:button_unlock), {:action => 'protect', :id => @page.title, :protected => 0}, :method => :post, :class => 'icon icon-unlock') if @page.protected? %> <%= link_to_if_authorized(l(:button_rename), {:action => 'rename', :id => @page.title}, :class => 'icon icon-move') if @content.current_version? %> -<%= link_to_if_authorized(l(:button_delete), {:action => 'destroy', :id => @page.title}, :method => :delete, :confirm => l(:text_are_you_sure), :class => 'icon icon-del') %> +<%= link_to_if_authorized(l(:button_delete), {:action => 'destroy', :id => @page.title}, :method => :delete, :data => {:confirm => l(:text_are_you_sure)}, :class => 'icon icon-del') %> <%= link_to_if_authorized(l(:button_rollback), {:action => 'edit', :id => @page.title, :version => @content.version }, :class => 'icon icon-cancel') unless @content.current_version? %> <% end %> <%= link_to_if_authorized(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %> -- 2.39.5