Skip to content

Commit ce2f29b

Browse files
committed
Merge branch 'main' into fix-jquery-hide
2 parents 309d8bf + 51383ec commit ce2f29b

File tree

149 files changed

+1054
-1000
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+1054
-1000
lines changed

models/avatars/avatar.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121

2222
const (
2323
// DefaultAvatarClass is the default class of a rendered avatar
24-
DefaultAvatarClass = "ui avatar vm"
24+
DefaultAvatarClass = "ui avatar gt-vm"
2525
// DefaultAvatarPixelSize is the default size in pixels of a rendered avatar
2626
DefaultAvatarPixelSize = 28
2727
)

models/repo/repo_unit.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ type PullRequestsConfig struct {
125125
AllowRebaseUpdate bool
126126
DefaultDeleteBranchAfterMerge bool
127127
DefaultMergeStyle MergeStyle
128+
DefaultAllowMaintainerEdit bool
128129
}
129130

130131
// FromDB fills up a PullRequestsConfig from serialized format.

modules/structs/repo.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ type Repository struct {
9696
AllowRebaseUpdate bool `json:"allow_rebase_update"`
9797
DefaultDeleteBranchAfterMerge bool `json:"default_delete_branch_after_merge"`
9898
DefaultMergeStyle string `json:"default_merge_style"`
99+
DefaultAllowMaintainerEdit bool `json:"default_allow_maintainer_edit"`
99100
AvatarURL string `json:"avatar_url"`
100101
Internal bool `json:"internal"`
101102
MirrorInterval string `json:"mirror_interval"`
@@ -187,6 +188,8 @@ type EditRepoOption struct {
187188
DefaultDeleteBranchAfterMerge *bool `json:"default_delete_branch_after_merge,omitempty"`
188189
// set to a merge style to be used by this repository: "merge", "rebase", "rebase-merge", or "squash".
189190
DefaultMergeStyle *string `json:"default_merge_style,omitempty"`
191+
// set to `true` to allow edits from maintainers by default
192+
DefaultAllowMaintainerEdit *bool `json:"default_allow_maintainer_edit,omitempty"`
190193
// set to `true` to archive this repository.
191194
Archived *bool `json:"archived,omitempty"`
192195
// set to a string like `8h30m0s` to set the mirror interval time

options/locale/locale_en-US.ini

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,14 +1871,10 @@ settings.enable_timetracker = Enable Time Tracking
18711871
settings.allow_only_contributors_to_track_time = Let Only Contributors Track Time
18721872
settings.pulls_desc = Enable Repository Pull Requests
18731873
settings.pulls.ignore_whitespace = Ignore Whitespace for Conflicts
1874-
settings.pulls.allow_merge_commits = Enable Commit Merging
1875-
settings.pulls.allow_rebase_merge = Enable Rebasing to Merge Commits
1876-
settings.pulls.allow_rebase_merge_commit = Enable Rebasing with explicit merge commits (--no-ff)
1877-
settings.pulls.allow_squash_commits = Enable Squashing to Merge Commits
1878-
settings.pulls.allow_manual_merge = Enable Mark PR as manually merged
18791874
settings.pulls.enable_autodetect_manual_merge = Enable autodetect manual merge (Note: In some special cases, misjudgments can occur)
18801875
settings.pulls.allow_rebase_update = Enable updating pull request branch by rebase
18811876
settings.pulls.default_delete_branch_after_merge = Delete pull request branch after merge by default
1877+
settings.pulls.default_allow_edits_from_maintainers = Allow edits from maintainers by default
18821878
settings.releases_desc = Enable Repository Releases
18831879
settings.packages_desc = Enable Repository Packages Registry
18841880
settings.projects_desc = Enable Repository Projects
@@ -2147,7 +2143,8 @@ settings.block_on_official_review_requests_desc = Merging will not be possible w
21472143
settings.block_outdated_branch = Block merge if pull request is outdated
21482144
settings.block_outdated_branch_desc = Merging will not be possible when head branch is behind base branch.
21492145
settings.default_branch_desc = Select a default repository branch for pull requests and code commits:
2150-
settings.default_merge_style_desc = Default merge style for pull requests:
2146+
settings.merge_style_desc = Merge Styles
2147+
settings.default_merge_style_desc = Default Merge Style
21512148
settings.choose_branch = Choose a branch…
21522149
settings.no_protected_branch = There are no protected branches.
21532150
settings.edit_protected_branch = Edit

routers/api/v1/repo/repo.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,7 @@ func updateRepoUnits(ctx *context.APIContext, opts api.EditRepoOption) error {
863863
AllowRebaseUpdate: true,
864864
DefaultDeleteBranchAfterMerge: false,
865865
DefaultMergeStyle: repo_model.MergeStyleMerge,
866+
DefaultAllowMaintainerEdit: false,
866867
}
867868
} else {
868869
config = unit.PullRequestsConfig()
@@ -898,6 +899,9 @@ func updateRepoUnits(ctx *context.APIContext, opts api.EditRepoOption) error {
898899
if opts.DefaultMergeStyle != nil {
899900
config.DefaultMergeStyle = repo_model.MergeStyle(*opts.DefaultMergeStyle)
900901
}
902+
if opts.DefaultAllowMaintainerEdit != nil {
903+
config.DefaultAllowMaintainerEdit = *opts.DefaultAllowMaintainerEdit
904+
}
901905

902906
units = append(units, repo_model.RepoUnit{
903907
RepoID: repo.ID,

routers/web/repo/blame.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,9 @@ func renderBlame(ctx *context.Context, blameParts []git.BlamePart, commitNames m
262262

263263
var avatar string
264264
if commit.User != nil {
265-
avatar = string(templates.Avatar(commit.User, 18, "mr-3"))
265+
avatar = string(templates.Avatar(commit.User, 18, "gt-mr-3"))
266266
} else {
267-
avatar = string(templates.AvatarByEmail(commit.Author.Email, commit.Author.Name, 18, "mr-3"))
267+
avatar = string(templates.AvatarByEmail(commit.Author.Email, commit.Author.Name, 18, "gt-mr-3"))
268268
}
269269

270270
br.Avatar = gotemplate.HTML(avatar)

routers/web/repo/compare.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,13 @@ func CompareDiff(ctx *context.Context) {
820820

821821
ctx.Data["HasIssuesOrPullsWritePermission"] = ctx.Repo.CanWrite(unit.TypePullRequests)
822822

823+
if unit, err := ctx.Repo.Repository.GetUnit(ctx, unit.TypePullRequests); err == nil {
824+
config := unit.PullRequestsConfig()
825+
ctx.Data["AllowMaintainerEdit"] = config.DefaultAllowMaintainerEdit
826+
} else {
827+
ctx.Data["AllowMaintainerEdit"] = false
828+
}
829+
823830
ctx.HTML(http.StatusOK, tplCompare)
824831
}
825832

routers/web/repo/issue_content_history.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func GetContentHistoryList(ctx *context.Context) {
7171
}
7272

7373
src := html.EscapeString(item.UserAvatarLink)
74-
class := avatars.DefaultAvatarClass + " mr-3"
74+
class := avatars.DefaultAvatarClass + " gt-mr-3"
7575
name := html.EscapeString(username)
7676
avatarHTML := string(templates.AvatarHTML(src, 28, class, username))
7777
timeSinceText := string(timeutil.TimeSinceUnix(item.EditedUnix, ctx.Locale))

routers/web/repo/setting.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,7 @@ func SettingsPost(ctx *context.Context) {
529529
AllowRebaseUpdate: form.PullsAllowRebaseUpdate,
530530
DefaultDeleteBranchAfterMerge: form.DefaultDeleteBranchAfterMerge,
531531
DefaultMergeStyle: repo_model.MergeStyle(form.PullsDefaultMergeStyle),
532+
DefaultAllowMaintainerEdit: form.DefaultAllowMaintainerEdit,
532533
},
533534
})
534535
} else if !unit_model.TypePullRequests.UnitGlobalDisabled() {

services/convert/repository.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ func innerToRepo(ctx context.Context, repo *repo_model.Repository, mode perm.Acc
8181
allowRebaseUpdate := false
8282
defaultDeleteBranchAfterMerge := false
8383
defaultMergeStyle := repo_model.MergeStyleMerge
84+
defaultAllowMaintainerEdit := false
8485
if unit, err := repo.GetUnit(ctx, unit_model.TypePullRequests); err == nil {
8586
config := unit.PullRequestsConfig()
8687
hasPullRequests = true
@@ -92,6 +93,7 @@ func innerToRepo(ctx context.Context, repo *repo_model.Repository, mode perm.Acc
9293
allowRebaseUpdate = config.AllowRebaseUpdate
9394
defaultDeleteBranchAfterMerge = config.DefaultDeleteBranchAfterMerge
9495
defaultMergeStyle = config.GetDefaultMergeStyle()
96+
defaultAllowMaintainerEdit = config.DefaultAllowMaintainerEdit
9597
}
9698
hasProjects := false
9799
if _, err := repo.GetUnit(ctx, unit_model.TypeProjects); err == nil {
@@ -182,6 +184,7 @@ func innerToRepo(ctx context.Context, repo *repo_model.Repository, mode perm.Acc
182184
AllowRebaseUpdate: allowRebaseUpdate,
183185
DefaultDeleteBranchAfterMerge: defaultDeleteBranchAfterMerge,
184186
DefaultMergeStyle: string(defaultMergeStyle),
187+
DefaultAllowMaintainerEdit: defaultAllowMaintainerEdit,
185188
AvatarURL: repo.AvatarLink(),
186189
Internal: !repo.IsPrivate && repo.Owner.Visibility == api.VisibleTypePrivate,
187190
MirrorInterval: mirrorInterval,

0 commit comments

Comments
 (0)