Fix some ui bugs on the post show page
This commit is contained in:
parent
27f78dd1ad
commit
4a9900dff6
6 changed files with 16 additions and 10 deletions
|
|
@ -9,7 +9,7 @@ class AspectsController < ApplicationController
|
||||||
|
|
||||||
respond_to :html, :js
|
respond_to :html, :js
|
||||||
respond_to :json, :only => [:show, :create]
|
respond_to :json, :only => [:show, :create]
|
||||||
|
|
||||||
helper_method :tags, :tag_followings
|
helper_method :tags, :tag_followings
|
||||||
helper_method :all_aspects_selected?
|
helper_method :all_aspects_selected?
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -123,4 +123,8 @@ class StatusMessagesController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
helper_method :comments_expanded
|
||||||
|
def comments_expanded
|
||||||
|
true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -24,4 +24,8 @@ module StreamHelper
|
||||||
post.created_at
|
post.created_at
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def comments_expanded
|
||||||
|
false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,14 @@
|
||||||
-# licensed under the Affero General Public License version 3 or later. See
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
-# the COPYRIGHT file.
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
- is_expanded = defined?(always_expanded) && always_expanded
|
- unless comments_expanded
|
||||||
|
%ul.show_comments{:class => ("hidden" if comments.size <= 3)}
|
||||||
- unless is_expanded
|
|
||||||
%ul.show_comments{:class => ("hidden" unless comments.size > 3)}
|
|
||||||
%li
|
%li
|
||||||
%b= comment_toggle(comments.size)
|
%b= comment_toggle(comments.size)
|
||||||
|
|
||||||
%ul.comments{:id => post.id, :class => ("hidden" if comments.size == 0 && !defined?(force_open) && !is_expanded)}
|
%ul.comments{:id => post.id, :class => ("hidden" if comments.size == 0 && !comments_expanded)}
|
||||||
-if comments.size > 3
|
-if comments.size > 3
|
||||||
.older_comments{:class => ("hidden inactive" if defined?(condensed) && condensed)}
|
.older_comments{:class => ("hidden inactive" unless comments_expanded)}
|
||||||
= render :partial => 'comments/comment', :collection => comments[0..-4], :locals => {:post => post}
|
= render :partial => 'comments/comment', :collection => comments[0..-4], :locals => {:post => post}
|
||||||
= render :partial => 'comments/comment', :collection => comments[-3, 3], :locals => {:post => post}
|
= render :partial => 'comments/comment', :collection => comments[-3, 3], :locals => {:post => post}
|
||||||
-else
|
-else
|
||||||
|
|
|
||||||
|
|
@ -59,4 +59,4 @@
|
||||||
- if post.likes_count > 0
|
- if post.likes_count > 0
|
||||||
= render "likes/likes_container", :post_id => post.id, :likes_count => post.likes_count, :current_user => current_user
|
= render "likes/likes_container", :post_id => post.id, :likes_count => post.likes_count, :current_user => current_user
|
||||||
|
|
||||||
= render "comments/comments", :post => post, :comments => post.comments, :current_user => current_user, :condensed => true, :commenting_disabled => (defined?(@commenting_disabled) && @commenting_disabled)
|
= render "comments/comments", :post => post, :comments => post.comments, :current_user => current_user, :commenting_disabled => (defined?(@commenting_disabled) && @commenting_disabled)
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ var Stream = {
|
||||||
// collapse long comments
|
// collapse long comments
|
||||||
$(".comment .content span", this.selector).expander({
|
$(".comment .content span", this.selector).expander({
|
||||||
slicePoint: 200,
|
slicePoint: 200,
|
||||||
widow: 12,
|
widow: 400,
|
||||||
expandText: Diaspora.widgets.i18n.t("show_more"),
|
expandText: Diaspora.widgets.i18n.t("show_more"),
|
||||||
userCollapse: false
|
userCollapse: false
|
||||||
});
|
});
|
||||||
|
|
@ -93,7 +93,7 @@ var Stream = {
|
||||||
.removeClass("open");
|
.removeClass("open");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
setUpAudioLinks: function() {
|
setUpAudioLinks: function() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue