diaspora/app/views/shared/_stream_element.html.haml
2011-07-11 14:03:59 -07:00

62 lines
2.9 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-# Copyright (c) 2010, 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}}
- if current_user && post.author.owner_id == current_user.id
.right.controls
= link_to image_tag('deletelabel.png'), post_path(post), :confirm => t('are_you_sure'), :method => :delete, :remote => true, :class => "delete stream_element_delete", :title => t('delete')
- else
.right.controls
= link_to image_tag('deletelabel.png'), post_visibility_path(:id => "42", :post_id => post.id), :method => :put, :remote => true, :class => "delete stream_element_delete", :title => t('hide')
.undo_text.hidden
= t('post_visibilites.update.post_hidden', :name => post.author.name)
= link_to t('undo'), post_visibility_path(:id => "42", :post_id => post.id), :method => :put, :remote => true, :class => "delete stream_element_delete"
.sm_body
= person_image_link(post.author, :size => :thumb_small)
.content
%div.post_initial_info
%span.from
= person_link(post.author, :class => 'hovercardable')
%time.time.timeago{:datetime => post.created_at, :integer => time_for_sort(post).to_i}
%span.details
%span.timeago
= link_to(how_long_ago(post), post_path(post))
- if post.activity_streams?
= link_to image_tag(post.image_url, 'data-small-photo' => post.image_url, 'data-full-photo' => post.image_url, :class => 'stream-photo'), post.object_url, :class => "stream-photo-link"
- else
= render 'status_messages/status_message', :post => post, :photos => post.photos
.info
- if post.public?
%span.post_scope{:title => t('.viewable_to_anyone')}
= t('public')
·
- else
- if post.author.owner_id == current_user.id
%span.post_scope{:title => t('.shared_with', :aspect_names => aspects_with_post(all_aspects, post).map!{|a| a.name}.join(', '))}
= t('limited')
- else
%span.post_scope
= t('limited')
·
%span.via
- if post.activity_streams?
= t('.via', :link => link_to("#{post.provider_display_name}", post.actor_url)).html_safe
·
- unless (defined?(@commenting_disabled) && @commenting_disabled)
%span.like_action
= like_action(post, current_user)
·
= link_to t('comments.new_comment.comment'), '#', :class => 'focus_comment_textarea'
.likes
- if post.likes_count > 0
= render "likes/likes_container", :post_id => post.id, :likes_count => post.likes_count, :current_user => current_user
= render "comments/comments", :post => post, :current_user => current_user, :commenting_disabled => (defined?(@commenting_disabled) && @commenting_disabled)