summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/.VERSION1
-rw-r--r--templates/VERSION1
-rw-r--r--templates/admin/auth/edit.tmpl260
-rw-r--r--templates/admin/auth/list.tmpl59
-rw-r--r--templates/admin/auth/new.tmpl266
-rw-r--r--templates/admin/auths.tmpl43
-rw-r--r--templates/admin/config.tmpl454
-rw-r--r--templates/admin/dashboard.tmpl282
-rw-r--r--templates/admin/monitor.tmpl74
-rw-r--r--templates/admin/monitor/cron.tmpl40
-rw-r--r--templates/admin/monitor/process.tmpl38
-rw-r--r--templates/admin/nav.tmpl22
-rw-r--r--templates/admin/org/list.tmpl58
-rw-r--r--templates/admin/repo/list.tmpl60
-rw-r--r--templates/admin/repos.tmpl44
-rw-r--r--templates/admin/user/edit.tmpl173
-rw-r--r--templates/admin/user/list.tmpl61
-rw-r--r--templates/admin/user/new.tmpl140
-rw-r--r--templates/admin/users.tmpl45
-rw-r--r--templates/base/navbar.tmpl26
-rw-r--r--templates/home.tmpl95
-rw-r--r--templates/install.tmpl4
-rw-r--r--templates/mail/notify/collaborator.tmpl2
-rw-r--r--templates/ng/base/alert.tmpl2
-rw-r--r--templates/ng/base/footer.tmpl27
-rw-r--r--templates/ng/base/head.tmpl38
-rw-r--r--templates/ng/base/header.tmpl58
-rw-r--r--templates/ng/base/social.tmpl4
-rw-r--r--templates/org/base/header.tmpl16
-rw-r--r--templates/org/create.tmpl31
-rw-r--r--templates/org/edit_team.tmpl75
-rw-r--r--templates/org/home.tmpl153
-rw-r--r--templates/org/member/invite.tmpl18
-rw-r--r--templates/org/member/members.tmpl49
-rw-r--r--templates/org/members.tmpl56
-rw-r--r--templates/org/settings.tmpl130
-rw-r--r--templates/org/settings/delete.tmpl29
-rw-r--r--templates/org/settings/nav.tmpl11
-rw-r--r--templates/org/settings/options.tmpl57
-rw-r--r--templates/org/team/members.tmpl45
-rw-r--r--templates/org/team/new.tmpl63
-rw-r--r--templates/org/team/repositories.tmpl45
-rw-r--r--templates/org/team/sidebar.tmpl34
-rw-r--r--templates/org/team/teams.tmpl42
-rw-r--r--templates/org/team_new.tmpl79
-rw-r--r--templates/org/teams.tmpl58
-rw-r--r--templates/repo/bare.tmpl53
-rw-r--r--templates/repo/collaboration.tmpl47
-rw-r--r--templates/repo/commits.tmpl2
-rw-r--r--templates/repo/create.tmpl160
-rw-r--r--templates/repo/diff.tmpl2
-rw-r--r--templates/repo/header.tmpl57
-rw-r--r--templates/repo/home.tmpl78
-rw-r--r--templates/repo/hook_add.tmpl62
-rw-r--r--templates/repo/hook_edit.tmpl72
-rw-r--r--templates/repo/hooks.tmpl33
-rw-r--r--templates/repo/issue/create.tmpl14
-rw-r--r--templates/repo/issue/list.tmpl6
-rw-r--r--templates/repo/issue/view.tmpl60
-rw-r--r--templates/repo/migrate.tmpl177
-rw-r--r--templates/repo/nav.tmpl4
-rw-r--r--templates/repo/setting.tmpl182
-rw-r--r--templates/repo/settings/collaboration.tmpl47
-rw-r--r--templates/repo/settings/hook_new.tmpl70
-rw-r--r--templates/repo/settings/hooks.tmpl39
-rw-r--r--templates/repo/settings/nav.tmpl11
-rw-r--r--templates/repo/settings/options.tmpl129
-rw-r--r--templates/repo/sidebar.tmpl28
-rw-r--r--templates/repo/single_file.tmpl2
-rw-r--r--templates/repo/view_file.tmpl37
-rw-r--r--templates/repo/view_list.tmpl46
-rw-r--r--templates/status/200.tmpl7
-rw-r--r--templates/status/401.tmpl8
-rw-r--r--templates/status/403.tmpl6
-rw-r--r--templates/status/404.tmpl10
-rw-r--r--templates/status/500.tmpl12
-rw-r--r--templates/user/activate.tmpl36
-rw-r--r--templates/user/auth/activate.tmpl39
-rw-r--r--templates/user/auth/forgot_passwd.tmpl32
-rw-r--r--templates/user/auth/reset_passwd.tmpl25
-rw-r--r--templates/user/auth/signin.tmpl44
-rw-r--r--templates/user/auth/signup.tmpl49
-rw-r--r--templates/user/dashboard.tmpl102
-rw-r--r--templates/user/dashboard/dashboard.tmpl168
-rw-r--r--templates/user/dashboard/nav.tmpl46
-rw-r--r--templates/user/dashboard/pulls.tmpl5
-rw-r--r--templates/user/delete.tmpl45
-rw-r--r--templates/user/forgot_passwd.tmpl32
-rw-r--r--templates/user/issues.tmpl2
-rw-r--r--templates/user/notification.tmpl9
-rw-r--r--templates/user/password.tmpl49
-rw-r--r--templates/user/profile.tmpl8
-rw-r--r--templates/user/publickey.tmpl65
-rw-r--r--templates/user/pulls.tmpl17
-rw-r--r--templates/user/reset_passwd.tmpl26
-rw-r--r--templates/user/security.tmpl9
-rw-r--r--templates/user/setting.tmpl69
-rw-r--r--templates/user/setting_nav.tmpl11
-rw-r--r--templates/user/settings/delete.tmpl28
-rw-r--r--templates/user/settings/nav.tmpl12
-rw-r--r--templates/user/settings/password.tmpl37
-rw-r--r--templates/user/settings/profile.tmpl52
-rw-r--r--templates/user/settings/social.tmpl33
-rw-r--r--templates/user/settings/sshkeys.tmpl61
-rw-r--r--templates/user/signin.tmpl71
-rw-r--r--templates/user/signup.tmpl60
-rw-r--r--templates/user/social.tmpl37
-rw-r--r--templates/user/stars.tmpl17
108 files changed, 3225 insertions, 2900 deletions
diff --git a/templates/.VERSION b/templates/.VERSION
new file mode 100644
index 0000000000..fb2403adf0
--- /dev/null
+++ b/templates/.VERSION
@@ -0,0 +1 @@
+0.4.9.0831 Beta \ No newline at end of file
diff --git a/templates/VERSION b/templates/VERSION
deleted file mode 100644
index 6237548bbc..0000000000
--- a/templates/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-0.4.5.0704 Alpha \ No newline at end of file
diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl
index a2c2ddc698..400a4cebe3 100644
--- a/templates/admin/auth/edit.tmpl
+++ b/templates/admin/auth/edit.tmpl
@@ -1,165 +1,113 @@
-{{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 Authentication
- </div>
-
- <div class="panel-body">
- <br/>
- <form action="/admin/auths/{{.Source.Id}}" method="post" class="form-horizontal">
- {{.CsrfTokenHtml}}
- {{template "base/alert" .}}
- <input type="hidden" value="{{.Source.Id}}" name="id"/>
- {{$type := .Source.Type}}
- <div class="form-group">
- <label class="col-md-3 control-label">Auth Type: </label>
- <input type="hidden" name="type" value="{{.Source.Type}}"/>
- <label class="control-label">
- {{range $key, $val := .LoginTypes}}
- {{if eq $key $type}}{{$val}}{{end}}
- {{end}}
- </label>
- </div>
- <div class="form-group {{if .Err_AuthName}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Name: </label>
- <div class="col-md-7">
- <input name="name" class="form-control" placeholder="Type authentication's name" value="{{.Source.Name}}" required="required">
- </div>
- </div>
-
- {{if eq $type 2}}
- <div class="form-group {{if .Err_Domain}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Domain: </label>
- <div class="col-md-7">
- <input name="domain" class="form-control" placeholder="Type domain name" value="{{.Source.LDAP.Name}}" required="required">
- </div>
- </div>
-
- <div class="form-group {{if .Err_Host}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Host: </label>
- <div class="col-md-7">
- <input name="host" class="form-control" placeholder="Type host address" value="{{.Source.LDAP.Host}}" required="required">
- </div>
- </div>
-
- <div class="form-group {{if .Err_Port}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Port: </label>
- <div class="col-md-7">
- <input name="port" class="form-control" placeholder="Type port number" value="{{.Source.LDAP.Port}}" required="required">
- </div>
- </div>
-
- <div class="form-group {{if .Err_UseSSL}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Use SSL: </label>
- <div class="col-md-7">
- <input name="usessl" class="form-control" type="checkbox" {{if .Source.LDAP.UseSSL}}checked{{end}}>
- </div>
- </div>
-
-
- <div class="form-group {{if .Err_BaseDN}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Base DN: </label>
- <div class="col-md-7">
- <input name="base_dn" class="form-control" placeholder="Type base DN" value="{{.Source.LDAP.BaseDN}}" required="required">
- </div>
- </div>
-
- <div class="form-group {{if .Err_Attributes}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Search Attributes: </label>
- <div class="col-md-7">
- <input name="attributes" class="form-control" placeholder="Type search attributes" value="{{.Source.LDAP.Attributes}}">
- </div>
- </div>
-
- <div class="form-group {{if .Err_Filter}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Search Filter: </label>
- <div class="col-md-7">
- <input name="filter" class="form-control" placeholder="Type search filter" value="{{.Source.LDAP.Filter}}">
- </div>
- </div>
-
- <div class="form-group {{if .Err_MsAdSA}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Ms Ad SA: </label>
- <div class="col-md-7">
- <input name="ms_ad_sa" class="form-control" placeholder="Type Ms Ad SA" value="{{.Source.LDAP.MsAdSAFormat}}">
- </div>
- </div>
- {{else if eq $type 3}}
- <div class="form-group {{if .Err_TLS}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">SMTP Auth: </label>
- <div class="col-md-7">
- <select name="smtpauth" class="form-control">
- {{$auth := .Source.SMTP.Auth}}
- {{range .SMTPAuths}}
- <option value="{{.}}"
- {{if eq . $auth}} selected{{end}}>{{.}}</option>
- {{end}}
- </select>
- </div>
- </div>
-
- <div class="form-group {{if .Err_SmtpHost}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Host: </label>
- <div class="col-md-7">
- <input name="smtphost" class="form-control" placeholder="Type host address" value="{{.Source.SMTP.Host}}">
- </div>
- </div>
-
- <div class="form-group {{if .Err_SmtpPort}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Port: </label>
- <div class="col-md-7">
- <input name="smtpport" class="form-control" placeholder="Type port number" value="{{.Source.SMTP.Port}}">
- </div>
- </div>
- {{end}}
-
- <div class="form-group">
- {{if eq $type 3}}
- <div class="col-md-offset-3 col-md-7">
- <div class="checkbox">
- <label>
- <input name="tls" type="checkbox" class="form-control" {{if .Source.SMTP.TLS}}checked{{end}}>
- <strong>Enable TLS Encryption</strong>
- </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.auths.edit"}}</strong>
</div>
- </div>
- {{end}}
+ <form class="form form-align panel-body" id="auth-setting-form" action="/admin/auths/{{.Source.Id}}" data-delete-url="/admin/auths/{{.Source.Id}}/delete" method="post">
+ {{.CsrfTokenHtml}}
+ <input type="hidden" value="{{.Source.Id}}" name="id"/>
+ {{$type := .Source.Type}}
+ <div class="field">
+ <label>{{.i18n.Tr "admin.auths.auth_type"}}</label>
+ <input type="hidden" name="type" value="{{.Source.Type}}"/>
+ <label class="control-label">
+ {{range $key, $val := .LoginTypes}}
+ {{if eq $key $type}}{{$val}}{{end}}
+ {{end}}
+ </label>
+ </div>
+ <div class="field">
+ <label class="req" for="name">{{.i18n.Tr "admin.auths.auth_name"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_AuthName}}ipt-error{{end}}" id="name" name="name" value="{{.Source.Name}}" required />
+ </div>
+
+ {{if eq $type 2}}
+ <div class="field">
+ <label class="req" for="domain">{{.i18n.Tr "admin.auths.domain"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_Domain}}ipt-error{{end}}" id="domain" name="domain" value="{{.Source.LDAP.Name}}" required />
+ </div>
+ <div class="field">
+ <label class="req" for="host">{{.i18n.Tr "admin.auths.host"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_Host}}ipt-error{{end}}" id="host" name="host" value="{{.Source.LDAP.Host}}" required />
+ </div>
+ <div class="field">
+ <label class="req" for="port">{{.i18n.Tr "admin.auths.port"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_Port}}ipt-error{{end}}" id="port" name="port" value="{{.Source.LDAP.Port}}" required />
+ </div>
+ <div class="field">
+ <label class="req" for="base_dn">{{.i18n.Tr "admin.auths.base_dn"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_BaseDN}}ipt-error{{end}}" id="base_dn" name="base_dn" value="{{.Source.LDAP.BaseDN}}" />
+ </div>
+ <div class="field">
+ <label class="req" for="attributes">{{.i18n.Tr "admin.auths.attributes"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_Attributes}}ipt-error{{end}}" id="attributes" name="attributes" value="{{.Source.LDAP.Attributes}}" />
+ </div>
+ <div class="field">
+ <label class="req" for="filter">{{.i18n.Tr "admin.auths.filter"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_Filter}}ipt-error{{end}}" id="filter" name="filter" value="{{.Source.LDAP.Filter}}" />
+ </div>
+ <div class="field">
+ <label class="req" for="ms_ad_sa">{{.i18n.Tr "admin.auths.ms_ad_sa"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_MsAdSA}}ipt-error{{end}}" id="ms_ad_sa" name="ms_ad_sa" value="{{.Source.LDAP.MsAdSAFormat}}" />
+ </div>
+
+ {{else if eq $type 3}}
+ <div class="field">
+ <label class="req">{{.i18n.Tr "admin.auths.smtp_auth"}}</label>
+ <select name="smtpauth">
+ {{$auth := .Source.SMTP.Auth}}
+ {{range .SMTPAuths}}
+ <option value="{{.}}"
+ {{if eq . $auth}} selected{{end}}>{{.}}</option>
+ {{end}}
+ </select>
+ </div>
+ <div class="field">
+ <label class="req" for="smtphost">{{.i18n.Tr "admin.auths.smtphost"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_SmtpHost}}ipt-error{{end}}" id="smtphost" name="smtphost" value="{{.Source.SMTP.Host}}" />
+ </div>
+ <div class="field">
+ <label class="req" for="smtpport">{{.i18n.Tr "admin.auths.smtpport"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_SmtpPort}}ipt-error{{end}}" id="smtpport" name="smtpport" value="{{.Source.SMTP.Port}}" />
+ </div>
+ {{end}}
- <div class="col-md-offset-3 col-md-7">
- <div class="checkbox">
- <label>
+ <div class="field">
+ {{if eq $type 3}}
+ <label></label>
+ <input name="tls" type="checkbox" {{if .Source.SMTP.TLS}}checked{{end}}>
+ <strong>{{.i18n.Tr "admin.auths.enable_tls"}}</strong>
+ <br>
+ {{end}}
+ <label></label>
<input name="allowautoregister" type="checkbox" {{if .Source.AllowAutoRegister}}checked{{end}}>
- <strong>Enable Auto Registration</strong>
- </label>
- </div>
- </div>
-
- <div class="col-md-7 col-md-offset-3">
- <div class="checkbox">
- <label>
- <input type="checkbox" name="is_actived" {{if .Source.IsActived}}checked{{end}}>
- <strong>This authentication has activated.</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 authentication config</button>
- <a type="button" href="/admin/auths/{{.Source.Id}}/delete" class="btn btn-lg btn-danger btn-block">Delete this authentication</a>
+ <strong>{{.i18n.Tr "admin.auths.enable_auto_register"}}</strong>
+ <br>
+ <label></label>
+ <input name="is_actived" type="checkbox" {{if .Source.IsActived}}checked{{end}}>
+ <strong>{{.i18n.Tr "admin.auths.activated"}}</strong>
+ </div>
+ <div class="field">
+ <label></label>
+ <button class="btn btn-green btn-large btn-radius">{{.i18n.Tr "admin.auths.update"}}</button>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ <button class="btn btn-large btn-red btn-radius" id="auth-delete">{{.i18n.Tr "admin.auths.delete"}}</button>
+ </div>
+ </form>
</div>
</div>
- </form>
+ </div>
</div>
</div>
-
</div>
</div>
-{{template "base/footer" .}}
+{{template "ng/base/footer" .}}
diff --git a/templates/admin/auth/list.tmpl b/templates/admin/auth/list.tmpl
new file mode 100644
index 0000000000..591d2ed4c3
--- /dev/null
+++ b/templates/admin/auth/list.tmpl
@@ -0,0 +1,59 @@
+{{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.auths.auth_manage_panel"}}</strong>
+ </div>
+ <div class="panel-body admin-panel">
+ <a class="btn-blue btn-medium btn-link btn-radius" href="/admin/auths/new">{{.i18n.Tr "admin.auths.new"}}</a>
+ <div class="admin-table">
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ <th>Id</th>
+ <th>{{.i18n.Tr "admin.auths.name"}}</th>
+ <th>{{.i18n.Tr "admin.auths.type"}}</th>
+ <th>{{.i18n.Tr "admin.auths.enabled"}}</th>
+ <th>{{.i18n.Tr "admin.auths.updated"}}</th>
+ <th>{{.i18n.Tr "admin.users.created"}}</th>
+ <th>{{.i18n.Tr "admin.users.edit"}}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{range .Sources}}
+ <tr>
+ <td>{{.Id}}</td>
+ <td><a href="/admin/auths/{{.Id}}">{{.Name}}</a></td>
+ <td>{{.TypeString}}</td>
+ <td><i class="fa fa{{if .IsActived}}-check{{end}}-square-o"></i></td>
+ <td>{{DateFormat .Updated "M d, Y"}}</td>
+ <td>{{DateFormat .Created "M d, Y"}}</td>
+ <td><a href="/admin/auths/{{.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/auths?p={{.LastPageNum}}">&laquo; Prev.</a></li>{{end}}
+ {{if .NextPageNum}}<li><a class="btn btn-medium btn-gray btn-radius" href="/admin/auths?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/auth/new.tmpl b/templates/admin/auth/new.tmpl
index abb88043ee..8f9f5ccc01 100644
--- a/templates/admin/auth/new.tmpl
+++ b/templates/admin/auth/new.tmpl
@@ -1,178 +1,110 @@
-{{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 Authentication
- </div>
-
- <div class="panel-body">
- <br/>
- <form action="/admin/auths/new" method="post" class="form-horizontal">
- {{.CsrfTokenHtml}}
- {{template "base/alert" .}}
- <div class="form-group">
- <label class="col-md-3 control-label">Auth Type: </label>
- <div class="col-md-7">
- <select name="type" class="form-control" id="auth-type">
- {{range $key, $val := .LoginTypes}}
- <option value="{{$key}}">{{$val}}</option>
- {{end}}
- </select>
- </div>
- </div>
- <div class="form-group {{if .Err_AuthName}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Name: </label>
- <div class="col-md-7">
- <input name="name" class="form-control" placeholder="Type authentication's name" value="{{.name}}">
- </div>
- </div>
- <div class="ldap">
- <div class="form-group {{if .Err_Domain}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Domain: </label>
- <div class="col-md-7">
- <input name="domain" class="form-control" placeholder="Type domain name" value="{{.domain}}">
- </div>
- </div>
-
- <div class="form-group {{if .Err_Host}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Host: </label>
- <div class="col-md-7">
- <input name="host" class="form-control" placeholder="Type host address" value="{{.host}}">
- </div>
- </div>
-
- <div class="form-group {{if .Err_Port}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Port: </label>
- <div class="col-md-7">
- <input name="port" class="form-control" placeholder="Type port number" value="{{.port}}">
- </div>
- </div>
-
- <div class="form-group {{if .Err_UseSSL}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Use SSL: </label>
- <div class="col-md-7">
- <input name="usessl" class="form-control" type="checkbox" {{if .usessl}}checked{{end}}>
- </div>
- </div>
-
- <div class="form-group {{if .Err_BaseDN}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Base DN: </label>
- <div class="col-md-7">
- <input name="base_dn" class="form-control" placeholder="Type base DN" value="{{.base_dn}}">
- </div>
- </div>
-
- <div class="form-group {{if .Err_Attributes}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Search Attributes: </label>
- <div class="col-md-7">
- <input name="attributes" class="form-control" placeholder="Type search attributes" value="{{.attributes}}">
- </div>
- </div>
-
- <div class="form-group {{if .Err_Filter}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Search Filter: </label>
- <div class="col-md-7">
- <input name="filter" class="form-control" placeholder="Type search filter" value="{{.filter}}">
- </div>
- </div>
-
- <div class="form-group {{if .Err_MsAdSA}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Ms Ad SA: </label>
- <div class="col-md-7">
- <input name="ms_ad_sa" class="form-control" placeholder="Type Ms Ad SA" value="{{.ms_ad_sa}}">
- </div>
- </div>
-
- </div>
-
- <div class="smtp hidden">
- <div class="form-group">
- <label class="col-md-3 control-label">SMTP Auth: </label>
- <div class="col-md-7">
- <select name="smtpauth" class="form-control">
- {{range .SMTPAuths}}
- <option value="{{.}}">{{.}}</option>
- {{end}}
- </select>
+{{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.auths.new"}}</strong>
</div>
- </div>
-
- <div class="form-group {{if .Err_SmtpHost}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Host: </label>
- <div class="col-md-7">
- <input name="smtphost" class="form-control" placeholder="Type host address" value="{{.smtphost}}">
- </div>
- </div>
-
- <div class="form-group {{if .Err_SmtpPort}}has-error has-feedback{{end}}">
- <label class="col-md-3 control-label">Port: </label>
- <div class="col-md-7">
- <input name="smtpport" class="form-control" placeholder="Type port number" value="{{.smtpport}}">
- </div>
- </div>
-
- <div class="form-group">
- <div class="col-md-offset-3 col-md-7">
- <div class="checkbox">
- <label>
+ <form class="form form-align panel-body" id="repo-setting-form" action="/admin/auths/new" method="post">
+ {{.CsrfTokenHtml}}
+ <div class="field">
+ <label class="req">{{.i18n.Tr "admin.auths.auth_type"}}</label>
+ <select id="auth-type" name="type">
+ {{range $key, $val := .LoginTypes}}
+ <option value="{{$key}}">{{$val}}</option>
+ {{end}}
+ </select>
+ </div>
+ <div class="field">
+ <label class="req" for="name">{{.i18n.Tr "admin.auths.auth_name"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_AuthName}}ipt-error{{end}}" id="name" name="name" value="{{.name}}" required />
+ </div>
+ <div class="ldap">
+ <div class="field">
+ <label class="req" for="domain">{{.i18n.Tr "admin.auths.domain"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_Domain}}ipt-error{{end}}" id="domain" name="domain" value="{{.domain}}" />
+ </div>
+ <div class="field">
+ <label class="req" for="host">{{.i18n.Tr "admin.auths.host"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_Host}}ipt-error{{end}}" id="host" name="host" value="{{.host}}" />
+ </div>
+ <div class="field">
+ <label class="req" for="port">{{.i18n.Tr "admin.auths.port"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_Port}}ipt-error{{end}}" id="port" name="port" value="{{.port}}" />
+ </div>
+ <div class="field">
+ <label class="req" for="base_dn">{{.i18n.Tr "admin.auths.base_dn"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_BaseDN}}ipt-error{{end}}" id="base_dn" name="base_dn" value="{{.base_dn}}" />
+ </div>
+ <div class="field">
+ <label class="req" for="attributes">{{.i18n.Tr "admin.auths.attributes"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_Attributes}}ipt-error{{end}}" id="attributes" name="attributes" value="{{.attributes}}" />
+ </div>
+ <div class="field">
+ <label class="req" for="filter">{{.i18n.Tr "admin.auths.filter"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_Filter}}ipt-error{{end}}" id="filter" name="filter" value="{{.filter}}" />
+ </div>
+ <div class="field">
+ <label class="req" for="ms_ad_sa">{{.i18n.Tr "admin.auths.ms_ad_sa"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_MsAdSA}}ipt-error{{end}}" id="ms_ad_sa" name="ms_ad_sa" value="{{.ms_ad_sa}}" />
+ </div>
+ </div>
+ <div class="smtp hidden">
+ <div class="field">
+ <label class="req">{{.i18n.Tr "admin.auths.smtp_auth"}}</label>
+ <select name="smtpauth">
+ {{range .SMTPAuths}}
+ <option value="{{.}}">{{.}}</option>
+ {{end}}
+ </select>
+ </div>
+ <div class="field">
+ <label class="req" for="smtphost">{{.i18n.Tr "admin.auths.smtphost"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_SmtpHost}}ipt-error{{end}}" id="smtphost" name="smtphost" value="{{.smtphost}}" />
+ </div>
+ <div class="field">
+ <label class="req" for="smtpport">{{.i18n.Tr "admin.auths.smtpport"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_SmtpPort}}ipt-error{{end}}" id="smtpport" name="smtpport" value="{{.smtpport}}" />
+ </div>
+ </div>
+ <div class="field">
+ <div class="smtp hidden">
+ <label></label>
<input name="tls" type="checkbox" {{if .tls}}checked{{end}}>
- <strong>Enable TLS Encryption</strong>
- </label>
+ <strong>{{.i18n.Tr "admin.auths.enable_tls"}}</strong>
+ <br>
+ </div>
+ <label></label>
+ <input name="allowautoregister" type="checkbox" {{if .allowautoregister}}checked{{end}}>
+ <strong>{{.i18n.Tr "admin.auths.enable_auto_register"}}</strong>
</div>
- </div>
+ <div class="field">
+ <label></label>
+ <button class="btn btn-blue btn-large btn-radius">{{.i18n.Tr "admin.auths.new"}}</button>
+ </div>
+ </form>
</div>
- </div>
-
- <div class="form-group">
- <div class="col-md-offset-3 col-md-7">
- <div class="checkbox">
- <label>
- <input name="allowautoregister" type="checkbox" {{if .allowautoregister}}checked{{end}}>
- <strong>Enable Auto Registration</strong>
- </label>
+ <br>
+ <div class="panel panel-radius">
+ <div class="panel-header">
+ {{.i18n.Tr "admin.auths.tips"}}
+ </div>
+ <div class="panel-body admin-panel">
+ <h5>GMail Setting:</h5>
+ <p>Host: smtp.gmail.com, Post: 587, Enable TLS Encryption: true</p>
</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 authentication</button>
- </div>
- </div>
- </form>
- </div>
- </div>
-
- <div class="panel panel-info">
- <div class="panel-heading">
- Tips
- </div>
-
- <div class="panel-body">
- <h5>GMail Setting:</h5>
- <p>Host: smtp.gmail.com, Post: 587, Enable TLS Encryption: true</p>
+ </div>
</div>
</div>
</div>
</div>
-<script>
- $(function () {
- $('#auth-type').on("change", function () {
- var v = $(this).val();
- if (v == 2) {
- $('.ldap').toggleShow();
- $('.smtp').toggleHide();
- }
- if (v == 3) {
- $('.smtp').toggleShow();
- $('.ldap').toggleHide();
- }
- });
- });
-</script>
-{{template "base/footer" .}}
+{{template "ng/base/footer" .}}
diff --git a/templates/admin/auths.tmpl b/templates/admin/auths.tmpl
deleted file mode 100644
index a0f7ba9790..0000000000
--- a/templates/admin/auths.tmpl
+++ /dev/null
@@ -1,43 +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">
- Authentication Management
- </div>
-
- <div class="panel-body">
- <a href="/admin/auths/new" class="btn btn-primary">New Auth Source</a>
- <table class="table table-striped">
- <thead>
- <tr>
- <th>Id</th>
- <th>Name</th>
- <th>Type</th>
- <th>Actived</th>
- <th>Updated</th>
- <th>Created</th>
- <th>Edit</th>
- </tr>
- </thead>
- <tbody>
- {{range .Sources}}
- <tr>
- <td>{{.Id}}</td>
- <td><a href="/admin/auths/{{.Id}}">{{.Name}}</a></td>
- <td>{{.TypeString}}</td>
- <td><i class="fa fa{{if .IsActived}}-check{{end}}-square-o"></i></td>
- <td>{{DateFormat .Updated "M d, Y"}}</td>
- <td>{{DateFormat .Created "M d, Y"}}</td>
- <td><a href="/admin/auths/{{.Id}}"><i class="fa fa-pencil-square-o"></i></a></td>
- </tr>
- {{end}}
- </tbody>
- </table>
- </div>
- </div>
- </div>
-</div>
-{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl
index 10a53b5397..e5a210c200 100644
--- a/templates/admin/config.tmpl
+++ b/templates/admin/config.tmpl
@@ -1,232 +1,230 @@
-{{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">
- Server Configuration
- </div>
-
- <div class="panel-body">
- <dl class="dl-horizontal admin-dl-horizontal">
- <dt>Application Name</dt>
- <dd>{{AppName}}</dd>
- <dt>Application Version</dt>
- <dd>{{AppVer}}</dd>
- <dt>Application URL</dt>
- <dd>{{.AppUrl}}</dd>
- <dt>Domain</dt>
- <dd>{{.Domain}}</dd>
- <dt>Offline Mode</dt>
- <dd><i class="fa fa{{if .OfflineMode}}-check{{end}}-square-o"></i></dd>
- <dt>Disable Router Log</dt>
- <dd><i class="fa fa{{if .DisableRouterLog}}-check{{end}}-square-o"></i></dd>
- <hr/>
- <dt>Run User</dt>
- <dd>{{.RunUser}}</dd>
- <dt>Run Mode</dt>
- <dd>{{.RunMode}}</dd>
- <hr/>
- <dt>Repository Root Path</dt>
- <dd>{{.RepoRootPath}}</dd>
- <dt>Static File Root Path</dt>
- <dd>{{.StaticRootPath}}</dd>
- <dt>Log File Root Path</dt>
- <dd>{{.LogRootPath}}</dd>
- <dt>Script Type</dt>
- <dd>{{.ScriptType}}</dd>
- <dt>Reverse Authentication User</dt>
- <dd>{{.ReverseProxyAuthUser}}</dd>
- </dl>
- </div>
- </div>
-
- <div class="panel panel-default">
- <div class="panel-heading">
- Database Configuration
- </div>
-
- <div class="panel-body">
- <dl class="dl-horizontal admin-dl-horizontal">
- <dt>Type</dt>
- <dd>{{.DbCfg.Type}}</dd>
- <dt>Host</dt>
- <dd>{{.DbCfg.Host}}</dd>
- <dt>Name</dt>
- <dd>{{.DbCfg.Name}}</dd>
- <dt>User</dt>
- <dd>{{.DbCfg.User}}</dd>
- <dt>SslMode</dt>
- <dd>{{.DbCfg.SslMode}} (for "postgres" only)</dd>
- <dt>Path</dt>
- <dd>{{.DbCfg.Path}} (for "sqlite3" only)</dd>
- </dl>
- </div>
- </div>
-
- <div class="panel panel-default">
- <div class="panel-heading">
- Service Configuration
- </div>
-
- <div class="panel-body">
- <dl class="dl-horizontal admin-dl-horizontal">
- <dt>Register Email Confirmation</dt>
- <dd><i class="fa fa{{if .Service.RegisterEmailConfirm}}-check{{end}}-square-o"></i></dd>
- <dt>Disable Registration</dt>
- <dd><i class="fa fa{{if .Service.DisableRegistration}}-check{{end}}-square-o"></i></dd>
- <dt>Require Sign In View</dt>
- <dd><i class="fa fa{{if .Service.RequireSignInView}}-check{{end}}-square-o"></i></dd>
- <dt>Mail Notification</dt>
- <dd><i class="fa fa{{if .Service.EnableNotifyMail}}-check{{end}}-square-o"></i></dd>
- <dt>Enable Cache Avatar</dt>
- <dd><i class="fa fa{{if .Service.EnableCacheAvatar}}-check{{end}}-square-o"></i></dd>
- <hr/>
- <dt>Active Code Lives</dt>
- <dd>{{.Service.ActiveCodeLives}} minutes</dd>
- <dt>Reset Password Code Lives</dt>
- <dd>{{.Service.ResetPwdCodeLives}} minutes</dd>
- </dl>
- </div>
- </div>
-
- <div class="panel panel-default">
- <div class="panel-heading">
- Webhook Configuration
- </div>
-
- <div class="panel-body">
- <dl class="dl-horizontal admin-dl-horizontal">
- <dt>Task Interval</dt>
- <dd>{{.WebhookTaskInterval}} minutes</dd>
- <dt>Deliver Timeout</dt>
- <dd>{{.WebhookDeliverTimeout}} seconds</dd>
- </dl>
- </div>
- </div>
-
- <div class="panel panel-default">
- <div class="panel-heading">
- Mailer Configuration
- </div>
-
- <div class="panel-body">
- <dl class="dl-horizontal admin-dl-horizontal">
- <dt>Enabled</dt>
- <dd><i class="fa fa{{if .MailerEnabled}}-check{{end}}-square-o"></i></dd>
- {{if .MailerEnabled}}<dt>Name</dt>
- <dd>{{.Mailer.Name}}</dd>
- <dt>Host</dt>
- <dd>{{.Mailer.Host}}</dd>
- <dt>User</dt>
- <dd>{{.Mailer.User}}</dd>{{end}}
- </dl>
- </div>
- </div>
-
- <div class="panel panel-default">
- <div class="panel-heading">
- OAuth Configuration
- </div>
-
- <div class="panel-body">
- <dl class="dl-horizontal admin-dl-horizontal">
- <dt>Enabled</dt>
- <dd><i class="fa fa{{if .OauthEnabled}}-check{{end}}-square-o"></i></dd>
- {{if .OauthEnabled}}<dt>GitHub</dt>
- <dd><i class="fa fa{{if .Oauther.GitHub}}-check{{end}}-square-o"></i></dd>
- <dt>Google</dt>
- <dd><i class="fa fa{{if .Oauther.Google}}-check{{end}}-square-o"></i></dd>
- <dt>Tencent QQ</dt>
- <dd><i class="fa fa{{if .Oauther.Tencent}}-check{{end}}-square-o"></i></dd>
- <dt>Weibo</dt>
- <dd><i class="fa fa{{if .Oauther.Weibo}}-check{{end}}-square-o"></i></dd>
- {{end}}
- </dl>
- </div>
- </div>
-
- <div class="panel panel-default">
- <div class="panel-heading">
- Cache Configuration
- </div>
-
- <div class="panel-body">
- <dl class="dl-horizontal admin-dl-horizontal">
- <dt>Cache Adapter</dt>
- <dd>{{.CacheAdapter}}</dd>
- <dt>Cache Config</dt>
- <dd><div style="padding-top: 5px;"><pre>{{.CacheConfig}}</pre></div></dd>
- </dl>
- </div>
- </div>
-
- <div class="panel panel-default">
- <div class="panel-heading">
- Session Configuration
- </div>
-
- <div class="panel-body">
- <dl class="dl-horizontal admin-dl-horizontal">
- <dt>Session Provider</dt>
- <dd>{{.SessionProvider}}</dd>
- <dt>Cookie Name</dt>
- <dd>{{.SessionConfig.CookieName}}</dd>
- <dt>Enable Set Cookie</dt>
- <dd><i class="fa fa{{if .SessionConfig.EnableSetCookie}}-check{{end}}-square-o"></i></dd>
- <dt>GC Interval Time</dt>
- <dd>{{.SessionConfig.GcIntervalTime}} seconds</dd>
- <dt>Session Life Time</dt>
- <dd>{{.SessionConfig.SessionLifeTime}} seconds</dd>
- <dt>HTTPS Only</dt>
- <dd><i class="fa fa{{if .SessionConfig.CookieSecure}}-check{{end}}-square-o"></i></dd>
- <dt>Cookie Life Time</dt>
- <dd>{{.SessionConfig.CookieLifeTime}} seconds</dd>
- <dt>Session ID Hash Function</dt>
- <dd>{{.SessionConfig.SessionIDHashFunc}}</dd>
- <dt>Session ID Hash Key</dt>
- <dd>{{.SessionConfig.SessionIDHashKey}}</dd>
- <dt>Provider Config</dt>
- <dd>{{.SessionConfig.ProviderConfig}}</dd>
- </dl>
- </div>
- </div>
-
- <div class="panel panel-default">
- <div class="panel-heading">
- Picture Configuration
- </div>
-
- <div class="panel-body">
- <dl class="dl-horizontal admin-dl-horizontal">
- <dt>Picture Service</dt>
- <dd>{{.PictureService}}</dd>
- <dt>Disable Gravatar</dt>
- <dd><i class="fa fa{{if .DisableGravatar}}-check{{end}}-square-o"></i></dd>
- </dl>
- </div>
- </div>
-
- <div class="panel panel-default">
- <div class="panel-heading">
- Log Configuration
- </div>
-
- <div class="panel-body">
- <dl class="dl-horizontal admin-dl-horizontal">
- {{range .Loggers}}
- <dt>Log Mode</dt>
- <dd>{{.Mode}}</dd>
- <dt>Log Config</dt>
- <dd>
- <div style="padding-top: 5px;"><pre>{{.Config}}</pre></div>
- </dd>
- {{end}}
- </dl>
-
+{{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.config.server_config"}}</strong>
+ </div>
+ <div class="panel-body">
+ <dl class="dl-horizontal admin-dl-horizontal">
+ <dt>{{.i18n.Tr "admin.config.app_name"}}</dt>
+ <dd>{{AppName}}</dd>
+ <dt>{{.i18n.Tr "admin.config.app_ver"}}</dt>
+ <dd>{{AppVer}}</dd>
+ <dt>{{.i18n.Tr "admin.config.app_url"}}</dt>
+ <dd>{{.AppUrl}}</dd>
+ <dt>{{.i18n.Tr "admin.config.domain"}}</dt>
+ <dd>{{.Domain}}</dd>
+ <dt>{{.i18n.Tr "admin.config.offline_mode"}}</dt>
+ <dd><i class="fa fa{{if .OfflineMode}}-check{{end}}-square-o"></i></dd>
+ <dt>{{.i18n.Tr "admin.config.disable_router_log"}}</dt>
+ <dd><i class="fa fa{{if .DisableRouterLog}}-check{{end}}-square-o"></i></dd>
+ <hr/>
+ <dt>{{.i18n.Tr "admin.config.run_user"}}</dt>
+ <dd>{{.RunUser}}</dd>
+ <dt>{{.i18n.Tr "admin.config.run_mode"}}</dt>
+ <dd>{{.RunMode}}</dd>
+ <hr/>
+ <dt>{{.i18n.Tr "admin.config.repo_root_path"}}</dt>
+ <dd>{{.RepoRootPath}}</dd>
+ <dt>{{.i18n.Tr "admin.config.static_file_root_path"}}</dt>
+ <dd>{{.StaticRootPath}}</dd>
+ <dt>{{.i18n.Tr "admin.config.log_file_root_path"}}</dt>
+ <dd>{{.LogRootPath}}</dd>
+ <dt>{{.i18n.Tr "admin.config.script_type"}}</dt>
+ <dd>{{.ScriptType}}</dd>
+ <dt>{{.i18n.Tr "admin.config.reverse_auth_user"}}</dt>
+ <dd>{{.ReverseProxyAuthUser}}</dd>
+ </dl>
+ </div>
+ </div>
+ <br>
+ <div class="panel panel-radius">
+ <div class="panel-header">
+ <strong>{{.i18n.Tr "admin.config.db_config"}}</strong>
+ </div>
+ <div class="panel-body">
+ <dl class="dl-horizontal admin-dl-horizontal">
+ <dt>{{.i18n.Tr "admin.config.db_type"}}</dt>
+ <dd>{{.DbCfg.Type}}</dd>
+ <dt>{{.i18n.Tr "admin.config.db_host"}}</dt>
+ <dd>{{.DbCfg.Host}}</dd>
+ <dt>{{.i18n.Tr "admin.config.db_name"}}</dt>
+ <dd>{{.DbCfg.Name}}</dd>
+ <dt>{{.i18n.Tr "admin.config.db_user"}}</dt>
+ <dd>{{.DbCfg.User}}</dd>
+ <dt>{{.i18n.Tr "admin.config.db_ssl_mode"}}</dt>
+ <dd>{{.DbCfg.SslMode}} {{.i18n.Tr "admin.config.db_ssl_mode_helper"}}</dd>
+ <dt>{{.i18n.Tr "admin.config.db_path"}}</dt>
+ <dd>{{.DbCfg.Path}} {{.i18n.Tr "admin.config.db_path_helper"}}</dd>
+ </dl>
+ </div>
+ </div>
+ <br>
+ <div class="panel panel-radius">
+ <div class="panel-header">
+ <strong>{{.i18n.Tr "admin.config.service_config"}}</strong>
+ </div>
+ <div class="panel-body">
+ <dl class="dl-horizontal admin-dl-horizontal">
+ <dt>{{.i18n.Tr "admin.config.register_email_confirm"}}</dt>
+ <dd><i class="fa fa{{if .Service.RegisterEmailConfirm}}-check{{end}}-square-o"></i></dd>
+ <dt>{{.i18n.Tr "admin.config.disable_register"}}</dt>
+ <dd><i class="fa fa{{if .Service.DisableRegistration}}-check{{end}}-square-o"></i></dd>
+ <dt>{{.i18n.Tr "admin.config.require_sign_in_view"}}</dt>
+ <dd><i class="fa fa{{if .Service.RequireSignInView}}-check{{end}}-square-o"></i></dd>
+ <dt>{{.i18n.Tr "admin.config.mail_notify"}}</dt>
+ <dd><i class="fa fa{{if .Service.EnableNotifyMail}}-check{{end}}-square-o"></i></dd>
+ <dt>{{.i18n.Tr "admin.config.enable_cache_avatar"}}</dt>
+ <dd><i class="fa fa{{if .Service.EnableCacheAvatar}}-check{{end}}-square-o"></i></dd>
+ <hr/>
+ <dt>{{.i18n.Tr "admin.config.active_code_lives"}}</dt>
+ <dd>{{.Service.ActiveCodeLives}} {{.i18n.Tr "tool.raw_minutes"}}</dd>
+ <dt>{{.i18n.Tr "admin.config.reset_password_code_lives"}}</dt>
+ <dd>{{.Service.ResetPwdCodeLives}} {{.i18n.Tr "tool.raw_minutes"}}</dd>
+ </dl>
+ </div>
+ </div>
+ <br>
+ <div class="panel panel-radius">
+ <div class="panel-header">
+ <strong>{{.i18n.Tr "admin.config.webhook_config"}}</strong>
+ </div>
+ <div class="panel-body">
+ <dl class="dl-horizontal admin-dl-horizontal">
+ <dt>{{.i18n.Tr "admin.config.task_interval"}}</dt>
+ <dd>{{.WebhookTaskInterval}} {{.i18n.Tr "tool.raw_minutes"}}</dd>
+ <dt>{{.i18n.Tr "admin.config.deliver_timeout"}}</dt>
+ <dd>{{.WebhookDeliverTimeout}} {{.i18n.Tr "tool.raw_seconds"}}</dd>
+ </dl>
+ </div>
+ </div>
+ <br>
+ <div class="panel panel-radius">
+ <div class="panel-header">
+ <strong>{{.i18n.Tr "admin.config.mailer_config"}}</strong>
+ </div>
+ <div class="panel-body">
+ <dl class="dl-horizontal admin-dl-horizontal">
+ <dt>{{.i18n.Tr "admin.config.mailer_enabled"}}</dt>
+ <dd><i class="fa fa{{if .MailerEnabled}}-check{{end}}-square-o"></i></dd>
+ {{if .MailerEnabled}}<dt>{{.i18n.Tr "admin.config.mailer_name"}}</dt>
+ <dd>{{.Mailer.Name}}</dd>
+ <dt>{{.i18n.Tr "admin.config.mailer_host"}}</dt>
+ <dd>{{.Mailer.Host}}</dd>
+ <dt>{{.i18n.Tr "admin.config.mailer_user"}}</dt>
+ <dd>{{.Mailer.User}}</dd>{{end}}
+ </dl>
+ </div>
+ </div>
+ <br>
+ <div class="panel panel-radius">
+ <div class="panel-header">
+ <strong>{{.i18n.Tr "admin.config.oauth_config"}}</strong>
+ </div>
+ <div class="panel-body">
+ <dl class="dl-horizontal admin-dl-horizontal">
+ <dt>{{.i18n.Tr "admin.config.oauth_enabled"}}</dt>
+ <dd><i class="fa fa{{if .OauthEnabled}}-check{{end}}-square-o"></i></dd>
+ {{if .OauthEnabled}}<dt>GitHub</dt>
+ <dd><i class="fa fa{{if .Oauther.GitHub}}-check{{end}}-square-o"></i></dd>
+ <dt>Google</dt>
+ <dd><i class="fa fa{{if .Oauther.Google}}-check{{end}}-square-o"></i></dd>
+ <dt>腾讯 QQ</dt>
+ <dd><i class="fa fa{{if .Oauther.Tencent}}-check{{end}}-square-o"></i></dd>
+ <dt>新浪微博</dt>
+ <dd><i class="fa fa{{if .Oauther.Weibo}}-check{{end}}-square-o"></i></dd>
+ {{end}}
+ </dl>
+ </div>
+ </div>
+ <br>
+ <div class="panel panel-radius">
+ <div class="panel-header">
+ <strong>{{.i18n.Tr "admin.config.cache_config"}}</strong>
+ </div>
+ <div class="panel-body">
+ <dl class="dl-horizontal admin-dl-horizontal">
+ <dt>{{.i18n.Tr "admin.config.cache_adapter"}}</dt>
+ <dd>{{.CacheAdapter}}</dd>
+ <dt>{{.i18n.Tr "admin.config.cache_interval"}}</dt>
+ <dd>{{.CacheInternal}} {{.i18n.Tr "tool.raw_seconds"}}</dd>
+ <dt>{{.i18n.Tr "admin.config.cache_conn"}}</dt>
+ <dd><pre>{{.CacheConn}}</pre></dd>
+ </dl>
+ </div>
+ </div>
+ <br>
+ <div class="panel panel-radius">
+ <div class="panel-header">
+ <strong>{{.i18n.Tr "admin.config.session_config"}}</strong>
+ </div>
+ <div class="panel-body">
+ <dl class="dl-horizontal admin-dl-horizontal">
+ <dt>{{.i18n.Tr "admin.config.session_provider"}}</dt>
+ <dd>{{.SessionProvider}}</dd>
+ <dt>{{.i18n.Tr "admin.config.provider_config"}}</dt>
+ <dd><pre>{{.SessionConfig.ProviderConfig}}</pre></dd>
+ <dt>{{.i18n.Tr "admin.config.cookie_name"}}</dt>
+ <dd>{{.SessionConfig.CookieName}}</dd>
+ <dt>{{.i18n.Tr "admin.config.enable_set_cookie"}}</dt>
+ <dd><i class="fa fa{{if .SessionConfig.EnableSetCookie}}-check{{end}}-square-o"></i></dd>
+ <dt>{{.i18n.Tr "admin.config.gc_interval_time"}}</dt>
+ <dd>{{.SessionConfig.Gclifetime}} {{.i18n.Tr "tool.raw_seconds"}}</dd>
+ <dt>{{.i18n.Tr "admin.config.session_life_time"}}</dt>
+ <dd>{{.SessionConfig.Maxlifetime}} {{.i18n.Tr "tool.raw_seconds"}}</dd>
+ <dt>{{.i18n.Tr "admin.config.https_only"}}</dt>
+ <dd><i class="fa fa{{if .SessionConfig.Secure}}-check{{end}}-square-o"></i></dd>
+ <dt>{{.i18n.Tr "admin.config.cookie_life_time"}}</dt>
+ <dd>{{.SessionConfig.CookieLifeTime}} {{.i18n.Tr "tool.raw_seconds"}}</dd>
+ <dt>{{.i18n.Tr "admin.config.session_hash_function"}}</dt>
+ <dd>{{.SessionConfig.SessionIDHashFunc}}</dd>
+ <dt>{{.i18n.Tr "admin.config.session_hash_key"}}</dt>
+ <dd>{{.SessionConfig.SessionIDHashKey}}</dd>
+ </dl>
+ </div>
+ </div>
+ <br>
+ <div class="panel panel-radius">
+ <div class="panel-header">
+ <strong>{{.i18n.Tr "admin.config.picture_config"}}</strong>
+ </div>
+ <div class="panel-body">
+ <dl class="dl-horizontal admin-dl-horizontal">
+ <dt>{{.i18n.Tr "admin.config.picture_service"}}</dt>
+ <dd>{{.PictureService}}</dd>
+ <dt>{{.i18n.Tr "admin.config.disable_gravatar"}}</dt>
+ <dd><i class="fa fa{{if .DisableGravatar}}-check{{end}}-square-o"></i></dd>
+ </dl>
+ </div>
+ </div>
+ <br>
+ <div class="panel panel-radius">
+ <div class="panel-header">
+ <strong>{{.i18n.Tr "admin.config.log_config"}}</strong>
+ </div>
+ <div class="panel-body">
+ <dl class="dl-horizontal admin-dl-horizontal">
+ {{range .Loggers}}
+ <dt>{{$.i18n.Tr "admin.config.log_mode"}}</dt>
+ <dd>{{.Mode}}</dd>
+ <dt>{{$.i18n.Tr "admin.config.log_config"}}</dt>
+ <dd><pre>{{.Config}}</pre></dd>
+ {{end}}
+ </dl>
+ </div>
+ </div>
+ </div>
+ </div>
</div>
</div>
</div>
</div>
-{{template "base/footer" .}} \ No newline at end of file
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/admin/dashboard.tmpl b/templates/admin/dashboard.tmpl
index aa2080d83e..09e105826a 100644
--- a/templates/admin/dashboard.tmpl
+++ b/templates/admin/dashboard.tmpl
@@ -1,143 +1,151 @@
-{{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">
- {{template "base/alert" .}}
- <div class="panel panel-default">
- <div class="panel-heading">
- Statistic
- </div>
-
- <div class="panel-body">
- Gogs database has <b>{{.Stats.Counter.User}}</b> users, <b>{{.Stats.Counter.PublicKey}}</b> SSH keys, <b>{{.Stats.Counter.Repo}}</b> repositories, <b>{{.Stats.Counter.Watch}}</b> watches, <b>{{.Stats.Counter.Action}}</b> actions, <b>{{.Stats.Counter.Access}}</b> accesses, <b>{{.Stats.Counter.Issue}}</b> issues, <b>{{.Stats.Counter.Comment}}</b> comments, <b>{{.Stats.Counter.Mirror}}</b> mirrors, <b>{{.Stats.Counter.Oauth}}</b> oauthes, <b>{{.Stats.Counter.Release}}</b> releases, <b>{{.Stats.Counter.LoginSource}}</b> login sources, <b>{{.Stats.Counter.Webhook}}</b> webhooks, <b>{{.Stats.Counter.Milestone}}</b> milestones.
- </div>
- </div>
-
- <div class="panel panel-default">
- <div class="panel-heading">
- Operations
- </div>
-
- <div class="panel-body">
- <table class="table">
- <thead>
- <tr>
- <th>Name</th>
- <th>Op.</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>Clean unbind OAuthes</td>
- <td><i class="fa fa-caret-square-o-right"></i> <a href="/admin?op=1">Run</a></td>
- </tr>
- <tr>
- <td>Delete inactivate accounts</td>
- <td><i class="fa fa-caret-square-o-right"></i> <a href="/admin?op=2">Run</a></td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
-
- <div class="panel panel-default">
- <div class="panel-heading">
- System Monitor Status
- </div>
-
- <div class="panel-body">
- <dl class="dl-horizontal admin-dl-horizontal">
- <dt>Server Uptime</dt>
- <dd>{{.SysStatus.Uptime}}</dd>
-
- <dt>Current Goroutines</dt>
- <dd>{{.SysStatus.NumGoroutine}}</dd>
-
- <hr/>
- <dt>Current Memory Usage</dt>
- <dd>{{.SysStatus.MemAllocated}}</dd>
-
- <dt>Total Memory Allocated</dt>
- <dd>{{.SysStatus.MemTotal}}</dd>
-
- <dt>Memory Obtained</dt>
- <dd>{{.SysStatus.MemSys}}</dd>
-
- <dt>Pointer Lookup Times</dt>
- <dd>{{.SysStatus.Lookups}}</dd>
-
- <dt>Memory Allocate Times</dt>
- <dd>{{.SysStatus.MemMallocs}}</dd>
-
- <dt>Memory Free Times</dt>
- <dd>{{.SysStatus.MemFrees}}</dd>
-
- <hr/>
- <dt>Current Heap Usage</dt>
- <dd>{{.SysStatus.HeapAlloc}}</dd>
-
- <dt>Heap Memory Obtained</dt>
- <dd>{{.SysStatus.HeapSys}}</dd>
-
- <dt>Heap Memory Idle</dt>
- <dd>{{.SysStatus.HeapIdle}}</dd>
-
- <dt>Heap Memory In Use</dt>
- <dd>{{.SysStatus.HeapInuse}}</dd>
-
- <dt>Heap Memory Released</dt>
- <dd>{{.SysStatus.HeapReleased}}</dd>
-
- <dt>Heap Objects</dt>
- <dd>{{.SysStatus.HeapObjects}}</dd>
-
- <hr/>
- <dt>Bootstrap Stack Usage</dt>
- <dd>{{.SysStatus.StackInuse}}</dd>
-
- <dt>Stack Memory Obtained</dt>
- <dd>{{.SysStatus.StackSys}}</dd>
-
- <dt>MSpan Structures Usage</dt>
- <dd>{{.SysStatus.MSpanInuse}}</dd>
-
- <dt>MSpan Structures Obtained</dt>
- <dd>{{.SysStatus.HeapSys}}</dd>
-
- <dt>MCache Structures Usage</dt>
- <dd>{{.SysStatus.MCacheInuse}}</dd>
-
- <dt>MCache Structures Obtained</dt>
- <dd>{{.SysStatus.MCacheSys}}</dd>
-
- <dt>Profiling Bucket Hash Table Obtained</dt>
- <dd>{{.SysStatus.BuckHashSys}}</dd>
-
- <dt>GC Metadada Obtained</dt>
- <dd>{{.SysStatus.GCSys}}</dd>
-
- <dt>Other System Allocation Obtained</dt>
- <dd>{{.SysStatus.OtherSys}}</dd>
-
- <hr/>
- <dt>Next GC Recycle</dt>
- <dd>{{.SysStatus.NextGC}}</dd>
-
- <dt>Last GC Time</dt>
- <dd>{{.SysStatus.LastGC}} ago</dd>
-
- <dt>Total GC Pause</dt>
- <dd>{{.SysStatus.PauseTotalNs}}</dd>
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="admin-wrapper">
+ <div id="setting-wrapper" class="main-wrapper">
+ <div id="repo-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.dashboard.statistic"}}</strong>
+ </div>
+ <div class="panel-body">
+ <p class="admin-desc">
+ {{.i18n.Tr "admin.dashboard.statistic_info" .Stats.Counter.User .Stats.Counter.Org .Stats.Counter.PublicKey .Stats.Counter.Repo .Stats.Counter.Watch .Stats.Counter.Star .Stats.Counter.Action .Stats.Counter.Access .Stats.Counter.Issue .Stats.Counter.Comment .Stats.Counter.Oauth .Stats.Counter.Follow .Stats.Counter.Mirror .Stats.Counter.Release .Stats.Counter.LoginSource .Stats.Counter.Webhook .Stats.Counter.Milestone .Stats.Counter.Label .Stats.Counter.HookTask .Stats.Counter.Team .Stats.Counter.UpdateTask .Stats.Counter.Attachment | Str2html}}
+ </div>
+ </div>
+ <br>
+ <div class="panel panel-radius">
+ <div class="panel-header">
+ <strong>{{.i18n.Tr "admin.dashboard.operations"}}</strong>
+ </div>
+ <div class="panel-body admin-panel">
+ <div class="admin-table">
+ <table class="table">
+ <thead>
+ <tr>
+ <th>{{.i18n.Tr "admin.dashboard.operation_name"}}</th>
+ <th>{{.i18n.Tr "admin.dashboard.operation_switch"}}</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{.i18n.Tr "admin.dashboard.clean_unbind_oauth"}}</td>
+ <td><i class="fa fa-caret-square-o-right"></i> <a href="/admin?op=1">{{.i18n.Tr "admin.dashboard.operation_run"}}</a></td>
+ </tr>
+ <tr>
+ <td>{{.i18n.Tr "admin.dashboard.delete_inactivate_accounts"}}</td>
+ <td><i class="fa fa-caret-square-o-right"></i> <a href="/admin?op=2">{{.i18n.Tr "admin.dashboard.operation_run"}}</a></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </div>
+ <br>
+ <div class="panel panel-radius">
+ <div class="panel-header">
+ <strong>{{.i18n.Tr "admin.dashboard.system_status"}}</strong>
+ </div>
+ <div class="panel-body">
+ <dl class="dl-horizontal admin-dl-horizontal">
+ <dt>{{.i18n.Tr "admin.dashboard.server_uptime"}}</dt>
+ <dd>{{.SysStatus.Uptime}}</dd>
+
+ <dt>{{.i18n.Tr "admin.dashboard.current_goroutine"}}</dt>
+ <dd>{{.SysStatus.NumGoroutine}}</dd>
+
+ <hr/>
+ <dt>{{.i18n.Tr "admin.dashboard.current_memory_usage"}}</dt>
+ <dd>{{.SysStatus.MemAllocated}}</dd>
+
+ <dt>{{.i18n.Tr "admin.dashboard.total_memory_allocated"}}</dt>
+ <dd>{{.SysStatus.MemTotal}}</dd>
+
+ <dt>{{.i18n.Tr "admin.dashboard.memory_obtained"}}</dt>
+ <dd>{{.SysStatus.MemSys}}</dd>
+
+ <dt>{{.i18n.Tr "admin.dashboard.pointer_lookup_times"}}</dt>
+ <dd>{{.SysStatus.Lookups}}</dd>
+
+ <dt>{{.i18n.Tr "admin.dashboard.memory_allocate_times"}}</dt>
+ <dd>{{.SysStatus.MemMallocs}}</dd>
+
+ <dt>{{.i18n.Tr "admin.dashboard.memory_free_times"}}</dt>
+ <dd>{{.SysStatus.MemFrees}}</dd>
+
+ <hr/>
+ <dt>{{.i18n.Tr "admin.dashboard.current_heap_usage"}}</dt>
+ <dd>{{.SysStatus.HeapAlloc}}</dd>
+
+ <dt>{{.i18n.Tr "admin.dashboard.heap_memory_obtained"}}</dt>
+ <dd>{{.SysStatus.HeapSys}}</dd>
+
+ <dt>{{.i18n.Tr "admin.dashboard.heap_memory_idle"}}</dt>
+ <dd>{{.SysStatus.HeapIdle}}</dd>
+
+ <dt>{{.i18n.Tr "admin.dashboard.heap_memory_in_use"}}</dt>
+ <dd>{{.SysStatus.HeapInuse}}</dd>
+
+ <dt>{{.i18n.Tr "admin.dashboard.heap_memory_released"}}</dt>
+ <dd>{{.SysStatus.HeapReleased}}</dd>
+
+ <dt>{{.i18n.Tr "admin.dashboard.heap_objects"}}</dt>
+ <dd>{{.SysStatus.HeapObjects}}</dd>
+
+ <hr/>
+ <dt>{{.i18n.Tr "admin.dashboard.bootstrap_stack_usage"}}</dt>
+ <dd>{{.SysStatus.StackInuse}}</dd>
+
+ <dt>{{.i18n.Tr "admin.dashboard.stack_memory_obtained"}}</dt>
+ <dd>{{.SysStatus.StackSys}}</dd>
+
+ <dt>{{.i18n.Tr "admin.dashboard.mspan_structures_usage"}}</dt>
+ <dd>{{.SysStatus.MSpanInuse}}</dd>
+
+ <dt>{{.i18n.Tr "admin.dashboard.mspan_structures_obtained"}}</dt>
+ <dd>{{.SysStatus.HeapSys}}</dd>
+
+ <dt>{{.i18n.Tr "admin.dashboard.mcache_structures_usage"}}</dt>
+ <dd>{{.SysStatus.MCacheInuse}}</dd>
+
+ <dt>{{.i18n.Tr "admin.dashboard.mcache_structures_obtained"}}</dt>
+ <dd>{{.SysStatus.MCacheSys}}</dd>
+
+ <dt>{{.i18n.Tr "admin.dashboard.profiling_bucket_hash_table_obtained"}}</dt>
+ <dd>{{.SysStatus.BuckHashSys}}</dd>
+
+ <dt>{{.i18n.Tr "admin.dashboard.gc_metadata_obtained"}}</dt>
+ <dd>{{.SysStatus.GCSys}}</dd>
+
+ <dt>{{.i18n.Tr "admin.dashboard.other_system_allocation_obtained"}}</dt>
+ <dd>{{.SysStatus.OtherSys}}</dd>
+
+ <hr>
+ <dt>{{.i18n.Tr "admin.dashboard.next_gc_recycle"}}</dt>
+ <dd>{{.SysStatus.NextGC}}</dd>
+
+ <dt>{{.i18n.Tr "admin.dashboard.last_gc_time"}}</dt>
+ <dd>{{.SysStatus.LastGC}}</dd>
+
+ <dt>{{.i18n.Tr "admin.dashboard.total_gc_pause"}}</dt>
+ <dd>{{.SysStatus.PauseTotalNs}}</dd>
- <dt>Last GC Pause</dt>
- <dd>{{.SysStatus.PauseNs}}</dd>
+ <dt>{{.i18n.Tr "admin.dashboard.last_gc_pause"}}</dt>
+ <dd>{{.SysStatus.PauseNs}}</dd>
- <dt>GC Times</dt>
- <dd>{{.SysStatus.NumGC}}</dd>
- </dl>
+ <dt>{{.i18n.Tr "admin.dashboard.gc_times"}}</dt>
+ <dd>{{.SysStatus.NumGC}}</dd>
+ </dl>
+ </div>
+ </div>
+ </div>
+ </div>
</div>
</div>
</div>
</div>
-{{template "base/footer" .}} \ No newline at end of file
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/admin/monitor.tmpl b/templates/admin/monitor.tmpl
new file mode 100644
index 0000000000..b94f92b664
--- /dev/null
+++ b/templates/admin/monitor.tmpl
@@ -0,0 +1,74 @@
+{{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.monitor.cron"}}</strong>
+ </div>
+ <div class="panel-body admin-panel">
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ <th>{{.i18n.Tr "admin.monitor.name"}}</th>
+ <th>{{.i18n.Tr "admin.monitor.schedule"}}</th>
+ <th>{{.i18n.Tr "admin.monitor.next"}}</th>
+ <th>{{.i18n.Tr "admin.monitor.previous"}}</th>
+ <th>{{.i18n.Tr "admin.monitor.execute_times"}}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{range .Entries}}
+ <tr>
+ <td>{{.Description}}</td>
+ <td>{{.Spec}}</td>
+ <td>{{.Next}}</td>
+ <td>{{.Prev}}</td>
+ <td>{{.ExecTimes}}</td>
+ </tr>
+ {{end}}
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <br>
+ <div class="panel panel-radius">
+ <div class="panel-header">
+ <strong>{{.i18n.Tr "admin.monitor.process"}}</strong>
+ </div>
+ <div class="panel-body admin-panel">
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ <th>Pid</th>
+ <th>{{.i18n.Tr "admin.monitor.desc"}}</th>
+ <th>{{.i18n.Tr "admin.monitor.start"}}</th>
+ <th>{{.i18n.Tr "admin.monitor.execute_time"}}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{range .Processes}}
+ <tr>
+ <td>{{.Pid}}</td>
+ <td>{{.Description}}</td>
+ <td>{{.Start}}</td>
+ <td>{{TimeSince .Start}}</td>
+ </tr>
+ {{end}}
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/admin/monitor/cron.tmpl b/templates/admin/monitor/cron.tmpl
deleted file mode 100644
index a04c017e29..0000000000
--- a/templates/admin/monitor/cron.tmpl
+++ /dev/null
@@ -1,40 +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">
- <ul class="nav nav-tabs">
- <li{{if .PageIsMonitorCron}} class="active"{{end}}><a href="/admin/monitor">Cron Tasks</a></li>
- <li{{if .PageIsMonitorProcess}} class="active"{{end}}><a href="/admin/monitor?tab=process">Processes</a></li>
- </ul>
- <div class="panel panel-default">
- <div class="panel-body">
- {{if .PageIsMonitorCron}}
- <table class="table table-striped">
- <thead>
- <tr>
- <th>Name</th>
- <th>Schedule</th>
- <th>Next Time</th>
- <th>Previous Time</th>
- <th>Execute Times</th>
- </tr>
- </thead>
- <tbody>
- {{range .Entries}}
- <tr>
- <td>{{.Description}}</td>
- <td>{{.Spec}}</td>
- <td>{{.Next}}</td>
- <td>{{.Prev}}</td>
- <td>{{.ExecTimes}}</td>
- </tr>
- {{end}}
- </tbody>
- </table>
- {{end}}
- </div>
- </div>
- </div>
-</div>
-{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/admin/monitor/process.tmpl b/templates/admin/monitor/process.tmpl
deleted file mode 100644
index 2d60ff6895..0000000000
--- a/templates/admin/monitor/process.tmpl
+++ /dev/null
@@ -1,38 +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">
- <ul class="nav nav-tabs">
- <li{{if .PageIsMonitorCron}} class="active"{{end}}><a href="/admin/monitor">Cron Tasks</a></li>
- <li{{if .PageIsMonitorProcess}} class="active"{{end}}><a href="/admin/monitor?tab=process">Processes</a></li>
- </ul>
- <div class="panel panel-default">
- <div class="panel-body">
- {{if .PageIsMonitorProcess}}
- <table class="table table-striped">
- <thead>
- <tr>
- <th>Pid</th>
- <th>Description</th>
- <th>Start Time</th>
- <th>Execution Time</th>
- </tr>
- </thead>
- <tbody>
- {{range .Processes}}
- <tr>
- <td>{{.Pid}}</td>
- <td>{{.Description}}</td>
- <td>{{.Start}}</td>
- <td>{{TimeSince .Start}}</td>
- </tr>
- {{end}}
- </tbody>
- </table>
- {{end}}
- </div>
- </div>
- </div>
-</div>
-{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/admin/nav.tmpl b/templates/admin/nav.tmpl
index b78e0bd17d..ccb250c250 100644
--- a/templates/admin/nav.tmpl
+++ b/templates/admin/nav.tmpl
@@ -1,10 +1,14 @@
-<div id="user-setting-nav" class="col-md-2 admin-nav">
- <ul class="list-group">
- <li class="list-group-item{{if .PageIsDashboard}} active{{end}}"><a href="/admin"><i class="fa fa-tachometer fa-lg"></i> Dashboard</a></li>
- <li class="list-group-item{{if .PageIsUsers}} active{{end}}"><a href="/admin/users"><i class="fa fa-users fa-lg"></i> Users</a></li>
- <li class="list-group-item{{if .PageIsRepos}} active{{end}}"><a href="/admin/repos"><i class="fa fa-book fa-lg"></i> Repositories</a></li>
- <li class="list-group-item{{if .PageIsAuths}} active{{end}}"><a href="/admin/auths"><i class="fa fa-certificate fa-lg"></i> Authentication</a></li>
- <li class="list-group-item{{if .PageIsConfig}} active{{end}}"><a href="/admin/config"><i class="fa fa-cogs fa-lg"></i> Configuration</a></li>
- <li class="list-group-item{{if .PageIsMonitor}} active{{end}}"><a href="/admin/monitor"><i class="fa fa-th fa-lg"></i> Monitoring</a></li>
- </ul>
+<div id="setting-menu" class="grid-1-5 panel panel-radius left">
+ <p class="panel-header"><strong>{{.i18n.Tr "admin_panel"}}</strong></p>
+ <div class="panel-body">
+ <ul class="menu menu-vertical switching-list grid-1-5 left">
+ <li {{if .PageIsAdminDashboard}}class="current"{{end}}><a href="/admin">{{.i18n.Tr "admin.dashboard"}}</a></li>
+ <li {{if .PageIsAdminUsers}}class="current"{{end}}><a href="/admin/users">{{.i18n.Tr "admin.users"}}</a></li>
+ <li {{if .PageIsAdminOrganizations}}class="current"{{end}}><a href="/admin/orgs">{{.i18n.Tr "admin.organizations"}}</a></li>
+ <li {{if .PageIsAdminRepositories}}class="current"{{end}}><a href="/admin/repos">{{.i18n.Tr "admin.repositories"}}</a></li>
+ <li {{if .PageIsAdminAuthentications}}class="current"{{end}}><a href="/admin/auths">{{.i18n.Tr "admin.authentication"}}</a></li>
+ <li {{if .PageIsAdminConfig}}class="current"{{end}}><a href="/admin/config">{{.i18n.Tr "admin.config"}}</a></li>
+ <li {{if .PageIsAdminMonitor}}class="current"{{end}}><a href="/admin/monitor">{{.i18n.Tr "admin.monitor"}}</a></li>
+ </ul>
+ </div>
</div> \ No newline at end of file
diff --git a/templates/admin/org/list.tmpl b/templates/admin/org/list.tmpl
new file mode 100644
index 0000000000..ea9167c0c4
--- /dev/null
+++ b/templates/admin/org/list.tmpl
@@ -0,0 +1,58 @@
+{{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.orgs.org_manage_panel"}}</strong>
+ </div>
+ <div class="panel-body admin-panel">
+ <div class="admin-table">
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ <th>Id</th>
+ <th>{{.i18n.Tr "admin.orgs.name"}}</th>
+ <th>{{.i18n.Tr "email"}}</th>
+ <th>{{.i18n.Tr "admin.orgs.teams"}}</th>
+ <th>{{.i18n.Tr "admin.orgs.members"}}</th>
+ <th>{{.i18n.Tr "admin.users.repos"}}</th>
+ <th>{{.i18n.Tr "admin.users.created"}}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{range .Orgs}}
+ <tr>
+ <td>{{.Id}}</td>
+ <td><a href="/org/{{.Name}}">{{.Name}}</a></td>
+ <td>{{.Email}}</td>
+ <td>{{.NumTeams}}</td>
+ <td>{{.NumMembers}}</td>
+ <td>{{.NumRepos}}</td>
+ <td>{{DateFormat .Created "M d, Y"}}</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/orgs?p={{.LastPageNum}}">&laquo; {{.i18n.Tr "admin.prev"}}</a></li>{{end}}
+ {{if .NextPageNum}}<li><a class="btn btn-medium btn-gray btn-radius" href="/admin/orgs?p={{.NextPageNum}}">&raquo; {{.i18n.Tr "admin.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/repo/list.tmpl b/templates/admin/repo/list.tmpl
new file mode 100644
index 0000000000..3f35715833
--- /dev/null
+++ b/templates/admin/repo/list.tmpl
@@ -0,0 +1,60 @@
+{{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.repos.repo_manage_panel"}}</strong>
+ </div>
+ <div class="panel-body admin-panel">
+ <div class="admin-table">
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ <th>Id</th>
+ <th>{{.i18n.Tr "admin.repos.owner"}}</th>
+ <th>{{.i18n.Tr "admin.repos.name"}}</th>
+ <th>{{.i18n.Tr "admin.repos.private"}}</th>
+ <th>{{.i18n.Tr "admin.repos.watches"}}</th>
+ <th>{{.i18n.Tr "admin.repos.stars"}}</th>
+ <th>{{.i18n.Tr "admin.repos.issues"}}</th>
+ <th>{{.i18n.Tr "admin.users.created"}}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{range .Repos}}
+ <tr>
+ <td>{{.Id}}</td>
+ <td><a href="/user/{{.Owner.Name}}">{{.Owner.Name}}</a></td>
+ <td><a href="/{{.Owner.Name}}/{{.Name}}">{{.Name}}</a></td>
+ <td><i class="fa fa{{if .IsPrivate}}-check{{end}}-square-o"></i></td>
+ <td>{{.NumWatches}}</td>
+ <td>{{.NumIssues}}</td>
+ <td>{{.NumStars}}</td>
+ <td>{{DateFormat .Created "M d, Y"}}</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/repos?p={{.LastPageNum}}">&laquo; Prev.</a></li>{{end}}
+ {{if .NextPageNum}}<li><a class="btn btn-medium btn-gray btn-radius" href="/admin/repos?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/repos.tmpl b/templates/admin/repos.tmpl
deleted file mode 100644
index f6f3a7be98..0000000000
--- a/templates/admin/repos.tmpl
+++ /dev/null
@@ -1,44 +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">
- Repository Management
- </div>
-
- <div class="panel-body">
- <table class="table table-striped">
- <thead>
- <tr>
- <th>Id</th>
- <th>Owner</th>
- <th>Name</th>
- <th>Private</th>
- <th>Watches</th>
- <th>Issues</th>
- <th>Forks</th>
- <th>Created</th>
- </tr>
- </thead>
- <tbody>
- {{range .Repos}}
- <tr>
- <td>{{.Id}}</td>
- <th>{{.Owner.Name}}</th>
- <td><a href="/{{.Owner.Name}}/{{.Name}}">{{.Name}}</a></td>
- <td><i class="fa fa{{if .IsPrivate}}-check{{end}}-square-o"></i></td>
- <td>{{.NumWatches}}</td>
- <td>{{.NumIssues}}</td>
- <td>{{.NumForks}}</td>
- <td>{{DateFormat .Created "M d, Y"}}</td>
- </tr>
- {{end}}
- </tbody>
- </table>
- </div>
- </div>
- </div>
-</div>
-{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl
index 329c667318..e88126706e 100644
--- a/templates/admin/user/edit.tmpl
+++ b/templates/admin/user/edit.tmpl
@@ -1,103 +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"{{if eq 0 .User.LoginSource}} selected{{end}}>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">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..51e6604fac
--- /dev/null
+++ b/templates/admin/user/list.tmpl
@@ -0,0 +1,61 @@
+{{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 "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..0c4ad603ac 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">
+ <label></label>
+ <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 14fddf33c4..0000000000
--- a/templates/admin/users.tmpl
+++ /dev/null
@@ -1,45 +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>
- </div>
- </div>
- </div>
-</div>
-{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/base/navbar.tmpl b/templates/base/navbar.tmpl
index 29a2b75cc1..75096a4e43 100644
--- a/templates/base/navbar.tmpl
+++ b/templates/base/navbar.tmpl
@@ -6,7 +6,7 @@
<a class="nav-item pull-left{{if .PageIsHelp}} active{{end}}" target="_blank" href="http://gogs.io/docs">Help</a>
{{if .IsSigned}}
{{if .HasAccess}}
- <form class="nav-item pull-left{{if .PageIsNewRepo}} active{{end}}" id="nav-search-form">
+ <!-- <form class="nav-item pull-left{{if .PageIsNewRepo}} active{{end}}" id="nav-search-form">
<div class="input-group">
<div class="input-group-btn">
<button type="button" class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown">{{if .Repository}}This Repository{{else}}All Repositories{{end}} <span class="caret"></span></button>
@@ -20,14 +20,16 @@
</div>
<input type="search" class="form-control input-sm" name="q" placeholder="search code, commits and issues"/>
</div>
- </form>
+ </form> -->
{{end}}
<a id="nav-out" class="nav-item navbar-right navbar-btn btn btn-danger" href="/user/logout/"><i class="fa fa-power-off fa-lg"></i></a>
<a id="nav-avatar" class="nav-item navbar-right{{if .PageIsUserProfile}} active{{end}}" href="{{.SignedUser.HomeLink}}" data-toggle="tooltip" data-placement="bottom" title="{{.SignedUserName}}">
<img src="{{.SignedUser.AvatarLink}}?s=28" alt="user-avatar" title="username"/>
</a>
<a class="navbar-right nav-item{{if .PageIsUserSetting}} active{{end}}" href="/user/settings" data-toggle="tooltip" data-placement="bottom" title="Settings"><i class="fa fa-cogs fa-lg"></i></a>
- {{if .IsAdmin}}<a class="navbar-right nav-item{{if .PageIsAdmin}} active{{end}}" href="/admin" data-toggle="tooltip" data-placement="bottom" title="Admin"><i class="fa fa-gear fa-lg"></i></a>{{end}}
+ {{if .IsAdmin}}
+ <a class="navbar-right nav-item{{if .PageIsAdmin}} active{{end}}" href="/admin" data-toggle="tooltip" data-placement="bottom" title="Admin"><i class="fa fa-gear fa-lg"></i></a>
+ {{end}}
<div class="navbar-right nav-item pull-right{{if .PageIsNewRepo}} active{{end}}" id="nav-repo-new" data-toggle="tooltip" data-placement="bottom" title="New Repo">
<button type="button" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus-square fa-lg"></i></button>
<div class="dropdown-menu">
@@ -45,21 +47,3 @@
</nav>
</div>
</div>
-<!--<nav class="navbar navbar-inverse navbar-fixed-top">
- <div class="container">
- <div class="navbar-header">
- <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse">
- <i class="fa fa-bars"></i>
- </button>
- <a class="navbar-brand" href="/"><img src="/img/favicon.png" alt="Gogs Logo"></a>
- </div>
-
- <div class="collapse navbar-collapse" id="gopmweb-navbar-collapse">
- <ul class="nav navbar-nav">
- <li><a>{{.Title}}</a></li>
- </ul>
-
- <a href="/user/signin" class="navbar-right btn btn-success navbar-btn">Sign In</a>
- </div>
- </div>
-</nav>-->
diff --git a/templates/home.tmpl b/templates/home.tmpl
index 8288d21e15..ba9cbe402b 100644
--- a/templates/home.tmpl
+++ b/templates/home.tmpl
@@ -1,27 +1,72 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body" class="container">
- {{if not .Repos}}
- <h4>Hey there, welcome to the land of Gogs!</h4>
- <p>If you just got your Gogs server running, go to the <a href="/install">install</a> guide page, which will guide you through your initial setup.</p>
- <img src="http://gowalker.org/public/gogs_demo.gif">
- {{else}}
- <h4>Hey there, welcome to the land of Gogs!</h4>
- <h5>Here are some recent updated repositories:</h5>
- <div class="tab-pane active">
- <ul class="list-unstyled repo-list">
- {{range .Repos}}
- <li>
- <div class="meta pull-right"><!-- <i class="fa fa-star"></i> {{.NumStars}} --> <i class="fa fa-code-fork"></i> {{.NumForks}}</div>
- <h4>
- <a href="/{{.Owner.Name}}/{{.Name}}">{{.Name}}</a>
- </h4>
- <p class="desc">{{.Description}}</p>
- <div class="info">Last updated {{.Updated|TimeSince}}</div>
- </li>
- {{end}}
- </ul>
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="promo-wrapper">
+ <div class="container clear">
+ <div id="promo-logo" class="left">
+ <img src="/img/gogs-lg.png" alt="logo" />
+ </div>
+ <div id="promo-content">
+ <h1>Gogs</h1>
+ <h2>{{.i18n.Tr "app_desc"}}</h2>
+ <form id="promo-form" action="/user/login" method="post">
+ {{.CsrfTokenHtml}}
+ <input class="ipt ipt-large" id="username" name="uname" type="text" placeholder="{{.i18n.Tr "home.uname_holder"}}"/>
+ <input class="ipt ipt-large" name="password" type="password" placeholder="{{.i18n.Tr "home.password_holder"}}"/>
+ <input name="from" type="hidden" value="home">
+ <button class="btn btn-black btn-large">{{.i18n.Tr "sign_in"}}</button>
+ <button class="btn btn-green btn-large" id="register-button">{{.i18n.Tr "register"}}</button>
+ </form>
+ <div id="promo-social" class="social-buttons">
+ {{template "ng/base/social" .}}
+ </div>
+ </div>&nbsp;
</div>
- {{end}}
</div>
-{{template "base/footer" .}}
+<div id="feature-wrapper">
+ <div class="container clear">
+ {{if eq .Lang "zh-CN"}}
+ <div class="grid-1-2 left">
+ <i class="octicon octicon-flame"></i>
+ <b>易安装</b>
+ <p>您除了可以根据操作系统平台通过 <a target="_blank" href="http://gogs.io/docs/installation/install_from_binary.html">二进制运行</a>,还可以通过 <a target="_blank" href="https://github.com/gogits/gogs/tree/master/dockerfiles">Docker</a> 或 <a target="_blank" href="https://github.com/geerlingguy/ansible-vagrant-examples/tree/master/gogs">Vagrant</a>,以及 <a target="_blank" href="http://gogs.io/docs/installation/install_from_packages.html">包管理</a> 安装。</p>
+ </div>
+ <div class="grid-1-2 left">
+ <i class="octicon octicon-device-desktop"></i>
+ <b>跨平台</b>
+ <p>任何 <a target="_blank" href="http://golang.org/">Go 语言</a> 支持的平台都可以运行 Gogs,包括 Windows、Mac、Linux 以及 ARM。挑一个您喜欢的就行!</p>
+ </div>
+ <div class="grid-1-2 left">
+ <i class="octicon octicon-rocket"></i>
+ <b>轻量级</b>
+ <p>一个廉价的树莓派的配置足以满足 Gogs 的最低系统硬件要求。最大程度上节省您的服务器资源!</p>
+ </div>
+ <div class="grid-1-2 left">
+ <i class="octicon octicon-code"></i>
+ <b>开源化</b>
+ <p>所有的代码都开源在 <a target="_blank" href="https://github.com/gogits/gogs/">GitHub</a> 上,赶快加入我们来共同发展这个伟大的项目!还等什么?成为贡献者吧!</p>
+ </div>
+ {{else}}
+ <div class="grid-1-2 left">
+ <i class="octicon octicon-flame"></i>
+ <b>Easy to install</b>
+ <p>Simply <a target="_blank" href="http://gogs.io/docs/installation/install_from_binary.html">run the binary</a> for your platform. Or ship Gogs with <a target="_blank" href="https://github.com/gogits/gogs/tree/master/dockerfiles">Docker</a> or <a target="_blank" href="https://github.com/geerlingguy/ansible-vagrant-examples/tree/master/gogs">Vagrant</a>, or get it <a target="_blank" href="http://gogs.io/docs/installation/install_from_packages.html">packaged</a>.</p>
+ </div>
+ <div class="grid-1-2 left">
+ <i class="octicon octicon-device-desktop"></i>
+ <b>Cross-platform</b>
+ <p>Gogs runs anywhere <a target="_blank" href="http://golang.org/">Go</a> can compile for: Windows, Mac OS X, Linux, ARM, etc. Choose the one you love!</p>
+ </div>
+ <div class="grid-1-2 left">
+ <i class="octicon octicon-rocket"></i>
+ <b>Lightweight</b>
+ <p>Gogs has low minimal requirements and can run on an inexpensive Raspberry Pi. Save your machine energy!</p>
+ </div>
+ <div class="grid-1-2 left">
+ <i class="octicon octicon-code"></i>
+ <b>Open Source</b>
+ <p>It's all on <a target="_blank" href="https://github.com/gogits/gogs/">GitHub</a>! Join us by contributing to make this project even better. Don't be shy to be a contributor!</p>
+ </div>
+ {{end}}
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/install.tmpl b/templates/install.tmpl
index 9ba610b62d..bf443de5a0 100644
--- a/templates/install.tmpl
+++ b/templates/install.tmpl
@@ -87,7 +87,7 @@
<p class="help-block">The user has access to visit and run Gogs.</p>
</div>
</div>
-
+
<div class="form-group">
<label class="col-md-3 control-label">Domain: </label>
<div class="col-md-8">
@@ -95,7 +95,7 @@
<p class="help-block">This affects SSH clone URL.</p>
</div>
</div>
-
+
<div class="form-group">
<label class="col-md-3 control-label">App URL: </label>
<div class="col-md-8">
diff --git a/templates/mail/notify/collaborator.tmpl b/templates/mail/notify/collaborator.tmpl
index 0664b4c640..36a3149daa 100644
--- a/templates/mail/notify/collaborator.tmpl
+++ b/templates/mail/notify/collaborator.tmpl
@@ -10,7 +10,7 @@
<p>
---
<br>
- View it on Gogs:
+ View it on Gogs:
<br>
<a href="{{.AppUrl}}{{.RepoLink}}">{{.AppUrl}}{{.RepoLink}}</a>
</p>
diff --git a/templates/ng/base/alert.tmpl b/templates/ng/base/alert.tmpl
new file mode 100644
index 0000000000..df14d3c3bf
--- /dev/null
+++ b/templates/ng/base/alert.tmpl
@@ -0,0 +1,2 @@
+{{if .Flash.ErrorMsg}}<span class="alert alert-red alert-radius block text-bold"><i class="octicon octicon-alert"></i>{{.Flash.ErrorMsg}}</span>{{end}}
+{{if .Flash.SuccessMsg}}<div class="alert alert-green alert-radius block"><i class="octicon octicon-check"></i>{{.Flash.SuccessMsg}}</div>{{end}} \ No newline at end of file
diff --git a/templates/ng/base/footer.tmpl b/templates/ng/base/footer.tmpl
new file mode 100644
index 0000000000..734533a108
--- /dev/null
+++ b/templates/ng/base/footer.tmpl
@@ -0,0 +1,27 @@
+ </div>
+ <footer id="footer">
+ <div class="container clear">
+ <p class="left" id="footer-rights">© 2014 GoGits · {{.i18n.Tr "version"}}: {{AppVer}} · {{.i18n.Tr "page"}}: <strong>{{LoadTimes .PageStartTime}}</strong> ·
+ {{.i18n.Tr "template"}}: <strong>{{call .TmplLoadTimes}}</strong></p>
+
+ <div class="right" id="footer-links">
+ <a target="_blank" href="https://github.com/gogits/gogs"><i class="fa fa-github-square"></i></a>
+ <a target="_blank" href="https://twitter.com/gogitservice"><i class="fa fa-twitter"></i></a>
+ <a target="_blank" href="https://plus.google.com/communities/115599856376145964459"><i class="fa fa-google-plus"></i></a>
+ <a target="_blank" href="http://weibo.com/gogschina"><i class="fa fa-weibo"></i></a>
+ <div id="footer-lang" class="inline drop drop-top">{{.i18n.Tr "language"}}
+ <div class="drop-down">
+ <ul class="menu menu-vertical switching-list">
+ {{range .AllLangs}}
+ <li><a href="{{if eq $.Lang .Lang}}#{{else}}{{$.Link}}?lang={{.Lang}}{{end}}">{{.Name}}</a></li>
+ {{end}}
+ </ul>
+ </div>
+ </div>
+ <a target="_blank" href="http://gogs.io">{{.i18n.Tr "website"}}</a>
+ <span class="version">{{GoVer}}</span>
+ </div>
+ </div>
+ </footer>
+ </body>
+</html> \ No newline at end of file
diff --git a/templates/ng/base/head.tmpl b/templates/ng/base/head.tmpl
new file mode 100644
index 0000000000..815453446a
--- /dev/null
+++ b/templates/ng/base/head.tmpl
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
+ <meta name="author" content="Gogs - Go Git Service" />
+ <meta name="description" content="Gogs(Go Git Service) a painless self-hosted Git Service written in Go" />
+ <meta name="keywords" content="go, git, self-hosted, gogs">
+ <meta name="_csrf" content="{{.CsrfToken}}" />
+ {{if .Repository.IsGoget}}<meta name="go-import" content="{{.GoGetImport}} git {{.CloneLink.HTTPS}}">{{end}}
+
+ <link rel="shortcut icon" href="/img/favicon.png" />
+
+ {{if CdnMode}}
+ <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css">
+
+ <script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
+ {{else}}
+ <link rel="stylesheet" href="/css/font-awesome.min.css">
+
+ <script src="/ng/js/lib/jquery-1.11.1.min.js"></script>
+ {{end}}
+ <!-- Stylesheet -->
+ <link rel="stylesheet" href="/ng/css/ui.css">
+ <link rel="stylesheet" href="/ng/css/gogs.css">
+ <link rel="stylesheet" href="/ng/fonts/octicons.css">
+ <link rel="stylesheet" href="/css/github.min.css">
+
+ <!-- JavaScript -->
+ <script src="/ng/js/lib/tabs.js"></script>
+ <script src="/ng/js/lib/lib.js"></script>
+ <script src="/ng/js/gogs.js"></script>
+
+ <title>{{if .Title}}{{.Title}} - {{end}}{{AppName}}</title>
+ </head>
+ <body>
+ <div id="wrapper">
+ <noscript>Please enable JavaScript in your browser!</noscript> \ No newline at end of file
diff --git a/templates/ng/base/header.tmpl b/templates/ng/base/header.tmpl
new file mode 100644
index 0000000000..31533d2727
--- /dev/null
+++ b/templates/ng/base/header.tmpl
@@ -0,0 +1,58 @@
+<header id="header">
+ <ul class="menu menu-line container" id="header-nav">
+ {{if not .PageIsHome}}
+ <li class="head" id="header-nav-logo">
+ <img src="/img/favicon.png" alt="avatar" class="avatar-30"/>
+ </li>
+ <li {{if .PageIsDashboard}}class="current"{{end}}>
+ <a href="/">{{if .IsSigned}}{{.i18n.Tr "dashboard"}}{{else}}{{.i18n.Tr "home"}}{{end}}</a>
+ </li>
+ <li><a href="/explore">{{.i18n.Tr "explore"}}</a></li>
+ <li><a target="_blank" href="http://gogs.io/docs">{{.i18n.Tr "help"}}</a></li>
+ {{end}}
+
+ {{if .IsSigned}}
+ <li class="right" id="header-nav-sign-out">
+ <a href="/user/logout" title="{{.i18n.Tr "sign_out"}}"><i class="octicon octicon-sign-out"></i></a>
+ </li>
+ <li class="right {{if .PageIsUserSettings}}current{{end}}">
+ <a href="/user/settings" title="{{.i18n.Tr "account_settings"}}"><i class="octicon octicon-settings"></i></a>
+ </li>
+ {{if .IsAdmin}}
+ <li class="right {{if .PageIsAdmin}}current{{end}}">
+ <a href="/admin" title="{{.i18n.Tr "admin_panel"}}"><i class="octicon octicon-circuit-board"></i></a>
+ </li>
+ {{end}}
+ <li class="right down">
+ <a href="#"><i class="octicon octicon-plus"></i></a>
+ <ul class="menu menu-down" id="header-new-repo-menu">
+ <li><a href="/repo/create"><i class="octicon octicon-repo-create"></i>{{.i18n.Tr "new_repo"}}</a></li>
+ <li><a href="/repo/migrate"><i class="octicon octicon-repo-clone"></i>{{.i18n.Tr "new_migrate"}}</a></li>
+ <li><a href="/org/create"><i class="octicon octicon-organization"></i>{{.i18n.Tr "new_org"}}</a></li>
+ </ul>
+ </li>
+ <li class="right" id="header-nav-user">
+ <a href="/{{.SignedUser.Name}}" class="text-bold">
+ <img src="{{.SignedUser.AvatarLink}}" alt="user-avatar" class="avatar-30"/>
+ {{.SignedUser.Name}}
+ </a>
+ </li>
+ {{else}}
+ {{if .PageIsHome}}
+ <li class="right" id="header-nav-help">
+ <a target="_blank" href="http://gogs.io/docs"><i class="octicon octicon-info"></i>&nbsp;&nbsp;{{.i18n.Tr "help"}}</a>
+ </li>
+ <li class="right" id="header-nav-explore">
+ <a href="/explore"><i class="octicon octicon-globe"></i>&nbsp;&nbsp;{{.i18n.Tr "explore"}}</a>
+ </li>
+ {{else}}
+ <li class="right" id="header-nav-sign-in">
+ <a href="/user/login" title="Sign In"><i class="octicon octicon-sign-in"></i> {{.i18n.Tr "sign_in"}}</a>
+ </li>
+ <li class="right">
+ <a href="/user/sign_up" title="Account Settings"><i class="octicon octicon-person-add"></i> {{.i18n.Tr "register"}}</a>
+ </li>
+ {{end}}
+ {{end}}
+ </ul>
+</header> \ No newline at end of file
diff --git a/templates/ng/base/social.tmpl b/templates/ng/base/social.tmpl
new file mode 100644
index 0000000000..97f71b4e99
--- /dev/null
+++ b/templates/ng/base/social.tmpl
@@ -0,0 +1,4 @@
+{{if .OauthService.GitHub}}<a class="btn github" href="/user/login/github?next=/user/sign_up"><i class="fa fa-github"></i>GitHub</a>{{end}}
+{{if .OauthService.Google}}<a class="btn google" href="/user/login/google?next=/user/sign_up"><i class="fa fa-google"></i>Google +</a>{{end}}
+{{if .OauthService.Weibo}}<a class="btn weibo" href="/user/login/weibo?next=/user/sign_up"><i class="fa fa-weibo"></i>新浪微博</a>{{end}}
+{{if .OauthService.Tencent}}<a class="btn qq" href="/user/login/qq?next=/user/sign_up"><i class="fa fa-qq"></i>腾讯 QQ&nbsp;</a>{{end}} \ No newline at end of file
diff --git a/templates/org/base/header.tmpl b/templates/org/base/header.tmpl
new file mode 100644
index 0000000000..8566d0a3c5
--- /dev/null
+++ b/templates/org/base/header.tmpl
@@ -0,0 +1,16 @@
+<div class="org-header" id="org-header">
+ <div class="container">
+ <a class="text-black left" href="/org/{{.Org.LowerName}}">
+ <img class="avatar-48 left" src="{{.Org.AvatarLink}}?s=100">
+ <span class="org-name">{{.Org.FullName}}</span>
+ </a>
+ <ul class="menu menu-line container">
+ <li class="right">
+ <a {{if .PageIsOrgTeams}}class="current"{{end}} href="{{.OrgLink}}/teams"><i class="octicon octicon-jersey"></i> {{.i18n.Tr "org.teams"}} <span class="label label-gray label-radius">{{.Org.NumTeams}}</span></a>
+ </li>
+ <li class="right">
+ <a {{if .PageIsOrgMembers}}class="current"{{end}} href="{{.OrgLink}}/members"><i class="octicon octicon-organization"></i> {{.i18n.Tr "org.people"}} <span class="label label-gray label-radius">{{.Org.NumMembers}}</span></a>
+ </li>
+ </ul>
+ </div>
+</div> \ No newline at end of file
diff --git a/templates/org/create.tmpl b/templates/org/create.tmpl
new file mode 100644
index 0000000000..820cf7e756
--- /dev/null
+++ b/templates/org/create.tmpl
@@ -0,0 +1,31 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="sign-wrapper">
+ <form class="form-align form panel sign-panel sign-form container panel-radius" id="sign-up-form" action="/org/create" method="post">
+ {{.CsrfTokenHtml}}
+ <div class="panel-header">
+ <h2>{{.i18n.Tr "new_org"}}</h2>
+ </div>
+ <div class="panel-content">
+ {{template "ng/base/alert" .}}
+ <div class="field">
+ <label class="req" for="org_name">{{.i18n.Tr "org.org_name_holder"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_OrgName}}ipt-error{{end}}" id="org_name" name="org_name" type="text" value="{{.org_name}}" required/>
+ <label></label>
+ <span class="help">{{.i18n.Tr "org.org_name_helper"}}</span>
+ </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/>
+ <label></label>
+ <span class="help">{{.i18n.Tr "org.org_email_helper"}}</span>
+ </div>
+ <div class="field">
+ <span class="form-label"></span>
+ <button class="btn btn-large btn-blue btn-radius">{{.i18n.Tr "org.create_org"}}</button>
+ <a class="btn btn-small btn-gray btn-radius" id="repo-create-cancel" href="/"><strong>{{.i18n.Tr "cancel"}}</strong></a>
+ </div>
+ </div>
+ </form>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/org/edit_team.tmpl b/templates/org/edit_team.tmpl
deleted file mode 100644
index 4292575c87..0000000000
--- a/templates/org/edit_team.tmpl
+++ /dev/null
@@ -1,75 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body-nav" class="org-nav org-nav-auto">
- <div class="container clearfix">
- <div id="org-nav-wrapper">
- <ul class="nav nav-pills pull-right">
- <li><a href="#"><i class="fa fa-users"></i>Members
- <span class="label label-default">5</span></a>
- </li>
- <li class="active"><a href="#"><i class="fa fa-tags"></i>Teams
- <span class="label label-default">2</span></a>
- </li>
- </ul>
- <img class="pull-left org-small-logo" src="https://avatars3.githubusercontent.com/u/6656686?s=140" alt="" width="60"/>
- <div id="org-nav-info">
- <h2 class="org-name">Organization Name</h2>
- </div>
- </div>
- </div>
-</div>
-<div id="body" class="container">
- <div id="org">
- <form id="org-teams-edit" class="form-horizontal card">
- <h3>Edit team</h3>
- <div class="form-group">
- <label class="col-md-2 control-label">Team Name<strong class="text-danger">*</strong></label>
- <div class="col-md-8">
- <input name="team" type="text" class="form-control" placeholder="Type your team name" value="" required="required">
- <span class="help-block">You'll use this name to mention this team in conversations.</span>
- </div>
- </div>
- <div class="form-group">
- <label class="col-md-2 control-label">Description</label>
- <div class="col-md-8">
- <input name="desc" type="text" class="form-control" placeholder="Type your team description (optional)" value="">
- </div>
- </div>
- <div class="form-group">
- <label class="col-md-2 control-label">Permission</label>
- <div class="col-md-8">
- <div class="radio">
- <label>
- <input type="radio" name="permission" value="pull" checked="">
- <strong>Read & Clone</strong>
- </label>
- <p>This team will be able to view and clone its repositories.</p>
- </div>
- <div class="radio">
- <label>
- <input type="radio" name="permission" value="push">
- <strong>Push, Read & Clone</strong>
- </label>
- <p>This team will be able to read its repositories, as well as push to them.</p>
- </div>
- <div class="radio">
- <label>
- <input type="radio" name="permission" value="admin">
- <strong>Collaboration, Push, Read & Clone</strong>
- </label>
- <p>This team will be able to push/pull to its repositories, as well as add other collaborators to them.</p>
- </div>
- </div>
- </div>
- <hr/>
- <div class="form-group">
- <label class="col-md-2">&nbsp;</label>
- <div class="col-md-8">
- <button class="btn btn-primary">Edit this team</button>
- <button class="btn btn-danger pull-right" value="delete" name="delete">Delete this team</button>
- </div>
- </div>
- </form>
- </div>
-</div>
-{{template "base/footer" .}}
diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl
index a3c2326230..6f3078de50 100644
--- a/templates/org/home.tmpl
+++ b/templates/org/home.tmpl
@@ -1,70 +1,93 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body-nav" class="org-nav">
- <div class="container clearfix">
- <div class="col-md-8" id="org-nav-wrapper">
- <img class="pull-left org-logo" src="{{.Org.AvatarLink}}?s=140" alt="" width="100"/>
- <div id="org-nav-info">
- <h2 class="org-name">{{.Org.FullName}}</h2>
- {{if .Org.Description}}<p class="org-description">{{.Org.Description}}</p>{{end}}
- <ul class="org-meta list-inline">
- {{if .Org.Website}}<li><i class="fa fa-link"></i><a target="_blank" href="{{.Org.Website}}">{{.Org.Website}}</a></li>{{end}}
- <li><i class="fa fa-envelope"></i><a href="mailto:{{.Org.Email}}">{{.Org.Email}}</a></li>
- </ul>
- </div>
- </div>
- </div>
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div class="org-header" id="org-home-header">
+ <div class="container clear">
+ <img class="avatar-100 left" src="{{.Org.AvatarLink}}?s=140"/>
+ <div id="org-home-header-info">
+ <h2>
+ {{.Org.FullName}}
+ {{if .IsOrganizationOwner}}<a class="text-grey" href="{{.OrgLink}}/settings"><span class="octicon octicon-gear"></span></a>{{end}}
+ </h2>
+ {{if .Org.Description}}<p>{{.Org.Description}}</p>{{end}}
+ <ul class="text-grey">
+ {{if .Org.Location}}<li><span class="octicon octicon-location"></span> <span>{{.Org.Location}}</span></li>{{end}}
+ {{if .Org.Website}}<li><span class="octicon octicon-link"></span> <a target="_blank" href="{{.Org.Website}}">{{.Org.Website}}</a></li>{{end}}
+ {{if .Org.Email}}<li><span class="octicon octicon-mail"></span> <a href="mailto:{{.Org.Email}}">{{.Org.Email}}</a></li>{{end}}
+ </ul>
+ </div>
+ </div>
</div>
-<div id="body" class="container">
- <div id="org">
- <div class="org-main col-md-8">
- <div class="org-toolbar clearfix">
- <a class="btn pull-right btn-success" href="/repo/create?org={{.Org.Id}}"><i class="fa fa-plus"></i> New Repository</a>
- </div>
- <hr style="width: 100%;border-color: #DDD"/>
- <div class="org-repo-list" id="org-repo-list">
- {{range .Repos}}
- <div class="org-repo-item">
- <div class="org-repo-status pull-right">
- <!-- <ul class="list-inline">
- <li><strong>Go</strong></li>
- <li><i class="i fa fa-star"></i><strong>6</strong></li>
- <li><i class="fa fa-code-fork"></i><strong>2</strong></li>
- </ul> -->
- </div>
- <h3 class="org-repo-name"><a href="/{{$.Org.Name}}/{{.Name}}">{{.Name}}</a></h3>
- <p class="org-repo-description">{{.Description}}</p>
- <p class="org-repo-update">Updated {{TimeSince .Updated}}</p>
- </div>
- {{end}}
- </div>
+<div class="container">
+ {{$isMember := .Org.IsOrgMember $.SignedUser.Id}}
+ <div id="org-home-repo-list" class="left grid-2-3">
+ <div class="clear">
+ {{if .IsOrganizationOwner}}
+ <a class="btn btn-green btn-large btn-link btn-radius right" href="/repo/create?org={{.Org.Id}}"><i class="octicon octicon-repo-create"></i> {{.i18n.Tr "new_repo"}}</a>
+ {{end}}
</div>
-
- <div class="org-sidebar col-md-4">
- <div class="org-panel panel panel-default" id="org-sidebar-members">
- <div class="panel-heading"><strong><a href="/org/{{$.Org.Name}}/members">Members</a></strong></div>
- <div class="panel-body">
- {{range .Members}}
- <a class="org-member" href="/user/{{.Name}}" data-toggle="tooltip" title="{{.Name}}" data-placement="bottom"><img src="{{.AvatarLink}}?s=140" alt=""/></a>
- {{end}}
- </div>
- </div>
- <div class="org-panel panel panel-default" id="org-sidebar-teams">
- <div class="panel-heading"><strong><a href="/org/{{$.Org.Name}}/teams">Teams</a></strong></div>
- <div class="panel-body">
- {{range .Teams}}
- <div class="org-team">
- <a href="/org/{{$.Org.Name}}/teams/{{.LowerName}}">
- <p class="org-team-name"><strong>{{.Name}}</strong></p>
- <p class="org-team-meta">
- {{.NumMembers}} members · {{.NumRepos}} repositories
- </p>
- </a>
- </div>
- {{end}}
- </div>
- </div>
+ <div id="org-repo-list">
+ {{range .Repos}}
+ {{if or $isMember (not .IsPrivate)}}
+ <div class="org-repo-item">
+ <ul class="org-repo-status right">
+ <li><i class="octicon octicon-star"></i> {{.NumStars}}</li>
+ <li><i class="octicon octicon-git-branch"></i> {{.NumForks}}</li>
+ </ul>
+ <h2><a href="/{{$.Org.Name}}/{{.Name}}">{{.Name}}</a></h2>
+ <p class="org-repo-description">{{.Description}}</p>
+ <p class="org-repo-updated">{{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Updated $.i18n.Lang}}</p>
+ </div>
+ {{end}}
+ {{end}}
</div>
</div>
+ <div class="grid-1-3 right">
+ <div class="org-sidebar">
+ <div class="panel panel-radius">
+ <div class="panel-header">
+ {{if $isMember}}
+ <a class="text-grey right" href="/org/{{.Org.LowerName}}/members"><strong>{{.Org.NumMembers}}</strong><span class="octicon octicon-chevron-right"></span></a>
+ {{end}}
+ <strong>{{.i18n.Tr "org.people"}}</strong>
+ </div>
+ <div class="panel-body member-avatar-group">
+ {{range .Members}}
+ {{if or $isMember (.IsPublicMember $.Org.Id)}}
+ <a href="/{{.Name}}" title="{{.Name}}"><img src="{{.AvatarLink}}"></a>
+ {{end}}
+ {{end}}
+ </div>
+ {{if .IsOrganizationOwner}}
+ <div class="panel-footer">
+ <a class="btn btn-medium btn-blue btn-link btn-radius" href="/org/{{.Org.LowerName}}/invitations/new">{{.i18n.Tr "org.invite_someone"}}</a>
+ </div>
+ {{end}}
+ </div>
+ {{if $isMember}}
+ <br>
+ <div class="panel panel-radius">
+ <div class="panel-header">
+ <a class="text-grey right" href="/org/{{.Org.LowerName}}/teams"><strong>{{.Org.NumTeams}}</strong><span class="octicon octicon-chevron-right"></span></a>
+ <strong>{{.i18n.Tr "org.teams"}}</strong>
+ </div>
+ <div class="panel-body" id="org-home-team-list">
+ <ul>
+ {{range .Teams}}
+ <li>
+ <a class="text-black" href="/org/{{$.Org.LowerName}}/teams/{{.LowerName}}"><strong class="team-name">{{.Name}}</strong></a>
+ <p class="team-meta">{{.NumMembers}} {{$.i18n.Tr "org.lower_members"}} · {{.NumRepos}} {{$.i18n.Tr "org.lower_repositories"}}</p>
+ </li>
+ {{end}}
+ </ul>
+ </div>
+ {{if .IsOrganizationOwner}}
+ <div class="panel-footer">
+ <a class="btn btn-medium btn-blue btn-link btn-radius" href="/org/{{$.Org.LowerName}}/teams/new">{{.i18n.Tr "org.create_new_team"}}</a>
+ </div>
+ {{end}}
+ </div>
+ {{end}}
+ </div>
+ </div>
</div>
-{{template "base/footer" .}}
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/org/member/invite.tmpl b/templates/org/member/invite.tmpl
new file mode 100644
index 0000000000..bff1b98b4c
--- /dev/null
+++ b/templates/org/member/invite.tmpl
@@ -0,0 +1,18 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+{{template "org/base/header" .}}
+<div class="container">
+ <div class="invite-box" id="invite-box">
+ {{template "ng/base/alert" .}}
+ <h3>{{.i18n.Tr "org.members.invite_desc" .Org.FullName}}</h3>
+ <form id="invite-member-form" action="{{.OrgLink}}/invitations/new" method="post">
+ {{.CsrfTokenHtml}}
+ <input class="ipt ipt-large ipt-radius" id="org-member-invite" name="uname" autocomplete="off" required>
+ <button class="btn btn-blue btn-large btn-radius">{{.i18n.Tr "org.members.invite_now"}}</button>
+ <div id="org-member-list-block">
+ <ul class="menu-down-show menu-vertical menu-radius switching-list user-list" id="org-member-invite-list"></ul>
+ </div>
+ </form>
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/org/member/members.tmpl b/templates/org/member/members.tmpl
new file mode 100644
index 0000000000..1c530982fb
--- /dev/null
+++ b/templates/org/member/members.tmpl
@@ -0,0 +1,49 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+{{template "org/base/header" .}}
+<div class="container">
+ <div class="org-header-alert">
+ {{template "ng/base/alert" .}}
+ </div>
+ <div class="org-toolbar clear">
+ {{if .IsOrganizationOwner}}
+ <a class="btn btn-green btn-large btn-link btn-radius right" href="{{.OrgLink}}/invitations/new"><i class="octicon octicon-repo-create"></i> {{.i18n.Tr "org.invite_someone"}}</a>
+ {{end}}
+ </div>
+ <div id="org-member-list">
+ {{range .Members}}
+ <div class="org-member-item">
+ <img class="avatar-48 left" src="{{.AvatarLink}}?s=100">
+ <a class="text-black" href="/{{.Name}}"><span class="member-name"><strong>{{.FullName}}</strong>({{.Name}})</span></a>
+ <ul class="grid-6-12 right">
+ <li class="grid-1-3">
+ {{ $isPublic := .IsPublicMember $.Org.Id}}
+ {{if $isPublic}}
+ {{$.i18n.Tr "org.members.public"}}
+ {{if eq $.SignedUser.Id .Id}}(<a href="{{$.OrgLink}}/members/action/private?uid={{.Id}}">{{$.i18n.Tr "org.members.public_helper"}}</a>){{end}}
+ {{else}}
+ {{$.i18n.Tr "org.members.private"}}
+ {{if eq $.SignedUser.Id .Id}}(<a href="{{$.OrgLink}}/members/action/public?uid={{.Id}}">{{$.i18n.Tr "org.members.private_helper"}}</a>){{end}}
+ {{end}}
+ </li>
+ <li class="grid-1-4">{{if .IsUserOrgOwner $.Org.Id}}<strong>{{$.i18n.Tr "org.members.owner"}}</strong>{{else}}{{$.i18n.Tr "org.members.member"}}{{end}}</li>
+ {{if eq $.SignedUser.Id .Id}}
+ <li class="grid-1-6 right">
+ <a class="btn btn-red btn-link btn-radius" href="{{$.OrgLink}}/members/action/leave?uid={{.Id}}">{{$.i18n.Tr "org.members.leave"}}</a>
+ </li>
+ {{else if $.IsOrganizationOwner}}
+ <li class="grid-1-6 right">
+ <a class="btn btn-red btn-link btn-radius" href="{{$.OrgLink}}/members/action/remove?uid={{.Id}}">{{$.i18n.Tr "org.members.remove"}}</a>
+ </li>
+ {{if $isPublic}}
+ <li class="grid-1-6 right">
+ <a class="btn btn-blue btn-link btn-radius" href="{{$.OrgLink}}/members/action/private?uid={{.Id}}">{{$.i18n.Tr "org.members.conceal"}}</a>
+ </li>
+ {{end}}
+ {{end}}
+ </ul>
+ </div>
+ {{end}}
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/org/members.tmpl b/templates/org/members.tmpl
deleted file mode 100644
index ba14cb4cc9..0000000000
--- a/templates/org/members.tmpl
+++ /dev/null
@@ -1,56 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body-nav" class="org-nav org-nav-auto">
- <div class="container clearfix">
- <div id="org-nav-wrapper">
- <ul class="nav nav-pills pull-right">
- <li class="active"><a href="#"><i class="fa fa-users"></i>Members
- <span class="label label-default">5</span></a>
- </li>
- <li><a href="#"><i class="fa fa-tags"></i>Teams
- <span class="label label-default">2</span></a>
- </li>
- </ul>
- <img class="pull-left org-small-logo" src="https://avatars3.githubusercontent.com/u/6656686?s=140" alt="" width="60"/>
- <div id="org-nav-info">
- <h2 class="org-name">Organization Name</h2>
- </div>
- </div>
-
- </div>
-</div>
-<div id="body" class="container">
- <div id="org">
- <div id="org-members">
- <div class="member">&nbsp;
- <div class="avatar col-md-1">
- <img src="https://avatars3.githubusercontent.com/u/2142787?s=140" alt=""/>
- </div>
- <div class="name col-md-4">
- <a href="#"><strong>fuxiaohei</strong><span class="nick">傅小黑</span></a>
- </div>
- <div class="role col-md-2 pull-right">
- <strong>Member</strong>
- </div>
- <div class="status col-md-1 pull-right">
- <strong>Public</strong>
- </div>
- </div>
- <div class="member">&nbsp;
- <div class="avatar col-md-1">
- <img src="https://avatars3.githubusercontent.com/u/2142787?s=140" alt=""/>
- </div>
- <div class="name col-md-4">
- <a href="#"><strong>fuxiaohei</strong><span class="nick">傅小黑</span></a>
- </div>
- <div class="role col-md-2 pull-right">
- <strong><i class="fa fa-user"></i>Owner</strong>
- </div>
- <div class="status col-md-1 pull-right">
- <i class="fa fa-lock"></i>Private
- </div>
- </div>
- </div>
- </div>
-</div>
-{{template "base/footer" .}}
diff --git a/templates/org/settings.tmpl b/templates/org/settings.tmpl
deleted file mode 100644
index fd0d6a1c14..0000000000
--- a/templates/org/settings.tmpl
+++ /dev/null
@@ -1,130 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body-nav">
- <div class="container">
- <div class="btn-group pull-left" id="dashboard-switch">
- <button type="button" class="btn btn-default">
- <img src="{{.Org.AvatarLink}}?s=28" alt="user-avatar" title="username">
- {{.Org.Name}}
- </button>
- </div>
- <ul class="nav nav-pills pull-right">
- <li><a href="/org/{{.Org.Name}}/dashboard/">News Feed</a></li>
- <li><a href="/org/{{.Org.Name}}/dashboard/issues">Issues</a></li>
- <li class="active"><a href="/org/{{.Org.Name}}/settings">Settings</a></li>
- <!-- <li><a href="/pulls">Pull Requests</a></li>
- <li><a href="/stars">Stars</a></li> -->
- </ul>
- </div>
-</div>
-
-<div id="body" class="container" data-page="org">
- <div id="user-setting-nav" class="col-md-2 repo-setting-nav">
- <ul class="list-group">
- <li class="list-group-item active"><a href="#">Options</a></li>
- </ul>
- </div>
- <div id="repo-setting-container" class="col-md-10">
- {{template "base/alert" .}}
- <div class="panel panel-default">
- <div class="panel-heading">
- Organization Options
- </div>
-
- <div class="panel-body">
- <form action="/org/{{.Org.Name}}/settings" method="post" class="form-horizontal">
- {{.CsrfTokenHtml}}
- <input type="hidden" name="action" value="update">
-
- <div class="form-group{{if .Err_DisplayName}} has-error has-feedback{{end}}">
- <label class="col-md-3 text-right" for="org-setting-name">Display Name</label>
- <div class="col-md-9">
- <input class="form-control" name="display_name" value="{{.Org.FullName}}" title="" id="org-setting-name"/>
- </div>
- </div>
-
- <div class="form-group{{if .Err_Email}} has-error has-feedback{{end}}">
- <label class="col-md-3 text-right" for="org-email">Email</label>
- <div class="col-md-9">
- <input class="form-control" name="email" value="{{.Org.Email}}" title="" id="org-email" type="email"/>
- </div>
- </div>
-
- <div class="form-group{{if .Err_Description}} has-error has-feedback{{end}}">
- <label class="col-md-3 text-right" for="org-desc">Description</label>
- <div class="col-md-9">
- <textarea class="form-control" name="desc" id="org-desc" rows="3">{{.Org.Description}}</textarea>
- </div>
- </div>
-
- <div class="form-group{{if .Err_Website}} has-error has-feedback{{end}}">
- <label class="col-md-3 text-right" for="org-site">Official Site</label>
- <div class="col-md-9">
- <input type="url" class="form-control" name="site" value="{{.Org.Website}}" id="org-site"/>
- </div>
- </div>
-
- <div class="form-group{{if .Err_Location}} has-error has-feedback{{end}}">
- <label class="col-md-3 text-right" for="org-location">Location</label>
- <div class="col-md-9">
- <input class="form-control" name="location" value="{{.Org.Location}}" title="" id="org-location"/>
- </div>
- </div>
-
- <div class="form-group">
- <div class="col-md-9 col-md-offset-3">
- <button class="btn btn-primary" type="submit">Save Options</button>
- </div>
- </div>
- </form>
- </div>
- </div>
-
- <div class="panel panel-warning">
- <div class="panel-heading">
- Danger Zone
- </div>
- <div class="panel-body">
- <button type="button" class="btn btn-default pull-right" href="#delete-org-modal" data-toggle="modal">
- Delete this organization
- </button>
- <dd>
- <dt>Delete this organization</dt>
- <dl>Once you delete this organization and all repositories in, there is no going back. Please be
- certain.
- </dl>
- </dd>
-
- <div class="modal fade" id="delete-org-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
- aria-hidden="true">
- <div class="modal-dialog">
- <form action="/org/{{.Org.Name}}/settings/delete" method="post"
- class="modal-content">
- {{.CsrfTokenHtml}}
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal"
- aria-hidden="true">&times;</button>
- <h4 class="modal-title" id="myModalLabel">Delete organization</h4>
- </div>
-
- <div class="modal-body">
- <div class="form-group">
- <label>Make sure your are owner of this organization. Please enter your password.<strong class="text-danger">*</strong></label>
- <input name="password" class="form-control" type="password" placeholder="Type your account password" required="required">
- </div>
- </div>
-
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
- <button class="btn btn-danger btn-lg">I understand the consequences, delete this
- organization
- </button>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
-</div>
-{{template "base/footer" .}}
diff --git a/templates/org/settings/delete.tmpl b/templates/org/settings/delete.tmpl
new file mode 100644
index 0000000000..ea9853d919
--- /dev/null
+++ b/templates/org/settings/delete.tmpl
@@ -0,0 +1,29 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+{{template "org/base/header" .}}
+<div id="setting-wrapper" class="main-wrapper">
+ <div id="org-setting" class="container clear">
+ {{template "org/settings/nav" .}}
+ <div class="grid-4-5 left">
+ <div class="setting-content">
+ {{template "ng/base/alert" .}}
+ <div id="setting-content">
+ <div id="user-profile-setting-content" class="panel panel-warning panel-radius">
+ <p class="panel-header"><strong>{{.i18n.Tr "org.settings.delete_account"}}</strong></p>
+ <div class="panel-body panel-content">
+ <span class="alert alert-red alert-radius block"><i class="octicon octicon-alert"></i>{{.i18n.Tr "org.settings.delete_prompt" | Str2html}}</span>
+ <form action="/org/{{.Org.LowerName}}/settings/delete" method="post">
+ {{.CsrfTokenHtml}}
+ <p class="field">
+ <span class="form-label"></span>
+ <button class="btn btn-red btn-large btn-radius" id="delete-org-button">{{.i18n.Tr "org.settings.confirm_delete_account"}}</button>
+ </p>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/org/settings/nav.tmpl b/templates/org/settings/nav.tmpl
new file mode 100644
index 0000000000..950569d686
--- /dev/null
+++ b/templates/org/settings/nav.tmpl
@@ -0,0 +1,11 @@
+<div id="setting-menu" class="grid-1-5 panel panel-radius left">
+ <div class="panel-header">
+ <strong>{{.i18n.Tr "org.settings"}}</strong>
+ </div>
+ <div class="panel-body">
+ <ul class="menu menu-vertical switching-list grid-1-5 left">
+ <li {{if .PageIsSettingsOptions}}class="current"{{end}}><a href="/org/{{.Org.LowerName}}/settings">{{.i18n.Tr "org.settings.options"}}</a></li>
+ <li {{if .PageIsSettingsDelete}}class="current"{{end}}><a href="/org/{{.Org.LowerName}}/settings/delete">{{.i18n.Tr "org.settings.delete"}}</a></li>
+ </ul>
+ </div>
+</div> \ No newline at end of file
diff --git a/templates/org/settings/options.tmpl b/templates/org/settings/options.tmpl
new file mode 100644
index 0000000000..ae225a9ca4
--- /dev/null
+++ b/templates/org/settings/options.tmpl
@@ -0,0 +1,57 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+{{template "org/base/header" .}}
+<div id="setting-wrapper" class="main-wrapper">
+ <div id="org-setting" class="container clear">
+ {{template "org/settings/nav" .}}
+ <div class="grid-4-5 left">
+ <div class="setting-content">
+ {{template "ng/base/alert" .}}
+ <div id="setting-content">
+ <div id="user-profile-setting-content" class="panel panel-radius">
+ <div class="panel-header">
+ <strong>{{.i18n.Tr "org.settings.options"}}</strong>
+ </div>
+ <form class="form form-align panel-body" id="org-setting-form" action="/org/{{.Org.LowerName}}/settings" method="post">
+ {{.CsrfTokenHtml}}
+ <input type="hidden" name="action" value="update">
+ <div class="field">
+ <label class="req" for="orgname">{{.i18n.Tr "username"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_UserName}}ipt-error{{end}}" id="orgname" name="uname" value="{{.Org.Name}}" data-orgname="{{.Org.Name}}" required />
+ </div>
+ <div class="field">
+ <label for="full-name">{{.i18n.Tr "org.settings.full_name"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_FullName}}ipt-error{{end}}" id="full-name" name="fullname" value="{{.Org.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="{{.Org.Email}}" required />
+ </div>
+ <div class="field clear">
+ <label class="left" for="desc">{{.i18n.Tr "org.org_desc"}}</label>
+ <textarea class="ipt ipt-large ipt-radius {{if .Err_Description}}ipt-error{{end}}" id="desc" name="desc">{{.Org.Description}}</textarea>
+ </div>
+ <div class="field">
+ <label for="website">{{.i18n.Tr "org.settings.website"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_Website}}ipt-error{{end}}" id="website" name="website" type="url" value="{{.Org.Website}}" />
+ </div>
+ <div class="field">
+ <label for="location">{{.i18n.Tr "org.settings.location"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_Location}}ipt-error{{end}}" id="location" name="location" type="text" value="{{.Org.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="{{.Org.AvatarEmail}}" />
+ </div>
+ <div class="field">
+ <span class="form-label"></span>
+ <button class="btn btn-green btn-large btn-radius">{{.i18n.Tr "org.settings.update_settings"}}</button>
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/org/team/members.tmpl b/templates/org/team/members.tmpl
new file mode 100644
index 0000000000..d3176be152
--- /dev/null
+++ b/templates/org/team/members.tmpl
@@ -0,0 +1,45 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+{{template "org/base/header" .}}
+<div id="setting-wrapper" class="main-wrapper">
+ <div id="team-members-list" class="container clear">
+ {{template "ng/base/alert" .}}
+ {{template "org/team/sidebar" .}}
+ <div class="grid-2-3 left">
+ <div class="setting-content">
+ <div class="panel panel-radius">
+ <div class="panel-header">
+ {{.i18n.Tr "org.teams.members"}}
+ </div>
+ <ul class="panel-body setting-list" id="team-members-list">
+ {{if .IsOrganizationOwner}}
+ <li class="search">
+ <form class="form form-align" action="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/action/add" id="repo-collab-form">
+ {{.CsrfTokenHtml}}
+ <input type="hidden" name="uid" value="{{.SignedUser.Id}}">
+ <input class="ipt ipt-large ipt-radius" id="org-team-members-add" name="uname" autocomplete="off" required />
+ <button class="btn btn-blue btn-large btn-radius">{{.i18n.Tr "org.teams.add_team_member"}}</button>
+ <div class="repo-user-list-block">
+ <ul class="menu-down-show menu-vertical menu-radius switching-list user-list" id="org-team-members-list"></ul>
+ </div>
+ </form>
+ </li>
+ {{end}}
+ {{range .Team.Members}}
+ <li class="collab">
+ {{if $.IsOrganizationOwner}}
+ <a class="btn btn-small btn-red btn-radius right" href="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/action/remove?uid={{.Id}}">{{$.i18n.Tr "org.members.remove"}}</a>
+ {{end}}
+ <a class="member" href="/{{.Name}}">
+ <img alt="{{.Name}}" class="pull-left avatar" src="{{.AvatarLink}}">
+ <strong>{{.FullName}}</strong> ({{.Name}})
+ </a>
+ </li>
+ {{end}}
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/org/team/new.tmpl b/templates/org/team/new.tmpl
new file mode 100644
index 0000000000..f9632fcfd4
--- /dev/null
+++ b/templates/org/team/new.tmpl
@@ -0,0 +1,63 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+{{template "org/base/header" .}}
+<div id="repo-wrapper">
+ <form id="team-create-form" class="form form-align panel panel-radius" action="{{if .PageIsOrgTeamsNew}}{{.OrgLink}}/teams/new{{else}}{{.OrgLink}}/teams/{{.Team.LowerName}}/edit{{end}}" data-delete-url="{{.OrgLink}}/teams/{{.Team.LowerName}}/delete" method="post">
+ {{.CsrfTokenHtml}}
+ <div class="panel-header">
+ <h2>
+ {{if .PageIsOrgTeamsNew}}{{.i18n.Tr "org.create_new_team"}}{{else}}{{.i18n.Tr "org.teams.settings"}}{{end}}
+ </h2>
+ </div>
+ <div class="panel-content">
+ {{template "ng/base/alert" .}}
+ <div class="field">
+ <label class="req" for="team-name">{{.i18n.Tr "org.team_name"}}</label>
+ {{if eq .Team.LowerName "owners"}}
+ <input type="hidden" name="team_name" value="{{.team_name}}">
+ {{end}}
+ <input class="ipt ipt-large ipt-radius {{if .Err_TeamName}}ipt-error{{end}}" id="team-name" name="team_name" value="{{.team_name}}" required {{if eq .Team.LowerName "owners"}}disabled{{end}} />
+ <span class="form-label"></span>
+ <span class="help">{{.i18n.Tr "org.team_name_helper"}}</span>
+ </div>
+ <div class="field">
+ <label for="desc">{{.i18n.Tr "org.team_desc"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_Description}}ipt-error{{end}}" id="desc" name="desc" value="{{.desc}}" />
+ <span class="form-label"></span>
+ <span class="help">{{.i18n.Tr "org.team_desc_helper"}}</span>
+ </div>
+ {{if not (eq .Team.LowerName "owners")}}
+ <div class="field">
+ <h4 class="text-center">{{.i18n.Tr "org.team_permission_desc"}}</h4>
+ <label></label>
+ <input name="permission" type="radio" value="read" {{if or .PageIsOrgTeamsNew (eq .Team.Authorize 1)}}checked{{end}}> {{.i18n.Tr "org.teams.read_access"}}
+ <label></label>
+ <p class="text-grey note">{{.i18n.Tr "org.teams.read_access_helper"}}</p>
+ <label></label>
+ <input name="permission" type="radio" value="write" {{if eq .Team.Authorize 2}}checked{{end}}> {{.i18n.Tr "org.teams.write_access"}}
+ <label></label>
+ <p class="text-grey note">{{.i18n.Tr "org.teams.write_access_helper"}}</p>
+ <label></label>
+ <input name="permission" type="radio" value="admin" {{if eq .Team.Authorize 3}}checked{{end}}> {{.i18n.Tr "org.teams.admin_access"}}
+ <label></label>
+ <p class="text-grey note">{{.i18n.Tr "org.teams.admin_access_helper"}}</p>
+ </div>
+ <hr>
+ {{end}}
+ <div class="field">
+ <label></label>
+ {{if .PageIsOrgTeamsNew}}
+ <button class="btn btn-large btn-blue btn-radius">{{.i18n.Tr "org.create_new_team"}}</button>
+ <a class="btn btn-small btn-gray btn-radius" id="repo-create-cancel" href="{{.OrgLink}}/teams"><strong>{{.i18n.Tr "cancel"}}</strong></a>
+ {{else}}
+ <button class="btn btn-large btn-green btn-radius">{{.i18n.Tr "org.teams.update_settings"}}</button>
+ {{if not (eq .Team.LowerName "owners")}}
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ <button class="btn btn-large btn-red btn-radius" id="org-team-delete">{{.i18n.Tr "org.teams.delete_team"}}</button>
+ {{end}}
+ {{end}}
+ </div>
+ </div>
+ </form>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/org/team/repositories.tmpl b/templates/org/team/repositories.tmpl
new file mode 100644
index 0000000000..0a3f771068
--- /dev/null
+++ b/templates/org/team/repositories.tmpl
@@ -0,0 +1,45 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+{{template "org/base/header" .}}
+<div id="setting-wrapper" class="main-wrapper">
+ <div id="team-members-list" class="container clear">
+ {{template "ng/base/alert" .}}
+ {{template "org/team/sidebar" .}}
+ <div class="grid-2-3 left">
+ <div class="setting-content">
+ <div class="panel panel-radius">
+ <div class="panel-header">
+ {{.i18n.Tr "org.teams.repositories"}}
+ </div>
+ {{$canAddRemove := and $.IsOrganizationOwner (not (eq $.Team.LowerName "owners"))}}
+ <ul class="panel-body setting-list" id="team-repositories-list">
+ {{if $canAddRemove}}
+ <li class="search">
+ <form class="form form-align" action="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/action/repo/add" id="repo-collab-form">
+ {{.CsrfTokenHtml}}
+ <input class="ipt ipt-large ipt-radius" id="org-team-repositories-add" name="repo-name" autocomplete="off" data-uid="{{.Org.Id}}" required />
+ <button class="btn btn-blue btn-large btn-radius">{{.i18n.Tr "org.teams.add_team_repository"}}</button>
+ <div class="repo-user-list-block">
+ <ul class="menu-down-show menu-vertical menu-radius switching-list user-list" id="org-team-repositories-list"></ul>
+ </div>
+ </form>
+ </li>
+ {{end}}
+ {{range .Team.Repos}}
+ <li class="collab">
+ {{if $canAddRemove}}
+ <a class="btn btn-small btn-red btn-radius right" href="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/action/repo/remove?repoid={{.Id}}">{{$.i18n.Tr "org.teams.remove_repo"}}</a>
+ {{end}}
+ <a class="member" href="/{{$.Org.Name}}/{{.Name}}">
+ <i class="octicon octicon-{{if .IsPrivate}}lock{{else if .IsFork}}repo-forked{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i>
+ <strong>{{$.Org.Name}}/{{.Name}}</strong>
+ </a>
+ </li>
+ {{end}}
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/org/team/sidebar.tmpl b/templates/org/team/sidebar.tmpl
new file mode 100644
index 0000000000..2015884f45
--- /dev/null
+++ b/templates/org/team/sidebar.tmpl
@@ -0,0 +1,34 @@
+<div class="grid-1-3 panel panel-radius left" id="org-team-card">
+ <div class="panel-header">
+ {{if .Team.IsMember $.SignedUser.Id}}
+ <a class="btn btn-small btn-red btn-header btn-radius right" href="{{.OrgLink}}/teams/{{.Team.LowerName}}/action/leave?uid={{$.SignedUser.Id}}&page=team">{{$.i18n.Tr "org.teams.leave"}}</a>
+ {{else if .IsOrganizationOwner}}
+ <a class="btn btn-small btn-blue btn-header btn-radius right" href="{{.OrgLink}}/teams/{{.Team.LowerName}}/action/join?uid={{$.SignedUser.Id}}&page=team">{{$.i18n.Tr "org.teams.join"}}</a>
+ {{end}}
+ <strong>{{.Team.Name}}</strong>
+ </div>
+ <div class="panel-body">
+ <p class="desc">{{if .Team.Description}}{{.Team.Description}}{{else}}{{.i18n.Tr "org.teams.no_desc"}}{{end}}</p>
+ <hr>
+ <div class="team-stats">
+ <a class="text-black" href="{{.OrgLink}}/teams/{{.Team.LowerName}}"><span class="octicon octicon-person"></span> <strong>{{.Team.NumMembers}}</strong> {{$.i18n.Tr "org.lower_members"}}</a> ·
+ <a class="text-black" href="{{.OrgLink}}/teams/{{.Team.LowerName}}/repositories"><span class="octicon octicon-repo"></span> <strong>{{.Team.NumRepos}}</strong> {{$.i18n.Tr "org.lower_repositories"}}</a>
+ </div>
+ <p class="desc">
+ {{if eq .Team.LowerName "owners"}}
+ {{.i18n.Tr "org.teams.owners_permission_desc" | Str2html}}
+ {{else if (eq .Team.Authorize 1)}}
+ {{.i18n.Tr "org.teams.read_permission_desc" | Str2html}}
+ {{else if (eq .Team.Authorize 2)}}
+ {{.i18n.Tr "org.teams.write_permission_desc" | Str2html}}
+ {{else if (eq .Team.Authorize 3)}}
+ {{.i18n.Tr "org.teams.admin_permission_desc" | Str2html}}
+ {{end}}
+ </p>
+ </div>
+ {{if .IsOrganizationOwner}}
+ <div class="panel-footer">
+ <a class="btn btn-medium btn-green btn-link btn-radius" href="{{.OrgLink}}/teams/{{.Team.LowerName}}/edit"><span class="octicon octicon-gear"></span> {{$.i18n.Tr "org.teams.settings"}}</a>
+ </div>
+ {{end}}
+</div> \ No newline at end of file
diff --git a/templates/org/team/teams.tmpl b/templates/org/team/teams.tmpl
new file mode 100644
index 0000000000..9c47cb5a41
--- /dev/null
+++ b/templates/org/team/teams.tmpl
@@ -0,0 +1,42 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+{{template "org/base/header" .}}
+<div class="container">
+ <div class="org-header-alert">
+ {{template "ng/base/alert" .}}
+ </div>
+ <div class="org-toolbar clear">
+ {{if .IsOrganizationOwner}}
+ <a class="btn btn-green btn-large btn-link btn-radius right" href="{{.OrgLink}}/teams/new"><i class="octicon octicon-repo-create"></i> {{.i18n.Tr "org.create_new_team"}}</a>
+ {{end}}
+ </div>
+ <div class="org-team-list">
+ {{range .Teams}}
+ <div class="org-team-list-item">
+ <div class="panel panel-radius">
+ <div class="panel-header">
+ {{if .IsMember $.SignedUser.Id}}
+ <a class="btn btn-small btn-red btn-header btn-radius right" href="{{$.OrgLink}}/teams/{{.LowerName}}/action/leave?uid={{$.SignedUser.Id}}">{{$.i18n.Tr "org.teams.leave"}}</a>
+ {{else if $.IsOrganizationOwner}}
+ <a class="btn btn-small btn-blue btn-header btn-radius right" href="{{$.OrgLink}}/teams/{{.LowerName}}/action/join?uid={{$.SignedUser.Id}}">{{$.i18n.Tr "org.teams.join"}}</a>
+ {{end}}
+ <a class="text-black" href="{{$.OrgLink}}/teams/{{.LowerName}}"><strong>{{.Name}}</strong></a>
+ </div>
+ {{if .NumMembers}}
+ <div class="panel-body member-avatar-group">
+ {{range .Members}}
+ <a href="/{{.Name}}" title="{{.Name}}">
+ <img src="{{.AvatarLink}}">
+ </a>
+ {{end}}
+ </div>
+ {{end}}
+ <div class="panel-footer">
+ <p class="team-meta">{{.NumMembers}} {{$.i18n.Tr "org.lower_members"}} · {{.NumRepos}} {{$.i18n.Tr "org.lower_repositories"}}</p>
+ </div>
+ </div>
+ </div>
+ {{end}}
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/org/team_new.tmpl b/templates/org/team_new.tmpl
deleted file mode 100644
index 0936ec29b3..0000000000
--- a/templates/org/team_new.tmpl
+++ /dev/null
@@ -1,79 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body-nav" class="org-nav org-nav-auto">
- <div class="container clearfix">
- <div id="org-nav-wrapper">
- <ul class="nav nav-pills pull-right">
- <li><a href="/org/{{.Org.Name}}/members"><i class="fa fa-users"></i>Members
- <span class="label label-default">{{.Org.NumMembers}}</span></a>
- </li>
- <li class="active"><a href="/org/{{.Org.Name}}/teams"><i class="fa fa-tags"></i>Teams
- <span class="label label-default">{{.Org.NumTeams}}</span></a>
- </li>
- </ul>
- <img class="pull-left org-small-logo" src="{{.Org.AvatarLink}}?s=140" alt="" width="60"/>
- <div id="org-nav-info">
- <h2 class="org-name">{{.Org.FullName}}</h2>
- </div>
- </div>
- </div>
-</div>
-
-<div id="body" class="container">
- <div id="org">
- <form action="/org/{{.Org.Name}}/teams/new" method="post" id="org-teams-create" class="form-horizontal card">
- {{.CsrfTokenHtml}}
- <h3>Create new team</h3>
- {{template "base/alert" .}}
- <div class="form-group{{if .Err_TeamName}} has-error has-feedback{{end}}">
- <label class="col-md-2 control-label">Team Name<strong class="text-danger">*</strong></label>
- <div class="col-md-8">
- <input name="name" type="text" class="form-control" placeholder="Type your team name" value="{{.name}}" required="required">
- <span class="help-block">You'll use this name to mention this team in conversations.</span>
- </div>
- </div>
-
- <div class="form-group{{if .Err_Description}} has-error has-feedback{{end}}">
- <label class="col-md-2 control-label">Description</label>
- <div class="col-md-8">
- <input name="desc" type="text" class="form-control" placeholder="Type your team description (optional)" value="{{.desc}}">
- </div>
- </div>
-
- <div class="form-group{{if .Err_Permission}} has-error has-feedback{{end}}">
- <label class="col-md-2 control-label">Permission</label>
- <div class="col-md-8">
- <div class="radio">
- <label>
- <input type="radio" name="permission" value="read" checked="">
- <strong>Read Access</strong>
- </label>
- <p>This team will be able to view and clone its repositories.</p>
- </div>
- <div class="radio">
- <label>
- <input type="radio" name="permission" value="write">
- <strong>Write Access</strong>
- </label>
- <p>This team will be able to read its repositories, as well as push to them.</p>
- </div>
- <div class="radio">
- <label>
- <input type="radio" name="permission" value="admin">
- <strong>Admin Access</strong>
- </label>
- <p>This team will be able to push/pull to its repositories, as well as add other collaborators to them.</p>
- </div>
- </div>
- </div>
- <hr/>
- <div class="form-group">
- <label class="col-md-2">&nbsp;</label>
- <div class="col-md-8">
- <button class="btn btn-primary">Create team</button>
- </div>
- </div>
- </form>
- </div>
-</div>
-{{template "base/footer" .}}
diff --git a/templates/org/teams.tmpl b/templates/org/teams.tmpl
deleted file mode 100644
index decfecf598..0000000000
--- a/templates/org/teams.tmpl
+++ /dev/null
@@ -1,58 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body-nav" class="org-nav org-nav-auto">
- <div class="container clearfix">
- <div id="org-nav-wrapper">
- <ul class="nav nav-pills pull-right">
- <li><a href="/org/{{.Org.Name}}/members"><i class="fa fa-users"></i>Members
- <span class="label label-default">{{.Org.NumMembers}}</span></a>
- </li>
- <li class="active"><a href="/org/{{.Org.Name}}/teams"><i class="fa fa-tags"></i>Teams
- <span class="label label-default">{{.Org.NumTeams}}</span></a>
- </li>
- </ul>
- <img class="pull-left org-small-logo" src="{{.Org.AvatarLink}}?s=140" alt="" width="60"/>
- <div id="org-nav-info">
- <h2 class="org-name">{{.Org.FullName}}</h2>
- </div>
- </div>
- </div>
-</div>
-
-<div id="body" class="container">
- <div id="org">
- <div id="org-teams">
- <div id="org-teams-action">
- <div class="col-md-12">
- <a href="/org/{{.Org.Name}}/teams/new"><button class="btn btn-success"><i class="fa fa-plus-square"></i>New Team</button></a>
- <hr/>
- </div>
- </div>
- {{range .Teams}}
- <div class="org-team col-md-6">
- <div class="panel panel-default">
- <h2 class="panel-heading org-team-name"><a href="/org/{{$.Org.Name}}/teams/{{.LowerName}}"><strong>{{.Name}}</strong></a></h2>
- <div class="panel-body">
- <p class="org-team-meta">{{.NumMembers}} members · {{.NumRepos}} repositories</p>
- <p class="org-team-members">
- {{range .Members}}
- <a href="/user/{{.LowerName}}">
- <img class="img-thumbnail" src="{{.AvatarLink}}?s=60" alt=""/>
- </a>
- {{end}}
- </p>
- </div>
- <div class="panel-footer">
- {{if .IsMember $.SignedUserId}}
- <a class="pull-right btn btn-danger" href="/org/{{$.Org.Name}}/teams/{{.LowerName}}?action=leave">Leave</a>
- {{else}}
- <a class="pull-right btn btn-default" href="/org/{{$.Org.Name}}/teams/{{.LowerName}}?action=join">Join</a>
- {{end}}
- </div>
- </div>
- </div>
- {{end}}
- </div>
- </div>
-</div>
-{{template "base/footer" .}}
diff --git a/templates/repo/bare.tmpl b/templates/repo/bare.tmpl
new file mode 100644
index 0000000000..5b943bad63
--- /dev/null
+++ b/templates/repo/bare.tmpl
@@ -0,0 +1,53 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="repo-wrapper" class="repo-bare">
+ <div id="repo-header" class="clear">
+ <div class="container clear">
+ <h1 id="repo-header-name" class="left public">
+ <i class="mega-octicon octicon-{{if .Repository.IsPrivate}}lock{{else}}repo{{end}}"></i>
+ <a class="author" href="/{{.Repository.Owner.Name}}">{{.Repository.Owner.Name}}</a>
+ <span class="divider">/</span>
+ <a class="repo text-bold" href="{{.RepoLink}}">{{.Repository.Name}}</a>
+ </h1>
+ </div>
+ </div>
+ <div id="repo-content" class="clear container">
+ <div id="repo-bare">
+ <div id="repo-bare-start" class="panel panel-radius">
+ <div class="panel-header">
+ <a class="btn btn-small btn-black btn-header btn-radius right" href="{{.RepoLink}}/settings">{{.i18n.Tr "repo.settings"}}</a>
+ <strong>Quick Start</strong>
+ </div>
+ <div class="panel-content">
+ <div id="repo-clone" class="clear text-center">
+ <h2>Clone this repository</h2>
+ <button id="repo-clone-ssh" class="btn btn-blue current left btn-left-radius">SSH</button>
+ <button id="repo-clone-https" class="btn btn-gray left">HTTPS</button>
+ <input id="repo-clone-url" type="text" class="ipt ipt-disabled left" value="{{.CloneLink.SSH}}" />
+ <button id="repo-clone-copy" class="btn btn-black left btn-right-radius">Copy</button>
+ <p class="text-center" id="repo-clone-help">Need help cloning? Visit <a href="#">Help</a>!</p>
+ <hr/>
+ </div>
+ <div id="repo-bare-cmd" class="text-center">
+ <h2>Create a new repository on the command line</h2>
+ <pre class="text-left radius"><code>touch README.md
+git init
+git add README.md
+git commit -m "first commit"
+git remote add origin <span class="clone-url">{{.CloneLink.SSH}}</span>
+git push -u origin master</code></pre>
+ <br/>
+ <hr/>
+ </div>
+ <div id="repo-bare-remote" class="text-center">
+ <h2>Push an existing repository from the command line</h2>
+ <pre class="text-left radius"><code>git remote add origin <span class="clone-url">{{.CloneLink.SSH}}</span>
+git push -u origin master</code></pre>
+ <br/>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/repo/collaboration.tmpl b/templates/repo/collaboration.tmpl
deleted file mode 100644
index 564c99eca2..0000000000
--- a/templates/repo/collaboration.tmpl
+++ /dev/null
@@ -1,47 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-{{template "repo/nav" .}}
-{{template "repo/toolbar" .}}
-<div id="body" class="container">
- {{template "repo/setting_nav" .}}
- <div id="repo-setting-container" class="col-md-10">
- {{template "base/alert" .}}
- <div class="panel panel-default">
- <div class="panel-heading">
- Collaborators
- </div>
-
- <div class="panel-body">
- <ul id="repo-collab-list" class="list-unstyled">
- {{range .Collaborators}}
- <li class="collab">
- {{if not (eq .LowerName $.Owner.LowerName)}}<a href="{{$.RepoLink}}/settings/collaboration?remove={{.Name}}" class="remove-collab pull-right"><i class="fa fa-times"></i></a>{{end}}
- <a class="member" href="/user/{{.Name}}">
- <img alt="{{.Name}}" class="pull-left avatar" src="{{.AvatarLink}}">
- <strong class="access-member-fullname">{{.FullName}}</strong><br/>
- {{.Name}}
- </a>
- </li>
- {{end}}
- </ul>
- </div>
-
- <div class="panel-footer">
- <form action="{{.RepoLink}}/settings/collaboration" method="post" class="form-horizontal" id="repo-collab-form">
- {{.CsrfTokenHtml}}
- <div class="form-group" style="margin-bottom: 0">
- <div class="col-md-4">
- <input type="text" name="collaborator" class="form-control dropdown-toggle" id="repo-collaborator" autocomplete="off" required="required" data-toggle="dropdown"/>
- <div class="dropdown-menu">
- <ul class="list-unstyled"></ul>
- </div>
- </div>
- <button class="col-md-2 btn btn-primary">Add collaborator</button>
- </div>
- </form>
- </div>
- </div>
-
- </div>
-</div>
-{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/repo/commits.tmpl b/templates/repo/commits.tmpl
index 385f9d5bae..420e973a50 100644
--- a/templates/repo/commits.tmpl
+++ b/templates/repo/commits.tmpl
@@ -34,7 +34,7 @@
<td class="author"><img class="avatar" src="{{AvatarLink .Author.Email}}" alt=""/><a href="/user/email2user?email={{.Author.Email}}">{{.Author.Name}}</a></td>
<td class="sha"><a rel="nofollow" class="label label-success" href="/{{$username}}/{{$reponame}}/commit/{{.Id}} ">{{SubStr .Id.String 0 10}} </a></td>
<td class="message">{{.Summary}} </td>
- <td class="date">{{TimeSince .Author.When}}</td>
+ <td class="date">{{TimeSince .Author.When $.Lang}}</td>
</tr>
{{end}}
</tbody>
diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl
index ed01d9772b..6baa6d31e0 100644
--- a/templates/repo/create.tmpl
+++ b/templates/repo/create.tmpl
@@ -1,105 +1,83 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div class="container" id="body">
- <form action="/repo/create" method="post" class="form-horizontal card" id="repo-create">
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="repo-wrapper">
+ <form id="repo-create-form" class="form form-align panel panel-radius" action="/repo/create" method="post">
{{.CsrfTokenHtml}}
- <h3>Create New Repository</h3>
- {{template "base/alert" .}}
- <div class="form-group">
- <label class="col-md-2 control-label">Owner<strong class="text-danger">*</strong></label>
- <div class="col-md-8">
- <div class="btn-group" id="repo-owner-switch">
- <button type="button" class="btn btn-default" id="repo-owner-current">
- <img src="{{.ContextUser.AvatarLink}}?s=28" alt="user-avatar" title="username" id="repo-owner-avatar">
- <span id="repo-owner-name">{{.ContextUser.Name}}</span>
- </button>
- <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
- <span class="caret"></span>
- </button>
- <div class="dropdown-menu clone-group-btn no-propagation">
- <ul id="dashboard-switch-menu" class="list-unstyled">
- {{range .AllUsers}}
- <li data-uid="{{.Id}}"{{if eq .Id $.ContextUser.Id}}class="checked"{{end}}>
- <a>
- <i class="fa fa-check"></i>
- <img src="{{.AvatarLink}}?s=28" alt="user-avatar" title="username">
- {{.Name}}
- </a>
- </li>
- {{end}}
- </ul>
- </div>
+ <div class="panel-header">
+ <h2>{{.i18n.Tr "new_repo"}}</h2>
+ </div>
+ <div class="panel-content">
+ {{template "ng/base/alert" .}}
+ <div class="field">
+ <label for="owner" class="req">{{.i18n.Tr "repo.owner"}}</label>
+ <input id="repo-owner-id" type="hidden" name="uid" value="{{.ContextUser.Id}}" />
+ <div class="inline-block drop">
+ <a class="drop-bottom">
+ <img class="avatar" src="{{.ContextUser.AvatarLink}}" id="repo-owner-avatar" alt="user-avatar">
+ <strong id="repo-owner-name">{{.ContextUser.Name}}</strong>
+ </a>
+ <ul class="drop-down menu menu-vertical menu-radius switching-list" id="repo-create-owner-list">
+ <li {{if eq $.ContextUser.Id .SignedUser.Id}}class="checked"{{end}} data-uid="{{.SignedUser.Id}}">
+ <a>
+ <i class="octicon octicon-check"></i>
+ <img class="avatar" src="{{.SignedUser.AvatarLink}}" alt="user-avatar">
+ <strong>{{.SignedUser.Name}}</strong>
+ </a>
+ </li>
+ {{range .Orgs}}
+ <li {{if eq $.ContextUser.Id .Id}}class="checked"{{end}} data-uid="{{.Id}}">
+ <a>
+ <i class="octicon octicon-check"></i>
+ <img class="avatar" src="{{.AvatarLink}}" alt="user-avatar">
+ <strong>{{.Name}}</strong>
+ </a>
+ </li>
+ {{end}}
+ </ul>
</div>
</div>
- <input type="hidden" value="{{.ContextUser.Id}}" name="uid" id="repo-owner-id"/>
- </div>
-
- <div class="form-group {{if .Err_RepoName}}has-error has-feedback{{end}}">
- <label class="col-md-2 control-label">Repository<strong class="text-danger">*</strong></label>
- <div class="col-md-8">
- <input name="repo" type="text" class="form-control" placeholder="Type your repository name" value="{{.repo}}" required="required">
- <span class="help-block">Great repository names are short and memorable. </span>
+ <div class="field">
+ <label class="req" for="repo-name">{{.i18n.Tr "repo.repo_name"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_RepoName}}ipt-error{{end}}" id="repo-name" name="repo_name" type="text" value="{{.repo_name}}" required />
+ <span class="form-label"></span>
+ <span class="help">{{.i18n.Tr "repo.repo_name_helper" | Str2html}}</span>
</div>
- </div>
-
- <div class="form-group">
- <label class="col-md-2 control-label">Visibility</label>
- <div class="col-md-8">
- <div class="checkbox">
- <label>
- <input type="checkbox" name="private" {{if .private}}checked{{end}}>
- <strong>This repository is private</strong>
- </label>
- </div>
+ <div class="field">
+ <label for="visibility">{{.i18n.Tr "repo.visibility"}}</label>
+ <input class="ipt-chk" id="visibility" name="private" type="checkbox" {{if .private}}checked{{end}} />
+ <span>{{.i18n.Tr "repo.visiblity_helper" | Str2html}}</span>
</div>
- </div>
-
- <div class="form-group {{if .Err_Description}}has-error has-feedback{{end}}">
- <label class="col-md-2 control-label">Description</label>
- <div class="col-md-8">
- <textarea name="desc" class="form-control" placeholder="Type your repository description">{{.desc}}</textarea>
+ <div class="field clear">
+ <label class="left" for="desc">{{.i18n.Tr "repo.repo_desc"}}</label>
+ <textarea class="ipt ipt-large ipt-radius {{if .Err_Description}}ipt-error{{end}}" id="desc" name="desc">{{.desc}}</textarea>
</div>
- </div>
-
- <div class="form-group">
- <label class="col-md-2 control-label">Language</label>
- <div class="col-md-8">
- <select class="form-control" name="language">
- <option value="">Select a language</option>
- {{range .LanguageIgns}}<option value="{{.}}">{{.}}</option>{{end}}
+ <div class="field">
+ <label for="lang">{{.i18n.Tr "repo.repo_lang"}}</label>
+ <select id="lang" name="gitignore">
+ <option>{{.i18n.Tr "repo.repo_lang_helper"}}</option>
+ {{range .Gitignores}}
+ <option value="{{.}}" {{if eq . $.gitignore}}selected{{end}}>{{.}}</option>
+ {{end}}
</select>
- <br>
- <div>Need more .gitignore? Go <a href="http://www.gitignore.io/">gitignore.io</a>.</div>
- </div>
- </div>
-
- <div class="form-group">
- <label class="col-md-2 control-label">License</label>
- <div class="col-md-8">
- <select class="form-control" name="license">
- <option value="">Select a license</option>
- {{range .Licenses}}<option value="{{.}}">{{.}}</option>{{end}}
+ <label for="license">{{.i18n.Tr "repo.license"}}</label>
+ <select id="license" name="license">
+ <option>{{.i18n.Tr "repo.license_helper"}}</option>
+ {{range .Licenses}}
+ <option value="{{.}}" {{if eq . $.license}}selected{{end}}>{{.}}</option>
+ {{end}}
</select>
</div>
- </div>
-
- <div class="form-group">
- <div class="col-md-8 col-md-offset-2">
- <div class="checkbox">
- <label>
- <input type="checkbox" name="initReadme" {{if .initReadme}}checked{{end}}>
- <strong>Initialize this repository with a README</strong>
- </label>
- </div>
+ <div class="field">
+ <label for="init-readme"></label>
+ <input class="ipt-chk" id="init-readme" name="init_readme" type="checkbox" {{if .init_readme}}checked{{end}} />
+ <strong>{{.i18n.Tr "repo.init_readme"}}</strong>
</div>
- </div>
-
- <div class="form-group">
- <div class="col-md-offset-2 col-md-8">
- <button type="submit" class="btn btn-lg btn-primary">Create repository</button>
- <a href="/" class="text-danger">Cancel</a>
+ <div class="field">
+ <label></label>
+ <button class="btn btn-large btn-blue btn-radius">{{.i18n.Tr "repo.create_repo"}}</button>
+ <a class="btn btn-small btn-gray btn-radius" id="repo-create-cancel" href="/"><strong>{{.i18n.Tr "cancel"}}</strong></a>
</div>
</div>
</form>
</div>
-{{template "base/footer" .}} \ No newline at end of file
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/repo/diff.tmpl b/templates/repo/diff.tmpl
index c85caa21ec..6adea04593 100644
--- a/templates/repo/diff.tmpl
+++ b/templates/repo/diff.tmpl
@@ -20,7 +20,7 @@
<p class="author">
<img class="avatar" src="{{AvatarLink .Commit.Author.Email}}" alt=""/>
<a class="name" href="/user/email2user?email={{.Commit.Author.Email}}"><strong>{{.Commit.Author.Name}}</strong></a>
- <span class="time">{{TimeSince .Commit.Author.When}}</span>
+ <span class="time">{{TimeSince .Commit.Author.When $.Lang}}</span>
</p>
</div>
</div>
diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl
new file mode 100644
index 0000000000..31259f056d
--- /dev/null
+++ b/templates/repo/header.tmpl
@@ -0,0 +1,57 @@
+<div id="repo-header" class="clear">
+ <div class="container clear">
+ <h1 id="repo-header-name" class="left public">
+ <i class="mega-octicon octicon-{{if .Repository.IsPrivate}}lock{{else if .Repository.IsMirror}}repo-clone{{else}}repo{{end}}"></i>
+ <a class="author" href="/{{.Owner.Name}}">{{.Owner.Name}}</a>
+ <span class="divider">/</span>
+ <a class="repo text-bold" href="{{.RepoLink}}">{{.Repository.Name}}</a>
+ {{if .Repository.IsMirror}}<span class="label label-gray">{{.i18n.Tr "mirror"}}</span>{{end}}
+ </h1>
+ <ul id="repo-header-meta" class="right menu menu-line">
+ <li id="repo-header-download" class="inline-block down drop">
+ <a id="repo-header-download-btn" href="#">
+ <button class="btn btn-black text-bold btn-radius">
+ <i class="octicon octicon-cloud-download"></i>
+ </button>
+ </a>
+ <div id="repo-header-download-drop" class="drop-down">
+ <div id="repo-clone" class="clear">
+ <button id="repo-clone-ssh" class="btn btn-blue current left left btn-left-radius">SSH</button>
+ <button id="repo-clone-https" class="btn btn-gray left">HTTPS</button>
+ <input id="repo-clone-url" type="text" class="ipt ipt-disabled left" value="{{.CloneLink.SSH}}" />
+ <button id="repo-clone-copy" class="btn btn-black left btn-right-radius">Copy</button>
+ <p class="text-center" id="repo-clone-help">{{.i18n.Tr "repo.clone_helper" | Str2html}}</p>
+ <hr/>
+ <div class="text-center" id="repo-clone-zip">
+ <a class="btn btn-green btn-radius" href="{{.RepoLink}}/archive/{{.BranchName}}.zip"><i class="octicon octicon-file-zip"></i>ZIP</a>
+ <a class="btn btn-green btn-radius" href="{{.RepoLink}}/archive/{{.BranchName}}.tar.gz"><i class="octicon octicon-file-zip"></i>TAR.GZ</a>
+ </div>
+ </div>
+ </div>
+ </li>
+ <li id="repo-header-watch">
+ <a id="repo-header-watch-btn" href="{{.RepoLink}}/action/{{if .IsWatchingRepo}}un{{end}}watch">
+ <button class="btn btn-gray text-bold btn-radius">
+ <i class="octicon octicon-eye-watch"></i>{{if .IsWatchingRepo}}{{.i18n.Tr "repo.unwatch"}}{{else}}{{.i18n.Tr "repo.watch"}}{{end}}<span class="num">{{.Repository.NumWatches}}</span>
+ </button>
+ </a>
+ </li>
+ <li id="repo-header-star">
+ <a id="repo-header-star-btn" href="{{.RepoLink}}/action/{{if .IsStaringRepo}}un{{end}}star">
+ <button class="btn btn-gray text-bold btn-radius">
+ <i class="octicon octicon-star"></i>{{if .IsStaringRepo}}{{.i18n.Tr "repo.unstar"}}{{else}}{{.i18n.Tr "repo.star"}}{{end}}
+ <span class="num">{{.Repository.NumStars}}</span>
+ </button>
+ </a>
+ </li>
+ <li id="repo-header-fork">
+ <a id="repo-header-fork-btn" href="{{.RepoLink}}/action/fork">
+ <button class="btn btn-gray text-bold btn-radius">
+ <i class="octicon octicon-repo-forked"></i>{{.i18n.Tr "repo.fork"}}
+ <span class="num">{{.Repository.NumForks}}</span>
+ </button>
+ </a>
+ </li>
+ </ul>
+ </div>
+</div> \ No newline at end of file
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl
new file mode 100644
index 0000000000..42b8bdd4b1
--- /dev/null
+++ b/templates/repo/home.tmpl
@@ -0,0 +1,78 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="repo-wrapper">
+ {{template "repo/header" .}}
+ <div id="repo-content" class="clear container">
+ <div id="repo-main" class="left grid-4-5">
+ <p id="repo-desc">
+ <span class="description">{{.Repository.DescriptionHtml}}</span>
+ <a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>
+ </p>
+ <ul id="repo-file-nav" class="clear menu menu-line">
+ <li>
+ <a href="#">
+ <button class="btn btn-green btn-small btn-radius" id="repo-compare-btn"><i class="octicon octicon-git-compare"></i></button>
+ </a>
+ </li>
+ <li id="repo-branch-switch" class="down drop">
+ <a href="#">
+ <button class="btn btn-gray btn-small btn-radius">
+ <i class="octicon octicon-git-branch"></i> Branch :
+ <strong id="repo-branch-current">{{if .IsViewBranch}}{{.BranchName}}{{else}}{{ShortSha .BranchName}}{{end}}</strong>
+ </button>
+ </a>
+ <div class="drop-down panel">
+ <p class="panel-header text-bold">Branches & Tags</p>
+ <input id="repo-branch-filter-ipt" class="ipt ipt-large" type="text" placeholder="find branches / tags"/>
+ <div id="repo-branch-tag">
+ <ul class="menu menu-line tab-nav clear" id="repo-branch-tab-nav">
+ <li class="js-tab-nav js-tab-nav-show left" data-tab-target="#repo-branch-list"><a href="#">Branches</a></li>
+ <li class="js-tab-nav left" data-tab-target="#repo-tag-list"><a href="#">Tags</a></li>
+ </ul>
+ <ul class="menu menu-vertical switching-list" id="repo-branch-list">
+ {{range .Branches}}
+ <li {{if eq . $.BranchName}}class="checked"{{end}}><a href="{{$.RepoLink}}/src/{{.}}"><i class="octicon octicon-check"></i>{{.}}</a></li>
+ {{end}}
+ </ul>
+ <ul class="menu menu-vertical switching-list" id="repo-tag-list">
+ <li><a href="#"><i class="octicon octicon-check"></i>0.3.3</a></li>
+ <li><a href="#"><i class="octicon octicon-check"></i>0.4.4</a></li>
+ <li class="checked"><a href="#"><i class="octicon octicon-check"></i>0.1</a></li>
+ <li><a href="#"><i class="octicon octicon-check"></i>0.1 beta</a></li>
+ </ul>
+ </div>
+ </div>
+ </li>
+ <li id="repo-bread" class="breads">
+ <a class="title bread" href="{{.RepoLink}}">{{.Repository.Name}}</a>
+ {{ $n := len .Treenames}}
+ {{ $l := Subtract $n 1}}
+ {{range $i, $v := .Treenames}}
+ {{if eq $i $l}}
+ <span class="bread">{{$v}}</span>
+ {{else}}
+ <span class="bread"><a href="{{$.BranchLink}}/{{index $.Paths $i}}">{{$v}}</a></span>
+ {{end}}
+ {{end}}
+ </li>
+ <li id="repo-commits-jump" class="repo-jump right">
+ <a href="#">
+ <button class="btn btn-small btn-gray btn-right-radius"><i class="octicon octicon-git-commit"></i></button>
+ </a>
+ </li>
+ <li id="repo-find-jump" class="repo-jump right">
+ <a href="#">
+ <button class="btn btn-small btn-gray btn-left-radius"><i class="octicon octicon-list-unordered"></i></button>
+ </a>
+ </li>
+ </ul>
+ {{if .IsFile}}
+ {{template "repo/view_file" .}}
+ {{else}}
+ {{template "repo/view_list" .}}
+ {{end}}
+ </div>
+ {{template "repo/sidebar" .}}
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/repo/hook_add.tmpl b/templates/repo/hook_add.tmpl
deleted file mode 100644
index df3ff3bdf4..0000000000
--- a/templates/repo/hook_add.tmpl
+++ /dev/null
@@ -1,62 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-{{template "repo/nav" .}}
-{{template "repo/toolbar" .}}
-<div id="body" class="container">
- {{template "repo/setting_nav" .}}
- <div id="repo-setting-container" class="col-md-10">
- {{template "base/alert" .}}
- <form id="repo-hooks-add-form" action="{{.RepoLink}}/settings/hooks/add" method="post">
- {{.CsrfTokenHtml}}
- <div class="panel panel-default">
- <div class="panel-heading">
- Add Webhook
- </div>
-
- <div class="panel-body">
- <div class="col-md-7">
- <p>We’ll send a POST request to the URL below with details of any subscribed events.</p>
- <hr/>
- <div class="form-group">
- <label for="payload-url">Payload URL</label>
- <input id="payload-url" name="url" class="form-control" type="url" required="required"/>
- </div>
-
- <div class="form-group">
- <label for="content-type">Content type</label>
- <select id="content-type" name="content_type" class="form-control">
- <option value="1">application/json</option>
- </select>
- </div>
-
- <div class="form-group">
- <label for="payload-secret">Secret</label>
- <input id="payload-secret" name="secret" class="form-control" type="text"/>
- </div>
- <hr/>
- <div class="form-group">
- <label>Which events would you like to trigger this webhook?</label>
- <div class="radio">
- <label>
- <input class="form-control" name="push_only" type="radio" checked name="trigger"/> Just the <i>push</i> event.
- </label>
- </div>
- </div>
- <hr/>
- <div class="form-group">
- <label>
- <input type="checkbox" name="active" checked/>&nbsp;&nbsp;Active
- </label>
- <p class="help-block">We will deliver event details when this hook is triggered.</p>
- </div>
- </div>
- </div>
-
- <div class="panel-footer">
- <button class="btn btn-success">Add Webhook</button>
- </div>
- </div>
- </form>
- </div>
-</div>
-{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/repo/hook_edit.tmpl b/templates/repo/hook_edit.tmpl
deleted file mode 100644
index c3fe217e37..0000000000
--- a/templates/repo/hook_edit.tmpl
+++ /dev/null
@@ -1,72 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-{{template "repo/nav" .}}
-{{template "repo/toolbar" .}}
-<div id="body" class="container">
- {{template "repo/setting_nav" .}}
- <div id="repo-setting-container" class="col-md-10">
- {{template "base/alert" .}}
- <form id="repo-hooks-edit-form" action="{{.RepoLink}}/settings/hooks/{{.Webhook.Id}}" method="post">
- {{.CsrfTokenHtml}}
- <div class="panel panel-default">
- <div class="panel-heading">
- Manage Webhook
- </div>
-
- <div class="panel-body">
- <div class="col-md-7">
- <p>We’ll send a POST request to the URL below with details of any subscribed events.</p>
- <hr/>
- <div class="form-group">
- <label for="payload-url">Payload URL</label>
- <input id="payload-url" name="url" class="form-control" type="url" required="required" value="{{.Webhook.Url}}" />
- </div>
-
- <div class="form-group">
- <label for="payload-version">Content type</label>
- <select id="content-type" name="content_type" class="form-control">
- <option value="1">application/json</option>
- </select>
- </div>
-
- <div class="form-group">
- <label for="payload-secret">Secret</label>
- <input id="payload-secret" name="secret" class="form-control" type="text" value="{{.Webhook.Secret}}" />
- </div>
- <hr/>
- <div class="form-group">
- <label>Which events would you like to trigger this webhook?</label>
- <div class="radio">
- <label>
- <input class="form-control" name="push_only" type="radio" {{if .Webhook.HookEvent.PushOnly}}checked {{end}}name="trigger"/> Just the <i>push</i> event.
- </label>
- </div>
- </div>
- <hr/>
- <div class="form-group">
- <label>
- <input type="checkbox" name="active" {{if .Webhook.IsActive}}checked{{end}}/>&nbsp;&nbsp;Active
- </label>
- <p class="help-block">We will deliver event details when this hook is triggered.</p>
- </div>
- </div>
- </div>
-
- <div class="panel-footer">
- <button class="btn btn-primary">Update Webhook</button>&nbsp;&nbsp;
- <a type="button" href="{{.RepoLink}}/settings/hooks?remove={{.Webhook.Id}}" class="btn btn-danger">Delete Webhook</a>
- </div>
- </div>
- </form>
- <div class="panel panel-default">
- <div class="panel-heading">
- <h3 class="panel-title">Recent Deliveries</h3>
- </div>
-
- <div class="panel-body">
- Coming soon
- </div>
- </div>
- </div>
-</div>
-{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/repo/hooks.tmpl b/templates/repo/hooks.tmpl
deleted file mode 100644
index 85132e4b81..0000000000
--- a/templates/repo/hooks.tmpl
+++ /dev/null
@@ -1,33 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-{{template "repo/nav" .}}
-{{template "repo/toolbar" .}}
-<div id="body" class="container">
- {{template "repo/setting_nav" .}}
- <div id="repo-setting-container" class="col-md-10">
- {{template "base/alert" .}}
- <div class="panel panel-default">
- <div class="panel-heading">
- Webhooks
- </div>
- <div class="panel-body">
- <p>Webhooks allow external services to be notified when certain events happen on GitHub. When the specified events happen, we'll send a POST request to each of the URLs you provide. Learn more in our Webhooks Guide.<br/>&nbsp;</p>
- <ul id="repo-hooks-list" class="list-unstyled">
- {{range .Webhooks}}
- <li>
- {{if .IsActive}}<span class="pull-left status text-success"><i class="fa fa-check"></i></span>{{else}}<span class="pull-left status"><i class="fa fa-times"></i></span>{{end}}
- <a class="link" href="{{$.RepoLink}}/settings/hooks/{{.Id}}">{{.Url}}</a>
- <a href="{{$.RepoLink}}/settings/hooks?remove={{.Id}}" class="remove-hook pull-right"><i class="fa fa-times"></i></a>
- <a href="{{$.RepoLink}}/settings/hooks/{{.Id}}" class="edit-hook pull-right"><i class="fa fa-pencil"></i></a>
- </li>
- {{end}}
- </ul>
- </div>
- <div class="panel-footer">
- <a href="{{.RepoLink}}/settings/hooks/add"><button class="btn btn-primary">Add Webhook</button></a>
- </div>
- </div>
-
- </div>
-</div>
-{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/repo/issue/create.tmpl b/templates/repo/issue/create.tmpl
index b548b1e749..9b5468397d 100644
--- a/templates/repo/issue/create.tmpl
+++ b/templates/repo/issue/create.tmpl
@@ -4,7 +4,7 @@
{{template "repo/toolbar" .}}
<div id="body" class="container">
<div id="issue">
- <form class="form" action="{{.RepoLink}}/issues/new" method="post" id="issue-create-form">
+ <form class="form" action="{{.RepoLink}}/issues/new" method="post" id="issue-create-form" enctype="multipart/form-data">
{{.CsrfTokenHtml}}
{{template "base/alert" .}}
<div class="col-md-1">
@@ -95,14 +95,26 @@
<div class="tab-content">
<div class="tab-pane" id="issue-textarea">
<div class="form-group">
+ <div id="submit-error" class="text-danger"></div>
<textarea class="form-control" name="content" id="issue-content" rows="10" placeholder="Write some content" data-ajax-rel="issue-preview" data-ajax-val="val" data-ajax-field="text">{{.content}}</textarea>
</div>
</div>
<div class="tab-pane issue-preview-content" id="issue-preview">loading...</div>
</div>
</div>
+ {{if .AttachmentsEnabled}}
+ <div id="attached">
+ <div id="attached-list">
+ <b>Attachments:</b>
+ </div>
+ </div>
+ {{end}}
<div class="text-right panel-body">
<div class="form-group">
+ {{if .AttachmentsEnabled}}
+ <input type="file" accept="{{.AllowedTypes}}" style="display: none;" id="attachments-input" name="attachments" multiple />
+ <button class="btn-default btn attachment-add" id="attachments-button">Select Attachments...</button>
+ {{end}}
<input type="hidden" value="id" name="repo-id"/>
<button class="btn-success btn">Create new issue</button>
</div>
diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl
index 0fae3eb663..099e41b2dd 100644
--- a/templates/repo/issue/list.tmpl
+++ b/templates/repo/issue/list.tmpl
@@ -26,6 +26,7 @@
<a class="del pull-right" href="#" data-id="{{.Id}}"><i class="fa fa-times-circle-o"></i></a>
</li>
{{end}}
+ {{if or .IsRepositoryOwner .IsAdmin}}
<li class="label-change-li" style="display: none">
<form id="label-change-form" action="{{$.RepoLink}}/issues/labels/edit" method="post">
{{.CsrfTokenHtml}}
@@ -41,7 +42,9 @@
</div>
</form>
</li>
+ {{end}}
</ul>
+ {{if or .IsRepositoryOwner .IsAdmin}}
<button class="btn btn-default btn-block label-button" id="label-manage-btn">Manage Labels</button>
<hr/>
<form id="label-add-form" action="{{$.RepoLink}}/issues/labels/new" method="post">
@@ -57,6 +60,7 @@
<button class="btn btn-default btn-sm">Create</button>
</div>
</form>
+ {{end}}
</div>
</div>
<div class="col-md-9">
@@ -82,7 +86,7 @@
<p class="info">
<span class="author"><img class="avatar" src="{{.Poster.AvatarLink}}" alt="" width="20"/>
<a href="/user/{{.Poster.Name}}">{{.Poster.Name}}</a></span>
- <span class="time">{{TimeSince .Created}}</span>
+ <span class="time">{{TimeSince .Created $.Lang}}</span>
<span class="comment"><i class="fa fa-comments"></i> {{.NumComments}}</span>
</p>
</div>
diff --git a/templates/repo/issue/view.tmpl b/templates/repo/issue/view.tmpl
index d95fba40d8..ff68ce0cc9 100644
--- a/templates/repo/issue/view.tmpl
+++ b/templates/repo/issue/view.tmpl
@@ -18,7 +18,7 @@
<a class="btn btn-primary pull-right issue-edit-save hidden" href="#" data-ajax="{{.RepoLink}}/issues/{{.Issue.Index}}" data-ajax-name="issue-edit-save" data-ajax-method="post">Save</a>{{end}}
<span class="status label label-{{if .Issue.IsClosed}}danger{{else}}success{{end}}">{{if .Issue.IsClosed}}Closed{{else}}Open{{end}}</span>
<a href="/user/{{.Issue.Poster.Name}}" class="author"><strong>{{.Issue.Poster.Name}}</strong></a> opened this issue
- <span class="time">{{TimeSince .Issue.Created}}</span> · {{.Issue.NumComments}} comments
+ <span class="time">{{TimeSince .Issue.Created $.Lang}}</span> · {{.Issue.NumComments}} comments
</p>
</div>
<div class="issue-main">
@@ -47,35 +47,73 @@
</div>
</div>
</div>
+ {{with $attachments := .Issue.Attachments}}
+ {{if $attachments}}
+ <div class="attachments">
+ <span class="attachment-label label label-info">Attachments:</span>
+
+ {{range $attachments}}
+ <a class="attachment label label-default" href="{{.IssueId}}/attachment/{{.Id}}">{{.Name}}</a>
+ {{end}}
+ </div>
+ {{end}}
+ {{end}}
</div>
{{range .Comments}}
+ {{/* 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE, 4 = COMMIT, 5 = PULL */}}
{{if eq .Type 0}}
<div class="issue-child" id="issue-comment-{{.Id}}">
<a class="user pull-left" href="/user/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a>
<div class="issue-content panel panel-default">
<div class="panel-heading">
- <a href="/user/{{.Poster.Name}}" class="user">{{.Poster.Name}}</a> commented <span class="time">{{TimeSince .Created}}</span>
+ <a href="/user/{{.Poster.Name}}" class="user">{{.Poster.Name}}</a> commented <span class="time">{{TimeSince .Created $.Lang}}</span>
<!-- <a class="issue-comment-del pull-right issue-action" href="#" title="Edit Comment"><i class="fa fa-times-circle"></i></a>
<a class="issue-comment-edit pull-right issue-action" href="#" title="Remove Comment" data-url="{remove-link}"><i class="fa fa-edit"></i></a> -->
<span class="role label label-default pull-right">Owner</span>
</div>
<div class="panel-body markdown">
+ {{if len .Content}}
{{str2html .Content}}
+ {{else}}
+ <i>No comment entered</i>
+ {{end}}
+ </div>
+ {{with $attachments := .Attachments}}
+ {{if $attachments}}
+ <div class="attachments">
+ <span class="attachment-label label label-info">Attachments:</span>
+
+ {{range $attachments}}
+ <a class="attachment label label-default" href="{{.IssueId}}/attachment/{{.Id}}">{{.Name}}</a>
+ {{end}}
</div>
+ {{end}}
+ {{end}}
</div>
</div>
{{else if eq .Type 1}}
<div class="issue-child issue-opened">
<a class="user pull-left" href="/user/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt="" /></a>
<div class="issue-content">
- <a class="user pull-left" href="/user/{{.Poster.Name}}">{{.Poster.Name}}</a> <span class="label label-success">Reopened</span> this issue <span class="time">{{TimeSince .Created}}</span>
+ <a class="user pull-left" href="/user/{{.Poster.Name}}">{{.Poster.Name}}</a> <span class="label label-success">Reopened</span> this issue <span class="time">{{TimeSince .Created $.Lang}}</span>
</div>
</div>
{{else if eq .Type 2}}
<div class="issue-child issue-closed">
<a class="user pull-left" href="/user/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a>
<div class="issue-content">
- <a class="user pull-left" href="/user/{{.Poster.Name}}">{{.Poster.Name}}</a> <span class="label label-danger">Closed</span> this issue <span class="time">{{TimeSince .Created}}</span>
+ <a class="user pull-left" href="/user/{{.Poster.Name}}">{{.Poster.Name}}</a> <span class="label label-danger">Closed</span> this issue <span class="time">{{TimeSince .Created $.Lang}}</span>
+ </div>
+ </div>
+ {{else if eq .Type 4}}
+ <div class="issue-child issue-reference issue-reference-commit">
+ <a class="user pull-left" href="/user/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a>
+ <div class="issue-content">
+ <a class="user pull-left" href="/user/{{.Poster.Name}}">{{.Poster.Name}}</a> <span class="label label-primary">Referenced</span> this issue <span class="time">{{TimeSince .Created $.Lang}}</span>
+ <p>
+ <a class="user pull-left" href="/user/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a>
+ {{.ContentHtml}}
+ </p>
</div>
</div>
{{end}}
@@ -83,7 +121,7 @@
<hr class="issue-line"/>
{{if .SignedUser}}<div class="issue-child issue-reply">
<a class="user pull-left" href="/user/{{.SignedUser.Name}}"><img class="avatar" src="{{.SignedUser.AvatarLink}}" alt=""/></a>
- <form class="panel panel-default issue-content" action="{{.RepoLink}}/comment/new" method="post">
+ <form class="panel panel-default issue-content" action="{{.RepoLink}}/comment/new" method="post" enctype="multipart/form-data">
{{.CsrfTokenHtml}}
<div class="panel-body">
<div class="form-group">
@@ -96,6 +134,7 @@
<div class="tab-content">
<div class="tab-pane" id="issue-textarea">
<div class="form-group">
+ <div id="submit-error" class="text-danger"></div>
<input type="hidden" value="{{.Issue.Index}}" name="issueIndex"/>
<textarea class="form-control" name="content" id="issue-reply-content" rows="10" placeholder="Write some content" data-ajax-rel="issue-preview" data-ajax-val="val" data-ajax-field="text">{{.content}}</textarea>
</div>
@@ -103,8 +142,19 @@
<div class="tab-pane issue-preview-content" id="issue-preview">Loading...</div>
</div>
</div>
+ {{if .AttachmentsEnabled}}
+ <div id="attached">
+ <div id="attached-list">
+ <b>Attachments:</b>
+ </div>
+ </div>
+ {{end}}
<div class="text-right">
<div class="form-group">
+ {{if .AttachmentsEnabled}}
+ <input type="file" accept="{{.AllowedTypes}}" style="display: none;" id="attachments-input" name="attachments" multiple />
+ <button class="btn-default btn attachment-add" id="attachments-button">Select Attachments...</button>
+ {{end}}
{{if .IsIssueOwner}}{{if .Issue.IsClosed}}
<input type="submit" class="btn-default btn issue-open" id="issue-open-btn" data-origin="Reopen" data-text="Reopen & Comment" name="change_status" value="Reopen"/>{{else}}
<input type="submit" class="btn-default btn issue-close" id="issue-close-btn" data-origin="Close" data-text="Close & Comment" name="change_status" value="Close"/>{{end}}{{end}}&nbsp;&nbsp;
diff --git a/templates/repo/migrate.tmpl b/templates/repo/migrate.tmpl
index fff25e6de5..7c983d7686 100644
--- a/templates/repo/migrate.tmpl
+++ b/templates/repo/migrate.tmpl
@@ -1,127 +1,82 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div class="container" id="body">
- <form action="/repo/migrate" method="post" class="form-horizontal card" id="repo-create">
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="repo-wrapper">
+ <form id="repo-migrate-form" class="form form-align panel panel-radius" action="/repo/migrate" method="post">
{{.CsrfTokenHtml}}
- <h3>Repository Migration</h3>
- {{template "base/alert" .}}
- <!-- <div class="form-group">
- <label class="col-md-2 control-label">From<strong class="text-danger">*</strong></label>
- <div class="col-md-8">
- <select class="form-control" name="from">
- <option value="github">GitHub</option>
- </select>
+ <div class="panel-header"><h2>{{.i18n.Tr "new_migrate"}}</h2></div>
+ <div class="panel-content">
+ {{template "ng/base/alert" .}}
+ <div class="field">
+ <label class="req" for="url">HTTPS URL</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_HttpsUrl}}ipt-error{{end}}" id="url" name="url" type="text" value="{{.url}}" required />
</div>
- </div> -->
-
- <div class="form-group">
- <label class="col-md-2 control-label">HTTPS URL<strong class="text-danger">*</strong></label>
- <div class="col-md-8">
- <input name="url" type="text" class="form-control" placeholder="Type your migration repository HTTPS URL" value="{{.url}}" required="required" >
- </div>
- </div>
-
- <div class="form-group">
- <div class="col-md-offset-2 col-md-8">
- <a class="btn btn-default" data-toggle="collapse" data-target="#repo-import-auth">Need Authorization</a>
- </div>
- <div id="repo-import-auth" class="collapse">
- <div class="form-group">
- <label class="col-md-2 control-label">Username</label>
- <div class="col-md-8">
- <input name="auth_username" type="text" class="form-control" placeholder="Type your user name" value="{{.auth_username}}" >
+ <div class="field">
+ <span class="form-label"></span>
+ <button class="btn btn-large btn-gray btn-radius" id="auth-button" data-toggle="collapse" data-target="#repo-import-auth">{{.i18n.Tr "repo.need_auth"}}</button>
+ <div id="repo-migrate-auth" {{if not .Err_Auth}}class="hide"{{end}}>
+ <div class="field">
+ <label for="auth_username">{{.i18n.Tr "username"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_Auth}}ipt-error{{end}}" id="auth_username" name="auth_username" type="text" value="{{.auth_username}}" />
</div>
- </div>
- <div class="form-group">
- <label class="col-md-2 control-label">Password</label>
- <div class="col-md-8">
- <input name="auth_password" type="password" class="form-control" placeholder="Type your password" value="{{.auth_password}}" >
+ <div class="field">
+ <label for="auth_password">{{.i18n.Tr "password"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_Auth}}ipt-error{{end}}" id="auth_password" name="auth_password" type="password" value="{{.auth_password}}" />
</div>
</div>
</div>
- </div>
- <hr/>
- <div class="form-group">
- <label class="col-md-2 control-label">Owner<strong class="text-danger">*</strong></label>
- <div class="col-md-8">
- <div class="btn-group" id="repo-owner-switch">
- <button type="button" class="btn btn-default" id="repo-owner-current">
- <img src="{{.SignedUser.AvatarLink}}?s=28" alt="user-avatar" title="username" id="repo-owner-avatar">
- <span id="repo-owner-name">{{.SignedUser.Name}}</span>
- </button>
- <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
- <span class="caret"></span>
- </button>
- <div class="dropdown-menu clone-group-btn no-propagation">
- <ul id="dashboard-switch-menu" class="list-unstyled">
- <li data-uid="{{.SignedUser.Id}}" class="checked">
- <a>
- <i class="fa fa-check"></i>
- <img src="{{.SignedUser.AvatarLink}}?s=28" alt="user-avatar" title="username">
- {{.SignedUser.Name}}
- </a>
- </li>
- {{range .Orgs}}
- <li data-uid="{{.Id}}">
- <a>
- <i class="fa fa-check"></i>
- <img src="{{.AvatarLink}}?s=28" alt="user-avatar" title="username">
- {{.Name}}
- </a>
- </li>
- {{end}}
- </ul>
- </div>
+ <hr/>
+ <div class="field">
+ <label for="owner" class="req">{{.i18n.Tr "repo.owner"}}</label>
+ <input id="repo-owner-id" type="hidden" name="uid" value="{{.ContextUser.Id}}" />
+ <div class="inline-block drop">
+ <a href="#" class="drop-bottom">
+ <img class="avatar" src="{{.ContextUser.AvatarLink}}" id="repo-owner-avatar" alt="user-avatar">
+ <strong id="repo-owner-name">{{.ContextUser.Name}}</strong>
+ </a>
+ <ul class="drop-down menu menu-vertical menu-radius switching-list" id="repo-create-owner-list">
+ <li {{if eq $.ContextUser.Id .SignedUser.Id}}class="checked"{{end}} data-uid="{{.SignedUser.Id}}">
+ <a>
+ <i class="octicon octicon-check"></i>
+ <img class="avatar" src="{{.SignedUser.AvatarLink}}" alt="user-avatar">
+ <strong>{{.SignedUser.Name}}</strong>
+ </a>
+ </li>
+ {{range .Orgs}}
+ <li {{if eq $.ContextUser.Id .Id}}class="checked"{{end}} data-uid="{{.Id}}">
+ <a>
+ <i class="octicon octicon-check"></i>
+ <img class="avatar" src="{{.AvatarLink}}" alt="user-avatar">
+ <strong>{{.Name}}</strong>
+ </a>
+ </li>
+ {{end}}
+ </ul>
</div>
</div>
- <input type="hidden" value="{{.SignedUserId}}" name="uid" id="repo-owner-id"/>
- </div>
-
- <div class="form-group {{if .Err_RepoName}}has-error has-feedback{{end}}">
- <label class="col-md-2 control-label">Repository<strong class="text-danger">*</strong></label>
- <div class="col-md-8">
- <input name="repo" type="text" class="form-control" placeholder="Type your repository name" value="{{.repo}}" required="required">
- <span class="help-block">Great repository names are short and memorable. </span>
+ <div class="field">
+ <label class="req" for="repo-name">{{.i18n.Tr "repo.repo_name"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_RepoName}}ipt-error{{end}}" id="repo-name" name="repo_name" type="text" value="{{.repo_name}}" required />
</div>
- </div>
-
- <div class="form-group">
- <label class="col-md-2 control-label">Migration Type</label>
- <div class="col-md-8">
- <div class="checkbox">
- <label>
- <input type="checkbox" name="mirror" {{if .mirror}}checked{{end}}>
- <strong>This repository is a mirror</strong>
- </label>
- </div>
+ <div class="field">
+ <label for="visibility">{{.i18n.Tr "repo.visibility"}}</label>
+ <input class="ipt-chk" id="visibility" name="private" type="checkbox" {{if .private}}checked{{end}} />
+ <span>{{.i18n.Tr "repo.visiblity_helper" | Str2html}}</span>
</div>
- </div>
-
- <div class="form-group">
- <label class="col-md-2 control-label">Visibility</label>
- <div class="col-md-8">
- <div class="checkbox">
- <label>
- <input type="checkbox" name="private" {{if .private}}checked{{end}}>
- <strong>This repository is private</strong>
- </label>
- </div>
+ <div class="field">
+ <label for="migrate_type">{{.i18n.Tr "repo.migrate_type"}}</label>
+ <input class="ipt-chk" id="migrate_type" name="mirror" type="checkbox" {{if .mirror}}checked{{end}} />
+ <span>{{.i18n.Tr "repo.migrate_type_helper" | Str2html}}</span>
</div>
- </div>
-
- <div class="form-group {{if .Err_Description}}has-error has-feedback{{end}}">
- <label class="col-md-2 control-label">Description</label>
- <div class="col-md-8">
- <textarea name="desc" class="form-control" placeholder="Type your repository description">{{.desc}}</textarea>
+ <div class="field clear">
+ <label class="left" for="desc">{{.i18n.Tr "repo.repo_desc"}}</label>
+ <textarea class="ipt ipt-large ipt-radius {{if .Err_Description}}ipt-error{{end}}" id="desc" name="desc">{{.desc}}</textarea>
</div>
- </div>
-
- <div class="form-group">
- <div class="col-md-offset-2 col-md-8">
- <button type="submit" class="btn btn-lg btn-primary">Migrate repository</button>
- <a href="/" class="text-danger">Cancel</a>
+ <div class="field">
+ <label for="repo-create-submit"></label>
+ <button class="btn btn-large btn-blue btn-radius" id="repo-create-submit">{{.i18n.Tr "repo.migrate_repo"}}</button>
+ <a class="btn btn-small btn-gray btn-radius" id="repo-create-cancel" href="/"><strong>{{.i18n.Tr "cancel"}}</strong></a>
</div>
</div>
</form>
</div>
-{{template "base/footer" .}} \ No newline at end of file
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/repo/nav.tmpl b/templates/repo/nav.tmpl
index ea7799b351..69f60ba469 100644
--- a/templates/repo/nav.tmpl
+++ b/templates/repo/nav.tmpl
@@ -3,7 +3,7 @@
<div class="row">
<div class="col-md-7">
<h3 class="name"><i class="fa fa-book fa-lg"></i><a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a> / <a href="/{{.Owner.Name}}/{{.Repository.Name}}">{{.Repository.Name}}</a> {{if .Repository.IsPrivate}}<span class="label label-default">Private</span>{{else if .Repository.IsMirror}}<span class="label label-default">Mirror</span>{{end}}</h3>
- <p class="desc">{{.Repository.Description}}{{if .Repository.Website}} <a href="{{.Repository.Website}}">{{.Repository.Website}}</a>{{end}}</p>
+ <p class="desc">{{.Repository.DescriptionHtml}}{{if .Repository.Website}} <a href="{{.Repository.Website}}">{{.Repository.Website}}</a>{{end}}</p>
</div>
<div class="col-md-5 actions text-right clone-group-btn">
{{if not .IsBareRepo}}
@@ -31,6 +31,7 @@
</div>
</div>
</div>
+ {{if .IsSigned}}
<div class="btn-group {{if .IsRepositoryWatching}}watching{{else}}no-watching{{end}}" id="repo-watching" data-watch="/{{.Owner.Name}}/{{.Repository.Name}}/action/watch" data-unwatch="/{{.Owner.Name}}/{{.Repository.Name}}/action/unwatch">
{{if .IsRepositoryWatching}}
<button type="button" class="btn btn-default"><i class="fa fa-eye fa-lg fa-m"></i></button>
@@ -52,6 +53,7 @@
</div>
</div>
</div>
+ {{end}}
<!-- <div class="btn-group">
<button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="top" title="Star"><i class="fa fa-star"></i>&nbsp;{{.Repository.NumStars}}</button>
</div> -->
diff --git a/templates/repo/setting.tmpl b/templates/repo/setting.tmpl
deleted file mode 100644
index 99835640fc..0000000000
--- a/templates/repo/setting.tmpl
+++ /dev/null
@@ -1,182 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-{{template "repo/nav" .}}
-{{template "repo/toolbar" .}}
-<div id="body" class="container">
- {{template "repo/setting_nav" .}}
- <div id="repo-setting-container" class="col-md-10">
- {{template "base/alert" .}}
- <div class="panel panel-default">
- <div class="panel-heading">
- Repository Options
- </div>
-
- <div class="panel-body">
- <form action="/{{.Owner.Name}}/{{.Repository.Name}}/settings" method="post" class="form-horizontal">
- {{.CsrfTokenHtml}}
- <input type="hidden" name="action" value="update">
- <div class="form-group">
- <label class="col-md-3 text-right" for="repo-setting-name">Name</label>
- <div class="col-md-9">
- <input class="form-control" name="name" value="{{.Repository.Name}}" title="{{.Repository.Name}}" id="repo-setting-name"/>
- <p class="help-block hidden"><span class="text-danger">Cautious : </span>your repository name is changing !</p>
- </div>
- </div>
-
- <div class="form-group">
- <label class="col-md-3 text-right">Description</label>
- <div class="col-md-9">
- <textarea class="form-control" name="desc" id="repo-desc" rows="3">{{.Repository.Description}}</textarea>
- </div>
- </div>
-
- <div class="form-group">
- <label class="col-md-3 text-right">Official Site</label>
- <div class="col-md-9">
- <input type="url" class="form-control" name="site" value="{{.Repository.Website}}" />
- </div>
- </div>
- <hr>
- <div class="form-group">
- <label class="col-md-3 text-right">Default Branch</label>
- <div class="col-md-3">
- <select name="branch" id="repo-default-branch" class="form-control">
- {{if .Repository.DefaultBranch}}<option value="{{.Repository.DefaultBranch}}">{{.Repository.DefaultBranch}}</option>{{end}}
- {{range .Branches}}
- {{if eq . $.Repository.DefaultBranch}}{{else}}<option value="{{.}}">{{.}}</option>{{end}}
- {{end}}
- </select>
- </div>
- </div>
-
- {{if .Repository.IsMirror}}<div class="form-group">
- <label class="col-md-3 text-right">Mirror Interval(hours)</label>
- <div class="col-md-3">
- <input class="form-control" name="interval" value="{{.MirrorInterval}}"/>
- </div>
- </div>{{end}}
-
- <div class="form-group">
- <div class="col-md-offset-3 col-md-9">
- <div class="checkbox">
- <label style="line-height: 15px;">
- <input type="checkbox" name="private" {{if .Repository.IsPrivate}}checked{{end}}>
- <strong>Make this repository private</strong>
- </label>
- </div>
-
- <div class="checkbox">
- <label style="line-height: 15px;">
- <input type="checkbox" name="goget" {{if .Repository.IsGoget}}checked{{end}}>
- <strong>Enable 'go get' meta</strong>
- </label>
- </div>
- </div>
- </div>
-
- <div class="form-group">
- <div class="col-md-9 col-md-offset-3">
- <button class="btn btn-primary" type="submit">Save Options</button>
- </div>
- </div>
- </form>
- </div>
- </div>
-
- <div class="panel panel-warning">
- <div class="panel-heading">
- Danger Zone
- </div>
-
- {{if not .Repository.IsMirror}}
- <div class="panel-body">
- <button type="button" class="btn btn-default pull-right" href="#transfer-repository-modal" data-toggle="modal">
- Transfer ownership
- </button>
- <dd>
- <dt>Transfer ownership</dt>
- <dl>Transfer this repo to another user or to an organization where you have admin rights.</dl>
- </dd>
-
- <div class="modal fade" id="transfer-repository-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
- <div class="modal-dialog">
- <form action="/{{.Owner.Name}}/{{.Repository.Name}}/settings" method="post" class="modal-content">
- {{.CsrfTokenHtml}}
- <input type="hidden" name="action" value="transfer">
-
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
- <h4 class="modal-title" id="myModalLabel">Do you really want to transfer this repo?</h4>
- </div>
-
- <div class="modal-body">
- <div class="alert alert-warning">This is important, pay attention.</div>
- <ul>
- <!-- <li>Transferring may be delayed until the new owner approves the transfer.</li> -->
- <!-- <li>If you are transferring into an org, teams <strong>will not be set</strong>. An owner on the org will need to set teams for the repo.</li> -->
- <li>Admin rights will be transferred to the new owner, you <strong>will lose admin rights</strong>.</li>
- <!-- <li>Admin rights will be transferred to the new owner, you <strong>may lose admin rights</strong> if you are transferring into an organization account.</li> -->
- <li>Redirect entries <strong>will NOT be</strong> set up from the previous location.</li>
- <li>Git access <strong>will NOT continue</strong> to work from the previous location.</li>
- </ul>
- <div class="form-group">
- <label>Please type the name of the repository to confirm "<strong class="text-danger">{{.Repository.Name}}</strong>"</label>
- <input name="repository" class="form-control" type="text" placeholder="Type your repository name" required="required">
- </div>
-
- <div class="form-group">
- <label>Please type the name of the new owner:</label>
- <input name="owner" class="form-control" type="text" placeholder="Type new owner's name" required="required">
- </div>
- </div>
-
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
- <button class="btn btn-danger btn-lg">I understand the consequences, transfer this repository</button>
- </div>
- </form>
- </div>
- </div>
- </div>
- {{end}}
-
- <hr>
- <div class="panel-body">
- <button type="button" class="btn btn-default pull-right" href="#delete-repository-modal" data-toggle="modal">
- Delete this repository
- </button>
- <dd>
- <dt>Delete this repository</dt>
- <dl>Once you delete a repository, there is no going back. Please be certain.</dl>
- </dd>
-
- <div class="modal fade" id="delete-repository-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
- <div class="modal-dialog">
- <form action="/{{.Owner.Name}}/{{.Repository.Name}}/settings" method="post" class="modal-content">
- {{.CsrfTokenHtml}}
- <input type="hidden" name="action" value="delete">
-
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
- <h4 class="modal-title" id="myModalLabel">Delete repository</h4>
- </div>
-
- <div class="modal-body">
- <div class="form-group">
- <label>Please enter your repository name "<strong class="text-danger">{{.Repository.Name}}</strong>"</label>
- <input name="repository" class="form-control" type="text" placeholder="Type your repository name" required="required">
- </div>
- </div>
-
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
- <button class="btn btn-danger btn-lg">I understand the consequences, delete this repository</button>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
-</div>
-{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/repo/settings/collaboration.tmpl b/templates/repo/settings/collaboration.tmpl
new file mode 100644
index 0000000000..fe4ec49868
--- /dev/null
+++ b/templates/repo/settings/collaboration.tmpl
@@ -0,0 +1,47 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="repo-wrapper">
+ {{template "repo/header" .}}
+ <div id="setting-wrapper" class="main-wrapper">
+ <div id="repo-setting" class="container clear">
+ {{template "repo/settings/nav" .}}
+ <div class="grid-4-5 left">
+ <div class="setting-content">
+ {{template "ng/base/alert" .}}
+ <div id="setting-content">
+ <div id="user-profile-setting-content" class="panel panel-radius">
+ <div class="panel-header">
+ <strong>{{.i18n.Tr "repo.settings.collaboration"}}</strong>
+ </div>
+ <div class="panel-body">
+ <ul id="repo-collab-list">
+ {{range .Collaborators}}
+ <li class="collab">
+ {{if not (eq .Id $.Owner.Id)}}<a href="{{$.RepoLink}}/settings/collaboration?remove={{.Name}}" class="remove-collab right"><i class="fa fa-times"></i></a>{{end}}
+ <a class="member" href="/{{.Name}}">
+ <img alt="{{.Name}}" class="pull-left avatar" src="{{.AvatarLink}}">
+ <strong>{{.FullName}}</strong> ({{.Name}})
+ </a>
+ </li>
+ <hr>
+ {{end}}
+ </ul>
+ </div>
+ <div class="panel-footer">
+ <form class="form form-align" action="{{.RepoLink}}/settings/collaboration" method="post" id="repo-collab-form">
+ {{.CsrfTokenHtml}}
+ <input class="ipt ipt-large ipt-radius" id="repo-collaborator" name="collaborator" autocomplete="off" required />
+ <button class="btn btn-blue btn-large btn-radius">{{.i18n.Tr "repo.settings.add_collaborator"}}</button>
+ <div class="repo-user-list-block">
+ <ul class="menu-down-show menu-vertical menu-radius switching-list user-list" id="repo-collaborator-list"></ul>
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/repo/settings/hook_new.tmpl b/templates/repo/settings/hook_new.tmpl
new file mode 100644
index 0000000000..2cd0eacb6a
--- /dev/null
+++ b/templates/repo/settings/hook_new.tmpl
@@ -0,0 +1,70 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="repo-wrapper">
+ {{template "repo/header" .}}
+ <div id="setting-wrapper" class="main-wrapper">
+ <div id="repo-setting" class="container clear">
+ {{template "repo/settings/nav" .}}
+ <div class="grid-4-5 left">
+ <div class="setting-content">
+ {{template "ng/base/alert" .}}
+ <div id="setting-content">
+ <div id="repo-hooks-panel" class="panel panel-radius">
+ <div class="panel-header">
+ <strong>{{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}}</strong>
+ </div>
+ <form class="form form-align panel-body" id="repo-setting-form" action="{{.RepoLink}}/settings/hooks/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.Id}}{{end}}" method="post">
+ {{.CsrfTokenHtml}}
+ <div class="text-center panel-desc">{{.i18n.Tr "repo.settings.add_webhook_desc" | Str2html}}</div>
+ <div class="field">
+ <label class="req" for="payload-url">{{.i18n.Tr "repo.settings.payload_url"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_UserName}}ipt-error{{end}}" id="payload-url" name="payload_url" type="url" value="{{.Webhook.Url}}" required />
+ </div>
+ <div class="field">
+ <label class="req">{{.i18n.Tr "repo.settings.content_type"}}</label>
+ <select name="content_type">
+ <option value="1" {{if or .PageIsSettingsHooksNew (eq .Webhook.ContentType 1)}}selected{{end}}>application/json</option>
+ <option value="2" {{if eq .Webhook.ContentType 2}}selected{{end}}>application/x-www-form-urlencoded</option>
+ </select>
+ </div>
+ <div class="field">
+ <label for="secret">{{.i18n.Tr "repo.settings.secret"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_UserName}}ipt-error{{end}}" id="secret" name="secret" type="password" value="{{.Webhook.Secret}}" autocomplete="off" />
+ </div>
+ <div class="field">
+ <h4 class="text-center">{{.i18n.Tr "repo.settings.event_desc"}}</h4>
+ <label></label>
+ <input name="push_only" type="radio" {{if or .PageIsSettingsHooksNew .Webhook.PushOnly}}checked{{end}}> {{.i18n.Tr "repo.settings.event_push_only" | Str2html}}
+ </div>
+ <div class="field">
+ <label for="active">{{.i18n.Tr "repo.settings.active"}}</label>
+ <input class="ipt-chk" id="active" name="active" type="checkbox" {{if or .PageIsSettingsHooksNew .Webhook.IsActive}}checked{{end}} />
+ <span>{{.i18n.Tr "repo.settings.active_helper"}}</span>
+ </div>
+ <div class="field">
+ <label></label>
+ <button class="btn btn-green btn-large btn-radius">{{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}}</button>
+ {{if .PageIsSettingsHooksEdit}}<a class="btn btn-red btn-large btn-link btn-radius" href="{{.RepoLink}}/settings/hooks?remove={{.Webhook.Id}}"><strong>{{.i18n.Tr "repo.settings.delete_webhook"}}</strong></a>{{end}}
+ </div>
+ </form>
+ </div>
+ </div>
+ {{if .PageIsSettingsHooksEdit}}
+ <br>
+ <div id="setting-content">
+ <div id="repo-hooks-history-panel" class="panel panel-radius">
+ <div class="panel-header">
+ <strong>{{.i18n.Tr "repo.settings.recent_deliveries"}}</strong>
+ </div>
+ <ul class="panel-body setting-list">
+ <li>Coming soon!</li>
+ </ul>
+ </div>
+ </div>
+ {{end}}
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/repo/settings/hooks.tmpl b/templates/repo/settings/hooks.tmpl
new file mode 100644
index 0000000000..6efd8f0a6f
--- /dev/null
+++ b/templates/repo/settings/hooks.tmpl
@@ -0,0 +1,39 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="repo-wrapper">
+ {{template "repo/header" .}}
+ <div id="setting-wrapper" class="main-wrapper">
+ <div id="repo-setting" class="container clear">
+ {{template "repo/settings/nav" .}}
+ <div class="grid-4-5 left">
+ <div class="setting-content">
+ {{template "ng/base/alert" .}}
+ <div id="setting-content">
+ <div id="repo-hooks-panel" class="panel panel-radius">
+ <div class="panel-header">
+ <a class="btn btn-small btn-black btn-header btn-radius right" href="{{.RepoLink}}/settings/hooks/new">{{.i18n.Tr "repo.settings.add_webhook"}}</a>
+ <strong>{{.i18n.Tr "repo.settings.hooks"}}</strong>
+ </div>
+ <ul class="panel-body setting-list">
+ <li>{{.i18n.Tr "repo.settings.hooks_desc" | Str2html}}</li>
+ {{range .Webhooks}}
+ <li>
+ {{if .IsActive}}
+ <span class="left text-success"><i class="octicon octicon-check"></i></span>
+ {{else}}
+ <span class="left text-grey"><i class="octicon octicon-primitive-dot"></i></span>
+ {{end}}
+ <a class="link" href="{{$.RepoLink}}/settings/hooks/{{.Id}}">{{.Url}}</a>
+ <a href="{{$.RepoLink}}/settings/hooks?remove={{.Id}}" class="text-red right"><i class="fa fa-times"></i></a>
+ <a href="{{$.RepoLink}}/settings/hooks/{{.Id}}" class="text-blue right"><i class="fa fa-pencil"></i></a>
+ </li>
+ {{end}}
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/repo/settings/nav.tmpl b/templates/repo/settings/nav.tmpl
new file mode 100644
index 0000000000..6288ca6cd7
--- /dev/null
+++ b/templates/repo/settings/nav.tmpl
@@ -0,0 +1,11 @@
+<div id="setting-menu" class="grid-1-5 panel panel-radius left">
+ <p class="panel-header"><strong>{{.i18n.Tr "repo.settings"}}</strong></p>
+ <div class="panel-body">
+ <ul class="menu menu-vertical switching-list grid-1-5 left">
+ <li {{if .PageIsSettingsOptions}}class="current"{{end}}><a href="{{.RepoLink}}/settings">{{.i18n.Tr "repo.settings.options"}}</a></li>
+ <li {{if .PageIsSettingsCollaboration}}class="current"{{end}}><a href="{{.RepoLink}}/settings/collaboration">{{.i18n.Tr "repo.settings.collaboration"}}</a></li>
+ <li {{if .PageIsSettingsHooks}}class="current"{{end}}><a href="{{.RepoLink}}/settings/hooks">{{.i18n.Tr "repo.settings.hooks"}}</a></li>
+ <li {{if .PageIsSettingsKeys}}class="current"{{end}}><a href="{{.RepoLink}}/settings/keys">{{.i18n.Tr "repo.settings.deploy_keys"}}</a></li>
+ </ul>
+ </div>
+</div> \ No newline at end of file
diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl
new file mode 100644
index 0000000000..fb6cda2aae
--- /dev/null
+++ b/templates/repo/settings/options.tmpl
@@ -0,0 +1,129 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="repo-wrapper">
+ {{template "repo/header" .}}
+ <div id="setting-wrapper" class="main-wrapper">
+ <div id="repo-setting" class="container clear">
+ {{template "repo/settings/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 "repo.settings.basic_settings"}}</strong>
+ </div>
+ <form class="form form-align panel-body" id="repo-setting-form" action="{{.RepoLink}}/settings" method="post">
+ {{.CsrfTokenHtml}}
+ <input type="hidden" name="action" value="update">
+ <div class="field">
+ <label class="req" for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_RepoName}}ipt-error{{end}}" id="repo_name" name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" required />
+ </div>
+ <div class="field clear">
+ <label class="left" for="desc">{{.i18n.Tr "repo.repo_desc"}}</label>
+ <textarea class="ipt ipt-large ipt-radius {{if .Err_Description}}ipt-error{{end}}" id="desc" name="desc">{{.Repository.Description}}</textarea>
+ </div>
+ <div class="field">
+ <label for="website">{{.i18n.Tr "repo.settings.site"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_Website}}ipt-error{{end}}" id="website" name="site" type="url" value="{{.Repository.Website}}" />
+ </div>
+ <hr>
+ <br>
+ {{if not .Repository.IsBare}}
+ <div class="field">
+ <label>{{.i18n.Tr "repo.default_branch"}}</label>
+ <select name="branch">
+ {{if .Repository.DefaultBranch}}<option value="{{.Repository.DefaultBranch}}">{{.Repository.DefaultBranch}}</option>{{end}}
+ {{range .Branches}}
+ {{if not (eq . $.Repository.DefaultBranch)}}<option value="{{.}}">{{.}}</option>{{end}}
+ {{end}}
+ </select>
+ </div>
+ {{end}}
+ {{if .Repository.IsMirror}}
+ <div class="field">
+ <label for="interval">{{.i18n.Tr "repo.mirror_interval"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_Interval}}ipt-error{{end}}" id="interval" name="interval" type="number" value="{{.MirrorInterval}}" />
+ </div>
+ {{end}}
+ <div class="field">
+ <label for="visibility">{{.i18n.Tr "repo.visibility"}}</label>
+ <input class="ipt-chk" id="visibility" name="private" type="checkbox" {{if .Repository.IsPrivate}}checked{{end}} />
+ <span>{{.i18n.Tr "repo.visiblity_helper" | Str2html}}</span>
+ </div>
+ <div class="field">
+ <label for="goget">{{.i18n.Tr "repo.goget_meta"}}</label>
+ <input class="ipt-chk" id="goget" name="goget" type="checkbox" {{if .Repository.IsGoget}}checked{{end}} />
+ <span>{{.i18n.Tr "repo.goget_meta_helper" | Str2html}}</span>
+ </div>
+ <div class="field">
+ <span class="form-label"></span>
+ <button class="btn btn-green btn-large btn-radius">{{.i18n.Tr "repo.settings.update_settings"}}</button>
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
+ <br>
+ <div class="setting-content">
+ <div id="setting-content">
+ <div id="user-profile-setting-content" class="panel panel-warning panel-radius">
+ <div class="panel-header">
+ <strong>{{.i18n.Tr "repo.settings.danger_zone"}}</strong>
+ </div>
+ <div class="panel-body">
+ <div class="repo-setting-zone">
+ <button class="btn btn-gray btn-large btn-radius right" id="transfer-button">{{.i18n.Tr "repo.settings.transfer"}}</button>
+ <dt>{{.i18n.Tr "repo.settings.transfer"}}</dt>
+ <dl>{{.i18n.Tr "repo.settings.transfer_desc"}}</dl>
+ <div class="hide" id="transfer-form">
+ <br>
+ <form class="form-align form panel container panel-radius" action="{{.RepoLink}}/settings" method="post">
+ {{.CsrfTokenHtml}}
+ <input type="hidden" name="action" value="transfer">
+ <div class="panel-content">
+ <div class="field">
+ <label class="req" for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
+ <input class="ipt ipt-large ipt-radius" id="repo_name" name="repo_name" required />
+ </div>
+ <label class="req" for="new_owner_name">{{.i18n.Tr "repo.settings.transfer_owner"}}</label>
+ <input class="ipt ipt-large ipt-radius" id="new_owner_name" name="new_owner_name" required/>
+ <span class="form-label"></span>
+ <button class="btn btn-large btn-red btn-radius right">{{.i18n.Tr "repo.settings.make_transfer"}}</button>
+ </div>
+ </form>
+ </div>
+ </div>
+ <hr>
+ <div class="repo-setting-zone">
+ <button class="btn btn-gray btn-large btn-radius pull-right" id="delete-button">{{.i18n.Tr "repo.settings.delete"}}</button>
+ <dt>{{.i18n.Tr "repo.settings.delete"}}</dt>
+ <dl>{{.i18n.Tr "repo.settings.delete_desc"}}</dl>
+ <div class="hide" id="delete-form">
+ <br>
+ <form class="form-align form panel container panel-radius" action="{{.RepoLink}}/settings" method="post">
+ {{.CsrfTokenHtml}}
+ <input type="hidden" name="action" value="delete">
+ <div class="panel-content">
+ <div class="field">
+ <label class="req" for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
+ <input class="ipt ipt-large ipt-radius" id="repo_name" name="repo_name" required />
+ </div>
+ <label class="req" for="password">{{.i18n.Tr "password"}}</label>
+ <input class="ipt ipt-large ipt-radius" id="password" name="password" type="password" required/>
+ <span class="form-label"></span>
+ <button class="btn btn-large btn-red btn-radius right">{{.i18n.Tr "repo.settings.confirm_delete"}}</button>
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/repo/sidebar.tmpl b/templates/repo/sidebar.tmpl
new file mode 100644
index 0000000000..39d999cabc
--- /dev/null
+++ b/templates/repo/sidebar.tmpl
@@ -0,0 +1,28 @@
+<div id="repo-sidebar" class="right grid-1-5">
+ <ul class="menu menu-vertical" id="repo-sidebar-nav">
+ <li>
+ <a class="radius" href="{{.RepoLink}}/issues"><i class="octicon octicon-issue-opened"></i>Issues<span class="num right label label-blue label-radius">{{.Repository.NumOpenIssues}}</span></a>
+ </li>
+ <li>
+ <a class="radius" href="{{.RepoLink}}/pulls"><i class="octicon octicon-git-pull-request"></i>Pull Requests<span class="num right label label-blue label-radius">{{.Repository.NumOpenPulls}}</span></a>
+ </li>
+ <li class="border-bottom"></li>
+ <li class="head">{{if .IsViewBranch}}{{.BranchName}}{{else}}{{ShortSha .BranchName}}{{end}}</li>
+ <li>
+ <a class="radius" href="{{.RepoLink}}/commits/{{.BranchName}}"><i class="octicon octicon-history"></i>Commits <span class="num right label label-gray label-radius">{{.CommitsCount}}</span></a>
+ </li>
+ <li>
+ <a class="radius" href="{{.RepoLink}}/branches"><i class="octicon octicon-git-branch"></i>Branches<span class="num right label label-gray label-radius">{{.BrancheCount}}</span></a>
+ </li>
+ <li>
+ <a class="radius" href="{{.RepoLink}}/releases"><i class="octicon octicon-tag"></i>Releases <span class="num right label label-gray label-radius">{{.Repository.NumTags}}</span></a>
+ </li>
+ <li>
+ <a class="radius" href="#"><i class="octicon octicon-organization"></i>contributors <span class="num right label label-gray label-radius">43</span></a>
+ </li>
+ <li class="border-bottom"></li>
+ <li>
+ <a class="radius" href="{{.RepoLink}}/settings"><i class="octicon octicon-tools"></i>settings</a>
+ </li>
+ </ul>
+</div> \ No newline at end of file
diff --git a/templates/repo/single_file.tmpl b/templates/repo/single_file.tmpl
index 8c09f3ec1c..0ce04e13ba 100644
--- a/templates/repo/single_file.tmpl
+++ b/templates/repo/single_file.tmpl
@@ -21,7 +21,7 @@
</div>
{{end}}
</div>
-
+
{{if not .FileIsText}}
<div class="panel-body file-body file-code code-view">
{{if .IsImageFile}}
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl
new file mode 100644
index 0000000000..fb05945b9f
--- /dev/null
+++ b/templates/repo/view_file.tmpl
@@ -0,0 +1,37 @@
+<div class="panel panel-radius" id="repo-readme">
+ <p class="panel-header">
+ {{if .ReadmeExist}}
+ <i class="icon fa fa-book fa-lg"></i>
+ {{if .ReadmeInHome}}
+ <strong class="file-name">{{.FileName}}</strong>
+ {{else}}
+ <strong>{{.FileName}}</strong><span class="file-size">{{FileSize .FileSize}}</span>
+ {{end}}
+ {{else}}
+ <i class="icon fa fa-file-text-o"></i>
+ <strong class="file-name">{{.FileName}}</strong><span class="file-size">{{FileSize .FileSize}}</span>
+ {{end}}
+ </p>
+ <div class="{{if .ReadmeExist}}panel-content markdown{{end}} code-view">
+ {{if .ReadmeExist}}
+ {{.FileContent | Str2html}}
+ {{else if not .IsFileText}}
+ <div class="view-raw">
+ {{if .IsImageFile}}
+ <img src="{{.FileLink}}">
+ {{else}}
+ <a href="{{.FileLink}}" rel="nofollow" class="btn btn-gray btn-radius">View Raw</a>
+ {{end}}
+ </div>
+ {{else if .FileSize}}
+ <table>
+ <tbody>
+ <tr>
+ <td class="lines-num"></td>
+ <td class="lines-code"><pre class="prettyprint linenums {{if .FileExt}}lang-{{.FileExt}}{{end}}"><code>{{.FileContent}}</code></pre></td>
+ </tr>
+ </tbody>
+ </table>
+ {{end}}
+ </div>
+</div> \ No newline at end of file
diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl
new file mode 100644
index 0000000000..26e7dd4597
--- /dev/null
+++ b/templates/repo/view_list.tmpl
@@ -0,0 +1,46 @@
+<table id="repo-files-table" class="table-border table-block table-radius">
+ <thead>
+ <tr>
+ <th colspan="4" class="clear">
+ <span class="author left">
+ <img class="avatar-24 radius" src="{{AvatarLink .LastCommit.Author.Email}}" />
+ <a href="/user/email2user?email={{Md5 .LastCommit.Author.Email}}"><strong>{{.LastCommit.Author.Name}}</strong>:</a>
+ </span>
+ <span class="last-commit"><a href="{{.RepoLink}}/commit/{{.LastCommit.Id}}" rel="nofollow">
+ <strong>{{ShortSha .LastCommit.Id.String}}</strong></a>
+ <span class="text-truncate">{{.LastCommit.Summary}}</span>
+ </span>
+ <span class="age right">{{TimeSince .LastCommit.Author.When .i18n.Lang}}</span>
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {{if .HasParentPath}}
+ <tr class="has-parent">
+ <td class="icon"></td>
+ <td class="name"><a href="{{.BranchLink}}{{.ParentPath}}">..</a></td>
+ <td class="msg"></td>
+ <td class="age"></td>
+ </tr>
+ {{end}}
+ {{range $item := .Files}}
+ {{$entry := index $item 0}}
+ {{$commit := index $item 1}}
+ <tr>
+ <td class="icon">
+ <span class="octicon octicon-file-{{if $entry.IsDir}}directory{{else}}text{{end}}"></span>
+ </td>
+ <td class="name">
+ <a href="{{$.BranchLink}}/{{$.TreePath}}{{$entry.Name}}" class="text-truncate">{{$entry.Name}}</a>
+ </td>
+ <td class="msg">
+ <a class="text-truncate" href="/{{$.Username}}/{{$.Reponame}}/commit/{{$commit.Id}}" rel="nofollow">{{$commit.Summary}}</a>
+ </td>
+ <td class="age">{{TimeSince $commit.Committer.When $.i18n.Lang}}</td>
+ </tr>
+ {{end}}
+ </tbody>
+</table>
+{{if .ReadmeExist}}
+ {{template "repo/view_file" .}}
+{{end}} \ No newline at end of file
diff --git a/templates/status/200.tmpl b/templates/status/200.tmpl
deleted file mode 100644
index 0846ad7951..0000000000
--- a/templates/status/200.tmpl
+++ /dev/null
@@ -1,7 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body" class="container">
- <p>An error is occurred : {{.ErrorMsg}}</p>
- <p>Application Version: {{AppVer}}</p>
-</div>
-{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/status/401.tmpl b/templates/status/401.tmpl
index 98995381af..2c38d90fb5 100644
--- a/templates/status/401.tmpl
+++ b/templates/status/401.tmpl
@@ -1,6 +1,6 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
<div class="container">
- 401 Unauthorized
+ 401 Unauthorized: {{.ErrorMsg}}
</div>
-{{template "base/footer" .}} \ No newline at end of file
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/status/403.tmpl b/templates/status/403.tmpl
index 03a88479dd..f252146773 100644
--- a/templates/status/403.tmpl
+++ b/templates/status/403.tmpl
@@ -1,6 +1,6 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
<div class="container">
403 Forbidden
</div>
-{{template "base/footer" .}} \ No newline at end of file
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/status/404.tmpl b/templates/status/404.tmpl
index 6adb3d7163..2d04b55917 100644
--- a/templates/status/404.tmpl
+++ b/templates/status/404.tmpl
@@ -1,9 +1,11 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
<div id="body" class="container text-center">
- <p style="margin-top: 80px"><img src="/img/404.png" alt="404"/></p>
+ <p style="margin-top: 100px"><img src="/img/404.png" alt="404"/></p>
<hr/>
+ <br>
<p>Application Version: {{AppVer}}</p>
<p>If you think this is an error, please open an issue on <a href="https://github.com/gogits/gogs/issues/new">GitHub</a>.</p>
+ <h3>We're currently working on 0.5 beta version, many pages may be missing at this time. Sorry for confusion!</h3>
</div>
-{{template "base/footer" .}}
+{{template "ng/base/footer" .}}
diff --git a/templates/status/500.tmpl b/templates/status/500.tmpl
index 07edd3620a..b887532d7c 100644
--- a/templates/status/500.tmpl
+++ b/templates/status/500.tmpl
@@ -1,10 +1,10 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
<div id="body" class="container text-center">
- <p style="margin-top: 80px"><img src="/img/500.png" alt="404"/></p>
- {{if .ErrorMsg}}<hr/>
- <p>An error is occurred : {{.ErrorMsg}}</p>{{end}}
+ <p style="margin-top: 100px"><img src="/img/500.png" alt="500"/></p>
<hr/>
+ <br>
+ {{if .ErrorMsg}}<p>An error has occurred : {{.ErrorMsg}}</p>{{end}}
<p>Application Version: {{AppVer}}</p>
</div>
-{{template "base/footer" .}} \ No newline at end of file
+{{template "ng/base/footer" .}}
diff --git a/templates/user/activate.tmpl b/templates/user/activate.tmpl
deleted file mode 100644
index 1df3646b6d..0000000000
--- a/templates/user/activate.tmpl
+++ /dev/null
@@ -1,36 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body" class="container">
- <form action="/user/activate" method="post" class="form-horizontal card" id="login-card">
- {{.CsrfTokenHtml}}
- <h3>Activate Your Account</h3>
- {{if .IsActivatePage}}
- {{if .ServiceNotEnabled}}
- <p>Sorry, Register Mail Confirmation has been disabled.</p>
- {{else if .ResendLimited}}
- <p>Sorry, you are sending an activation e-mail too frequently. Please wait 3 minutes.</p>
- {{else}}
- <p>A new confirmation e-mail has been sent to <b>{{.SignedUser.Email}}</b>, please check your inbox within the next {{.Hours}} hours to complete your registration.</p>
- <hr/>
- <a href="http://{{Mail2Domain .SignedUser.Email}}" class="btn btn-lg btn-success">Sign in to your e-mail</a>
- {{end}}
- {{else}}
- {{if .IsSendRegisterMail}}
- <p>A confirmation e-mail has been sent to <b>{{.Email}}</b>, please check your inbox within the next {{.Hours}} hours to complete your registration.</p>
- <hr/>
- <a href="http://{{Mail2Domain .Email}}" class="btn btn-lg btn-success">Sign in to your e-mail</a>
- {{else if .IsActivateFailed}}
- <p>Sorry, your confirmation code has exipired or not valid.</p>
- {{else}}
- <p>Hi, {{.SignedUser.Name}}, you have an unconfirmed email address(<b>{{.SignedUser.Email}}</b>). If you haven't received a confirmation e-mail or need to resend a new one, please click on the button below.</p>
- <hr/>
- <div class="form-group">
- <div class="col-md-offset-4 col-md-6">
- <button type="submit" class="btn btn-lg btn-primary">Click here to resend your activation e-mail</button>
- </div>
- </div>
- {{end}}
- {{end}}
- </form>
-</div>
-{{template "base/footer" .}}
diff --git a/templates/user/auth/activate.tmpl b/templates/user/auth/activate.tmpl
new file mode 100644
index 0000000000..6a9e0b0d52
--- /dev/null
+++ b/templates/user/auth/activate.tmpl
@@ -0,0 +1,39 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="sign-wrapper">
+ <form class="form-align form panel sign-panel sign-form container panel-radius" id="sign-up-form" action="/user/activate" method="post">
+ {{.CsrfTokenHtml}}
+ <div class="panel-header">
+ <h2>{{.i18n.Tr "auth.active_your_account"}}</h2>
+ </div>
+ <div class="panel-content">
+ {{if .IsActivatePage}}
+ {{if .ServiceNotEnabled}}
+ <p>{{.i18n.Tr "auth.disable_register_mail"}}</p>
+ {{else if .ResendLimited}}
+ <p>{{.i18n.Tr "auth.resent_limit_prompt"}}</p>
+ {{else}}
+ <p>{{.i18n.Tr "auth.confirmation_mail_sent_prompt" .SignedUser.Email .Hours | Str2html}}</p>
+ <hr/>
+ <label></label>
+ <a class="btn btn-green btn-large btn-link btn-radius" href="http://{{Mail2Domain .SignedUser.Email}}">{{.i18n.Tr "auth.sign_in_email"}}</a>
+ {{end}}
+ {{else}}
+ {{if .IsSendRegisterMail}}
+ <p>{{.i18n.Tr "auth.confirmation_mail_sent_prompt" .Email .Hours | Str2html}}</p>
+ <hr/>
+ <label></label>
+ <a class="btn btn-green btn-large btn-link btn-radius" href="http://{{Mail2Domain .Email}}">{{.i18n.Tr "auth.sign_in_email"}}</a>
+ {{else if .IsActivateFailed}}
+ <p>{{.i18n.Tr "auth.invalid_code"}}</p>
+ {{else}}
+ <p>{{.i18n.Tr "auth.has_unconfirmed_mail" .SignedUser.Name .SignedUser.Email | Str2html}}</p>
+ <hr/>
+ <label></label>
+ <button class="btn btn-blue btn-large btn-radius">{{.i18n.Tr "auth.resend_mail"}}</button>
+ {{end}}
+ {{end}}
+ </div>
+ </form>
+</div>
+{{template "ng/base/footer" .}}
diff --git a/templates/user/auth/forgot_passwd.tmpl b/templates/user/auth/forgot_passwd.tmpl
new file mode 100644
index 0000000000..3e9f76e935
--- /dev/null
+++ b/templates/user/auth/forgot_passwd.tmpl
@@ -0,0 +1,32 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="sign-wrapper">
+ <form class="form-align form panel sign-panel sign-form container panel-radius" id="sign-up-form" action="/user/forget_password" method="post">
+ {{.CsrfTokenHtml}}
+ <div class="panel-header">
+ <h2>{{.i18n.Tr "auth.forgot_password"}}</h2>
+ </div>
+ <div class="panel-content">
+ {{template "ng/base/alert" .}}
+ {{if .IsResetSent}}
+ <p>{{.i18n.Tr "auth.confirmation_mail_sent_prompt" .Email .Hours | Str2html}}</p>
+ <hr/>
+ <label></label>
+ <a class="btn btn-green btn-large btn-link btn-radius" href="http://{{Mail2Domain .Email}}">{{.i18n.Tr "auth.sign_in_email"}}</a>
+ {{else if .IsResetRequest}}
+ <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>
+ <hr/>
+ <label></label>
+ <button class="btn btn-blue btn-large btn-radius">{{.i18n.Tr "auth.send_reset_mail"}}</button>
+ {{else if .IsResetDisable}}
+ <p>{{.i18n.Tr "auth.disable_register_mail"}}</p>
+ {{else if .ResendLimited}}
+ <p>{{.i18n.Tr "auth.resent_limit_prompt"}}</p>
+ {{end}}
+ </div>
+ </form>
+</div>
+{{template "ng/base/footer" .}}
diff --git a/templates/user/auth/reset_passwd.tmpl b/templates/user/auth/reset_passwd.tmpl
new file mode 100644
index 0000000000..3c9da96b67
--- /dev/null
+++ b/templates/user/auth/reset_passwd.tmpl
@@ -0,0 +1,25 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="sign-wrapper">
+ <form class="form-align form panel sign-panel sign-form container panel-radius" id="sign-up-form" action="/user/reset_password?code={{.Code}}" method="post">
+ {{.CsrfTokenHtml}}
+ <div class="panel-header">
+ <h2>{{.i18n.Tr "auth.reset_password"}}</h2>
+ </div>
+ <div class="panel-content">
+ {{template "ng/base/alert" .}}
+ {{if .IsResetForm}}
+ <div class="field">
+ <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>
+ <hr/>
+ <label></label>
+ <button class="btn btn-blue btn-large btn-radius">{{.i18n.Tr "auth.reset_password_helper"}}</button>
+ {{else}}
+ <p>{{.i18n.Tr "auth.invalid_code"}}</p>
+ {{end}}
+ </div>
+ </form>
+</div>
+{{template "ng/base/footer" .}}
diff --git a/templates/user/auth/signin.tmpl b/templates/user/auth/signin.tmpl
new file mode 100644
index 0000000000..c2f6ef877a
--- /dev/null
+++ b/templates/user/auth/signin.tmpl
@@ -0,0 +1,44 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="sign-wrapper">
+ <form class="form-align form panel sign-panel sign-form container panel-radius" id="sign-up-form" action="/user/login" method="post">
+ <div class="panel-header">
+ <h2>{{if .IsSocialLogin}}{{.i18n.Tr "social_sign_in" | Str2html}}{{else}}{{.i18n.Tr "sign_in"}}{{end}}</h2>
+ </div>
+ <div class="panel-content">
+ {{template "ng/base/alert" .}}
+ <div class="field">
+ <label class="req" for="username">{{.i18n.Tr "home.uname_holder"}}</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="password">{{.i18n.Tr "password"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_Password}}ipt-error{{end}}" id="password" name="password" type="password" required/>
+ </div>
+ {{if not .IsSocialLogin}}
+ <div class="field">
+ <span class="form-label"></span>
+ <input class="ipt-chk" id="remember" name="remember" type="checkbox"/>&nbsp;&nbsp;&nbsp;&nbsp;<strong>{{.i18n.Tr "auth.remember_me"}}</strong>
+ </div>
+ {{end}}
+ <div class="field">
+ <span class="form-label"></span>
+ <button class="btn btn-green btn-large btn-radius">{{.i18n.Tr "sign_in"}}</button>&nbsp;&nbsp;&nbsp;&nbsp;
+ {{if not .IsSocialLogin}}<a href="/user/forget_password">{{.i18n.Tr "auth.forget_password"}}</a>{{end}}
+ </div>
+ {{if not .IsSocialLogin}}
+ <div class="field">
+ <label></label>
+ <a href="/user/sign_up">{{.i18n.Tr "auth.sign_up_now" | Str2html}}</a>
+ </div>
+ {{if .OauthEnabled}}
+ <hr/>
+ <div id="sign-social" class="text-center social-buttons">
+ {{template "ng/base/social" .}}
+ </div>
+ {{end}}
+ {{end}}
+ </div>
+ </form>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/user/auth/signup.tmpl b/templates/user/auth/signup.tmpl
new file mode 100644
index 0000000000..d116ad6276
--- /dev/null
+++ b/templates/user/auth/signup.tmpl
@@ -0,0 +1,49 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="sign-wrapper">
+ <form class="form-align form panel panel-radius sign-panel sign-form container" id="sign-up-form" action="/user/sign_up" method="post">
+ <div class="panel-header">
+ <h2>{{if .IsSocialLogin}}{{.i18n.Tr "social_sign_in" | Str2html}}{{else}}{{.i18n.Tr "sign_up"}}{{end}}</h2>
+ </div>
+ <div class="panel-content">
+ {{template "ng/base/alert" .}}
+ {{if .DisableRegistration}}
+ <p>{{.i18n.Tr "auth.disable_register_prompt"}}</p>
+ {{else}}
+ <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">
+ <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">
+ <label></label>
+ {{.Captcha.CreateHtml}}
+ </div>
+ <div class="field">
+ <label class="req" for="captcha">{{.i18n.Tr "captcha"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_Captcha}}ipt-error{{end}}" id="captcha" name="captcha" type="text" required/>
+ </div>
+ <div class="field">
+ <span class="form-label"></span>
+ <button class="btn btn-blue btn-large btn-radius">{{.i18n.Tr "auth.create_new_account"}}</button>
+ </div>
+ <div class="field">
+ <span class="form-label"></span>
+ <a href="/user/login">{{if .IsSocialLogin}}{{.i18n.Tr "auth.social_register_hepler_msg"}}{{else}}{{.i18n.Tr "auth.register_hepler_msg"}}{{end}}</a>
+ </div>
+ {{end}}
+ </div>
+ </form>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/user/dashboard.tmpl b/templates/user/dashboard.tmpl
deleted file mode 100644
index 2cb19cef16..0000000000
--- a/templates/user/dashboard.tmpl
+++ /dev/null
@@ -1,102 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body-nav">
- <div class="container">
- <div class="btn-group pull-left" id="dashboard-switch">
- <button type="button" class="btn btn-default">
- <img src="{{.ContextUser.AvatarLink}}?s=28" alt="user-avatar" title="username">
- {{.ContextUser.Name}}
- </button>
- <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
- <span class="caret"></span>
- </button>
- <div class="dropdown-menu clone-group-btn no-propagation">
- <ul id="dashboard-switch-menu" class="list-unstyled">
- <li{{if not .PageIsOrgDashboard}} class="checked"{{end}}>
- <a href="/">
- <i class="fa fa-check"></i>
- <img src="{{.SignedUser.AvatarLink}}?s=28" alt="user-avatar" title="username">
- {{.SignedUser.Name}}
- </a>
- </li>
- {{range .Orgs}}
- <li{{if eq $.ContextUser.Id .Id}} class="checked"{{end}}>
- <a href="/org/{{.Name}}/dashboard">
- <i class="fa fa-check"></i>
- <img src="{{.AvatarLink}}?s=28" alt="user-avatar" title="username">
- {{.Name}}
- </a>
- </li>
- {{end}}
- <li>
- <a href="/org/create">Create organization</a>
- </li>
- </ul>
- </div>
- </div>
- <ul class="nav nav-pills pull-right">
- <li class="active"><a href="/{{if .PageIsOrgDashboard}}org/{{.ContextUser.Name}}/dashboard{{end}}">News Feed</a></li>
- <li><a href="/{{if .PageIsOrgDashboard}}org/{{.ContextUser.Name}}/dashboard/{{end}}issues">Issues</a></li>
- {{if .PageIsOrgDashboard}}<li><a href="/org/{{.ContextUser.Name}}/settings">Settings</a></li>{{end}}
- <!-- <li><a href="/pulls">Pull Requests</a></li>
- <li><a href="/stars">Stars</a></li> -->
- </ul>
- </div>
-</div>
-
-<div id="body" class="container" data-page="user">
- {{if .HasInfo}}<div class="alert alert-info">{{.InfoMsg}}</div>{{end}}
- <div id="feed-left" class="col-md-8">
- <ul class="list-unstyled activity-list">
- {{range .Feeds}}
- <li>
- <i class="icon fa fa-{{ActionIcon .OpType}}"></i>
- <div class="info"><span class="meta">{{TimeSince .Created}}</span><br>{{ActionDesc . | str2html}}</div>
- <span class="clearfix"></span>
- </li>
- {{else}}
- <li>Oh. Looks like there isn't any activity here yet. Get Busy!</li>
- {{end}}
- </ul>
- </div>
- <div id="feed-right" class="col-md-4">
- <div class="panel panel-default repo-panel">
- <div class="panel-heading">{{if not .PageIsOrgDashboard}}Your {{end}}Repositories
- <div class="btn-group pull-right" id="user-dashboard-repo-new">
- <button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus-square"></i>New</button>
- <div class="dropdown-menu dropdown-menu-right">
- <ul class="list-unstyled">
- <li><a href="/repo/create"><i class="fa fa-book"></i>Repository</a></li>
- <li><a href="/repo/migrate"><i class="fa fa-clipboard"></i>Migration</a></li>
- <!-- <li><a href="#"><i class="fa fa-users"></i>Organization</a></li> -->
- </ul>
- </div>
- </div>
- </div>
-
- <div class="panel-body">
- <ul class="list-group">{{range .MyRepos}}
- <li class="list-group-item"><a href="/{{$.ContextUser.Name}}/{{.Name}}">
- <!-- <span class="stars pull-right"><i class="fa fa-star"></i>{{.NumStars}}</span> -->
- <i class="fa fa-book"></i>{{.Name}}{{if .IsPrivate}} <span class="label label-default">Private</span>{{end}}</a>
- </li>{{end}}
- </ul>
- </div>
- </div>
-
- {{if not .PageIsOrgDashboard}}
- <div class="panel panel-default repo-panel">
- <div class="panel-heading">Collaborative Repositories</div>
- <div class="panel-body">
- <ul class="list-group">{{range .CollaborativeRepos}}
- <li class="list-group-item"><a href="/{{.Owner.Name}}/{{.Name}}">
- <!-- <span class="stars pull-right"><i class="fa fa-star"></i>{{.NumStars}}</span> -->
- <i class="fa fa-book"></i>{{.Name}}{{if .IsPrivate}} <span class="label label-default">Private</span>{{end}}</a>
- </li>{{end}}
- </ul>
- </div>
- </div>
- {{end}}
- </div>
-</div>
-{{template "base/footer" .}}
diff --git a/templates/user/dashboard/dashboard.tmpl b/templates/user/dashboard/dashboard.tmpl
new file mode 100644
index 0000000000..df4fc0b65e
--- /dev/null
+++ b/templates/user/dashboard/dashboard.tmpl
@@ -0,0 +1,168 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+{{template "user/dashboard/nav" .}}
+<div id="dashboard-wrapper">
+ <div id="dashboard" class="container">
+ <div id="dashboard-news" class="left grid-2-3">
+ {{range .Feeds}}
+ <div class="news clear">
+ <div class="avatar left">
+ <img class="avatar-30" src="{{AvatarLink .GetActEmail}}" alt="">
+ </div>
+ <div class="content left {{if eq .GetOpType 5}}push-news{{end}}">
+ <p class="text-bold">
+ <a href="/{{.GetActUserName}}">{{.GetActUserName}}</a>
+ {{if eq .GetOpType 1}}
+ {{$.i18n.Tr "action.create_repo" .GetRepoLink .GetRepoLink | Str2html}}
+ {{else if eq .GetOpType 5}}
+ {{$.i18n.Tr "action.commit_repo" .GetRepoLink .GetBranch .GetBranch .GetRepoLink .GetRepoLink | Str2html}}
+ {{else if eq .GetOpType 6}}
+ {{ $index := index .GetIssueInfos 0}}
+ {{$.i18n.Tr "action.create_issue" .GetRepoLink $index .GetRepoLink $index | Str2html}}
+ {{else if eq .GetOpType 10}}
+ {{ $index := index .GetIssueInfos 0}}
+ {{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .GetRepoLink $index | Str2html}}
+ {{end}}
+ </p>
+ {{if eq .GetOpType 5}}
+ <div class="news-content content">
+ <ul class="list-no-style">
+ {{ $push := ActionContent2Commits .}}
+ {{ $repoLink := .GetRepoLink}}
+ {{range $push.Commits}}
+ <li><img class="avatar-16" src="{{AvatarLink .AuthorEmail}}?s=16"> <a href="/{{$repoLink}}/commit/{{.Sha1}}">{{ShortSha .Sha1}}</a> {{.Message}}</li>
+ {{end}}
+ </ul>
+ </div>
+ {{else if eq .GetOpType 6}}
+ <p class="news-content comment-news">{{index .GetIssueInfos 1}}</p>
+ {{else if eq .GetOpType 10}}
+ <p class="news-content comment-news">{{index .GetIssueInfos 1}}</p>
+ {{end}}
+ <p class="news-time text-italic">{{TimeSince .GetCreate $.i18n.Lang}}</p>
+ </div>
+ <i class="mega-octicon octicon-{{ActionIcon .GetOpType}} right"></i>
+ </div>
+ {{end}}
+ </div>
+ <div id="dashboard-sidebar" class="right grid-1-3">
+ <ul id="dashboard-sidebar-menu" class="menu menu-line">
+ <li class="js-tab-nav js-tab-nav-show first" data-tab-target="#dashboard-my-repo"><a href="#">{{.i18n.Tr "repository"}}</a></li>
+ {{if not .ContextUser.IsOrganization}}
+ <li class="js-tab-nav" data-tab-target="#dashboard-my-org"><a href="#">{{.i18n.Tr "organization"}}</a></li>
+ {{end}}
+ <li class="js-tab-nav last" data-tab-target="#dashboard-my-mirror"><a href="#">{{.i18n.Tr "mirror"}}</a></li>
+ <li class="drop right">
+ <button class="btn btn-green text-bold" id="dashboard-new-repo">
+ <i class="octicon octicon-plus"></i>
+ </button>
+ <ul class="menu menu-vertical drop-down" id="dashboard-new-repo-menu">
+ <li><a href="/repo/create"><i class="octicon octicon-repo-create"></i>{{.i18n.Tr "new_repo"}}</a></li>
+ <li><a href="/org/create"><i class="octicon octicon-organization"></i>{{.i18n.Tr "new_org"}}</a></li>
+ </ul>
+ </li>
+ </ul>
+ <div class="panel" id="dashboard-my-repo">
+ <div class="panel-header">
+ <h4 class="left">{{.i18n.Tr "home.my_repos"}}
+ <span class="repo-count label label-gray label-radius">{{.ContextUser.NumRepos}}</span>
+ </h4>
+ &nbsp;
+ </div>
+ <div class="panel-body">
+ <ul class="list-no-style">
+ {{range .Repos}}
+ <li {{if .IsPrivate}}class="private"{{end}}>
+ <a href="/{{$.ContextUser.Name}}/{{.Name}}">
+ <i class="octicon octicon-{{if .IsPrivate}}lock{{else if .IsFork}}repo-forked{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i>
+ <span class="repo-name">
+ <strong class="repo">{{.Name}}</strong>
+ </span>
+ <span class="right repo-star">
+ <i class="octicon octicon-star"></i>{{.NumStars}}
+ </span>
+ </a>
+ </li>
+ {{end}}
+ </ul>
+ </div>
+ {{if not .ContextUser.IsOrganization}}
+ <div class="panel-header repo-contrib-header">
+ <h4 class="text-bold">{{.i18n.Tr "home.collaborative_repos"}}
+ <span class="repo-count label label-gray label-radius">{{.CollaborateCount}}</span>
+ </h4>
+ </div>
+ <div class="panel-body">
+ <ul class="list-no-style">
+ {{range .CollaborativeRepos}}
+ <li {{if .IsPrivate}}class="private"{{end}}>
+ <a href="{{.Owner.Name}}/{{.Name}}">
+ <i class="octicon octicon-{{if .IsPrivate}}lock{{else if .IsFork}}repo-forked{{else if .IsMirror}}repo-clone{{else}}repo{{end}}"></i>
+ <span class="repo-name">
+ <span class="repo-name-prefix">{{.Owner.Name}} / </span>
+ <strong class="repo">{{.Name}}</strong>
+ </span>
+ <span class="right repo-star">
+ <i class="octicon octicon-star"></i>{{.NumStars}}
+ </span>
+ </a>
+ </li>
+ {{end}}
+ </ul>
+ </div>
+ {{end}}
+ </div>
+ {{if not .ContextUser.IsOrganization}}
+ <div class="panel" id="dashboard-my-org">
+ <div class="panel-header">
+ <h4 class="text-bold">{{.i18n.Tr "home.my_orgs"}}
+ <span class="repo-count label label-gray label-radius">{{.ContextUser.GetOrganizationCount}}</span>
+ </h4>
+ </div>
+ <div class="panel-body">
+ <ul class="list-no-style">
+ {{range .ContextUser.Orgs}}
+ <li>
+ <a href="/{{.Name}}">
+ <i class="octicon octicon-organization"></i>
+ <span class="repo-name">
+ <strong class="repo">{{.Name}}</strong>
+ </span>
+ <span class="right repo-star">
+ <i class="octicon octicon-repo"></i>{{.NumRepos}}
+ </span>
+ </a>
+ </li>
+ {{end}}
+ </ul>
+ </div>
+ </div>
+ {{end}}
+ <div class="panel" id="dashboard-my-mirror">
+ <div class="panel-header">
+ <h4 class="text-bold">{{.i18n.Tr "home.my_mirrors"}}
+ <span class="repo-count label label-gray label-radius">{{.MirrorCount}}</span>
+ </h4>
+ </div>
+ <div class="panel-body">
+ <ul class="list-no-style">
+ {{range .Mirrors}}
+ <li {{if .IsPrivate}}class="private"{{end}}>
+ <a href="/{{$.ContextUser.Name}}/{{.Name}}">
+ <i class="octicon octicon-repo-clone"></i>
+ <span class="repo-name">
+ <strong class="repo">{{.Name}}</strong>
+ </span>
+ <span class="right repo-star">
+ <i class="octicon octicon-sync"></i>{{.Interval}}H
+ </span>
+ </a>
+ </li>
+ {{end}}
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/user/dashboard/nav.tmpl b/templates/user/dashboard/nav.tmpl
new file mode 100644
index 0000000000..6064f35692
--- /dev/null
+++ b/templates/user/dashboard/nav.tmpl
@@ -0,0 +1,46 @@
+<div id="dashboard-header">
+ <ul class="menu menu-line container">
+ <li id="dashboard-selection-menu" class="down drop">
+ <a href="#" class="text-bold radius">
+ <img class="avatar-30" src="{{.ContextUser.AvatarLink}}" alt="user-avatar" />
+ {{.ContextUser.Name}}
+ </a>
+ <div class="drop-down panel panel-radius">
+ <p class="panel-header"><strong>{{.i18n.Tr "home.switch_dashboard_context"}}</strong></p>
+ <ul class="menu menu-vertical switching-list" id="dashboard-switch-menu">
+ <li class="org {{if eq .ContextUser.Id .SignedUser.Id}}checked{{end}}">
+ <a href="/">
+ <i class="octicon octicon-check"></i>
+ <img class="avatar-24" src="{{.SignedUser.AvatarLink}}" alt="user-avatar" />
+ {{.SignedUser.Name}}
+ </a>
+ </li>
+ {{range .Orgs}}
+ <li class="org {{if eq $.ContextUser.Id .Id}}checked{{end}}">
+ <a href="{{.DashboardLink}}">
+ <i class="octicon octicon-check"></i>
+ <img class="avatar-24" src="{{.AvatarLink}}" alt="user-avatar" />
+ {{.Name}}
+ </a>
+ </li>
+ {{end}}
+ <li>
+ <a href="/user/settings/orgs"><i class="octicon octicon-organization"></i>{{.i18n.Tr "manage_org"}}</a>
+ </li>
+ <li>
+ <a href="/org/create"><i class="octicon octicon-plus"></i>{{.i18n.Tr "new_org"}}</a>
+ </li>
+ </ul>
+ </div>
+ </li>
+ <li class="right">
+ <a {{if $.PageIsIssues}}class="current"{{end}} href="{{.ContextUser.DashboardLink}}issues"><i class="octicon octicon-issue-opened"></i>{{.i18n.Tr "issues"}}</a>
+ </li>
+ <li class="right">
+ <a {{if .PageIsPulls}}class="current"{{end}} href="{{.ContextUser.DashboardLink}}pulls"><i class="octicon octicon-git-pull-request"></i>{{.i18n.Tr "pull_requests"}}</a>
+ </li>
+ <li class="right">
+ <a {{if $.PageIsNews}}class="current"{{end}} href="{{.ContextUser.DashboardLink}}"><i class="octicon octicon-rss"></i>{{.i18n.Tr "news_feed"}}</a>
+ </li>
+ </ul>
+</div> \ No newline at end of file
diff --git a/templates/user/dashboard/pulls.tmpl b/templates/user/dashboard/pulls.tmpl
new file mode 100644
index 0000000000..9a03684250
--- /dev/null
+++ b/templates/user/dashboard/pulls.tmpl
@@ -0,0 +1,5 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+{{template "user/dashboard/nav" .}}
+
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/user/delete.tmpl b/templates/user/delete.tmpl
deleted file mode 100644
index fe29173560..0000000000
--- a/templates/user/delete.tmpl
+++ /dev/null
@@ -1,45 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body" class="container" data-page="user">
- {{template "user/setting_nav" .}}
- <div id="repo-setting-container" class="col-md-10">
- {{template "base/alert" .}}
- <div class="panel panel-warning">
- <div class="panel-heading">
- Delete Account
- </div>
-
- <div class="panel-body">
- {{if not .Flash.ErrorMsg}}<p class="alert alert-danger">The operation will delete your account permanently. Sorry to see you go, but we know you'll back soon.</p>{{end}}
- <div class="form-group">
- <button type="submit" class="btn btn-danger btn-lg" href="#delete-account-modal" id="delete-account" data-toggle="modal">Delete Account</button>
- </div>
- </div>
- </div>
- </div>
-
- <div class="modal fade" id="delete-account-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
- <div class="modal-dialog">
- <form action="/user/delete" method="post" class="modal-content" id="user-delete">
- {{.CsrfTokenHtml}}
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
- <h4 class="modal-title" id="myModalLabel">Delete Account</h4>
- </div>
-
- <div class="modal-body">
- <div class="form-group">
- <label>Make sure your are owner of this account. Please enter your password.<strong class="text-danger">*</strong></label>
- <input name="password" class="form-control" type="password" placeholder="Type your account password" required="required">
- </div>
- </div>
-
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
- <button type="submit" class="btn btn-danger">Delete</button>
- </div>
- </form>
- </div>
- </div>
-</div>
-{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/user/forgot_passwd.tmpl b/templates/user/forgot_passwd.tmpl
deleted file mode 100644
index 57564ffd4f..0000000000
--- a/templates/user/forgot_passwd.tmpl
+++ /dev/null
@@ -1,32 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body" class="container">
- <form action="/user/forget_password" method="post" class="form-horizontal card" id="login-card">
- {{.CsrfTokenHtml}}
- <h3>Reset Your Password</h3>
- {{template "base/alert" .}}
- {{if .IsResetSent}}
- <p>A confirmation e-mail has been sent to <b>{{.Email}}</b>, please check your inbox within {{.Hours}} hours.</p>
- <hr/>
- <a href="http://{{Mail2Domain .Email}}" class="btn btn-lg btn-success">Sign in to your e-mail</a>
- {{else if .IsResetRequest}}
- <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 your e-mail address" required="required">
- </div>
- </div>
- <hr/>
- <div class="form-group">
- <div class="col-md-offset-4 col-md-6">
- <button type="submit" class="btn btn-lg btn-primary">Click here to send resend confirmation e-mail</button>
- </div>
- </div>
- {{else if .IsResetDisable}}
- <p>Sorry, mail service is not enabled.</p>
- {{else if .ResendLimited}}
- <p>Sorry, you are sending an e-mail too frequently, please wait another 3 minutes and try again.</p>
- {{end}}
- </form>
-</div>
-{{template "base/footer" .}}
diff --git a/templates/user/issues.tmpl b/templates/user/issues.tmpl
index c4ad64a4cf..93e798aa30 100644
--- a/templates/user/issues.tmpl
+++ b/templates/user/issues.tmpl
@@ -41,7 +41,7 @@
<p class="info">
<span class="author"><img class="avatar" src="{{.Poster.AvatarLink}}" alt="" width="20"/>
<a href="/user/{{.Poster.Name}}">{{.Poster.Name}}</a></span>
- <span class="time">{{TimeSince .Created}}</span>
+ <span class="time">{{TimeSince .Created $.Lang}}</span>
<span class="comment"><i class="fa fa-comments"></i> {{.NumComments}}</span>
</p>
</div>
diff --git a/templates/user/notification.tmpl b/templates/user/notification.tmpl
deleted file mode 100644
index 7c2e8425d4..0000000000
--- a/templates/user/notification.tmpl
+++ /dev/null
@@ -1,9 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body" class="container" data-page="user">
- {{template "user/setting_nav" .}}
- <div id="user-setting-container" class="col-md-9">
- <h4>Notification</h4>
- </div>
-</div>
-{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/user/password.tmpl b/templates/user/password.tmpl
deleted file mode 100644
index 955a744e4f..0000000000
--- a/templates/user/password.tmpl
+++ /dev/null
@@ -1,49 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body" class="container" data-page="user">
- {{template "user/setting_nav" .}}
- <div id="user-setting-container" class="col-md-10">
- {{template "base/alert" .}}
- <div class="panel panel-default">
- <div class="panel-heading">
- Password
- </div>
-
- <div class="panel-body">
- <div class="col-md-8">
- <form class="form-horizontal" id="password-form" method="post" action="/user/settings/password">
- {{.CsrfTokenHtml}}
- <div class="form-group">
- <label class="col-md-3 control-label">Old Password<strong class="text-danger">*</strong></label>
- <div class="col-md-7">
- <input type="password" name="oldpasswd" class="form-control" placeholder="Type your current password" required="required">
- </div>
- </div>
-
- <div class="form-group">
- <label class="col-md-3 control-label">New Password<strong class="text-danger">*</strong></label>
- <div class="col-md-7">
- <input type="password" name="newpasswd" class="form-control" placeholder="Type your new password" required="required">
- </div>
- </div>
-
- <div class="form-group">
- <label class="col-md-3 control-label">Re-Type<strong class="text-danger">*</strong></label>
- <div class="col-md-7">
- <input type="password" name="retypepasswd" class="form-control" placeholder="Re-type your new password" required="required">
- </div>
- </div>
-
- <div class="form-group">
- <div class="col-md-offset-3 col-md-7">
- <button type="submit" class="btn btn-primary">Change Password</button>&nbsp;&nbsp;
- <a href="/user/forget_password/">Forgot your password?</a>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
-</div>
-{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl
index 0c9ada0130..fe4e32f703 100644
--- a/templates/user/profile.tmpl
+++ b/templates/user/profile.tmpl
@@ -9,7 +9,7 @@
{{if .Owner.FullName}}<span id="user-full-name" class="center-block">{{.Owner.FullName}}</span>{{end}}
<span id="user-name" class="center-block">{{.Owner.Name}}</span>
</div>
-
+
<div class="profile-info">
<ul class="list-group">
{{if .Owner.Location}}
@@ -50,8 +50,8 @@
<ul class="list-unstyled activity-list">
{{range .Feeds}}
<li>
- <i class="icon fa fa-{{ActionIcon .OpType}}"></i>
- <div class="info"><span class="meta">{{TimeSince .Created}}</span><br>{{ActionDesc . | str2html}}</div>
+ <i class="icon fa fa-{{ActionIcon .GetOpType}}"></i>
+ <div class="info"><span class="meta">{{TimeSince .Created $.Lang}}</span><br>{{ActionDesc . | str2html}}</div>
<span class="clearfix"></span>
</li>
{{else}}
@@ -69,7 +69,7 @@
<a href="/{{$.Owner.Name}}/{{.Name}}">{{.Name}}{{if .IsPrivate}} <span class="label label-default">Private</span>{{end}}</a>
</h4>
<p class="desc">{{.Description}}</p>
- <div class="info">Last updated {{.Updated|TimeSince}}</div>
+ <div class="info">Last updated {{TimeSince .Updated $.Lang}}</div>
</li>
{{end}}
</ul>
diff --git a/templates/user/publickey.tmpl b/templates/user/publickey.tmpl
deleted file mode 100644
index 49b6b9caac..0000000000
--- a/templates/user/publickey.tmpl
+++ /dev/null
@@ -1,65 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body" class="container" data-page="user">
- {{template "user/setting_nav" .}}
- <div id="repo-setting-container" class="col-md-10">
- {{template "base/alert" .}}
- <div class="panel panel-default">
- <div class="panel-heading">
- SSH Keys
- </div>
-
- <div class="panel-body">
- <div id="ssh-keys">
- <ul id="ssh-keys-list" class="list-group">
- <li class="list-group-item"><span class="name">SSH Key's name</span></li>
- {{range .Keys}}
- <li class="list-group-item">
- <span class="name">{{.Name}}</span>
- <span class="print">({{.Fingerprint}})</span>
- <button href="#" class="btn btn-danger delete pull-right" rel="{{.Id}}" data-del="{{.Id}}">Delete</button>
- </li>
- {{end}}
- <li class="list-group-item">
- <a class="btn btn-link btn-primary" href="#ssh-add-modal" id="ssh-add" data-toggle="modal">Add SSH Key</a>
- </li>
- </ul>
- <div class="modal fade" id="ssh-add-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
- <div class="modal-dialog">
- <form class="modal-content form-horizontal" id="ssh-form" method="post" action="/user/settings/ssh/">
- {{.CsrfTokenHtml}}
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
- <h4 class="modal-title" id="myModalLabel">Add SSH Key</h4>
- </div>
-
- <div class="modal-body">
- <div class="form-group">
- <label class="col-md-3 control-label">Key Name<strong class="text-danger">*</strong></label>
- <div class="col-md-8">
- <input name="keyname" class="form-control" placeholder="Type your preferred name" required="required">
- </div>
- </div>
-
- <div class="form-group">
- <label class="col-md-3 control-label">SSH Key<strong class="text-danger">*</strong></label>
- <div class="col-md-8">
- <textarea name="key_content" class="form-control" placeholder="Type your key content" required="required"></textarea>
- </div>
- </div>
- </div>
-
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
- <button type="submit" class="btn btn-primary">Save SSH Key</button>
- </div>
- </form>
- </div>
- </div>
- <p><strong>Need help?</strong> Check out the guide to <a href="https://help.github.com/articles/generating-ssh-keys" target="_blank">generating SSH keys</a> or troubleshoot <a href="https://help.github.com/ssh-issues/" target="_blank">common SSH Problems</a></p>
- </div>
- </div>
- </div>
- </div>
-</div>
-{{template "base/footer" .}}
diff --git a/templates/user/pulls.tmpl b/templates/user/pulls.tmpl
deleted file mode 100644
index 47462a9be6..0000000000
--- a/templates/user/pulls.tmpl
+++ /dev/null
@@ -1,17 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body-nav">
- <div class="container">
- <ul class="nav nav-pills pull-right">
- <li><a href="/">Feed</a></li>
- <li><a href="/issues">Issues</a></li>
- <li class="active"><a href="/pulls">Pull Requests</a></li>
- <li><a href="/stars">Stars</a></li>
- </ul>
- <h3>Pull Requests</h3>
- </div>
-</div>
-<div id="body" class="container" data-page="user">
- {{if .HasInfo}}<div class="alert alert-info">{{.InfoMsg}}</div>{{end}}
-</div>
-{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/user/reset_passwd.tmpl b/templates/user/reset_passwd.tmpl
deleted file mode 100644
index a2a5ca9ece..0000000000
--- a/templates/user/reset_passwd.tmpl
+++ /dev/null
@@ -1,26 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body" class="container">
- <form action="/user/reset_password?code={{.Code}}" method="post" class="form-horizontal card" id="login-card">
- {{.CsrfTokenHtml}}
- <h3>Reset Your Pasword</h3>
- {{template "base/alert" .}}
- {{if .IsResetForm}}
- <div class="form-group">
- <label class="col-md-4 control-label">Password: </label>
- <div class="col-md-6">
- <input name="passwd" type="password" class="form-control" placeholder="Type your password" required="required">
- </div>
- </div>
- <hr/>
- <div class="form-group">
- <div class="col-md-offset-4 col-md-6">
- <button type="submit" class="btn btn-lg btn-primary">Click here to reset your password</button>
- </div>
- </div>
- {{else}}
- <p>Sorry, your confirmation code has expired or is not valid.</p>
- {{end}}
- </form>
-</div>
-{{template "base/footer" .}}
diff --git a/templates/user/security.tmpl b/templates/user/security.tmpl
deleted file mode 100644
index 7de41ebd35..0000000000
--- a/templates/user/security.tmpl
+++ /dev/null
@@ -1,9 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body" class="container" data-page="user">
- {{template "user/setting_nav" .}}
- <div id="user-setting-container" class="col-md-9">
- <h4>Security</h4>
- </div>
-</div>
-{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/user/setting.tmpl b/templates/user/setting.tmpl
deleted file mode 100644
index b197b0eb5f..0000000000
--- a/templates/user/setting.tmpl
+++ /dev/null
@@ -1,69 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body" class="container" data-page="user">
- {{template "user/setting_nav" .}}
- <div id="user-setting-container" class="col-md-10">
- {{template "base/alert" .}}
- <div class="panel panel-default">
- <div class="panel-heading">
- Account Profile
- </div>
-
- <div class="panel-body">
- <form class="form-horizontal" id="password-form" method="post" action="/user/settings">
- {{.CsrfTokenHtml}}
- <p>Your Email address is public and will be used for any account related notifications, and any web based operations made via the site.</p>
- <div class="form-group {{if .Err_UserName}}has-error has-feedback{{end}}">
- <label class="col-md-2 control-label" for="user-setting-username">Username<strong class="text-danger">*</strong></label>
- <div class="col-md-8">
- <input name="username" class="form-control" placeholder="Type your user name" required="required" value="{{.SignedUser.Name}}" title="{{.SignedUser.Name}}" id="user-setting-username">
- <p class="help-block hidden"><span class="text-danger">Caution : </span>your username is changing !</p>
- </div>
- </div>
-
- <div class="form-group {{if .Err_FullName}}has-error has-feedback{{end}}">
- <label class="col-md-2 control-label">Full Name</label>
- <div class="col-md-8">
- <input name="fullname" class="form-control" placeholder="Type your full name" value="{{.SignedUser.FullName}}">
- </div>
- </div>
-
- <div class="form-group {{if .Err_Email}}has-error has-feedback{{end}}">
- <label class="col-md-2 control-label">Email<strong class="text-danger">*</strong></label>
- <div class="col-md-8">
- <input name="email" class="form-control" placeholder="Type your e-mail address" required="required" value="{{.SignedUser.Email}}">
- </div>
- </div>
-
- <div class="form-group {{if .Err_Website}}has-error has-feedback{{end}}">
- <label class="col-md-2 control-label">Website</label>
- <div class="col-md-8">
- <input name="website" class="form-control" placeholder="Type your website URL" value="{{.SignedUser.Website}}">
- </div>
- </div>
-
- <div class="form-group {{if .Err_Location}}has-error has-feedback{{end}}">
- <label class="col-md-2 control-label">Location</label>
- <div class="col-md-8">
- <input name="location" class="form-control" placeholder="Type your current location" value="{{.SignedUser.Location}}">
- </div>
- </div>
-
- <div class="form-group {{if .Err_Avatar}}has-error has-feedback{{end}}">
- <label class="col-md-2 control-label">Gravatar Email<strong class="text-danger">*</strong></label>
- <div class="col-md-8">
- <input name="avatar" class="form-control" placeholder="Type your Gravatar e-mail address" required="required" value="{{.SignedUser.AvatarEmail}}">
- </div>
- </div>
-
- <div class="form-group">
- <div class="col-md-offset-2 col-md-8">
- <button type="submit" class="btn btn-primary">Update Profile</button>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
-</div>
-{{template "base/footer" .}}
diff --git a/templates/user/setting_nav.tmpl b/templates/user/setting_nav.tmpl
deleted file mode 100644
index 7ee7982bdd..0000000000
--- a/templates/user/setting_nav.tmpl
+++ /dev/null
@@ -1,11 +0,0 @@
-<div id="user-setting-nav" class="col-md-2 repo-setting-nav">
- <ul class="list-group">
- <li class="list-group-item{{if .IsUserPageSetting}} active{{end}}"><a href="/user/settings">Account Profile</a></li>
- <li class="list-group-item{{if .IsUserPageSettingSocial}} active{{end}}"><a href="/user/settings/social">Social Account</a></li>
- <li class="list-group-item{{if .IsUserPageSettingPasswd}} active{{end}}"><a href="/user/settings/password">Password</a></li>
- <!-- <li class="list-group-item{{if .IsUserPageSettingNotify}} active{{end}}"><a href="/user/setting/notification">Notifications</a></li> -->
- <li class="list-group-item{{if .IsUserPageSettingSSH}} active{{end}}"><a href="/user/settings/ssh/">SSH Keys</a></li>
- <!-- <li class="list-group-item{{if .IsUserPageSettingSecurity}} active{{end}}"><a href="/user/setting/security">Security</a></li> -->
- <li class="list-group-item{{if .IsUserPageSettingDelete}} active{{end}}"><a href="/user/delete">Delete Account</a></li>
- </ul>
-</div> \ No newline at end of file
diff --git a/templates/user/settings/delete.tmpl b/templates/user/settings/delete.tmpl
new file mode 100644
index 0000000000..9bfc287d8e
--- /dev/null
+++ b/templates/user/settings/delete.tmpl
@@ -0,0 +1,28 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="setting-wrapper" class="main-wrapper">
+ <div id="user-profile-setting" class="container clear">
+ {{template "user/settings/nav" .}}
+ <div class="grid-4-5 left">
+ <div class="setting-content">
+ {{template "ng/base/alert" .}}
+ <div id="setting-content">
+ <div id="user-profile-setting-content" class="panel panel-warning panel-radius">
+ <p class="panel-header"><strong>{{.i18n.Tr "settings.delete_account"}}</strong></p>
+ <div class="panel-body panel-content">
+ <span class="alert alert-red alert-radius block"><i class="octicon octicon-alert"></i>{{.i18n.Tr "settings.delete_prompt" | Str2html}}</span>
+ <form action="/user/settings/delete" method="post">
+ {{.CsrfTokenHtml}}
+ <p class="field">
+ <span class="form-label"></span>
+ <button class="btn btn-red btn-large btn-radius" id="delete-account-button">{{.i18n.Tr "settings.confirm_delete_account"}}</button>
+ </p>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/user/settings/nav.tmpl b/templates/user/settings/nav.tmpl
new file mode 100644
index 0000000000..d6d20dee96
--- /dev/null
+++ b/templates/user/settings/nav.tmpl
@@ -0,0 +1,12 @@
+<div id="setting-menu" class="grid-1-5 panel panel-radius left">
+ <p class="panel-header"><strong>{{.i18n.Tr "settings"}}</strong></p>
+ <div class="panel-body">
+ <ul class="menu menu-vertical switching-list grid-1-5 left">
+ <li {{if .PageIsSettingsProfile}}class="current"{{end}}><a href="/user/settings">{{.i18n.Tr "settings.profile"}}</a></li>
+ <li {{if .PageIsSettingsPassword}}class="current"{{end}}><a href="/user/settings/password">{{.i18n.Tr "settings.password"}}</a></li>
+ <li {{if .PageIsSettingsSSHKeys}}class="current"{{end}}><a href="/user/settings/ssh">{{.i18n.Tr "settings.ssh_keys"}}</a></li>
+ <li {{if .PageIsSettingsSocial}}class="current"{{end}}><a href="/user/settings/social">{{.i18n.Tr "settings.social"}}</a></li>
+ <li {{if .PageIsSettingsDelete}}class="current"{{end}}><a href="/user/settings/delete">{{.i18n.Tr "settings.delete"}}</a></li>
+ </ul>
+ </div>
+</div> \ No newline at end of file
diff --git a/templates/user/settings/password.tmpl b/templates/user/settings/password.tmpl
new file mode 100644
index 0000000000..44e087af4e
--- /dev/null
+++ b/templates/user/settings/password.tmpl
@@ -0,0 +1,37 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="setting-wrapper" class="main-wrapper">
+ <div id="user-profile-setting" class="container clear">
+ {{template "user/settings/nav" .}}
+ <div class="grid-4-5 left">
+ <div class="setting-content">
+ {{template "ng/base/alert" .}}
+ <div id="setting-content">
+ <div id="user-profile-setting-content" class="panel panel-radius">
+ <p class="panel-header"><strong>{{.i18n.Tr "settings.change_password"}}</strong></p>
+ <form class="form form-align panel-body" id="user-profile-form" action="/user/settings/password" method="post">
+ {{.CsrfTokenHtml}}
+ <p class="field">
+ <label class="req" for="old-password">{{.i18n.Tr "settings.old_password"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_OldPassword}}ipt-error{{end}}" id="old-password" name="old_password" type="password" required />
+ </p>
+ <p class="field">
+ <label class="req" for="password">{{.i18n.Tr "settings.new_password"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_Password}}ipt-error{{end}}" id="password" name="password" type="password" required />
+ </p>
+ <p class="field">
+ <label class="req" for="retype">{{.i18n.Tr "re_type"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_Retype}}ipt-error{{end}}" id="retype" name="retype" type="password" required />
+ </p>
+ <p class="field">
+ <span class="form-label"></span>
+ <button class="btn btn-green btn-large btn-radius">{{.i18n.Tr "settings.change_password"}}</button>
+ </p>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/user/settings/profile.tmpl b/templates/user/settings/profile.tmpl
new file mode 100644
index 0000000000..3fff074842
--- /dev/null
+++ b/templates/user/settings/profile.tmpl
@@ -0,0 +1,52 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="setting-wrapper" class="main-wrapper">
+ <div id="user-profile-setting" class="container clear">
+ {{template "user/settings/nav" .}}
+ <div class="grid-4-5 left">
+ <div class="setting-content">
+ {{template "ng/base/alert" .}}
+ <div id="setting-content">
+ <div id="user-profile-setting-content" class="panel panel-radius">
+ <div class="panel-header">
+ <strong>{{.i18n.Tr "settings.public_profile"}}</strong>
+ </div>
+ <form class="form form-align panel-body" id="user-profile-form" action="/user/settings" method="post">
+ {{.CsrfTokenHtml}}
+ <div class="text-center panel-desc">{{.i18n.Tr "settings.profile_desc"}}</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="{{.SignedUser.Name}}" data-uname="{{.SignedUser.Name}}" required />
+ </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="{{.SignedUser.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="{{.SignedUser.Email}}" required />
+ </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="{{.SignedUser.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="{{.SignedUser.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="{{.SignedUser.AvatarEmail}}" />
+ </div>
+ <div class="field">
+ <label></label>
+ <button class="btn btn-green btn-large btn-radius">{{.i18n.Tr "settings.update_profile"}}</button>
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/user/settings/social.tmpl b/templates/user/settings/social.tmpl
new file mode 100644
index 0000000000..bcbc1fc567
--- /dev/null
+++ b/templates/user/settings/social.tmpl
@@ -0,0 +1,33 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="setting-wrapper" class="main-wrapper">
+ <div id="user-profile-setting" class="container clear">
+ {{template "user/settings/nav" .}}
+ <div class="grid-4-5 left">
+ <div class="setting-content">
+ {{template "ng/base/alert" .}}
+ <div id="setting-content">
+ <div id="user-social-panel" class="panel panel-radius">
+ <div class="panel-header"><strong>{{.i18n.Tr "settings.manage_social"}}</strong></div>
+ <ul class="panel-body setting-list">
+ <li>{{.i18n.Tr "settings.social_desc"}}</li>
+ {{range .Socials}}
+ <li class="ssh clear">
+ <span class="active-icon left label label-{{if .HasRecentActivity}}green{{else}}gray{{end}} label-radius"></span>
+ <i class="fa {{Oauth2Icon .Type}} fa-2x left"></i>
+ <div class="ssh-content left">
+ <p><strong>{{Oauth2Name .Type}}</strong></p>
+ <p class="print">{{.Identity}}</p>
+ <p class="activity"><i>{{$.i18n.Tr "settings.add_on"}} {{DateFormat .Created "M d, Y"}} — <i class="octicon octicon-info"></i>{{$.i18n.Tr "settings.last_used"}} {{DateFormat .Updated "M d, Y"}}</i></p>
+ </div>
+ <a class="right btn btn-small btn-red btn-header btn-radius" href="/user/settings/social?remove={{.Id}}">{{$.i18n.Tr "settings.unbind"}}</a>
+ </li>
+ {{end}}
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/user/settings/sshkeys.tmpl b/templates/user/settings/sshkeys.tmpl
new file mode 100644
index 0000000000..3db0f54bbb
--- /dev/null
+++ b/templates/user/settings/sshkeys.tmpl
@@ -0,0 +1,61 @@
+{{template "ng/base/head" .}}
+{{template "ng/base/header" .}}
+<div id="setting-wrapper" class="main-wrapper">
+ <div id="user-profile-setting" class="container clear">
+ {{template "user/settings/nav" .}}
+ <div class="grid-4-5 left">
+ <div class="setting-content">
+ {{template "ng/base/alert" .}}
+ <div id="user-ssh-setting-content">
+ <div id="user-ssh-panel" class="panel panel-radius">
+ <div class="panel-header">
+ <a class="btn btn-small btn-black btn-header btn-radius right" id="ssh-add">{{.i18n.Tr "settings.add_key"}}</a>
+ <strong>{{.i18n.Tr "settings.manage_ssh_keys"}}</strong>
+ </div>
+ <ul class="panel-body setting-list">
+ <li>{{.i18n.Tr "settings.ssh_desc"}}</li>
+ {{range .Keys}}
+ <li class="ssh clear">
+ <span class="active-icon left label label-{{if .HasRecentActivity}}green{{else}}gray{{end}} label-radius"></span>
+ <i class="mega-octicon octicon-key left"></i>
+ <div class="ssh-content left">
+ <p><strong>{{.Name}}</strong></p>
+ <p class="print">{{.Fingerprint}}</p>
+ <p class="activity"><i>{{$.i18n.Tr "settings.add_on"}} {{DateFormat .Created "M d, Y"}} — <i class="octicon octicon-info"></i>{{if .HasUsed}}{{$.i18n.Tr "settings.last_used"}} {{DateFormat .Updated "M d, Y"}}{{else}}{{$.i18n.Tr "settings.no_activity"}}{{end}}</i></p>
+ </div>
+ <form action="/user/settings/ssh" method="post">
+ {{$.CsrfTokenHtml}}
+ <input name="_method" type="hidden" value="DELETE">
+ <input name="id" type="hidden" value="{{.Id}}">
+ <button class="right ssh-delete-btn btn btn-red btn-radius btn-small">{{$.i18n.Tr "settings.delete_key"}}</button>
+ </form>
+ </li>
+ {{end}}
+ </ul>
+ </div>
+ <p>{{.i18n.Tr "settings.ssh_helper" | Str2html}}</p>
+ <br>
+ <form class="panel panel-radius form form-align hide" id="user-ssh-add-form" action="/user/settings/ssh" method="post">
+ {{.CsrfTokenHtml}}
+ <p class="panel-header"><strong>{{.i18n.Tr "settings.add_new_key"}}</strong></p>
+ <div class="panel-body">
+ <p class="field">
+ <label class="req" for="ssh-title">{{.i18n.Tr "settings.key_name"}}</label>
+ <input class="ipt ipt-radius" id="ssh-title" name="title" type="text" required />
+ </p>
+ <p class="field clear">
+ <label class="left req" for="ssh-key">{{.i18n.Tr "settings.key_content"}}</label>
+ <textarea class="ipt ipt-radius left" name="content" id="ssh-key" required></textarea>
+ </p>
+ <p class="field">
+ <label></label>
+ <button class="btn btn-green btn-radius" id="ssh-add-btn">{{.i18n.Tr "settings.add_key"}}</button>
+ </p>
+ </div>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{{template "ng/base/footer" .}} \ No newline at end of file
diff --git a/templates/user/signin.tmpl b/templates/user/signin.tmpl
deleted file mode 100644
index 9a8aa1992d..0000000000
--- a/templates/user/signin.tmpl
+++ /dev/null
@@ -1,71 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div class="container" id="body" data-page="user-signin">
- <form action="/user/login" method="post" class="form-horizontal card" id="login-card">
- {{.CsrfTokenHtml}}
- {{if .IsSocialLogin}}
- <h3>Social login: 2nd step <small>associate account</small></h3>
- {{else}}
- <h3>Log in</h3>
- {{end}}
- {{template "base/alert" .}}
- <div class="form-group {{if .Err_UserName}}has-error has-feedback{{end}}">
- <label class="col-md-4 control-label">Username or e-mail: </label>
- <div class="col-md-6">
- <input name="username" class="form-control" placeholder="Type your username" value="{{.username}}" required="required">
- </div>
- </div>
-
- <div class="form-group {{if .Err_Password}}has-error has-feedback{{end}}">
- <label class="col-md-4 control-label">Password: </label>
- <div class="col-md-6">
- <input name="passwd" type="password" class="form-control" placeholder="Type your password" required="required">
- </div>
- </div>
-
- {{if not .IsSocialLogin}}<div class="form-group">
- <div class="col-md-6 col-md-offset-4">
- <div class="checkbox">
- <label>
- <input type="checkbox" name="remember" {{if .remember}}checked{{end}}>
- <strong>Remember me</strong>
- </label>
- </div>
- </div>
- </div>{{end}}
-
- <div class="form-group">
- <div class="col-md-offset-4 col-md-6">
- <button type="submit" class="btn btn-lg btn-primary">Log In</button>
- {{if not .IsSocialLogin}}<a href="/user/forget_password/">Forgot your password?</a>{{end}}
- </div>
- </div>
-
- {{if not .IsSocialLogin}}<div class="form-group">
- <div class="col-md-offset-4 col-md-6">
- <a href="/user/sign_up">Need an account? Sign up now.</a>
- </div>
- </div>
-
- {{if .OauthEnabled}}
- <div class="form-group text-center" id="social-login">
- <h4><span>or</span></h4>
- <!--
- <a href="/user/login/github?next=/user/sign_up" class="btn btn-default facebbok">
- <i class="fa fa-facebook-square fa-2x"></i>
- <span>Facebook</span>
- </a>
- <a href="/user/login/github?next=/user/sign_up" class="btn btn-default weibo">
- <i class="fa fa-weibo fa-2x"></i>
- <span>Weibo</span>
- </a>-->
- {{if .OauthService.GitHub}}<a href="/user/login/github?next=/user/sign_up" class="btn btn-default"><i class="fa fa-github-square fa-2x"></i><span>GitHub</span></a>{{end}}
- {{if .OauthService.Google}}<a href="/user/login/google?next=/user/sign_up" class="btn btn-default"><i class="fa fa-google-plus-square fa-2x"></i><span>Google</span></a>{{end}}
- {{if .OauthService.Twitter}}<a href="/user/login/twitter?next=/user/sign_up" class="btn btn-default"><i class="fa fa-twitter-square fa-2x"></i><span>Twitter</span></a>{{end}}
- {{if not .OauthService.Tencent}}<a href="/user/login/qq?next=/user/sign_up" class="btn btn-default"><i class="fa fa-qq fa-2x"></i><span>Tencent QQ</span></a>{{end}}
- {{if .OauthService.Weibo}}<a href="/user/login/weibo?next=/user/sign_up" class="btn btn-default"><i class="fa fa-weibo fa-2x"></i><span>Weibo</span></a>{{end}}
- </div>
- {{end}}{{end}}
- </form>
-</div>
-{{template "base/footer" .}}
diff --git a/templates/user/signup.tmpl b/templates/user/signup.tmpl
deleted file mode 100644
index 209058c904..0000000000
--- a/templates/user/signup.tmpl
+++ /dev/null
@@ -1,60 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div class="container" id="body">
- <form action="/user/sign_up" method="post" class="form-horizontal card" id="login-card">
- {{.CsrfTokenHtml}}
- {{if .DisableRegistration}}
- Sorry, registration has been disabled. Please contact the site administrator.
- {{else}}
- {{if .IsSocialLogin}}
- <h3>Social login: 2nd step <small>complete information</small></h3>
- {{else}}
- <h3>Sign Up</h3>
- {{end}}
- {{template "base/alert" .}}
- <div class="form-group {{if .Err_UserName}}has-error has-feedback{{end}}">
- <label class="col-md-4 control-label">Username: </label>
- <div class="col-md-6">
- <input name="username" class="form-control" placeholder="Type your username" value="{{.username}}" required="required">
- </div>
- </div>
- <div class="form-group {{if .Err_Email}}has-error has-feedback{{end}}">
- <label class="col-md-4 control-label">Email: </label>
- <div class="col-md-6">
- <input name="email" class="form-control" placeholder="Type your e-mail address" value="{{.email}}" required="required">
- </div>
- </div>
-
- <div class="form-group {{if .Err_Password}}has-error has-feedback{{end}}">
- <label class="col-md-4 control-label">Password: </label>
- <div class="col-md-6">
- <input name="passwd" type="password" class="form-control" placeholder="Type your password" required="required">
- </div>
- </div>
-
- <div class="form-group {{if .Err_RetypePasswd}}has-error has-feedback{{end}}">
- <label class="col-md-4 control-label">Re-type: </label>
- <div class="col-md-6">
- <input name="retypepasswd" type="password" class="form-control" placeholder="Re-type your password" required="required">
- </div>
- </div>
-
- <div class="form-group">
- <div class="col-md-offset-4 col-md-6">
- <button type="submit" class="btn btn-lg btn-primary">Create an account</button>
- </div>
- </div>
-
- <div class="form-group">
- <div class="col-md-offset-4 col-md-6">
- {{if .IsSocialLogin}}
- <a href="/user/login">Already have an account? Bind now!</a>
- {{else}}
- <a href="/user/login">Already have an account? Sign in now!</a>
- {{end}}
- </div>
- </div>
- {{end}}
- </form>
-</div>
-{{template "base/footer" .}}
diff --git a/templates/user/social.tmpl b/templates/user/social.tmpl
deleted file mode 100644
index 7814cc0956..0000000000
--- a/templates/user/social.tmpl
+++ /dev/null
@@ -1,37 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body" class="container" data-page="user">
- {{template "user/setting_nav" .}}
- <div id="repo-setting-container" class="col-md-10">
- {{template "base/alert" .}}
- <div class="panel panel-default">
- <div class="panel-heading">
- Social Account
- </div>
-
- <div class="panel-body">
- <table class="table">
- <thead>
- <tr>
- <th></th>
- <th>Name</th>
- <th>Identity</th>
- <th>Op.</th>
- </tr>
- </thead>
- <tbody>
- {{range .Socials}}
- <tr>
- <td><i class="fa {{Oauth2Icon .Type}} fa-2x"></i></td>
- <td>{{Oauth2Name .Type}}</td>
- <td>{{.Identity}}</td>
- <td><a href="/user/settings/social?remove={{.Id}}">Unbind</a></td>
- </tr>
- {{end}}
- </tbody>
- </table>
- </div>
- </div>
- </div>
-</div>
-{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/user/stars.tmpl b/templates/user/stars.tmpl
deleted file mode 100644
index 253efd6eec..0000000000
--- a/templates/user/stars.tmpl
+++ /dev/null
@@ -1,17 +0,0 @@
-{{template "base/head" .}}
-{{template "base/navbar" .}}
-<div id="body-nav">
- <div class="container">
- <ul class="nav nav-pills pull-right">
- <li><a href="/">Feed</a></li>
- <li><a href="/issues">Issues</a></li>
- <li><a href="/pulls">Pull Requests</a></li>
- <li class="active"><a href="/stars">Stars</a></li>
- </ul>
- <h3>Stars</h3>
- </div>
-</div>
-<div id="body" class="container" data-page="user">
- {{if .HasInfo}}<div class="alert alert-info">{{.InfoMsg}}</div>{{end}}
-</div>
-{{template "base/footer" .}} \ No newline at end of file