mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-25 08:34:08 +01:00
Apply James Kebinger's patch to improve the initial state of the projects page when a user does not yet have any projectes.
Thanks, James! git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@472 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
85885f9b9b
commit
3e177ad67b
7 changed files with 37 additions and 3 deletions
|
|
@ -48,6 +48,7 @@ class ProjectsController < ApplicationController
|
|||
end
|
||||
@saved = @project.save
|
||||
@project_not_done_counts = { @project.id => 0 }
|
||||
@active_projects_count = @user.projects.count(:conditions => "state = 'active'")
|
||||
respond_to do |wants|
|
||||
wants.js
|
||||
wants.xml do
|
||||
|
|
@ -102,6 +103,9 @@ class ProjectsController < ApplicationController
|
|||
|
||||
def destroy
|
||||
@project.destroy
|
||||
@active_projects_count = @user.projects.count(:conditions => "state = 'active'")
|
||||
@hidden_projects_count = @user.projects.count(:conditions => "state = 'hidden'")
|
||||
@completed_projects_count = @user.projects.count(:conditions => "state = 'completed'")
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.xml { render :text => "Deleted project #{@project.name}" }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue