comparison src/account.html.luan @ 20:dade6a560494

add dialogs
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 04 Nov 2024 21:37:58 -0700
parents e22a1ba4b2ed
children 5a56297713a3
comparison
equal deleted inserted replaced
19:435f474f07c7 20:dade6a560494
18 %> 18 %>
19 <!doctype html> 19 <!doctype html>
20 <html> 20 <html>
21 <head> 21 <head>
22 <% head() %> 22 <% head() %>
23 <script>
24 'use strict';
25
26 function deleteUser() {
27 let dialog = document.querySelector('dialog[delete_user]');
28 openModal(dialog);
29 }
30
31 function doDeleteUser(el) {
32 closeModal(el);
33 ajax('delete_user.js');
34 }
35 </script>
23 </head> 36 </head>
24 <body> 37 <body>
25 <% header() %> 38 <% header() %>
26 <div content> 39 <div content>
27 <h1>Your Account</h1> 40 <h1>Your Account</h1>
28 <p><a href="chat.html">Your Chats</a></p> 41 <p><a href="chat.html">Your Chats</a></p>
29 <p>Your URL: <%= base_url() %>/chat.html?with=<%=user.email%></p> 42 <p>Your URL: <%= base_url() %>/chat.html?with=<%=user.email%></p>
30 <p><a href="javascript:ajax('delete_user.js')">Delete account</a></p> 43 <p><a href="javascript:deleteUser()">Delete account</a></p>
31 <p><a href="javascript:logout()">Logout</a></p> 44 <p><a href="javascript:logout()">Logout</a></p>
32 </div> 45 </div>
46 <dialog delete_user>
47 <h2>Delete Account</h2>
48 <p>Are you sure that you want to delete your account?</p>
49 <div buttons>
50 <button cancel onclick="closeModal(this)">Cancel</button>
51 <button go onclick="doDeleteUser(this)">Delete</button>
52 </div>
53 </dialog>
33 </body> 54 </body>
34 </html> 55 </html>
35 <% 56 <%
36 end 57 end