summaryrefslogtreecommitdiffstats
path: root/templates/admin
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-08-29 15:32:52 +0800
committerUnknwon <joe2010xtmf@163.com>2014-08-29 15:32:52 +0800
commit88291745747ffb200b55ca62e1054d1d2c4315d3 (patch)
tree493d0cfe13d53c0720a25d30ced2b0d8d4f39d1a /templates/admin
parent6558990e3a1e3d5aac595e0f0b525a834d708647 (diff)
downloadgitea-88291745747ffb200b55ca62e1054d1d2c4315d3.tar.gz
gitea-88291745747ffb200b55ca62e1054d1d2c4315d3.zip
Finish new admin users pages
Diffstat (limited to 'templates/admin')
-rw-r--r--templates/admin/dashboard.tmpl2
-rw-r--r--templates/admin/user/edit.tmpl180
-rw-r--r--templates/admin/user/list.tmpl62
-rw-r--r--templates/admin/user/new.tmpl140
-rw-r--r--templates/admin/users.tmpl49
5 files changed, 189 insertions, 244 deletions
diff --git a/templates/admin/dashboard.tmpl b/templates/admin/dashboard.tmpl
index 81c262e2e0..09e105826a 100644
--- a/templates/admin/dashboard.tmpl
+++ b/templates/admin/dashboard.tmpl
@@ -22,7 +22,7 @@
<div class="panel-header">
<strong>{{.i18n.Tr "admin.dashboard.operations"}}</strong>
</div>
- <div class="panel-body">
+ <div class="panel-body admin-panel">
<div class="admin-table">
<table class="table">
<thead>
diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl
index 5975832f32..e88126706e 100644
--- a/templates/admin/user/edit.tmpl
+++ b/templates/admin/user/edit.tmpl
@@ -1,110 +1,78 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body" class="container" data-page="admin">
- {{template "admin/nav" .}}
- <div id="admin-container" class="col-md-9">
- <div class="panel panel-default">
- <div class="panel-heading">
- Edit Account
- </div>
-
- <div class="panel-body">
- <br/>
- <form action="/admin/users/{{.User.Id}}" method="post" class="form-horizontal">
- {{.CsrfTokenHtml}}
- {{template "base/alert" .}}
- <div class="form-group">
- <label class="col-md-3 control-label">Auth Source: </label>
- <div class="col-md-7">
- <select name="logintype" class="form-control">
- <option value="0-0">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>
-
- <div class="form-group">
- <label class="col-md-3 control-label">Auth Login Name: </label>
- <div class="col-md-7">
- <input name="loginname" class="form-control" placeholder="Type auth login's username" value="{{.User.LoginName}}">
- </div>
- </div>
-
- <div class="form-group">
- <label class="col-md-3 control-label">Username: </label>
- <label class="control-label">{{.User.Name}}</label>
- </div>
-
- <div class="form-group {{if .Err_Email}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Email<strong class="text-danger">*</strong></label>
- <div class="col-md-7">
- <input name="email" class="form-control" placeholder="Type account's e-mail address" value="{{.User.Email}}" required="required">
- </div>
- </div>
-
- <div class="form-group">
- <label class="col-md-3 control-label">Password</label>
- <div class="col-md-7">
- <input name="passwd" type="password" class="form-control" placeholder="Type account's new password or leave unfilled">
- </div>
- </div>
-
- <div class="form-group">
- <label class="col-md-3 control-label">Website</label>
- <div class="col-md-7">
- <input name="website" class="form-control" placeholder="Type account's website URL" value="{{.User.Website}}">
- </div>
- </div>
-
- <div class="form-group">
- <label class="col-md-3 control-label">Location</label>
- <div class="col-md-7">
- <input name="location" class="form-control" placeholder="Type account's current location" value="{{.User.Location}}">
- </div>
- </div>
-
- <div class="form-group {{if .Err_Avatar}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Gravatar Email<strong class="text-danger">*</strong></label>
- <div class="col-md-7">
- <input name="avatar" class="form-control" placeholder="Type account's Gravatar e-mail address" required="required" value="{{.User.AvatarEmail}}">
- </div>
- </div>
-
- <div class="form-group">
- <div class="col-md-7 col-md-offset-3">
- <div class="checkbox">
- <label>
+{{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="/admin/users/{{.User.Id}}" method="post" data-delete-url="/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>{{.User.Name}}</label>
+ </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>This account is activated</strong>
- </label>
- </div>
- </div>
- </div>
-
- <div class="form-group">
- <div class="col-md-7 col-md-offset-3">
- <div class="checkbox">
- <label>
+ <strong>{{.i18n.Tr "admin.users.is_activated"}}</strong>
+ <br>
+ <label></label>
<input type="checkbox" name="admin" {{if .User.IsAdmin}}checked{{end}}>
- <strong>This account has administrator permissions</strong>
- </label>
- </div>
- </div>
- </div>
- <hr/>
- <div class="form-group">
- <div class="col-md-offset-3 col-md-6">
- <button type="submit" class="btn btn-lg btn-primary btn-block">Update account profile</button>
- <a type="button" href="/admin/users/{{.User.Id}}/delete" class="btn btn-lg btn-danger btn-block">Delete this account</a>
- </div>
- </div>
- </form>
- </div>
- </div>
-
+ <strong>{{.i18n.Tr "admin.users.is_admin"}}</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;&nbsp;
+ <button class="btn btn-large btn-red btn-radius" id="user-delete">{{.i18n.Tr "admin.users.delete_account"}}</button>
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
</div>
</div>
-{{template "base/footer" .}}
+{{template "ng/base/footer" .}}
diff --git a/templates/admin/user/list.tmpl b/templates/admin/user/list.tmpl
new file mode 100644
index 0000000000..39e348fdf0
--- /dev/null
+++ b/templates/admin/user/list.tmpl
@@ -0,0 +1,62 @@
+{{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.user_manage_panel"}}</strong>
+ </div>
+ <div class="panel-body admin-panel">
+ <a class="btn-blue btn-medium btn-link btn-radius" href="/admin/users/new">{{.i18n.Tr "admin.users.new_account"}}</a>
+ <div class="admin-table">
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ <th>Id</th>
+ <th>{{.i18n.Tr "admin.users.name"}}</th>
+ <th>{{.i18n.Tr "admin.users.email"}}</th>
+ <th>{{.i18n.Tr "admin.users.activated"}}</th>
+ <th>{{.i18n.Tr "admin.users.admin"}}</th>
+ <th>{{.i18n.Tr "admin.users.repos"}}</th>
+ <th>{{.i18n.Tr "admin.users.created"}}</th>
+ <th>{{.i18n.Tr "admin.users.edit"}}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{range .Users}}
+ <tr>
+ <td>{{.Id}}</td>
+ <td><a href="/user/{{.Name}}">{{.Name}}</a></td>
+ <td>{{.Email}}</td>
+ <td><i class="fa fa{{if .IsActive}}-check{{end}}-square-o"></i></td>
+ <td><i class="fa fa{{if .IsAdmin}}-check{{end}}-square-o"></i></td>
+ <td>{{.NumRepos}}</td>
+ <td>{{DateFormat .Created "M d, Y"}}</td>
+ <td><a href="/admin/users/{{.Id}}"><i class="fa fa-pencil-square-o"></i></a></td>
+ </tr>
+ {{end}}
+ </tbody>
+ </table>
+ {{if or .LastPageNum .NextPageNum}}
+ <ul class="pagination">
+ {{if .LastPageNum}}<li><a class="btn btn-medium btn-gray btn-radius" href="/admin/users?p={{.LastPageNum}}">&laquo; Prev.</a></li>{{end}}
+ {{if .NextPageNum}}<li><a class="btn btn-medium btn-gray btn-radius" href="/admin/users?p={{.NextPageNum}}">&raquo; Next</a></li>{{end}}
+ </ul>
+ {{end}}
+ </div>
+ </div>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/admin/user/new.tmpl b/templates/admin/user/new.tmpl
index 4f4866c4b6..19126ee0c4 100644
--- a/templates/admin/user/new.tmpl
+++ b/templates/admin/user/new.tmpl
@@ -1,94 +1,58 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body" class="container" data-page="admin">
- {{template "admin/nav" .}}
- <div id="admin-container" class="col-md-9">
- <div class="panel panel-default">
- <div class="panel-heading">
- New Account
- </div>
-
- <div class="panel-body">
- <br/>
- <form action="/admin/users/new" method="post" class="form-horizontal">
- {{.CsrfTokenHtml}}
- {{template "base/alert" .}}
- <div class="form-group">
- <label class="col-md-3 control-label">Auth Source: </label>
- <div class="col-md-7">
- <select name="logintype" class="form-control" id="login-type">
- <option value="0-0">Local</option>
- {{range $key, $val := .LoginSources}}
- <option value="{{$val.Type}}-{{$val.Id}}">{{$val.Name}}</option>
- {{end}}
- </select>
- </div>
- </div>
-
- <div class="auth-name hidden">
- <div class="form-group">
- <label class="col-md-3 control-label">Auth Login Name: </label>
- <div class="col-md-7">
- <input name="loginname" class="form-control" placeholder="Type auth login's username" value="{{.loginname}}">
- </div>
- </div>
- </div>
-
- <div class="form-group {{if .Err_UserName}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Username: </label>
- <div class="col-md-7">
- <input name="username" class="form-control" placeholder="Type account's username" value="{{.username}}" required="required">
- </div>
- </div>
-
- <div class="form-group {{if .Err_Email}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Email: </label>
- <div class="col-md-7">
- <input name="email" class="form-control" placeholder="Type account's e-mail address" value="{{.email}}" required="required" title="Email is not valid">
- </div>
- </div>
-
- <div class="pwd">
- <div class="form-group {{if .Err_Password}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Password: </label>
- <div class="col-md-7">
- <input name="passwd" type="password" class="form-control" placeholder="Type account's password" required="required" title="Password must contain at least 6 characters">
+{{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.new_account"}}</strong>
</div>
- </div>
-
- <div class="form-group {{if .Err_RetypePasswd}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Re-type: </label>
- <div class="col-md-7">
- <input name="retypepasswd" type="password" class="form-control" placeholder="Re-type account's password" required="required" title="Re-type Password must be same to Password">
- </div>
- </div>
- </div>
- <hr/>
- <div class="form-group">
- <div class="col-md-offset-3 col-md-7">
- <button type="submit" class="btn btn-lg btn-primary">Create new account</button>
+ <form class="form form-align panel-body" id="repo-setting-form" action="/admin/users/new" method="post">
+ {{.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>
+ {{range $key, $val := .LoginSources}}
+ <option value="{{$val.Type}}-{{$val.Id}}">{{$val.Name}}</option>
+ {{end}}
+ </select>
+ </div>
+ <div class="field auth-name hidden">
+ <label class="req" 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="{{.loginname}}" />
+ </div>
+ <div class="field">
+ <label class="req" for="username">{{.i18n.Tr "username"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_UserName}}ipt-error{{end}}" id="username" name="uname" type="text" value="{{.uname}}" required />
+ </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="{{.email}}" required/>
+ </div>
+ <div class="field pwd">
+ <label class="req" 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" value="{{.password}}" required/>
+ </div>
+ <div class="field">
+ <label class="req" for="re-type">{{.i18n.Tr "re_type"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_Password}}ipt-error{{end}}" id="re-type" name="retype" type="password" required/>
+ </div>
+ <div class="field">
+ <span class="form-label"></span>
+ <button class="btn btn-blue btn-large btn-radius">{{.i18n.Tr "admin.users.new_account"}}</button>
+ </div>
+ </form>
</div>
</div>
- </form>
+ </div>
</div>
</div>
-
- </div>
+ </div>
</div>
-<script>
- $(function(){
- $('#login-type').on("change",function(){
- var v = $(this).val();
- if(v.indexOf("0-")+1){
- $('.auth-name').toggleHide();
- $(".pwd").find("input").attr("required","required")
- .end().toggleShow();
- }else{
- $(".pwd").find("input").removeAttr("required")
- .end().toggleHide();
- $('.auth-name').toggleShow();
- }
- });
- });
-</script>
-{{template "base/footer" .}} \ No newline at end of file
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/admin/users.tmpl b/templates/admin/users.tmpl
deleted file mode 100644
index 0efe909296..0000000000
--- a/templates/admin/users.tmpl
+++ /dev/null
@@ -1,49 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body" class="container" data-page="admin">
- {{template "admin/nav" .}}
- <div id="admin-container" class="col-md-10">
- <div class="panel panel-default">
- <div class="panel-heading">
- User Management
- </div>
-
- <div class="panel-body">
- <a href="/admin/users/new" class="btn btn-primary">New Account</a>
- <table class="table table-striped">
- <thead>
- <tr>
- <th>Id</th>
- <th>Name</th>
- <th>E-mail</th>
- <th>Actived</th>
- <th>Admin</th>
- <th>Repos</th>
- <th>Join</th>
- <th>Edit</th>
- </tr>
- </thead>
- <tbody>
- {{range .Users}}
- <tr>
- <td>{{.Id}}</td>
- <td><a href="/user/{{.Name}}">{{.Name}}</a></td>
- <td>{{.Email}}</td>
- <td><i class="fa fa{{if .IsActive}}-check{{end}}-square-o"></i></td>
- <td><i class="fa fa{{if .IsAdmin}}-check{{end}}-square-o"></i></td>
- <td>{{.NumRepos}}</td>
- <td>{{DateFormat .Created "M d, Y"}}</td>
- <td><a href="/admin/users/{{.Id}}"><i class="fa fa-pencil-square-o"></i></a></td>
- </tr>
- {{end}}
- </tbody>
- </table>
- <ul class="pagination">
- {{if .LastPageNum}}<li><a href="/admin/users?p={{.LastPageNum}}">&laquo; Prev.</a></li>{{end}}
- {{if .NextPageNum}}<li><a href="/admin/users?p={{.NextPageNum}}">&raquo; Next</a></li>{{end}}
- </ul>
- </div>
- </div>
- </div>
-</div>
-{{template "base/footer" .}} \ No newline at end of file