34 lines
1.1 KiB
Elixir
34 lines
1.1 KiB
Elixir
<h1><%= @page.title %></h1>
|
|
<span><%= link "Edit", to: Routes.page_path(@conn, :edit, @page) %></span>
|
|
<span><%= link "Back", to: Routes.page_path(@conn, :index) %></span>
|
|
|
|
<div>
|
|
<%= raw(@page.html) %>
|
|
</div>
|
|
|
|
<%= for upload <- @page.uploads do %>
|
|
<div class="page-upload">
|
|
<%= cond do %>
|
|
<% String.starts_with?(upload.content_type, "image/") -> %>
|
|
<img src="<%= Routes.page_path(@conn, :get_upload, @page.id, upload.id) %>" />
|
|
<% String.starts_with?(upload.content_type, "video/") -> %>
|
|
<video controls src="<%= Routes.page_path(@conn, :get_upload, @page.id, upload.id) %>"></video>
|
|
<% String.starts_with?(upload.content_type, "audio/") -> %>
|
|
<audio controls src="<%= Routes.page_path(@conn, :get_upload, @page.id, upload.id) %>"></audio>
|
|
<% true -> %>
|
|
<a href="<%= Routes.page_path(@conn, :get_upload, @page.id, upload.id) %>"><%= upload.relative_path %></a>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<h2>Backlinks</h2>
|
|
<ul>
|
|
<%= for page <- @page.pages_linked_from do %>
|
|
<li>
|
|
<a href="<%= Routes.page_path(@conn, :show, page.id) %>">
|
|
<%= page.title %>
|
|
</a>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|