[Opda-develop] OPDA/app/controllers subscription_lists_controller.rb, 1.4, 1.5
Brought to you by:
digitalpodcast
|
From: Alex N. <dig...@us...> - 2006-07-24 04:19:09
|
Update of /cvsroot/opda/OPDA/app/controllers In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3539/app/controllers Modified Files: subscription_lists_controller.rb Log Message: set up subscription list views. Built browser tree for lists with channels in center div. see subscription_lists/list. Tree still needs some work. should be expanded to next level on entry and ajax toggle on minus sign needs to be fixed - currently set to display - but it is not toggling for some reason Index: subscription_lists_controller.rb =================================================================== RCS file: /cvsroot/opda/OPDA/app/controllers/subscription_lists_controller.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** subscription_lists_controller.rb 23 Jul 2006 20:35:34 -0000 1.4 --- subscription_lists_controller.rb 24 Jul 2006 04:19:07 -0000 1.5 *************** *** 1,3 **** --- 1,4 ---- class SubscriptionListsController < ApplicationController + model :channel def index list *************** *** 10,16 **** raise # We can tie in a OPML feed, if there is no user hence subscrition list. end ! @root = @user.subscription_lists.find(:first, :conditions => "parent_id = 0") ! @subscription_lists = @root.children # @subscription_list_pages, @subscription_lists = paginate :subscriptions, :per_page => 10 --- 11,18 ---- raise # We can tie in a OPML feed, if there is no user hence subscrition list. end ! # @root = @user.subscription_lists.find(:first, :conditions => "parent_id = 0") ! # @subscription_lists = @root.children ! @subscription_lists = SubscriptionList.find_all_by_user_id(@user.id) # @subscription_list_pages, @subscription_lists = paginate :subscriptions, :per_page => 10 *************** *** 20,23 **** --- 22,32 ---- # CHristophe TODO. # = SubscriptionList.find(params[:id]) + @subscription_list = SubscriptionList.find(params[:id]) + @channels = @subscription_list.channels + + render :update do |page| + page.replace_html 'channellist', :partial => 'channel', :collection => @channels + page.visual_effect :highlight, 'center', :duration =>5 + end end *************** *** 61,63 **** --- 70,79 ---- end + def show_sublist + + @id = params[:id] + render :update do |page| + page.toggle "plus#{@id}", "minus#{@id}", "sublist#{@id}" + end + end end |