refactor mobile stream post_stats
This commit is contained in:
parent
99f42cb643
commit
bf3d903c11
3 changed files with 29 additions and 42 deletions
|
|
@ -1,18 +1 @@
|
|||
.comment_container
|
||||
.post_stats
|
||||
- if @post.public?
|
||||
%span.reshare_count
|
||||
= @post.reshares.size
|
||||
|
||||
%span.comment_count
|
||||
= @post.comments.size
|
||||
%span.like_count
|
||||
= @post.likes.size
|
||||
|
||||
%ul.comments
|
||||
= render :partial => 'comments/comment', :collection => @comments, :locals => {:post => @post}
|
||||
|
||||
%li.comment.add_comment_bottom_link_container
|
||||
= link_to "#", :class => "show_comments bottom_collapse active" do
|
||||
= image_tag 'icons/arrow_up_small.png'
|
||||
= link_to t('comments.new_comment.comment'), new_post_comment_path(@post), :class => 'add_comment_bottom_link btn comment_action inactive'
|
||||
= render :partial => 'shared/post_stats', :locals => { :post => @post}
|
||||
21
app/views/shared/_post_stats.mobile.haml
Normal file
21
app/views/shared/_post_stats.mobile.haml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
.comment_container
|
||||
.post_stats
|
||||
- if @post.public?
|
||||
%span.reshare_count
|
||||
= @post.reshares.size
|
||||
|
||||
%span.comment_count
|
||||
= @post.comments.size
|
||||
|
||||
%span.like_count
|
||||
= @post.likes.size
|
||||
|
||||
%ul.comments
|
||||
= render partial: "comments/comment", collection: @post.comments, locals: {post: @post}
|
||||
|
||||
%li.comment.add_comment_bottom_link_container
|
||||
= link_to "#", class: "show_comments bottom_collapse active" do
|
||||
= image_tag "icons/arrow_up_small.png"
|
||||
|
||||
- if user_signed_in?
|
||||
= link_to t("comments.new_comment.comment"), new_post_comment_path(@post), class: "add_comment_bottom_link btn comment_action inactive"
|
||||
|
|
@ -2,24 +2,24 @@
|
|||
-# licensed under the Affero General Public License version 3 or later. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
.stream_element{:data=>{:guid=>post.id}}
|
||||
.stream_element{data: {guid: post.id}}
|
||||
- if post.respond_to?(:nsfw) && post.nsfw
|
||||
.shield_wrapper
|
||||
.shield
|
||||
%strong #NSFW
|
||||
|
|
||||
= link_to t('javascripts.stream.show_nsfw_post'), '#'
|
||||
= link_to t("javascripts.stream.show_nsfw_post"), "#"
|
||||
|
||||
- if post.is_a?(Reshare)
|
||||
= render 'reshares/reshare', :reshare => post, :post => post.absolute_root
|
||||
= render "reshares/reshare", reshare: post, post: post.absolute_root
|
||||
|
||||
= render 'shared/photo_area', :post => post
|
||||
= render "shared/photo_area", post: post
|
||||
|
||||
.content
|
||||
= render 'shared/post_info', :post => post
|
||||
= render "shared/post_info", post: post
|
||||
|
||||
- if post.is_a?(StatusMessage)
|
||||
= render 'status_messages/status_message', :post => post, :photos => post.photos
|
||||
= render "status_messages/status_message", post: post, photos: post.photos
|
||||
|
||||
.bottom_bar
|
||||
.floater
|
||||
|
|
@ -30,22 +30,5 @@
|
|||
!= reactions_link(post)
|
||||
|
||||
- if defined?(expanded_info) && expanded_info
|
||||
.comment_container
|
||||
.post_stats
|
||||
- if post.public?
|
||||
%span.reshare_count
|
||||
= post.reshares.size
|
||||
|
||||
%span.comment_count
|
||||
= post.comments.size
|
||||
|
||||
%span.like_count
|
||||
= post.likes.size
|
||||
|
||||
%ul.comments
|
||||
= render :partial => 'comments/comment', :collection => post.comments.order('created_at ASC')
|
||||
|
||||
%li.comment.add_comment_bottom_link_container
|
||||
- if user_signed_in?
|
||||
= link_to t('comments.new_comment.comment'), new_post_comment_path(post), :class => 'add_comment_bottom_link btn comment_action inactive'
|
||||
= render partial: "shared/post_stats", locals: {post: @post}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue