From 3c38f81b8a145778d4329c6be4c91baa00ca0d48 Mon Sep 17 00:00:00 2001 From: pdp8 Date: Fri, 21 Jul 2023 16:28:24 +0200 Subject: thread rendering --- views/object.erb | 49 ++++++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 21 deletions(-) (limited to 'views/object.erb') diff --git a/views/object.erb b/views/object.erb index 6ac9f43..b4b7d89 100644 --- a/views/object.erb +++ b/views/object.erb @@ -1,32 +1,38 @@ <% @idx +=1 mention = mention @object['attributedTo'] JSON.parse(File.read(FOLLOWING))['orderedItems'].include?(@object['attributedTo']) ? follow='unfollow' : follow='follow' + @indent = 0 unless @object['inReplyTo'] %> -
em' id='<%= @idx %>'> +
', target='_blank'><%= mention %> 
' /> - +
-   - <%= @object['published'] %> -   -
- ' /> - - - -
-   - <% unless @dir == 'shared' %> -
- ' /> - - - + <% unless @object['inReplyTo'] %> +   + <%= @object['published'] %> +   + + ' /> + + + +
+ <% end %> + <% unless @box == 'shared' %> +   +
+ ' /> + + + +
+ <% end %> + <% unless @object['content'].match(/^

/) %> +

<% end %> - <%= @object['content'] %> <% if @object['attachment'] @object['attachment'].each do |att| @@ -44,12 +50,12 @@ <% end %> <% end %>

- <% unless @dir == 'shared' %> + <% unless @box == 'shared' %>

<% @object['replies'].each do |reply| + @indent += 2 @object = reply %> <%= erb :object %> <% end %> -- cgit v1.2.3