edit.tmpl 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. {{template "base/head" .}}
  2. <div class="admin edit user">
  3. <div class="ui container">
  4. <div class="ui grid">
  5. {{template "admin/navbar" .}}
  6. <div class="twelve wide column content">
  7. {{template "base/alert" .}}
  8. <h4 class="ui top attached header">
  9. {{.i18n.Tr "admin.users.edit_account"}}
  10. </h4>
  11. <div class="ui attached segment">
  12. <form class="ui form" action="{{.Link}}" method="post">
  13. {{.CsrfTokenHtml}}
  14. <div class="inline field {{if .Err_UserName}}error{{end}}">
  15. <label for="user_name">{{.i18n.Tr "username"}}</label>
  16. <span>{{.User.Name}}</span>
  17. </div>
  18. <!-- Types and name -->
  19. <div class="inline required field {{if .Err_LoginType}}error{{end}}">
  20. <label>{{.i18n.Tr "admin.users.auth_source"}}</label>
  21. <div class="ui selection type dropdown">
  22. <input type="hidden" id="login_type" name="login_type" value="{{.LoginSource.Type}}-{{.LoginSource.ID}}" required>
  23. <div class="text">{{.i18n.Tr "admin.users.local"}}</div>
  24. <i class="dropdown icon"></i>
  25. <div class="menu">
  26. <div class="item" data-value="0-0">{{.i18n.Tr "admin.users.local"}}</div>
  27. {{range .Sources}}
  28. <div class="item" data-value="{{.Type}}-{{.ID}}">{{.Name}}</div>
  29. {{end}}
  30. </div>
  31. </div>
  32. </div>
  33. <div class="required non-local field {{if .Err_LoginName}}error{{end}} {{if eq .User.LoginSource 0}}hide{{end}}">
  34. <label for="login_name">{{.i18n.Tr "admin.users.auth_login_name"}}</label>
  35. <input id="login_name" name="login_name" value="{{.User.LoginName}}" autofocus>
  36. </div>
  37. <div class="field {{if .Err_FullName}}error{{end}}">
  38. <label for="full_name">{{.i18n.Tr "settings.full_name"}}</label>
  39. <input id="full_name" name="full_name" value="{{.User.FullName}}">
  40. </div>
  41. <div class="required field {{if .Err_Email}}error{{end}}">
  42. <label for="email">{{.i18n.Tr "email"}}</label>
  43. <input id="email" name="email" type="email" value="{{.User.Email}}" autofocus required>
  44. </div>
  45. <input class="fake" type="password">
  46. <div class="local field {{if .Err_Password}}error{{end}} {{if not (eq .User.LoginSource 0)}}hide{{end}}">
  47. <label for="password">{{.i18n.Tr "password"}}</label>
  48. <input id="password" name="password" type="password">
  49. <p class="help">{{.i18n.Tr "admin.users.password_helper"}}</p>
  50. </div>
  51. <div class="field {{if .Err_Website}}error{{end}}">
  52. <label for="website">{{.i18n.Tr "settings.website"}}</label>
  53. <input id="website" name="website" type="url" value="{{.User.Website}}" placeholder="e.g. http://mydomain.com or https://mydomain.com">
  54. </div>
  55. <div class="field {{if .Err_Location}}error{{end}}">
  56. <label for="location">{{.i18n.Tr "settings.location"}}</label>
  57. <input id="location" name="location" value="{{.User.Location}}">
  58. </div>
  59. <div class="inline field">
  60. <div class="ui checkbox">
  61. <label><strong>{{.i18n.Tr "admin.users.is_activated"}}</strong></label>
  62. <input name="active" type="checkbox" {{if .User.IsActive}}checked{{end}}>
  63. </div>
  64. </div>
  65. <div class="inline field">
  66. <div class="ui checkbox">
  67. <label><strong>{{.i18n.Tr "admin.users.is_admin"}}</strong></label>
  68. <input name="admin" type="checkbox" {{if .User.IsAdmin}}checked{{end}}>
  69. </div>
  70. </div>
  71. <div class="inline field">
  72. <div class="ui checkbox">
  73. <label><strong>{{.i18n.Tr "admin.users.allow_git_hook"}}</strong></label>
  74. <input name="allow_git_hook" type="checkbox" {{if .User.CanEditGitHook}}checked{{end}}>
  75. </div>
  76. </div>
  77. <div class="inline field">
  78. <div class="ui checkbox">
  79. <label><strong>{{.i18n.Tr "admin.users.allow_import_local"}}</strong></label>
  80. <input name="allow_import_local" type="checkbox" {{if .User.CanImportLocal}}checked{{end}}>
  81. </div>
  82. </div>
  83. <div class="field">
  84. <button class="ui green button">{{.i18n.Tr "admin.users.update_profile"}}</button>
  85. <div class="ui red button delete-button" data-url="{{$.Link}}/delete" data-id="{{.User.Id}}">{{.i18n.Tr "admin.users.delete_account"}}</div>
  86. </div>
  87. </form>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. <div class="ui small basic delete modal">
  94. <div class="ui icon header">
  95. <i class="trash icon"></i>
  96. {{.i18n.Tr "settings.delete_account_title"}}
  97. </div>
  98. <div class="content">
  99. <p>{{.i18n.Tr "settings.delete_account_desc"}}</p>
  100. </div>
  101. {{template "base/delete_modal_actions" .}}
  102. </div>
  103. {{template "base/footer" .}}