pkg/context: rename {CsrfToken, CsrfTokenHtml} -> {CSRFToken, CSRFTokenHTML}

master
Unknwon 2017-04-06 17:20:38 -04:00
parent 0e271799f2
commit 2c404daca6
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
51 changed files with 67 additions and 67 deletions

View File

@ -212,10 +212,10 @@ func Contexter() macaron.Handler {
}
}
ctx.Data["CsrfToken"] = x.GetToken()
ctx.Data["CsrfTokenHtml"] = template.HTML(`<input type="hidden" name="_csrf" value="` + x.GetToken() + `">`)
ctx.Data["CSRFToken"] = x.GetToken()
ctx.Data["CSRFTokenHTML"] = template.HTML(`<input type="hidden" name="_csrf" value="` + x.GetToken() + `">`)
log.Trace("Session ID: %s", sess.ID())
log.Trace("CSRF Token: %v", ctx.Data["CsrfToken"])
log.Trace("CSRF Token: %v", ctx.Data["CSRFToken"])
ctx.Data["ShowRegistrationButton"] = setting.Service.ShowRegistrationButton
ctx.Data["ShowFooterBranding"] = setting.ShowFooterBranding

View File

@ -10,7 +10,7 @@
</h4>
<div class="ui attached segment">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<input type="hidden" name="id" value="{{.Source.ID}}">
<div class="inline field">
<label>{{$.i18n.Tr "admin.auths.auth_type"}}</label>

View File

@ -10,7 +10,7 @@
</h4>
<div class="ui attached segment">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<!-- Types and name -->
<div class="inline required field {{if .Err_Type}}error{{end}}">
<label>{{.i18n.Tr "admin.auths.auth_type"}}</label>

View File

@ -178,7 +178,7 @@
<dt>{{.i18n.Tr "admin.config.mailer_user"}}</dt>
<dd>{{if .Mailer.User}}{{.Mailer.User}}{{else}}(empty){{end}}</dd><br>
<form class="ui form" action="{{AppSubUrl}}/admin/config/test_mail" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<div class="inline field ui left">
<div class="ui input">
<input type="email" name="email" required>

View File

@ -10,7 +10,7 @@
</h4>
<div class="ui attached segment">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<div class="inline field {{if .Err_UserName}}error{{end}}">
<label for="user_name">{{.i18n.Tr "username"}}</label>
<span>{{.User.Name}}</span>

View File

@ -10,7 +10,7 @@
</h4>
<div class="ui attached segment">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<!-- Types and name -->
<div class="inline required field {{if .Err_LoginType}}error{{end}}">
<label>{{.i18n.Tr "admin.users.auth_source"}}</label>

View File

@ -9,7 +9,7 @@
<meta name="keywords" content="go, git, self-hosted, gogs">
{{end}}
<meta name="referrer" content="no-referrer" />
<meta name="_csrf" content="{{.CsrfToken}}" />
<meta name="_csrf" content="{{.CSRFToken}}" />
<meta name="_suburl" content="{{AppSubUrl}}" />
{{if .GoGetImport}}
<meta name="go-import" content="{{.GoGetImport}} git {{.CloneLink.HTTPS}}">

View File

@ -3,7 +3,7 @@
<div class="ui middle very relaxed page grid">
<div class="column">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<h3 class="ui top attached header">
{{.i18n.Tr "new_org"}}
</h3>

View File

@ -6,7 +6,7 @@
{{template "base/alert" .}}
<h2>{{.i18n.Tr "org.members.invite_desc" .Org.DisplayName}}</h2>
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<div class="inline field ui left">
<div id="search-user-box">
<div class="ui input">

View File

@ -14,7 +14,7 @@
<p class="text left"><i class="octicon octicon-alert"></i> {{.i18n.Tr "org.settings.delete_prompt" | Str2html}}</p>
</div>
<form class="ui form" id="delete-form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<input class="fake" type="password">
<div class="inline required field {{if .Err_Password}}error{{end}}">
<label for="password">{{.i18n.Tr "password"}}</label>

View File

@ -11,7 +11,7 @@
</h4>
<div class="ui attached segment">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<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>
@ -51,7 +51,7 @@
<div class="ui divider"></div>
<form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<div class="inline field">
<label for="avatar">{{.i18n.Tr "settings.choose_new_avatar"}}</label>
<input name="avatar" type="file" >

