IZ tying the publisher to fb in public aspect
This commit is contained in:
parent
fc2cf4fde6
commit
be10681945
4 changed files with 22 additions and 3 deletions
|
|
@ -13,6 +13,16 @@ class StatusMessagesController < ApplicationController
|
||||||
params[:status_message][:to] = params[:aspect_ids]
|
params[:status_message][:to] = params[:aspect_ids]
|
||||||
|
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,10 @@
|
||||||
= render "shared/aspect_friends"
|
= render "shared/aspect_friends"
|
||||||
|
|
||||||
- content_for :publish do
|
- content_for :publish do
|
||||||
= render "shared/publisher", :aspect_ids => :public
|
- if @logged_in
|
||||||
|
= render "shared/publisher", :aspect_ids => :public
|
||||||
|
- else
|
||||||
|
= render "shared/publisher", :aspect_ids => :all
|
||||||
|
|
||||||
%h3 Facebook
|
%h3 Facebook
|
||||||
%p
|
%p
|
||||||
|
|
|
||||||
|
|
@ -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)}
|
||||||
|
|
|
||||||
|
|
@ -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]}"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue