diff options
Diffstat (limited to 'templates/user/settings/keys_gpg.tmpl')
-rw-r--r-- | templates/user/settings/keys_gpg.tmpl | 72 |
1 files changed, 35 insertions, 37 deletions
diff --git a/templates/user/settings/keys_gpg.tmpl b/templates/user/settings/keys_gpg.tmpl index c840801e5a..20ccea9f00 100644 --- a/templates/user/settings/keys_gpg.tmpl +++ b/templates/user/settings/keys_gpg.tmpl @@ -5,7 +5,41 @@ </div> </h4> <div class="ui attached segment"> - <div class="ui key list"> + <div class="{{if not .HasGPGError}}hide{{end}} mb-4" id="add-gpg-key-panel"> + <form class="ui form{{if .HasGPGError}} error{{end}}" action="{{.Link}}" method="post"> + {{.CsrfTokenHtml}} + <input type="hidden" name="title" value="none"> + <div class="field {{if .Err_Content}}error{{end}}"> + <label for="content">{{.i18n.Tr "settings.key_content"}}</label> + <textarea id="gpg-key-content" name="content" placeholder="{{.i18n.Tr "settings.key_content_gpg_placeholder"}}" required>{{.content}}</textarea> + </div> + {{if .Err_Signature}} + <div class="ui error message"> + <p>{{.i18n.Tr "settings.gpg_token_required"}}</p> + </div> + <div class="field"> + <label for="token">{{.i18n.Tr "setting.gpg_token"}} + <input readonly="" value="{{.TokenToSign}}"> + <div class="help"> + <p>{{.i18n.Tr "settings.gpg_token_help"}}</p> + <p><code>{{$.i18n.Tr "settings.gpg_token_code" .TokenToSign .KeyID}}</code></p> + </div> + </div> + <div class="field"> + <label for="signature">{{.i18n.Tr "settings.gpg_token_signature"}}</label> + <textarea id="gpg-key-signature" name="signature" placeholder="{{.i18n.Tr "settings.key_signature_gpg_placeholder"}}" required>{{.signature}}</textarea> + </div> + {{end}} + <input name="type" type="hidden" value="gpg"> + <button class="ui green button"> + {{.i18n.Tr "settings.add_key"}} + </button> + <button class="ui hide-panel button" data-panel="#add-gpg-key-panel"> + {{.i18n.Tr "cancel"}} + </button> + </form> + </div> + <div class="ui key list mt-0"> <div class="item"> {{.i18n.Tr "settings.gpg_desc"}} </div> @@ -76,42 +110,6 @@ </div> <br> <p>{{.i18n.Tr "settings.gpg_helper" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/about-commit-signature-verification#gpg-commit-signature-verification" | Str2html}}</p> -<div {{if not .HasGPGError}}class="hide"{{end}} id="add-gpg-key-panel"> - <h4 class="ui top attached header"> - {{.i18n.Tr "settings.add_new_gpg_key"}} - </h4> - <div class="ui attached segment"> - <form class="ui form{{if .HasGPGError}} error{{end}}" action="{{.Link}}" method="post"> - {{.CsrfTokenHtml}} - <input type="hidden" name="title" value="none"> - <div class="field {{if .Err_Content}}error{{end}}"> - <label for="content">{{.i18n.Tr "settings.key_content"}}</label> - <textarea id="gpg-key-content" name="content" placeholder="{{.i18n.Tr "settings.key_content_gpg_placeholder"}}" required>{{.content}}</textarea> - </div> - {{if .Err_Signature}} - <div class="ui error message"> - <p>{{.i18n.Tr "settings.gpg_token_required"}}</p> - </div> - <div class="field"> - <label for="token">{{.i18n.Tr "setting.gpg_token"}} - <input readonly="" value="{{.TokenToSign}}"> - <div class="help"> - <p>{{.i18n.Tr "settings.gpg_token_help"}}</p> - <p><code>{{$.i18n.Tr "settings.gpg_token_code" .TokenToSign .KeyID}}</code></p> - </div> - </div> - <div class="field"> - <label for="signature">{{.i18n.Tr "settings.gpg_token_signature"}}</label> - <textarea id="gpg-key-signature" name="signature" placeholder="{{.i18n.Tr "settings.key_signature_gpg_placeholder"}}" required>{{.signature}}</textarea> - </div> - {{end}} - <input name="type" type="hidden" value="gpg"> - <button class="ui green button"> - {{.i18n.Tr "settings.add_key"}} - </button> - </form> - </div> -</div> <div class="ui small basic delete modal" id="delete-gpg"> <div class="ui icon header"> |