View File

@ -25,7 +25,7 @@
{{if .IsOrganizationOwner}}
<div class="ui bottom attached segment">
<form class="ui form" id="add-member-form" action="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/action/add" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<input type="hidden" name="uid" value="{{.SignedUser.ID}}">
<div class="inline field ui left">
<div id="search-user-box">

View File

@ -4,7 +4,7 @@
<div class="ui middle very relaxed page grid">
<div class="column">
<form class="ui form" action="{{if .PageIsOrgTeamsNew}}{{.OrgLink}}/teams/new{{else}}{{.OrgLink}}/teams/{{.Team.LowerName}}/edit{{end}}" data-delete-url="{{.OrgLink}}/teams/{{.Team.LowerName}}/delete" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<h3 class="ui top attached header">
{{if .PageIsOrgTeamsNew}}{{.i18n.Tr "org.create_new_team"}}{{else}}{{.i18n.Tr "org.teams.settings"}}{{end}}
</h3>

View File

@ -26,7 +26,7 @@
{{if $canAddRemove}}
<div class="ui bottom attached segment">
<form class="ui form" id="add-repo-form" action="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/action/repo/add" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<div class="inline field ui left">
<div id="search-repo-box" data-uid="{{.Org.ID}}">
<div class="ui input">

View File

@ -3,7 +3,7 @@
<div class="ui middle very relaxed page grid">
<div class="column">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<h3 class="ui top attached header">
{{.i18n.Tr "new_repo"}}
</h3>

View File

@ -4,7 +4,7 @@
<div class="ui container">
{{template "base/alert" .}}
<form class="ui form" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
{{template "repo/editor/commit_form" .}}
</form>
</div>

View File

@ -4,7 +4,7 @@
<div class="ui container">
{{template "base/alert" .}}
<form class="ui edit form" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<input type="hidden" name="last_commit" value="{{.last_commit}}">
<div class="ui secondary menu">
<div class="fitted item treepath">

View File

@ -4,7 +4,7 @@
<div class="ui container">
{{template "base/alert" .}}
<form class="ui comment form" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<div class="ui secondary menu">
<div class="item fitted treepath">
<div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
@ -27,7 +27,7 @@
</div>
<div class="field">
<div class="files"></div>
<div class="ui basic button dropzone" id="dropzone" data-upload-url="{{.RepoLink}}/upload-file" data-remove-url="{{.RepoLink}}/upload-remove" data-csrf="{{.CsrfToken}}" data-accepts="{{.UploadAllowedTypes}}" data-max-file="{{.UploadMaxFiles}}" data-max-size="{{.UploadMaxSize}}" data-default-message="{{.i18n.Tr "dropzone.default_message"}}" data-invalid-input-type="{{.i18n.Tr "dropzone.invalid_input_type"}}" data-file-too-big="{{.i18n.Tr "dropzone.file_too_big"}}" data-remove-file="{{.i18n.Tr "dropzone.remove_file"}}"></div>
<div class="ui basic button dropzone" id="dropzone" data-upload-url="{{.RepoLink}}/upload-file" data-remove-url="{{.RepoLink}}/upload-remove" data-csrf="{{.CSRFToken}}" data-accepts="{{.UploadAllowedTypes}}" data-max-file="{{.UploadMaxFiles}}" data-max-size="{{.UploadMaxSize}}" data-default-message="{{.i18n.Tr "dropzone.default_message"}}" data-invalid-input-type="{{.i18n.Tr "dropzone.invalid_input_type"}}" data-file-too-big="{{.i18n.Tr "dropzone.file_too_big"}}" data-remove-file="{{.i18n.Tr "dropzone.remove_file"}}"></div>
</div>
{{template "repo/editor/commit_form" .}}
</form>

View File

@ -12,7 +12,7 @@
</div>
<div class="ui new-label segment hide">
<form class="ui form" action="{{$.RepoLink}}/labels/new" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<div class="ui grid">
<div class="five wide column">
<div class="ui small input">
@ -51,7 +51,7 @@
<p>{{.i18n.Tr "repo.issues.label_templates.info"}}</p>
<br/>
<form class="ui form center" action="{{.Link}}/initialize" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<div class="field">
<div class="ui selection dropdown">
<input type="hidden" name="template_name" value="Default">
@ -111,7 +111,7 @@
</div>
<div class="content">
<form class="ui edit-label form" action="{{$.RepoLink}}/labels/edit" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<input id="label-modal-id" name="id" type="hidden">
<div class="ui grid">
<div class="five wide column">

