Put avatar on cmment form all the time, fix socketed comment form
This commit is contained in:
parent
f1c63939f9
commit
a307519e94
6 changed files with 19 additions and 21 deletions
|
|
@ -12,9 +12,9 @@ module StreamHelper
|
|||
end
|
||||
end
|
||||
|
||||
def new_comment_form(post_id)
|
||||
def new_comment_form(post_id, current_user)
|
||||
@form ||= controller.render_to_string(
|
||||
:partial => 'comments/new_comment', :locals => {:post_id => GSUB_THIS})
|
||||
:partial => 'comments/new_comment', :locals => {:post_id => GSUB_THIS, :current_user => current_user})
|
||||
@form.gsub(GSUB_THIS, post_id.to_s)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -19,4 +19,4 @@
|
|||
|
||||
- unless @commenting_disabled
|
||||
%li.comment.show
|
||||
= new_comment_form(post_id)
|
||||
= new_comment_form(post_id, current_user)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
-# the COPYRIGHT file.
|
||||
|
||||
= form_tag( comments_path, :id => "new_comment_on_#{post_id}", :class => 'new_comment', :remote => true) do
|
||||
= owner_image_tag
|
||||
= person_image_tag(current_user, nil)
|
||||
%p
|
||||
= label_tag "comment_text_on_#{post_id}", t('.comment')
|
||||
= text_area_tag :text, nil, :rows => 2, :class => "comment_box",:id => "comment_text_on_#{post_id}"
|
||||
|
|
@ -34,4 +34,4 @@
|
|||
%span.timeago= link_to(how_long_ago(post), status_message_path(post))
|
||||
= link_to t('comments.new_comment.comment').downcase, '#', :class => 'focus_comment_textarea'
|
||||
|
||||
= render "comments/comments", :post_id => post.id, :comments => post.comments, :condensed => true, :commenting_disabled => defined?(@commenting_disabled)
|
||||
= render "comments/comments", :post_id => post.id, :comments => post.comments, :current_user => current_user, :condensed => true, :commenting_disabled => defined?(@commenting_disabled)
|
||||
|
|
|
|||
|
|
@ -120,10 +120,12 @@ var WebSocketReceiver = {
|
|||
|
||||
addPostToStream: function(postId, html) {
|
||||
if( $(".stream_element[data-guid='" + postId + "']").length == 0 ) {
|
||||
var streamElement = $(html);
|
||||
|
||||
var showMessage = function() {
|
||||
$("#main_stream:not('.show')").prepend(
|
||||
$(html).fadeIn("fast", function() {
|
||||
$("#main_stream").find("label").first().inFieldLabels();
|
||||
streamElement.fadeIn("fast", function() {
|
||||
streamElement.find("label").inFieldLabels();
|
||||
})
|
||||
);
|
||||
};
|
||||
|
|
@ -133,9 +135,8 @@ var WebSocketReceiver = {
|
|||
} else {
|
||||
showMessage();
|
||||
}
|
||||
Diaspora.widgets.timeago.updateTimeAgo();
|
||||
}
|
||||
Diaspora.widgets.timeago.updateTimeAgo();
|
||||
$("label").inFieldLabels();
|
||||
},
|
||||
|
||||
onPageForClass: function(className) {
|
||||
|
|
|
|||
|
|
@ -600,10 +600,16 @@ ul.show_comments
|
|||
:size 1em
|
||||
:margin
|
||||
:bottom -3px
|
||||
:width 482px
|
||||
:width 445px
|
||||
:min-height 23px
|
||||
|
||||
.avatar
|
||||
:display none
|
||||
p
|
||||
:position relative
|
||||
:left 36px
|
||||
|
||||
.avatar
|
||||
:position absolute
|
||||
:display inline
|
||||
|
||||
form.open
|
||||
.submit_button
|
||||
|
|
@ -611,18 +617,9 @@ ul.show_comments
|
|||
:margin
|
||||
:bottom 2px
|
||||
:right 2px
|
||||
|
||||
textarea
|
||||
:min-height 2.4em
|
||||
:width 445px
|
||||
|
||||
p
|
||||
:position relative
|
||||
:left 36px
|
||||
|
||||
.avatar
|
||||
:position absolute
|
||||
:display inline
|
||||
|
||||
.stream.show
|
||||
ul.comments
|
||||
|
|
|
|||
Loading…
Reference in a new issue