Archived
1
0

more sfw fixes

This commit is contained in:
Jeff 2018-08-05 10:02:30 +10:00
parent c34bed4d85
commit eeac199b1e
2 changed files with 15 additions and 2 deletions

View File

@ -639,7 +639,7 @@ type thread struct {
_i18n *I18N
allowFiles bool
prefix string
links []LinkModel
links []linkModel
Posts []PostModel
SFW bool
dirty bool
@ -685,6 +685,11 @@ func (self *thread) Navbar() string {
param := make(map[string]interface{})
param["name"] = fmt.Sprintf("Thread %s", self.Posts[0].ShortHash())
param["frontend"] = self.Board()
for idx := range self.links {
self.links[idx].link += "?sfw=1"
}
param["links"] = self.links
param["prefix"] = self.prefix
return template.renderTemplate("navbar", param, self._i18n)
@ -725,7 +730,7 @@ func createThreadModel(posts ...PostModel) ThreadModel {
dirty: true,
prefix: prefix,
Posts: posts,
links: []LinkModel{
links: []linkModel{
linkModel{
text: group,
link: fmt.Sprintf("%sb/%s/", prefix, group),

View File

@ -25,7 +25,11 @@
<meta property="og:type" content="website"/>
<meta property="og:title" content="{{board.Board}}"/>
<meta property="og:description" content="thread no. {{thread.OP.PostHash}} on changolia"/>
{{sfw}}
<meta property="og:url" content="{{prefix}}t/{{thread.OP.PostHash}}/?lang={{i18n.Name}}&sfw=1"/>
{{#sfw}}
<meta property="og:url" content="{{prefix}}t/{{thread.OP.PostHash}}/?lang={{i18n.Name}}"/>
{{/sfw}}
<meta property="og:image"
content="{{prefix}}static/changolia-logo.png"/>
</head>
@ -33,7 +37,11 @@
{{{thread.Navbar}}}
<hr />
<div class="sitetitle">
{{sfw}}
<h2><a href="{{thread.Prefix}}?lang={{i18n.Name}}&sfw=1">CHANGOLIA</a></h2>
{{#sfw}}
<h2><a href="{{thread.Prefix}}?lang={{i18n.Name}}">CHANGOLIA</a></h2>
{{/sfw}}
<b>Most of the rest of the wild west.</b>
</div>
<center><b><a href="{{thread.BoardURL}}">{{thread.Board}}</a></b></center>