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

51 lines
2.4 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
.big_stream_photo
= link_to (image_tag photos.first.url(:thumb_large), :class => "stream-photo", 'data-small-photo' => photos.first.url(:thumb_medium), 'data-full-photo' => photos.first.url), photo_path(photos.first), :class => "stream-photo-link"
- if photos.size > 1
- if photos.size >= 8
- for photo in photos[1..8]
= link_to (image_tag photo.url(:thumb_small), :class => 'stream-photo thumb_small', 'data-small-photo' => photo.url(:thumb_medium), 'data-full-photo' => photo.url), photo_path(photo), :class => 'stream-photo-link'
- else
- for photo in photos[1..photos.size]
= link_to (image_tag photo.url(:thumb_small), :class => 'stream-photo thumb_small', 'data-small-photo' => photo.url(:thumb_medium), 'data-full-photo' => photo.url), photo_path(photo), :class => 'stream-photo-link'
- 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 "reshare"
= link_to '', post_path(post), :class => "image_link comment_action"
- if current_user.liked?(post)
= link_to '', '#', :class => "image_link like_action active", 'data-post-id' => post.id, 'data-like-id' => current_user.like_for(post).id
- else
= link_to '', '#', :class => "image_link like_action inactive", 'data-post-id' => post.id
= link_to "#{t('comments', :count => post.comments.length)}", post_path(post), :class => 'comment_link'