Split out repository unit settings

This splits out the repository unit settings (formerly "Advanced
settings" under the repository settings page) into their own, separate
page.

The primary reason for this is that the settings page became long and
complicated, with a structure that not always made sense. A secondary
reason is that toggling units on and off should not necessarily be an
"advanced" setting. We want to make doing that easier, and having the
units on their own page helps with that.

This is basically a refactor, there is no new functionality introduced,
just an extra pair of routes for the new page, and the supporting code.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
This commit is contained in:
Gergely Nagy 2024-01-23 10:46:34 +01:00
parent a4ca473d33
commit fa73375e13
No known key found for this signature in database
11 changed files with 586 additions and 510 deletions

View file

@ -1037,6 +1037,8 @@ func registerRoutes(m *web.Route) {
m.Combo("").Get(repo_setting.Settings).
Post(web.Bind(forms.RepoSettingForm{}), repo_setting.SettingsPost)
}, repo_setting.SettingsCtxData)
m.Combo("/units").Get(repo_setting.Units).
Post(web.Bind(forms.RepoUnitSettingForm{}), repo_setting.UnitsPost)
m.Post("/avatar", web.Bind(forms.AvatarForm{}), repo_setting.SettingsAvatar)
m.Post("/avatar/delete", repo_setting.SettingsDeleteAvatar)