annotate src/account.html.luan @ 86:625ffdf6499d

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