diff options
author | Maks1mS <maks1ms@noreply.codeberg.org> | 2024-12-26 15:33:09 +0100 |
---|---|---|
committer | Maks1mS <maks1ms@noreply.codeberg.org> | 2024-12-26 15:33:09 +0100 |
commit | 8a3fb4885e2cd65bd413801a2af51fc916e6bcb0 (patch) | |
tree | 4cc5417bb0cca25a46b1b06eaeeddae6b7f6803d /templates | |
parent | style: make fmt (diff) | |
parent | i18n: update of translations from Codeberg Translate (#6331) (diff) | |
download | forgejo-8a3fb4885e2cd65bd413801a2af51fc916e6bcb0.tar.xz forgejo-8a3fb4885e2cd65bd413801a2af51fc916e6bcb0.zip |
Merge branch 'forgejo' into feat/add-oidc-ssh-keys
Diffstat (limited to 'templates')
-rw-r--r-- | templates/package/content/container.tmpl | 6 | ||||
-rw-r--r-- | templates/repo/actions/status.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/home.tmpl | 22 | ||||
-rw-r--r-- | templates/repo/issue/view_content/update_branch_by_merge.tmpl | 18 | ||||
-rw-r--r-- | templates/repo/settings/units/pulls.tmpl | 23 | ||||
-rw-r--r-- | templates/repo/sub_menu.tmpl | 4 | ||||
-rw-r--r-- | templates/shared/search/code/results.tmpl | 4 | ||||
-rw-r--r-- | templates/shared/search/code/search.tmpl | 18 | ||||
-rw-r--r-- | templates/swagger/v1_json.tmpl | 9 |
9 files changed, 90 insertions, 18 deletions
diff --git a/templates/package/content/container.tmpl b/templates/package/content/container.tmpl index 78fdac3bad..dd1c24269b 100644 --- a/templates/package/content/container.tmpl +++ b/templates/package/content/container.tmpl @@ -36,11 +36,13 @@ </thead> <tbody> {{range .PackageDescriptor.Metadata.Manifests}} - <tr> + {{if ne .Platform "unknown/unknown"}} + <tr> <td><a href="{{$.PackageDescriptor.PackageWebLink}}/{{PathEscape .Digest}}">{{.Digest}}</a></td> <td>{{.Platform}}</td> <td>{{ctx.Locale.TrSize .Size}}</td> - </tr> + </tr> + {{end}} {{end}} </tbody> </table> diff --git a/templates/repo/actions/status.tmpl b/templates/repo/actions/status.tmpl index a0e02cf8d7..99fa74ac17 100644 --- a/templates/repo/actions/status.tmpl +++ b/templates/repo/actions/status.tmpl @@ -17,13 +17,15 @@ {{svg "octicon-check-circle-fill" $size (printf "text green %s" $className)}} {{else if eq .status "skipped"}} {{svg "octicon-skip" $size (printf "text grey %s" $className)}} +{{else if eq .status "cancelled"}} + {{svg "octicon-stop" $size (printf "text grey %s" $className)}} {{else if eq .status "waiting"}} {{svg "octicon-clock" $size (printf "text yellow %s" $className)}} {{else if eq .status "blocked"}} {{svg "octicon-blocked" $size (printf "text yellow %s" $className)}} {{else if eq .status "running"}} {{svg "octicon-meter" $size (printf "text yellow job-status-rotate %s" $className)}} -{{else if or (eq .status "failure") or (eq .status "cancelled") or (eq .status "unknown")}} +{{else}}{{/*failure, unknown*/}} {{svg "octicon-x-circle-fill" $size (printf "text red %s" $className)}} {{end}} </span> diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 9cbdef53ca..7bf4ee4a8e 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -11,12 +11,6 @@ {{if $description}}<span class="description">{{$description | RenderCodeBlock}}</span>{{else}}<span class="no-description text-italic">{{ctx.Locale.Tr "repo.no_desc"}}</span>{{end}} {{if .Repository.Website}}<a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>{{end}} </div> - <form class="ignore-dirty" action="{{.RepoLink}}/search/{{if .CodeIndexerDisabled}}{{.BranchNameSubURL}}{{end}}" method="get" data-test-tag="codesearch"> - <div class="ui small action input"> - <input name="q" value="{{.Keyword}}" placeholder="{{ctx.Locale.Tr "search.code_kind"}}"> - {{template "shared/search/button"}} - </div> - </form> </div> <div class="tw-flex tw-items-center tw-flex-wrap tw-gap-2 tw-my-2" id="repo-topics"> {{/* it should match the code in issue-home.js */}} @@ -158,6 +152,22 @@ {{else if .IsBlame}} {{template "repo/blame" .}} {{else}}{{/* IsViewDirectory */}} + {{/* display the search bar only if */}} + {{$isCommit := StringUtils.HasPrefix .BranchNameSubURL "commit"}} + {{if and (not $isCommit) (or .CodeIndexerDisabled (and (not .TagName) (eq .Repository.DefaultBranch .BranchName)))}} + <div class="code-search tw-w-full tw-py-2 tw-px-2 tw-bg-box-header tw-rounded-t tw-border tw-border-secondary tw-border-b-0"> + <form class="ui form ignore-dirty" action="{{.RepoLink}}/search/{{if .CodeIndexerDisabled}}{{.BranchNameSubURL}}{{end}}" method="get" data-test-tag="codesearch"> + <input type="hidden" name="path" value="{{.TreePath | PathEscapeSegments}}"> + {{template "shared/search/combo_multi" + dict + "Value" .Keyword + "Disabled" .CodeIndexerUnavailable + "Placeholder" (ctx.Locale.Tr "search.code_kind") + "Selected" (index .CodeSearchOptions 0) + "Options" .CodeSearchOptions}} + </form> + </div> + {{end}} {{template "repo/view_list" .}} {{end}} </div> diff --git a/templates/repo/issue/view_content/update_branch_by_merge.tmpl b/templates/repo/issue/view_content/update_branch_by_merge.tmpl index adce052dee..9fbc8b018b 100644 --- a/templates/repo/issue/view_content/update_branch_by_merge.tmpl +++ b/templates/repo/issue/view_content/update_branch_by_merge.tmpl @@ -9,23 +9,31 @@ {{if and $.UpdateAllowed $.UpdateByRebaseAllowed}} <div class="tw-inline-block"> <div class="ui buttons update-button"> - <button class="ui button" data-do="{{$.Link}}/update" data-redirect="{{$.Link}}"> + <button class="ui button" data-do="{{$.Link}}/update?style={{$.UpdateStyle}}" data-redirect="{{$.Link}}"> <span class="button-text"> - {{ctx.Locale.Tr "repo.pulls.update_branch"}} + {{if eq $.UpdateStyle "rebase"}} + {{ctx.Locale.Tr "repo.pulls.update_branch_rebase"}} + {{else}} + {{ctx.Locale.Tr "repo.pulls.update_branch"}} + {{end}} </span> </button> <div class="ui dropdown icon button"> {{svg "octicon-triangle-down"}} <div class="menu"> - <a class="item active selected" data-do="{{$.Link}}/update">{{ctx.Locale.Tr "repo.pulls.update_branch"}}</a> - <a class="item" data-do="{{$.Link}}/update?style=rebase">{{ctx.Locale.Tr "repo.pulls.update_branch_rebase"}}</a> + <a class="item {{if ne $.UpdateStyle "rebase"}}active selected{{end}}" data-do="{{$.Link}}/update?style=merge"> + {{ctx.Locale.Tr "repo.pulls.update_branch"}} + </a> + <a class="item {{if eq $.UpdateStyle "rebase"}}active selected{{end}}" data-do="{{$.Link}}/update?style=rebase"> + {{ctx.Locale.Tr "repo.pulls.update_branch_rebase"}} + </a> </div> </div> </div> </div> {{end}} {{if and $.UpdateAllowed (not $.UpdateByRebaseAllowed)}} - <form action="{{$.Link}}/update" method="post" class="ui update-branch-form"> + <form action="{{$.Link}}/update?style=merge" method="post" class="ui update-branch-form"> {{$.CsrfTokenHtml}} <button class="ui compact button"> <span class="ui text">{{ctx.Locale.Tr "repo.pulls.update_branch"}}</span> diff --git a/templates/repo/settings/units/pulls.tmpl b/templates/repo/settings/units/pulls.tmpl index 4e9c53e0f4..2e637d4e0b 100644 --- a/templates/repo/settings/units/pulls.tmpl +++ b/templates/repo/settings/units/pulls.tmpl @@ -106,6 +106,29 @@ </div> </div> <div class="field"> + <p> + {{ctx.Locale.Tr "repo.settings.default_update_style_desc"}} + </p> + <div class="ui dropdown selection"> + <select name="pulls_default_update_style"> + <option value="merge" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultUpdateStyle "merge")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.update_branch"}}</option> + <option value="rebase" {{if or (not $pullRequestEnabled) (eq $prUnit.PullRequestsConfig.DefaultUpdateStyle "rebase")}}selected{{end}}>{{ctx.Locale.Tr "repo.pulls.update_branch_rebase"}}</option> + </select>{{svg "octicon-triangle-down" 14 "dropdown icon"}} + <div class="default text"> + {{if (eq $prUnit.PullRequestsConfig.DefaultUpdateStyle "merge")}} + {{ctx.Locale.Tr "repo.pulls.update_branch"}} + {{end}} + {{if (eq $prUnit.PullRequestsConfig.DefaultUpdateStyle "rebase")}} + {{ctx.Locale.Tr "repo.pulls.update_branch_rebase"}} + {{end}} + </div> + <div class="menu"> + <div class="item" data-value="merge">{{ctx.Locale.Tr "repo.pulls.update_branch"}}</div> + <div class="item" data-value="rebase">{{ctx.Locale.Tr "repo.pulls.update_branch_rebase"}}</div> + </div> + </div> + </div> + <div class="field"> <div class="ui checkbox"> <input name="default_delete_branch_after_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.DefaultDeleteBranchAfterMerge)}}checked{{end}}> <label>{{ctx.Locale.Tr "repo.settings.pulls.default_delete_branch_after_merge"}}</label> diff --git a/templates/repo/sub_menu.tmpl b/templates/repo/sub_menu.tmpl index ddf01b33ed..598cfc5c80 100644 --- a/templates/repo/sub_menu.tmpl +++ b/templates/repo/sub_menu.tmpl @@ -1,6 +1,6 @@ {{if and (not .HideRepoInfo) (not .IsBlame)}} <div class="ui segments repository-summary tw-mt-1 tw-mb-0"> - <div class="ui segment sub-menu repository-menu"> + <div class="ui segment repository-menu"> {{if and (.Permission.CanRead $.UnitTypeCode) (not .IsEmptyRepo)}} <a class="item muted {{if .PageIsCommits}}active{{end}}" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}"> {{svg "octicon-history"}} {{ctx.Locale.TrN .CommitsCount "repo.n_commit_one" "repo.n_commit_few" (printf "<b>%d</b>" .CommitsCount | SafeHTML)}} @@ -13,7 +13,7 @@ {{svg "octicon-tag"}} {{ctx.Locale.TrN .NumTags "repo.n_tag_one" "repo.n_tag_few" (printf "<b>%d</b>" .NumTags | SafeHTML)}} </a> {{end}} - <span class="item not-mobile" {{if not (eq .Repository.Size 0)}}data-tooltip-content="{{.Repository.SizeDetailsString ctx.Locale}}"{{end}}> + <span class="item" {{if not (eq .Repository.Size 0)}}data-tooltip-content="{{.Repository.SizeDetailsString ctx.Locale}}"{{end}}> {{$fileSizeFields := ctx.Locale.TrSize .Repository.Size}} {{svg "octicon-database"}} <b>{{$fileSizeFields.PrettyNumber}}</b> {{$fileSizeFields.TranslatedUnit}} </span> diff --git a/templates/shared/search/code/results.tmpl b/templates/shared/search/code/results.tmpl index 98c5430502..5525d0c715 100644 --- a/templates/shared/search/code/results.tmpl +++ b/templates/shared/search/code/results.tmpl @@ -1,7 +1,7 @@ <div class="flex-text-block tw-flex-wrap"> {{range $term := .SearchResultLanguages}} <a class="ui {{if eq $.Language $term.Language}}primary{{end}} basic label tw-m-0" - href="?q={{$.Keyword}}{{if ne $.Language $term.Language}}&l={{$term.Language}}{{end}}&mode={{$.CodeSearchMode}}"> + href="?q={{$.Keyword}}{{if ne $.Language $term.Language}}&l={{$term.Language}}{{end}}&mode={{$.CodeSearchMode}}&path={{$.CodeSearchPath}}"> <i class="color-icon tw-mr-2" style="background-color: {{$term.Color}}"></i> {{$term.Language}} <div class="detail">{{$term.Count}}</div> @@ -13,7 +13,7 @@ {{$repo := or $.Repo (index $.RepoMaps .RepoID)}} <details class="tw-group diff-file-box diff-box file-content non-diff-file-content repo-search-result" open> <summary class="tw-list-none"> - <h4 class="ui top attached header tw-font-normal tw-flex tw-flex-wrap tw-transform-reset"> + <h4 class="ui top attached header tw-font-normal tw-flex tw-items-center tw-flex-wrap tw-transform-reset"> <span class="tw-h-4 tw-transition -tw-rotate-90 group-open:tw-rotate-0"> {{svg "octicon-chevron-down"}} </span> diff --git a/templates/shared/search/code/search.tmpl b/templates/shared/search/code/search.tmpl index 7f1fda8822..9457da988a 100644 --- a/templates/shared/search/code/search.tmpl +++ b/templates/shared/search/code/search.tmpl @@ -1,4 +1,5 @@ <form class="ui form ignore-dirty"> + <input type="hidden" name="path" value="{{.CodeSearchPath}}"> {{template "shared/search/combo_multi" dict "Value" .Keyword @@ -14,6 +15,23 @@ <p>{{ctx.Locale.Tr "search.code_search_unavailable"}}</p> </div> {{else}} + {{if .CodeSearchPath}} + <div class="tw-mb-4"> + <span class="breadcrumb"> + <a class="section" href="?q={{.Keyword}}&mode={{.CodeSearchMode}}">@</a> + {{$href := ""}} + {{- range $i, $path := StringUtils.Split .CodeSearchPath "/" -}} + {{if eq $i 0}} + {{$href = $path}} + {{else}} + {{$href = StringUtils.Join (StringUtils.Make $href $path) "/"}} + {{end}} + <span class="breadcrumb-divider">/</span> + <span class="section"><a href="?q={{$.Keyword}}&mode={{$.CodeSearchMode}}&path={{$href}}">{{$path}}</a></span> + {{- end -}} + </span> + </div> + {{end}} {{if .CodeIndexerDisabled}} <div class="ui message" data-test-tag="grep"> <p>{{ctx.Locale.Tr "search.code_search_by_git_grep"}}</p> diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index f0a0b86622..1feeebba98 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -23321,6 +23321,11 @@ "type": "string", "x-go-name": "DefaultMergeStyle" }, + "default_update_style": { + "description": "set to a update style to be used by this repository: \"rebase\" or \"merge\"", + "type": "string", + "x-go-name": "DefaultUpdateStyle" + }, "description": { "description": "a short description of the repository.", "type": "string", @@ -26605,6 +26610,10 @@ "type": "string", "x-go-name": "DefaultMergeStyle" }, + "default_update_style": { + "type": "string", + "x-go-name": "DefaultUpdateStyle" + }, "description": { "type": "string", "x-go-name": "Description" |