From 7735da1c66c5a1511a2eac04b2a7f5c60b214c83 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 3 Jul 2023 11:32:21 +0800 Subject: [PATCH 01/22] Display branch commit status (#25608) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #10388 This PR adds a status icon for every branch which has a status check for the latest commit on branch list page. 图片 --- models/git/commit_status.go | 47 +++++++++++++++++++++++++++++++++ routers/web/repo/branch.go | 18 +++++++++++++ templates/repo/branch/list.tmpl | 2 ++ 3 files changed, 67 insertions(+) diff --git a/models/git/commit_status.go b/models/git/commit_status.go index 49143a87e83f..c418cd23eb63 100644 --- a/models/git/commit_status.go +++ b/models/git/commit_status.go @@ -346,6 +346,53 @@ func GetLatestCommitStatusForPairs(ctx context.Context, repoIDsToLatestCommitSHA return repoStatuses, nil } +// GetLatestCommitStatusForRepoCommitIDs returns all statuses with a unique context for a given list of repo-sha pairs +func GetLatestCommitStatusForRepoCommitIDs(ctx context.Context, repoID int64, commitIDs []string) (map[string][]*CommitStatus, error) { + type result struct { + ID int64 + Sha string + } + + results := make([]result, 0, len(commitIDs)) + + sess := db.GetEngine(ctx).Table(&CommitStatus{}) + + // Create a disjunction of conditions for each repoID and SHA pair + conds := make([]builder.Cond, 0, len(commitIDs)) + for _, sha := range commitIDs { + conds = append(conds, builder.Eq{"sha": sha}) + } + sess = sess.Where(builder.Eq{"repo_id": repoID}.And(builder.Or(conds...))). + Select("max( id ) as id, sha"). + GroupBy("context_hash, sha").OrderBy("max( id ) desc") + + err := sess.Find(&results) + if err != nil { + return nil, err + } + + ids := make([]int64, 0, len(results)) + repoStatuses := make(map[string][]*CommitStatus) + for _, result := range results { + ids = append(ids, result.ID) + } + + statuses := make([]*CommitStatus, 0, len(ids)) + if len(ids) > 0 { + err = db.GetEngine(ctx).In("id", ids).Find(&statuses) + if err != nil { + return nil, err + } + + // Group the statuses by repo ID + for _, status := range statuses { + repoStatuses[status.SHA] = append(repoStatuses[status.SHA], status) + } + } + + return repoStatuses, nil +} + // FindRepoRecentCommitStatusContexts returns repository's recent commit status contexts func FindRepoRecentCommitStatusContexts(ctx context.Context, repoID int64, before time.Duration) ([]string, error) { start := timeutil.TimeStampNow().AddDuration(-before) diff --git a/routers/web/repo/branch.go b/routers/web/repo/branch.go index f0282a71b876..8e3383848f7d 100644 --- a/routers/web/repo/branch.go +++ b/routers/web/repo/branch.go @@ -57,7 +57,25 @@ func Branches(ctx *context.Context) { return } + commitIDs := []string{defaultBranch.DBBranch.CommitID} + for _, branch := range branches { + commitIDs = append(commitIDs, branch.DBBranch.CommitID) + } + + commitStatuses, err := git_model.GetLatestCommitStatusForRepoCommitIDs(ctx, ctx.Repo.Repository.ID, commitIDs) + if err != nil { + ctx.ServerError("LoadBranches", err) + return + } + + commitStatus := make(map[string]*git_model.CommitStatus) + for commitID, cs := range commitStatuses { + commitStatus[commitID] = git_model.CalcCommitStatus(cs) + } + ctx.Data["Branches"] = branches + ctx.Data["CommitStatus"] = commitStatus + ctx.Data["CommitStatuses"] = commitStatuses ctx.Data["DefaultBranchBranch"] = defaultBranch pager := context.NewPagination(int(branchesCount), pageSize, page, 5) pager.SetDefaultParams(ctx) diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index b03c8aa56687..298d85438146 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -25,6 +25,7 @@
{{.DefaultBranchBranch.DBBranch.Name}} + {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DefaultBranchBranch.DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DefaultBranchBranch.DBBranch.CommitID)}}

