aboutsummaryrefslogtreecommitdiff
path: root/shardweb/lib/templates/page
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2018-11-05 15:40:18 +0100
committerAlex Auvolat <alex@adnab.me>2018-11-05 15:40:18 +0100
commit0b27af3dab56b667b50fd80590cdfd9df0feffbd (patch)
tree7c1185496166b04aa21ea66f285650d62e954f20 /shardweb/lib/templates/page
parent72906c6bb473ea605235c84b6d01c318f7b6cef8 (diff)
downloadshard-0b27af3dab56b667b50fd80590cdfd9df0feffbd.tar.gz
shard-0b27af3dab56b667b50fd80590cdfd9df0feffbd.zip
File progress
Diffstat (limited to 'shardweb/lib/templates/page')
-rw-r--r--shardweb/lib/templates/page/shard_entry.html.eex11
1 files changed, 11 insertions, 0 deletions
diff --git a/shardweb/lib/templates/page/shard_entry.html.eex b/shardweb/lib/templates/page/shard_entry.html.eex
index d99fc34..bc9edd4 100644
--- a/shardweb/lib/templates/page/shard_entry.html.eex
+++ b/shardweb/lib/templates/page/shard_entry.html.eex
@@ -23,6 +23,17 @@
<a href="<%= directory_path(@conn, (if public do :view_pub else :view_priv end), owner|>Base.encode16(), name) %>"><%= name %></a>
<%= if public do %><i class="fa fa-globe"></i><% else %><i class="fa fa-lock"></i><% end %>
+ <% %SApp.File.Manifest{infohash: infohash} -> %>
+ <% file_info = SApp.File.get_info(Shard.Manager.find_or_start(@manifest)) %>
+ <i class="fa fa-file"></i>
+ <%= if file_info[:size] != nil do Size.humanize!(file_info[:size]) end %>
+ <%= if file_info[:mime_type] != nil do %><code><%= file_info[:mime_type] %></code><% end %>
+ <%= if file_info[:missing_blocks] != nil and file_info[:missing_blocks] > 0 do %>
+ <%= file_info[:num_blocks] - file_info[:missing_blocks] %> / <%= file_info[:num_blocks] %>
+ <% end %>
+ <%= if file_info[:missing_blocks] == 0 do %>
+ <a href="<%= directory_path(@conn, :raw_file, infohash|>Base.encode16) %>">[raw]</a>
+ <% end %>
<% x -> %> <%= inspect x %>
<% end %>