mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-18 00:00:12 +01:00
38 lines
1 KiB
Ruby
38 lines
1 KiB
Ruby
class FeedlistController < ApplicationController
|
|
|
|
helper :feedlist
|
|
|
|
def index
|
|
@page_title = 'TRACKS::Feeds'
|
|
|
|
unless mobile?
|
|
init_data_for_sidebar
|
|
else
|
|
@projects = current_user.projects
|
|
@contexts = current_user.contexts
|
|
end
|
|
|
|
@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 { 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
|