{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage .RepoLink .Repository.ComposeMetas}} · {{.locale.Tr "org.repo_updated"}} {{TimeSince .DefaultBranchBranch.DBBranch.CommitTime.AsTime .locale}}{{if .DefaultBranchBranch.DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "Context" $.Context "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}

@@ -91,6 +92,7 @@
{{.DBBranch.Name}} + {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DBBranch.CommitID)}}

{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DBBranch.CommitMessage $.RepoLink $.Repository.ComposeMetas}} · {{$.locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime $.locale}}{{if .DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "Context" $.Context "user" .DBBranch.Pusher}}  {{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}

{{end}} From 2aa6a785cf9b066fb0a297b1bdc3fb431fa25667 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 3 Jul 2023 12:11:32 +0800 Subject: [PATCH 02/22] Make FindBranches have stable result (#25631) See the comment --- models/git/branch_list.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/models/git/branch_list.go b/models/git/branch_list.go index 836d4ffc4177..131a149782e2 100644 --- a/models/git/branch_list.go +++ b/models/git/branch_list.go @@ -64,11 +64,6 @@ func (branches BranchList) LoadPusher(ctx context.Context) error { return nil } -const ( - BranchOrderByNameAsc = "name ASC" - BranchOrderByCommitTimeDesc = "commit_time DESC" -) - type FindBranchOptions struct { db.ListOptions RepoID int64 @@ -102,7 +97,8 @@ func orderByBranches(sess *xorm.Session, opts FindBranchOptions) *xorm.Session { } if opts.OrderBy == "" { - opts.OrderBy = BranchOrderByCommitTimeDesc + // the commit_time might be the same, so add the "name" to make sure the order is stable + opts.OrderBy = "commit_time DESC, name ASC" } return sess.OrderBy(opts.OrderBy) } From 45bc180a15d1edf3a20f25c4bb428819b94e6ad9 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 3 Jul 2023 14:04:50 +0800 Subject: [PATCH 03/22] Make "cancel" buttons have proper type in modal forms (#25618) Replace #25446, fix #25438 All "cancel" buttons which do not have "type" should not submit the form, should not be triggered by "Enter". This is a complete fix for all modal dialogs. The major change is "modules/aria/modal.js", "devtest" related code is for demo/test purpose. --- routers/web/devtest/devtest.go | 12 +++++++++++- templates/devtest/fomantic-modal.tmpl | 13 +++++++++++++ web_src/js/modules/aria/modal.js | 26 ++++++++++++++++++++++++++ web_src/js/modules/fomantic.js | 2 ++ 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 web_src/js/modules/aria/modal.js diff --git a/routers/web/devtest/devtest.go b/routers/web/devtest/devtest.go index 64b732c03567..525ca9be53c6 100644 --- a/routers/web/devtest/devtest.go +++ b/routers/web/devtest/devtest.go @@ -34,7 +34,7 @@ func List(ctx *context.Context) { func FetchActionTest(ctx *context.Context) { _ = ctx.Req.ParseForm() - ctx.Flash.Info(ctx.Req.Method + " " + ctx.Req.RequestURI + "
" + + ctx.Flash.Info("fetch-action: " + ctx.Req.Method + " " + ctx.Req.RequestURI + "
" + "Form: " + ctx.Req.Form.Encode() + "
" + "PostForm: " + ctx.Req.PostForm.Encode(), ) @@ -52,5 +52,15 @@ func Tmpl(ctx *context.Context) { ctx.Data["TimePast1y"] = now.Add(-1 * 366 * 86400 * time.Second) ctx.Data["TimeFuture1y"] = now.Add(1 * 366 * 86400 * time.Second) + if ctx.Req.Method == "POST" { + _ = ctx.Req.ParseForm() + ctx.Flash.Info("form: "+ctx.Req.Method+" "+ctx.Req.RequestURI+"
"+ + "Form: "+ctx.Req.Form.Encode()+"
"+ + "PostForm: "+ctx.Req.PostForm.Encode(), + true, + ) + time.Sleep(2 * time.Second) + } + ctx.HTML(http.StatusOK, base.TplName("devtest"+path.Clean("/"+ctx.Params("sub")))) } diff --git a/templates/devtest/fomantic-modal.tmpl b/templates/devtest/fomantic-modal.tmpl index aaa4c2c12d1a..799bab7594e2 100644 --- a/templates/devtest/fomantic-modal.tmpl +++ b/templates/devtest/fomantic-modal.tmpl @@ -1,5 +1,18 @@ {{template "base/head" .}}
+ {{template "base/alert" .}} + + + + +
+ -
- - - -
+
{{RenderEmoji $.Context .Title | RenderCodeBlock}} {{if .IsPull}} @@ -24,7 +24,7 @@ {{end}}
-
+
{{if eq $.listType "dashboard"}} {{.Repo.FullName}}#{{.Index}} diff --git a/web_src/css/base.css b/web_src/css/base.css index ca400f270ba5..542fb1fd7460 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -1633,6 +1633,7 @@ i.icon.centerlock { .ui.label { padding: 0.3em 0.5em; + transition: none; } .ui.label, diff --git a/web_src/css/shared/issuelist.css b/web_src/css/shared/issuelist.css index b20fd1a80e1b..7f9e49831a74 100644 --- a/web_src/css/shared/issuelist.css +++ b/web_src/css/shared/issuelist.css @@ -17,15 +17,24 @@ } .issue.list > .item .issue-item-main { - width: 100%; + flex: 1; + display: flex; + flex-direction: column; } -.issue.list > .item .action-item-main { - width: 80%; +.issue.list > .item .action-item-center { + display: flex; + align-items: center; + padding-left: 4px; + padding-right: 12px; } -.issue.list > .item .issue-item-right { - width: 15%; +.issue.list > .item .action-item-right { + flex: 0 0 15%; + display: flex; + flex-direction: column; + gap: 3px; + color: var(--color-text-light); } .issue.list > .item .issue-item-top-row { @@ -52,6 +61,10 @@ .issue.list > .item .issue-item-bottom-row { font-size: 13px; + display: flex; + align-items: center; + flex-wrap: wrap; + margin: .125rem 0; } .issue.list > .item .title { diff --git a/web_src/js/components/RepoActionView.vue b/web_src/js/components/RepoActionView.vue index c247967161c3..f244720fe044 100644 --- a/web_src/js/components/RepoActionView.vue +++ b/web_src/js/components/RepoActionView.vue @@ -20,12 +20,12 @@
@@ -507,7 +507,6 @@ export function initRepositoryActionView() { .action-view-header { margin-top: 8px; - margin-bottom: 4px; } .action-info-summary { @@ -522,14 +521,14 @@ export function initRepositoryActionView() { .action-info-summary-title-text { font-size: 20px; - margin: 0 0 0 5px; + margin: 0 0 0 8px; flex: 1; } .action-commit-summary { display: flex; gap: 5px; - margin: 5px 0 0 25px; + margin: 0 0 0 28px; } .action-view-left, .action-view-right { From ff140d40507d7cf607de712d84849db244db6054 Mon Sep 17 00:00:00 2001 From: Zettat123 Date: Tue, 4 Jul 2023 18:26:24 +0800 Subject: [PATCH 15/22] Fix the nil pointer when assigning issues to projects (#25665) Fixes #25649 Caused by #25468 --- routers/web/org/projects.go | 8 +++++--- routers/web/repo/projects.go | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/routers/web/org/projects.go b/routers/web/org/projects.go index e525f2c43f3a..c568b1c07164 100644 --- a/routers/web/org/projects.go +++ b/routers/web/org/projects.go @@ -436,9 +436,11 @@ func UpdateIssueProject(ctx *context.Context) { projectID := ctx.FormInt64("id") for _, issue := range issues { - oldProjectID := issue.Project.ID - if oldProjectID == projectID { - continue + if issue.Project != nil { + oldProjectID := issue.Project.ID + if oldProjectID == projectID { + continue + } } if err := issues_model.ChangeProjectAssign(issue, ctx.Doer, projectID); err != nil { diff --git a/routers/web/repo/projects.go b/routers/web/repo/projects.go index 6da9edfd0b80..b1033fe0030e 100644 --- a/routers/web/repo/projects.go +++ b/routers/web/repo/projects.go @@ -385,9 +385,11 @@ func UpdateIssueProject(ctx *context.Context) { projectID := ctx.FormInt64("id") for _, issue := range issues { - oldProjectID := issue.Project.ID - if oldProjectID == projectID { - continue + if issue.Project != nil { + oldProjectID := issue.Project.ID + if oldProjectID == projectID { + continue + } } if err := issues_model.ChangeProjectAssign(issue, ctx.Doer, projectID); err != nil { From 43c9a84ae56d33048cb66497d79ca0bed739d115 Mon Sep 17 00:00:00 2001 From: Earl Warren <109468362+earl-warren@users.noreply.github.com> Date: Tue, 4 Jul 2023 14:43:38 +0200 Subject: [PATCH 16/22] Add unit test for `HashAvatar` (#25662) - Add 100% unit test for this function. --------- Co-authored-by: Gusted --- modules/avatar/hash_test.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 modules/avatar/hash_test.go diff --git a/modules/avatar/hash_test.go b/modules/avatar/hash_test.go new file mode 100644 index 000000000000..1b8249c696c3 --- /dev/null +++ b/modules/avatar/hash_test.go @@ -0,0 +1,26 @@ +// Copyright 2023 The Gitea Authors. All rights reserved. +// SPDX-License-Identifier: MIT + +package avatar_test + +import ( + "bytes" + "image" + "image/png" + "testing" + + "code.gitea.io/gitea/modules/avatar" + + "github.com/stretchr/testify/assert" +) + +func Test_HashAvatar(t *testing.T) { + myImage := image.NewRGBA(image.Rect(0, 0, 32, 32)) + var buff bytes.Buffer + png.Encode(&buff, myImage) + + assert.EqualValues(t, "9ddb5bac41d57e72aa876321d0c09d71090c05f94bc625303801be2f3240d2cb", avatar.HashAvatar(1, buff.Bytes())) + assert.EqualValues(t, "9a5d44e5d637b9582a976676e8f3de1dccd877c2fe3e66ca3fab1629f2f47609", avatar.HashAvatar(8, buff.Bytes())) + assert.EqualValues(t, "ed7399158672088770de6f5211ce15528ebd675e92fc4fc060c025f4b2794ccb", avatar.HashAvatar(1024, buff.Bytes())) + assert.EqualValues(t, "161178642c7d59eb25a61dddced5e6b66eae1c70880d5f148b1b497b767e72d9", avatar.HashAvatar(1024, []byte{})) +} From f4c1f43644eb4a30d185518c1732b24aa821e39d Mon Sep 17 00:00:00 2001 From: delvh Date: Tue, 4 Jul 2023 16:43:02 +0200 Subject: [PATCH 17/22] Prevent duplicate image loading (#25675) Regression of #25672. --- web_src/js/features/imagediff.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web_src/js/features/imagediff.js b/web_src/js/features/imagediff.js index a26b927c33de..2e7baab79ff9 100644 --- a/web_src/js/features/imagediff.js +++ b/web_src/js/features/imagediff.js @@ -65,8 +65,9 @@ export function initImageDiff() { }; } - $('.image-diff').each(function() { + $('.image-diff:not([data-image-diff-loaded])').each(function() { const $container = $(this); + $container.attr('data-image-diff-loaded', 'true'); // the container may be hidden by "viewed" checkbox, so use the parent's width for reference const diffContainerWidth = Math.max($container.closest('.diff-file-box').width() - 300, 100); From 934124c641438667d0bbe4c2272b27b424097d82 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 4 Jul 2023 17:52:33 +0200 Subject: [PATCH 18/22] some less naked returns (#25682) fix upcoming lint issues --- models/perm/access/repo_permission.go | 40 ++++++++++++++------------- models/repo/release.go | 2 +- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/models/perm/access/repo_permission.go b/models/perm/access/repo_permission.go index 64df5355bba6..2027b87ecb43 100644 --- a/models/perm/access/repo_permission.go +++ b/models/perm/access/repo_permission.go @@ -127,7 +127,8 @@ func (p *Permission) LogString() string { } // GetUserRepoPermission returns the user permissions to the repository -func GetUserRepoPermission(ctx context.Context, repo *repo_model.Repository, user *user_model.User) (perm Permission, err error) { +func GetUserRepoPermission(ctx context.Context, repo *repo_model.Repository, user *user_model.User) (Permission, error) { + var perm Permission if log.IsTrace() { defer func() { if user == nil { @@ -147,30 +148,31 @@ func GetUserRepoPermission(ctx context.Context, repo *repo_model.Repository, use // TODO: anonymous user visit public unit of private repo??? if user == nil && repo.IsPrivate { perm.AccessMode = perm_model.AccessModeNone - return + return perm, nil } - var is bool + var isCollaborator bool + var err error if user != nil { - is, err = repo_model.IsCollaborator(ctx, repo.ID, user.ID) + isCollaborator, err = repo_model.IsCollaborator(ctx, repo.ID, user.ID) if err != nil { return perm, err } } - if err = repo.LoadOwner(ctx); err != nil { - return + if err := repo.LoadOwner(ctx); err != nil { + return perm, err } // Prevent strangers from checking out public repo of private organization/users // Allow user if they are collaborator of a repo within a private user or a private organization but not a member of the organization itself - if !organization.HasOrgOrUserVisible(ctx, repo.Owner, user) && !is { + if !organization.HasOrgOrUserVisible(ctx, repo.Owner, user) && !isCollaborator { perm.AccessMode = perm_model.AccessModeNone - return + return perm, nil } - if err = repo.LoadUnits(ctx); err != nil { - return + if err := repo.LoadUnits(ctx); err != nil { + return perm, err } perm.Units = repo.Units @@ -178,32 +180,32 @@ func GetUserRepoPermission(ctx context.Context, repo *repo_model.Repository, use // anonymous visit public repo if user == nil { perm.AccessMode = perm_model.AccessModeRead - return + return perm, nil } // Admin or the owner has super access to the repository if user.IsAdmin || user.ID == repo.OwnerID { perm.AccessMode = perm_model.AccessModeOwner - return + return perm, nil } // plain user perm.AccessMode, err = accessLevel(ctx, user, repo) if err != nil { - return + return perm, err } - if err = repo.LoadOwner(ctx); err != nil { - return + if err := repo.LoadOwner(ctx); err != nil { + return perm, err } if !repo.Owner.IsOrganization() { - return + return perm, nil } perm.UnitsMode = make(map[unit.Type]perm_model.AccessMode) // Collaborators on organization - if is { + if isCollaborator { for _, u := range repo.Units { perm.UnitsMode[u.Type] = perm.AccessMode } @@ -212,7 +214,7 @@ func GetUserRepoPermission(ctx context.Context, repo *repo_model.Repository, use // get units mode from teams teams, err := organization.GetUserRepoTeams(ctx, repo.OwnerID, user.ID, repo.ID) if err != nil { - return + return perm, err } // if user in an owner team @@ -220,7 +222,7 @@ func GetUserRepoPermission(ctx context.Context, repo *repo_model.Repository, use if team.AccessMode >= perm_model.AccessModeAdmin { perm.AccessMode = perm_model.AccessModeOwner perm.UnitsMode = nil - return + return perm, nil } } diff --git a/models/repo/release.go b/models/repo/release.go index b77490584f90..246642205a28 100644 --- a/models/repo/release.go +++ b/models/repo/release.go @@ -339,7 +339,7 @@ func (s releaseMetaSearch) Less(i, j int) bool { // GetReleaseAttachments retrieves the attachments for releases func GetReleaseAttachments(ctx context.Context, rels ...*Release) (err error) { if len(rels) == 0 { - return + return nil } // To keep this efficient as possible sort all releases by id, From f35ea2b09a0553ac7644eccdf8a96dd6f90c2982 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 5 Jul 2023 00:22:37 +0800 Subject: [PATCH 19/22] Add elapsed time on debug for slow git commands (#25642) To record which command is slow, this PR adds a debug log for slow git operations. --------- Co-authored-by: Lauris BH Co-authored-by: delvh --- modules/git/command.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/git/command.go b/modules/git/command.go index ac013d4ea1c7..c38fd0469667 100644 --- a/modules/git/command.go +++ b/modules/git/command.go @@ -301,6 +301,8 @@ func (c *Command) Run(opts *RunOpts) error { } defer finished() + startTime := time.Now() + cmd := exec.CommandContext(ctx, c.prog, c.args...) if opts.Env == nil { cmd.Env = os.Environ() @@ -327,7 +329,13 @@ func (c *Command) Run(opts *RunOpts) error { } } - if err := cmd.Wait(); err != nil && ctx.Err() != context.DeadlineExceeded { + err := cmd.Wait() + elapsed := time.Since(startTime) + if elapsed > time.Second { + log.Debug("slow git.Command.Run: %s (%s)", c, elapsed) + } + + if err != nil && ctx.Err() != context.DeadlineExceeded { return err } From 00dbba7f4266032a2b91b760e7c611950ffad096 Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Tue, 4 Jul 2023 19:45:45 +0200 Subject: [PATCH 20/22] Several fixes for mobile UI (#25634) Resolves #25622
Screenshots ![Bildschirmfoto vom 2023-07-02 20-47-34](https://github.com/go-gitea/gitea/assets/47871822/a8a0bff6-9ae3-48f3-b008-00c196a3f8fd) ![Bildschirmfoto vom 2023-07-02 20-47-45](https://github.com/go-gitea/gitea/assets/47871822/172a0021-af74-4690-aa67-0e66688ce733) ![Bildschirmfoto vom 2023-07-02 20-48-37](https://github.com/go-gitea/gitea/assets/47871822/14572ebd-0106-4c8a-ba27-b6b631375ee6) ![Bildschirmfoto vom 2023-07-02 20-49-08](https://github.com/go-gitea/gitea/assets/47871822/7c0ba3aa-1712-482c-aae9-13394dbdaf8a) ![Bildschirmfoto vom 2023-07-02 20-50-28](https://github.com/go-gitea/gitea/assets/47871822/8bd68e26-099a-4abd-8817-16d52af13167) ![Bildschirmfoto vom 2023-07-02 20-51-46](https://github.com/go-gitea/gitea/assets/47871822/3beab8c6-3747-4829-be50-bafaed11000c) ![Bildschirmfoto vom 2023-07-02 20-54-12](https://github.com/go-gitea/gitea/assets/47871822/51f82ef3-a32c-4c27-9056-e8711ed469cc)
--------- Co-authored-by: wxiaoguang Co-authored-by: silverwind --- templates/repo/branch/list.tmpl | 2 +- templates/repo/commits_list.tmpl | 2 +- templates/repo/commits_table.tmpl | 14 ++--- .../issue/labels/labels_selector_field.tmpl | 2 +- templates/repo/issue/new_form.tmpl | 12 ++-- .../repo/issue/view_content/sidebar.tmpl | 6 +- templates/shared/combomarkdowneditor.tmpl | 2 +- web_src/css/admin.css | 4 ++ web_src/css/editor/combomarkdowneditor.css | 2 + web_src/css/repo.css | 56 ++++++++++++++----- web_src/js/components/RepoActionView.vue | 8 +-- 11 files changed, 71 insertions(+), 39 deletions(-) diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index 298d85438146..d7ea299fd126 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -29,7 +29,7 @@

{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage .RepoLink .Repository.ComposeMetas}} · {{.locale.Tr "org.repo_updated"}} {{TimeSince .DefaultBranchBranch.DBBranch.CommitTime.AsTime .locale}}{{if .DefaultBranchBranch.DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "Context" $.Context "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}

- + {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}}