edit.tmpl 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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="ui divider"></div>
  60. <div class="inline field {{if .Err_MaxRepoCreation}}error{{end}}">
  61. <label for="max_repo_creation">{{.i18n.Tr "admin.users.max_repo_creation"}}</label>
  62. <input id="max_repo_creation" name="max_repo_creation" type="number" value="{{.User.MaxRepoCreation}}">
  63. <p class="help">{{.i18n.Tr "admin.users.max_repo_creation_desc"}}</p>
  64. </div>
  65. <div class="ui divider"></div>
  66. <div class="inline field">
  67. <div class="ui checkbox">
  68. <label><strong>{{.i18n.Tr "admin.users.is_activated"}}</strong></label>
  69. <input name="active" type="checkbox" {{if .User.IsActive}}checked{{end}}>
  70. </div>
  71. </div>
  72. <div class="inline field">
  73. <div class="ui checkbox">
  74. <label><strong>{{.i18n.Tr "admin.users.prohibit_login"}}</strong></label>
  75. <input name="prohibit_login" type="checkbox" {{if .User.ProhibitLogin}}checked{{end}}>
  76. </div>
  77. </div>
  78. <div class="inline field">
  79. <div class="ui checkbox">
  80. <label><strong>{{.i18n.Tr "admin.users.is_admin"}}</strong></label>
  81. <input name="admin" type="checkbox" {{if .User.IsAdmin}}checked{{end}}>
  82. </div>
  83. </div>
  84. <div class="inline field">
  85. <div class="ui checkbox">
  86. <label><strong>{{.i18n.Tr "admin.users.allow_git_hook"}}</strong></label>
  87. <input name="allow_git_hook" type="checkbox" {{if .User.CanEditGitHook}}checked{{end}}>
  88. </div>
  89. </div>
  90. <div class="inline field">
  91. <div class="ui checkbox">
  92. <label><strong>{{.i18n.Tr "admin.users.allow_import_local"}}</strong></label>
  93. <input name="allow_import_local" type="checkbox" {{if .User.CanImportLocal}}checked{{end}}>
  94. </div>
  95. </div>
  96. <div class="ui divider"></div>
  97. <div class="field">
  98. <button class="ui green button">{{.i18n.Tr "admin.users.update_profile"}}</button>
  99. <div class="ui red button delete-button" data-url="{{$.Link}}/delete" data-id="{{.User.ID}}">{{.i18n.Tr "admin.users.delete_account"}}</div>
  100. </div>
  101. </form>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. <div class="ui small basic delete modal">
  108. <div class="ui icon header">
  109. <i class="trash icon"></i>
  110. {{.i18n.Tr "settings.delete_account_title"}}
  111. </div>
  112. <div class="content">
  113. <p>{{.i18n.Tr "settings.delete_account_desc"}}</p>
  114. </div>
  115. {{template "base/delete_modal_actions" .}}
  116. </div>
  117. {{template "base/footer" .}}