From c4f6cbab20b0b1d08755073d93365e5bd00dc755 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 6 Nov 2018 11:57:09 +0100 Subject: Shard deletion ; update README and TODO --- shardweb/lib/templates/page/shard_list.html.eex | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'shardweb/lib/templates') 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 @@ Shard + URI - <%= for {_id, manifest, why_have_it} <- shard_list() do %> + <%= for {id, manifest, why_have_it} <- shard_list() do %> <%= case why_have_it do %> @@ -37,6 +38,18 @@ <%= render "shard_entry.html", conn: @conn, manifest: manifest, pk: @pk %> + + <%= 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 %> + <% _ -> %>  + <% end %> + + <%= manifest |> ShardURI.from_manifest %> <% end %> -- cgit v1.2.3