aboutsummaryrefslogtreecommitdiffhomepage
path: root/ui/form/settings.go
diff options
context:
space:
mode:
Diffstat (limited to 'ui/form/settings.go')
-rw-r--r--ui/form/settings.go31
1 files changed, 17 insertions, 14 deletions
diff --git a/ui/form/settings.go b/ui/form/settings.go
index 0377f5f..8b4d7e6 100644
--- a/ui/form/settings.go
+++ b/ui/form/settings.go
@@ -13,13 +13,14 @@ import (
// SettingsForm represents the settings form.
type SettingsForm struct {
- Username string
- Password string
- Confirmation string
- Theme string
- Language string
- Timezone string
- EntryDirection string
+ Username string
+ Password string
+ Confirmation string
+ Theme string
+ Language string
+ Timezone string
+ EntryDirection string
+ KeyboardShortcuts bool
}
// Merge updates the fields of the given user.
@@ -29,6 +30,7 @@ func (s *SettingsForm) Merge(user *model.User) *model.User {
user.Language = s.Language
user.Timezone = s.Timezone
user.EntryDirection = s.EntryDirection
+ user.KeyboardShortcuts = s.KeyboardShortcuts
if s.Password != "" {
user.Password = s.Password
@@ -64,12 +66,13 @@ func (s *SettingsForm) Validate() error {
// NewSettingsForm returns a new SettingsForm.
func NewSettingsForm(r *http.Request) *SettingsForm {
return &SettingsForm{
- Username: r.FormValue("username"),
- Password: r.FormValue("password"),
- Confirmation: r.FormValue("confirmation"),
- Theme: r.FormValue("theme"),
- Language: r.FormValue("language"),
- Timezone: r.FormValue("timezone"),
- EntryDirection: r.FormValue("entry_direction"),
+ Username: r.FormValue("username"),
+ Password: r.FormValue("password"),
+ Confirmation: r.FormValue("confirmation"),
+ Theme: r.FormValue("theme"),
+ Language: r.FormValue("language"),
+ Timezone: r.FormValue("timezone"),
+ EntryDirection: r.FormValue("entry_direction"),
+ KeyboardShortcuts: r.FormValue("keyboard_shortcuts") == "1",
}
}