aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-09-06 16:31:22 -0400
committerUnknwon <u@gogs.io>2015-09-06 16:31:22 -0400
commit85f34ba53843177999cb98bad046e9cce22bfc8f (patch)
treef1f7ca6d3b0fc4848216becd9bc2a25e019cb12e /templates
parent00767a0522606cd504d81d35fa1d9e9c1e34610c (diff)
downloadgitea-85f34ba53843177999cb98bad046e9cce22bfc8f.tar.gz
gitea-85f34ba53843177999cb98bad046e9cce22bfc8f.zip
new user profile settings UI
Signed-off-by: Unknwon <u@gogs.io>
Diffstat (limited to 'templates')
-rw-r--r--templates/install.tmpl4
-rw-r--r--templates/org/settings/options.tmpl2
-rw-r--r--templates/user/settings/profile.tmpl148
-rw-r--r--templates/user/settings/sshkeys.tmpl13
4 files changed, 75 insertions, 92 deletions
diff --git a/templates/install.tmpl b/templates/install.tmpl
index 3001a47bfd..657247ce50 100644
--- a/templates/install.tmpl
+++ b/templates/install.tmpl
@@ -26,7 +26,7 @@
</div>
</div>
- <div id="sql_settings" class="{{if eq .CurDbOption "SQLite3"}}hide{{end}}">
+ <div id="sql_settings" class="{{if or (eq .CurDbOption "SQLite3") (eq .CurDbOption "TiDB")}}hide{{end}}">
<div class="inline required field {{if .Err_DbSetting}}error{{end}}">
<label for="db_host">{{.i18n.Tr "install.host"}}</label>
<input id="db_host" name="db_host" value="{{.db_host}}">
@@ -62,7 +62,7 @@
</div>
</div>
- <div id="sqlite_settings" class="{{if not (eq .CurDbOption "SQLite3")}}hide{{end}}">
+ <div id="sqlite_settings" class="{{if not (or (eq .CurDbOption "SQLite3") (eq .CurDbOption "TiDB"))}}hide{{end}}">
<div class="inline required field {{if or .Err_DbPath .Err_DbSetting}}error{{end}}">
<label for="db_path">{{.i18n.Tr "install.path"}}</label>
<input id="db_path" name="db_path" value="{{.db_path}}">
diff --git a/templates/org/settings/options.tmpl b/templates/org/settings/options.tmpl
index c24e74476b..1c1c8bcf01 100644
--- a/templates/org/settings/options.tmpl
+++ b/templates/org/settings/options.tmpl
@@ -12,7 +12,7 @@
<div class="ui attached segment">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
- <div class="required field {{if .Err_OrgName}}error{{end}}">
+ <div class="required field {{if .Err_Name}}error{{end}}">
<label for="org_name">{{.i18n.Tr "org.org_name_holder"}}<span class="text red hide" id="org-name-change-prompt"> {{.i18n.Tr "org.settings.change_orgname_prompt"}}</span></label>
<input id="org_name" name="name" value="{{.Org.Name}}" data-org-name="{{.Org.Name}}" autofocus required>
</div>
diff --git a/templates/user/settings/profile.tmpl b/templates/user/settings/profile.tmpl
index 9ed92babcb..5438feae35 100644
--- a/templates/user/settings/profile.tmpl
+++ b/templates/user/settings/profile.tmpl
@@ -1,82 +1,74 @@
-{{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>
- <div class="panel-body">
- <form class="form form-align" id="user-profile-form" action="{{AppSubUrl}}/user/settings" method="post">
- {{.CsrfTokenHtml}}
- <div class="text-center panel-desc">{{.i18n.Tr "settings.profile_desc"}}</div>
- <div class="field">
- <label>{{.i18n.Tr "settings.uid"}}</label>
- <label class="text-left">{{.SignedUser.Id}}</label>
- </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="white-popup-block mfp-hide" id="change-username-modal">
- <h1 class="text-red">{{.i18n.Tr "settings.change_username"}}</h1>
- <p>{{.i18n.Tr "settings.change_username_desc"}}</p>
- <br>
- <button class="btn btn-red btn-large btn-radius" id="change-username-submit">{{.i18n.Tr "settings.continue"}}</button>
- <button class="btn btn-large btn-radius popup-modal-dismiss">{{.i18n.Tr "settings.cancel"}}</button>
- </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 {{if DisableGravatar}}hide{{end}}">
- <label class="req" 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" id="change-username-btn" href="#change-username-modal">{{.i18n.Tr "settings.update_profile"}}</button>
- </div>
- </form>
- <hr>
- <form class="form form-align" id="user-profile-form" action="{{AppSubUrl}}/user/settings/avatar" method="post" enctype="multipart/form-data">
- {{.CsrfTokenHtml}}
- <div class="field">
- <label for="enable">{{.i18n.Tr "settings.enable_custom_avatar"}}</label>
- <input class="ipt-chk" id="enable" name="enable" type="checkbox" {{if .SignedUser.UseCustomAvatar}}checked{{end}} />
- <span>{{.i18n.Tr "settings.enable_custom_avatar_helper"}}</span>
- </div>
- <div class="field">
- <label>{{.i18n.Tr "settings.choose_new_avatar"}}</label>
- <input name="avatar" type="file" />
- </div>
- <div class="field">
- <label></label>
- <button class="btn btn-green btn-large btn-radius">{{.i18n.Tr "settings.update_avatar"}}</button>
- </div>
- </form>
- </div>
- </div>
- </div>
+{{template "base/head" .}}
+<div class="user settings profile">
+ <div class="ui container">
+ <div class="ui grid">
+ {{template "user/settings/navbar" .}}
+ <div class="twelve wide column content">
+ {{template "base/alert" .}}
+ <h4 class="ui top attached header">
+ {{.i18n.Tr "settings.public_profile"}}
+ </h4>
+ <div class="ui attached segment">
+ <p>{{.i18n.Tr "settings.profile_desc"}}</p>
+ <form class="ui form" action="{{.Link}}" method="post">
+ {{.CsrfTokenHtml}}
+ <div class="inline field">
+ <label>{{.i18n.Tr "settings.uid"}}</label>
+ <span>{{.SignedUser.Id}}</span>
</div>
+ <div class="required field {{if .Err_Name}}error{{end}}">
+ <label for="username">{{.i18n.Tr "username"}}<span class="text red hide" id="name-change-prompt"> {{.i18n.Tr "settings.change_username_prompt"}}</span></label>
+ <input id="username" name="name" value="{{.SignedUser.Name}}" data-name="{{.SignedUser.Name}}" autofocus required>
+ </div>
+ <div class="field {{if .Err_FullName}}error{{end}}">
+ <label for="full_name">{{.i18n.Tr "settings.full_name"}}</label>
+ <input id="full_name" name="full_name" value="{{.SignedUser.FullName}}">
+ </div>
+ <div class="required field {{if .Err_Email}}error{{end}}">
+ <label for="email">{{.i18n.Tr "email"}}</label>
+ <input id="email" name="email" value="{{.SignedUser.Email}}">
+ </div>
+ <div class="field {{if .Err_Website}}error{{end}}">
+ <label for="website">{{.i18n.Tr "settings.website"}}</label>
+ <input id="website" name="website" type="url" value="{{.SignedUser.Website}}">
+ </div>
+ <div class="field">
+ <label for="location">{{.i18n.Tr "settings.location"}}</label>
+ <input id="location" name="location" value="{{.SignedUser.Location}}">
+ </div>
+ <div class="required field {{if or DisableGravatar .SignedUser.UseCustomAvatar}}hide{{end}} {{if .Err_Gravatar}}error{{end}}">
+ <label for="gravatar">Gravatar {{.i18n.Tr "email"}}</label>
+ <input id="gravatar" name="gravatar" value="{{.SignedUser.AvatarEmail}}" />
+ </div>
+
+ <div class="field">
+ <button class="ui green button">{{$.i18n.Tr "settings.update_profile"}}</button>
+ </div>
+ </form>
+
+ <div class="ui divider"></div>
+
+ <form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data">
+ {{.CsrfTokenHtml}}
+ <div class="inline field">
+ <label>{{.i18n.Tr "settings.enable_custom_avatar"}}</label>
+ <div class="ui checkbox">
+ <input name="enable" type="checkbox" {{if .SignedUser.UseCustomAvatar}}checked{{end}}>
+ <label>{{.i18n.Tr "settings.enable_custom_avatar_helper"}}</label>
+ </div>
+ </div>
+ <div class="inline field">
+ <label for="avatar">{{.i18n.Tr "settings.choose_new_avatar"}}</label>
+ <input name="avatar" type="file" >
+ </div>
+
+ <div class="field">
+ <button class="ui green button">{{$.i18n.Tr "settings.update_avatar"}}</button>
+ </div>
+ </form>
</div>
+ </div>
</div>
+ </div>
</div>
-{{template "ng/base/footer" .}} \ No newline at end of file
+{{template "base/footer" .}} \ No newline at end of file
diff --git a/templates/user/settings/sshkeys.tmpl b/templates/user/settings/sshkeys.tmpl
index 5eb3bfb741..4c2177278b 100644
--- a/templates/user/settings/sshkeys.tmpl
+++ b/templates/user/settings/sshkeys.tmpl
@@ -1,5 +1,5 @@
{{template "base/head" .}}
-<div class="user settings">
+<div class="user settings sshkeys">
<div class="ui container">
<div class="ui grid">
{{template "user/settings/navbar" .}}
@@ -78,15 +78,6 @@
<div class="content">
<p>{{.i18n.Tr "settings.ssh_key_deletion_desc"}}</p>
</div>
- <div class="actions">
- <div class="ui red basic inverted cancel button">
- <i class="remove icon"></i>
- {{.i18n.Tr "modal.no"}}
- </div>
- <div class="ui green basic inverted ok button">
- <i class="checkmark icon"></i>
- {{.i18n.Tr "modal.yes"}}
- </div>
- </div>
+ {{template "base/delete_modal_actions" .}}
</div>
{{template "base/footer" .}} \ No newline at end of file