- post ||= @post - with_context ||= false - without_author ||= false - preview ||= false %div.post{:id => post.dom_id} %div{:class => post.first? ? 'first_post' : 'reply'} .post_header - if admin? .post_control %p.post_admin = link_to t("edit"), edit_topic_post_url(post.topic, post), :class => 'edit_post', :id => "revise_post_#{post.id}" %span.separator | = link_to t("remove"), topic_post_url(post.topic, post), :method => 'delete', :class => 'delete_post', :id => "delete_post_#{post.id}", :title => "remove post", :confirm => "Are you sure you want to delete this message?" %p.context - if with_context %a{:href => forum_topic_url(post.topic.forum, post.topic, :anchor => "post_#{post.id}"), :class => post.first? ? 'speaker begun' : 'speaker replied'} = gravatar_for(post.reader, {:size => 40}, {:alt => post.reader.name, :class => 'gravatar offset', :width => '40', :height => '40'}) = post.topic.name - else %a{:href => reader_url(post.reader), :class => 'speaker'} = gravatar_for(post.reader, {:size => 40}, {:alt => post.reader.name, :class => 'gravatar offset', :width => '40', :height => '40'}) = post.reader.name - if with_context = link_to post.reader.name, reader_url(post.reader) - if post.first? = t('started_topic_on', :date => friendly_date(post.created_at)) - else = t('replied_on', :date => friendly_date(post.created_at)) - else - if post.updated_at && post.updated_at > post.created_at = t('posted_and_updated_on', :posted => friendly_date(post.created_at), :updated => friendly_date(post.updated_at)) - if post.updated_by != post.created_by = t('by') = post.updated_by.name - else = t('posted_on', :date => friendly_date(post.created_at)) - if post.editable_by?(current_reader) %br %span.still_editable - if post.editable_interval = t('time_remaining_to_edit', :time => distance_of_time_in_words(post.still_editable_for)) = link_to t('edit_your_post'), edit_topic_post_url(post.topic, post), :class => 'edit_post', :id => "revise_post_#{post.id}" .post_wrapper .post_body - if post.frozen? %p = t('post_removed') - elsif preview = truncate_and_textilize(post.body, 100) - else = clean_textilize(post.body) - unless post.attachments.empty? .post_attachments %h4 attached: - post.attachments.images.each do |att| = link_to image_tag(att.thumbnail), att.file.url, :class => :thumbnail - if post.attachments.non_images.any? %ul.attachments - post.attachments.non_images.each do |att| %li = link_to att.filename, att.file.url, :class => "attachment #{att.extension}"