diff options
author | pdp8 <pdp8@pdp8.info> | 2023-06-03 19:38:21 +0200 |
---|---|---|
committer | pdp8 <pdp8@pdp8.info> | 2023-06-03 19:38:21 +0200 |
commit | c727922afd124ae59e05b2da56634a271863f8af (patch) | |
tree | 8be6dae1b73a9c7db328a5cddb683348734ef95a /views/inbox.erb | |
parent | 23d72528a829e080ca6a508a217a700f04217d4a (diff) |
public dirs ignored
Diffstat (limited to 'views/inbox.erb')
-rw-r--r-- | views/inbox.erb | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/views/inbox.erb b/views/inbox.erb new file mode 100644 index 0000000..a3e3f83 --- /dev/null +++ b/views/inbox.erb @@ -0,0 +1,50 @@ + <!DOCTYPE html> + <html lang='en'> + <head> + <link rel='stylesheet' type='text/css' href='/style.css'> + </head> + <body> + <% @inbox.each_with_index do |file,i| %> + <% item = JSON.parse(File.read(file)) + mention = mention(item['attributedTo']) + following_path = File.join('public', 'following', mention + '.json') %> + <b><a href='<%= item['attributedTo'] %>', target='_blank'><%= mention %></a></b> <i><%= item['published'].sub('T', ' ') %></i> + <% File.exists?(following_path) ? method = 'unfollow' : method = 'follow' %> + <form action='<%= File.join method, mention %>' method='post'> + <button><%= method.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', file %>' method='post'> + <button>Delete</button> + </form> + <!-- + <form action='<%= File.join 'boost', file %>' method='post'> + <button>Boost</button> + </form> + <form action='<%= File.join 'archive', file %>' method='post'> + <button>Archive</button> + </form> + <form action='<%= File.join 'reply', file %>' method='post'> + <button>Reply</button> + </form> + --> + <hr> + <% end %> + </body> + </html> |