Merge branch 'forgejo' into feat/actions-logs-api

This commit is contained in:
zachhandley 2026-05-27 22:35:52 +02:00
commit 2400c168b2
6 changed files with 21 additions and 1 deletions

View file

@ -761,6 +761,7 @@ func createUser(ctx context.Context, u *User, createdByAdmin bool, overwriteDefa
u.Theme = setting.UI.DefaultTheme
u.IsRestricted = setting.Service.DefaultUserIsRestricted
u.IsActive = !setting.Service.RegisterEmailConfirm && !setting.Service.RegisterManualConfirm
u.EnableRepoUnitHints = true
// Ensure consistency of the dates.
if u.UpdatedUnix < u.CreatedUnix {

View file

@ -129,6 +129,7 @@
"search.fuzzy_tooltip": "Include results is an approximate match to the search term",
"repo.settings.push_mirror.branch_filter.label": "Branch filter (optional)",
"repo.settings.push_mirror.branch_filter.description": "Branches to be mirrored. Leave blank to mirror all branches. See <a href=\"%[1]s\">%[2]s documentation</a> for syntax. Examples: <code>main, release/*</code>",
"repo.settings.units.more_units_disable_hint": "The \"Enable more\" hint can be disabled in <a href=\"%s\">User settings > Appearance</a>.",
"incorrect_root_url": "This Forgejo instance is configured to be served on \"%s\". You are currently viewing Forgejo through a different URL, which may cause parts of the application to break. The canonical URL is controlled by Forgejo admins via the ROOT_URL setting in the app.ini.",
"themes.names.forgejo-auto": "Forgejo (follow system theme)",
"themes.names.forgejo-light": "Forgejo light",

View file

@ -1,6 +1,12 @@
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings options")}}
<div class="user-main-content twelve wide column">
<form class="ui form" method="post" action="{{.RepoLink}}/settings/units">
{{if and .SignedUser.EnableRepoUnitHints (not (.Repository.AllUnitsEnabled ctx))}}
{{$settingsURL := print AppSubUrl "/user/settings/appearance#hints"}}
<div class="ui attached segment">
<p>{{ctx.Locale.Tr "repo.settings.units.more_units_disable_hint" $settingsURL}}</p>
</div>
{{end}}
{{template "repo/settings/units/overview" .}}
{{template "repo/settings/units/issues" .}}
{{if not .IsMirror}}

View file

@ -71,7 +71,7 @@
</div>
<!-- Hints -->
<h4 class="ui top attached header">
<h4 id="hints" class="ui top attached header">
{{ctx.Locale.Tr "settings.hints"}}
</h4>
<div class="ui attached segment">

View file

@ -36,6 +36,10 @@ func TestSignup(t *testing.T) {
// should be able to view new user's page
req = NewRequest(t, "GET", "/exampleUser")
MakeRequest(t, req, http.StatusOK)
// check default values
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{Name: "exampleUser"})
assert.True(t, user.EnableRepoUnitHints)
}
func TestSignupAsRestricted(t *testing.T) {

View file

@ -502,11 +502,19 @@ func TestUserHints(t *testing.T) {
assertAddMore := func(t *testing.T, present bool) {
t.Helper()
// check if the tab is present
req := NewRequest(t, "GET", repo.Link())
resp := session.MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)
htmlDoc.AssertElement(t, fmt.Sprintf("a[href='%s/settings/units']", repo.Link()), present)
// check if the user settings hint is present
req = NewRequest(t, "GET", repo.Link()+"/settings/units")
resp = session.MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body)
htmlDoc.AssertElement(t, ".user-main-content a[href='/user/settings/appearance#hints']", present)
}
t.Run("hints enabled", func(t *testing.T) {