<% if notice %>

<%= notice %>

<% end %>

<%= post.title %>

<%= t("posts.status_#{post.status}") %>

<% if post.cover %>

<%= post.title %>

<% end %>

<%= post.body %>

<%= t('posts.last_activity', when: l(post.updated_at)) %>

<%= t('likes.count', count: likes_count(post)) %> <% if user_signed_in? %> <% own_like = current_user_like(post) %> <% if own_like %> <%== button_to(t('likes.unlike'), "/likes/#{own_like.id}", method: :delete) %> <% else %> <%== button_to(t('likes.like'), "/likes?likeable_type=Post&likeable_id=#{post.id}") %> <% end %> <% end %>

<% if post.giveaway? %>

<% if post.giveaway_sold_out? %> <%= t('claims.sold_out_label') %> <% else %> <%= t('claims.remaining_label', count: post.giveaway_remaining) %> <% end %> <% if user_signed_in? %> <% if current_user_claim(post) %> <%= t('claims.already_claimed_label') %> <% elsif !post.giveaway_sold_out? %> <%== button_to(t('claims.claim_button'), "/posts/#{post.to_param}/claims") %> <% end %> <% end %>

<% end %>

<%== link_to(t('posts.back_to_list'), url_for(:posts)) %>

<% if current_user && current_user.id == post.user_id %>

<%== link_to(t('posts.edit_link'), url_for(:edit_post, slug: post.to_param)) %>

<% if post.published? %> <%== button_to(t('posts.unpublish'), url_for(:unpublish_post, slug: post.to_param), method: :patch) %> <% else %> <%== button_to(t('posts.publish'), url_for(:publish_post, slug: post.to_param), method: :patch) %> <% end %> <%== button_to(t('posts.delete'), url_for(:post, slug: post.to_param), method: :delete, data_confirm: t('posts.confirm_delete')) %> <%== link_to(t('posts.trash_heading'), url_for(:trash_posts)) %> <% end %>

<%= t('comments.heading') %>

<%== link_to(t('comments.view_all_link'), url_for(:comments, post_id: post.to_param)) %>

<% if comments.empty? %>

<%= t('comments.empty') %>

<% else %> <% end %> <% if user_signed_in? %> <% form_for(new_comment, url: "/posts/#{post.to_param}/comments", method: :post) do |f| %>

<%== f.label(:author, t('comments.author_label')) %> <%== f.text_field(:author) %>

<%== f.label(:body, t('comments.body_label')) %> <%== f.text_area(:body) %>

<%== f.submit(t('comments.submit')) %> <% end %> <% end %>