summary refs log tree commit diff
path: root/views/outbox.erb
blob: d5e3db5b32c087af46e4191fbee09ea52f5324b0 (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="https://pdp8.info/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>
    <p>
    <% if @activity == 'create' %>
      <h2>posts&nbsp;|&nbsp;<a href='/outbox/announce'>boosts</a></h2>
    <% elsif @activity == 'announce' %>
      <h2><a href='/outbox/create'>posts</a>&nbsp;|&nbsp;boosts</h2>
    <% end %>
    <% @objects.each do |object| 
        object = fetch(object) if object.is_a? String
        mention = mention object['attributedTo'] %>
        <div class='pdp8'>
        <p><b><a href='<%= object['attributedTo'] %>' target='_blank'><%= mention %></a></b>&nbsp;
        <em><%= object['published'] %></em>
        <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 loading='lazy' width='1024' height='768' alt='<%= att['name'].gsub("'",'&apos;').gsub('"','&quot;') if att['name'] %>' src='<%= att['url'] %>'></a>
          <% when /video/ %>
            <br><video controls=''><source src='<%= att['url'] %>' type='<%= att['mediaType'] %>'></video>
          <% end %>
         <% end %>
       <% end %>
        </div>
    <% end %>
  </body>
</html>