fb_status partial rendered in public

This commit is contained in:
ilya 2010-09-24 15:04:31 -07:00
parent bb58678556
commit ac9854596f
3 changed files with 20 additions and 1 deletions

View file

@ -18,7 +18,8 @@ class FbStatus
def self.from_api(json) def self.from_api(json)
hash = JSON.parse(json) hash = JSON.parse(json)
self.create( #just keeping them in memory for now
self.new(
:graph_id => hash['id'], :graph_id => hash['id'],
:author_id => hash['from']['id'] :author_id => hash['from']['id']
:author_name => hash['from']['name'], :author_name => hash['from']['name'],

View file

@ -18,6 +18,11 @@
%ul#stream %ul#stream
- for post in @posts - for post in @posts
= render type_partial(post), :post => post unless post.class == Album = render type_partial(post), :post => post unless post.class == Album
- if @logged_in
- MiniFB.get(@access_token, 'me', :type => "feed").each do |item|
- if item['type'] == 'status'
= render "fb_status", :post => FbStatus.from_api()
#pagination #pagination
= will_paginate @posts = will_paginate @posts

View file

@ -0,0 +1,13 @@
-# Copyright (c) 2010, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3. See
-# the COPYRIGHT file.
%li.message{:id => post.id, :class => ("mine" if current_user.owns?(post))}
= image_tag( "http://graph.facebook.com/#{post.author_id}/picture" )
.content
%span.from
= post.author_name
= post.message