summaryrefslogtreecommitdiffstats
path: root/templates/user
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-11-12 06:48:50 -0500
committerUnknwon <joe2010xtmf@163.com>2014-11-12 06:48:50 -0500
commit8c9338a5377c60c84cdee1f5781b3de5933bb3b0 (patch)
tree57de36743bf8b9c8eaa0ff51172180b834354c4d /templates/user
parent21b9d5fa1f4014b30619d221f5d665509d373147 (diff)
downloadgitea-8c9338a5377c60c84cdee1f5781b3de5933bb3b0.tar.gz
gitea-8c9338a5377c60c84cdee1f5781b3de5933bb3b0.zip
add personal access token panel #12
Diffstat (limited to 'templates/user')
-rw-r--r--templates/user/settings/applications.tmpl56
-rw-r--r--templates/user/settings/nav.tmpl1
-rw-r--r--templates/user/settings/sshkeys.tmpl8
3 files changed, 62 insertions, 3 deletions
diff --git a/templates/user/settings/applications.tmpl b/templates/user/settings/applications.tmpl
new file mode 100644
index 0000000000..f34349a502
--- /dev/null
+++ b/templates/user/settings/applications.tmpl
@@ -0,0 +1,56 @@
+{{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-applications-panel" class="panel panel-radius">
+ <div class="panel-header">
+ <a class="show-form-btn" data-target-form="#access-add-form">
+ <button class="btn btn-medium btn-black btn-radius right">{{.i18n.Tr "settings.generate_new_token"}}</button>
+ </a>
+ <strong>{{.i18n.Tr "settings.manage_access_token"}}</strong>
+ </div>
+ <ul class="panel-body setting-list">
+ <li>{{.i18n.Tr "settings.tokens_desc"}}</li>
+ {{range .Tokens}}
+ <li class="ssh clear">
+ <span class="active-icon left label label-{{if .HasRecentActivity}}green{{else}}gray{{end}} label-radius"></span>
+ <i class="fa fa-send fa-2x left"></i>
+ <div class="ssh-content left">
+ <p><strong>{{.Name}}</strong></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>
+ <a href="{{AppSubUrl}}/user/settings/applications?remove={{.Id}}">
+ <button class="btn btn-small btn-red btn-radius ssh-btn right">{{$.i18n.Tr "settings.delete_token"}}</button>
+ </a>
+ </li>
+ {{end}}
+ </ul>
+ </div>
+ <br>
+ <form class="panel panel-radius form form-align form-settings-add hide" id="access-add-form" action="{{AppSubUrl}}/user/settings/applications" method="post">
+ {{.CsrfTokenHtml}}
+ <p class="panel-header"><strong>{{.i18n.Tr "settings.generate_new_token"}}</strong></p>
+ <div class="panel-body">
+ <div class="text-center panel-desc">{{.i18n.Tr "settings.new_token_desc"}}</div>
+ <input type="hidden" name="type" value="token">
+ <p class="field">
+ <label class="req" for="token-name">{{.i18n.Tr "settings.token_name"}}</label>
+ <input class="ipt ipt-radius" id="token-name" name="name" required />
+ </p>
+ <p class="field">
+ <label></label>
+ <button class="btn btn-green btn-medium btn-radius" id="ssh-add-btn">{{.i18n.Tr "settings.generate_token"}}</button>
+ </p>
+ </div>
+ </form>
+ </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
index fd60cb538b..6204b85a75 100644
--- a/templates/user/settings/nav.tmpl
+++ b/templates/user/settings/nav.tmpl
@@ -6,6 +6,7 @@
<li {{if .PageIsSettingsPassword}}class="current"{{end}}><a href="{{AppSubUrl}}/user/settings/password">{{.i18n.Tr "settings.password"}}</a></li>
<li {{if .PageIsSettingsSSHKeys}}class="current"{{end}}><a href="{{AppSubUrl}}/user/settings/ssh">{{.i18n.Tr "settings.ssh_keys"}}</a></li>
<li {{if .PageIsSettingsSocial}}class="current"{{end}}><a href="{{AppSubUrl}}/user/settings/social">{{.i18n.Tr "settings.social"}}</a></li>
+ <li {{if .PageIsSettingsApplications}}class="current"{{end}}><a href="{{AppSubUrl}}/user/settings/applications">{{.i18n.Tr "settings.applications"}}</a></li>
<li {{if .PageIsSettingsDelete}}class="current"{{end}}><a href="{{AppSubUrl}}/user/settings/delete">{{.i18n.Tr "settings.delete"}}</a></li>
</ul>
</div>
diff --git a/templates/user/settings/sshkeys.tmpl b/templates/user/settings/sshkeys.tmpl
index 7b1dec5f70..dcebccbbe2 100644
--- a/templates/user/settings/sshkeys.tmpl
+++ b/templates/user/settings/sshkeys.tmpl
@@ -9,7 +9,9 @@
<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>
+ <a class="show-form-btn" data-target-form="#user-ssh-add-form">
+ <button class="btn btn-medium btn-black btn-radius right">{{.i18n.Tr "settings.add_key"}}</button>
+ </a>
<strong>{{.i18n.Tr "settings.manage_ssh_keys"}}</strong>
</div>
<ul class="panel-body setting-list">
@@ -27,7 +29,7 @@
{{$.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>
+ <button class="right ssh-btn btn btn-red btn-radius btn-small">{{$.i18n.Tr "settings.delete_key"}}</button>
</form>
</li>
{{end}}
@@ -35,7 +37,7 @@
</div>
<p>{{.i18n.Tr "settings.ssh_helper" "https://help.github.com/articles/generating-ssh-keys" "https://help.github.com/ssh-issues/" | Str2html}}</p>
<br>
- <form class="panel panel-radius form form-align hide" id="user-ssh-add-form" action="{{AppSubUrl}}/user/settings/ssh" method="post">
+ <form class="panel panel-radius form form-align form-settings-add hide" id="user-ssh-add-form" action="{{AppSubUrl}}/user/settings/ssh" method="post">
{{.CsrfTokenHtml}}
<p class="panel-header"><strong>{{.i18n.Tr "settings.add_new_key"}}</strong></p>
<div class="panel-body">