diff options
author | pdp8 <pdp8@pdp8.info> | 2023-07-01 00:57:48 +0200 |
---|---|---|
committer | pdp8 <pdp8@pdp8.info> | 2023-07-01 00:57:48 +0200 |
commit | 5af8d78e195c7479769240b32703d5b76843db4d (patch) | |
tree | e9d145e1318e3c47b5b2b00ce276703a14edc958 /views/collection.erb | |
parent | 8dd940a1c08b02ed1ea613284b627e1f46fb13c9 (diff) |
initial refactoring of client.rb
Diffstat (limited to 'views/collection.erb')
-rw-r--r-- | views/collection.erb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/views/collection.erb b/views/collection.erb new file mode 100644 index 0000000..4455b31 --- /dev/null +++ b/views/collection.erb @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<html lang='en'> + <head> + <link rel='stylesheet' type='text/css' href='/style.css'> + </head> + <body> + <h1><%= @dir %> + <form action='<%= @alt_dir %>' method='get'> + <button><%= @alt_name %></button> + </form> + </h1> + <% @threads.each do |object| + @object = object %> + <%= erb :object %> + <% end %> + <form action='/delete' method='post'> + <button>Delete all</button> + </form> + </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> |