From e143a03f733df599c263c6f79b70cb1251f99dc8 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Wed, 3 Dec 2008 12:31:24 +0100 Subject: [PATCH 1/7] restores sidebar and refactor sidebar sidebar was not shown after rails upgrade --- app/controllers/application.rb | 8 ++++++++ app/views/sidebar/sidebar.html.erb | 12 ++++++------ app/views/todos/index.html.erb | 4 +++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 16cb0518..5400987d 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -230,6 +230,14 @@ class ApplicationController < ActionController::Base def init_data_for_sidebar @projects = @projects || current_user.projects.find(:all, :include => [:default_context ]) @contexts = @contexts || current_user.contexts + + @completed_projects = current_user.projects.completed + @hidden_projects = current_user.projects.hidden + @active_projects = current_user.projects.active + + @active_contexts = current_user.contexts.active + @hidden_contexts = current_user.contexts.hidden + init_not_done_counts if prefs.show_hidden_projects_in_sidebar init_project_hidden_todo_counts(['project']) diff --git a/app/views/sidebar/sidebar.html.erb b/app/views/sidebar/sidebar.html.erb index bb5d8847..3de85ff3 100644 --- a/app/views/sidebar/sidebar.html.erb +++ b/app/views/sidebar/sidebar.html.erb @@ -1,30 +1,30 @@