mirror of
https://github.com/rystaf/mlmym.git
synced 2024-11-22 05:36:16 +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"
|
||||
"fmt"
|
||||
"io"
|
||||
"math/rand"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
@ -95,6 +96,7 @@ type State struct {
|
|||
XHR bool
|
||||
Op string
|
||||
Site *lemmy.GetSiteResponse
|
||||
Tagline string
|
||||
Query string
|
||||
Content string
|
||||
SearchType string
|
||||
|
@ -279,6 +281,9 @@ func (state *State) GetSite() {
|
|||
return
|
||||
}
|
||||
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() {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
{{ template "nsfw.html" }}
|
||||
{{ else }}
|
||||
<main>
|
||||
{{ if and (not .Community) .Tagline }}
|
||||
<h3>{{ markdown .Host .Tagline }}</h3>
|
||||
{{ end }}
|
||||
{{ template "menu.html" . }}
|
||||
|
||||
{{ if .Error }}
|
||||
|
|
Loading…
Reference in a new issue