change feed page to dynamically select feed for project/context

when you have a long list of projects and/or contexts, the page got really crowded
This commit is contained in:
Reinier Balt 2008-07-24 20:51:50 +02:00
parent c3fa86fc36
commit e3f444575d
5 changed files with 85 additions and 22 deletions

View file

@ -5,14 +5,28 @@ class FeedlistController < ApplicationController
def index
@page_title = 'TRACKS::Feeds'
init_data_for_sidebar unless mobile?
@active_projects = @projects.select{ |p| p.active? }
@hidden_projects = @projects.select{ |p| p.hidden? }
@completed_projects = @projects.select{ |p| p.completed? }
@active_contexts = @contexts.select{ |c| !c.hidden? }
@hidden_contexts = @contexts.select{ |c| c.hidden? }
respond_to do |format|
format.html { render :layout => 'standard' }
format.m {
# @projects = @projects || current_user.projects.find(:all, :include => [:default_context ])
# @contexts = @contexts || current_user.contexts
render :action => 'mobile_index'
}
format.m { render :action => 'mobile_index' }
end
end
def get_feeds_for_context
context = current_user.contexts.find params[:context_id]
render :partial => 'feed_for_context', :locals => { :context => context }
end
def get_feeds_for_project
project = current_user.projects.find params[:project_id]
render :partial => 'feed_for_project', :locals => { :project => project }
end
end