mirror of
https://github.com/rystaf/mlmym.git
synced 2024-11-22 13:47:42 +00:00
add tagline support
This commit is contained in:
parent
797d40f9c1
commit
d918604d75
5
state.go
5
state.go
|
@ -8,6 +8,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"math/rand"
|
||||||
"mime/multipart"
|
"mime/multipart"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
@ -95,6 +96,7 @@ type State struct {
|
||||||
XHR bool
|
XHR bool
|
||||||
Op string
|
Op string
|
||||||
Site *lemmy.GetSiteResponse
|
Site *lemmy.GetSiteResponse
|
||||||
|
Tagline string
|
||||||
Query string
|
Query string
|
||||||
Content string
|
Content string
|
||||||
SearchType string
|
SearchType string
|
||||||
|
@ -279,6 +281,9 @@ func (state *State) GetSite() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
state.Site = resp
|
state.Site = resp
|
||||||
|
if len(state.Site.Taglines) > 0 {
|
||||||
|
state.Tagline = state.Site.Taglines[rand.Intn(len(state.Site.Taglines))].Content
|
||||||
|
}
|
||||||
if !state.Site.MyUser.IsValid() {
|
if !state.Site.MyUser.IsValid() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,9 @@
|
||||||
{{ template "nsfw.html" }}
|
{{ template "nsfw.html" }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<main>
|
<main>
|
||||||
|
{{ if and (not .Community) .Tagline }}
|
||||||
|
<h3>{{ markdown .Host .Tagline }}</h3>
|
||||||
|
{{ end }}
|
||||||
{{ template "menu.html" . }}
|
{{ template "menu.html" . }}
|
||||||
|
|
||||||
{{ if .Error }}
|
{{ if .Error }}
|
||||||
|
|
Loading…
Reference in a new issue