mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-24 11:10:12 +01:00
applied the patch from Peter Suschlik in #641. Changed the badge count for completed actions to the number of actions shown in stead of the total number of completed actions. Thanks Peter for the patch
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@705 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
67c79ba5a6
commit
da63b552ce
2 changed files with 52 additions and 49 deletions
|
|
@ -1,49 +1,50 @@
|
|||
class NotesController < ApplicationController
|
||||
|
||||
def index
|
||||
@all_notes = current_user.notes
|
||||
@page_title = "TRACKS::All notes"
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.xml { render :xml => @all_notes.to_xml( :except => :user_id ) }
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
@note = current_user.notes.find(params['id'])
|
||||
@page_title = "TRACKS::Note " + @note.id.to_s
|
||||
end
|
||||
|
||||
def create
|
||||
note = current_user.notes.build
|
||||
note.attributes = params["new_note"]
|
||||
|
||||
if note.save
|
||||
render :partial => 'notes_summary', :object => note
|
||||
else
|
||||
render :text => ''
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
note = current_user.notes.find(params['id'])
|
||||
if note.destroy
|
||||
render :text => ''
|
||||
else
|
||||
notify :warning, "Couldn't delete note \"#{note.id}\""
|
||||
render :text => ''
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
note = current_user.notes.find(params['id'])
|
||||
note.attributes = params["note"]
|
||||
if note.save
|
||||
render :partial => 'notes', :object => note
|
||||
else
|
||||
notify :warning, "Couldn't update note \"#{note.id}\""
|
||||
render :text => ''
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
class NotesController < ApplicationController
|
||||
|
||||
def index
|
||||
@all_notes = current_user.notes
|
||||
@count = @all_notes.size
|
||||
@page_title = "TRACKS::All notes"
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.xml { render :xml => @all_notes.to_xml( :except => :user_id ) }
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
@note = current_user.notes.find(params['id'])
|
||||
@page_title = "TRACKS::Note " + @note.id.to_s
|
||||
end
|
||||
|
||||
def create
|
||||
note = current_user.notes.build
|
||||
note.attributes = params["new_note"]
|
||||
|
||||
if note.save
|
||||
render :partial => 'notes_summary', :object => note
|
||||
else
|
||||
render :text => ''
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
note = current_user.notes.find(params['id'])
|
||||
if note.destroy
|
||||
render :text => ''
|
||||
else
|
||||
notify :warning, "Couldn't delete note \"#{note.id}\""
|
||||
render :text => ''
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
note = current_user.notes.find(params['id'])
|
||||
note.attributes = params["note"]
|
||||
if note.save
|
||||
render :partial => 'notes', :object => note
|
||||
else
|
||||
notify :warning, "Couldn't update note \"#{note.id}\""
|
||||
render :text => ''
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -244,11 +244,13 @@ class TodosController < ApplicationController
|
|||
@done_today = @done.completed_within current_user.time - 1.day
|
||||
@done_this_week = @done.completed_within current_user.time - 1.week
|
||||
@done_this_month = @done.completed_within current_user.time - 4.week
|
||||
@count = @done_today.size + @done_this_week.size + @done_this_month.size
|
||||
end
|
||||
|
||||
def completed_archive
|
||||
@page_title = "TRACKS::Archived completed tasks"
|
||||
@done = current_user.completed_todos
|
||||
@count = @done.size
|
||||
@done_archive = @done.completed_more_than current_user.time - 28.days
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue