From 458ce88d5f96272daeadfc70ccd7d43c10df1a31 Mon Sep 17 00:00:00 2001 From: pdp8 Date: Sun, 4 Jun 2023 12:34:23 +0200 Subject: inbox at '/', inbox parsing moved to activitypub.rb --- views/inbox.erb | 50 -------------------------------------------------- views/index.erb | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 50 deletions(-) delete mode 100644 views/inbox.erb create mode 100644 views/index.erb (limited to 'views') diff --git a/views/inbox.erb b/views/inbox.erb deleted file mode 100644 index 0be5dd5..0000000 --- a/views/inbox.erb +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - <% @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') %> - ', target='_blank'><%= mention %>  - <% File.exists?(following_path) ? method = 'unfollow' : method = 'follow' %> -
- -
-

<%= item['content'] %> - <% if item['attachment'] - item['attachment'].each do |att| - case att['mediaType'] - when /audio/ %> -
- <% when /image/ %> -
'>'> - <% when /video/ %> -
- <% else %> - <%= att %>
- '><%= att['url'] %> - <% end %> - <% end %> - <% end %> -

-

' method='post'> - -
- -
- <% end %> - - diff --git a/views/index.erb b/views/index.erb new file mode 100644 index 0000000..a698565 --- /dev/null +++ b/views/index.erb @@ -0,0 +1,35 @@ + + + + + + + <% @inbox.each do |item| %> + <%= item[:mention] %>  +
+ +
+

<%= item[:content] %> + <% if item[:attachment] + item[:attachment].each do |att| + case att['mediaType'] + when /audio/ %> +
+ <% when /image/ %> +
'>'> + <% when /video/ %> +
+ <% else %> + <%= att %>
+ '><%= att['url'] %> + <% end %> + <% end %> + <% end %> +

+

' method='post'> + +
+
+ <% end %> + + -- cgit v1.2.3