View File

@ -22,7 +22,7 @@
</h2>
{{template "base/alert" .}}
<form class="ui form grid" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<div class="eleven wide column">
<div class="field {{if .Err_Title}}error{{end}}">
<label>{{.i18n.Tr "repo.milestones.title"}}</label>

View File

@ -1,5 +1,5 @@
<form class="ui comment form grid" action="{{EscapePound .Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
{{if .Flash}}
<div class="sixteen wide column">
{{template "base/alert" .}}

View File

@ -166,7 +166,7 @@
<div class="ui divider"></div>
<div>
<form class="ui form" action="{{.DeleteBranchLink}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<button class="ui red button">{{$.i18n.Tr "repo.pulls.delete_branch"}}</button>
</form>
</div>
@ -194,7 +194,7 @@
<div class="ui divider"></div>
<div>
<form class="ui form" action="{{.Link}}/merge" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<button class="ui green button">
<span class="octicon octicon-git-merge"></span> {{$.i18n.Tr "repo.pulls.merge_pull_request"}}
</button>
@ -224,7 +224,7 @@
<div class="content">
<form class="ui segment form" id="comment-form" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/comments" method="post">
{{template "repo/issue/comment_tab" .}}
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<input id="status" name="status" type="hidden">
<div class="text right">
{{if and .IsIssueOwner (not .DisableStatusChange)}}

View File

@ -3,7 +3,7 @@
<div class="ui middle very relaxed page grid">
<div class="column">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<h3 class="ui top attached header">
{{.i18n.Tr "new_migrate"}}
</h3>

View File

@ -3,7 +3,7 @@
<div class="ui middle very relaxed page grid">
<div class="column">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<h3 class="ui top attached header">
{{.i18n.Tr "new_fork"}}
</h3>

View File

@ -13,7 +13,7 @@
</h2>
{{template "base/alert" .}}
<form class="ui form grid" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<div class="ui seven wide column target">
<div class="inline field {{if .Err_TagName}}error{{end}}">
{{if .PageIsEditRelease}}

View File

@ -12,7 +12,7 @@
<div class="ui attached segment default-branch">
<p>{{.i18n.Tr "repo.settings.default_branch_desc"}}</p>
<form class="ui form" action="{{.Link}}/default_branch" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<div class="required inline field {{if .Repository.IsBare}}disabled{{end}}">
<div class="ui selection dropdown">
<input type="hidden" id="branch" name="branch" value="{{.Repository.DefaultBranch}}">

View File

@ -40,7 +40,7 @@
</div>
<div class="ui bottom attached segment">
<form class="ui form" id="repo-collab-form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<div class="inline field ui left">
<div id="search-user-box">
<div class="ui input">

View File

@ -52,7 +52,7 @@
</h4>
<div class="ui attached segment">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<div class="field">
{{.i18n.Tr "repo.settings.deploy_key_desc"}}
</div>

View File

@ -12,7 +12,7 @@
<div class="ui attached segment">
<p>{{.i18n.Tr "repo.settings.githook_edit_desc"}}</p>
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
{{with .Hook}}
<div class="inline field">
<label>{{$.i18n.Tr "repo.settings.githook_name"}}</label>

View File

