From 12b73f54d3416bd68fffab756e1c17c5dc8d2787 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 7 Dec 2016 15:39:48 +0800 Subject: [PATCH] =?UTF-8?q?commit=20issue=E5=85=B3=E8=81=94=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=B1=80?= =?UTF-8?q?=E9=83=A8=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/_action_menu.html.erb | 3 ++- app/views/issues/_issue_commit_ids.html.erb | 2 +- app/views/issues/issue_commit_delete.js.erb | 1 + config/routes.rb | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 app/views/issues/issue_commit_delete.js.erb diff --git a/app/views/issues/_action_menu.html.erb b/app/views/issues/_action_menu.html.erb index 97e95d4a9..974c0dd9f 100644 --- a/app/views/issues/_action_menu.html.erb +++ b/app/views/issues/_action_menu.html.erb @@ -2,5 +2,6 @@ <%#= watcher_link_issue(@issue, User.current) %> <%= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'talk_edit fr' if User.current.allowed_to?(:add_issues, @project) %> <%= link_to l(:button_delete), issue_path(@issue.id), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'talk_edit fr' if User.current.allowed_to?(:delete_issues, @project) %> -<%= link_to l(:button_edit), 'javascript:void(0);', :onclick => 'issueEditShow();', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:edit_issues, @project) %> +<%#= link_to l(:button_edit), 'javascript:void(0);', :onclick => 'issueEditShow();', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:edit_issues, @project) %> +<%= link_to l(:button_edit), edit_issue_path(@issue), :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:edit_issues, @project) %> <%#= link_to l(:label_user_newfeedback), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("update", "issue_journal_kind_reply"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:add_issue_notes, @project) %> diff --git a/app/views/issues/_issue_commit_ids.html.erb b/app/views/issues/_issue_commit_ids.html.erb index f6c8ef2f8..6bc3f5a01 100644 --- a/app/views/issues/_issue_commit_ids.html.erb +++ b/app/views/issues/_issue_commit_ids.html.erb @@ -2,7 +2,7 @@ <% @issue_commit_ids.each do |commit_id| %>
<%= link_to commit_id[0,8], {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => commit_id}, :target => "_blank", :class => "commit_id_value" %> - × + <%= link_to "×", issue_commit_delete_issues_path(:commit_id => commit_id, :project_id => @project.id, :issue_commit_ids => @issue_commit_ids, :issue_id => @issue.try(:id)), :remote => true, :style => "color:#fff;" %>
<% end %> <% else %> diff --git a/app/views/issues/issue_commit_delete.js.erb b/app/views/issues/issue_commit_delete.js.erb new file mode 100644 index 000000000..0a368159a --- /dev/null +++ b/app/views/issues/issue_commit_delete.js.erb @@ -0,0 +1 @@ +$("#issue_commit_ids").html('<%= escape_javascript(render :partial => 'issues/issue_commit_ids') %>'); \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 12e857a43..c7e254ff5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -954,6 +954,7 @@ RedmineApp::Application.routes.draw do post 'bulk_update' post 'issue_commits' get 'commit_for_issue' + get 'issue_commit_delete' end member do post 'add_journal'