edit.tmpl 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. <div class="field">
  46. <div class="ui checkbox">
  47. <label for="show_email">{{.i18n.Tr "settings.show_email"}}</label>
  48. <input id="show_email" name="show_email" type="checkbox" {{if .User.ShowEmail}}checked{{end}} />
  49. </div>
  50. </div>
  51. <input class="fake" type="password">
  52. <div class="local field {{if .Err_Password}}error{{end}} {{if not (eq .User.LoginSource 0)}}hide{{end}}">
  53. <label for="password">{{.i18n.Tr "password"}}</label>
  54. <input id="password" name="password" type="password">
  55. <p class="help">{{.i18n.Tr "admin.users.password_helper"}}</p>
  56. </div>
  57. <div class="field {{if .Err_Website}}error{{end}}">
  58. <label for="website">{{.i18n.Tr "settings.website"}}</label>
  59. <input id="website" name="website" type="url" value="{{.User.Website}}" placeholder="e.g. http://mydomain.com or https://mydomain.com">
  60. </div>
  61. <div class="field {{if .Err_Location}}error{{end}}">
  62. <label for="location">{{.i18n.Tr "settings.location"}}</label>
  63. <input id="location" name="location" value="{{.User.Location}}">
  64. </div>
  65. <div class="ui divider"></div>
  66. <div class="inline field {{if .Err_MaxRepoCreation}}error{{end}}">
  67. <label for="max_repo_creation">{{.i18n.Tr "admin.users.max_repo_creation"}}</label>
  68. <input id="max_repo_creation" name="max_repo_creation" type="number" value="{{.User.MaxRepoCreation}}">
  69. <p class="help">{{.i18n.Tr "admin.users.max_repo_creation_desc"}}</p>
  70. </div>
  71. <div class="ui divider"></div>
  72. <div class="inline field">
  73. <div class="ui checkbox">
  74. <label><strong>{{.i18n.Tr "admin.users.is_activated"}}</strong></label>
  75. <input name="active" type="checkbox" {{if .User.IsActive}}checked{{end}}>
  76. </div>
  77. </div>
  78. <div class="inline field">
  79. <div class="ui checkbox">
  80. <label><strong>{{.i18n.Tr "admin.users.prohibit_login"}}</strong></label>
  81. <input name="prohibit_login" type="checkbox" {{if .User.ProhibitLogin}}checked{{end}}>
  82. </div>
  83. </div>
  84. <div class="inline field">
  85. <div class="ui checkbox">
  86. <label><strong>{{.i18n.Tr "admin.users.is_admin"}}</strong></label>
  87. <input name="admin" type="checkbox" {{if .User.IsAdmin}}checked{{end}}>
  88. </div>
  89. </div>
  90. <div class="inline field">
  91. <div class="ui checkbox">
  92. <label><strong>{{.i18n.Tr "admin.users.allow_git_hook"}}</strong></label>
  93. <input name="allow_git_hook" type="checkbox" {{if .User.CanEditGitHook}}checked{{end}}>
  94. </div>
  95. </div>
  96. <div class="inline field">
  97. <div class="ui checkbox">
  98. <label><strong>{{.i18n.Tr "admin.users.allow_import_local"}}</strong></label>
  99. <input name="allow_import_local" type="checkbox" {{if .User.CanImportLocal}}checked{{end}}>
  100. </div>
  101. </div>
  102. <div class="ui divider"></div>
  103. <div class="field">
  104. <button class="ui green button">{{.i18n.Tr "admin.users.update_profile"}}</button>
  105. <div class="ui red button delete-button" data-url="{{$.Link}}/delete" data-id="{{.User.ID}}">{{.i18n.Tr "admin.users.delete_account"}}</div>
  106. </div>
  107. </form>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. <div class="ui small basic delete modal">
  114. <div class="ui icon header">
  115. <i class="trash icon"></i>
  116. {{.i18n.Tr "settings.delete_account_title"}}
  117. </div>
  118. <div class="content">
  119. <p>{{.i18n.Tr "settings.delete_account_desc"}}</p>
  120. </div>
  121. {{template "base/delete_modal_actions" .}}
  122. </div>
  123. {{template "base/footer" .}}