diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d391cf78cf7da..1b0255d198b5c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -10,7 +10,8 @@ "ghcr.io/devcontainers-contrib/features/poetry:2": {}, "ghcr.io/devcontainers/features/python:1": { "version": "3.12" - } + }, + "ghcr.io/warrenbuckley/codespace-features/sqlite:1": {} }, "customizations": { "vscode": { @@ -25,8 +26,9 @@ "Vue.volar", "ms-azuretools.vscode-docker", "vitest.explorer", - "qwtel.sqlite-viewer", - "GitHub.vscode-pull-request-github" + "cweijan.vscode-database-client2", + "GitHub.vscode-pull-request-github", + "Azurite.azurite" ] } }, diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 0d2f955319509..cbfe0220e8e4d 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -4,6 +4,7 @@ reportUnusedDisableDirectives: true ignorePatterns: - /web_src/js/vendor - /web_src/fomantic + - /public/assets/js parserOptions: sourceType: module @@ -126,19 +127,21 @@ rules: "@stylistic/js/computed-property-spacing": [2, never] "@stylistic/js/dot-location": [2, property] "@stylistic/js/eol-last": [2] - "@stylistic/js/function-call-spacing": [2, never] "@stylistic/js/function-call-argument-newline": [0] + "@stylistic/js/function-call-spacing": [2, never] "@stylistic/js/function-paren-newline": [0] "@stylistic/js/generator-star-spacing": [0] "@stylistic/js/implicit-arrow-linebreak": [0] "@stylistic/js/indent": [2, 2, {ignoreComments: true, SwitchCase: 1}] "@stylistic/js/key-spacing": [2] "@stylistic/js/keyword-spacing": [2] + "@stylistic/js/line-comment-position": [0] "@stylistic/js/linebreak-style": [2, unix] "@stylistic/js/lines-around-comment": [0] "@stylistic/js/lines-between-class-members": [0] "@stylistic/js/max-len": [0] "@stylistic/js/max-statements-per-line": [0] + "@stylistic/js/multiline-comment-style": [0] "@stylistic/js/multiline-ternary": [0] "@stylistic/js/new-parens": [2] "@stylistic/js/newline-per-chained-call": [0] @@ -704,6 +707,7 @@ rules: unicorn/better-regex: [0] unicorn/catch-error-name: [0] unicorn/consistent-destructuring: [2] + unicorn/consistent-empty-array-spread: [2] unicorn/consistent-function-scoping: [2] unicorn/custom-error-definition: [0] unicorn/empty-brace-spaces: [2] @@ -730,9 +734,11 @@ rules: unicorn/no-for-loop: [0] unicorn/no-hex-escape: [0] unicorn/no-instanceof-array: [0] + unicorn/no-invalid-fetch-options: [2] unicorn/no-invalid-remove-event-listener: [2] unicorn/no-keyword-prefix: [0] unicorn/no-lonely-if: [2] + unicorn/no-magic-array-flat-depth: [0] unicorn/no-negated-condition: [0] unicorn/no-nested-ternary: [0] unicorn/no-new-array: [0] @@ -798,10 +804,12 @@ rules: unicorn/prefer-set-has: [0] unicorn/prefer-set-size: [2] unicorn/prefer-spread: [0] + unicorn/prefer-string-raw: [0] unicorn/prefer-string-replace-all: [0] unicorn/prefer-string-slice: [0] unicorn/prefer-string-starts-ends-with: [2] unicorn/prefer-string-trim-start-end: [2] + unicorn/prefer-structured-clone: [2] unicorn/prefer-switch: [0] unicorn/prefer-ternary: [0] unicorn/prefer-text-content: [2] diff --git a/.gitea/issue_template.md b/.gitea/issue_template.md index 9ad186cca7c25..cf173a67cae53 100644 --- a/.gitea/issue_template.md +++ b/.gitea/issue_template.md @@ -3,7 +3,7 @@ {{else if .IsSigned}} - {{if EnableTimetracking}} - + {{if and EnableTimetracking .ActiveStopwatch}} +
{{svg "octicon-stopwatch"}}
- {{ctx.Locale.Tr "active_stopwatch"}}
-
-
- - {{svg "octicon-issue-opened" 16 "tw-mr-2"}} - {{.ActiveStopwatch.RepoSlug}}#{{.ActiveStopwatch.IssueIndex}} - - {{if .ActiveStopwatch}}{{Sec2Time .ActiveStopwatch.Seconds}}{{end}} - - -
- {{.CsrfTokenHtml}} - -
-
- {{.CsrfTokenHtml}} - -
-
-
{{end}} @@ -202,4 +182,33 @@ {{end}} + + {{if and .IsSigned EnableTimetracking .ActiveStopwatch}} +
+
+ + {{svg "octicon-issue-opened" 16}} + {{.ActiveStopwatch.RepoSlug}}#{{.ActiveStopwatch.IssueIndex}} + +
+
+ {{.CsrfTokenHtml}} + +
+
+ {{.CsrfTokenHtml}} + +
+
+
+
+ {{end}} diff --git a/templates/devtest/fomantic-dropdown.tmpl b/templates/devtest/fomantic-dropdown.tmpl new file mode 100644 index 0000000000000..57a7c1313ea63 --- /dev/null +++ b/templates/devtest/fomantic-dropdown.tmpl @@ -0,0 +1,109 @@ +{{template "base/head" .}} + +
+
+

Dropdown

+
+ + + + +
+ + +
+
+ +

Selection

+
+ {{/* the "selection" class is optional, it will be added by JS automatically */}} + + +
+

Dropdown Button (demo only without menu)

+
+ + + +
+ +
+ + + +
+ +
+
+
Other button align with ...
+ +
+
+
+{{template "base/footer" .}} diff --git a/templates/devtest/gitea-ui.tmpl b/templates/devtest/gitea-ui.tmpl index 3b13c13be8405..ea293fd3b41b4 100644 --- a/templates/devtest/gitea-ui.tmpl +++ b/templates/devtest/gitea-ui.tmpl @@ -180,94 +180,6 @@ - -

Dropdown with SVG

-
- - - - -
- - -
-
- -
- - - -
- -
- - - -
- -
-
-
Button align with ...
- -
diff --git a/templates/install.tmpl b/templates/install.tmpl index f3117af5476a3..965e57f21372f 100644 --- a/templates/install.tmpl +++ b/templates/install.tmpl @@ -157,168 +157,171 @@

{{ctx.Locale.Tr "install.optional_title"}}

- - -
- - {{ctx.Locale.Tr "install.email_title"}} - -
- - -
-
- - -
-
- - - {{ctx.Locale.TrString "install.smtp_from_helper"}}{{/* it contains lt/gt chars*/}} -
-
- - -
-
- - -
-
-
- - +
+ +
+ + {{ctx.Locale.Tr "install.email_title"}} + +
+ +
-
-
-
- - +
+ +
-
-
+
+ + + {{ctx.Locale.TrString "install.smtp_from_helper"}}{{/* it contains lt/gt chars*/}} +
+
+ + +
+
+ + +
+
+
+ + +
+
+
+
+ + +
+
+ - -
- - {{ctx.Locale.Tr "install.server_service_title"}} - -
-
- - + +
+ + {{ctx.Locale.Tr "install.server_service_title"}} + +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
- - - {{ctx.Locale.Tr "install.no_reply_address_helper"}} -
-
- -
+ - -
- - {{ctx.Locale.Tr "install.admin_title"}} - -

{{ctx.Locale.Tr "install.admin_setting_desc"}}

-
- - -
-
- - -
-
- - -
-
- - -
-
+ +
+ + {{ctx.Locale.Tr "install.admin_title"}} + +

{{ctx.Locale.Tr "install.admin_setting_desc"}}

+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
{{if .EnvConfigKeys}} @@ -333,12 +336,11 @@ {{end}} -
These configuration options will be written into: {{.CustomConfFile}}
-
+
diff --git a/templates/org/menu.tmpl b/templates/org/menu.tmpl index c519606d1f63a..698a9559c5287 100644 --- a/templates/org/menu.tmpl +++ b/templates/org/menu.tmpl @@ -40,8 +40,9 @@ {{end}} {{if .IsOrganizationOwner}} + - {{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}} + {{svg "octicon-tools"}} {{ctx.Locale.Tr "repo.settings"}} {{end}}
diff --git a/templates/org/team/members.tmpl b/templates/org/team/members.tmpl index 7e9a59a6bfb45..5433f01530ff3 100644 --- a/templates/org/team/members.tmpl +++ b/templates/org/team/members.tmpl @@ -8,7 +8,7 @@
{{template "org/team/navbar" .}} {{if .IsOrganizationOwner}} -
+
{{.CsrfTokenHtml}} @@ -21,7 +21,7 @@
{{end}} -
+
{{range .Team.Members}}
diff --git a/templates/org/team/navbar.tmpl b/templates/org/team/navbar.tmpl index 8f2571e1f6a9d..9704f63f6fb51 100644 --- a/templates/org/team/navbar.tmpl +++ b/templates/org/team/navbar.tmpl @@ -1,4 +1,4 @@ -
{{end}} -
+
{{range .Team.Repos}}
diff --git a/templates/package/content/container.tmpl b/templates/package/content/container.tmpl index fe393f4388968..138fedecb3fc3 100644 --- a/templates/package/content/container.tmpl +++ b/templates/package/content/container.tmpl @@ -54,7 +54,7 @@ {{end}} {{if .PackageDescriptor.Metadata.ImageLayers}}

