Web forum: a grey theme in the manner of Ikonboard

ikon: a Perl board of 2001, after Ikonboard 2's default look: a narrow
centered page, grey tables with one-pixel cell lines, a title box with
its menu row, a Welcome box, a brushed-metal logo beside a folder tree
of where you are, dark red links, "» Category" rows, Date/Time/by last
posts, grey bevelled buttons, folder badges and gem topic icons, posts
with their author on the left, small icon links above and Total Posts,
Joined, Posted on beneath.  Its own CSS and templates; no code or
images taken from Ikonboard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
This commit is contained in:
Claude committed 2026-10-12 23:57:09 +00:00
1 parent 26409ef5b0
commit 4c86b112a7
14 files changed
+498 -21

No files matched your search

+1 -1
View File
@@ -84,7 +84,7 @@ What there is:
elsewhere by telnet or RLogin, and the door networks BBSLink and DoorParty
- [chat](https://github.com/Neo-Desktop/bbs-sec/wiki/Chat-and-Paging): rooms, messages to a node, paging the sysop
- [finger and gopher](https://github.com/Neo-Desktop/bbs-sec/wiki/Finger-and-Gopher): who is on, and chosen areas in gopherspace
- [a web forum](https://github.com/Neo-Desktop/bbs-sec/wiki/Web-Forum): the message areas as a bulletin board in the browser, in the manner of Invision Power Board 3, or of IPB 2 or 1 (themes)
- [a web forum](https://github.com/Neo-Desktop/bbs-sec/wiki/Web-Forum): the message areas as a bulletin board in the browser, in the manner of Invision Power Board 3, or of IPB 2 or 1, or Ikonboard (themes)
- [a web terminal](https://github.com/Neo-Desktop/bbs-sec/wiki/HTTP-API#the-web-terminal): the BBS in a browser (xterm.js, built in)
- [an HTTP API](https://github.com/Neo-Desktop/bbs-sec/wiki/HTTP-API): REST, server-sent events, and WebSockets (JSON or protobuf) where web clients chat with terminal callers; Prometheus metrics
- [customization](https://github.com/Neo-Desktop/bbs-sec/wiki/Customization): ANSI art and 3270 screens, menus of the sysop's, @-codes, the prompts' words
+1 -1
View File
@@ -213,7 +213,7 @@ address = 127.0.0.1:2513
;forum_guests = yes
; the forum's theme until a caller chooses (at the foot of each page):
; ipb3 (in the manner of Invision Power Board 3), ipb2 (classic, as IPB 2)
; or ipb1 (retro, as IPB 1)
; ipb1 (retro, as IPB 1) or ikon (grey, as Ikonboard 2)
;forum_theme = ipb3
; Access levels: a user's level (0-255) gets what the [level] at or
+1 -1
View File
@@ -26,7 +26,7 @@ key_file = /etc/bbs/tls/key.pem
| `rate`, `burst` | `10`, `20` | requests a second per token (per address without one), and how many may come at once |
| `session_hours` | `24` | how long a login's token lasts |
| `terminal` | `yes` | the web terminal page (below) |
| `forum`, `forum_guests`, `forum_theme` | `yes`, `yes`, `ipb3` | the [web forum](Web-Forum), guests reading it, and its theme (`ipb3`, `ipb2` or `ipb1`) |
| `forum`, `forum_guests`, `forum_theme` | `yes`, `yes`, `ipb3` | the [web forum](Web-Forum), guests reading it, and its theme (`ipb3`, `ipb2`, `ipb1` or `ikon`) |
The OpenAPI 3.1 description is at `/api/v1/openapi.json`.
+1 -1
View File
@@ -83,7 +83,7 @@ What there is:
[IRC](IRC) channels too, for IRC clients, and [MRC](MRC)'s rooms join the
BBSes' Multi Relay Chat
- [finger and gopher](Finger-and-Gopher): who is on, and chosen areas in gopherspace
- [a web forum](Web-Forum): the message areas as a bulletin board in the browser, in the manner of Invision Power Board 3, or of IPB 2 or 1 (themes)
- [a web forum](Web-Forum): the message areas as a bulletin board in the browser, in the manner of Invision Power Board 3, or of IPB 2 or 1, or Ikonboard (themes)
- [a web terminal](HTTP-API#the-web-terminal): the BBS in a browser (xterm.js, built in)
- [an HTTP API](HTTP-API): REST, server-sent events, and WebSockets (JSON or protobuf) where web clients chat with terminal callers; Prometheus metrics
- [customization](Customization): ANSI art and 3270 screens, menus of the sysop's, @-codes, the prompts' words
+1
View File
@@ -74,6 +74,7 @@ On a post:
| theme | |
|---|---|
| `ipb3` | the default: a board of the early 2010s in the manner of Invision Power Board 3: a dark user bar, a navy header with tabs, rounded blue category bars, posts with their author's column on the left |
| `ikon` | grey: a Perl board of 2001 in the manner of Ikonboard 2: a narrow centered page, grey tables with one-pixel lines between cells, a title box with a menu row and a *Welcome* box, a brushed-metal logo beside a folder tree of where you are, dark red links, grey bevelled buttons, folder badges and gem icons, posts with *Total Posts, Joined, Posted on* beneath |
| `ipb1` | retro: a board of the early 2000s in the manner of Invision Power Board 1: tables outlined in slate blue with white lines between their cells, bright title bars, a flat menu box, round forum badges and envelope topic icons, rounded glossy buttons, *Posted on* and a post links bar |
| `ipb2` | classic: a board of the mid-2000s in the manner of Invision Power Board 2: a white page, boxes outlined in navy, blue gradient title bars, pale blue rows, small Verdana; *Logged in as* and *Welcome Guest* bars, *Last Post Info*, *Fast Reply*, big blue buttons |
+19 -17
View File
@@ -17,23 +17,25 @@ import (
)
var funcs = template.FuncMap{
"body": renderBody,
"when": when,
"date": func(t time.Time) string { return t.Format("02 January 2006") },
"longdate": longDate,
"odd": func(n int) bool { return n%2 == 1 },
"initial": initial,
"avatar": avatarClass,
"group": groupTitle,
"urlq": url.QueryEscape,
"path": url.PathEscape,
"add": func(a, b int) int { return a + b },
"plural": plural,
"num": func(n int) string { return groupDigits(n) },
"isSysop": func(u *store.User) bool { return u != nil && u.Sysop },
"truncate": truncate,
"snippet": snippet,
"av": func(name, size string) map[string]string { return map[string]string{"Name": name, "Size": size} },
"body": renderBody,
"when": when,
"date": func(t time.Time) string { return t.Format("02 January 2006") },
"longdate": longDate,
"odd": func(n int) bool { return n%2 == 1 },
"shortdate": func(t time.Time) string { return t.Format("Jan. 02, 2006") },
"clock": func(t time.Time) string { return t.Format("03:04 PM") },
"initial": initial,
"avatar": avatarClass,
"group": groupTitle,
"urlq": url.QueryEscape,
"path": url.PathEscape,
"add": func(a, b int) int { return a + b },
"plural": plural,
"num": func(n int) string { return groupDigits(n) },
"isSysop": func(u *store.User) bool { return u != nil && u.Sysop },
"truncate": truncate,
"snippet": snippet,
"av": func(name, size string) map[string]string { return map[string]string{"Name": name, "Size": size} },
"seq": func(n int) []int {
out := make([]int, n)
for i := range out {
+1
View File
@@ -51,6 +51,7 @@ var Themes = []Theme{
{"ipb3", "Default (IPB 3 style)"},
{"ipb2", "Classic (IPB 2 style)"},
{"ipb1", "Retro (IPB 1 style)"},
{"ikon", "Grey (Ikonboard style)"},
}
// KnownTheme says whether there is a theme of the name.
+1
View File
@@ -417,6 +417,7 @@ func TestThemes(t *testing.T) {
"ipb3": {{"Signed in as", "Reply to this topic"}, {"Board Statistics", "Create Account"}},
"ipb2": {{"Logged in as:", "Fast Reply", "Member No.:", `class="postsep"`}, {"Welcome Guest", "Last Post Info", `id="gfooter"`}},
"ipb1": {{"Logged in as:", "Posted on", `class="postlinksbar"`, `class="activeuserstrip"`}, {"Welcome Guest", "Last Post Info", `class="pformstrip"`}},
"ikon": {{"Log out</button>", "Total Posts:", "Post a reply", `class="bottomline"`}, {"Guest: ", "Forum Info", "welcomes its newest member", "You must be logged in to view the post markers"}},
}[th.Name]
has(t, th.Name+" own topic", body, own[0]...)
_, _, body = guest.get("/forum/")
+283
View File
@@ -0,0 +1,283 @@
/*
* The forum's grey theme: laid out in the manner of the Perl boards of
* 2001 (Ikonboard 2's default look and its kind): a narrow centered page,
* grey tables with one-pixel lines between their cells, a title box and
* a menu row, a folder tree for where you are, dark red links, a brushed
* metal logo, grey bevelled buttons, round folder badges and gem icons.
* Written for this BBS; it takes no code or images from any board.
*/
:root {
--titleback: #eeeeee;
--titlefont: #555555;
--titleborder: #333333;
--menuback: #dddddd;
--menufont: #333333;
--link: #990000;
--link-hover: #660000;
--highlight: #990000;
--poster: #000066;
--admin: #990000;
--misc: #333333;
--back1: #ffffff;
--back2: #eeeeee;
--catback: #dddddd;
--border: #999999;
--titlecolor: #999999;
--titletext: #333333;
--forum1: #eeeeee;
--forum2: #ffffff;
--post1: #eeeeee;
--post2: #ffffff;
}
body {
margin: 0;
padding: 5px 0 20px;
background: #fff;
color: var(--misc);
font: 12px Verdana, Arial, sans-serif;
}
a:link, a:visited, a:active { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
p { margin: 0; }
form { margin: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
b.hl, .hl { color: var(--highlight); }
.small { font-size: 10px; }
#wrap { width: 740px; max-width: calc(100% - 16px); margin: 0 auto; }
.inline-form { display: inline; }
.linkish { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--link); cursor: pointer; }
.linkish:hover { color: var(--link-hover); }
.desc { font-size: 10px; color: #666; }
/* --- the title box, its menu row, the welcome box */
.titlebox { border: 1px solid var(--titleborder); background: var(--titleback); }
.titlerow { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 4px; padding: 4px; color: var(--titlefont); }
.bname { font-size: 18px; font-weight: bold; }
.bdesc { font-size: 12px; }
.back { font-size: 10px; }
.menurow { padding: 4px; background: var(--menuback); color: var(--menufont); }
.welcomebox { margin: 12px 0 0; padding: 4px; border: 1px solid var(--titleborder); background: var(--menuback); color: var(--menufont); font-size: 10px; }
.welcomebox.notice { color: var(--highlight); font-weight: bold; }
/* --- the logo and the folder tree beside it */
.header { display: flex; align-items: center; gap: 16px; margin: 14px 0; }
.logo {
display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none;
width: 198px; height: 70px;
border: 1px solid #777;
background:
repeating-linear-gradient(to bottom, rgba(255,255,255,0.18) 0 1px, rgba(0,0,0,0.05) 1px 2px, transparent 2px 3px),
linear-gradient(135deg, #e3e3e3, #a9a9a9 40%, #d6d6d6 60%, #9a9a9a);
box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #666;
text-decoration: none !important;
}
.logo-name {
max-width: 186px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
color: #b30000; font: bold 20px/1.1 "Arial Black", Verdana, sans-serif; letter-spacing: 0;
text-shadow: 1px 1px 0 rgba(255,255,255,0.7), -1px -1px 0 rgba(0,0,0,0.35);
}
.logo-sub { margin-top: 4px; color: #222; font-size: 8px; letter-spacing: 2px; text-transform: uppercase; }
.tree { font-size: 12px; line-height: 18px; }
.tree > div { display: flex; align-items: center; gap: 4px; }
.tree .lvl0 { padding-left: 10px; }
.tree .lvl1 { padding-left: 30px; }
.tree .lvl2 { padding-left: 50px; }
.treebar { width: 10px; height: 10px; margin-top: -8px; border-left: 1px dotted #555; border-bottom: 1px dotted #555; }
.fold { display: inline-block; width: 16px; height: 12px; position: relative; border: 1px solid #555; border-radius: 1px 2px 2px 2px; background: linear-gradient(#f5f5f5, #c8c8c8); }
.fold::before { content: ""; position: absolute; left: -1px; top: -4px; width: 7px; height: 3px; border: 1px solid #555; border-bottom: 0; border-radius: 2px 2px 0 0; background: #e8e8e8; }
.fold.open { background: linear-gradient(#fff2a8, #e8c23a); border-color: #7a6512; }
.fold.open::before { background: #fff2a8; border-color: #7a6512; }
.boardinfo { margin: -64px 0 14px 214px; min-height: 50px; text-align: right; font-size: 12px; }
/* --- the grey tables */
.tbl { margin: 0 0 14px; border: 1px solid var(--border); background: var(--border); }
.itable { width: 100%; border-collapse: separate; border-spacing: 1px; }
.itable td { padding: 4px; vertical-align: middle; }
tr.title td { background: var(--titlecolor); color: var(--titletext); font-weight: bold; font-size: 10px; }
tr.title td a.ibtn { font-size: 11px; }
td.cat { background: var(--catback); color: #333; font-size: 14px; font-weight: bold; }
td.f1 { background: var(--forum1); }
td.f2 { background: var(--forum2); }
td.icon { width: 5%; text-align: center; }
td.num { width: 6%; text-align: center; white-space: nowrap; }
.lastcol { width: 25%; }
td.lastcol { font-size: 10px; color: #000; }
td.info { width: 25%; }
.fname { font-size: 14px; }
td.topic { width: 45%; }
/* menu bars above and below lists */
.menubar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px; padding: 6px; background: var(--menuback); font-size: 10px; color: var(--menufont); }
.pagelinks .cur { color: var(--menufont); }
.pagelinks a b { color: var(--highlight); }
/* a forum's badge: a dark disc with a folder, the folder yellow when new */
.ifold {
display: inline-block; position: relative; width: 26px; height: 22px; border-radius: 50%;
background: radial-gradient(circle at 40% 35%, #777, #222 70%);
border: 1px solid #000; box-shadow: inset 0 0 0 2px #bbb;
vertical-align: middle;
}
.ifold::after { content: ""; position: absolute; left: 7px; top: 8px; width: 11px; height: 7px; background: #f4f4f4; border-radius: 1px; box-shadow: -1px -2px 0 -1px #f4f4f4; }
.ifold.new::after { background: #f2d22e; box-shadow: -1px -2px 0 -1px #f2d22e; }
/* a topic's icon: a gem, green when new, red when hot */
.gem {
display: inline-block; width: 13px; height: 13px; border-radius: 50%; vertical-align: middle;
background: radial-gradient(circle at 35% 30%, #fff 0 15%, #c9c9c9 45%, #7d7d7d 100%);
border: 1px solid #555;
}
.gem.new { background: radial-gradient(circle at 35% 30%, #fff 0 15%, #8ee08e 45%, #2c8a2c 100%); border-color: #1d5c1d; }
.gem.hot { background: radial-gradient(circle at 35% 30%, #fff 0 15%, #e3b2b2 45%, #9b6b6b 100%); border-color: #6d4444; }
.gem.new.hot { background: radial-gradient(circle at 35% 30%, #fff 0 15%, #f07a7a 45%, #b01010 100%); border-color: #6d0000; }
.onlineicon { display: inline-block; width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 50% 38%, #f3d2a8 0 5px, transparent 5.5px), radial-gradient(circle at 50% 110%, #333 0 9px, transparent 9.5px), linear-gradient(#ddd, #aaa); border: 1px solid #555; }
/* grey bevelled buttons with a squared-off face */
.ibtn:link, .ibtn:visited {
display: inline-block; padding: 3px 12px;
border: 1px solid #555;
background: linear-gradient(to bottom, #f0f0f0, #bcbcbc 50%, #a8a8a8 51%, #cfcfcf);
box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #777;
color: #333; font: bold 12px/1.2 "Trebuchet MS", Verdana, sans-serif; letter-spacing: 1px; text-transform: uppercase; text-decoration: none;
text-shadow: 1px 1px 0 #eee;
}
.ibtn:hover { color: #000; background: linear-gradient(to bottom, #fafafa, #c8c8c8 50%, #b4b4b4 51%, #dadada); }
.legendbox { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 0 0 14px; font-size: 10px; }
.legendbox div { display: flex; align-items: center; gap: 6px; }
/* --- a topic's posts */
td.postcell { padding: 0 !important; }
td.p1 { background: var(--post1); }
td.p2 { background: var(--post2); }
.post { display: flex; }
.who { flex: 0 0 20%; padding: 4px; font-size: 12px; }
.who .avatar { margin-top: 4px; }
.poster { color: var(--poster) !important; font-weight: bold; }
.poster.admin { color: var(--admin) !important; }
.teamicon { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; background: radial-gradient(circle at 35% 30%, #fff 0 15%, #ffd34a 50%, #b07a00); border: 1px solid #6b4b00; }
.pips { color: #900; letter-spacing: 1px; font-size: 11px; }
.said { flex: 1; padding: 4px; min-width: 0; }
.picons { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.picon:link, .picon:visited, button.picon {
display: inline-flex; align-items: center; gap: 3px;
background: none; border: 0; padding: 0; cursor: pointer;
color: #224 !important; font: bold 9px Verdana, sans-serif; text-transform: uppercase; letter-spacing: 1px;
}
.picon:hover { color: var(--link) !important; }
.pi { display: inline-block; width: 14px; height: 14px; border: 1px solid #335; border-radius: 2px; background: linear-gradient(#e8eef8, #9fb0cc); }
.pi.quote { background: linear-gradient(#e8eef8, #6d8ac0); }
.pi.profile { border-radius: 50% 50% 2px 2px; background: radial-gradient(circle at 50% 35%, #f3d2a8 0 3px, transparent 3.5px), linear-gradient(#8fb0de, #3d5f9a); }
.pi.like { border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 15%, #f07a7a 45%, #b01010); border-color: #6d0000; }
.pi.delete { background: linear-gradient(45deg, transparent 42%, #b00 42% 58%, transparent 58%), linear-gradient(-45deg, transparent 42%, #b00 42% 58%, transparent 58%), #f4f4f4; }
.postbody { font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; min-height: 40px; }
.likes { margin-top: 8px; font-size: 10px; color: var(--highlight); }
.bottomline { padding: 0 4px 4px 20.5%; font-size: 10px; }
/* quotes: a blockquote between two rules, in small type */
.citation { margin: 6px 0 0 40px; font: 10px Arial, sans-serif; }
blockquote.quote { margin: 2px 40px 8px; padding: 0; font: 11px Arial, sans-serif; }
blockquote.quote::before, blockquote.quote::after { content: ""; display: block; border-top: 1px solid #999; margin: 4px 0; }
.bbc_url:link, .bbc_url:visited { color: var(--link); text-decoration: underline; }
/* polls */
td.poll { padding: 8px !important; }
.pollresults { border-collapse: collapse; margin: 0 0 6px; }
.pollresults td { padding: 2px 8px 2px 0; }
.pollresults td.bar { width: 220px; }
meter { width: 100%; height: 10px; }
meter::-webkit-meter-bar { background: #fff; border: 1px solid #777; border-radius: 0; }
meter::-webkit-meter-optimum-value { background: linear-gradient(#c33, #800); }
meter::-moz-meter-bar { background: linear-gradient(#c33, #800); }
.poll-form { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
/* --- forms */
input[type=text], input[type=password], input[type=search], textarea, select {
font: 12px Verdana, Arial, sans-serif; color: #000; background: #eee; border: 1px solid #777; padding: 2px;
}
textarea { width: 100%; box-sizing: border-box; }
.button, button.button, a.button:link, a.button:visited {
display: inline-block; padding: 2px 8px;
font: 12px Verdana, Arial, sans-serif; color: #000; text-decoration: none; cursor: pointer;
background: #ddd; border: 2px outset #eee;
}
.button:active { border-style: inset; }
.button.important { font-weight: bold; }
.button.danger { color: var(--admin); }
td.formleft { width: 30%; vertical-align: top !important; }
.formbuttons { margin-top: 6px; text-align: center; }
/* the default theme's pages that this one shows as they are */
.box { margin: 0 0 14px; border: 1px solid var(--border); background: var(--forum2); }
.box > h2.maintitle { margin: 0; padding: 4px; background: var(--titlecolor); color: var(--titletext); font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.box .count { margin-left: auto; font-weight: normal; font-size: 10px; }
.box-body { padding: 8px; background: var(--forum1); }
.box.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.field { display: grid; grid-template-columns: 35% 1fr; align-items: center; gap: 6px; padding: 4px 0; font-weight: bold; }
.field input, .field textarea { font-weight: normal; }
.editor .field { grid-template-columns: 1fr; }
.editor-foot { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.signin .desc { margin-bottom: 6px; }
.poll-maker { margin: 8px 0; }
.poll-maker summary { cursor: pointer; color: var(--link); }
.searchform { display: flex; gap: 6px; }
.searchform input { flex: 1; }
.message { margin: 0 0 14px; padding: 4px; border: 1px solid var(--titleborder); background: var(--menuback); }
.message.error { color: var(--admin); font-weight: bold; }
.box-body .message { margin: 0 0 8px; }
table.board { width: 100%; border-collapse: separate; border-spacing: 1px; background: var(--border); }
table.board th { padding: 4px; background: var(--catback); font-size: 10px; text-align: left; }
table.board td { padding: 4px; background: var(--forum2); vertical-align: top; }
table.board tr:nth-child(even) td { background: var(--forum1); }
table.board h3 { margin: 0; font-size: 12px; }
.snippet { color: #555; font-size: 11px; }
td.none { text-align: center; }
/* letter pictures for those without one */
.avatar {
display: inline-flex; align-items: center; justify-content: center;
color: #fff; font: bold 16px Verdana, sans-serif;
border: 1px solid #333;
vertical-align: middle;
}
.avatar.tiny { width: 16px; height: 16px; font-size: 10px; }
.avatar.mini { width: 24px; height: 24px; font-size: 12px; }
.avatar.large { width: 60px; height: 60px; font-size: 30px; }
.avatar.huge { width: 90px; height: 90px; font-size: 46px; }
.av0 { background: #4f7bb0; } .av1 { background: #b0574f; } .av2 { background: #4f9a6b; }
.av3 { background: #8a5fb0; } .av4 { background: #c0862d; } .av5 { background: #3e8f9e; }
.av6 { background: #a24f86; } .av7 { background: #6b7a3c; } .av8 { background: #c06a3e; }
.av9 { background: #546478; } .av10 { background: #2f7f5f; } .av11 { background: #9b4545; }
/* --- the foot */
.footbox { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; padding: 4px; border: 1px solid var(--titleborder); background: var(--menuback); font-size: 10px; }
.themepicker, .quicksearch { display: flex; align-items: center; gap: 4px; }
.themepicker select, .quicksearch input { font-size: 10px; }
.copyright { margin: 14px 0 0; text-align: center; font-size: 10px; }
/* --- narrow screens */
@media (max-width: 760px) {
.header { flex-direction: column; align-items: flex-start; }
.boardinfo { margin: -6px 0 14px; text-align: left; min-height: 0; }
.lastcol, td.num { display: none; }
.post { flex-direction: column; }
.who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.who br { display: none; }
.who .avatar.large { width: 32px; height: 32px; font-size: 16px; margin: 0; }
.bottomline { padding-left: 4px; }
td.formleft { display: none; }
.field { grid-template-columns: 1fr; }
}
+27
View File
@@ -0,0 +1,27 @@
{{define "area.html"}}{{template "head" .}}
{{$b := .Body}}
<div class="tbl menubar"><div class="mleft">{{template "pages" $b.Pages}}</div>
<div class="mright">{{if .User}}<form method="post" action="/forum/area/{{$b.Area.ID}}/read" class="inline-form"><input type="hidden" name="csrf" value="{{.CSRF}}"><button class="linkish">Mark all forum posts as read</button></form>{{else}}{{plural $b.Count "topic" "topics"}}{{end}}</div></div>
<div class="tbl"><table class="itable">
<tr class="title"><td colspan="2">{{if $b.CanPost}}<a href="/forum/area/{{$b.Area.ID}}/new" class="ibtn">New Topic</a>{{else if not .User}}<a href="/forum/login?back={{urlq (printf "/forum/area/%d" $b.Area.ID)}}" class="ibtn">Log-in</a>{{else}}&nbsp;{{end}}</td><td class="info">Topic Info</td><td class="lastcol">Last Post</td></tr>
{{range $b.Topics}}
<tr>
<td class="f2 icon"><span class="gem{{if .Unread}} new{{end}}{{if ge .Replies 15}} hot{{end}}" title="{{if .Unread}}New replies{{else}}No new replies{{end}}"></span></td>
<td class="f2 topic"><b><a href="/forum/topic/{{.Root.ID}}">{{.Root.Subject}}</a></b>{{if gt .Pages 1}} &nbsp;[ Pages {{$root := .Root.ID}}{{range (seq .Pages)}}<a href="/forum/topic/{{$root}}{{if gt . 1}}?page={{.}}{{end}}"> {{.}} </a>{{end}}]{{end}}
<br><span class="small">&nbsp;&nbsp;&raquo;{{snippet .Root.Body 60}}</span></td>
<td class="f2 small"><b>{{num .Replies}}</b> {{if eq .Replies 1}}reply{{else}}replies{{end}}<br>Started by: <b>{{.Root.From}}</b></td>
<td class="f1 lastcol">{{shortdate .Last.Created}} - {{clock .Last.Created}}<br>by: <a href="/forum/post/{{.Last.ID}}"><b>{{.Last.From}}</b></a></td>
</tr>
{{else}}
<tr><td class="f2" colspan="4">There are no topics in this forum yet.{{if $b.CanPost}} <a href="/forum/area/{{$b.Area.ID}}/new">Start the first one.</a>{{end}}</td></tr>
{{end}}
<tr class="title"><td colspan="4">{{if $b.CanPost}}<a href="/forum/area/{{$b.Area.ID}}/new" class="ibtn">New Topic</a>{{else}}&nbsp;{{end}}</td></tr>
</table></div>
<div class="tbl menubar"><div class="mleft">{{template "pages" $b.Pages}}</div><div class="mright"><a href="/forum/">&raquo; back to the forums</a></div></div>
<div class="legendbox">
<div><span class="gem new"></span> Open topic, new replies</div>
<div><span class="gem"></span> Open topic</div>
<div><span class="gem new hot"></span> Hot topic, new replies</div>
<div><span class="gem hot"></span> Hot topic</div>
</div>
{{template "foot" .}}{{end}}
+31
View File
@@ -0,0 +1,31 @@
{{define "index.html"}}{{template "head" .}}
{{$st := .Body.Stats}}
<div class="boardinfo">{{with $st.Newest}}{{$.BBS}} welcomes its newest member <a href="/forum/user/{{path .Name}}">{{.Name}}</a><br>{{end}}
{{.BBS}} has <b>{{num $st.Members}}</b> members with <b>{{num $st.Posts}}</b> posts in <b>{{num $st.Topics}}</b> topics</div>
<div class="tbl"><table class="itable">
<tr class="title"><td class="icon">&nbsp;</td><td>Forum Info</td><td class="num">Replies</td><td class="num">Topics</td><td class="lastcol">Last Post</td></tr>
{{range .Body.Categories}}
<tr><td class="cat" colspan="5">&raquo; {{.Name}}</td></tr>
{{range $f := .Forums}}
<tr>
<td class="f2 icon">{{if $.User}}<span class="ifold{{if $f.Unread}} new{{end}}" title="{{if $f.Unread}}New posts since your last visit{{else}}No new posts since your last visit{{end}}"></span>{{else}}&nbsp;{{end}}</td>
<td class="f2"><b class="fname"><a href="/forum/area/{{$f.Area.ID}}">{{$f.Area.Name}}</a></b>{{if $f.Area.Description}}<br>{{$f.Area.Description}}{{end}}</td>
<td class="f2 num">{{if $f.Unread}}<b class="hl">{{num $f.Replies}}</b>{{else}}{{num $f.Replies}}{{end}}</td>
<td class="f2 num">{{num $f.Topics}}</td>
<td class="f1 lastcol">{{with $f.Last}}Date: <b>{{shortdate .Created}}</b><br>Time: {{clock .Created}}<br>by: {{.From}} &middot; <a href="/forum/post/{{.ID}}" title="{{$f.LastTopic.Subject}}">&raquo;</a>{{else}}N/A{{end}}</td>
</tr>
{{end}}
{{else}}
<tr><td class="f2" colspan="5">There are no forums open to you yet.{{if not .User}} <a href="/forum/login">Log in</a> to see more.{{end}}</td></tr>
{{end}}
<tr class="title"><td colspan="5">{{plural (len .Body.Online) "user is" "users are"}} on the BBS just now</td></tr>
<tr><td class="f2 icon"><span class="onlineicon" aria-hidden="true"></span></td>
<td class="f2 small" colspan="4">Total members: {{len .Body.Online}}<br>{{range $i, $n := .Body.Online}}{{if $i}}, {{end}}<a href="/forum/user/{{path $n.User}}">{{$n.User}}</a> ({{$n.Via}}){{end}}</td></tr>
</table></div>
<div class="legendbox">
{{if .User}}
<div><span class="ifold new"></span> New posts since your last visit</div>
<div><span class="ifold"></span> No new posts since your last visit</div>
{{else}}<p>You must be logged in to view the post markers</p>{{end}}
</div>
{{template "foot" .}}{{end}}
+40
View File
@@ -0,0 +1,40 @@
{{define "head"}}<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{if ne .Title .BBS}}{{.Title}} - {{end}}{{.BBS}}</title>
<link rel="stylesheet" href="/forum/static/ikon.css">
</head>
<body id="top">
<div id="wrap">
<div class="titlebox">
<div class="titlerow">
<div><span class="bname">{{.BBS}}</span><br><span class="bdesc">The forums of a bulletin board system</span></div>
{{if .Terminal}}<div class="back"><a href="/terminal">&raquo; back to the terminal</a></div>{{end}}
</div>
<div class="menurow">{{if not .User}}{{if .Register}}<a href="/forum/register">Register</a> | {{end}}<a href="/forum/login">Log-in</a> | {{else}}<a href="/forum/user/{{path .User.Name}}">Profile</a> | {{end}}<a href="/forum/online">Active Users ({{.Online}})</a> | <a href="/forum/search">Search</a>{{if .Terminal}} | <a href="/terminal">Terminal</a>{{end}}</div>
</div>
<div class="welcomebox">&raquo; Welcome {{if .User}}{{.User.Name}}: <form method="post" action="/forum/logout" class="inline-form"><input type="hidden" name="csrf" value="{{.CSRF}}"><button class="linkish">Log out</button></form> | <a href="/forum/user/{{path .User.Name}}">Your profile</a> | <a href="/forum/search">Search the posts</a>{{else}}Guest: <a href="/forum/login">log in</a>{{if .Register}} | <a href="/forum/register">Register</a>{{end}}{{end}}</div>
{{if eq .Notice "welcome"}}<div class="welcomebox notice">&raquo; Thanks for registering! Your account is made, and you are logged in.</div>{{end}}
<div class="header">
<a href="/forum/" class="logo"><span class="logo-name">{{.BBS}}</span><span class="logo-sub">bulletin board</span></a>
<div class="tree">
<div><span class="fold{{if not .Crumbs}} open{{end}}" aria-hidden="true"></span><a href="/forum/">{{.BBS}}</a></div>
{{$n := len .Crumbs}}{{range $i, $c := .Crumbs}}<div class="lvl{{$i}}"><span class="treebar" aria-hidden="true"></span><span class="fold{{if eq (add $i 1) $n}} open{{end}}" aria-hidden="true"></span>{{if $c.URL}}<a href="{{$c.URL}}">{{$c.Name}}</a>{{else}}{{$c.Name}}{{end}}</div>{{end}}
</div>
</div>
{{end}}
{{define "foot"}}
<div class="footbox">
{{template "themepicker" .}}
<form action="/forum/search" method="get" class="quicksearch"><input type="search" name="q" placeholder="Search" aria-label="Search"> <button class="button">Go</button></form>
</div>
<div class="copyright">{{.BBS}} | <a href="/forum/online">Active Users</a><br><br>Powered by bbs-sec<br>All times are server time: {{longdate .Now}}</div>
</div>
</body>
</html>
{{end}}
{{define "pages"}}{{if gt .Total 1}}<span class="pagelinks"><b>Multiple pages</b> [ {{$cur := .Cur}}{{$p := .}}{{range .Shown}}{{if eq . 0}}&hellip; {{else if eq . $cur}}<span class="cur">{{.}}</span> {{else}}<a href="{{$p.URL .}}"><b>{{.}}</b></a> {{end}}{{end}}]</span>{{else}}<span class="pagelinks">Single page</span>{{end}}{{end}}
+19
View File
@@ -0,0 +1,19 @@
{{define "profile.html"}}{{template "head" .}}
{{$u := .Body.U}}
<div class="tbl"><table class="itable">
<tr class="title"><td colspan="2">Profile for <b>{{$u.Name}}</b></td></tr>
<tr><td class="f1 formleft">Avatar</td><td class="f2">{{template "avatar" (av $u.Name "huge")}}</td></tr>
<tr><td class="f1 formleft">Member title</td><td class="f2">{{if $u.Sysop}}<span class="poster admin">Administrator</span>{{else if $u.Locked}}BANNED{{else}}Member{{end}}</td></tr>
<tr><td class="f1 formleft">Joined</td><td class="f2">{{shortdate $u.Created}}</td></tr>
<tr><td class="f1 formleft">Last visit</td><td class="f2">{{shortdate $u.LastLogin}} {{clock $u.LastLogin}}</td></tr>
<tr><td class="f1 formleft">Total posts</td><td class="f2">{{num $u.Posts}}</td></tr>
<tr><td class="f1 formleft">Calls</td><td class="f2">{{num $u.Logins}}</td></tr>
<tr><td class="f1 formleft">Location</td><td class="f2">{{if $u.Location}}{{$u.Location}}{{else}}&nbsp;{{end}}</td></tr>
<tr><td class="f1 formleft">Interests</td><td class="f2">{{if $u.About}}{{$u.About}}{{else}}&nbsp;{{end}}</td></tr>
<tr><td class="f1 formleft">Status</td><td class="f2">{{range .Body.On}}<span class="hl">On node {{.Num}} by {{.Via}}: {{.Activity}}</span><br>{{else}}Offline{{end}}</td></tr>
<tr class="title"><td colspan="2">Recent posts</td></tr>
{{range .Body.Recent}}
<tr><td class="f1 formleft small">{{shortdate .Created}}<br>{{clock .Created}}</td><td class="f2"><b><a href="/forum/post/{{.ID}}">{{.Subject}}</a></b><br><span class="small">{{snippet .Body 160}}</span></td></tr>
{{else}}<tr><td class="f2" colspan="2">No posts to show.</td></tr>{{end}}
</table></div>
{{template "foot" .}}{{end}}
+72
View File
@@ -0,0 +1,72 @@
{{define "topic.html"}}{{template "head" .}}
{{$b := .Body}}{{$csrf := .CSRF}}{{$me := .User}}
<div class="tbl menubar"><div class="mleft"><a href="/forum/area/{{$b.Area.ID}}">&laquo; {{$b.Area.Name}}</a> &nbsp; {{template "pages" $b.Pages}}</div>
<div class="mright">{{plural $b.Count "post" "posts"}}</div></div>
<div class="tbl"><table class="itable">
<tr class="title"><td>{{if $b.CanPost}}<a href="/forum/area/{{$b.Area.ID}}/new" class="ibtn">New Topic</a> &nbsp; <a href="#reply" class="ibtn">Post Reply</a>{{else}}<b>{{$b.Root.Subject}}</b>{{end}}</td></tr>
{{with $b.Poll}}
<tr><td class="f1 poll">
<b>Poll: {{$b.Root.Subject}}</b>
<hr>
{{if or .Voted (not $me)}}
<table class="pollresults">
{{range .Answers}}<tr><td class="answer">{{.Text}}{{if .Mine}} <span class="hl">&laquo;</span>{{end}}</td><td class="bar"><meter min="0" max="100" value="{{.Pct}}"></meter></td><td class="small">{{.Count}} votes ({{.Pct}}%)</td></tr>{{end}}
</table>
<p class="small">Total votes: <b>{{.Total}}</b>{{if not $me}} | <a href="/forum/login">Log in</a> to vote{{end}}</p>
{{end}}
{{if $me}}
<form method="post" action="/forum/post/{{.ID}}/answer" class="poll-form">
<input type="hidden" name="csrf" value="{{$csrf}}">
{{range .Answers}}<label><input type="radio" name="answer" value="{{.Index}}"{{if .Mine}} checked{{end}}> {{.Text}}</label>{{end}}
<div><button class="button">{{if .Voted}}Change vote{{else}}Vote{{end}}</button></div>
</form>
{{end}}
</td></tr>
{{end}}
{{range $b.Posts}}
<tr id="entry{{.M.ID}}"><td class="{{if odd .Num}}p1{{else}}p2{{end}} postcell">
<div class="post">
<div class="who">
{{if .Author}}<a href="/forum/user/{{path .Author.Name}}" class="poster{{if .Author.Sysop}} admin{{end}}">{{.M.From}}</a>{{if .Author.Sysop}} <span class="teamicon" title="Sysop" aria-hidden="true"></span>{{end}}{{else}}<span class="poster">{{.M.From}}</span>{{end}}
<br>{{template "avatar" (av .M.From "large")}}
{{if .Author}}<br><span class="pips" aria-hidden="true">{{if ge .Author.Posts 10}}&#9679;{{end}}{{if ge .Author.Posts 50}}&#9679;{{end}}&#9679;</span>
<br><span class="small">{{if .Author.Sysop}}Administrator{{else if .Author.Locked}}BANNED{{else}}Member{{end}}</span>
{{else if .Where}}<br><span class="small">Visitor from {{.Where}}</span>{{end}}
</div>
<div class="said">
<div class="picons">
{{if $b.CanPost}}<a href="/forum/topic/{{$b.Root.ID}}?quote={{.M.ID}}{{if gt $b.Pages.Cur 1}}&amp;page={{$b.Pages.Cur}}{{end}}#reply" class="picon"><span class="pi quote" aria-hidden="true"></span>quote</a>{{end}}
{{if .Author}}<a href="/forum/user/{{path .Author.Name}}" class="picon"><span class="pi profile" aria-hidden="true"></span>profile</a>{{end}}
{{if .CanLike}}<form method="post" action="/forum/post/{{.M.ID}}/like" class="inline-form"><input type="hidden" name="csrf" value="{{$csrf}}"><input type="hidden" name="like" value="{{if .Liked}}0{{else}}1{{end}}"><button class="picon"><span class="pi like" aria-hidden="true"></span>{{if .Liked}}unlike{{else}}like{{end}}</button></form>{{end}}
{{if .CanDelete}}<form method="post" action="/forum/post/{{.M.ID}}/delete" class="inline-form"><input type="hidden" name="csrf" value="{{$csrf}}"><button class="picon"><span class="pi delete" aria-hidden="true"></span>delete</button></form>{{end}}
</div>
<hr>
<div class="postbody">{{body .M.Body}}</div>
{{if .Likes}}<p class="likes">{{plural .Likes "member likes" "members like"}} this post</p>{{end}}
</div>
</div>
<div class="bottomline"><hr>
{{if .Author}}Total Posts: <b>{{num .Author.Posts}}</b> | Joined <b>{{shortdate .Author.Created}}</b> | {{end}}Posted on: <b>{{shortdate .M.Created}} {{clock .M.Created}}</b>{{if and .M.To (ne .M.To "All")}} | To: <b>{{.M.To}}</b>{{end}} | <a href="/forum/post/{{.M.ID}}">#{{.Num}}</a>
</div>
</td></tr>
{{end}}
<tr class="title"><td>{{if $b.CanPost}}<a href="/forum/area/{{$b.Area.ID}}/new" class="ibtn">New Topic</a> &nbsp; <a href="#reply" class="ibtn">Post Reply</a>{{else}}&nbsp;{{end}}</td></tr>
</table></div>
<div class="tbl menubar"><div class="mleft">{{template "pages" $b.Pages}}</div><div class="mright"><a href="/forum/area/{{$b.Area.ID}}">&raquo; back to {{$b.Area.Name}}</a></div></div>
{{if $b.CanPost}}
<div class="tbl" id="reply"><table class="itable">
<tr class="title"><td colspan="2"><b>Post a reply</b></td></tr>
<tr><td class="f1 formleft"><b>Your reply</b><br><span class="small">Quote with &gt; at the start of a line. Links are made links.</span></td>
<td class="f2"><form method="post" action="/forum/topic/{{$b.Root.ID}}/reply" id="replyform">
<input type="hidden" name="csrf" value="{{.CSRF}}">
{{if $b.QuoteID}}<input type="hidden" name="reply_to" value="{{$b.QuoteID}}">{{end}}
<textarea name="body" rows="9" required aria-label="Your reply">{{$b.Quote}}</textarea>
{{if $b.Aliases}}<br><label><input type="checkbox" name="alias"> Post as {{$me.Alias}}</label>{{end}}
<div class="formbuttons"><button class="button">Add Reply</button></div>
</form></td></tr>
</table></div>
{{else if not .User}}
<div class="welcomebox">&raquo; You must be logged in to reply. <a href="/forum/login?back={{urlq (printf "/forum/topic/%d" $b.Root.ID)}}">log in</a>{{if .Register}} | <a href="/forum/register">Register</a>{{end}}</div>
{{end}}
{{template "foot" .}}{{end}}