From 2258db66c2e8ddccc1716b92f9d9a3a1cb3eff7f Mon Sep 17 00:00:00 2001 From: gitlabhq Date: Thu, 27 Oct 2011 18:18:50 +0300 Subject: [PATCH] issue can be edit from show page --- app/views/issues/index.html.haml | 2 +- app/views/issues/show.html.haml | 9 +++++++++ app/views/issues/update.js.haml | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/views/issues/index.html.haml b/app/views/issues/index.html.haml index 56042fa2446..a70c65d47c6 100644 --- a/app/views/issues/index.html.haml +++ b/app/views/issues/index.html.haml @@ -45,7 +45,7 @@ }); $('.delete-issue').live('ajax:success', function() { - $(this).closest('tr').fadeOut(); }); + $(this).closest('tr').fadeOut(); updatePage();}); function setSortable(){ $('#issues-table>tbody').sortable({ diff --git a/app/views/issues/show.html.haml b/app/views/issues/show.html.haml index 29b6f3f7b84..58bebe9b3de 100644 --- a/app/views/issues/show.html.haml +++ b/app/views/issues/show.html.haml @@ -3,6 +3,10 @@ .span-15 = simple_format html_escape(@issue.content) + + + .clear + %br .issue_notes= render "notes/notes" .span-8.right .span-8 @@ -39,5 +43,10 @@ - else = check_box_tag "closed", 1, @issue.closed, :disabled => true + + - if can?(current_user, :admin_issue, @issue) + .clear + = link_to 'Edit', edit_project_issue_path(@project, @issue), :class => "lbutton positive", :remote => true + .right= link_to 'Destroy', [@project, @issue], :confirm => 'Are you sure?', :method => :delete, :class => "lbutton delete-issue negative", :id => "destroy_issue_#{@issue.id}" .clear diff --git a/app/views/issues/update.js.haml b/app/views/issues/update.js.haml index 30fca38c38e..137dba3cc71 100644 --- a/app/views/issues/update.js.haml +++ b/app/views/issues/update.js.haml @@ -6,7 +6,7 @@ - if @issue.valid? :plain $("#edit_issue_dialog").dialog("close"); - $.ajax({type: "GET", url: location.href, dataType: "script"}); + updatePage(); - else :plain $("#edit_issue_dialog").empty();