1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-29 08:56:23 -07:00

Make ban page template use standard page header template, use h1 as title element

This commit is contained in:
Eggbertx 2024-11-17 23:17:11 -08:00
parent 93ac36fd0f
commit 4595e16466
14 changed files with 83 additions and 63 deletions

View file

@ -4,12 +4,12 @@
@import 'global/lightbox';
@import 'global/qr';
@import "global/watcher";
@import 'global/bans';
header {
margin-top:50px;
text-align:center;
h1 {
font-size:30px;
margin: 0px;
}
}

View file

@ -0,0 +1,7 @@
.reason, .ban-boards, .ban-timestamp, .ban-title, .ban-ip {
font-weight: bold;
}
form#appeal-form * {
display: block;
}

View file

@ -26,8 +26,9 @@ div#top-pane {
text-align: center;
margin-top: 32px;
width:100%;
span#site-title {
#site-title {
font-size:50px;
margin-bottom: 0px;
}
}

View file

@ -37,6 +37,6 @@ header, div#top-pane, a {
color: $linkcol;
}
span#site-title, div#board-title {
#site-title, #board-title {
font-weight: 800;
}

View file

@ -15,7 +15,7 @@ body {
font: $font;
}
header h1, span#site-title {
header h1, #site-title {
color: $headercol;
}

View file

@ -249,8 +249,9 @@ div#top-pane {
margin-top: 32px;
width: 100%;
}
div#top-pane span#site-title {
div#top-pane #site-title {
font-size: 50px;
margin-bottom: 0px;
}
col#recent {
@ -558,12 +559,19 @@ table#qr-postbox textarea {
font-weight: bold;
}
.reason, .ban-boards, .ban-timestamp, .ban-title, .ban-ip {
font-weight: bold;
}
form#appeal-form * {
display: block;
}
header {
margin-top: 50px;
text-align: center;
}
header h1 {
font-size: 30px;
margin: 0px;
}

View file

@ -62,6 +62,6 @@ header, div#top-pane, a {
color: #f60;
}
span#site-title, div#board-title {
#-title, #board-title {
font-weight: 800;
}

View file

@ -102,7 +102,7 @@ body {
font: 12pt sans-serif;
}
header h1, span#site-title {
header h1, #site-title {
color: #e1b400;
}

View file

