diaspora/app/views/shared/_stream_element.mobile.haml

46 lines
1.9 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
.floater
= link_to '', new_post_comment_path(post), :class => "image_link comment_action inactive"
- 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"
- if post.comments.length + post.likes_count > 0
= link_to "#{t('reactions', :count => (post.comments.length + post.likes_count))}", post_comments_path(post, :format => "mobile"), :class => 'show_comments'
- else
%span.show_comments
= "#{t('reactions', :count => (post.comments.length + post.likes_count))}"