aboutsummaryrefslogtreecommitdiff
path: root/lib/waev_web/templates/exports/show.html.eex
blob: 501f3c2ce8f4211f3595d48a139c247565c0ff15 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<div class="wa-avatars">
  <div class="wa-avatar">
    <figure>
      <img alt="<%= @export.left.name %>" src="<%= Routes.exports_path(@conn, :get_avatar, @id, @export.left.name) %>" />
      <figcaption><%= @export.left.name %></figcaption>
    </figure>
  </div>
  <div class="wa-avatar">
    <figure>
      <img alt="<%= @export.right.name %>" src="<%= Routes.exports_path(@conn, :get_avatar, @id, @export.right.name) %>" />
      <figcaption><%= @export.right.name %></figcaption>
    </figure>
  </div>
</div>

<%= for message <- @export.messages do %>
  <%= case message.side do %>
    <% :left -> %>
<div class="wa-row wa-row-left">
  <img class="wa-avatar--tiny" src="<%= Routes.exports_path(@conn, :get_avatar, @id, @export.left.name) %>" />
    <% :right -> %>
<div class="wa-row wa-row-right">
  <img class="wa-avatar--tiny" src="<%= Routes.exports_path(@conn, :get_avatar, @id, @export.right.name) %>" />
  <% end %>

  <div class="wa-message wa-white-box">
    <%= case message.attachment do %>
      <% %Waev.Export.Message.File{filename: filename, type: :image} -> %>
    <img class="wa-message-photo" alt="<%= filename %>" src="<%= Routes.exports_path(@conn, :get_media, @id, filename) %>" />
      <% _ -> %>
    <% end %>
    <div class="wa-message-box">
      <%= case message.attachment do %>
        <% %Waev.Export.Message.File{filename: filename, type: :file} -> %>
      <a class="wa-message-text" href="<%= Routes.exports_path(@conn, :get_media, @id, filename) %>"><%= filename %></a>
        <% _ -> %>
      <% end %>

      <div><%= message.text %></div>
      <div class="wa-message-date">
        <%= message.date %>
      </div>
    </div>
  </div>

</div>
<% end %>