From 5af8d78e195c7479769240b32703d5b76843db4d Mon Sep 17 00:00:00 2001 From: pdp8 Date: Sat, 1 Jul 2023 00:57:48 +0200 Subject: initial refactoring of client.rb --- views/object.erb | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 views/object.erb (limited to 'views/object.erb') diff --git a/views/object.erb b/views/object.erb new file mode 100644 index 0000000..744a518 --- /dev/null +++ b/views/object.erb @@ -0,0 +1,57 @@ + +<% mention = mention @object['attributedTo'] + following_path = File.join(FOLLOWING, "#{mention}.json") + follow = File.exist?(following_path) ? 'unfollow' : 'follow' +%> +
em' id='<%= @object['id'] %>'> + ', target='_blank'><%= mention %>  +
+ ' /> + ' /> + +
+   +
+ ' /> + ' /> + +
+   +
+ ' /> + ' /> + +
+ <%= @object['content'] %> + <% if @object['attachment'] + @object['attachment'].each do |att| + case att['mediaType'] + when /audio/ %> +
+ <% when /image/ %> +
'>'> + <% when /video/ %> +
+ <% else %> + <%= att %>
+ '><%= att['url'] %> + <% end %> + <% end %> + <% end %> +

+ +

' style='display:none;' > + ' /> + ' /> + ' /> + +
+ + +
+
+<% @object['replies'].each do |reply| + @object = reply %> + <%= erb :object %> +<% end %> + -- cgit v1.2.3