Browse Source

Add site_description config value

This changes what displays in the NodeInfo, and in the future might be
used for other things.
tags/v0.5.0
Matt Baer 5 years ago
parent
commit
cbf6ff54df
4 changed files with 10 additions and 1 deletions
  1. +1
    -0
      admin.go
  2. +1
    -0
      config/config.go
  3. +4
    -1
      nodeinfo.go
  4. +4
    -0
      templates/user/admin.tmpl

+ 1
- 0
admin.go View File

@@ -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 {


+ 1
- 0
config/config.go View File

@@ -31,6 +31,7 @@ type (

AppCfg struct {
SiteName string `ini:"site_name"`
SiteDesc string `ini:"site_description"`
Host string `ini:"host"`

// Site appearance


+ 4
- 1
nodeinfo.go View File

@@ -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)


+ 4
- 0
templates/user/admin.tmpl View File

@@ -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