profile.tmpl 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. {{template "base/head" .}}
  2. <div class="user settings profile">
  3. <div class="ui container">
  4. <div class="ui grid">
  5. {{template "user/settings/navbar" .}}
  6. <div class="twelve wide column content">
  7. {{template "base/alert" .}}
  8. <h4 class="ui top attached header">
  9. {{.i18n.Tr "settings.public_profile"}}
  10. </h4>
  11. <div class="ui attached segment">
  12. <p>{{.i18n.Tr "settings.profile_desc"}}</p>
  13. <form class="ui form" action="{{.Link}}" method="post">
  14. {{.CsrfTokenHtml}}
  15. <div class="required field {{if .Err_Name}}error{{end}}">
  16. <label for="username">{{.i18n.Tr "username"}}<span class="text red hide" id="name-change-prompt"> {{.i18n.Tr "settings.change_username_prompt"}}</span></label>
  17. <input id="username" name="name" value="{{.SignedUser.Name}}" data-name="{{.SignedUser.Name}}" autofocus required {{if not .SignedUser.IsLocal}}disabled{{end}}>
  18. {{if not .SignedUser.IsLocal}}
  19. <p class="help text blue">{{$.i18n.Tr "settings.password_username_disabled"}}</p>
  20. {{end}}
  21. </div>
  22. <div class="field {{if .Err_FullName}}error{{end}}">
  23. <label for="full_name">{{.i18n.Tr "settings.full_name"}}</label>
  24. <input id="full_name" name="full_name" value="{{.SignedUser.FullName}}">
  25. </div>
  26. <div class="required field {{if .Err_Email}}error{{end}}">
  27. <label for="email">{{.i18n.Tr "email"}}</label>
  28. <input id="email" name="email" value="{{.SignedUser.Email}}">
  29. </div>
  30. <div class="inline field">
  31. <div class="ui checkbox">
  32. <label for="show_email">{{.i18n.Tr "settings.show_email"}}</label>
  33. <input id="show_email" name="show_email" type="checkbox" {{if .SignedUser.ShowEmail}}checked{{end}} />
  34. </div>
  35. </div>
  36. <div class="field {{if .Err_Website}}error{{end}}">
  37. <label for="website">{{.i18n.Tr "settings.website"}}</label>
  38. <input id="website" name="website" type="url" value="{{.SignedUser.Website}}">
  39. </div>
  40. <div class="field">
  41. <label for="location">{{.i18n.Tr "settings.location"}}</label>
  42. <input id="location" name="location" value="{{.SignedUser.Location}}">
  43. </div>
  44. {{if not DisableGravatar}}
  45. <div class="field {{if .Err_Gravatar}}error{{end}}">
  46. <label for="gravatar">Gravatar {{.i18n.Tr "email"}}</label>
  47. <input id="gravatar" name="gravatar" value="{{.SignedUser.AvatarEmail}}" />
  48. </div>
  49. {{end}}
  50. <div class="field">
  51. <button class="ui green button">{{$.i18n.Tr "settings.update_profile"}}</button>
  52. </div>
  53. </form>
  54. <div class="ui divider"></div>
  55. <form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data">
  56. {{.CsrfTokenHtml}}
  57. <div class="inline field">
  58. <div class="ui checkbox">
  59. <input name="enable" type="checkbox" {{if .SignedUser.UseCustomAvatar}}checked{{end}}>
  60. <label>{{.i18n.Tr "settings.enable_custom_avatar"}}</label>
  61. </div>
  62. </div>
  63. <div class="inline field">
  64. <label for="avatar">{{.i18n.Tr "settings.choose_new_avatar"}}</label>
  65. <input name="avatar" type="file" >
  66. </div>
  67. <div class="field">
  68. <button class="ui green button">{{$.i18n.Tr "settings.update_avatar"}}</button>
  69. <a class="ui red button delete-post" data-request-url="{{.Link}}/avatar/delete" data-done-url="{{.Link}}">{{$.i18n.Tr "settings.delete_current_avatar"}}</a>
  70. </div>
  71. </form>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. {{template "base/footer" .}}