mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 13:35:50 +01:00
Display the message after settings updating is completed.
This commit is contained in:
@@ -4,11 +4,12 @@ import service.{AccountService, SystemSettingsService}
|
||||
import SystemSettingsService._
|
||||
import util.AdminAuthenticator
|
||||
import jp.sf.amateras.scalatra.forms._
|
||||
import org.scalatra.FlashMapSupport
|
||||
|
||||
class SystemSettingsController extends SystemSettingsControllerBase
|
||||
with SystemSettingsService with AccountService with AdminAuthenticator
|
||||
|
||||
trait SystemSettingsControllerBase extends ControllerBase {
|
||||
trait SystemSettingsControllerBase extends ControllerBase with FlashMapSupport {
|
||||
self: SystemSettingsService with AccountService with AdminAuthenticator =>
|
||||
|
||||
private case class SystemSettingsForm(allowAccountRegistration: Boolean)
|
||||
@@ -19,11 +20,12 @@ trait SystemSettingsControllerBase extends ControllerBase {
|
||||
|
||||
|
||||
get("/admin/system")(adminOnly {
|
||||
admin.html.system(loadSystemSettings())
|
||||
admin.html.system(loadSystemSettings(), flash.get("info"))
|
||||
})
|
||||
|
||||
post("/admin/system", form)(adminOnly { form =>
|
||||
saveSystemSettings(SystemSettings(form.allowAccountRegistration))
|
||||
flash += "info" -> "Settings updated."
|
||||
redirect("/admin/system")
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user