本站源代码
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

197 lines
7.3KB

  1. {{template "base/head" .}}
  2. <div class="user settings account">
  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.password"}}
  8. </h4>
  9. <div class="ui attached segment">
  10. {{if or (.SignedUser.IsLocal) (.SignedUser.IsOAuth2)}}
  11. <form class="ui form" action="{{AppSubUrl}}/user/settings/account" method="post">
  12. {{.CsrfTokenHtml}}
  13. {{if .SignedUser.IsPasswordSet}}
  14. <div class="required field {{if .Err_OldPassword}}error{{end}}">
  15. <label for="old_password">{{.i18n.Tr "settings.old_password"}}</label>
  16. <input id="old_password" name="old_password" type="password" autocomplete="off" autofocus required>
  17. </div>
  18. {{end}}
  19. <div class="required field {{if .Err_Password}}error{{end}}">
  20. <label for="password">{{.i18n.Tr "settings.new_password"}}</label>
  21. <input id="password" name="password" type="password" autocomplete="off" required>
  22. </div>
  23. <div class="required field {{if .Err_Password}}error{{end}}">
  24. <label for="retype">{{.i18n.Tr "settings.retype_new_password"}}</label>
  25. <input id="retype" name="retype" type="password" autocomplete="off" required>
  26. </div>
  27. <div class="field">
  28. <button class="ui green button">{{$.i18n.Tr "settings.change_password"}}</button>
  29. <a href="{{AppSubUrl}}/user/forgot_password?email={{.Email}}">{{.i18n.Tr "auth.forgot_password"}}</a>
  30. </div>
  31. </form>
  32. {{else}}
  33. <div class="ui info message">
  34. <p class="text left">{{$.i18n.Tr "settings.password_change_disabled"}}</p>
  35. </div>
  36. {{end}}
  37. </div>
  38. <h4 class="ui top attached header">
  39. {{.i18n.Tr "settings.manage_emails"}}
  40. </h4>
  41. <div class="ui attached segment">
  42. <div class="ui email list">
  43. <div class="item">
  44. <form action="{{AppSubUrl}}/user/settings/account/email" class="ui form" method="post">
  45. {{.i18n.Tr "settings.email_desc"}}
  46. <div class="right floated content">
  47. <div class="field">
  48. <button class="ui green button">{{$.i18n.Tr "settings.email_notifications.submit"}}</button>
  49. </div>
  50. </div>
  51. <div class="right floated content">
  52. {{$.CsrfTokenHtml}}
  53. <input name="_method" type="hidden" value="NOTIFICATION">
  54. <div class="field">
  55. <div class="ui selection dropdown" tabindex="0">
  56. <input name="preference" type="hidden" value="{{.EmailNotificationsPreference}}">
  57. <i class="dropdown icon"></i>
  58. <div class="text">{{$.i18n.Tr "settings.email_notifications"}}</div>
  59. <div class="menu">
  60. <div data-value="enabled" class="{{if eq .EmailNotificationsPreference "enabled"}}active selected {{end}}item">{{$.i18n.Tr "settings.email_notifications.enable"}}</div>
  61. <div data-value="onmention" class="{{if eq .EmailNotificationsPreference "onmention"}}active selected {{end}}item">{{$.i18n.Tr "settings.email_notifications.onmention"}}</div>
  62. <div data-value="disabled" class="{{if eq .EmailNotificationsPreference "disabled"}}active selected {{end}}item">{{$.i18n.Tr "settings.email_notifications.disable"}}</div>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. </form>
  68. </div>
  69. {{range .Emails}}
  70. <div class="item">
  71. {{if not .IsPrimary}}
  72. <div class="right floated content">
  73. <button class="ui red tiny button delete-button" id="delete-email" data-url="{{AppSubUrl}}/user/settings/account/email/delete" data-id="{{.ID}}">
  74. {{$.i18n.Tr "settings.delete_email"}}
  75. </button>
  76. </div>
  77. {{if .IsActivated}}
  78. <div class="right floated content">
  79. <form action="{{AppSubUrl}}/user/settings/account/email" method="post">
  80. {{$.CsrfTokenHtml}}
  81. <input name="_method" type="hidden" value="PRIMARY">
  82. <input name="id" type="hidden" value="{{.ID}}">
  83. <button class="ui blue tiny button">{{$.i18n.Tr "settings.primary_email"}}</button>
  84. </form>
  85. </div>
  86. {{end}}
  87. {{end}}
  88. <div class="content">
  89. <strong>{{.Email}}</strong>
  90. {{if .IsPrimary}}<span class="text red">{{$.i18n.Tr "settings.primary"}}</span>{{end}}
  91. </div>
  92. </div>
  93. {{end}}
  94. </div>
  95. </div>
  96. <div class="ui attached bottom segment">
  97. <form class="ui form" action="{{AppSubUrl}}/user/settings/account/email" method="post">
  98. {{.CsrfTokenHtml}}
  99. <div class="required field {{if .Err_Email}}error{{end}}">
  100. <label for="email">{{.i18n.Tr "settings.add_new_email"}}</label>
  101. <input id="email" name="email" type="email" required>
  102. </div>
  103. <button class="ui green button">
  104. {{.i18n.Tr "settings.add_email"}}
  105. </button>
  106. </form>
  107. </div>
  108. <h4 class="ui top attached header">
  109. {{.i18n.Tr "settings.manage_themes"}}
  110. </h4>
  111. <div class="ui attached segment">
  112. <div class="ui email list">
  113. <div class="item">
  114. {{.i18n.Tr "settings.theme_desc"}}
  115. </div>
  116. <form class="ui form" action="{{.Link}}/theme" method="post">
  117. {{.CsrfTokenHtml}}
  118. <div class="field">
  119. <label for="ui">{{.i18n.Tr "settings.ui"}}</label>
  120. <div class="ui selection dropdown" id="ui">
  121. <input name="theme" type="hidden" value="{{.SignedUser.Theme}}">
  122. <i class="dropdown icon"></i>
  123. <div class="text">
  124. {{range $i,$a := .AllThemes}}
  125. {{if eq $.SignedUser.Theme $a}}{{$a}}{{end}}
  126. {{end}}
  127. </div>
  128. <div class="menu">
  129. {{range $i,$a := .AllThemes}}
  130. <div class="item{{if eq $.SignedUser.Theme $a}} active selected{{end}}" data-value="{{$a}}">
  131. {{$a}}
  132. </div>
  133. {{end}}
  134. </div>
  135. </div>
  136. </div>
  137. <div class="field">
  138. <button class="ui green button">{{$.i18n.Tr "settings.update_theme"}}</button>
  139. </div>
  140. </form>
  141. </div>
  142. </div>
  143. <h4 class="ui top attached warning header">
  144. {{.i18n.Tr "settings.delete_account"}}
  145. </h4>
  146. <div class="ui attached warning segment">
  147. <div class="ui red message">
  148. <p class="text left"><i class="octicon octicon-alert"></i> {{.i18n.Tr "settings.delete_prompt" | Str2html}}</p>
  149. </div>
  150. <form class="ui form ignore-dirty" id="delete-form" action="{{AppSubUrl}}/user/settings/account/delete" method="post">
  151. {{.CsrfTokenHtml}}
  152. <input class="fake" type="password">
  153. <div class="required field {{if .Err_Password}}error{{end}}">
  154. <label for="password-confirmation">{{.i18n.Tr "password"}}</label>
  155. <input id="password-confirmation" name="password" type="password" required>
  156. </div>
  157. <div class="field">
  158. <div class="ui red button delete-button" id="delete-account" data-type="form" data-form="#delete-form">
  159. {{.i18n.Tr "settings.confirm_delete_account"}}
  160. </div>
  161. <a href="{{AppSubUrl}}/user/forgot_password?email={{.Email}}">{{.i18n.Tr "auth.forgot_password"}}</a>
  162. </div>
  163. </form>
  164. </div>
  165. </div>
  166. </div>
  167. <div class="ui small basic delete modal" id="delete-email">
  168. <div class="ui icon header">
  169. <i class="trash icon"></i>
  170. {{.i18n.Tr "settings.email_deletion"}}
  171. </div>
  172. <div class="content">
  173. <p>{{.i18n.Tr "settings.email_deletion_desc"}}</p>
  174. </div>
  175. {{template "base/delete_modal_actions" .}}
  176. </div>
  177. <div class="ui small basic delete modal" id="delete-account">
  178. <div class="ui icon header">
  179. <i class="trash icon"></i>
  180. {{.i18n.Tr "settings.delete_account_title"}}
  181. </div>
  182. <div class="content">
  183. <p>{{.i18n.Tr "settings.delete_account_desc"}}</p>
  184. </div>
  185. {{template "base/delete_modal_actions" .}}
  186. </div>
  187. {{template "base/footer" .}}
上海开阖软件有限公司 沪ICP备12045867号-1