diff --git a/app/models/comment.rb b/app/models/comment.rb index 63e46cb19..24b95941f 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -23,6 +23,7 @@ class Comment < ActiveRecord::Base t.add :guid t.add :text t.add :author + t.add :created_at end diff --git a/app/models/post.rb b/app/models/post.rb index 9780e88b6..87572b783 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -15,6 +15,7 @@ class Post < ActiveRecord::Base t.add :id t.add :guid t.add :text + t.add :public t.add :created_at t.add :comments_count t.add :last_three_comments diff --git a/app/models/services/facebook.rb b/app/models/services/facebook.rb index 7564637c3..45ee847e0 100644 --- a/app/models/services/facebook.rb +++ b/app/models/services/facebook.rb @@ -42,6 +42,7 @@ class Services::Facebook < Service end def save_friends + return url = "https://graph.facebook.com/me/friends?fields[]=name&fields[]=picture&access_token=#{URI.escape(self.access_token)}" response = Faraday.get(url) data = JSON.parse(response.body)['data'] diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 7deaa9ecc..77629ef9f 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -60,7 +60,8 @@ - if @person %link{:rel => "alternate", :href => "#{@person.public_url}.atom", :type => "application/atom+xml", :title => "#{t('.public_feed', :name => @person.name)}"} - %body{:class => "#{yield(:body_class)}", 'data-current-user-metadata' => CGI::escape(current_user.person.as_api_response(:backbone).to_json) } + - metadata = user_signed_in? ? CGI::escape({:current_user => current_user.person.as_api_response(:backbone)}.to_json) : "" + %body{:class => "#{yield(:body_class)}", 'data-current-user-metadata' => metadata } - unless @page == :logged_out - flash.each do |name, msg| diff --git a/app/views/shared/_stream_element.html.underscore b/app/views/shared/_stream_element.html.underscore index a9c7d9f61..040856cb5 100644 --- a/app/views/shared/_stream_element.html.underscore +++ b/app/views/shared/_stream_element.html.underscore @@ -1,8 +1,11 @@
+ +
+
+-
+
+ Show <%= comments_count - 3 %> more comments
+
+
+
+ +<% _.each(last_three_comments, function(comment) { %>-
@@ -74,9 +96,11 @@
-