From 367317af6cafeb131dce204e71173106fbe096ac Mon Sep 17 00:00:00 2001 From: 0ko <0ko@noreply.codeberg.org> Date: Tue, 11 Jun 2024 05:54:35 +0000 Subject: [PATCH] Disable issue subscribe button for guest users (#4095) * disabled the button itself, but added the tooltip to the form, because it didn't work for the button and likely has something to do with JS * added an integration test to verify the new logic ## Preview |Signed in|Guest| |-|-| |![](/attachments/b1441565-6aec-4a72-a28f-6383914c8918)|![](/attachments/839cc58e-18cf-4a5d-a9d7-f0e3e2556c98)| Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4095 Reviewed-by: Mai-Lapyst --- options/locale/locale_en-US.ini | 7 ++- release-notes/8.0.0/4095.md | 1 + .../issue/view_content/sidebar/watching.tmpl | 11 ++++- tests/integration/issue_subscribe_test.go | 44 +++++++++++++++++++ 4 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 release-notes/8.0.0/4095.md create mode 100644 tests/integration/issue_subscribe_test.go diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 39f7886c54..74958f977e 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1211,10 +1211,13 @@ fork_from_self = You cannot fork a repository you own. fork_guest_user = Sign in to fork this repository. watch_guest_user = Sign in to watch this repository. star_guest_user = Sign in to star this repository. -unwatch = Unwatch +subscribe.issue.guest.tooltip = Sign in to subscribe to this issue. +subscribe.pull.guest.tooltip = Sign in to subscribe to this pull request. + watch = Watch -unstar = Unstar +unwatch = Unwatch star = Star +unstar = Unstar fork = Fork download_archive = Download repository more_operations = More operations diff --git a/release-notes/8.0.0/4095.md b/release-notes/8.0.0/4095.md new file mode 100644 index 0000000000..0f072b65c4 --- /dev/null +++ b/release-notes/8.0.0/4095.md @@ -0,0 +1 @@ +Disable Subscribe button for guest users. diff --git a/templates/repo/issue/view_content/sidebar/watching.tmpl b/templates/repo/issue/view_content/sidebar/watching.tmpl index 05936d090b..d3d75946b5 100644 --- a/templates/repo/issue/view_content/sidebar/watching.tmpl +++ b/templates/repo/issue/view_content/sidebar/watching.tmpl @@ -1,6 +1,13 @@ -
+ -