summaryrefslogtreecommitdiff
path: root/views/index.erb
blob: a698565c2c78960910f0c096701495c01faade73 (plain)
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
  <!DOCTYPE html>
  <html lang='en'>
    <head>
      <link rel='stylesheet' type='text/css' href='/style.css'>
    </head>
    <body>
    <% @inbox.each do |item| %>
      <b><a href='<%= item[:actor_url] %>', target='_blank'><%= item[:mention] %></a></b>&nbsp;
      <form action='<%= File.join item[:follow], item[:mention] %>' method='post'>
        <button><%= item[:follow].capitalize %></button>
      </form>
      <p><%= item[:content] %>
      <% if item[:attachment]
        item[:attachment].each do |att|
        case att['mediaType']
        when /audio/ %>
          <br><audio controls=''><source src='<%= att['url'] %>' type='<%= att['mediaType'] %>'></audio>
        <% when /image/ %>
          <br><a href='<%= att['url'] %>'><img src='<%= att['url'] %>'></a>
        <% when /video/ %>
          <br><video controls=''><source src='<%= att['url'] %>' type='<%= att['mediaType'] %>'></video>
        <% else %>
          <%= att %><br>
          <a href='<%= att['url'] %>'><%= att['url'] %></a>
        <% end %>
      <% end %>
      <% end %>
      <p>
      <form action='<%= File.join 'delete', item[:file] %>' method='post'>
        <button>Delete</button>
      </form>
      <hr>
    <% end %>
    </body>
  </html>