wiki/lib/wiki_web/templates/page/edit.html.eex

37 lines
1014 B
Elixir
Raw Normal View History

2020-07-30 00:49:51 +00:00
<h1>Edit Page</h1>
<%= render "form.html", Map.put(assigns, :action, Routes.page_path(@conn, :update, @page)) %>
2020-08-01 20:43:55 +00:00
<h2>Uploaded Files</h2>
<table>
<tr>
<th>Encrypted Filename</th>
<th>Content Type</th>
<th></th>
</tr>
<%= for upload <- @page.uploads do %>
<tr>
<td>
<a href="<%= Routes.page_path(@conn, :get_upload, @page.id, upload.id) %>">
<%= upload.relative_path %>
</a>
</td>
<td>
<code><%= upload.content_type %></code>
</td>
<td>
<%= form_tag Routes.page_path(@conn, :delete_upload, @page.id, upload.id), method: :delete, style: "margin: 0;" do %>
<%= submit "Delete", style: "margin: 0;" %>
<% end %>
</td>
</tr>
<% end %>
</table>
<%= form_tag Routes.page_path(@conn, :create_upload, @page.id), method: :post, multipart: true do %>
<input type="file" name="file">
<%= submit "Upload" %>
<% end %>
2020-08-02 23:24:30 +00:00
<span><%= link "Back", to: Routes.page_path(@conn, :show, @page.id) %></span>