mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 15:20:13 +01:00
Merge pull request #1888 from C-Otto/tracks-1882
navigate back to note's project after deletion
This commit is contained in:
commit
486204c1d7
2 changed files with 10 additions and 2 deletions
|
|
@ -56,6 +56,7 @@ class NotesController < ApplicationController
|
|||
def destroy
|
||||
@note = current_user.notes.find(params['id'])
|
||||
@note.destroy
|
||||
set_source_view
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
|
|
|
|||
|
|
@ -1,6 +1,13 @@
|
|||
remove_deleted_note(<%=@note.id%>);
|
||||
TracksPages.set_page_badge(<%=@down_count%>);
|
||||
TracksPages.page_inform("<%= t('notes.deleted_note', :id => @note.id)%>");
|
||||
<%
|
||||
if @source_view == 'note' %>
|
||||
redirect_to("<%= project_path(@note.project) -%>")
|
||||
<% else %>
|
||||
remove_deleted_note(<%=@note.id%>);
|
||||
TracksPages.set_page_badge(<%=@down_count%>);
|
||||
<%
|
||||
end
|
||||
%>
|
||||
|
||||
function remove_deleted_note(id) {
|
||||
TracksPages.slide_up_and_remove('div#note-'+id+'-wrapper');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue