diff options
author | pdp8 <pdp8@pdp8.info> | 2023-07-24 02:46:05 +0200 |
---|---|---|
committer | pdp8 <pdp8@pdp8.info> | 2023-07-24 02:46:05 +0200 |
commit | a509c55faca368709044133199f71fb862b1e605 (patch) | |
tree | 9c53d06a4f26e6ccf8635278b8eb56c4a62403f3 /views | |
parent | 3c38f81b8a145778d4329c6be4c91baa00ca0d48 (diff) |
html output removed
Diffstat (limited to 'views')
-rw-r--r-- | views/collection.erb | 47 | ||||
-rw-r--r-- | views/object.erb | 71 |
2 files changed, 0 insertions, 118 deletions
diff --git a/views/collection.erb b/views/collection.erb deleted file mode 100644 index c169e0b..0000000 --- a/views/collection.erb +++ /dev/null @@ -1,47 +0,0 @@ -<!DOCTYPE html> -<html lang='en'> - <head> - <link rel='stylesheet' type='text/css' href='/style.css'> - </head> - <body> - <h1><%= @box %> - <% dirs = ['inbox','outbox'] - dirs.delete(@box) - dirs.each do |d| %> - <form action='/<%= d %>' method='get'> - <button><%= d %></button> - </form> - <% end %> - </h1> - <% @idx = 0 - @threads.each do |object| - @object = object %> - <%= erb :object %> - <% end %> - <% unless @box == 'shared' %> - <form action='/delete' method='post'> - <input type='hidden' name='dir' value='<%= @box %>' /> - <input type='hidden' name='anchor' value='/<%= @box %>' /> - <button>Delete all</button> - </form> - <% end %> - </body> - <script> - const reply_buttons = document.querySelectorAll(".reply"); - for (const button of reply_buttons) { - button.addEventListener('click', function() { - const form = document.getElementById('form' + button.getAttribute('data-index')); - button.style.display = 'none'; - form.style.display = 'block'; - }); - }; - const cancel_buttons = document.querySelectorAll(".cancel"); - for (const button of cancel_buttons) { - button.addEventListener('click', function() { - const form = document.getElementById('form' + button.getAttribute('data-index')); - button.style.display = 'block'; - form.style.display = 'none'; - }); - }; - </script> -</html> diff --git a/views/object.erb b/views/object.erb deleted file mode 100644 index b4b7d89..0000000 --- a/views/object.erb +++ /dev/null @@ -1,71 +0,0 @@ -<% @idx +=1 - mention = mention @object['attributedTo'] - JSON.parse(File.read(FOLLOWING))['orderedItems'].include?(@object['attributedTo']) ? follow='unfollow' : follow='follow' - @indent = 0 unless @object['inReplyTo'] -%> -<div style='margin-left:<%= @indent%>em' id='<%= @idx %>'> - <b><a href='<%= @object['attributedTo'] %>', target='_blank'><%= mention %></a></b> - <form action='/<%= follow %>' method='post'> - <input type='hidden' name='follow' value='<%= @object['attributedTo'] %>' /> - <input type='hidden' name='anchor' value='/<%= @box %>#<%= @idx %>' /> - <button><%= follow.capitalize %></button> - </form> - <% unless @object['inReplyTo'] %> - - <em><%= @object['published'] %></em> - - <form action='/delete' method='post'> - <input type='hidden' name='id' value='<%= @object['id'] %>' /> - <input type='hidden' name='dir' value='<%= @box %>' /> - <input type='hidden' name='anchor' value='/<%= @box %>#<%= @idx %>' /> - <button>Delete</button> - </form> - <% end %> - <% unless @box == 'shared' %> - - <form action='/share' method='post'> - <input type='hidden' name='id' value='<%= @object['id'] %>' /> - <input type='hidden' name='dir' value='<%= @box %>' /> - <input type='hidden' name='anchor' value='/<%= @box %>#<%= @idx %>' /> - <button>Share</button> - </form> - <% end %> - <% unless @object['content'].match(/^<p>/) %> - <p> - <% end %> - <%= @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'] %>'></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> - <% unless @box == 'shared' %> - <button class='reply' data-index='<%= @idx %>'>Reply</button> - <form action='/' method='post' id='form<%= @idx %>' style='display:none;' > - <input type='hidden' name='to' value='<%= @object['attributedTo'] %>' /> - <input type='hidden' name='inReplyTo' value='<%= @object['id'] %>' /> - <input type='hidden' name='anchor' value='/<%= @box %>#<%= @idx %>' /> - <textarea name='content'></textarea> - <br> - <button class='cancel' data-index='<%= @idx %>'>Cancel</button> - <input type='submit' value='Send'> - </form> - <% end %> -</div> -<% @object['replies'].each do |reply| - @indent += 2 - @object = reply %> - <%= erb :object %> -<% end %> - |