diff --git a/app/views/status_messages/show.html.haml b/app/views/status_messages/show.html.haml
index 83cada857..59d12ef3f 100644
--- a/app/views/status_messages/show.html.haml
+++ b/app/views/status_messages/show.html.haml
@@ -1,32 +1,42 @@
-# Copyright (c) 2010, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
-
-
.span-16.append-4.prepend-4.last
- #original_post_info
- = render 'shared/author_info', :person => @status_message.author, :post => @status_message
-
- #show_text
- %p
- = markdownify(@status_message.text, :youtube_maps => @status_message[:youtube_titles])
-
- - for photo in @status_message.photos
- = link_to (image_tag photo.url(:thumb_small), :class => 'thumb_small'), photo_path(photo)
-
- %p.time
- = how_long_ago(@status_message)
-
- %hr
-
- = link_to t('.permalink'), post_path(@status_message) if @status_message.public
- %br
- - if current_user.owns? @status_message
- = link_to t('.destroy'), @status_message, :confirm => t('are_you_sure'), :method => :delete
-
-
- %h5
- = t('_comments')
- #status_message_stream.stream.show
- %div{:data=>{:guid=>@status_message.id}}
- = render "comments/comments", :post => @status_message, :comments => @status_message.comments, :always_expanded => true
+ #main_stream.stream.status_message_show
+ = render 'shared/stream_element', :post => @status_message, :all_aspects => @status_message.aspects
+%br
+%br
+%br
+/.span-16.append-4.prepend-4.last
+/ #original_post_info
+/ = render 'shared/author_info', :person => @status_message.author, :post => @status_message
+/
+/ #show_text
+/ %p
+/ = markdownify(@status_message.text, :youtube_maps => @status_message[:youtube_titles])
+/
+/ - for photo in @status_message.photos
+/ = link_to (image_tag photo.url(:thumb_small), :class => 'thumb_small'), photo_path(photo)
+/
+/ %p.time
+/ = how_long_ago(@status_message)
+/ - unless (defined?(@commenting_disabled) && @commenting_disabled)
+/ %span.like_action
+/ = like_action(@status_message, current_user)
+/
+/ %hr
+//
+/ = link_to t('.permalink'), post_path(@status_message) if @status_message.public
+/ %br
+/ - if current_user.owns? @status_message
+/ = link_to t('.destroy'), @status_message, :confirm => t('are_you_sure'), :method => :delete
+/
+/
+//
+/ .likes
+/ - if @status_message.likes.count > 0
+/ = render "likes/likes", :post_id => @status_message.id, :likes => @status_message.likes, :dislikes => @status_message.dislikes, :current_user => current_user
+/
+/ #status_message_stream.stream.show
+/ %div{:data=>{:guid=>@status_message.id}}
+/ = render "comments/comments", :post => @status_message, :comments => @status_message.comments, :always_expanded => true
diff --git a/config/assets.yml b/config/assets.yml
index d354dd0e8..e18c138ec 100644
--- a/config/assets.yml
+++ b/config/assets.yml
@@ -34,6 +34,7 @@ javascripts:
- public/javascripts/widgets/directionDetector.js
- public/javascripts/widgets/notifications.js
- public/javascripts/widgets/flashes.js
+ - public/javascripts/widgets/post.js
- public/javascripts/view.js
- public/javascripts/stream.js
- public/javascripts/content-updater.js
diff --git a/public/javascripts/content-updater.js b/public/javascripts/content-updater.js
index 7cb24d308..0f1e115c7 100644
--- a/public/javascripts/content-updater.js
+++ b/public/javascripts/content-updater.js
@@ -4,6 +4,9 @@
*/
var ContentUpdater = {
+ elementWithGuid: function(selector, guid) {
+ return $(selector + "[data-guid='" + guid + "']");
+ },
addPostToStream: function(html) {
var streamElement = $(html);
var postId = streamElement.attr("data-guid");
@@ -21,5 +24,15 @@ var ContentUpdater = {
Diaspora.widgets.timeago.updateTimeAgo();
Diaspora.widgets.directionDetector.updateBinds();
}
+ },
+
+ addLikesToPost: function(postId, html) {
+ var post = ContentUpdater.elementWithGuid("div", postId);
+
+ $(".likes_container", post)
+ .fadeOut("fast")
+ .html(html)
+ .fadeIn("fast");
}
+
};
\ No newline at end of file
diff --git a/public/javascripts/stream.js b/public/javascripts/stream.js
index 0b8ac86e1..14cb9ee51 100644
--- a/public/javascripts/stream.js
+++ b/public/javascripts/stream.js
@@ -42,15 +42,6 @@ var Stream = {
this.setUpComments();
- $("a.expand_likes", this.selector).live('click',function(evt) {
- evt.preventDefault();
- $(this).siblings(".likes_list").fadeToggle("fast");
- });
-
- $("a.expand_dislikes", this.selector).live('click',function(evt) {
- evt.preventDefault();
- $(this).siblings(".dislikes_list").fadeToggle("fast");
- });
},
setUpComments: function(){
@@ -88,21 +79,8 @@ var Stream = {
});
},
- setUpLikes: function() {
- var likes = $(".like_it, .dislike_it", this.selector);
-
- likes.live("ajax:loading", function() {
- $(this).parent().fadeOut("fast");
- });
-
- likes.live("ajax:failure", function() {
- Diaspora.widgets.alert.alert(Diaspora.widgets.i18n.t("failed_to_like"));
- $(this).parent().fadeIn("fast");
- });
- },
-
setUpAudioLinks: function() {
- $(".stream a[target='_blank']").each(function() {
+ $(".stream a[target='_blank']").each(function(r){
var link = $(this);
if(this.href.match(/\.mp3$|\.ogg$/)) {
$("", {
diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass
index c8e0cdc33..556af64db 100644
--- a/public/stylesheets/sass/application.sass
+++ b/public/stylesheets/sass/application.sass
@@ -456,7 +456,24 @@ ul.dropdown
.from
a
:color $blue
+.status_message_show
+ .stream_element
+ .content
+ p
+ :font
+ :size 1em
+ .comments
+ :padding
+ :bottom 6px
+ > li:last-child
+ :border-bottom none
+ .comment_box
+ :width 475px
+ :margin
+ :bottom 5px
+
+
.time,
.timeago,
.via
@@ -583,10 +600,21 @@ ul.dropdown
.stream ul.comments
+ :padding
+ :bottom 6px
+
+ > li:last-child
+ :border-bottom none
+
.avatar
:width 30px
:height 30px
+ .comment_box
+ :margin
+ :bottom 5px
+
+
.submit_button
:text
:align right
diff --git a/spec/javascripts/support/jasmine.yml b/spec/javascripts/support/jasmine.yml
index 4c2e7b287..5bd842d0d 100644
--- a/spec/javascripts/support/jasmine.yml
+++ b/spec/javascripts/support/jasmine.yml
@@ -32,6 +32,7 @@ src_files:
- public/javascripts/widgets/infinite-scroll.js
- public/javascripts/widgets/notifications.js
- public/javascripts/widgets/flashes.js
+ - public/javascripts/widgets/post.js
- public/javascripts/mobile.js
- public/javascripts/contact-list.js
- public/javascripts/web-socket-receiver.js