{% import "fmt" %} {% import "time" %} {% import "strconv" %} {% import "github.com/bakape/meguca/auth" %} {% import "github.com/bakape/meguca/config" %} {% import "github.com/bakape/meguca/lang" %} {% import "github.com/bakape/meguca/common" %} {% import "github.com/bakape/mnemonics" %} // Header of a standalone HTML page {% func htmlHeader() %}{% stripspace %}
{% endstripspace %}{% endfunc %} // End of a standalone HTML page {% func htmlEnd() %}{% stripspace %} {% endstripspace %}{% endfunc %} BanPage renders a ban page for a banned user {% func BanPage(rec auth.BanRecord) %}{% stripspace %} {%= htmlHeader() %} {% code ln := lang.Get().Templates["banPage"] %} {% if len(ln) < 3 %} {% code panic(fmt.Errorf("invalid ban format strings: %v", ln)) %} {% endif %} {% if rec.By == "system" && rec.Reason == "brum brum" %}{% switch l.Type %} {% case common.BanPost %} {%s ln.UI["ban"] %} {% case common.ShadowBinPost %} {%s ln.UI["shadowBin"] %} {% case common.UnbanPost %} {%s ln.UI["unban"] %} {% case common.DeletePost %} {%s ln.UI["deletePost"] %} {% case common.DeleteImage %} {%s ln.UI["deleteImage"] %} {% case common.SpoilerImage %} {%s ln.UI["spoilerImage"] %} {% case common.LockThread %} {%s ln.Common.UI["lockThread"] %} {% case common.DeleteBoard %} {%s ln.Common.UI["deleteBoard"] %} {% case common.MeidoVision %} {%s ln.Common.UI["meidoVisionPost"] %} {% case common.PurgePost %} {%s ln.UI["purgePost"] %} {% case common.RedirectIP %} {%s ln.UI["redirectIP"] %} {% case common.RedirectThread %} {%s ln.UI["redirectThread"] %} {% endswitch %} | {%s l.By %} | {% if l.ID != 0 %} {%= staticPostLink(l.ID) %} {% endif %} | {%s l.Created.Format(time.UnixDate) %} | {%s l.Data %} | {% if l.Length != 0 %} {%s (time.Second * time.Duration(l.Length)).String() %} {% endif %} |