Files
redux-scraper/app/views/domain/inkbunny/posts/show.html.erb
2024-12-19 06:04:37 +00:00

30 lines
1.5 KiB
Plaintext

<div class='max-w-5xl mx-auto w-full px-6 sm:px-8'>
<%= link_to "← Back to Posts", domain_inkbunny_posts_path, class: "text-blue-600 hover:underline mb-4 inline-block" %>
<div class="text-center">
<h1 class='text-2xl'><%= @post.title %></h1>
<div class='text-stone-500 text-sm mt-2'>
by <%= link_to @post.creator.name, @post.creator, class: 'hover:underline' %>
</div>
</div>
</div>
<div class='mx-auto mt-4'>
<div class='text-stone-600 mb-4'>
<div>Post ID: <%= link_to "https://inkbunny.net/s/#{@post.ib_post_id}", target: "_blank", class: "text-blue-600 hover:underline inline-flex items-center" do %>
<%= @post.ib_post_id %>
<%= render partial: "shared/icons/external_link", locals: { class_name: "w-4 h-4 ml-1" } %>
<% end %></div>
<div>Type: <%= @post.submission_type.titleize %></div>
<div>Rating: <%= @post.rating.titleize %></div>
<div>Posted: <%= @post.posted_at.strftime("%B %d, %Y at %I:%M %p") %> (<%= time_ago_in_words(@post.posted_at) %> ago)</div>
<div>Scanned: <%= @post.created_at.strftime("%B %d, %Y at %I:%M %p") %> (<%= time_ago_in_words(@post.created_at) %> ago)</div>
</div>
<div class='flex flex-row gap-6 flex-wrap justify-center p-4'>
<% @post.files.each do |file| %>
<% img_src_path = contents_blob_path(HexUtil.bin2hex(file.blob_entry_sha256), format: "jpg") %>
<div class="rounded-lg overflow-hidden shadow-lg">
<img class='max-w-[400px] w-full h-auto' alt='<%= @post.title %>' src='<%= img_src_path %>' />
</div>
<% end %>
</div>
</div>