annotate src/account.html.luan @ 88:7b339b1ccd11

add tools/users.html
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 13 Mar 2025 16:18:39 -0600
parents 625ffdf6499d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 local Luan = require "luan:Luan.luan"
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2 local error = Luan.error
40
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
3 local Parsers = require "luan:Parsers.luan"
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
4 local json_string = Parsers.json_string or error()
46
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
5 local Html = require "luan:Html.luan"
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
6 local html_encode = Html.encode or error()
88
7b339b1ccd11 add tools/users.html
Franklin Schmidt <fschmidt@gmail.com>
parents: 86
diff changeset
7 local url_encode = Html.url_encode or error()
0
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8 local Io = require "luan:Io.luan"
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9 local Http = require "luan:http/Http.luan"
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10 local Shared = require "site:/lib/Shared.luan"
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11 local head = Shared.head or error()
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12 local header = Shared.header or error()
5
a49866b52cc2 login to chat
Franklin Schmidt <fschmidt@gmail.com>
parents: 4
diff changeset
13 local Utils = require "site:/lib/Utils.luan"
a49866b52cc2 login to chat
Franklin Schmidt <fschmidt@gmail.com>
parents: 4
diff changeset
14 local base_url = Utils.base_url or error()
a49866b52cc2 login to chat
Franklin Schmidt <fschmidt@gmail.com>
parents: 4
diff changeset
15 local User = require "site:/lib/User.luan"
a49866b52cc2 login to chat
Franklin Schmidt <fschmidt@gmail.com>
parents: 4
diff changeset
16 local current_user = User.current_required or error()
0
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
17
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
18
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
19 return function()
5
a49866b52cc2 login to chat
Franklin Schmidt <fschmidt@gmail.com>
parents: 4
diff changeset
20 local user = current_user()
a49866b52cc2 login to chat
Franklin Schmidt <fschmidt@gmail.com>
parents: 4
diff changeset
21 if user == nil then return end
0
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
22 Io.stdout = Http.response.text_writer()
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
23 %>
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
24 <!doctype html>
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
25 <html>
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
26 <head>
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
27 <% head() %>
20
dade6a560494 add dialogs
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
28 <script>
dade6a560494 add dialogs
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
29 'use strict';
dade6a560494 add dialogs
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
30
46
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
31 let email = <%= json_string(user.email) %>;
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
32 let username = <%= json_string(user.name) or "" %>;
41
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
33 let notifyEmail = <%= json_string(user.notify_email or "") %>;
40
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
34 let multiNotify = <%= user.multi_notify %>;
41
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
35 let voice = <%= json_string(user.voice_url or "") %>;
40
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
36
46
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
37 function showUsername() {
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
38 let span = document.querySelector('span[username]');
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
39 span.textContent = username || email;
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
40 }
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
41
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
42 function editUsername() {
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
43 let dialog = document.querySelector('dialog[edit_username]');
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
44 let input = dialog.querySelector('input[name=username]');
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
45 input.value = username;
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
46 openModal(dialog);
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
47 }
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
48
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
49 function saveUsername() {
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
50 let dialog = document.querySelector('dialog[edit_username]');
83
a47036fd0158 group chat
Franklin Schmidt <fschmidt@gmail.com>
parents: 67
diff changeset
51 closeModal(dialog);
a47036fd0158 group chat
Franklin Schmidt <fschmidt@gmail.com>
parents: 67
diff changeset
52 username = dialog.querySelector('input[name=username]').value;
46
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
53 showUsername();
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
54 ajax(`save_username.js?username=${encodeURIComponent(username)}`);
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
55 }
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
56
40
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
57 function showNotify() {
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
58 let span = document.querySelector('span[notify]');
41
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
59 span.textContent = notifyEmail ? `Send notifications to ${notifyEmail}` : 'No notifications';
40
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
60 }
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
61
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
62 function editNotify() {
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
63 let dialog = document.querySelector('dialog[edit_notify]');
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
64 let input = dialog.querySelector('input[name=notify_email]');
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
65 input.value = notifyEmail;
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
66 let radio = dialog.querySelector(`input[type=radio][value=${multiNotify}]`);
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
67 radio.checked = true;
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
68 openModal(dialog);
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
69 }
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
70
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
71 function saveNotify() {
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
72 let dialog = document.querySelector('dialog[edit_notify]');
83
a47036fd0158 group chat
Franklin Schmidt <fschmidt@gmail.com>
parents: 67
diff changeset
73 closeModal(dialog);
a47036fd0158 group chat
Franklin Schmidt <fschmidt@gmail.com>
parents: 67
diff changeset
74 notifyEmail = dialog.querySelector('input[name=notify_email]').value;
40
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
75 let radio = dialog.querySelector('input[type=radio]:checked');
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
76 multiNotify = radio.value === 'true';
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
77 showNotify();
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
78 ajax(`save_notify.js?email=${encodeURIComponent(notifyEmail)}&multi=${multiNotify}`);
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
79 }
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
80
41
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
81 function showVoice() {
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
82 let span = document.querySelector('span[voice]');
61
Franklin Schmidt <fschmidt@gmail.com>
parents: 60
diff changeset
83 span.textContent = voice ? `Your voice URL is ${voice}` : 'No voice URL';
41
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
84 }
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
85
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
86 function editVoice() {
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
87 let dialog = document.querySelector('dialog[edit_voice]');
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
88 let input = dialog.querySelector('input[name=voice]');
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
89 input.value = voice;
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
90 openModal(dialog);
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
91 }
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
92
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
93 function saveVoice() {
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
94 let dialog = document.querySelector('dialog[edit_voice]');
83
a47036fd0158 group chat
Franklin Schmidt <fschmidt@gmail.com>
parents: 67
diff changeset
95 closeModal(dialog);
a47036fd0158 group chat
Franklin Schmidt <fschmidt@gmail.com>
parents: 67
diff changeset
96 voice = dialog.querySelector('input[name=voice]').value;
41
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
97 showVoice();
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
98 ajax(`save_voice.js?url=${encodeURIComponent(voice)}`);
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
99 }
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
100
20
dade6a560494 add dialogs
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
101 function deleteUser() {
dade6a560494 add dialogs
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
102 let dialog = document.querySelector('dialog[delete_user]');
dade6a560494 add dialogs
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
103 openModal(dialog);
dade6a560494 add dialogs
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
104 }
dade6a560494 add dialogs
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
105
dade6a560494 add dialogs
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
106 function doDeleteUser(el) {
dade6a560494 add dialogs
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
107 closeModal(el);
dade6a560494 add dialogs
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
108 ajax('delete_user.js');
dade6a560494 add dialogs
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
109 }
40
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
110
67
Franklin Schmidt <fschmidt@gmail.com>
parents: 66
diff changeset
111 function openUrl() {
Franklin Schmidt <fschmidt@gmail.com>
parents: 66
diff changeset
112 let dialog = document.querySelector('dialog[url]');
Franklin Schmidt <fschmidt@gmail.com>
parents: 66
diff changeset
113 openModal(dialog);
Franklin Schmidt <fschmidt@gmail.com>
parents: 66
diff changeset
114 }
Franklin Schmidt <fschmidt@gmail.com>
parents: 66
diff changeset
115
40
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
116 function init() {
46
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
117 showUsername();
40
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
118 showNotify();
41
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
119 showVoice();
40
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
120 }
20
dade6a560494 add dialogs
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
121 </script>
34
Franklin Schmidt <fschmidt@gmail.com>
parents: 21
diff changeset
122 <style>
Franklin Schmidt <fschmidt@gmail.com>
parents: 21
diff changeset
123 h1 {
Franklin Schmidt <fschmidt@gmail.com>
parents: 21
diff changeset
124 text-align: center;
Franklin Schmidt <fschmidt@gmail.com>
parents: 21
diff changeset
125 }
52
c3fabb21b6c4 multi email
Franklin Schmidt <fschmidt@gmail.com>
parents: 51
diff changeset
126 input[name] {
c3fabb21b6c4 multi email
Franklin Schmidt <fschmidt@gmail.com>
parents: 51
diff changeset
127 max-width: 100%;
c3fabb21b6c4 multi email
Franklin Schmidt <fschmidt@gmail.com>
parents: 51
diff changeset
128 }
c3fabb21b6c4 multi email
Franklin Schmidt <fschmidt@gmail.com>
parents: 51
diff changeset
129 input[name=username] {
c3fabb21b6c4 multi email
Franklin Schmidt <fschmidt@gmail.com>
parents: 51
diff changeset
130 width: 300px;
c3fabb21b6c4 multi email
Franklin Schmidt <fschmidt@gmail.com>
parents: 51
diff changeset
131 }
40
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
132 input[name=notify_email] {
52
c3fabb21b6c4 multi email
Franklin Schmidt <fschmidt@gmail.com>
parents: 51
diff changeset
133 width: 500px;
41
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
134 }
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
135 input[name=voice] {
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
136 width: 500px;
40
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
137 }
67
Franklin Schmidt <fschmidt@gmail.com>
parents: 66
diff changeset
138 dialog[url] {
Franklin Schmidt <fschmidt@gmail.com>
parents: 66
diff changeset
139 width: 600px;
Franklin Schmidt <fschmidt@gmail.com>
parents: 66
diff changeset
140 }
40
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
141 span[note] {
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
142 font-size: small;
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
143 }
34
Franklin Schmidt <fschmidt@gmail.com>
parents: 21
diff changeset
144 </style>
0
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
145 </head>
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
146 <body>
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
147 <% header() %>
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
148 <div content>
3
2c63b10781e1 add login
Franklin Schmidt <fschmidt@gmail.com>
parents: 2
diff changeset
149 <h1>Your Account</h1>
61
Franklin Schmidt <fschmidt@gmail.com>
parents: 60
diff changeset
150 <p>Your username is <span username></span> <a href="javascript:editUsername()">Edit</a></p>
40
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
151 <p><span notify></span> <a href="javascript:editNotify()">Edit</a></p>
41
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
152 <p><span voice></span> <a href="javascript:editVoice()">Edit</a></p>
67
Franklin Schmidt <fschmidt@gmail.com>
parents: 66
diff changeset
153 <p><a href="javascript:openUrl()">Your chat URL</a></p>
34
Franklin Schmidt <fschmidt@gmail.com>
parents: 21
diff changeset
154 <p><a href="javascript:logout()">Logout</a></p>
20
dade6a560494 add dialogs
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
155 <p><a href="javascript:deleteUser()">Delete account</a></p>
66
Franklin Schmidt <fschmidt@gmail.com>
parents: 62
diff changeset
156 <p>&nbsp;</p>
Franklin Schmidt <fschmidt@gmail.com>
parents: 62
diff changeset
157 <p><a href="about.html">About Luan Chat</a></p>
0
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
158 </div>
46
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
159 <dialog edit_username>
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
160 <h2>Edit Username</h2>
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
161 <form action="javascript:saveUsername()">
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
162 <p>
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
163 <label>Username</label><br>
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
164 <input type=text name=username placeholder="<%=html_encode(user.email)%>"><br>
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
165 </p>
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
166 <div buttons>
60
3521166513b3 finish invite
Franklin Schmidt <fschmidt@gmail.com>
parents: 59
diff changeset
167 <button type=button onclick="closeModal(this)">Cancel</button>
3521166513b3 finish invite
Franklin Schmidt <fschmidt@gmail.com>
parents: 59
diff changeset
168 <button type=submit>Save</button>
46
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
169 </div>
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
170 </form>
42b741a1d5c6 add username
Franklin Schmidt <fschmidt@gmail.com>
parents: 45
diff changeset
171 </dialog>
40
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
172 <dialog edit_notify>
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
173 <h2>Edit Notification</h2>
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
174 <form action="javascript:saveNotify()">
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
175 <p>
86
625ffdf6499d web app
Franklin Schmidt <fschmidt@gmail.com>
parents: 83
diff changeset
176 <label>Email addresses to send notifications to</label><br>
52
c3fabb21b6c4 multi email
Franklin Schmidt <fschmidt@gmail.com>
parents: 51
diff changeset
177 <input type=email multiple name=notify_email><br>
c3fabb21b6c4 multi email
Franklin Schmidt <fschmidt@gmail.com>
parents: 51
diff changeset
178 <span note>Leave blank for no notifications. Use <a href="https://pushover.net/">Pushover</a> for app notification.</span>
40
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
179 </p>
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
180 <p>
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
181 <label clickable>
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
182 <input type=radio name=multi_notify value=false>
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
183 Notify only for first message
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
184 </label><br>
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
185 <label clickable>
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
186 <input type=radio name=multi_notify value=true>
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
187 Notify for all messages
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
188 </label>
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
189 </p>
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
190 <div buttons>
60
3521166513b3 finish invite
Franklin Schmidt <fschmidt@gmail.com>
parents: 59
diff changeset
191 <button type=button onclick="closeModal(this)">Cancel</button>
3521166513b3 finish invite
Franklin Schmidt <fschmidt@gmail.com>
parents: 59
diff changeset
192 <button type=submit>Save</button>
40
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
193 </div>
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
194 </form>
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
195 </dialog>
41
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
196 <dialog edit_voice>
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
197 <h2>Edit Voice URL</h2>
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
198 <form action="javascript:saveVoice()">
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
199 <p>
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
200 <label>URL for receiving voice calls</label><br>
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
201 <input type=url name=voice><br>
67
Franklin Schmidt <fschmidt@gmail.com>
parents: 66
diff changeset
202 <span note>Leave blank for no voice URL. We recommend <a href="https://whereby.com/">Whereby</a>.</span>
41
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
203 </p>
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
204 <div buttons>
60
3521166513b3 finish invite
Franklin Schmidt <fschmidt@gmail.com>
parents: 59
diff changeset
205 <button type=button onclick="closeModal(this)">Cancel</button>
3521166513b3 finish invite
Franklin Schmidt <fschmidt@gmail.com>
parents: 59
diff changeset
206 <button type=submit>Save</button>
41
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
207 </div>
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
208 </form>
818697418dbe add voice link
Franklin Schmidt <fschmidt@gmail.com>
parents: 40
diff changeset
209 </dialog>
20
dade6a560494 add dialogs
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
210 <dialog delete_user>
dade6a560494 add dialogs
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
211 <h2>Delete Account</h2>
dade6a560494 add dialogs
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
212 <p>Are you sure that you want to delete your account?</p>
dade6a560494 add dialogs
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
213 <div buttons>
60
3521166513b3 finish invite
Franklin Schmidt <fschmidt@gmail.com>
parents: 59
diff changeset
214 <button onclick="closeModal(this)">Cancel</button>
3521166513b3 finish invite
Franklin Schmidt <fschmidt@gmail.com>
parents: 59
diff changeset
215 <button onclick="doDeleteUser(this)">Delete</button>
20
dade6a560494 add dialogs
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
216 </div>
dade6a560494 add dialogs
Franklin Schmidt <fschmidt@gmail.com>
parents: 6
diff changeset
217 </dialog>
67
Franklin Schmidt <fschmidt@gmail.com>
parents: 66
diff changeset
218 <dialog url>
Franklin Schmidt <fschmidt@gmail.com>
parents: 66
diff changeset
219 <h2>Your chat URL</h2>
88
7b339b1ccd11 add tools/users.html
Franklin Schmidt <fschmidt@gmail.com>
parents: 86
diff changeset
220 <p><%= base_url() %>/chat?with=<%=url_encode(user.email)%></p>
67
Franklin Schmidt <fschmidt@gmail.com>
parents: 66
diff changeset
221 <p>Use this URL to link to your chat so that other people can chat with you by clicking on the link.</p>
Franklin Schmidt <fschmidt@gmail.com>
parents: 66
diff changeset
222 <div buttons>
Franklin Schmidt <fschmidt@gmail.com>
parents: 66
diff changeset
223 <button onclick="closeModal(this)">Close</button>
Franklin Schmidt <fschmidt@gmail.com>
parents: 66
diff changeset
224 </div>
Franklin Schmidt <fschmidt@gmail.com>
parents: 66
diff changeset
225 </dialog>
40
7ea33179592a email notification
Franklin Schmidt <fschmidt@gmail.com>
parents: 34
diff changeset
226 <script> init(); </script>
45
e138343b2c76 unsubscribe and more
Franklin Schmidt <fschmidt@gmail.com>
parents: 43
diff changeset
227 <!-- ID = <%=user.id%> -->
0
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
228 </body>
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
229 </html>
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
230 <%
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
231 end