mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-26 10:46:10 +01:00
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:
parent
c3fa86fc36
commit
e3f444575d
5 changed files with 85 additions and 22 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue