{{template "repo/header" .}} -
-

- {{DateTime "long" .DateFrom}} - {{DateTime "long" .DateUntil}} - - -

-
- - {{if (or (.Permission.CanRead $.UnitTypeIssues) (.Permission.CanRead $.UnitTypePullRequests))}} -

{{ctx.Locale.Tr "repo.activity.overview"}}

-
- {{if .Permission.CanRead $.UnitTypePullRequests}} -
- {{if gt .Activity.ActivePRCount 0}} -
- - -
- {{else}} -
- -
- {{end}} - {{ctx.Locale.TrN .Activity.ActivePRCount "repo.activity.active_prs_count_1" "repo.activity.active_prs_count_n" .Activity.ActivePRCount | Safe}} -
- {{end}} - {{if .Permission.CanRead $.UnitTypeIssues}} -
- {{if gt .Activity.ActiveIssueCount 0}} -
- - -
- {{else}} -
- -
- {{end}} - {{ctx.Locale.TrN .Activity.ActiveIssueCount "repo.activity.active_issues_count_1" "repo.activity.active_issues_count_n" .Activity.ActiveIssueCount | Safe}} -
- {{end}} +
+
+ {{template "repo/navbar" .}}
-
- {{if .Permission.CanRead $.UnitTypePullRequests}} - - {{svg "octicon-git-pull-request"}} {{.Activity.MergedPRCount}}
- {{ctx.Locale.TrN .Activity.MergedPRCount "repo.activity.merged_prs_count_1" "repo.activity.merged_prs_count_n"}} -
- - {{svg "octicon-git-branch"}} {{.Activity.OpenedPRCount}}
- {{ctx.Locale.TrN .Activity.OpenedPRCount "repo.activity.opened_prs_count_1" "repo.activity.opened_prs_count_n"}} -
- {{end}} - {{if .Permission.CanRead $.UnitTypeIssues}} - - {{svg "octicon-issue-closed"}} {{.Activity.ClosedIssueCount}}
- {{ctx.Locale.TrN .Activity.ClosedIssueCount "repo.activity.closed_issues_count_1" "repo.activity.closed_issues_count_n"}} -
- - {{svg "octicon-issue-opened"}} {{.Activity.OpenedIssueCount}}
- {{ctx.Locale.TrN .Activity.OpenedIssueCount "repo.activity.new_issues_count_1" "repo.activity.new_issues_count_n"}} -
- {{end}} +
+ {{if .PageIsPulse}}{{template "repo/pulse" .}}{{end}} + {{if .PageIsContributors}}{{template "repo/contributors" .}}{{end}}
- {{end}} - - {{if .Permission.CanRead $.UnitTypeCode}} - {{if eq .Activity.Code.CommitCountInAllBranches 0}} -
-

{{ctx.Locale.Tr "repo.activity.no_git_activity"}}

-
- {{end}} - {{if gt .Activity.Code.CommitCountInAllBranches 0}} -
-
- {{ctx.Locale.Tr "repo.activity.git_stats_exclude_merges"}} - {{ctx.Locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_author_1" "repo.activity.git_stats_author_n" .Activity.Code.AuthorCount}} - {{ctx.Locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_pushed_1" "repo.activity.git_stats_pushed_n"}} - {{ctx.Locale.TrN .Activity.Code.CommitCount "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCount}} - {{ctx.Locale.Tr "repo.activity.git_stats_push_to_branch" .Repository.DefaultBranch}} - {{ctx.Locale.TrN .Activity.Code.CommitCountInAllBranches "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCountInAllBranches}} - {{ctx.Locale.Tr "repo.activity.git_stats_push_to_all_branches"}} - {{ctx.Locale.Tr "repo.activity.git_stats_on_default_branch" .Repository.DefaultBranch}} - {{ctx.Locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_file_1" "repo.activity.git_stats_file_n" .Activity.Code.ChangedFiles}} - {{ctx.Locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_files_changed_1" "repo.activity.git_stats_files_changed_n"}} - {{ctx.Locale.Tr "repo.activity.git_stats_additions"}} - {{ctx.Locale.TrN .Activity.Code.Additions "repo.activity.git_stats_addition_1" "repo.activity.git_stats_addition_n" .Activity.Code.Additions}} - {{ctx.Locale.Tr "repo.activity.git_stats_and_deletions"}} - {{ctx.Locale.TrN .Activity.Code.Deletions "repo.activity.git_stats_deletion_1" "repo.activity.git_stats_deletion_n" .Activity.Code.Deletions}}. -
-
-
-
-
- {{end}} - {{end}} - - {{if gt .Activity.PublishedReleaseCount 0}} -

