From 871082bc7b757bf9e1b5e2e389e7cd2f897608e5 Mon Sep 17 00:00:00 2001 From: Gabriel Vasile Date: Tue, 9 Aug 2022 12:41:52 +0300 Subject: [PATCH 01/10] Remove manual rollback for failed generated repositories (#20639) Generating repositories from a template is done inside a transaction. Manual rollback on error is not needed and it always results in error "repository does not exist". Co-authored-by: wxiaoguang --- services/repository/template.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/services/repository/template.go b/services/repository/template.go index 3f2291ad6378..b73abdce587f 100644 --- a/services/repository/template.go +++ b/services/repository/template.go @@ -7,12 +7,10 @@ package repository import ( "context" - "code.gitea.io/gitea/models" "code.gitea.io/gitea/models/db" issues_model "code.gitea.io/gitea/models/issues" repo_model "code.gitea.io/gitea/models/repo" user_model "code.gitea.io/gitea/models/user" - "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/notification" repo_module "code.gitea.io/gitea/modules/repository" ) @@ -100,11 +98,6 @@ func GenerateRepository(doer, owner *user_model.User, templateRepo *repo_model.R return nil }); err != nil { - if generateRepo != nil && generateRepo.ID > 0 { - if errDelete := models.DeleteRepository(doer, owner.ID, generateRepo.ID); errDelete != nil { - log.Error("Rollback deleteRepository: %v", errDelete) - } - } return nil, err } From 33b03e851f1a99f8d7fb682fec4bcba4f20ff6a8 Mon Sep 17 00:00:00 2001 From: silverwind Date: Tue, 9 Aug 2022 12:32:41 +0200 Subject: [PATCH 02/10] Restore history button and hide add button when unable to add (#20718) Fix two regressions from #20602: - Restore the 'History' button that was previously unable to render because it's show condition was never hit - Hide the 'Add File' button when there would be no items in the dropdown. Co-authored-by: wxiaoguang --- templates/repo/home.tmpl | 56 +++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 1ff2ec5bc501..d7ce2240a090 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -73,34 +73,31 @@ {{end}} {{svg "octicon-file-moved" 15}} - + + {{svg "octicon-triangle-down" 14 "dropdown icon"}} + + {{end}} {{else}} {{EllipsisString .Repository.Name 30}}{{range $i, $v := .TreeNames}}/{{if eq $i $l}}{{EllipsisString $v 30}}{{else}}{{ $p := index $.Paths $i}}{{EllipsisString $v 30}}{{end}}{{end}} {{end}} @@ -133,6 +130,11 @@ {{end}} {{end}} + {{if and (ne $n 0) (not .IsViewFile) (not .IsBlame) }} + + {{svg "octicon-history" 16 "mr-3"}}{{.locale.Tr "repo.file_history"}} + + {{end}} {{if .IsViewFile}} From 36f9ee5813beba0fc4b394a5db636f76afc5cc38 Mon Sep 17 00:00:00 2001 From: CodeDoctor <20452814+CodeDoctorDE@users.noreply.github.com> Date: Tue, 9 Aug 2022 13:30:09 +0200 Subject: [PATCH 03/10] Add an option to create new issues from "/issues" page (#20650) --- routers/web/user/home.go | 6 ++++++ templates/user/dashboard/issues.tmpl | 3 +++ 2 files changed, 9 insertions(+) diff --git a/routers/web/user/home.go b/routers/web/user/home.go index 648269980472..f338c525b4d3 100644 --- a/routers/web/user/home.go +++ b/routers/web/user/home.go @@ -618,6 +618,12 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) { shownIssues += int(issueCountByRepo[repoID]) } } + if len(repoIDs) == 1 { + repo := showReposMap[repoIDs[0]] + if repo != nil { + ctx.Data["SingleRepoLink"] = repo.Link() + } + } ctx.Data["IsShowClosed"] = isShowClosed diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl index b2f4863d6c92..b6dc002154b6 100644 --- a/templates/user/dashboard/issues.tmpl +++ b/templates/user/dashboard/issues.tmpl @@ -99,6 +99,9 @@ {{.locale.Tr "repo.issues.filter_sort.farduedate"}} + {{if .SingleRepoLink}} + {{.locale.Tr "repo.issues.new"}} + {{end}} {{template "shared/issuelist" mergeinto . "listType" "dashboard"}} From 1b2cd4c4e19c78390be329b4a3ad50ff8857ca8d Mon Sep 17 00:00:00 2001 From: silverwind Date: Tue, 9 Aug 2022 14:37:34 +0200 Subject: [PATCH 04/10] Replace fomantic popup module with tippy.js (#20428) - replace fomantic popup module with tippy.js - fix chaining and add comment - add 100ms delay to tooltips - stopwatch improvments, raise default maxWidth - update web_src/js/features/common-global.js - use type=submit instead of js --- templates/admin/user/edit.tmpl | 2 +- templates/base/head_navbar.tmpl | 6 +- templates/repo/commit_statuses.tmpl | 2 +- templates/repo/diff/stats.tmpl | 2 +- templates/repo/header.tmpl | 2 +- .../repo/issue/view_content/add_reaction.tmpl | 2 +- templates/repo/settings/deploy_keys.tmpl | 2 +- templates/repo/settings/webhook/history.tmpl | 2 +- templates/repo/view_file.tmpl | 22 +- templates/user/settings/applications.tmpl | 2 +- templates/user/settings/keys_principal.tmpl | 2 +- templates/user/settings/keys_ssh.tmpl | 2 +- web_src/fomantic/build/semantic.css | 421 ----- web_src/fomantic/build/semantic.js | 1542 ----------------- web_src/fomantic/semantic.json | 1 - web_src/js/components/DashboardRepoList.js | 5 +- web_src/js/features/clipboard.js | 37 +- web_src/js/features/common-global.js | 31 +- web_src/js/features/comp/ReactionSelector.js | 12 +- web_src/js/features/repo-code.js | 50 +- web_src/js/features/repo-commit.js | 15 +- web_src/js/features/repo-diff.js | 4 +- web_src/js/features/repo-issue.js | 13 +- web_src/js/features/stopwatch.js | 21 +- web_src/js/index.js | 4 +- web_src/js/modules/tippy.js | 48 +- web_src/less/_base.less | 39 +- web_src/less/modules/tippy.less | 37 +- 28 files changed, 199 insertions(+), 2129 deletions(-) diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl index 17cbef9f108a..dd2646b50a17 100644 --- a/templates/admin/user/edit.tmpl +++ b/templates/admin/user/edit.tmpl @@ -117,7 +117,7 @@
-
+
diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index 8dc0083b76e3..5521a28a124e 100644 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -86,10 +86,10 @@ {{.locale.Tr "active_stopwatch"}} -