OSDN Git Service

issue can be edit from show page
authorgitlabhq <m@gitlabhq.com>
Thu, 27 Oct 2011 15:18:50 +0000 (18:18 +0300)
committergitlabhq <m@gitlabhq.com>
Thu, 27 Oct 2011 15:18:50 +0000 (18:18 +0300)
app/views/issues/index.html.haml
app/views/issues/show.html.haml
app/views/issues/update.js.haml

index 56042fa..a70c65d 100644 (file)
@@ -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({
index 29b6f3f..58bebe9 100644 (file)
@@ -3,6 +3,10 @@
 
 .span-15
   = simple_format html_escape(@issue.content)
+
+
+  .clear
+  %br
   .issue_notes= render "notes/notes"
 .span-8.right
   .span-8
         - 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
 
index 30fca38..137dba3 100644 (file)
@@ -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();