Add a Sidebar class to represent the side bar

Start using it throughout the rest of the app instead of the various
instance variables
This commit is contained in:
Matt Rogers 2014-09-14 21:47:14 -05:00
parent 2883d1b7f4
commit 8d24f5105a
5 changed files with 66 additions and 17 deletions

View file

@ -212,12 +212,7 @@ class ApplicationController < ActionController::Base
end
def init_data_for_sidebar
@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
@sidebar = Sidebar.new(current_user)
init_not_done_counts
if prefs.show_hidden_projects_in_sidebar