59 lines
1.9 KiB
Elixir
59 lines
1.9 KiB
Elixir
<h2><%= post.title %></h2>
|
|
|
|
<p>
|
|
<small><%= BdfrBrowser.RenderUtils.link_to_user(post.author) %></small>
|
|
-
|
|
<small><%= DateTime.to_iso8601(post.posted_at) %></small>
|
|
-
|
|
<a href="https://www.reddit.com<%= post.permalink %>" rel="noreferrer">Open reddit</a>
|
|
</p>
|
|
|
|
<%= unless is_nil(post.selftext) do %>
|
|
<div class="row">
|
|
<blockquote class="blockquote mb-0">
|
|
<%= BdfrBrowser.RenderUtils.selftext(post.selftext) %>
|
|
</blockquote>
|
|
</div>
|
|
<br>
|
|
<% end %>
|
|
|
|
<%= unless Enum.empty?(media.images) do %>
|
|
<div id="carouselImages" class="carousel slide">
|
|
<div class="carousel-inner">
|
|
<%= for {img, i} <- Enum.with_index(media.images) do %>
|
|
<div class="carousel-item <%= if i == 0, do: "active" %>">
|
|
<img src="<%= img %>" class="d-block w-100">
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
|
|
<button class="carousel-control-prev" type="button" data-bs-target="#carouselImages" data-bs-slide="prev">
|
|
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
|
<span class="visually-hidden">Previous</span>
|
|
</button>
|
|
<button class="carousel-control-next" type="button" data-bs-target="#carouselImages" data-bs-slide="next">
|
|
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
|
<span class="visually-hidden">Next</span>
|
|
</button>
|
|
</div>
|
|
<br>
|
|
<% end %>
|
|
|
|
<%= unless Enum.empty?(media.videos) do %>
|
|
<div class="row">
|
|
<%= for video <- media.videos do %>
|
|
<video controls loop>
|
|
<source src="<%= video %>" type="video/mp4">
|
|
</video>
|
|
<% end %>
|
|
</div>
|
|
<br>
|
|
<% end %>
|
|
|
|
<%= for comment when is_nil(comment.parent_id) <- post.comments do %>
|
|
<div class="row" style="margin-bottom: 4px;">
|
|
<div class="d-grid gap-2 col-12 mx-auto">
|
|
<%= EEx.eval_file(comment_template, comment: comment, level: 0, comment_template: comment_template) %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|