aboutsummaryrefslogtreecommitdiff
path: root/shardweb/lib/templates
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2018-11-06 11:57:09 +0100
committerAlex Auvolat <alex@adnab.me>2018-11-06 11:57:09 +0100
commitc4f6cbab20b0b1d08755073d93365e5bd00dc755 (patch)
tree384dd05c59a810d503790a2af1b5c49e1aed5ccf /shardweb/lib/templates
parent0e5b82f3348508eb7f4291a08722522a49edd752 (diff)
downloadshard-c4f6cbab20b0b1d08755073d93365e5bd00dc755.tar.gz
shard-c4f6cbab20b0b1d08755073d93365e5bd00dc755.zip
Shard deletion ; update README and TODO
Diffstat (limited to 'shardweb/lib/templates')
-rw-r--r--shardweb/lib/templates/page/shard_list.html.eex15
1 files changed, 14 insertions, 1 deletions
diff --git a/shardweb/lib/templates/page/shard_list.html.eex b/shardweb/lib/templates/page/shard_list.html.eex
index 3fffef7..79fd794 100644
--- a/shardweb/lib/templates/page/shard_list.html.eex
+++ b/shardweb/lib/templates/page/shard_list.html.eex
@@ -23,9 +23,10 @@
<tr>
<th></th>
<th>Shard</th>
+ <th></th>
<th>URI</th>
</tr>
- <%= for {_id, manifest, why_have_it} <- shard_list() do %>
+ <%= for {id, manifest, why_have_it} <- shard_list() do %>
<tr>
<td>
<%= case why_have_it do %>
@@ -37,6 +38,18 @@
<td>
<%= render "shard_entry.html", conn: @conn, manifest: manifest, pk: @pk %>
</td>
+ <td>
+ <%= case why_have_it do %>
+ <% {:cached, _} -> %>
+ <%= form_for @conn, page_path(@conn, :shard_action), [class: "form-inline", style: "display: inline", onsubmit: "return confirm('Delete this shard and all its data?');"], fn f -> %>
+ <%= hidden_input f, :shard_id, value: id |> Base.encode16 %>
+ <%= hidden_input f, :action, value: "delete" %>
+ <%= submit "Delete", [class: "btn btn-xs btn-danger"] %>
+ <% end %>
+ <% _ -> %>&nbsp;
+ <% end %>
+
+ </td>
<td><small class="shard_uri"><%= manifest |> ShardURI.from_manifest %></small></td>
</tr>
<% end %>