@ -13,10 +13,14 @@ import (
"github.com/gochan-org/gochan/pkg/gcutil"
)
const (
dateTimeFormat = "2006-01-02T15:04:05Z"
maxFilename = 10
)
var (
ErrInvalidKey = errors.New("template map expects string keys")
ErrInvalidMap = errors.New("invalid template map call")
maxFilename = 10
)
var funcMap = template.FuncMap{
@ -65,7 +69,10 @@ var funcMap = template.FuncMap{
return fmt.Sprintf("%0.2f GB", size/1024/1024/1024)
},
"formatTimestamp": func(t time.Time) string {
return t.Format(config.GetBoardConfig("").DateTimeFormat)
return t.UTC().Format(config.GetBoardConfig("").DateTimeFormat)
},
"formatTimestampAttribute": func(t time.Time) string {
return t.UTC().Format(dateTimeFormat)
},
"stringAppend": func(strings ...string) string {
var appended string

View file

@ -51,7 +51,7 @@ var (
templateMap = map[string]*gochanTemplate{
BanPage: {
files: []string{"banpage.html", "page_footer.html"},
files: []string{"banpage.html", "page_header.html", "topbar.html", "page_footer.html"},
},
BoardPage: {
files: []string{"boardpage.html", "topbar.html", "post_flag.html", "post.html", "page_header.html", "postbox.html", "page_footer.html"},

View file

@ -1,40 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<title>Banned</title>
<link rel="shortcut icon" href="{{webPath `favicon.png`}}">
<link rel="stylesheet" href="{{webPath `css/global.css`}}" />
<link id="theme" rel="stylesheet" href="{{webPath `css` .boardConfig.DefaultStyle}}" />
<script type="text/javascript" src="{{webPath `js/consts.js`}}"></script>
<script type="text/javascript" src="{{webPath `js/gochan.js`}}"></script>
</head>
<body>
<div id="top-pane">
<span id="site-title">{{.siteConfig.SiteName}}</span><br />
<span id="site-slogan">{{.siteConfig.SiteSlogan}}</span>
</div><br />
<div class="section-block" style="margin: 0px 26px 0px 24px">
<div class="section-title-block">
<span class="section-title"><b>{{if .ban.BannedForever}}YOUR'E PERMABANNED, IDIOT!{{else}}YOU ARE BANNED&nbsp;:({{end}}</b></span>
{{- template "page_header.html" map "global" . "pageTitle" $.siteConfig.SiteName "boardConfig" $.boardConfig "siteConfig" $.siteConfig "boards" $.boards "sections" $.sections}}
<div class="section-block" style="margin: 0px 26px 0px 24px">
<div class="section-title-block">
<span class="section-title"><span class="ban-title">{{if .ban.BannedForever}}YOUR'E PERMABANNED, IDIOT!{{else}}YOU ARE BANNED :({{end}}</span></span>
</div>
<div class="section-body" style="padding-top:8px">
<div id="ban-info" style="float:left">{{if .ban.IsGlobalBan}}
You are banned from posting on <span class="ban-boards">all boards</span> for the following reason:{{else}}
You are banned from posting on <span class="ban-boards">{{.board.Dir}}</span> for the following reason:{{end}}
<p class="reason">{{.ban.Message}}</p>
Your ban was placed on <time datetime="{{formatTimestampAttribute .ban.IssuedAt}}" class="ban-timestamp">{{formatTimestamp .ban.IssuedAt}}</time> and will
{{- if .ban.Permanent}} <span class="ban-timestamp">not expire</span>
{{- else}} expire on <time class="ban-timestamp" datetime="{{formatTimestampAttribute .ban.ExpiresAt}}">{{formatTimestamp .ban.ExpiresAt}}</time>
{{- end}}.<br />
Your IP address is <span class="ban-ip">{{.ip}}</span>.<br /><br />
{{if .ban.CanAppeal}}You may appeal this ban:<br />
<form id="appeal-form" action="{{webPath `/post`}}" method="POST">
<input type="hidden" name="board" value="{{.board.Dir}}">
<input type="hidden" name="banid" value="{{.ban.ID}}">
<textarea rows="4" cols="48" name="appealmsg" id="postmsg" placeholder="Appeal message"></textarea>
<input type="submit" name="doappeal" value="Submit" /><br />
</form>
{{- else}}You may <span class="ban-timestamp">not</span> appeal this ban.<br />{{end}}
</div>
<div class="section-body" style="padding-top:8px">
<div id="ban-info" style="float:left">{{if .ban.IsGlobalBan}}
You are banned from posting on <b>all boards</b> for the following reason:{{else}}
You are banned from posting on <b>{{.board.Dir}}</b> for the following reason:{{end}}
<br /><br />
<b>{{.ban.Message}}</b>
<br /><br />{{$expiresTimestamp := formatTimestamp .ban.ExpiresAt}}{{$appealTimestamp := formatTimestamp .ban.AppealAt}}
Your ban was placed on {{formatTimestamp .ban.IssuedAt}} and will {{if .ban.Permanent}}<b>not expire</b>{{else}}expire on&nbsp;<b>{{$expiresTimestamp}}</b>{{end}}.<br />
Your IP address is <b>{{.ip}}</b>.<br /><br />
{{if .ban.CanAppeal}}You may appeal this ban:<br />
<form id="appeal-form" action="{{webPath `/post`}}" method="POST">
<input type="hidden" name="board" value="{{.board.Dir}}">
<input type="hidden" name="banid" value="{{.ban.ID}}">
<textarea rows="4" cols="48" name="appealmsg" id="postmsg" placeholder="Appeal message"></textarea><br />
<input type="submit" name="doappeal" value="Submit" /><br />
</form>{{else}}You may&nbsp;<b>not</b> appeal this ban.<br />{{end}}
</div>{{if .ban.BannedForever}}
<img id="banpage-image" src="{{webPath "permabanned.jpg"}}" style="float:right; margin: 4px 8px 8px 4px"/><br />
{{- if .ban.BannedForever -}}
<img id="banpage-image" src="{{webPath `static/permabanned.jpg`}}" style="float:right; margin: 4px 8px 8px 4px"/><br />
<audio id="jack" preload="auto" autobuffer loop>
<source src="{{webPath `static/hittheroad.ogg`}}" />
<source src="{{webPath `static/hittheroad.wav`}}" />
@ -42,7 +31,8 @@
</audio>
<script type="text/javascript">
document.getElementById("jack").play();
</script>{{end}}
</div>
</div>
{{template "page_footer.html" .}}
</script>
{{- end -}}
</div>
</div>
{{template "page_footer.html" .}}

View file

@ -1,6 +1,6 @@
{{- template "page_header.html" .}}
<div id="top-pane">
<span id="site-title">{{.siteConfig.SiteName}}</span><br />
<h1 id="site-title">{{.siteConfig.SiteName}}</h1>
<span id="site-slogan">{{.siteConfig.SiteSlogan}}</span>
</div><br />
<div id="frontpage">

View file

@ -1,17 +1,23 @@
{{$title := ""}}
{{with .board}}
{{with $.op}}
{{$title = .TitleText}}
{{else}}
{{$title = print "/" $.board.Dir "/ - " $.board.Title}}
{{end}}
{{else}}
{{with $.pageTitle}}
{{$title = print $.pageTitle " - "}}
{{end}}
{{$title = print $title $.siteConfig.SiteName}}
{{end -}}
<!DOCTYPE html>
<html>
<head>
<head lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{{with .board -}}
{{with $.op -}}
<title>{{.TitleText}}</title>
{{- else}}
<title>/{{$.board.Dir}}/ - {{$.board.Title}}</title>
{{end}}
{{- else -}}
<title>{{with $.pageTitle}}{{$.pageTitle}} - {{end}}{{.siteConfig.SiteName}}</title>
{{- end}}
<title>{{$title}}</title>
<link rel="stylesheet" href="{{webPath "/css/global.css"}}" />
{{with .board -}}
<link id="theme" rel="stylesheet" href="{{webPath "/css/" (getBoardDefaultStyle $.board.Dir)}}" />

View file

@ -14,7 +14,8 @@
{{- end -}}
{{- if ne .post.Email ""}}</a>{{end}}</span>
{{- if ne .post.Tripcode ""}}<span class="tripcode">!{{.post.Tripcode}}</span>{{end -}}
{{- if ne .post.Country.Flag ""}}{{template "post_flag" .post.Country}}{{end}} {{formatTimestamp .post.Timestamp -}}
{{- if ne .post.Country.Flag ""}}{{template "post_flag" .post.Country}}{{end}}
<time datetime="{{formatTimestampAttribute .post.Timestamp}}">{{formatTimestamp .post.Timestamp}}</time>
</label> <a href="{{.post.WebPath}}">No.</a> <a href="javascript:quote({{.post.ID}})" class="backlink-click">{{.post.ID}}</a>
<span class="status-icons">
{{- if $.thread.Locked}}<img src="{{webPath `/static/lock.png`}}" class="locked-icon" alt="Thread locked" title="Thread locked">{{end -}}