{{ctx.Locale.Tr "packages.container.layers"}}

-
+
{{range .PackageDescriptor.Metadata.ImageLayers}} @@ -80,7 +80,7 @@ {{range $key, $value := .PackageDescriptor.Metadata.Labels}} - + {{end}} diff --git a/templates/package/content/maven.tmpl b/templates/package/content/maven.tmpl index 3a7de335de88f..f56595a8308ec 100644 --- a/templates/package/content/maven.tmpl +++ b/templates/package/content/maven.tmpl @@ -1,4 +1,8 @@ -{{if eq .PackageDescriptor.Package.Type "maven"}} +{{if and (eq .PackageDescriptor.Package.Type "maven") (not .PackageDescriptor.Metadata)}} +

{{ctx.Locale.Tr "packages.installation"}}

+
{{ctx.Locale.Tr "packages.no_metadata"}}
+{{end}} +{{if and (eq .PackageDescriptor.Package.Type "maven") .PackageDescriptor.Metadata}}

{{ctx.Locale.Tr "packages.installation"}}

diff --git a/templates/package/content/npm.tmpl b/templates/package/content/npm.tmpl index a78a07d874673..01298a664c734 100644 --- a/templates/package/content/npm.tmpl +++ b/templates/package/content/npm.tmpl @@ -45,6 +45,15 @@
{{end}} + {{if .PackageDescriptor.Metadata.BundleDependencies}} +

{{ctx.Locale.Tr "packages.npm.dependencies.bundle"}}

+
+ {{range .PackageDescriptor.Metadata.BundleDependencies}} + {{.}} + {{end}} +
+ {{end}} + {{if .PackageDescriptor.Metadata.Keywords}}

{{ctx.Locale.Tr "packages.keywords"}}

diff --git a/templates/package/metadata/maven.tmpl b/templates/package/metadata/maven.tmpl index 548be61790fff..36412723d24f8 100644 --- a/templates/package/metadata/maven.tmpl +++ b/templates/package/metadata/maven.tmpl @@ -1,4 +1,7 @@ -{{if eq .PackageDescriptor.Package.Type "maven"}} +{{if and (eq .PackageDescriptor.Package.Type "maven") (not .PackageDescriptor.Metadata)}} +
{{svg "octicon-note" 16 "tw-mr-2"}} {{ctx.Locale.Tr "packages.no_metadata"}}
+{{end}} +{{if and (eq .PackageDescriptor.Package.Type "maven") .PackageDescriptor.Metadata}} {{if .PackageDescriptor.Metadata.Name}}
{{svg "octicon-note" 16 "tw-mr-2"}} {{.PackageDescriptor.Metadata.Name}}
{{end}} {{if .PackageDescriptor.Metadata.ProjectURL}}
{{svg "octicon-link-external" 16 "tw-mr-2"}} {{ctx.Locale.Tr "packages.details.project_site"}}
{{end}} {{range .PackageDescriptor.Metadata.Licenses}}
{{svg "octicon-law" 16 "tw-mr-2"}} {{.}}
{{end}} diff --git a/templates/package/settings.tmpl b/templates/package/settings.tmpl index 9424baf4939ef..4b8773477b4af 100644 --- a/templates/package/settings.tmpl +++ b/templates/package/settings.tmpl @@ -59,7 +59,7 @@ {{ctx.Locale.Tr "packages.settings.delete"}}
-
+
{{ctx.Locale.Tr "packages.settings.delete.notice" .PackageDescriptor.Package.Name .PackageDescriptor.Version.Version}}
diff --git a/templates/projects/new.tmpl b/templates/projects/new.tmpl index 92ee36c1c44fd..bd173b54bcec9 100644 --- a/templates/projects/new.tmpl +++ b/templates/projects/new.tmpl @@ -25,11 +25,11 @@
diff --git a/templates/projects/view.tmpl b/templates/projects/view.tmpl index 3e000660e2859..584462d2a24dd 100644 --- a/templates/projects/view.tmpl +++ b/templates/projects/view.tmpl @@ -64,22 +64,18 @@
-
+
{{range .Columns}} -
+
-
-
- {{.NumIssues ctx}} -
- {{.Title}} +
+ {{.NumIssues ctx}}
+
{{.Title}}
{{if $canWriteProject}} -
+ {{if eq .GetType 4}} + {{$expandDirection := $line.GetExpandDirection}} - - - + + - - - + + + {{if eq .GetType 4}} + {{$expandDirection := $line.GetExpandDirection}} {{end}} {{$inlineDiff := $.section.GetComputedInlineDiffFor $line ctx.Locale}} - - - + + + {{end}} {{end}} diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 92a3163642cf6..2f9d4ecab6fa9 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -110,7 +110,7 @@ {{$isExpandable := or (gt $file.Addition 0) (gt $file.Deletion 0) $file.IsBin}} {{$isReviewFile := and $.IsSigned $.PageIsPullFiles (not $.IsArchived) $.IsShowingAllCommits}}
-

