5 .col-lg-6.col-lg-offset-3.col-md-6.col-md-offset-3
6 .alert.alert-danger.messagebox.center
7 strong Authorization Required
8 p You must be <a href="/login">logged in</a> to view this page.
10 .col-lg-6.col-lg-offset-3.col-md-6.col-md-offset-3
12 .alert.alert-success.center
15 .alert.alert-danger.center
18 form(action="/account/edit", method="post", onsubmit="return validatePasswordChange()")
19 input(type="hidden", name="_csrf", value=csrfToken)
20 input(type="hidden", name="action", value="change_password")
22 label.control-label(for="username") Username
23 input#username.form-control(type="text", name="name", value=loginName, disabled=true)
25 label.control-label(for="oldpassword") Current Password
26 input#oldpassword.form-control(type="password", name="oldpassword")
28 label.control-label(for="newpassword") New Password
29 input#newpassword.form-control(type="password", name="newpassword")
31 label.control-label(for="newpassword_confirm") Confirm New Password
32 input#newpassword_confirm.form-control(type="password", name="newpassword_confirm")
33 button#changepassbtn.btn.btn-danger.btn-block(type="submit") Change Password
36 form(action="/account/edit", method="post", onsubmit="return submitEmail()")
37 input(type="hidden", name="_csrf", value=csrfToken)
38 input(type="hidden", name="action", value="change_email")
40 label.control-label(for="username2") Username
41 input#username2.form-control(type="text", name="name", value=loginName, disabled=true)
43 label.control-label(for="password2") Password
44 input#password2.form-control(type="password", name="password")
46 label.control-label(for="email") New Email
47 input#email.form-control(type="email", name="email")
48 button#changeemailbtn.btn.btn-danger.btn-block(type="submit") Change Email
51 script(type="text/javascript").
52 function validatePasswordChange() {
53 var pw = $("#newpassword").val();
54 var pwc = $("#newpassword_confirm").val();
55 $("#passwordempty").remove();
56 $("#passwordmismatch").remove();
59 $("#newpassword").parent().addClass("has-error");
60 $("<p/>").addClass("text-danger")
61 .attr("id", "passwordempty")
62 .text("Password must not be empty")
63 .insertAfter($("#newpassword"));
67 $("#newpassword_confirm").parent().addClass("has-error");
68 $("#newpassword").parent().addClass("has-error");
69 $("<p/>").addClass("text-danger")
70 .attr("id", "passwordmismatch")
71 .text("Passwords do not match")
72 .insertAfter($("#newpassword_confirm"));
75 $("#username").attr("disabled", false);
80 function submitEmail() {
81 $("#username2").attr("disabled", false);