IZ tying the publisher to fb in public aspect

This commit is contained in:
ilya 2010-09-23 16:06:55 -07:00
parent fc2cf4fde6
commit be10681945
4 changed files with 22 additions and 3 deletions

View file

@ -14,6 +14,16 @@ class StatusMessagesController < ApplicationController
data = clean_hash params[:status_message] data = clean_hash params[:status_message]
if @logged_in && params[:status_message][:to] == :public
id = 'me'
type = 'feed'
@res = MiniFB.post(@access_token, id, :type=>type,
:metadata=>true, :params=>{:message => params[:status_message][:message]})
params[:status_message][:to] == :all
end
@status_message = current_user.post(:status_message, data) @status_message = current_user.post(:status_message, data)
respond_with @status_message respond_with @status_message
end end

View file

@ -10,7 +10,10 @@
= render "shared/aspect_friends" = render "shared/aspect_friends"
- content_for :publish do - content_for :publish do
- if @logged_in
= render "shared/publisher", :aspect_ids => :public = render "shared/publisher", :aspect_ids => :public
- else
= render "shared/publisher", :aspect_ids => :all
%h3 Facebook %h3 Facebook
%p %p

View file

@ -12,7 +12,7 @@
= link_to "All Aspects", root_url = link_to "All Aspects", root_url
%ul{ :style => "position:absolute;right:0;bottom:0.01em;"} %ul{ :style => "position:absolute;right:0;bottom:0.01em;"}
%li{:class => ("selected" if @aspect == :all)} %li{:class => ("selected" if @aspect == :public)}
= link_to "Public", aspects_public_path = link_to "Public", aspects_public_path
%li{ :style => "margin-right:0;", :class => ("selected" if @aspect == :manage)} %li{ :style => "margin-right:0;", :class => ("selected" if @aspect == :manage)}

View file

@ -16,7 +16,13 @@
going to... going to...
- for aspect in @aspects - for aspect in @aspects
%li %li
= check_box_tag("aspect_ids[]", aspect.id, @aspect == :all || current_aspect?(aspect) ) = check_box_tag("aspect_ids[]", aspect.id, @aspect == :public || @aspect == :all || current_aspect?(aspect) )
= aspect.name = aspect.name
= f.submit "Share" = f.submit "Share"
- if @logged_in
- @response_hash = MiniFB.get(@access_token, 'me')
= "going to Facebook as #{@response_hash[:name]}"