diff --git a/tracks/app/controllers/notes_controller.rb b/tracks/app/controllers/notes_controller.rb index 40c43175..c3c8fbec 100644 --- a/tracks/app/controllers/notes_controller.rb +++ b/tracks/app/controllers/notes_controller.rb @@ -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 diff --git a/tracks/app/controllers/todos_controller.rb b/tracks/app/controllers/todos_controller.rb index fb7e23a0..a8344b71 100644 --- a/tracks/app/controllers/todos_controller.rb +++ b/tracks/app/controllers/todos_controller.rb @@ -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