aboutsummaryrefslogtreecommitdiff
path: root/shardweb/lib/templates/page
diff options
context:
space:
mode:
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 %>