Toggle Gravatar support at the system settings.

This commit is contained in:
takezoe
2013-07-25 03:00:46 +09:00
parent 34e2663492
commit b61836adf7
5 changed files with 84 additions and 50 deletions

View File

@@ -12,10 +12,14 @@ class SystemSettingsController extends SystemSettingsControllerBase
trait SystemSettingsControllerBase extends ControllerBase with FlashMapSupport {
self: SystemSettingsService with AccountService with AdminAuthenticator =>
private case class SystemSettingsForm(allowAccountRegistration: Boolean)
private case class SystemSettingsForm(
allowAccountRegistration: Boolean,
gravatar: Boolean
)
private val form = mapping(
"allowAccountRegistration" -> trim(label("Account registration", boolean()))
"allowAccountRegistration" -> trim(label("Account registration", boolean())),
"gravatar" -> trim(label("Gravatar", boolean()))
)(SystemSettingsForm.apply)
@@ -24,7 +28,10 @@ trait SystemSettingsControllerBase extends ControllerBase with FlashMapSupport {
})
post("/admin/system", form)(adminOnly { form =>
saveSystemSettings(SystemSettings(form.allowAccountRegistration))
saveSystemSettings(SystemSettings(
form.allowAccountRegistration,
form.gravatar
))
flash += "info" -> "System settings has been updated."
redirect("/admin/system")
})