2
0
Files
gitcaddy-server/templates/repo/settings/pages_brand.tmpl
logikonline 80096bfbf9
Some checks failed
Build and Release / Create Release (push) Successful in 0s
Build and Release / Unit Tests (push) Successful in 3m24s
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 7m26s
Build and Release / Lint (push) Successful in 8m44s
Build and Release / Build Binaries (arm64, darwin, macos) (push) Failing after 0s
Build and Release / Build Binaries (amd64, darwin, macos) (push) Successful in 3m39s
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Successful in 4m53s
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Successful in 9h4m28s
Build and Release / Build Binary (linux/arm64) (push) Failing after 12m10s
feat(ui): add loading indicators for AI generation actions
Show loading spinner and message when AI content generation or translation is in progress. Disables submit button and hides form to prevent duplicate submissions. Adds Copilot icon to AI buttons. Marks file inputs with data-ays-ignore to prevent "unsaved changes" warnings. Improves UX by providing visual feedback during long-running AI operations.
2026-03-17 21:42:39 -04:00

96 lines
4.7 KiB
Handlebars

{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings pages")}}
<div class="user-main-content twelve wide column">
<h4 class="ui top attached header">
{{ctx.Locale.Tr "repo.settings.pages.brand"}}
</h4>
<div class="ui attached segment">
<form class="ui form" method="post">
{{.CsrfTokenHtml}}
<div class="field">
<label>{{ctx.Locale.Tr "repo.settings.pages.brand_name"}}</label>
<input name="brand_name" value="{{.Config.Brand.Name}}" placeholder="{{.Repository.Name}}">
<p class="help">{{ctx.Locale.Tr "repo.settings.pages.brand_name_help"}}</p>
</div>
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.pages.brand_logo"}}</h5>
{{if .Config.Brand.UploadedLogo}}
<div class="field">
<img src="/repo-avatars/{{.Config.Brand.UploadedLogo}}" style="max-width:200px;max-height:100px;border-radius:8px;border:1px solid var(--color-secondary);">
<div class="tw-mt-2">
<button class="ui mini red button" type="submit" form="delete-logo-form">
{{svg "octicon-trash" 14}} {{ctx.Locale.Tr "repo.settings.pages.brand_delete_logo"}}
</button>
</div>
</div>
{{else}}
<div class="field">
<label>{{ctx.Locale.Tr "repo.settings.pages.brand_upload_logo"}}</label>
<div class="tw-flex tw-gap-2 tw-items-center">
<input type="file" name="brand_logo" accept="image/jpeg,image/png,image/webp,image/gif" form="upload-logo-form" data-ays-ignore="true">
<button class="ui primary button" type="submit" form="upload-logo-form">
{{svg "octicon-upload" 16}} {{ctx.Locale.Tr "repo.settings.pages.brand_upload_btn"}}
</button>
</div>
<p class="help">{{ctx.Locale.Tr "repo.settings.pages.brand_upload_help"}}</p>
</div>
<div class="ui horizontal divider">{{ctx.Locale.Tr "repo.settings.pages.brand_or"}}</div>
<div class="field">
<input name="brand_logo_url" value="{{.Config.Brand.LogoURL}}" placeholder="https://example.com/logo.svg">
<p class="help">{{ctx.Locale.Tr "repo.settings.pages.brand_logo_url_help"}}</p>
</div>
{{end}}
<div class="field">
<label>{{ctx.Locale.Tr "repo.settings.pages.brand_tagline"}}</label>
<input name="brand_tagline" value="{{.Config.Brand.Tagline}}" placeholder="Your tagline here">
</div>
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.pages.brand_favicon"}}</h5>
{{if .Config.Brand.UploadedFavicon}}
<div class="field">
<img src="/repo-avatars/{{.Config.Brand.UploadedFavicon}}" style="max-width:64px;max-height:64px;border-radius:4px;border:1px solid var(--color-secondary);">
<div class="tw-mt-2">
<button class="ui mini red button" type="submit" form="delete-favicon-form">
{{svg "octicon-trash" 14}} {{ctx.Locale.Tr "repo.settings.pages.brand_delete_favicon"}}
</button>
</div>
</div>
{{else}}
<div class="field">
<label>{{ctx.Locale.Tr "repo.settings.pages.brand_upload_favicon"}}</label>
<div class="tw-flex tw-gap-2 tw-items-center">
<input type="file" name="brand_favicon" accept="image/jpeg,image/png,image/webp,image/gif,image/x-icon,image/svg+xml" form="upload-favicon-form" data-ays-ignore="true">
<button class="ui primary button" type="submit" form="upload-favicon-form">
{{svg "octicon-upload" 16}} {{ctx.Locale.Tr "repo.settings.pages.brand_upload_btn"}}
</button>
</div>
<p class="help">{{ctx.Locale.Tr "repo.settings.pages.brand_favicon_upload_help"}}</p>
</div>
<div class="ui horizontal divider">{{ctx.Locale.Tr "repo.settings.pages.brand_or"}}</div>
<div class="field">
<input name="brand_favicon_url" value="{{.Config.Brand.FaviconURL}}" placeholder="https://example.com/favicon.ico">
<p class="help">{{ctx.Locale.Tr "repo.settings.pages.brand_favicon_url_help"}}</p>
</div>
{{end}}
<div class="field">
<button class="ui primary button">{{ctx.Locale.Tr "save"}}</button>
</div>
</form>
{{/* Separate forms for upload/delete actions outside the main form to avoid nesting */}}
{{if .Config.Brand.UploadedLogo}}
<form id="delete-logo-form" method="post" action="{{.Link}}/delete_logo" class="tw-hidden">{{.CsrfTokenHtml}}</form>
{{else}}
<form id="upload-logo-form" method="post" enctype="multipart/form-data" action="{{.Link}}/upload_logo" class="tw-hidden">{{.CsrfTokenHtml}}</form>
{{end}}
{{if .Config.Brand.UploadedFavicon}}
<form id="delete-favicon-form" method="post" action="{{.Link}}/delete_favicon" class="tw-hidden">{{.CsrfTokenHtml}}</form>
{{else}}
<form id="upload-favicon-form" method="post" enctype="multipart/form-data" action="{{.Link}}/upload_favicon" class="tw-hidden">{{.CsrfTokenHtml}}</form>
{{end}}
</div>
</div>
{{template "repo/settings/layout_footer" .}}