-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignup.html
More file actions
192 lines (187 loc) · 8.18 KB
/
signup.html
File metadata and controls
192 lines (187 loc) · 8.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="description" content="Dydra.com — Sign Up" />
<meta name="author" content="Dydra" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sign Up — Dydra</title>
<link rel="shortcut icon" href="./favicon.ico" />
<link rel="apple-touch-icon" href="./apple-touch-icon.png" />
<link rel="stylesheet" href="./stylesheets/style.css" media="screen" />
<link rel="stylesheet" href="./stylesheets/jsui-overrides.css" media="screen" />
</head>
<body class="devise registrations new">
<div id="header">
<div class="wrapper">
<a href="/" id="logo">Dydra</a>
<div id="nav">
<ul class="nav">
<li><a href="http://docs.dydra.com/dydra">About</a></li>
<li><a href="http://docs.dydra.com">Documentation</a></li>
<li><a href="http://blog.dydra.com">Blog</a></li>
<li><a href="/login">Login</a></li>
</ul>
</div>
</div>
</div>
<div id="main">
<div id="main-0">
<div class="wrapper">
<div id="content">
<h1 id="content-title">Get Started with Dydra</h1>
<div id="error-messages" class="widget" style="display:none;">
<div class="alert-error rounded">
<p class="message">
<span class="icon icon-alert"></span>
<span id="error-text"></span>
</p>
</div>
</div>
<div id="success-message" class="widget" style="display:none;">
<div class="alert-success rounded" style="padding:8px;">
<p class="message">
<span id="success-text"></span>
</p>
</div>
</div>
<form id="signup-form" class="formtastic" action="/signup" method="post">
<fieldset class="inputs">
<ol>
<li id="invite-code-field" class="string optional">
<label for="account_invite_code">Invite code</label>
<input type="text" id="account_invite_code" name="account[invite_code]" />
</li>
<li class="string optional">
<label for="account_name">Username</label>
<input type="text" id="account_name" name="account[name]" required />
</li>
<li class="email optional">
<label for="account_email">Email</label>
<input type="email" id="account_email" name="account[email]" required />
</li>
<li class="password optional">
<label for="account_password">Password</label>
<input type="password" id="account_password" name="account[password]" required />
</li>
<li class="password optional">
<label for="account_password_confirmation">Confirm Password</label>
<input type="password" id="account_password_confirmation" name="account[password_confirmation]" required />
</li>
</ol>
</fieldset>
<fieldset class="buttons">
<ol>
<li class="commit"><input type="submit" value="Sign up" /></li>
</ol>
</fieldset>
</form>
</div>
<div id="aside">
<a class="login" id="aside-link" href="/login">Already have an account? <strong>Log in</strong></a>
<h5>Don't have an invite code?</h5>
<p>Dydra is currently in closed beta and only accepting signups using invite codes.</p>
<form id="join-beta" action="/invitations" method="post">
<h3>Request an invite</h3>
<p>Enter your email address and we'll<br />let you know when a slot is available.</p>
<p class="textfield">
<input id="invitation_email" name="invitation[email]" type="text" placeholder="Your email address..." />
<a class="disabled submit" href="#" id="notify-btn">Notify Me</a>
</p>
</form>
</div>
</div>
</div>
</div>
<div id="footer">
<div class="wrapper">
<p id="copyright">
A product of <a href="http://datagraph.org/">Datagraph, Inc.</a>
• <span><a href="http://docs.dydra.com/dydra">About</a></span>
• <span><a href="http://docs.dydra.com">Documentation</a></span>
• <span><a href="http://blog.dydra.com">Blog</a></span>
• <span><a href="/legal">Legal</a></span>
</p>
<p id="footer-links">
<a href="https://github.com/dydra/support/blob/master/README.rst#readme">Support</a>
•
<a href="https://github.com/dydra">GitHub</a>
•
<a href="http://twitter.com/dydradata">Twitter</a>
•
<a href="http://feeds.feedburner.com/dydra">RSS</a>
</p>
</div>
</div>
<script>
// Pre-fill invite code from URL parameter
(function () {
var params = new URLSearchParams(window.location.search);
var code = params.get("invite_code");
if (code) {
var field = document.getElementById("account_invite_code");
if (field) field.value = code;
}
})();
document.getElementById("signup-form").addEventListener("submit", async function (e) {
e.preventDefault();
var form = this;
var errorBox = document.getElementById("error-messages");
var errorText = document.getElementById("error-text");
var successBox = document.getElementById("success-message");
var successText = document.getElementById("success-text");
errorBox.style.display = "none";
successBox.style.display = "none";
var body = new URLSearchParams(new FormData(form)).toString();
try {
var response = await fetch(form.action, {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded", "Accept": "text/html" },
body: body,
});
if (response.ok || response.status === 302 || response.status === 303) {
successBox.style.display = "block";
successText.textContent = "Your account has been created. Check your email for confirmation instructions.";
form.style.display = "none";
} else {
var text = "";
try { text = await response.text(); } catch (_) {}
errorBox.style.display = "block";
errorText.textContent = text || "Registration failed. Please check your details and try again.";
}
} catch (err) {
errorBox.style.display = "block";
errorText.textContent = "Could not reach the server. Please try again later.";
}
});
// Enable the "Notify Me" button when email is entered
var notifyBtn = document.getElementById("notify-btn");
var inviteEmail = document.getElementById("invitation_email");
if (notifyBtn && inviteEmail) {
inviteEmail.addEventListener("input", function () {
if (this.value && this.value !== "Your email address...") {
notifyBtn.classList.remove("disabled");
} else {
notifyBtn.classList.add("disabled");
}
});
notifyBtn.addEventListener("click", async function (e) {
e.preventDefault();
if (notifyBtn.classList.contains("disabled")) return;
var email = inviteEmail.value;
if (!email) return;
try {
await fetch("/invitations", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: "invitation%5Bemail%5D=" + encodeURIComponent(email),
});
inviteEmail.value = "";
notifyBtn.classList.add("disabled");
inviteEmail.placeholder = "Request sent!";
} catch (_) {}
});
}
</script>
</body>
</html>