diff --git a/account.go b/account.go index ae8e21c..3adb7f7 100644 --- a/account.go +++ b/account.go @@ -840,7 +840,7 @@ func viewEditCollection(app *App, u *User, w http.ResponseWriter, r *http.Reques } // Add collection properties - c.Monetization = app.db.GetCollectionAttribute(c.ID, "monetization_pointer") + c.MonetizationPointer = app.db.GetCollectionAttribute(c.ID, "monetization_pointer") silenced, err := app.db.IsUserSilenced(u.ID) if err != nil { diff --git a/admin.go b/admin.go index 457b384..a0d10eb 100644 --- a/admin.go +++ b/admin.go @@ -529,6 +529,7 @@ func handleAdminUpdateConfig(apper Apper, u *User, w http.ResponseWriter, r *htt } apper.App().cfg.App.Federation = r.FormValue("federation") == "on" apper.App().cfg.App.PublicStats = r.FormValue("public_stats") == "on" + apper.App().cfg.App.Monetization = r.FormValue("monetization") == "on" apper.App().cfg.App.Private = r.FormValue("private") == "on" apper.App().cfg.App.LocalTimeline = r.FormValue("local_timeline") == "on" if apper.App().cfg.App.LocalTimeline && apper.App().timeline == nil { diff --git a/collections.go b/collections.go index ad9cd87..f2958fd 100644 --- a/collections.go +++ b/collections.go @@ -56,7 +56,7 @@ type ( PublicOwner bool `datastore:"public_owner" json:"-"` URL string `json:"url,omitempty"` - Monetization string `json:"monetization_pointer,omitempty"` + MonetizationPointer string `json:"monetization_pointer,omitempty"` db *datastore hostName string diff --git a/config/config.go b/config/config.go index 9ff13f8..39e461b 100644 --- a/config/config.go +++ b/config/config.go @@ -1,5 +1,5 @@ /* - * Copyright © 2018-2019 A Bunch Tell LLC. + * Copyright © 2018-2020 A Bunch Tell LLC. * * This file is part of WriteFreely. * @@ -136,9 +136,11 @@ type ( MinUsernameLen int `ini:"min_username_len"` MaxBlogs int `ini:"max_blogs"` + // Options for public instances // Federation - Federation bool `ini:"federation"` - PublicStats bool `ini:"public_stats"` + Federation bool `ini:"federation"` + PublicStats bool `ini:"public_stats"` + Monetization bool `ini:"monetization"` // Access Private bool `ini:"private"` diff --git a/templates/user/admin/app-settings.tmpl b/templates/user/admin/app-settings.tmpl index 4bd87da..9142dcc 100644 --- a/templates/user/admin/app-settings.tmpl +++ b/templates/user/admin/app-settings.tmpl @@ -136,6 +136,13 @@ select {
+
+
+
+
+ {{if .Monetization}}

Web Monetization

Web Monetization enables you to receive micropayments from readers that have a Coil membership. Add your payment pointer to enable Web Monetization on your blog.

- +
+ {{end}}