66 lines
2.6 KiB
Elixir
66 lines
2.6 KiB
Elixir
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
|
|
<title>BDFR Browser</title>
|
|
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="container">
|
|
<h2><a href="<%= post.url %>"><%= post.title %></a></h2>
|
|
|
|
<p>
|
|
<small><a href="https://reddit.com/user/<%= post.author %>"><%= post.author %></a></small>
|
|
-
|
|
<small><%= trunc(post.created_utc) |> DateTime.from_unix!() |> DateTime.to_iso8601() %></small>
|
|
-
|
|
<a href="https://reddit.com<%= post.permalink %>">Open reddit</a>
|
|
</p>
|
|
|
|
<%= 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 <- post.comments do %>
|
|
<div class="row">
|
|
<%= EEx.eval_file(comment_template, comment: comment, level: 0, comment_template: comment_template) %>
|
|
</div>
|
|
<br>
|
|
<% end %>
|
|
</div>
|
|
</body>
|
|
</html>
|