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

38 lines
1.1 KiB
Elixir
Raw Permalink Normal View History

2020-07-30 00:49:51 +00:00
<h1>Edit Page</h1>
2020-08-02 23:40:45 +00:00
<%= render "form.html", assigns |> Map.put(:action, Routes.page_path(@conn, :update, @page)) |> Map.put(:initial_file, false) %>
2020-07-30 00:49:51 +00:00
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>
2021-04-10 20:00:58 +00:00
<%= form_tag Routes.page_path(@conn, :create_upload, @page.id), method: :post, multipart: true, class: "edit-upload-form" do %>
2020-08-01 20:43:55 +00:00
<input type="file" name="file">
<%= submit "Upload" %>
2021-04-10 20:00:58 +00:00
<progress value="0" max="1" style="visibility: hidden;"></progress>
2020-08-01 20:43:55 +00:00
<% end %>
2020-08-02 23:24:30 +00:00
<span><%= link "Back", to: Routes.page_path(@conn, :show, @page.id) %></span>