Commit 2258db66c2e8ddccc1716b92f9d9a3a1cb3eff7f
1 parent
f4e7ad7a
Exists in
master
and in
4 other branches
issue can be edit from show page
Showing
3 changed files
with
11 additions
and
2 deletions
Show diff stats
app/views/issues/index.html.haml
| @@ -45,7 +45,7 @@ | @@ -45,7 +45,7 @@ | ||
| 45 | }); | 45 | }); |
| 46 | 46 | ||
| 47 | $('.delete-issue').live('ajax:success', function() { | 47 | $('.delete-issue').live('ajax:success', function() { |
| 48 | - $(this).closest('tr').fadeOut(); }); | 48 | + $(this).closest('tr').fadeOut(); updatePage();}); |
| 49 | 49 | ||
| 50 | function setSortable(){ | 50 | function setSortable(){ |
| 51 | $('#issues-table>tbody').sortable({ | 51 | $('#issues-table>tbody').sortable({ |
app/views/issues/show.html.haml
| @@ -3,6 +3,10 @@ | @@ -3,6 +3,10 @@ | ||
| 3 | 3 | ||
| 4 | .span-15 | 4 | .span-15 |
| 5 | = simple_format html_escape(@issue.content) | 5 | = simple_format html_escape(@issue.content) |
| 6 | + | ||
| 7 | + | ||
| 8 | + .clear | ||
| 9 | + %br | ||
| 6 | .issue_notes= render "notes/notes" | 10 | .issue_notes= render "notes/notes" |
| 7 | .span-8.right | 11 | .span-8.right |
| 8 | .span-8 | 12 | .span-8 |
| @@ -39,5 +43,10 @@ | @@ -39,5 +43,10 @@ | ||
| 39 | - else | 43 | - else |
| 40 | = check_box_tag "closed", 1, @issue.closed, :disabled => true | 44 | = check_box_tag "closed", 1, @issue.closed, :disabled => true |
| 41 | 45 | ||
| 46 | + | ||
| 47 | + - if can?(current_user, :admin_issue, @issue) | ||
| 48 | + .clear | ||
| 49 | + = link_to 'Edit', edit_project_issue_path(@project, @issue), :class => "lbutton positive", :remote => true | ||
| 50 | + .right= link_to 'Destroy', [@project, @issue], :confirm => 'Are you sure?', :method => :delete, :class => "lbutton delete-issue negative", :id => "destroy_issue_#{@issue.id}" | ||
| 42 | .clear | 51 | .clear |
| 43 | 52 |
app/views/issues/update.js.haml
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | - if @issue.valid? | 6 | - if @issue.valid? |
| 7 | :plain | 7 | :plain |
| 8 | $("#edit_issue_dialog").dialog("close"); | 8 | $("#edit_issue_dialog").dialog("close"); |
| 9 | - $.ajax({type: "GET", url: location.href, dataType: "script"}); | 9 | + updatePage(); |
| 10 | - else | 10 | - else |
| 11 | :plain | 11 | :plain |
| 12 | $("#edit_issue_dialog").empty(); | 12 | $("#edit_issue_dialog").empty(); |