@ -11,7 +11,7 @@
</h4>
<div class="ui attached segment">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<input type="hidden" name="action" value="update">
<div class="required field {{if .Err_RepoName}}error{{end}}">
<label for="repo_name">{{.i18n.Tr "repo.repo_name"}}<span class="text red hide" id="repo-name-change-prompt"> {{.i18n.Tr "repo.settings.change_reponame_prompt"}}</span></label>
@ -48,7 +48,7 @@
</h4>
<div class="ui attached segment">
<form class="ui form" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<input type="hidden" name="action" value="mirror">
<div class="inline field {{if .Err_EnablePrune}}error{{end}}">
<label>{{.i18n.Tr "repo.mirror_prune"}}</label>
@ -75,7 +75,7 @@
<div class="ui divider"></div>
<form class="ui form" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<input type="hidden" name="action" value="mirror-sync">
<div class="inline field">
<label>{{.i18n.Tr "repo.mirror_last_synced"}}</label>
@ -93,7 +93,7 @@
</h4>
<div class="ui attached segment">
<form class="ui form" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<input type="hidden" name="action" value="advanced">
<!-- Wiki -->
@ -277,7 +277,7 @@
{{.i18n.Tr "repo.settings.convert_notices_1" | Safe}}
</div>
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<input type="hidden" name="action" value="convert">
<div class="field">
<label>
@ -309,7 +309,7 @@
{{.i18n.Tr "repo.settings.transfer_notices_2" | Safe}}
</div>
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<input type="hidden" name="action" value="transfer">
<div class="field">
<label>
@ -347,7 +347,7 @@
{{end}}
</div>
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<input type="hidden" name="action" value="delete">
<div class="field">
<label>
@ -379,7 +379,7 @@
{{.i18n.Tr "repo.settings.wiki_delete_notices_1" .Repository.Name | Safe}}
</div>
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<input type="hidden" name="action" value="delete-wiki">
<div class="field">
<label>

View File

@ -12,7 +12,7 @@
<div class="ui attached segment branch-protection">
<p>{{.i18n.Tr "repo.settings.branch_protection_desc" .Branch.Name | Str2html}}</p>
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<div class="inline field">
<div class="ui checkbox">
<input class="enable-protection" name="protected" type="checkbox" data-target="#protection_box" {{if .Branch.Protected}}checked{{end}}>

View File

@ -1,7 +1,7 @@
{{if eq .HookType "discord"}}
<p>{{.i18n.Tr "repo.settings.add_discord_hook_desc" "https://discordapp.com/" | Str2html}}</p>
<form class="ui form" action="{{.BaseLink}}/settings/hooks/discord/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.ID}}{{end}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<div class="required field {{if .Err_PayloadURL}}error{{end}}">
<label for="payload_url">{{.i18n.Tr "repo.settings.payload_url"}}</label>
<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>

View File

@ -1,7 +1,7 @@
{{if eq .HookType "gogs"}}
<p>{{.i18n.Tr "repo.settings.add_webhook_desc" "https://gogs.io/docs/features/webhook.html" | Str2html}}</p>
<form class="ui form" action="{{.BaseLink}}/settings/hooks/gogs/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.ID}}{{end}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<div class="required field {{if .Err_PayloadURL}}error{{end}}">
<label for="payload_url">{{.i18n.Tr "repo.settings.payload_url"}}</label>
<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>

View File

@ -1,7 +1,7 @@
{{if eq .HookType "slack"}}
<p>{{.i18n.Tr "repo.settings.add_slack_hook_desc" "https://slack.com" | Str2html}}</p>
<form class="ui form" action="{{.BaseLink}}/settings/hooks/slack/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.ID}}{{end}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<div class="required field {{if .Err_PayloadURL}}error{{end}}">
<label for="payload_url">{{.i18n.Tr "repo.settings.payload_url"}}</label>
<input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>

View File

@ -12,7 +12,7 @@
{{end}}
</div>
<form class="ui form" action="{{EscapePound .Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<input type="hidden" name="old_title" value="{{.old_title}}">
<div class="field {{if .Err_Title}}error{{end}}">
<input name="title" value="{{.title}}" autofocus required>

View File

@ -3,7 +3,7 @@
<div class="ui middle very relaxed page grid">
<div class="column">
<form class="ui form" action="{{AppSubUrl}}/user/activate" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<h2 class="ui top attached header">
{{.i18n.Tr "auth.active_your_account"}}
</h2>

View File

@ -3,7 +3,7 @@
<div class="ui middle very relaxed page grid">
<div class="column">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<h2 class="ui top attached header">
{{.i18n.Tr "auth.forgot_password"}}
</h2>

View File

@ -3,7 +3,7 @@
<div class="ui middle very relaxed page grid">
<div class="column">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<h3 class="ui top attached header">
{{.i18n.Tr "sign_in"}}
</h3>

View File

@ -3,7 +3,7 @@
<div class="ui middle very relaxed page grid">
<div class="column">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<input name="code" type="hidden" value="{{.Code}}">
<h2 class="ui top attached header">
{{.i18n.Tr "auth.reset_password"}}

View File

