summaryrefslogtreecommitdiffstats
path: root/templates/admin/user
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-09-13 11:07:21 -0400
committerUnknwon <u@gogs.io>2015-09-13 11:07:21 -0400
commit83e747bfda43c2c8fa0aceb2c989d42fe5ca1582 (patch)
tree1dfee9128010bb08ad2177c24fd1c5c8c53d45cd /templates/admin/user
parente5ed5904c62d9a618cb6f4ad852b021a02c3481e (diff)
downloadgitea-83e747bfda43c2c8fa0aceb2c989d42fe5ca1582.tar.gz
gitea-83e747bfda43c2c8fa0aceb2c989d42fe5ca1582.zip
#697 and #1606 and new admin edit user UI
Diffstat (limited to 'templates/admin/user')
-rw-r--r--templates/admin/user/edit.tmpl185
-rw-r--r--templates/admin/user/new.tmpl2
2 files changed, 97 insertions, 90 deletions
diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl
index e6591b80db..d4e83d6f9d 100644
--- a/templates/admin/user/edit.tmpl
+++ b/templates/admin/user/edit.tmpl
@@ -1,93 +1,100 @@
-{{template "ng/base/head" .}}
-{{template "ng/base/header" .}}
-<div id="admin-wrapper">
- <div id="setting-wrapper" class="main-wrapper">
- <div id="admin-setting" class="container clear">
- {{template "admin/nav" .}}
- <div class="grid-4-5 left">
- <div class="setting-content">
- {{template "ng/base/alert" .}}
- <div id="setting-content">
- <div class="panel panel-radius">
- <div class="panel-header">
- <strong>{{.i18n.Tr "admin.users.edit_account"}}</strong>
- </div>
- <form class="form form-align panel-body" id="user-profile-form" action="{{AppSubUrl}}/admin/users/{{.User.Id}}" method="post" data-delete-url="{{AppSubUrl}}/admin/users/{{.User.Id}}/delete">
- {{.CsrfTokenHtml}}
- <div class="field">
- <label class="req">{{.i18n.Tr "admin.users.auth_source"}}</label>
- <select id="login-type" name="logintype">
- <option value="0-0">{{.i18n.Tr "admin.users.local"}}</option>
- {{$tp := .User.LoginSource}}
- {{range $key, $val := .LoginSources}}
- <option value="{{$val.Type}}-{{$val.ID}}"{{if eq $val.ID $tp}} selected{{end}}>{{$val.Name}}</option>
- {{end}}
- </select>
- </div>
- <div class="field">
- <label for="loginname">{{.i18n.Tr "admin.users.auth_login_name"}}</label>
- <input class="ipt ipt-large ipt-radius {{if .Err_LoginName}}ipt-error{{end}}" id="loginname" name="loginname" value="{{.User.LoginName}}" />
- </div>
- <div class="field">
- <label>{{.i18n.Tr "username"}}</label>
- <label class="text-left">{{.User.Name}}</label>
- </div>
- <div class="field">
- <label for="full-name">{{.i18n.Tr "settings.full_name"}}</label>
- <input class="ipt ipt-large ipt-radius {{if .Err_FullName}}ipt-error{{end}}" id="full-name" name="fullname" type="text" value="{{.User.FullName}}" />
- </div>
- <div class="field">
- <label class="req" for="email">{{.i18n.Tr "email"}}</label>
- <input class="ipt ipt-large ipt-radius {{if .Err_Email}}ipt-error{{end}}" id="email" name="email" type="email" value="{{.User.Email}}" required/>
- </div>
- <div class="field pwd">
- <label for="password">{{.i18n.Tr "password"}}</label>
- <input class="ipt ipt-large ipt-radius {{if .Err_Password}}ipt-error{{end}}" id="password" name="password" type="password" />
- </div>
- <div class="field">
- <label for="website">{{.i18n.Tr "settings.website"}}</label>
- <input class="ipt ipt-large ipt-radius {{if .Err_Website}}ipt-error{{end}}" id="website" name="website" type="url" value="{{.User.Website}}" />
- </div>
- <div class="field">
- <label for="location">{{.i18n.Tr "settings.location"}}</label>
- <input class="ipt ipt-large ipt-radius {{if .Err_Location}}ipt-error{{end}}" id="location" name="location" type="text" value="{{.User.Location}}" />
- </div>
- <div class="field">
- <label for="gravatar-email">Gravatar {{.i18n.Tr "email"}}</label>
- <input class="ipt ipt-large ipt-radius {{if .Err_Avatar}}ipt-error{{end}}" id="gravatar-email" name="avatar" type="text" value="{{.User.AvatarEmail}}" />
- </div>
- <div class="field">
- <label></label>
- <input type="checkbox" name="active" {{if .User.IsActive}}checked{{end}}>
- <strong>{{.i18n.Tr "admin.users.is_activated"}}</strong>
- <br>
- <label></label>
- <input type="checkbox" name="admin" {{if .User.IsAdmin}}checked{{end}}>
- <strong>{{.i18n.Tr "admin.users.is_admin"}}</strong>
- <br>
- <label></label>
- <input type="checkbox" name="allow_git_hook" {{if .User.AllowGitHook}}checked{{end}}>
- <strong>{{.i18n.Tr "admin.users.allow_git_hook"}}</strong>
- </div>
- <div class="field">
- <label></label>
- <button class="btn btn-green btn-large btn-radius">{{.i18n.Tr "admin.users.update_profile"}}</button>
- &nbsp;&nbsp;&nbsp;&nbsp;
- <button class="btn btn-large btn-red btn-radius" id="delete-account-btn" href="#delete-account-modal">{{.i18n.Tr "admin.users.delete_account"}}</button>
- </div>
- <div class="white-popup-block mfp-hide" id="delete-account-modal">
- <h1 class="text-red">{{.i18n.Tr "settings.delete_account_title"}}</h1>
- <p>{{.i18n.Tr "settings.delete_account_desc"}}</p>
- <br>
- <button class="btn btn-red btn-large btn-radius" id="delete-account-submit">{{.i18n.Tr "settings.continue"}}</button>
- <button class="btn btn-large btn-radius popup-modal-dismiss">{{.i18n.Tr "settings.cancel"}}</button>
- </div>
- </form>
- </div>
- </div>
- </div>
+{{template "base/head" .}}
+<div class="admin edit user">
+ <div class="ui container">
+ <div class="ui grid">
+ {{template "admin/navbar" .}}
+ <div class="twelve wide column content">
+ {{template "base/alert" .}}
+ <h4 class="ui top attached header">
+ {{.i18n.Tr "admin.users.edit_account"}}
+ </h4>
+ <div class="ui attached segment">
+ <form class="ui form" action="{{.Link}}" method="post">
+ {{.CsrfTokenHtml}}
+ <div class="inline field {{if .Err_UserName}}error{{end}}">
+ <label for="user_name">{{.i18n.Tr "username"}}</label>
+ <span>{{.User.Name}}</span>
+ </div>
+ <!-- Types and name -->
+ <div class="inline required field {{if .Err_LoginType}}error{{end}}">
+ <label>{{.i18n.Tr "admin.users.auth_source"}}</label>
+ <div class="ui selection type dropdown">
+ <input type="hidden" id="login_type" name="login_type" value="{{.LoginSource.Type}}-{{.LoginSource.ID}}" required>
+ <div class="text">{{.i18n.Tr "admin.users.local"}}</div>
+ <i class="dropdown icon"></i>
+ <div class="menu">
+ <div class="item" data-value="0-0">{{.i18n.Tr "admin.users.local"}}</div>
+ {{range .Sources}}
+ <div class="item" data-value="{{.Type}}-{{.ID}}">{{.Name}}</div>
+ {{end}}
+ </div>
+ </div>
+ </div>
+ <div class="required non-local field {{if .Err_LoginName}}error{{end}} {{if eq .User.LoginSource 0}}hide{{end}}">
+ <label for="login_name">{{.i18n.Tr "admin.users.auth_login_name"}}</label>
+ <input id="login_name" name="login_name" value="{{.User.LoginName}}" autofocus>
+ </div>
+ <div class="field {{if .Err_FullName}}error{{end}}">
+ <label for="full_name">{{.i18n.Tr "settings.full_name"}}</label>
+ <input id="full_name" name="full_name" value="{{.User.FullName}}">
+ </div>
+ <div class="required field {{if .Err_Email}}error{{end}}">
+ <label for="email">{{.i18n.Tr "email"}}</label>
+ <input id="email" name="email" type="email" value="{{.User.Email}}" autofocus required>
+ </div>
+ <input class="fake" type="password">
+ <div class="local field {{if .Err_Password}}error{{end}} {{if not (eq .User.LoginSource 0)}}hide{{end}}">
+ <label for="password">{{.i18n.Tr "password"}}</label>
+ <input id="password" name="password" type="password">
+ <p class="help">{{.i18n.Tr "admin.users.password_helper"}}</p>
+ </div>
+ <div class="field {{if .Err_Website}}error{{end}}">
+ <label for="website">{{.i18n.Tr "settings.website"}}</label>
+ <input id="website" name="website" type="url" value="{{.User.Website}}" placeholder="e.g. http://mydomain.com or https://mydomain.com">
+ </div>
+ <div class="field {{if .Err_Location}}error{{end}}">
+ <label for="location">{{.i18n.Tr "settings.location"}}</label>
+ <input id="location" name="location" value="{{.User.Location}}">
+ </div>
+
+ <div class="inline field">
+ <div class="ui checkbox">
+ <label><strong>{{.i18n.Tr "admin.users.is_activated"}}</strong></label>
+ <input name="active" type="checkbox" {{if .User.IsActive}}checked{{end}}>
+ </div>
+ </div>
+ <div class="inline field">
+ <div class="ui checkbox">
+ <label><strong>{{.i18n.Tr "admin.users.is_admin"}}</strong></label>
+ <input name="admin" type="checkbox" {{if .User.IsAdmin}}checked{{end}}>
+ </div>
+ </div>
+ <div class="inline field">
+ <div class="ui checkbox">
+ <label><strong>{{.i18n.Tr "admin.users.allow_git_hook"}}</strong></label>
+ <input name="allow_git_hook" type="checkbox" {{if or .User.IsAdmin .User.AllowGitHook}}checked{{end}}>
+ </div>
+ </div>
+
+ <div class="field">
+ <button class="ui green button">{{.i18n.Tr "admin.users.update_profile"}}</button>
+ <div class="ui red button delete-button" data-url="{{$.Link}}/delete" data-id="{{.User.Id}}">{{.i18n.Tr "admin.users.delete_account"}}</div>
+ </div>
+ </form>
+ </div>
</div>
</div>
</div>
</div>
-{{template "ng/base/footer" .}}
+
+<div class="ui small basic delete modal">
+ <div class="ui icon header">
+ <i class="trash icon"></i>
+ {{.i18n.Tr "settings.delete_account_title"}}
+ </div>
+ <div class="content">
+ <p>{{.i18n.Tr "settings.delete_account_desc"}}</p>
+ </div>
+ {{template "base/delete_modal_actions" .}}
+</div>
+{{template "base/footer" .}}
diff --git a/templates/admin/user/new.tmpl b/templates/admin/user/new.tmpl
index 5d02d1d6d7..7272343818 100644
--- a/templates/admin/user/new.tmpl
+++ b/templates/admin/user/new.tmpl
@@ -15,7 +15,7 @@
<div class="inline required field {{if .Err_LoginType}}error{{end}}">
<label>{{.i18n.Tr "admin.users.auth_source"}}</label>
<div class="ui selection type dropdown">
- <input type="hidden" id="login_type" name="login_type" value="{{.login_type}}" required>
+ <input type="hidden" id="login_type" name="login_type" value="{{.login_type}}" data-password="required" required>
<div class="text">{{.i18n.Tr "admin.users.local"}}</div>
<i class="dropdown icon"></i>
<div class="menu">