You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
4.6 KiB

  1. {{template "base/head" .}}
  2. <div class="user settings profile">
  3. {{template "user/settings/navbar" .}}
  4. <div class="ui container">
  5. {{template "base/alert" .}}
  6. <h4 class="ui top attached header">
  7. {{.i18n.Tr "settings.public_profile"}}
  8. </h4>
  9. <div class="ui attached segment">
  10. <p>{{.i18n.Tr "settings.profile_desc"}}</p>
  11. <form class="ui form" action="{{.Link}}" method="post">
  12. {{.CsrfTokenHtml}}
  13. <div class="required field {{if .Err_Name}}error{{end}}">
  14. <label for="username">{{.i18n.Tr "username"}}<span class="text red hide" id="name-change-prompt"> {{.i18n.Tr "settings.change_username_prompt"}}</span></label>
  15. <input id="username" name="name" value="{{.SignedUser.Name}}" data-name="{{.SignedUser.Name}}" autofocus required {{if not .SignedUser.IsLocal}}disabled{{end}}>
  16. {{if not .SignedUser.IsLocal}}
  17. <p class="help text blue">{{$.i18n.Tr "settings.password_username_disabled"}}</p>
  18. {{end}}
  19. </div>
  20. <div class="field {{if .Err_FullName}}error{{end}}">
  21. <label for="full_name">{{.i18n.Tr "settings.full_name"}}</label>
  22. <input id="full_name" name="full_name" value="{{.SignedUser.FullName}}">
  23. </div>
  24. <div class="required field {{if .Err_Email}}error{{end}}">
  25. <label for="email">{{.i18n.Tr "email"}}</label>
  26. <input id="email" name="email" value="{{.SignedUser.Email}}">
  27. </div>
  28. <div class="inline field">
  29. <div class="ui checkbox" id="keep-email-private">
  30. <label class="poping up" data-content="{{.i18n.Tr "settings.keep_email_private_popup"}}"><strong>{{.i18n.Tr "settings.keep_email_private"}}</strong></label>
  31. <input name="keep_email_private" type="checkbox" {{if .SignedUser.KeepEmailPrivate}}checked{{end}}>
  32. </div>
  33. </div>
  34. <div class="field {{if .Err_Description}}error{{end}}">
  35. <label for="description">{{$.i18n.Tr "user.user_bio"}}</label>
  36. <textarea id="description" name="description" rows="2">{{.SignedUser.Description}}</textarea>
  37. </div>
  38. <div class="field {{if .Err_Website}}error{{end}}">
  39. <label for="website">{{.i18n.Tr "settings.website"}}</label>
  40. <input id="website" name="website" type="url" value="{{.SignedUser.Website}}">
  41. </div>
  42. <div class="field">
  43. <label for="location">{{.i18n.Tr "settings.location"}}</label>
  44. <input id="location" name="location" value="{{.SignedUser.Location}}">
  45. </div>
  46. <div class="field">
  47. <label for="language">{{.i18n.Tr "settings.language"}}</label>
  48. <div class="ui language selection dropdown" id="language">
  49. <input name="language" type="hidden" value="{{.SignedUser.Language}}">
  50. <i class="dropdown icon"></i>
  51. <div class="text">{{range .AllLangs}}{{if eq $.SignedUser.Language .Lang}}{{.Name}}{{end}}{{end}}</div>
  52. <div class="menu">
  53. {{range .AllLangs}}
  54. <div class="item{{if eq $.SignedUser.Language .Lang}} active selected{{end}}" data-value="{{.Lang}}">{{.Name}}</div>
  55. {{end}}
  56. </div>
  57. </div>
  58. </div>
  59. <div class="field">
  60. <button class="ui green button">{{$.i18n.Tr "settings.update_profile"}}</button>
  61. </div>
  62. </form>
  63. </div>
  64. <h4 class="ui top attached header">
  65. {{.i18n.Tr "settings.avatar"}}
  66. </h4>
  67. <div class="ui attached segment">
  68. <form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data">
  69. {{.CsrfTokenHtml}}
  70. {{if not DisableGravatar}}
  71. <div class="inline field">
  72. <div class="ui radio checkbox">
  73. <input name="source" value="lookup" type="radio" {{if not .SignedUser.UseCustomAvatar}}checked{{end}}>
  74. <label>{{.i18n.Tr "settings.lookup_avatar_by_mail"}}</label>
  75. </div>
  76. </div>
  77. <div class="field {{if .Err_Gravatar}}error{{end}}">
  78. <label for="gravatar">Avatar {{.i18n.Tr "email"}}</label>
  79. <input id="gravatar" name="gravatar" value="{{.SignedUser.AvatarEmail}}" />
  80. </div>
  81. {{end}}
  82. <div class="inline field">
  83. <div class="ui radio checkbox">
  84. <input name="source" value="local" type="radio" {{if .SignedUser.UseCustomAvatar}}checked{{end}}>
  85. <label>{{.i18n.Tr "settings.enable_custom_avatar"}}</label>
  86. </div>
  87. </div>
  88. <div class="inline field">
  89. <label for="avatar">{{.i18n.Tr "settings.choose_new_avatar"}}</label>
  90. <input name="avatar" type="file" >
  91. </div>
  92. <div class="field">
  93. <button class="ui green button">{{$.i18n.Tr "settings.update_avatar"}}</button>
  94. <a class="ui red button delete-post" data-request-url="{{.Link}}/avatar/delete" data-done-url="{{.Link}}">{{$.i18n.Tr "settings.delete_current_avatar"}}</a>
  95. </div>
  96. </form>
  97. </div>
  98. </div>
  99. </div>
  100. {{template "base/footer" .}}