+

- - {{end}} - {{if and (not $file.IsSubmodule) (not $.PageIsWiki)}} - {{if $file.IsDeleted}} - {{ctx.Locale.Tr "repo.diff.view_file"}} - {{else}} - {{ctx.Locale.Tr "repo.diff.view_file"}} - {{if and $.Repository.CanEnableEditor $.CanEditFile (not $file.IsLFSFile) (not $file.IsBin)}} - {{ctx.Locale.Tr "repo.editor.edit_this_file"}} - {{end}} - {{end}} - {{end}} {{if $isReviewFile}} {{end}} +

@@ -235,7 +240,7 @@ {{if and (not $.Repository.IsArchived) (not .DiffNotAvailable)}} diff --git a/templates/repo/diff/comments.tmpl b/templates/repo/diff/comments.tmpl index c7f4337182415..90d6a511bfab6 100644 --- a/templates/repo/diff/comments.tmpl +++ b/templates/repo/diff/comments.tmpl @@ -61,7 +61,7 @@ {{end}}
{{.Content}}
-
+
{{if .Attachments}} {{template "repo/issue/view_content/attachments" dict "Attachments" .Attachments "RenderedContent" .RenderedContent}} {{end}} diff --git a/templates/repo/diff/conversation.tmpl b/templates/repo/diff/conversation.tmpl index c263ddcdd65c7..08f60644b3b52 100644 --- a/templates/repo/diff/conversation.tmpl +++ b/templates/repo/diff/conversation.tmpl @@ -40,8 +40,8 @@ {{template "repo/diff/comments" dict "root" $ "comments" .comments}}
-
-
+
+
@@ -50,7 +50,7 @@
{{if and $.CanMarkConversation $hasReview (not $isReviewPending)}} - {{end}} {{if and $.SignedUserID (not $.Repository.IsArchived)}} - {{end}} diff --git a/templates/repo/diff/new_review.tmpl b/templates/repo/diff/new_review.tmpl index a2eae007a56c9..1b74a230f47d4 100644 --- a/templates/repo/diff/new_review.tmpl +++ b/templates/repo/diff/new_review.tmpl @@ -30,20 +30,24 @@ {{end}}
{{$showSelfTooltip := (and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID))}} - {{if $showSelfTooltip}} - - - - {{else}} - + {{if not $.Issue.IsClosed}} + {{if $showSelfTooltip}} + + + + {{else}} + + {{end}} {{end}} - {{if $showSelfTooltip}} - - - - {{else}} - + {{if not $.Issue.IsClosed}} + {{if $showSelfTooltip}} + + + + {{else}} + + {{end}} {{end}}
diff --git a/templates/repo/diff/section_split.tmpl b/templates/repo/diff/section_split.tmpl index 67e2b195de346..37b42bcb376ab 100644 --- a/templates/repo/diff/section_split.tmpl +++ b/templates/repo/diff/section_split.tmpl @@ -1,4 +1,5 @@ {{$file := .file}} +{{$blobExcerptRepoLink := or ctx.RootData.CommitRepoLink ctx.RootData.RepoLink}}
@@ -15,20 +16,21 @@ {{if or (ne .GetType 2) (not $hasmatch)}} {{if eq .GetType 4}} + {{$expandDirection := $line.GetExpandDirection}} @@ -11,20 +12,21 @@ {{if eq .GetType 4}} {{if $.root.AfterCommitID}} + {{$expandDirection := $line.GetExpandDirection}}
{{$key}}{{$value}}{{$value}}
{{if .DBBranch.IsDeleted}}
- {{.DBBranch.Name}} + {{.DBBranch.Name}}

