diaspora/app/views/shared/_stream_element.mobile.haml
2011-09-27 21:09:26 -07:00

63 lines
2.5 KiB
Text

-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
.stream_element{:data=>{:guid=>post.id}}
.photo_area
- if post.is_a?(StatusMessage) && post.photos.size > 0
- photos = post.photos
.photo_attachments
= image_tag photos.first.url(:thumb_large), :class => "stream-photo big-stream-photo", 'data-small-photo' => photos.first.url(:thumb_medium), 'data-full-photo' => photos.first.url
- elsif post.activity_streams?
= image_tag post.image_url
.content
.from
= person_image_link(post.author, :size => :thumb_small)
= person_link(post.author)
.info
%span.time{:integer => post.created_at.to_i}
= t('ago', :time => time_ago_in_words(post.created_at))
%span.via
- if post.activity_streams?
= t('.via', :link => link_to("#{post.provider_display_name}", post.actor_url)).html_safe
- if reshare?(post)
= render 'reshares/reshare', :reshare => post, :post => post.root
- elsif post.is_a?(StatusMessage)
= render 'status_messages/status_message', :post => post, :photos => post.photos
.bottom_bar
- if defined?(expanded_info) && expanded_info
#bottom_bar_tabs
.comment_count.tab
= post.comments.size
= link_to '', post_path(post), :class => "image_link comment_action"
.like_count.tab
= post.likes.size
- if current_user.liked?(post)
= link_to '', post_likes_path(post.id), :class => "image_link like_action active", 'data-post-id' => post.id, 'data-like-id' => current_user.like_for(post).id
- else
= link_to '', post_likes_path(post.id), :class => "image_link like_action inactive"
/.reshare_count.tab
/ = post.comments.size
/ = link_to '', post_path(post), :class => "image_link comment_action"
= render "comments/comments", :post => post, :comments => post.comments, :comments_expanded => true
- else
.floater
= link_to '', post_path(post), :class => "image_link comment_action"
- if current_user.liked?(post)
= link_to '', post_like_path(post.id, current_user.like_for(post).id), :class => "image_link like_action active"
- else
= link_to '', post_likes_path(post.id), :class => "image_link like_action inactive"
= link_to "#{t('reactions', :count => (post.comments.length + post.likes_count))}", post_comments_path(post), :class => 'show_comments'