diff options
Diffstat (limited to 'views/outbox.erb')
-rw-r--r-- | views/outbox.erb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/views/outbox.erb b/views/outbox.erb new file mode 100644 index 0000000..db840f4 --- /dev/null +++ b/views/outbox.erb @@ -0,0 +1,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> + <em><%= @object['published'] %></em> + <% if activity['type'] == 'Announce' %> + (<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("'",''').gsub('"','"') 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> |