{{ctx.Locale.Tr "repo.branch.deleted_by" .DBBranch.DeletedBy.Name}} {{TimeSinceUnix .DBBranch.DeletedUnix ctx.Locale}}

diff --git a/templates/repo/branch_dropdown.tmpl b/templates/repo/branch_dropdown.tmpl index 7b39830df8082..c4f73875f2cfa 100644 --- a/templates/repo/branch_dropdown.tmpl +++ b/templates/repo/branch_dropdown.tmpl @@ -69,9 +69,9 @@
{{/* show dummy elements before Vue componment is mounted, this code must match the code in BranchTagSelector.vue */}} -
diff --git a/templates/repo/clone_buttons.tmpl b/templates/repo/clone_buttons.tmpl index 89daba9dc9827..91952c8a06db2 100644 --- a/templates/repo/clone_buttons.tmpl +++ b/templates/repo/clone_buttons.tmpl @@ -9,7 +9,7 @@ SSH {{end}} - + diff --git a/templates/repo/code/recently_pushed_new_branches.tmpl b/templates/repo/code/recently_pushed_new_branches.tmpl index b808f413d352f..025cc1a403d8e 100644 --- a/templates/repo/code/recently_pushed_new_branches.tmpl +++ b/templates/repo/code/recently_pushed_new_branches.tmpl @@ -1,11 +1,11 @@ {{range .RecentlyPushedNewBranches}} -
-
+
+
{{$timeSince := TimeSince .CommitTime.AsTime ctx.Locale}} - {{$branchLink := HTMLFormat `%s` $.RepoLink (PathEscapeSegments .Name) .Name}} + {{$branchLink := HTMLFormat `%s` .BranchLink .BranchDisplayName}} {{ctx.Locale.Tr "repo.pulls.recently_pushed_new_branches" $branchLink $timeSince}}
- + {{ctx.Locale.Tr "repo.pulls.compare_changes"}}
diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl index 938d93b323ae0..b8195ac544983 100644 --- a/templates/repo/commit_page.tmpl +++ b/templates/repo/commit_page.tmpl @@ -139,7 +139,7 @@ {{end}} {{template "repo/commit_load_branches_and_tags" .}}
-
+
{{if .Author}} {{ctx.AvatarUtils.Avatar .Author 28 "tw-mr-2"}} diff --git a/templates/repo/commits_list_small.tmpl b/templates/repo/commits_list_small.tmpl index 6ca6dd5cdcb26..4c67319b8c05a 100644 --- a/templates/repo/commits_list_small.tmpl +++ b/templates/repo/commits_list_small.tmpl @@ -13,13 +13,12 @@ {{$commitLink:= printf "%s/commit/%s" $.comment.Issue.PullRequest.BaseRepo.Link (PathEscape .ID.String)}} - {{RenderCommitMessageLinkSubject $.root.Context .Message $commitLink ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx)}} + + {{- RenderCommitMessageLinkSubject $.root.Context .Message $commitLink ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx) -}} + {{if IsMultilineCommitMessage .Message}} - - {{end}} - {{if IsMultilineCommitMessage .Message}} -
{{RenderCommitBody $.root.Context .Message ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx)}}
+ {{end}} @@ -47,5 +46,10 @@
+ {{if IsMultilineCommitMessage .Message}} +
+		{{- RenderCommitBody $.root.Context .Message ($.comment.Issue.PullRequest.BaseRepo.ComposeMetas ctx) -}}
+	
+ {{end}} {{end}}
diff --git a/templates/repo/contributors.tmpl b/templates/repo/contributors.tmpl index 54e3e426a2338..6b8a63fe9964d 100644 --- a/templates/repo/contributors.tmpl +++ b/templates/repo/contributors.tmpl @@ -1,5 +1,6 @@ {{if .Permission.CanRead ctx.Consts.RepoUnitTypeCode}}
{{ctx.Locale.Tr "repo.visibility"}}
{{if .IsForcedPrivate}} - + {{else}} diff --git a/templates/repo/diff/blob_excerpt.tmpl b/templates/repo/diff/blob_excerpt.tmpl index 8312b5d913add..2874ac6a55c61 100644 --- a/templates/repo/diff/blob_excerpt.tmpl +++ b/templates/repo/diff/blob_excerpt.tmpl @@ -1,20 +1,21 @@ {{if $.IsSplitStyle}} {{range $k, $line := $.section.Lines}} -
-
- {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}} +
+ {{if or (eq $expandDirection 3) (eq $expandDirection 5)}} {{end}} - {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}} + {{if or (eq $expandDirection 3) (eq $expandDirection 4)}} {{end}} - {{if eq $line.GetExpandDirection 2}} + {{if eq $expandDirection 2}} @@ -26,17 +27,17 @@ {{else}} {{$inlineDiff := $.section.GetComputedInlineDiffFor $line ctx.Locale}}
{{if and $line.LeftIdx $inlineDiff.EscapeStatus.Escaped}}{{end}}{{if $line.LeftIdx}}{{end}}{{/* + {{if and $line.LeftIdx $inlineDiff.EscapeStatus.Escaped}}{{end}}{{if $line.LeftIdx}}{{end}}{{/* */}}{{if $line.LeftIdx}}{{template "repo/diff/section_code" dict "diff" $inlineDiff}}{{else}}{{/* */}}{{/* */}}{{end}}{{/* */}} {{if and $line.RightIdx $inlineDiff.EscapeStatus.Escaped}}{{end}}{{if $line.RightIdx}}{{end}}{{/* + {{if and $line.RightIdx $inlineDiff.EscapeStatus.Escaped}}{{end}}{{if $line.RightIdx}}{{end}}{{/* */}}{{if $line.RightIdx}}{{template "repo/diff/section_code" dict "diff" $inlineDiff}}{{else}}{{/* */}}{{/* */}}{{end}}{{/* @@ -46,21 +47,22 @@ {{end}} {{else}} {{range $k, $line := $.section.Lines}} -
-
- {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}} +
+ {{if or (eq $expandDirection 3) (eq $expandDirection 5)}} {{end}} - {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}} + {{if or (eq $expandDirection 3) (eq $expandDirection 4)}} {{end}} - {{if eq $line.GetExpandDirection 2}} + {{if eq $expandDirection 2}} @@ -72,9 +74,9 @@
{{if $inlineDiff.EscapeStatus.Escaped}}{{end}}{{$inlineDiff.Content}}{{if $inlineDiff.EscapeStatus.Escaped}}{{end}}{{$inlineDiff.Content}}
-
- {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}} - {{end}} - {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}} - {{end}} - {{if eq $line.GetExpandDirection 2}} - {{end}} diff --git a/templates/repo/diff/section_unified.tmpl b/templates/repo/diff/section_unified.tmpl index 411115970963a..708b333291641 100644 --- a/templates/repo/diff/section_unified.tmpl +++ b/templates/repo/diff/section_unified.tmpl @@ -1,4 +1,5 @@ {{$file := .file}} +{{$blobExcerptRepoLink := or ctx.RootData.CommitRepoLink ctx.RootData.RepoLink}}
-
- {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}} - {{end}} - {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}} - {{end}} - {{if eq $line.GetExpandDirection 2}} - {{end}} diff --git a/templates/repo/editor/diff_preview.tmpl b/templates/repo/editor/diff_preview.tmpl index e2e922be343ca..fd543a5ab968f 100644 --- a/templates/repo/editor/diff_preview.tmpl +++ b/templates/repo/editor/diff_preview.tmpl @@ -1,3 +1,4 @@ +{{if .File}}
@@ -9,3 +10,8 @@
+{{else}} +
+ {{ctx.Locale.Tr "repo.editor.no_changes_to_show"}} +
+{{end}} diff --git a/templates/repo/editor/edit.tmpl b/templates/repo/editor/edit.tmpl index d52e5a047ab26..e990177d8a875 100644 --- a/templates/repo/editor/edit.tmpl +++ b/templates/repo/editor/edit.tmpl @@ -26,26 +26,30 @@
- -
- -
-
-
- {{ctx.Locale.Tr "loading"}} + -
-
+
+
+ +
+
+
+ {{ctx.Locale.Tr "loading"}} +
+
+
+
{{template "repo/editor/commit_form" .}} diff --git a/templates/repo/editor/patch.tmpl b/templates/repo/editor/patch.tmpl index ff5c09667fcc2..a29021fa47baf 100644 --- a/templates/repo/editor/patch.tmpl +++ b/templates/repo/editor/patch.tmpl @@ -19,10 +19,10 @@
-