aboutsummaryrefslogtreecommitdiff
path: root/lib/waev_web
diff options
context:
space:
mode:
Diffstat (limited to 'lib/waev_web')
-rw-r--r--lib/waev_web/controllers/exports_controller.ex2
-rw-r--r--lib/waev_web/router.ex2
-rw-r--r--lib/waev_web/templates/exports/show.html.eex4
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/waev_web/controllers/exports_controller.ex b/lib/waev_web/controllers/exports_controller.ex
index fd776a9..764accf 100644
--- a/lib/waev_web/controllers/exports_controller.ex
+++ b/lib/waev_web/controllers/exports_controller.ex
@@ -14,7 +14,7 @@ defmodule WaevWeb.ExportsController do
end
end
- def get_attachment(conn, %{"id" => id, "at_id" => at_id}) do
+ def get_media(conn, %{"id" => id, "at_id" => at_id}) do
case Waev.Export.Message.File.path(id, at_id) do
{:ok, path} ->
send_download(conn, {:file, path}, filename: at_id)
diff --git a/lib/waev_web/router.ex b/lib/waev_web/router.ex
index 54667a8..1e9ed0f 100644
--- a/lib/waev_web/router.ex
+++ b/lib/waev_web/router.ex
@@ -19,7 +19,7 @@ defmodule WaevWeb.Router do
get "/", PageController, :index
# index,edit,new,show,create,update
resources "/exports", ExportsController, only: [:show]
- get "/exports/:id/attachments/:at_id", ExportsController, :get_attachment
+ get "/exports/:id/media/:at_id", ExportsController, :get_media
end
# Other scopes may use custom stacks.
diff --git a/lib/waev_web/templates/exports/show.html.eex b/lib/waev_web/templates/exports/show.html.eex
index 425f2f8..265374a 100644
--- a/lib/waev_web/templates/exports/show.html.eex
+++ b/lib/waev_web/templates/exports/show.html.eex
@@ -21,7 +21,7 @@
<div class="wa-message">
<%= case message.attachment do %>
<% %Waev.Export.Message.File{filename: filename, available: true, type: :photo} -> %>
- <img class="wa-message-photo" alt="<%= filename %>" src="<%= Routes.exports_path(@conn, :get_attachment, @id, filename) %>" />
+ <img class="wa-message-photo" alt="<%= filename %>" src="<%= Routes.exports_path(@conn, :get_media, @id, filename) %>" />
<% _ -> %>
<% end %>
<div class="wa-message-box">
@@ -29,7 +29,7 @@
<% %Waev.Export.Message.File{filename: filename, available: false} -> %>
<i class="wa-message-text"><%= filename %></i> (fichero adjunto no disponible)
<% %Waev.Export.Message.File{filename: filename, available: true, type: :file} -> %>
- <a class="wa-message-text" href="<%= Routes.exports_path(@conn, :get_attachment, @id, filename) %>"><%= filename %></a>
+ <a class="wa-message-text" href="<%= Routes.exports_path(@conn, :get_media, @id, filename) %>"><%= filename %></a>
<% _ -> %>
<% end %>