@ -3,7 +3,7 @@
<div class="ui middle very relaxed page grid">
<div class="column">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<h3 class="ui top attached header">
{{.i18n.Tr "sign_up"}}
</h3>

View File

@ -3,7 +3,7 @@
<div class="ui middle very relaxed page grid">
<div class="column">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<h3 class="ui top attached center header">
{{.i18n.Tr "auth.login_two_factor"}}
</h3>

View File

@ -3,7 +3,7 @@
<div class="ui middle very relaxed page grid">
<div class="column">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<h3 class="ui top attached center header">
{{.i18n.Tr "auth.login_two_factor_recovery"}}
</h3>

View File

@ -46,7 +46,7 @@
</h4>
<div class="ui attached segment">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<p>{{.i18n.Tr "settings.new_token_desc"}}</p>
<div class="field {{if .Err_Name}}error{{end}}">
<label for="name">{{.i18n.Tr "settings.token_name"}}</label>

View File

@ -11,7 +11,7 @@
<div class="ui attached segment">
<form class="ui form" action="{{.Link}}" method="post" enctype="multipart/form-data">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
{{if not DisableGravatar}}
<div class="inline field">
<div class="ui radio checkbox">

View File

@ -13,7 +13,7 @@
<p class="text left"><i class="octicon octicon-alert"></i> {{.i18n.Tr "settings.delete_prompt" | Str2html}}</p>
</div>
<form class="ui form" id="delete-form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<input class="fake" type="password">
<div class="required field {{if .Err_Password}}error{{end}}">
<label for="password">{{.i18n.Tr "password"}}</label>

View File

@ -27,7 +27,7 @@
{{if .IsActivated}}
<div class="ui right">
<form action="{{$.Link}}" method="post">
{{$.CsrfTokenHtml}}
{{$.CSRFTokenHTML}}
<input name="_method" type="hidden" value="PRIMARY">
<input name="id" type="hidden" value="{{.ID}}">
<button class="ui green tiny button">{{$.i18n.Tr "settings.primary_email"}}</button>
@ -42,7 +42,7 @@
</div>
<div class="ui attached bottom segment">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<div class="required field {{if .Err_Email}}error{{end}}">
<label for="email">{{.i18n.Tr "settings.add_new_email"}}</label>
<input id="email" name="email" type="email" autofocus required>

View File

@ -11,7 +11,7 @@
<div class="ui attached segment">
{{if .SignedUser.IsLocal}}
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<div class="required field {{if .Err_OldPassword}}error{{end}}">
<label for="old_password">{{.i18n.Tr "settings.old_password"}}</label>
<input id="old_password" name="old_password" type="password" autofocus required>

View File

@ -11,7 +11,7 @@
<div class="ui attached segment">
<p>{{.i18n.Tr "settings.profile_desc"}}</p>
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<div class="required field {{if .Err_Name}}error{{end}}">
<label for="username">{{.i18n.Tr "username"}}<span class="text red {{if eq .name .origin_name}}hide{{end}}" id="name-change-prompt"> {{.i18n.Tr "settings.change_username_prompt"}}</span></label>
<input id="username" name="name" value="{{.name}}" data-name="{{.origin_name}}" autofocus required {{if not .SignedUser.IsLocal}}readonly{{end}}>

View File

@ -50,7 +50,7 @@
</h4>
<div class="ui attached segment">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<div class="field {{if .Err_Title}}error{{end}}">
<label for="title">{{.i18n.Tr "settings.key_name"}}</label>
<input id="title" name="title" value="{{.title}}" autofocus required>

View File

@ -13,7 +13,7 @@
<img src="{{.QRCode}}" alt="{{.TwoFactorSecret}}">
<p>{{.i18n.Tr "settings.two_factor_or_enter_secret"}} <b>{{.TwoFactorSecret}}</b></p>
<form class="ui form" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<div class="required inline field">
<span>{{.i18n.Tr "settings.two_factor_then_enter_passcode"}}</span>
<input class="ui input" name="passcode" autocomplete="off" autofocus required>

View File

@ -25,7 +25,7 @@
</ul>
<form class="ui form" method="post">
{{.CsrfTokenHtml}}
{{.CSRFTokenHTML}}
<button class="ui blue button">{{.i18n.Tr "settings.two_factor_regenerate_recovery_codes"}}</button>
</form>
</div>