Add site_description config value

This changes what displays in the NodeInfo, and in the future might be
used for other things.
pull/44/head
Matt Baer 6 years ago
parent 573ce02739
commit cbf6ff54df
  1. 1
      admin.go
  2. 1
      config/config.go
  3. 5
      nodeinfo.go
  4. 4
      templates/user/admin.tmpl

@ -113,6 +113,7 @@ func handleAdminUpdateSite(app *app, u *User, w http.ResponseWriter, r *http.Req
func handleAdminUpdateConfig(app *app, u *User, w http.ResponseWriter, r *http.Request) error {
app.cfg.App.SiteName = r.FormValue("site_name")
app.cfg.App.SiteDesc = r.FormValue("site_desc")
app.cfg.App.OpenRegistration = r.FormValue("open_registration") == "on"
mul, err := strconv.Atoi(r.FormValue("min_username_len"))
if err == nil {

@ -31,6 +31,7 @@ type (
AppCfg struct {
SiteName string `ini:"site_name"`
SiteDesc string `ini:"site_description"`
Host string `ini:"host"`
// Site appearance

@ -14,7 +14,10 @@ type nodeInfoResolver struct {
func nodeInfoConfig(db *datastore, cfg *config.Config) *nodeinfo.Config {
name := cfg.App.SiteName
desc := "Minimal, federated blogging platform."
desc := cfg.App.SiteDesc
if desc == "" {
desc = "Minimal, federated blogging platform."
}
if cfg.App.SingleUser {
// Fetch blog information, instead
coll, err := db.GetCollectionByID(1)

@ -92,6 +92,10 @@ function savePage(el) {
<dl class="dl-horizontal admin-dl-horizontal">
<dt>Site Name</dt>
<dd><input type="text" name="site_name" id="site_name" class="inline" value="{{.Config.SiteName}}" style="width: 14em;" /></dd>
{{if not .SingleUser}}
<dt>Site Description</dt>
<dd><input type="text" name="site_desc" id="site_desc" class="inline" value="{{.Config.SiteDesc}}" style="width: 14em;" /></dd>
{{end}}
<dt>Host</dt>
<dd>{{.Config.Host}}</dd>
<dt>User Mode</dt>

Loading…
Cancel
Save