- {{svg "octicon-tag" 16 "gt-mr-3"}} - {{ctx.Locale.Tr "repo.activity.title.releases_published_by" - (ctx.Locale.TrN .Activity.PublishedReleaseCount "repo.activity.title.releases_1" "repo.activity.title.releases_n" .Activity.PublishedReleaseCount) - (ctx.Locale.TrN .Activity.PublishedReleaseAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.PublishedReleaseAuthorCount) - }} -

-
- {{range .Activity.PublishedReleases}} -

- {{ctx.Locale.Tr "repo.activity.published_release_label"}} - {{.TagName}} - {{if not .IsTag}} - {{.Title | RenderEmoji $.Context | RenderCodeBlock}} - {{end}} - {{TimeSinceUnix .CreatedUnix ctx.Locale}} -

- {{end}} -
- {{end}} - - {{if gt .Activity.MergedPRCount 0}} -

- {{svg "octicon-git-pull-request" 16 "gt-mr-3"}} - {{ctx.Locale.Tr "repo.activity.title.prs_merged_by" - (ctx.Locale.TrN .Activity.MergedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n" .Activity.MergedPRCount) - (ctx.Locale.TrN .Activity.MergedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.MergedPRAuthorCount) - }} -

-
- {{range .Activity.MergedPRs}} -

- {{ctx.Locale.Tr "repo.activity.merged_prs_label"}} - #{{.Index}} {{.Issue.Title | RenderEmoji $.Context | RenderCodeBlock}} - {{TimeSinceUnix .MergedUnix ctx.Locale}} -

- {{end}} -
- {{end}} - - {{if gt .Activity.OpenedPRCount 0}} -

- {{svg "octicon-git-branch" 16 "gt-mr-3"}} - {{ctx.Locale.Tr "repo.activity.title.prs_opened_by" - (ctx.Locale.TrN .Activity.OpenedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n" .Activity.OpenedPRCount) - (ctx.Locale.TrN .Activity.OpenedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.OpenedPRAuthorCount) - }} -

-
- {{range .Activity.OpenedPRs}} -

- {{ctx.Locale.Tr "repo.activity.opened_prs_label"}} - #{{.Index}} {{.Issue.Title | RenderEmoji $.Context | RenderCodeBlock}} - {{TimeSinceUnix .Issue.CreatedUnix ctx.Locale}} -

- {{end}} -
- {{end}} - - {{if gt .Activity.ClosedIssueCount 0}} -

- {{svg "octicon-issue-closed" 16 "gt-mr-3"}} - {{ctx.Locale.Tr "repo.activity.title.issues_closed_from" - (ctx.Locale.TrN .Activity.ClosedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n" .Activity.ClosedIssueCount) - (ctx.Locale.TrN .Activity.ClosedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.ClosedIssueAuthorCount) - }} -

-
- {{range .Activity.ClosedIssues}} -

- {{ctx.Locale.Tr "repo.activity.closed_issue_label"}} - #{{.Index}} {{.Title | RenderEmoji $.Context | RenderCodeBlock}} - {{TimeSinceUnix .ClosedUnix ctx.Locale}} -

- {{end}} -
- {{end}} - - {{if gt .Activity.OpenedIssueCount 0}} -

- {{svg "octicon-issue-opened" 16 "gt-mr-3"}} - {{ctx.Locale.Tr "repo.activity.title.issues_created_by" - (ctx.Locale.TrN .Activity.OpenedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n" .Activity.OpenedIssueCount) - (ctx.Locale.TrN .Activity.OpenedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.OpenedIssueAuthorCount) - }} -

-
- {{range .Activity.OpenedIssues}} -

- {{ctx.Locale.Tr "repo.activity.new_issue_label"}} - #{{.Index}} {{.Title | RenderEmoji $.Context | RenderCodeBlock}} - {{TimeSinceUnix .CreatedUnix ctx.Locale}} -

- {{end}} -
- {{end}} - - {{if gt .Activity.UnresolvedIssueCount 0}} -

- {{svg "octicon-comment-discussion" 16 "gt-mr-3"}} - {{ctx.Locale.TrN .Activity.UnresolvedIssueCount "repo.activity.title.unresolved_conv_1" "repo.activity.title.unresolved_conv_n" .Activity.UnresolvedIssueCount}} -

-
- {{range .Activity.UnresolvedIssues}} -

- {{ctx.Locale.Tr "repo.activity.unresolved_conv_label"}} - #{{.Index}} - {{if .IsPull}} - {{.Title | RenderEmoji $.Context | RenderCodeBlock}} - {{else}} - {{.Title | RenderEmoji $.Context | RenderCodeBlock}} - {{end}} - {{TimeSinceUnix .UpdatedUnix ctx.Locale}} -

- {{end}} -
- {{end}}
{{template "base/footer" .}} + diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index 7702770c406..4eb31e0e8e6 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -78,9 +78,12 @@ {{end}} - {{if $.FileName}} - {{svg "octicon-file-code"}} - {{end}} + + {{svg "octicon-file-code"}} + {{end}} diff --git a/templates/repo/contributors.tmpl b/templates/repo/contributors.tmpl new file mode 100644 index 00000000000..49a251c1f96 --- /dev/null +++ b/templates/repo/contributors.tmpl @@ -0,0 +1,13 @@ +{{if .Permission.CanRead $.UnitTypeCode}} +
+
+{{end}} diff --git a/templates/repo/editor/cherry_pick.tmpl b/templates/repo/editor/cherry_pick.tmpl index ab2c3c33490..b65c3a30337 100644 --- a/templates/repo/editor/cherry_pick.tmpl +++ b/templates/repo/editor/cherry_pick.tmpl @@ -13,9 +13,9 @@ {{$shaurl := printf "%s/commit/%s" $.RepoLink (PathEscape .SHA)}} {{$shalink := printf `%s` (Escape $shaurl) (ShortSha .SHA)}} {{if eq .CherryPickType "revert"}} - {{ctx.Locale.Tr "repo.editor.revert" $shalink | Str2html}} + {{ctx.Locale.Tr "repo.editor.revert" ($shalink|Safe)}} {{else}} - {{ctx.Locale.Tr "repo.editor.cherry_pick" $shalink | Str2html}} + {{ctx.Locale.Tr "repo.editor.cherry_pick" ($shalink|Safe)}} {{end}} {{.Repository.FullName}} diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 93102467ccb..3e27d963bb6 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -5,9 +5,9 @@
{{template "repo/icon" .}}
{{if .IsArchived}} diff --git a/templates/repo/icon.tmpl b/templates/repo/icon.tmpl index 5a80b959d00..a001f818919 100644 --- a/templates/repo/icon.tmpl +++ b/templates/repo/icon.tmpl @@ -1,10 +1,10 @@ {{$avatarLink := (.RelAvatarLink ctx)}} {{if $avatarLink}} - {{.FullName}} + {{.FullName}} {{else if $.IsMirror}} - {{svg "octicon-mirror" 32}} + {{svg "octicon-mirror" 24}} {{else if $.IsFork}} - {{svg "octicon-repo-forked" 32}} + {{svg "octicon-repo-forked" 24}} {{else}} - {{svg "octicon-repo" 32}} + {{svg "octicon-repo" 24}} {{end}} diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 3cb7f7d0cfc..c1797ba77d5 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -591,11 +591,11 @@ {{$newProjectDisplayHtml = printf `%s` (ctx.Locale.Tr $trKey | Escape) (.Project.Title | Escape)}} {{end}} {{if and (gt .OldProjectID 0) (gt .ProjectID 0)}} - {{ctx.Locale.Tr "repo.issues.change_project_at" $oldProjectDisplayHtml $newProjectDisplayHtml $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.change_project_at" ($oldProjectDisplayHtml|Safe) ($newProjectDisplayHtml|Safe) $createdStr}} {{else if gt .OldProjectID 0}} - {{ctx.Locale.Tr "repo.issues.remove_project_at" $oldProjectDisplayHtml $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.remove_project_at" ($oldProjectDisplayHtml|Safe) $createdStr}} {{else if gt .ProjectID 0}} - {{ctx.Locale.Tr "repo.issues.add_project_at" $newProjectDisplayHtml $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.add_project_at" ($newProjectDisplayHtml|Safe) $createdStr}} {{end}}
diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index 2b5776ea03a..f1ab53eb677 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -197,7 +197,7 @@ {{if .AllowMerge}} {{/* user is allowed to merge */}} {{$prUnit := .Repository.MustGetUnit $.Context $.UnitTypePullRequests}} {{$approvers := (.Issue.PullRequest.GetApprovers ctx)}} - {{if or $prUnit.PullRequestsConfig.AllowMerge $prUnit.PullRequestsConfig.AllowRebase $prUnit.PullRequestsConfig.AllowRebaseMerge $prUnit.PullRequestsConfig.AllowSquash}} + {{if or $prUnit.PullRequestsConfig.AllowMerge $prUnit.PullRequestsConfig.AllowRebase $prUnit.PullRequestsConfig.AllowRebaseMerge $prUnit.PullRequestsConfig.AllowSquash $prUnit.PullRequestsConfig.AllowFastForwardOnly}} {{$hasPendingPullRequestMergeTip := ""}} {{if .HasPendingPullRequestMerge}} {{$createdPRMergeStr := TimeSinceUnix .PendingPullRequestMerge.CreatedUnix ctx.Locale}} @@ -268,6 +268,13 @@ 'mergeMessageFieldText': {{.GetCommitMessages}} + defaultSquashMergeMessage, 'hideAutoMerge': generalHideAutoMerge, }, + { + 'name': 'fast-forward-only', + 'allowed': {{and $prUnit.PullRequestsConfig.AllowFastForwardOnly (eq .Issue.PullRequest.CommitsBehind 0)}}, + 'textDoMerge': {{ctx.Locale.Tr "repo.pulls.fast_forward_only_merge_pull_request"}}, + 'hideMergeMessageTexts': true, + 'hideAutoMerge': generalHideAutoMerge, + }, { 'name': 'manually-merged', 'allowed': {{$prUnit.PullRequestsConfig.AllowManualMerge}}, diff --git a/templates/repo/issue/view_content/pull_merge_instruction.tmpl b/templates/repo/issue/view_content/pull_merge_instruction.tmpl index 3dab44710ea..a214f29786b 100644 --- a/templates/repo/issue/view_content/pull_merge_instruction.tmpl +++ b/templates/repo/issue/view_content/pull_merge_instruction.tmpl @@ -35,6 +35,10 @@
git checkout {{.PullRequest.BaseBranch}}
git merge --squash {{$localBranch}}
+
+
git checkout {{.PullRequest.BaseBranch}}
+
git merge --ff-only {{$localBranch}}
+
git checkout {{.PullRequest.BaseBranch}}
git merge {{$localBranch}}
diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 6c13eef0237..22f67ade7b3 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -2,7 +2,7 @@ {{template "repo/issue/branch_selector_field" .}} {{if .Issue.IsPull}} - +
+
+ + +
+
@@ -545,6 +551,7 @@ + {{svg "octicon-triangle-down" 14 "dropdown icon"}}
{{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "merge")}} @@ -559,12 +566,16 @@ {{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "squash")}} {{ctx.Locale.Tr "repo.pulls.squash_merge_pull_request"}} {{end}} + {{if (eq $prUnit.PullRequestsConfig.DefaultMergeStyle "fast-forward-only")}} + {{ctx.Locale.Tr "repo.pulls.fast_forward_only_merge_pull_request"}} + {{end}}
diff --git a/templates/repo/settings/webhook/base_list.tmpl b/templates/repo/settings/webhook/base_list.tmpl index ed6e670d60c..5a3fc0e7b88 100644 --- a/templates/repo/settings/webhook/base_list.tmpl +++ b/templates/repo/settings/webhook/base_list.tmpl @@ -3,52 +3,7 @@
diff --git a/templates/repo/settings/webhook/link_menu.tmpl b/templates/repo/settings/webhook/link_menu.tmpl new file mode 100644 index 00000000000..e2c86dcc3c0 --- /dev/null +++ b/templates/repo/settings/webhook/link_menu.tmpl @@ -0,0 +1,50 @@ +{{$size := 20}} +{{if .Size}} + {{$size = .Size}} +{{end}} + diff --git a/templates/shared/webhook/icon.tmpl b/templates/shared/webhook/icon.tmpl index 84f9de266fa..0f80787c574 100644 --- a/templates/shared/webhook/icon.tmpl +++ b/templates/shared/webhook/icon.tmpl @@ -3,7 +3,7 @@ {{$size = .Size}} {{end}} {{if eq .HookType "gitea"}} - + {{svg "gitea-gitea" $size "img"}} {{else if eq .HookType "gogs"}} {{else if eq .HookType "slack"}} diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 403f241d727..a881afaf0ec 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -19195,6 +19195,11 @@ "description": "EditRepoOption options when editing a repository's properties", "type": "object", "properties": { + "allow_fast_forward_only_merge": { + "description": "either `true` to allow fast-forward-only merging pull requests, or `false` to prevent fast-forward-only merging.", + "type": "boolean", + "x-go-name": "AllowFastForwardOnly" + }, "allow_manual_merge": { "description": "either `true` to allow mark pr as merged manually, or `false` to prevent it.", "type": "boolean", @@ -19251,7 +19256,7 @@ "x-go-name": "DefaultDeleteBranchAfterMerge" }, "default_merge_style": { - "description": "set to a merge style to be used by this repository: \"merge\", \"rebase\", \"rebase-merge\", or \"squash\".", + "description": "set to a merge style to be used by this repository: \"merge\", \"rebase\", \"rebase-merge\", \"squash\", or \"fast-forward-only\".", "type": "string", "x-go-name": "DefaultMergeStyle" }, @@ -20650,6 +20655,7 @@ "rebase", "rebase-merge", "squash", + "fast-forward-only", "manually-merged" ] }, @@ -22036,6 +22042,10 @@ "description": "Repository represents a repository", "type": "object", "properties": { + "allow_fast_forward_only_merge": { + "type": "boolean", + "x-go-name": "AllowFastForwardOnly" + }, "allow_merge_commits": { "type": "boolean", "x-go-name": "AllowMerge" diff --git a/templates/user/auth/signin_inner.tmpl b/templates/user/auth/signin_inner.tmpl index 40e54ec8fa9..a0aea5cb9b1 100644 --- a/templates/user/auth/signin_inner.tmpl +++ b/templates/user/auth/signin_inner.tmpl @@ -9,21 +9,20 @@ {{end}}
-
+ {{.CsrfTokenHtml}}
- +
{{if or (not .DisablePassword) .LinkAccountMode}}
- +
{{end}} {{if not .LinkAccountMode}}
-
@@ -34,7 +33,6 @@ {{template "user/auth/captcha" .}}
-
diff --git a/templates/user/auth/signup_inner.tmpl b/templates/user/auth/signup_inner.tmpl index e930bd3d158..65ce98c31ab 100644 --- a/templates/user/auth/signup_inner.tmpl +++ b/templates/user/auth/signup_inner.tmpl @@ -7,7 +7,7 @@ {{end}}
-
+ {{.CsrfTokenHtml}} {{if or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister)}} {{template "base/alert" .}} @@ -17,28 +17,27 @@ {{else}}
- +
- +
{{if not .DisablePassword}}
- +
- +
{{end}} {{template "user/auth/captcha" .}}
-