diff options
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r-- | app/controllers/projects_controller.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index c89167aa3..492e31795 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -48,7 +48,11 @@ class ProjectsController < ApplicationController def index respond_to do |format| format.html { - @projects = Project.visible.find(:all, :order => 'lft') + scope = Project + unless params[:closed] + scope = scope.active + end + @projects = scope.visible.order('lft').all } format.api { @offset, @limit = api_offset_and_limit @@ -224,6 +228,16 @@ class ProjectsController < ApplicationController redirect_to(url_for(:controller => 'admin', :action => 'projects', :status => params[:status])) end + def close + @project.close + redirect_to project_path(@project) + end + + def reopen + @project.reopen + redirect_to project_path(@project) + end + # Delete @project def destroy @project_to_destroy = @project |