From 0606284fcfce8c98fe6f42c47c0ddf42e90ffdd1 Mon Sep 17 00:00:00 2001 From: Kemal Zebari <60799661+kemzeb@users.noreply.github.com> Date: Sun, 21 Apr 2024 14:32:12 -0700 Subject: [PATCH 01/20] Add --skip-db option to dump command (#30613) Attempts to resolve #28720. --- Note that I am not a Gitea administrator so I don't normally use the gitea CLI. Just saw this issue and wanted an opportunity to understand how this subcommand works and see if I can add this feature :^) I tested both with `--skip-db` and without and it appears to not add any database-specific files to the generated archive i.e. I don't see a `gitea-db.sql` or `gitea.db` file: ```console $ TAGS="bindata sqlite sqlite_unlock_notify" make backend Running go generate... bindata for migration already up-to-date bindata for options already up-to-date bindata for public already up-to-date bindata for templates already up-to-date $ ./gitea dump --skip-db 2024/04/20 01:16:11 ...s/setting/session.go:77:loadSessionFrom() [I] Session Service Enabled 2024/04/20 01:16:11 ...s/storage/storage.go:176:initAttachments() [I] Initialising Attachment storage with type: local 2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/attachments 2024/04/20 01:16:11 ...s/storage/storage.go:166:initAvatars() [I] Initialising Avatar storage with type: local 2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/avatars 2024/04/20 01:16:11 ...s/storage/storage.go:192:initRepoAvatars() [I] Initialising Repository Avatar storage with type: local 2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/repo-avatars 2024/04/20 01:16:11 ...s/storage/storage.go:186:initLFS() [I] Initialising LFS storage with type: local 2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/lfs 2024/04/20 01:16:11 ...s/storage/storage.go:198:initRepoArchives() [I] Initialising Repository Archive storage with type: local 2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/repo-archive 2024/04/20 01:16:11 ...s/storage/storage.go:208:initPackages() [I] Initialising Packages storage with type: local 2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/packages 2024/04/20 01:16:11 ...s/storage/storage.go:219:initActions() [I] Initialising Actions storage with type: local 2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/actions_log 2024/04/20 01:16:11 ...s/storage/storage.go:223:initActions() [I] Initialising ActionsArtifacts storage with type: local 2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/actions_artifacts 2024/04/20 01:16:11 cmd/dump.go:172:runDump() [I] Dumping local repositories... /workspaces/gitea/data/gitea-repositories 2024/04/20 01:16:11 cmd/dump.go:195:runDump() [I] Skipping database 2024/04/20 01:16:11 cmd/dump.go:229:runDump() [I] Adding custom configuration file from /workspaces/gitea/custom/conf/app.ini 2024/04/20 01:16:11 cmd/dump.go:256:runDump() [I] Packing data directory.../workspaces/gitea/data 2024/04/20 01:16:11 cmd/dump.go:335:runDump() [I] Finish dumping in file /workspaces/gitea/gitea-dump-1713575771.zip $ unzip /workspaces/gitea/gitea-dump-1713575771.zip -d example Archive: /workspaces/gitea/gitea-dump-1713575771.zip . . . $ ls example/ app.ini custom data repos $ ls example/data/ actions_artifacts actions_log avatars home indexers jwt queues repo-archive repo-avatars tmp ``` Co-authored-by: Giteabot --- cmd/dump.go | 62 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/cmd/dump.go b/cmd/dump.go index da0a51d9ce..ececc80f72 100644 --- a/cmd/dump.go +++ b/cmd/dump.go @@ -87,6 +87,10 @@ var CmdDump = &cli.Command{ Name: "skip-index", Usage: "Skip bleve index data", }, + &cli.BoolFlag{ + Name: "skip-db", + Usage: "Skip database", + }, &cli.StringFlag{ Name: "type", Usage: fmt.Sprintf(`Dump output format, default to "zip", supported types: %s`, strings.Join(dump.SupportedOutputTypes, ", ")), @@ -185,35 +189,41 @@ func runDump(ctx *cli.Context) error { } } - tmpDir := ctx.String("tempdir") - if _, err := os.Stat(tmpDir); os.IsNotExist(err) { - fatal("Path does not exist: %s", tmpDir) - } - - dbDump, err := os.CreateTemp(tmpDir, "gitea-db.sql") - if err != nil { - fatal("Failed to create tmp file: %v", err) - } - defer func() { - _ = dbDump.Close() - if err := util.Remove(dbDump.Name()); err != nil { - log.Warn("Unable to remove temporary file: %s: Error: %v", dbDump.Name(), err) - } - }() - - targetDBType := ctx.String("database") - if len(targetDBType) > 0 && targetDBType != setting.Database.Type.String() { - log.Info("Dumping database %s => %s...", setting.Database.Type, targetDBType) + if ctx.Bool("skip-db") { + // Ensure that we don't dump the database file that may reside in setting.AppDataPath or elsewhere. + dumper.GlobalExcludeAbsPath(setting.Database.Path) + log.Info("Skipping database") } else { - log.Info("Dumping database...") - } + tmpDir := ctx.String("tempdir") + if _, err := os.Stat(tmpDir); os.IsNotExist(err) { + fatal("Path does not exist: %s", tmpDir) + } - if err := db.DumpDatabase(dbDump.Name(), targetDBType); err != nil { - fatal("Failed to dump database: %v", err) - } + dbDump, err := os.CreateTemp(tmpDir, "gitea-db.sql") + if err != nil { + fatal("Failed to create tmp file: %v", err) + } + defer func() { + _ = dbDump.Close() + if err := util.Remove(dbDump.Name()); err != nil { + log.Warn("Unable to remove temporary file: %s: Error: %v", dbDump.Name(), err) + } + }() - if err = dumper.AddFile("gitea-db.sql", dbDump.Name()); err != nil { - fatal("Failed to include gitea-db.sql: %v", err) + targetDBType := ctx.String("database") + if len(targetDBType) > 0 && targetDBType != setting.Database.Type.String() { + log.Info("Dumping database %s => %s...", setting.Database.Type, targetDBType) + } else { + log.Info("Dumping database...") + } + + if err := db.DumpDatabase(dbDump.Name(), targetDBType); err != nil { + fatal("Failed to dump database: %v", err) + } + + if err = dumper.AddFile("gitea-db.sql", dbDump.Name()); err != nil { + fatal("Failed to include gitea-db.sql: %v", err) + } } log.Info("Adding custom configuration file from %s", setting.CustomConf) From 6459c50278906893f3cbc2bf3e52eff65e739b37 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Mon, 22 Apr 2024 06:19:59 +0800 Subject: [PATCH 02/20] fix(api): refactor branch and tag existence checks (#30618) - Update branch existence check to also include tag existence check - Adjust error message for branch/tag existence check ref: https://github.com/go-gitea/gitea/pull/30349 --------- Signed-off-by: appleboy Co-authored-by: wxiaoguang Co-authored-by: Giteabot --- routers/api/v1/repo/pull.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go index e43366ff14..dfe34f23d0 100644 --- a/routers/api/v1/repo/pull.go +++ b/routers/api/v1/repo/pull.go @@ -1082,11 +1082,10 @@ func parseCompareInfo(ctx *context.APIContext, form api.CreatePullRequestOption) } ctx.Repo.PullRequest.SameRepo = isSameRepo - log.Info("Base branch: %s", baseBranch) - log.Info("Repo path: %s", ctx.Repo.GitRepo.Path) + log.Trace("Repo path: %q, base branch: %q, head branch: %q", ctx.Repo.GitRepo.Path, baseBranch, headBranch) // Check if base branch is valid. - if !ctx.Repo.GitRepo.IsBranchExist(baseBranch) { - ctx.NotFound("IsBranchExist") + if !ctx.Repo.GitRepo.IsBranchExist(baseBranch) && !ctx.Repo.GitRepo.IsTagExist(baseBranch) { + ctx.NotFound("BaseNotExist") return nil, nil, nil, nil, "", "" } @@ -1149,7 +1148,7 @@ func parseCompareInfo(ctx *context.APIContext, form api.CreatePullRequestOption) } // Check if head branch is valid. - if !headGitRepo.IsBranchExist(headBranch) { + if !headGitRepo.IsBranchExist(headBranch) && !headGitRepo.IsTagExist(headBranch) { headGitRepo.Close() ctx.NotFound() return nil, nil, nil, nil, "", "" From 1e4867730b261352d63098b85cf53ca05867c8c2 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 22 Apr 2024 07:14:33 +0800 Subject: [PATCH 03/20] Fix dropdown text ellipsis (#30628) Follow https://github.com/go-gitea/gitea/pull/30547#discussion_r1573866519 Fix #30624 The Fomantic UI Dropdown wasn't designed to work that way, its "text" element might contain images. So the "overflow" shouldn't be added to any general dropdown text. ![image](https://github.com/go-gitea/gitea/assets/2114189/f6ceaabd-bc89-4bf2-baa2-a6f0324c1962) --- .../repo/issue/view_content/reference_issue_dialog.tmpl | 8 ++++---- web_src/css/base.css | 6 ------ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/templates/repo/issue/view_content/reference_issue_dialog.tmpl b/templates/repo/issue/view_content/reference_issue_dialog.tmpl index f6ac4192ab..c7a471f55e 100644 --- a/templates/repo/issue/view_content/reference_issue_dialog.tmpl +++ b/templates/repo/issue/view_content/reference_issue_dialog.tmpl @@ -2,13 +2,13 @@
{{ctx.Locale.Tr "repo.issues.context.reference_issue"}}
-
-
+
+ {{.CsrfTokenHtml}}
@@ -18,7 +18,7 @@
- +
diff --git a/web_src/css/base.css b/web_src/css/base.css index 0dae25506a..ef403cd2ad 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -391,12 +391,6 @@ a.label, color: var(--color-text-light-2); } -.ui.dropdown > .text { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} - /* extend fomantic style '.ui.dropdown > .text > img' to include svg.img */ .ui.dropdown > .text > .img { margin-left: 0; From f4a1cf7eab674e3c1589a7ecef015ff64e441946 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 22 Apr 2024 07:47:31 +0800 Subject: [PATCH 04/20] Fix repo home UI when there is no repo description (#30552) Fix #30502 by a new approach. ![image](https://github.com/go-gitea/gitea/assets/2114189/22f48bca-82d1-45cc-b1b7-ee2344b81a76) --- options/locale/locale_en-US.ini | 1 - templates/repo/home.tmpl | 25 ++++++++++++------------- tests/integration/repo_test.go | 32 +++----------------------------- web_src/css/repo.css | 14 ++------------ 4 files changed, 17 insertions(+), 55 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index c602aba53d..c7d99a85b1 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1193,7 +1193,6 @@ action.blocked_user = Cannot perform action because you are blocked by the repos download_archive = Download Repository more_operations = More Operations -no_desc = No Description quick_guide = Quick Guide clone_this_repo = Clone this repository cite_this_repo = Cite this repository diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index e18a0aec17..7b37ac1011 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -5,18 +5,10 @@ {{template "base/alert" .}} {{template "repo/code/recently_pushed_new_branches" .}} {{if and (not .HideRepoInfo) (not .IsBlame)}} -
-
- {{$description := .Repository.DescriptionHTML $.Context}} - {{if $description}}{{$description | RenderCodeBlock}}{{else if .IsRepositoryAdmin}}{{ctx.Locale.Tr "repo.no_desc"}}{{end}} - {{.Repository.Website}} -
- -
- - {{template "shared/search/button"}} -
- +
+ {{- $description := .Repository.DescriptionHTML ctx -}} + {{if $description}}{{$description | RenderCodeBlock}}{{end}} + {{if .Repository.Website}}{{.Repository.Website}}{{end}}
{{/* it should match the code in issue-home.js */}} @@ -54,7 +46,7 @@ {{$l := Eval $n "-" 1}} {{$isHomepage := (eq $n 0)}}
-
+
{{template "repo/branch_dropdown" dict "root" . "ContainerClasses" "tw-mr-1"}} {{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}} {{$cmpBranch := ""}} @@ -111,6 +103,13 @@ {{- end -}} {{end}} + +
+
+ + {{template "shared/search/button"}} +
+
diff --git a/tests/integration/repo_test.go b/tests/integration/repo_test.go index 06c55b1e8a..b967ccad1e 100644 --- a/tests/integration/repo_test.go +++ b/tests/integration/repo_test.go @@ -28,11 +28,9 @@ func TestViewRepo(t *testing.T) { resp := session.MakeRequest(t, req, http.StatusOK) htmlDoc := NewHTMLParser(t, resp.Body) - noDescription := htmlDoc.doc.Find("#repo-desc").Children() repoTopics := htmlDoc.doc.Find("#repo-topics").Children() repoSummary := htmlDoc.doc.Find(".repository-summary").Children() - assert.True(t, noDescription.HasClass("no-description")) assert.True(t, repoTopics.HasClass("repo-topic")) assert.True(t, repoSummary.HasClass("repository-menu")) @@ -177,30 +175,6 @@ func TestViewRepoWithSymlinks(t *testing.T) { assert.Equal(t, "link_link: svg octicon-file-symlink-file", items[4]) } -// TestViewAsRepoAdmin tests PR #2167 -func TestViewAsRepoAdmin(t *testing.T) { - for user, expectedNoDescription := range map[string]bool{ - "user2": true, - "user4": false, - } { - defer tests.PrepareTestEnv(t)() - - session := loginUser(t, user) - - req := NewRequest(t, "GET", "/user2/repo1.git") - resp := session.MakeRequest(t, req, http.StatusOK) - - htmlDoc := NewHTMLParser(t, resp.Body) - noDescription := htmlDoc.doc.Find("#repo-desc").Children() - repoTopics := htmlDoc.doc.Find("#repo-topics").Children() - repoSummary := htmlDoc.doc.Find(".repository-summary").Children() - - assert.Equal(t, expectedNoDescription, noDescription.HasClass("no-description")) - assert.True(t, repoTopics.HasClass("repo-topic")) - assert.True(t, repoSummary.HasClass("repository-menu")) - } -} - // TestViewFileInRepo repo description, topics and summary should not be displayed when viewing a file func TestViewFileInRepo(t *testing.T) { defer tests.PrepareTestEnv(t)() @@ -211,7 +185,7 @@ func TestViewFileInRepo(t *testing.T) { resp := session.MakeRequest(t, req, http.StatusOK) htmlDoc := NewHTMLParser(t, resp.Body) - description := htmlDoc.doc.Find("#repo-desc") + description := htmlDoc.doc.Find(".repo-description") repoTopics := htmlDoc.doc.Find("#repo-topics") repoSummary := htmlDoc.doc.Find(".repository-summary") @@ -230,7 +204,7 @@ func TestBlameFileInRepo(t *testing.T) { resp := session.MakeRequest(t, req, http.StatusOK) htmlDoc := NewHTMLParser(t, resp.Body) - description := htmlDoc.doc.Find("#repo-desc") + description := htmlDoc.doc.Find(".repo-description") repoTopics := htmlDoc.doc.Find("#repo-topics") repoSummary := htmlDoc.doc.Find(".repository-summary") @@ -249,7 +223,7 @@ func TestViewRepoDirectory(t *testing.T) { resp := session.MakeRequest(t, req, http.StatusOK) htmlDoc := NewHTMLParser(t, resp.Body) - description := htmlDoc.doc.Find("#repo-desc") + description := htmlDoc.doc.Find(".repo-description") repoTopics := htmlDoc.doc.Find("#repo-topics") repoSummary := htmlDoc.doc.Find(".repository-summary") diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 6884bc5b16..62a72abaf9 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -157,21 +157,11 @@ left: auto !important; } -.repository.file.list .repo-description { - display: flex; - justify-content: space-between; - align-items: center; - gap: 5px; +.repository .repo-description { + font-size: 16px; margin-bottom: 5px; } -@media (max-width: 767.98px) { - .repository.file.list .repo-description { - flex-direction: column; - align-items: stretch; - } -} - .commit-summary { flex: 1; overflow-wrap: anywhere; From 7cb88e9c18995f194a0db153bbe43c5c029eb23e Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 22 Apr 2024 08:13:44 +0800 Subject: [PATCH 05/20] Use correct hash for "git update-index" (#30626) --- services/repository/files/temp_repo.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/services/repository/files/temp_repo.go b/services/repository/files/temp_repo.go index 9fcd335c55..d70b1e8d54 100644 --- a/services/repository/files/temp_repo.go +++ b/services/repository/files/temp_repo.go @@ -136,14 +136,18 @@ func (t *TemporaryUploadRepository) LsFiles(filenames ...string) ([]string, erro // RemoveFilesFromIndex removes the given files from the index func (t *TemporaryUploadRepository) RemoveFilesFromIndex(filenames ...string) error { + objFmt, err := t.gitRepo.GetObjectFormat() + if err != nil { + return fmt.Errorf("unable to get object format for temporary repo: %q, error: %w", t.repo.FullName(), err) + } stdOut := new(bytes.Buffer) stdErr := new(bytes.Buffer) stdIn := new(bytes.Buffer) for _, file := range filenames { if file != "" { - stdIn.WriteString("0 0000000000000000000000000000000000000000\t") - stdIn.WriteString(file) - stdIn.WriteByte('\000') + // man git-update-index: input syntax (1): mode SP sha1 TAB path + // mode=0 means "remove from index", then hash part "does not matter as long as it is well formatted." + _, _ = fmt.Fprintf(stdIn, "0 %s\t%s\x00", objFmt.EmptyObjectID(), file) } } @@ -154,8 +158,7 @@ func (t *TemporaryUploadRepository) RemoveFilesFromIndex(filenames ...string) er Stdout: stdOut, Stderr: stdErr, }); err != nil { - log.Error("Unable to update-index for temporary repo: %s (%s) Error: %v\nstdout: %s\nstderr: %s", t.repo.FullName(), t.basePath, err, stdOut.String(), stdErr.String()) - return fmt.Errorf("Unable to update-index for temporary repo: %s Error: %w\nstdout: %s\nstderr: %s", t.repo.FullName(), err, stdOut.String(), stdErr.String()) + return fmt.Errorf("unable to update-index for temporary repo: %q, error: %w\nstdout: %s\nstderr: %s", t.repo.FullName(), err, stdOut.String(), stdErr.String()) } return nil } From 31386dc2bb94346b5a1039f009021a4e2f5eb166 Mon Sep 17 00:00:00 2001 From: GiteaBot Date: Mon, 22 Apr 2024 00:25:56 +0000 Subject: [PATCH 06/20] [skip ci] Updated licenses and gitignores --- options/license/HPND-UC-export-US | 10 ++++++++++ options/license/NCL | 32 +++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 options/license/HPND-UC-export-US create mode 100644 options/license/NCL diff --git a/options/license/HPND-UC-export-US b/options/license/HPND-UC-export-US new file mode 100644 index 0000000000..015556c5f9 --- /dev/null +++ b/options/license/HPND-UC-export-US @@ -0,0 +1,10 @@ +Copyright (C) 1985, 1990 Regents of the University of California. + +Permission to use, copy, modify, and distribute this +software and its documentation for any purpose and without +fee is hereby granted, provided that the above copyright +notice appear in all copies. The University of California +makes no representations about the suitability of this +software for any purpose. It is provided "as is" without +express or implied warranty. Export of this software outside +of the United States of America may require an export license. diff --git a/options/license/NCL b/options/license/NCL new file mode 100644 index 0000000000..3bfb658c26 --- /dev/null +++ b/options/license/NCL @@ -0,0 +1,32 @@ +Copyright (c) 2004 the University Corporation for Atmospheric +Research ("UCAR"). All rights reserved. Developed by NCAR's +Computational and Information Systems Laboratory, UCAR, +www.cisl.ucar.edu. + +Redistribution and use of the Software in source and binary forms, +with or without modification, is permitted provided that the +following conditions are met: + +- Neither the names of NCAR's Computational and Information Systems +Laboratory, the University Corporation for Atmospheric Research, +nor the names of its sponsors or contributors may be used to +endorse or promote products derived from this Software without +specific prior written permission. + +- Redistributions of source code must retain the above copyright +notices, this list of conditions, and the disclaimer below. + +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions, and the disclaimer below in the +documentation and/or other materials provided with the +distribution. + +THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. From 0386a42f70d1026c50697b12378f5026a63182b9 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 22 Apr 2024 12:48:14 +0200 Subject: [PATCH 07/20] Hide diff stats on empty PRs (#30629) When a PR is empty, e.g. has neither additions nor deletions, we don't need to show this: Screenshot 2024-04-21 at 23 25 38 --- templates/repo/pulls/tab_menu.tmpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/repo/pulls/tab_menu.tmpl b/templates/repo/pulls/tab_menu.tmpl index c0e48928f9..a6d058f160 100644 --- a/templates/repo/pulls/tab_menu.tmpl +++ b/templates/repo/pulls/tab_menu.tmpl @@ -15,12 +15,14 @@ {{ctx.Locale.Tr "repo.pulls.tab_files"}} {{if .NumFiles}}{{.NumFiles}}{{else}}-{{end}} + {{if or .Diff.TotalAddition .Diff.TotalDeletion}} {{if .Diff.TotalAddition}}+{{.Diff.TotalAddition}}{{end}} {{if .Diff.TotalDeletion}}-{{.Diff.TotalDeletion}}{{end}}
+ {{end}}
From aff7b7bdd285cc1fcabea774f153886e11ae9f5d Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 22 Apr 2024 13:21:06 +0200 Subject: [PATCH 08/20] Remove obsolete CSS text classes (#30576) - `.text-thin` and `.text-italic` are not present in CSS so were doing nothing and I removed them. - `.text.middle` was unused so I removed it. - `.text.italic` is replaced with `tw-italic`. - `.text.normal` had exactly one use and it wasn't even needed. - add a `muted` class to the link to `org_profile_avatar.tmpl`. --------- Co-authored-by: wxiaoguang --- templates/org/team/members.tmpl | 2 +- templates/org/team/repositories.tmpl | 2 +- templates/org/team/sidebar.tmpl | 2 +- templates/repo/create.tmpl | 6 +++--- templates/repo/file_info.tmpl | 2 +- templates/repo/settings/collaboration.tmpl | 4 ++-- templates/repo/settings/options.tmpl | 2 +- templates/shared/user/org_profile_avatar.tmpl | 2 +- web_src/css/base.css | 16 ---------------- 9 files changed, 11 insertions(+), 27 deletions(-) diff --git a/templates/org/team/members.tmpl b/templates/org/team/members.tmpl index 5719328a27..7e9a59a6bf 100644 --- a/templates/org/team/members.tmpl +++ b/templates/org/team/members.tmpl @@ -46,7 +46,7 @@
{{else}}
- {{ctx.Locale.Tr "org.teams.members.none"}} + {{ctx.Locale.Tr "org.teams.members.none"}}
{{end}}
diff --git a/templates/org/team/repositories.tmpl b/templates/org/team/repositories.tmpl index 98b4854eb8..f5d68ce416 100644 --- a/templates/org/team/repositories.tmpl +++ b/templates/org/team/repositories.tmpl @@ -48,7 +48,7 @@
{{else}}
- {{ctx.Locale.Tr "org.teams.repos.none"}} + {{ctx.Locale.Tr "org.teams.repos.none"}}
{{end}}
diff --git a/templates/org/team/sidebar.tmpl b/templates/org/team/sidebar.tmpl index b9e55dd587..ac41cda716 100644 --- a/templates/org/team/sidebar.tmpl +++ b/templates/org/team/sidebar.tmpl @@ -22,7 +22,7 @@ {{if .Team.Description}} {{.Team.Description}} {{else}} - {{ctx.Locale.Tr "org.teams.no_desc"}} + {{ctx.Locale.Tr "org.teams.no_desc"}} {{end}}
{{if eq .Team.LowerName "owners"}} diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl index bcd3c16b6a..c1c8c2185e 100644 --- a/templates/repo/create.tmpl +++ b/templates/repo/create.tmpl @@ -65,7 +65,7 @@
-