settings.html 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8"/>
  5. <link rel="icon" href="/assets/logo.png">
  6. <link href="https://fonts.googleapis.com/css?family=Titillium+Web&display=swap" rel="stylesheet">
  7. <link type="text/css" href="/css/index.css" rel="stylesheet">
  8. <link type="text/css" href="/css/styles.css" rel="stylesheet">
  9. <link type="text/css" href="/css/controls.css" rel="stylesheet">
  10. <script src="/js/jquery-3.4.1.min.js"></script>
  11. <script src="/js/forms.js"></script>
  12. <script src="/js/notifications.js"></script>
  13. <script>
  14. $(document).ready(function() {
  15. initControls()
  16. addValidation('#fullNameField', null, validateFullName)
  17. addValidation('#passwordField', null, validatePassword)
  18. })
  19. function update() {
  20. var formValue = $('#updateForm').serialize()
  21. $.ajax({
  22. url: "/settings",
  23. type: "PATCH",
  24. data: formValue,
  25. success: function(result) {
  26. showToast(Severity.Normal, "User information updated successfully")
  27. },
  28. error: function(jqXHR, textStatus, errorThrown) {
  29. showToast(Severity.Warning, "Unable to udapte user information: " + errorThrown + " " + textStatus)
  30. }
  31. })
  32. }
  33. function back() {
  34. window.history.back();
  35. }
  36. </script>
  37. <title>Gostfix mail {{.Version}}</title>
  38. </head>
  39. <body>
  40. <div id="main">
  41. <div class="horizontalPaddingBox">
  42. <div class="contentBox">
  43. <div class="leftPanel">
  44. <div class="folderBtn" onclick="back();">Back</div>
  45. <div class="folderBtn">User settings</div>
  46. </div>
  47. <div class="verticalPaddingBox">
  48. <div class="innerConentBox materialLevel1">
  49. <div style="flex: 1 1 auto; display: flex; flex-direction: column;">
  50. <div class="settingsHeader">
  51. User settings
  52. </div>
  53. <form id="updateForm" style="margin: 0 auto;">
  54. <div class="inpt bad">
  55. <input id="fullNameField" name="fullName" type="text" required maxlength="128" autocomplete="off" value="{{.FullName}}">
  56. <span class="highlight"></span>
  57. <span class="bar"></span>
  58. <label>Full name</label>
  59. </div>
  60. <div class="inpt password bad">
  61. <input id="passwordField" name="password" type="password" required maxlength="28" autocomplete="off">
  62. <span class="highlight"></span>
  63. <span class="bar"></span>
  64. <label>New password</label>
  65. <img class="icon" src="/assets/eye.svg"/>
  66. </div>
  67. <div class="inpt">
  68. <input id="oldPasswordField" name="oldPassword" type="password" required maxlength="28" autocomplete="off">
  69. <span class="highlight"></span>
  70. <span class="bar"></span>
  71. <label>Current password</label>
  72. </div>
  73. <div id="updateButton" class="btn materialLevel1" style="margin-bottom: 30px;" onclick="update();">Update</div>
  74. </form>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <div id="copyrightBox" class="elidedText"><img src="/assets/logo.svg" height="30px"/>gostfix {{.Version}} Web interface. Copyright (c) 2020 Alexey Edelev &lt;semlanik@gmail.com&gt;</div>
  81. </div>
  82. </body>
  83. </html>