summaryrefslogtreecommitdiff
path: root/views/outbox.erb
blob: db840f4afa0a8f669a950d3d0a8e19d8bb95f63f (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
36
37
38
39
40
41
<!DOCTYPE html>
<html lang='en'>
  <head>
    <meta charset="UTF-8">
    <title>pdp8 social</title>
    <link rel="icon" type="image/png" href="/pdp8.png">
    <link rel='stylesheet' type='text/css' href='/style.css'>
  </head>
  <body>
    <h1><a href="https://social.pdp8.info/pdp8">pdp8@social.pdp8.info</a></h1>
    music, pictures and videos: <a href="https://pdp8.info">https://pdp8.info</a>
    <% @activities.each do |activity| 
      file = find_file activity['object']['id']
      @object = JSON.load_file file if file and File.exists? file
      if @object
        mention = mention @object['attributedTo'] %>
        <div class='pdp8'>
        <p><b><a href='<%= @object['attributedTo'] %>' target='_blank'><%= mention %></a></b>&nbsp;
        <em><%= @object['published'] %></em>
        <% if activity['type'] == 'Announce' %>
          &nbsp;(<em>announced</em>)
        <% end %>
        <p>
        <%= @object['content']%>
        <% if @object['attachment']
          @object['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'] %>' alt='<%= att['name'].gsub("'",'&apos;').gsub('"','&quot;') if att['name'] %>'></a>
          <% when /video/ %>
            <br><video controls=''><source src='<%= att['url'] %>' type='<%= att['mediaType'] %>'></video>
          <% end %>
         <% end %>
       <% end %>
        </div>
     <% end %>
    <% end %>
  </body>
</html>