aboutsummaryrefslogtreecommitdiff
path: root/lib/waev_web/templates
diff options
context:
space:
mode:
authorGuillermo Ramos2020-02-05 14:17:41 +0100
committerGuillermo Ramos2020-02-05 14:17:41 +0100
commita0eec8eadae94a71974868ac8d48820e0662857b (patch)
treef85dad657a8f7bea59fbb96e39a7e506986b8ed5 /lib/waev_web/templates
parent01143da6e79f26cfacefa0c17f225ccc88d15186 (diff)
downloadwaev-a0eec8eadae94a71974868ac8d48820e0662857b.tar.gz
Download attachments
Diffstat (limited to 'lib/waev_web/templates')
-rw-r--r--lib/waev_web/templates/exports/show.html.eex8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/waev_web/templates/exports/show.html.eex b/lib/waev_web/templates/exports/show.html.eex
index 2d72e2e..77727a8 100644
--- a/lib/waev_web/templates/exports/show.html.eex
+++ b/lib/waev_web/templates/exports/show.html.eex
@@ -20,8 +20,12 @@ ID: <%= @id %>
<div class="column wa-message column-50 column-offset-25">
<% end %>
<%= case message.attachment do %>
- <% %Waev.Export.Message.File{filename: filename} -> %>
- <a href="#"><%= filename %></a>
+ <% %Waev.Export.Message.File{filename: filename} = file -> %>
+ <%= if file.available do %>
+ <a href="<%= Routes.exports_path(@conn, :get_attachment, @id, filename) %>"><%= filename %></a>
+ <% else %>
+ <i><%= filename %></i> (fichero adjunto no disponible)
+ <% end %>
<% nil -> %>
<% end %>
<%= message.text %>