diff options
author | Daniel Baumann <daniel@debian.org> | 2024-10-18 20:33:49 +0200 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2024-12-12 23:57:56 +0100 |
commit | e68b9d00a6e05b3a941f63ffb696f91e554ac5ec (patch) | |
tree | 97775d6c13b0f416af55314eb6a89ef792474615 /templates/webhook/new/sourcehut_builds.tmpl | |
parent | Initial commit. (diff) | |
download | forgejo-e68b9d00a6e05b3a941f63ffb696f91e554ac5ec.tar.xz forgejo-e68b9d00a6e05b3a941f63ffb696f91e554ac5ec.zip |
Adding upstream version 9.0.3.
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to '')
-rw-r--r-- | templates/webhook/new/sourcehut_builds.tmpl | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/templates/webhook/new/sourcehut_builds.tmpl b/templates/webhook/new/sourcehut_builds.tmpl new file mode 100644 index 0000000..3bcbe1b --- /dev/null +++ b/templates/webhook/new/sourcehut_builds.tmpl @@ -0,0 +1,39 @@ +<p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://sourcehut.org/" (ctx.Locale.Tr "repo.settings.web_hook_name_sourcehut_builds")}}</p> +<form class="ui form" action="{{.BaseLink}}/{{or .Webhook.ID "sourcehut_builds/new"}}" method="post"> + {{.CsrfTokenHtml}} + <div class="required field {{if .Err_PayloadURL}}error{{end}}"> + <label for="payload_url">{{ctx.Locale.Tr "repo.settings.graphql_url"}}</label> + <input id="payload_url" name="payload_url" type="url" value="{{or .Webhook.URL "https://builds.sr.ht/query"}}" autofocus required> + </div> + <div class="required field {{if .Err_ManifestPath}}error{{end}}"> + <label for="manifest_path">{{ctx.Locale.Tr "repo.settings.sourcehut_builds.manifest_path"}}</label> + <input id="manifest_path" name="manifest_path" type="text" value="{{or .HookMetadata.ManifestPath ".build.yml"}}" required> + </div> + <div class="field"> + <label>{{ctx.Locale.Tr "repo.settings.sourcehut_builds.visibility"}}</label> + <div class="ui selection dropdown"> + <input type="hidden" id="visibility" name="visibility" value="{{if .HookMetadata.Visibility}}{{.HookMetadata.Visibility}}{{else}}PRIVATE{{end}}"> + <div class="default text"></div> + {{svg "octicon-triangle-down" 14 "dropdown icon"}} + <div class="menu"> + <div class="item" data-value="PUBLIC">PUBLIC</div> + <div class="item" data-value="UNLISTED">UNLISTED</div> + <div class="item" data-value="PRIVATE">PRIVATE</div> + </div> + </div> + </div> + <div class="field"> + <div class="ui checkbox"> + <input name="secrets" type="checkbox" {{if .HookMetadata.Secrets}}checked{{end}}> + <label>{{ctx.Locale.Tr "repo.settings.sourcehut_builds.secrets"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.sourcehut_builds.secrets_helper"}}</span> + </div> + </div> + <!-- Access Token --> + <div class="field required {{if .Err_AccessToken}}error{{end}}"> + <label for="access_token">{{ctx.Locale.Tr "form.AccessToken"}}</label> + <input id="access_token" name="access_token" type="password" value="{{.Webhook.HeaderAuthorizationTrimPrefix "Bearer "}}" required> + <span class="help">{{ctx.Locale.Tr "repo.settings.sourcehut_builds.access_token_helper" "https://meta.sr.ht/oauth2/personal-token?grants=builds.sr.ht/JOBS:RW" "https://meta.sr.ht/oauth2/personal-token?grants=builds.sr.ht/JOBS:RW+builds.sr.ht/SECRETS:RO"}}</span> + </div> + {{template "webhook/shared-settings" .}} +</form> |