From 48c212c1ab8e1e46a026bf07cbb102203ff32020 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 12:18:26 -0700 Subject: [PATCH] made a public view, copied the fb publisher there --- app/controllers/aspects_controller.rb | 10 ++++++++++ app/views/shared/_aspect_nav.haml | 2 ++ config/fb_config.yml | 2 +- config/routes.rb | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 779ce0f6f..9112792c1 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -45,6 +45,16 @@ class AspectsController < ApplicationController respond_with @aspect end + def public + @fb_access_url = MiniFB.oauth_url(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create", + :scope=>MiniFB.scopes.join(",")) + + @posts = current_user.visible_posts(:by_members_of => :all).paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC' + @aspect = :all + + respond_with @aspect + end + def manage @aspect = :manage @remote_requests = Request.for_user(current_user).all diff --git a/app/views/shared/_aspect_nav.haml b/app/views/shared/_aspect_nav.haml index 55da1bcdf..ebfd2b57d 100644 --- a/app/views/shared/_aspect_nav.haml +++ b/app/views/shared/_aspect_nav.haml @@ -12,6 +12,8 @@ = link_to "All Aspects", root_url %ul{ :style => "position:absolute;right:0;bottom:0.01em;"} + %li{:class => ("selected" if @aspect == :all)} + = link_to "Public", aspects_public_path %li{ :style => "margin-right:0;", :class => ("selected" if @aspect == :manage)} = link_to ( (@request_count == 0)? "Manage Aspects" : "Manage Aspects (#{@request_count})"), {:controller => :aspects, :action => :manage}, :class => "edit_aspect_button", :class => new_request(@request_count), :title => "Manage your Aspects" diff --git a/config/fb_config.yml b/config/fb_config.yml index 7b69791e5..4c3309fac 100644 --- a/config/fb_config.yml +++ b/config/fb_config.yml @@ -1,4 +1,4 @@ fb_api_key: {dcf4e90df086cf6d3e531b31e043ff32} -fb_secret: {36917c2878d658b8c575952b6a78e3c3} +fb_secret: {7fe864834726f8a5e65bc93928b99a53} fb_app_id: {120373411325347} host: http://localhost:3000/ diff --git a/config/routes.rb b/config/routes.rb index 269622156..112ff5768 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -16,6 +16,7 @@ Diaspora::Application.routes.draw do match 'aspects/move_friends', :to => 'aspects#move_friends', :as => 'move_friends' match 'aspects/move_friend', :to => 'aspects#move_friend', :as => 'move_friend' match 'aspects/manage', :to => 'aspects#manage' + match 'aspects/public', :to => 'aspects#public' resources :aspects, :except => [:edit] match 'services/create', :to => "services#create"