2007-03-30 04:36:52 +00:00
|
|
|
class FeedlistController < ApplicationController
|
|
|
|
|
|
|
|
helper :feedlist
|
|
|
|
|
|
|
|
def index
|
|
|
|
@page_title = 'TRACKS::Feeds'
|
2008-08-01 14:49:51 +02:00
|
|
|
|
|
|
|
unless mobile?
|
|
|
|
init_data_for_sidebar
|
|
|
|
else
|
|
|
|
@projects = current_user.projects
|
|
|
|
@contexts = current_user.contexts
|
|
|
|
end
|
2008-07-24 20:51:50 +02:00
|
|
|
|
|
|
|
@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? }
|
|
|
|
|
2008-04-19 19:15:07 +00:00
|
|
|
respond_to do |format|
|
|
|
|
format.html { render :layout => 'standard' }
|
2008-07-24 20:51:50 +02:00
|
|
|
format.m { render :action => 'mobile_index' }
|
2008-04-19 19:15:07 +00:00
|
|
|
end
|
2007-03-30 04:36:52 +00:00
|
|
|
end
|
2008-07-24 20:51:50 +02:00
|
|
|
|
|
|
|
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
|
2007-03-30 04:36:52 +00:00
|
|
|
|
|
|
|
end
|