From 412633b669401ae2c802a16c43427dbdc7f4e63a Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 7 Jul 2024 21:31:12 -0700 Subject: [PATCH 1/5] Don't show hidden labels when filling out an issue template (#31576) Related to #31574 --- *Sponsored by Kithara Software GmbH* (cherry picked from commit d7c7a789947080be76d94f28f3f7f8788a545f7d) --- templates/repo/issue/fields/header.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/issue/fields/header.tmpl b/templates/repo/issue/fields/header.tmpl index 6034fed5fd..06c41af6b9 100644 --- a/templates/repo/issue/fields/header.tmpl +++ b/templates/repo/issue/fields/header.tmpl @@ -1,4 +1,4 @@ -{{if .item.Attributes.label}} +{{if and (.item.Attributes.label) (not .item.Attributes.hide_label)}}

{{.item.Attributes.label}}{{if .item.Validations.required}}{{end}}

{{end}} {{if .item.Attributes.description}} From 3794079610b4efa35248b942e7599894dd855491 Mon Sep 17 00:00:00 2001 From: delvh Date: Tue, 9 Jul 2024 20:05:12 +0200 Subject: [PATCH 2/5] Add `YEAR`, `MONTH`, `MONTH_ENGLISH`, `DAY` variables for template repos (#31584) Fixes #31583 (cherry picked from commit 7bb38358114ef7f55ee9f56838df74f1dda969aa) --- services/repository/generate.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/repository/generate.go b/services/repository/generate.go index 5cb1471842..8bd14ace8d 100644 --- a/services/repository/generate.go +++ b/services/repository/generate.go @@ -12,6 +12,7 @@ import ( "path" "path/filepath" "regexp" + "strconv" "strings" "time" @@ -54,7 +55,12 @@ var defaultTransformers = []transformer{ } func generateExpansion(src string, templateRepo, generateRepo *repo_model.Repository, sanitizeFileName bool) string { + year, month, day := time.Now().Date() expansions := []expansion{ + {Name: "YEAR", Value: strconv.Itoa(year), Transformers: nil}, + {Name: "MONTH", Value: fmt.Sprintf("%02d", int(month)), Transformers: nil}, + {Name: "MONTH_ENGLISH", Value: month.String(), Transformers: defaultTransformers}, + {Name: "DAY", Value: fmt.Sprintf("%02d", day), Transformers: nil}, {Name: "REPO_NAME", Value: generateRepo.Name, Transformers: defaultTransformers}, {Name: "TEMPLATE_NAME", Value: templateRepo.Name, Transformers: defaultTransformers}, {Name: "REPO_DESCRIPTION", Value: generateRepo.Description, Transformers: nil}, From 6fafd5c991fa845e90a69d2981d8d4a88904c513 Mon Sep 17 00:00:00 2001 From: Tobias Balle-Petersen Date: Wed, 10 Jul 2024 04:15:17 +0200 Subject: [PATCH 3/5] Fix: Allow org team names of length 255 in create team form (#31564) Gitea 1.22.1 was supposed to allow for team names of length 255 (up from 30) after the following PR was merged in: https://github.com/go-gitea/gitea/pull/31410. However, the length of team names was still limited to 30 as described in this issue: https://github.com/go-gitea/gitea/issues/31554. One more change to _gitea_ needs to be made to allow for the longer team names, as there is a 30 character limit here: https://github.com/go-gitea/gitea/blob/2c92c7c5226e29636a1d47a277130f477fa2037b/services/forms/org.go#L65 This PR changes that value to 255. (cherry picked from commit 4ea2a6de81ab6adde436d77e2743095fafa6a7a9) --- services/forms/org.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/forms/org.go b/services/forms/org.go index 3677fcf429..db182f7e96 100644 --- a/services/forms/org.go +++ b/services/forms/org.go @@ -62,7 +62,7 @@ func (f *UpdateOrgSettingForm) Validate(req *http.Request, errs binding.Errors) // CreateTeamForm form for creating team type CreateTeamForm struct { - TeamName string `binding:"Required;AlphaDashDot;MaxSize(30)"` + TeamName string `binding:"Required;AlphaDashDot;MaxSize(255)"` Description string `binding:"MaxSize(255)"` Permission string RepoAccess string From c773ca37ad31d4d728f360426924d859f1588387 Mon Sep 17 00:00:00 2001 From: Sunny Wan <94445569+SunnyWan59@users.noreply.github.com> Date: Thu, 11 Jul 2024 19:23:31 -0400 Subject: [PATCH 4/5] Display app name in the registration email title (#31562) I changed the title of the registation email from "Welcome to Gitea" to "Welcome to (appname)". I did this by substituting 'Gitea' in register_notify to %s and formating the registration title in mail.go. I changed this for all the languages I could, but I struggled to changed the translation file for Farsi. I have attached the screenshots of before and after and the related issue below. Related issue: https://github.com/go-gitea/gitea/issues/31108 Before change: ![Screenshot from 2024-07-04 22-32-17](https://github.com/go-gitea/gitea/assets/94445569/4178b51c-1acc-45f4-9750-dff41564a709) After: ![Screenshot from 2024-07-04 22-32-01](https://github.com/go-gitea/gitea/assets/94445569/9cd7a58d-c0f5-4a3c-a66c-805c55411eaa) --------- Signed-off-by: Sunny Wan Co-authored-by: 6543 <6543@obermui.de> (cherry picked from commit 4913edaa70a48f7c5a524f680ca921ed515d6ec2) Conflicts: - options/locale/locale_en-US.ini Applied the change manually. Confliced because we don't have `register_notify.title`. - services/mailer/mail.go Adapted the change to Forgejo. We don't have `u.EmailTo` due to not picking gitea#31527 (yet). --- options/locale/locale_en-US.ini | 2 +- services/mailer/mail.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 2a19b1c0fe..6cc7646471 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -492,7 +492,7 @@ admin.new_user.subject = New user %s just signed up admin.new_user.user_info = User information admin.new_user.text = Please click here to manage this user from the admin panel. -register_notify = Welcome to Forgejo +register_notify = Welcome to %s register_notify.text_1 = this is your registration confirmation email for %s! register_notify.text_2 = You can sign into your account using your username: %s register_notify.text_3 = If someone else made this account for you, you will need to set your password first. diff --git a/services/mailer/mail.go b/services/mailer/mail.go index d86607295a..5eb8efe128 100644 --- a/services/mailer/mail.go +++ b/services/mailer/mail.go @@ -158,7 +158,7 @@ func SendRegisterNotifyMail(u *user_model.User) { return } - msg := NewMessage(u.Email, locale.TrString("mail.register_notify"), content.String()) + msg := NewMessage(u.Email, locale.TrString("mail.register_notify", setting.AppName), content.String()) msg.Info = fmt.Sprintf("UID: %d, registration notify", u.ID) SendAsync(msg) From c440c5b3d9984ec0b03a77b98222bfc03144d495 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Fri, 12 Jul 2024 09:25:54 -0700 Subject: [PATCH 5/5] Fix update flake (#31626) (cherry picked from commit 957c75bfd21b7ff15c37eae5c8cd86bae974ac5d) --- flake.lock | 6 +++--- flake.nix | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 606f8836c1..9eadad2b94 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1717974879, - "narHash": "sha256-GTO3C88+5DX171F/gVS3Qga/hOs/eRMxPFpiHq2t+D8=", + "lastModified": 1720542800, + "narHash": "sha256-ZgnNHuKV6h2+fQ5LuqnUaqZey1Lqqt5dTUAiAnqH0QQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c7b821ba2e1e635ba5a76d299af62821cbcb09f3", + "rev": "feb2849fdeb70028c70d73b848214b00d324a497", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 22354663dd..e2f273e341 100644 --- a/flake.nix +++ b/flake.nix @@ -31,6 +31,7 @@ # backend go_1_22 gofumpt + sqlite ]; }; }