mirror of
https://github.com/D-Modem/bbs.git
synced 2026-11-28 17:38:04 -08:00
Web forum: a dark theme in the manner of phpBB 1
phpbb1: a PHP board of 2001, after phpBB 1.4's default theme: a black page, white text and teal links, a glowing italic logo, glowing New Topic and Reply buttons in the header, [bracketed] menu links, the -N- statistics block, near-black table lines with cells alternating grey and navy, small folder icons, posts between rules with little labelled links beneath, Goto page. Its own CSS and templates; no code or images taken from phpBB. Layouts now know which page they show (page.Page), for headers that differ by page, as phpBB 1's did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
This commit is contained in:
14 files changed
+417
-9
No files matched your search
@@ -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, or Ikonboard (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, Ikonboard or phpBB 1 (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
|
||||
|
||||
+2
-1
@@ -213,7 +213,8 @@ 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)
|
||||
; ipb1 (retro, as IPB 1) or ikon (grey, as Ikonboard 2)
|
||||
; ipb1 (retro, as IPB 1), ikon (grey, as Ikonboard 2) or phpbb1 (dark,
|
||||
; as phpBB 1)
|
||||
;forum_theme = ipb3
|
||||
|
||||
; Access levels: a user's level (0-255) gets what the [level] at or
|
||||
|
||||
@@ -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`, `ipb1` or `ikon`) |
|
||||
| `forum`, `forum_guests`, `forum_theme` | `yes`, `yes`, `ipb3` | the [web forum](Web-Forum), guests reading it, and its theme (`ipb3`, `ipb2`, `ipb1`, `ikon` or `phpbb1`) |
|
||||
|
||||
The OpenAPI 3.1 description is at `/api/v1/openapi.json`.
|
||||
|
||||
|
||||
+1
-1
@@ -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, or Ikonboard (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, Ikonboard or phpBB 1 (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
|
||||
|
||||
@@ -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 |
|
||||
| `phpbb1` | dark: a PHP board of 2001 in the manner of phpBB 1: a black page with white text and teal links, a glowing italic logo, glowing *New Topic* and *Reply* buttons, [bracketed] menu links, the *-N-* statistics block, near-black table lines with cells in alternating grey and navy, small folder icons, posts between rules with little labelled links beneath |
|
||||
| `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 |
|
||||
|
||||
@@ -24,6 +24,8 @@ var funcs = template.FuncMap{
|
||||
"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") },
|
||||
"stamp": func(t time.Time) string { return t.Format("2006-01-02 15:04") },
|
||||
"monthyear": func(t time.Time) string { return t.Format("Jan 2006") },
|
||||
"initial": initial,
|
||||
"avatar": avatarClass,
|
||||
"group": groupTitle,
|
||||
|
||||
@@ -52,6 +52,7 @@ var Themes = []Theme{
|
||||
{"ipb2", "Classic (IPB 2 style)"},
|
||||
{"ipb1", "Retro (IPB 1 style)"},
|
||||
{"ikon", "Grey (Ikonboard style)"},
|
||||
{"phpbb1", "Dark (phpBB 1 style)"},
|
||||
}
|
||||
|
||||
// KnownTheme says whether there is a theme of the name.
|
||||
@@ -264,6 +265,7 @@ type page struct {
|
||||
Theme string // the theme in use
|
||||
Themes []Theme // to choose from
|
||||
Path string // this page's, to come back to
|
||||
Page string // which page it is (its template's name), for layouts that differ by page
|
||||
Body any // the page's own
|
||||
}
|
||||
|
||||
@@ -275,7 +277,7 @@ type crumb struct {
|
||||
func (q *req) render(status int, name, title string, crumbs []crumb, body any) {
|
||||
p := page{Title: title, BBS: q.s.B.Name, User: q.user, CSRF: q.csrf(), Crumbs: crumbs, Terminal: q.s.Terminal,
|
||||
Register: q.user == nil && q.s.B.NewUsers, Now: time.Now(), Body: body, Notice: q.r.URL.Query().Get("notice"),
|
||||
Theme: q.theme(), Themes: Themes, Path: q.r.URL.RequestURI()}
|
||||
Theme: q.theme(), Themes: Themes, Path: q.r.URL.RequestURI(), Page: name}
|
||||
switch {
|
||||
case strings.HasPrefix(name, "online"):
|
||||
p.Tab = "online"
|
||||
|
||||
@@ -414,10 +414,11 @@ func TestThemes(t *testing.T) {
|
||||
has(t, th.Name+" topic", body, "Remember these?", "I do.", `class="quote"`, `name="answer"`)
|
||||
// each laid out its own way
|
||||
own := map[string][2][]string{
|
||||
"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"}},
|
||||
"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"`}},
|
||||
"phpbb1": {{"Author</td>", "Posted:", "Reply to:", "Logout</button></form>]"}, {"Our users have posted a total of", "You are not logged in.", "= New Posts since your last visit."}},
|
||||
"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/")
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
/*
|
||||
* The forum's dark theme: laid out in the manner of the PHP boards of
|
||||
* 2001 (phpBB 1's default look and its kind): a black page, white
|
||||
* sans-serif text and teal links, a glowing italic logo, bracketed
|
||||
* menu links, tables with near-black lines and cells in alternating
|
||||
* grey and navy, small folder icons, posts between rules with little
|
||||
* labelled links beneath. Written for this BBS; it takes no code or
|
||||
* images from any board.
|
||||
*/
|
||||
|
||||
:root {
|
||||
--bg: #000000;
|
||||
--text: #ffffff;
|
||||
--color1: #6c706d;
|
||||
--color2: #2e4460;
|
||||
--line: #001100;
|
||||
--link: #11c6bd;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 8px 0 16px;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
font: 13px Arial, Helvetica, sans-serif;
|
||||
}
|
||||
a:link, a:visited, a:active { color: var(--link); }
|
||||
a:hover { color: #7ff0ea; }
|
||||
p { margin: 0; }
|
||||
form { margin: 0; }
|
||||
hr { border: 0; border-top: 1px solid #a8a8a8; border-bottom: 1px solid #3a3a3a; margin: 6px 0; }
|
||||
.small { font-size: 10px; }
|
||||
.desc { font-size: 11px; }
|
||||
.center { text-align: center; }
|
||||
|
||||
#wrap { width: 95%; margin: 0 auto; }
|
||||
|
||||
.inline-form { display: inline; }
|
||||
.linkish { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--link); text-decoration: underline; cursor: pointer; }
|
||||
|
||||
/* --- the header: a glowing logo, the title or the big buttons, the menu */
|
||||
|
||||
.header { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 4px 10px; padding: 5px 0; }
|
||||
.logo {
|
||||
display: flex; flex-direction: column; align-items: flex-start; justify-self: center;
|
||||
padding: 16px 30px 12px 18px;
|
||||
background: radial-gradient(ellipse 60% 26% at 45% 46%, rgba(255,255,255,0.55), rgba(255,255,255,0.12) 55%, transparent 75%);
|
||||
text-decoration: none !important;
|
||||
}
|
||||
.logo-name { color: #fff; font: italic 40px/1 "Times New Roman", Georgia, serif; text-shadow: 0 0 6px rgba(255,255,255,0.6); white-space: nowrap; }
|
||||
.logo-sub { margin: 6px 0 0 26px; color: #fff; font: bold 13px "Courier New", monospace; letter-spacing: 1px; }
|
||||
.headright { text-align: center; }
|
||||
.headtop { margin-bottom: 8px; }
|
||||
.sitename { font-size: 22px; }
|
||||
.posting { font-weight: bold; font-size: 14px; }
|
||||
.menu { font-size: 11px; line-height: 1.6; }
|
||||
|
||||
/* the big buttons: bold condensed white on a soft glow */
|
||||
.glow:link, .glow:visited {
|
||||
display: inline-block; margin: 0 6px; padding: 8px 26px;
|
||||
background: radial-gradient(ellipse 50% 40% at 50% 50%, rgba(255,255,255,0.35), rgba(255,255,255,0.08) 60%, transparent 80%);
|
||||
color: #fff; font: 26px/1 Impact, "Arial Narrow", "Helvetica Condensed", sans-serif; letter-spacing: 0; text-decoration: none;
|
||||
text-shadow: 0 0 4px rgba(255,255,255,0.5);
|
||||
}
|
||||
.glow:hover { color: #e8fffe; text-shadow: 0 0 8px rgba(17,198,189,0.9); }
|
||||
|
||||
.statsblock { margin: 0 0 8px; text-align: right; font-size: 11px; line-height: 1.4; }
|
||||
.crumbs { margin: 4px 0 8px; font-size: 11px; }
|
||||
.crumbs .fname { font-size: 13px; }
|
||||
.notice { margin: 6px 0; font-size: 12px; text-align: center; font-weight: bold; }
|
||||
.pagebar { margin: 4px 0 6px; font-size: 14px; }
|
||||
.gotopage { font-size: 13px; }
|
||||
|
||||
/* --- tables with near-black lines */
|
||||
|
||||
.tbl { margin: 0 0 6px; background: var(--line); padding: 1px; }
|
||||
.tbl table { width: 100%; border-collapse: separate; border-spacing: 1px; }
|
||||
.tbl td { padding: 3px; vertical-align: top; }
|
||||
td.c1, tr.c1row > td { background: var(--color1); }
|
||||
td.c2, tr.c2row > td { background: var(--color2); }
|
||||
tr.head td { font-size: 11px; font-weight: bold; vertical-align: middle; }
|
||||
td.cat { font-size: 13px; }
|
||||
td.icon { width: 3%; text-align: center; vertical-align: middle; }
|
||||
td.num { width: 7%; text-align: center; vertical-align: middle; }
|
||||
td.last { width: 17%; text-align: center; vertical-align: middle; }
|
||||
.narrowtbl { max-width: 560px; margin-left: auto; margin-right: auto; }
|
||||
td.key { width: 30%; font-weight: bold; }
|
||||
|
||||
/* a folder: yellow, pink when new, with dots when hot */
|
||||
.folder {
|
||||
display: inline-block; position: relative; width: 11px; height: 9px; margin-top: 4px; vertical-align: middle;
|
||||
border: 1px solid #5a4700; border-radius: 0 1px 1px 1px;
|
||||
background: linear-gradient(#ffe680, #d9a600);
|
||||
}
|
||||
.folder::before { content: ""; position: absolute; left: -1px; top: -4px; width: 5px; height: 3px; border: 1px solid #5a4700; border-bottom: 0; background: #ffe680; }
|
||||
.folder.new { border-color: #6b1010; background: linear-gradient(#ffb0b0, #e04848); }
|
||||
.folder.new::before { border-color: #6b1010; background: #ffb0b0; }
|
||||
.folder.hot::after { content: ""; position: absolute; left: 2px; top: 3px; width: 2px; height: 2px; background: #000; box-shadow: 3px 0 0 #000, 6px 0 0 #000; }
|
||||
|
||||
.legend { font-size: 11px; line-height: 1.8; }
|
||||
.legendrow { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
|
||||
.legendrow .right { text-align: right; font-size: 13px; }
|
||||
|
||||
/* --- a topic's posts */
|
||||
|
||||
td.author { width: 20%; }
|
||||
td.said { min-width: 0; }
|
||||
.posticon { display: inline-block; width: 12px; height: 9px; margin-right: 4px; vertical-align: -1px; border: 1px solid #ccc; background: linear-gradient(#fff, #9ab); }
|
||||
.postbody { font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
|
||||
.likes { margin-top: 6px; }
|
||||
.pbtns { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
|
||||
.pbtn:link, .pbtn:visited, button.pbtn {
|
||||
display: inline-flex; align-items: center; gap: 3px;
|
||||
background: none; border: 0; padding: 0; cursor: pointer;
|
||||
color: #fff; font: 10px Verdana, Arial, sans-serif; text-decoration: none;
|
||||
}
|
||||
.pbtn:hover { color: var(--link); }
|
||||
.ico { display: inline-block; width: 12px; height: 11px; border: 1px solid #ddd; background: #fff; }
|
||||
.ico.profile { background: linear-gradient(to bottom, #2a4fa8 0 3px, #fff 3px); }
|
||||
.ico.like { border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 15%, #f07a7a 45%, #b01010); border-color: #b01010; }
|
||||
.ico.edit { background: linear-gradient(45deg, transparent 40%, #e8b400 40% 60%, transparent 60%), #fff; }
|
||||
.ico.quote { background: linear-gradient(to bottom, #ffd34a, #c79300); border-color: #fff; }
|
||||
.pbtns .div { display: inline-block; width: 1px; height: 14px; background: #fff; }
|
||||
|
||||
/* quotes, as boards of the day showed them: "quote:" and a rule above and below */
|
||||
.citation { margin: 6px 0 0 20px; font-size: 11px; }
|
||||
.citation::before { content: "quote: "; }
|
||||
blockquote.quote { margin: 2px 20px 8px; padding: 3px 0; border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; font-size: 12px; }
|
||||
blockquote.quote:not(.citation + blockquote.quote)::before { content: "quote:"; display: block; font-size: 11px; margin-bottom: 2px; }
|
||||
|
||||
/* polls */
|
||||
td.poll { padding: 8px !important; }
|
||||
.pollresults { border-collapse: collapse; margin: 0 0 6px; }
|
||||
.pollresults td { padding: 2px 8px 2px 0 !important; background: none !important; }
|
||||
.pollresults td.bar { width: 200px; }
|
||||
meter { width: 100%; height: 10px; }
|
||||
meter::-webkit-meter-bar { background: #000; border: 1px solid #ccc; border-radius: 0; }
|
||||
meter::-webkit-meter-optimum-value { background: linear-gradient(#7ff0ea, #0b8a84); }
|
||||
meter::-moz-meter-bar { background: linear-gradient(#7ff0ea, #0b8a84); }
|
||||
.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: 13px Arial, sans-serif; color: #000; background: #fff; border: 2px inset #ddd; padding: 2px;
|
||||
}
|
||||
textarea { width: 100%; box-sizing: border-box; }
|
||||
.button, button.button, a.button:link, a.button:visited {
|
||||
display: inline-block; padding: 2px 8px; margin: 4px 2px;
|
||||
font: 13px Arial, sans-serif; color: #000; text-decoration: none; cursor: pointer;
|
||||
background: #d4d0c8; border: 2px outset #eee;
|
||||
}
|
||||
.button:active { border-style: inset; }
|
||||
.button.important { font-weight: bold; }
|
||||
.button.danger { color: #900; }
|
||||
|
||||
/* the default theme's pages that this one shows as they are */
|
||||
.box { margin: 0 0 8px; background: var(--line); padding: 1px; }
|
||||
.box > h2.maintitle { margin: 0 0 1px; padding: 3px; background: var(--color1); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; }
|
||||
.box .count { margin-left: auto; font-weight: normal; font-size: 11px; }
|
||||
.box-body { padding: 8px; background: var(--color2); }
|
||||
.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: 3px 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: 6px; }
|
||||
.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 8px; padding: 4px; text-align: center; font-weight: bold; }
|
||||
.message.error { color: #ff7070; }
|
||||
table.board { width: 100%; border-collapse: separate; border-spacing: 1px; }
|
||||
table.board th { padding: 3px; background: var(--color1); font-size: 11px; text-align: left; }
|
||||
table.board td { padding: 3px; background: var(--color2); vertical-align: top; }
|
||||
table.board tr:nth-child(even) td { background: var(--color1); }
|
||||
table.board h3 { margin: 0; font-size: 13px; }
|
||||
.snippet { 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 14px Arial, sans-serif;
|
||||
border: 1px solid #fff;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.avatar.tiny { width: 16px; height: 16px; font-size: 10px; }
|
||||
.avatar.mini { width: 22px; height: 22px; font-size: 12px; }
|
||||
.avatar.large { width: 50px; height: 50px; font-size: 26px; }
|
||||
.avatar.huge { width: 80px; height: 80px; font-size: 40px; }
|
||||
.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 */
|
||||
|
||||
.footbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; margin: 12px 0 6px; font-size: 11px; }
|
||||
.themepicker, .quicksearch { display: flex; align-items: center; gap: 4px; }
|
||||
.themepicker select, .quicksearch input { font-size: 11px; }
|
||||
.themepicker .button, .quicksearch .button { margin: 0; font-size: 11px; }
|
||||
.tail { text-align: center; font-size: 13px; line-height: 1.5; }
|
||||
|
||||
/* --- narrow screens */
|
||||
|
||||
@media (max-width: 760px) {
|
||||
.header { grid-template-columns: 1fr; }
|
||||
.logo-name { font-size: 30px; }
|
||||
.glow:link, .glow:visited { font-size: 20px; padding: 6px 12px; }
|
||||
.statsblock { text-align: left; }
|
||||
td.last, td.num:nth-child(3) { display: none; }
|
||||
td.author { width: 26%; }
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{{define "area.html"}}{{template "head" .}}
|
||||
{{$b := .Body}}
|
||||
{{if gt $b.Pages.Total 1}}<div class="pagebar">{{template "pages" $b.Pages}}</div>{{end}}
|
||||
<div class="tbl"><table>
|
||||
<tr class="head"><td class="c1 icon"> </td><td class="c1"> Topic</td><td class="c1 num">Replies</td><td class="c1 num"> Poster</td><td class="c1 last">Date</td></tr>
|
||||
{{range $b.Topics}}
|
||||
<tr>
|
||||
<td class="c1 icon"><span class="folder{{if .Unread}} new{{end}}{{if ge .Replies 15}} hot{{end}}" title="{{if .Unread}}New posts{{else}}No new posts{{end}}"></span></td>
|
||||
<td class="c2"> <a href="/forum/topic/{{.Root.ID}}">{{.Root.Subject}}</a>{{if gt .Pages 1}} <span class="small">(Goto page: {{$root := .Root.ID}}{{range (seq .Pages)}}<a href="/forum/topic/{{$root}}{{if gt . 1}}?page={{.}}{{end}}">{{.}}</a> {{end}})</span>{{end}}</td>
|
||||
<td class="c1 num">{{num .Replies}}</td>
|
||||
<td class="c2 num">{{.Root.From}}</td>
|
||||
<td class="c1 last small"><a href="/forum/post/{{.Last.ID}}">{{stamp .Last.Created}}</a><br>by {{.Last.From}}</td>
|
||||
</tr>
|
||||
{{else}}
|
||||
<tr><td colspan="5" class="c1 center">There are no topics for this forum. {{if $b.CanPost}}You can post one <a href="/forum/area/{{$b.Area.ID}}/new">here</a>.{{end}}</td></tr>
|
||||
{{end}}
|
||||
</table></div>
|
||||
<div class="legendrow">
|
||||
<div class="legend">
|
||||
<span class="folder new"></span> = New Posts since your last visit (<span class="folder new hot"></span> = More than 15 posts)<br>
|
||||
<span class="folder"></span> = No New Posts since your last visit (<span class="folder hot"></span> = More than 15 posts)
|
||||
</div>
|
||||
<div class="right">{{template "pages" $b.Pages}}{{if .User}}<br><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 topics read</button></form>{{end}}</div>
|
||||
</div>
|
||||
{{template "foot" .}}{{end}}
|
||||
@@ -0,0 +1,31 @@
|
||||
{{define "index.html"}}{{template "head" .}}
|
||||
{{$st := .Body.Stats}}
|
||||
<div class="statsblock">
|
||||
Our users have posted a total of -{{num $st.Posts}}- messages.<br>
|
||||
We have -{{num $st.Members}}- Registered Users.<br>
|
||||
{{with $st.Newest}}The newest Registered User is -<a href="/forum/user/{{path .Name}}">{{.Name}}</a>-.<br>{{end}}
|
||||
-{{len .Body.Online}}- {{if eq (len .Body.Online) 1}}user is{{else}}users are{{end}} <a href="/forum/online">currently browsing</a> the BBS.<br>
|
||||
<b>{{if .User}}You are logged in as {{.User.Name}}. <form method="post" action="/forum/logout" class="inline-form"><input type="hidden" name="csrf" value="{{.CSRF}}"><button class="linkish">Logout.</button></form>{{else}}You are not logged in. <a href="/forum/login">Login.</a>{{end}}</b>
|
||||
</div>
|
||||
<div class="tbl"><table>
|
||||
<tr class="head"><td class="c1 icon"> </td><td class="c1">Forum</td><td class="c1 num">Topics</td><td class="c1 num">Posts</td><td class="c1 last">Last Post</td></tr>
|
||||
{{range .Body.Categories}}
|
||||
<tr><td colspan="5" class="c1 cat"><b>{{.Name}}</b></td></tr>
|
||||
{{range $f := .Forums}}
|
||||
<tr>
|
||||
<td class="c1 icon"><span class="folder{{if $f.Unread}} new{{end}}" title="{{if $f.Unread}}New posts{{else}}No new posts{{end}}"></span></td>
|
||||
<td class="c2"><a href="/forum/area/{{$f.Area.ID}}">{{$f.Area.Name}}</a>{{if $f.Area.Description}}<br><span class="desc">{{$f.Area.Description}}</span>{{end}}</td>
|
||||
<td class="c1 num">{{num $f.Topics}}</td>
|
||||
<td class="c2 num">{{num $f.Area.Messages}}</td>
|
||||
<td class="c1 last small">{{with $f.Last}}<a href="/forum/post/{{.ID}}">{{stamp .Created}}</a><br>by {{.From}}{{else}}No Posts{{end}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
{{else}}
|
||||
<tr><td colspan="5" class="c2">There are no forums open to you yet.{{if not .User}} <a href="/forum/login">Login</a> to see more.{{end}}</td></tr>
|
||||
{{end}}
|
||||
</table></div>
|
||||
<div class="legend">
|
||||
<span class="folder new"></span> = New Posts since your last visit.<br>
|
||||
<span class="folder"></span> = No New Posts since your last visit.
|
||||
</div>
|
||||
{{template "foot" .}}{{end}}
|
||||
@@ -0,0 +1,41 @@
|
||||
{{define "head"}}<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{.BBS}} Forums - {{.Title}}</title>
|
||||
<link rel="stylesheet" href="/forum/static/phpbb1.css">
|
||||
</head>
|
||||
<body id="top">
|
||||
<div id="wrap">
|
||||
<div class="header">
|
||||
<a href="/forum/" class="logo"><span class="logo-name">{{.BBS}}</span><span class="logo-sub">The forums of a BBS</span></a>
|
||||
<div class="headright">
|
||||
<div class="headtop">
|
||||
{{if eq .Page "area.html"}}{{if .Body.CanPost}}<a href="/forum/area/{{.Body.Area.ID}}/new" class="glow">New Topic</a>{{else}}<span class="sitename">{{.Body.Area.Name}}</span>{{end}}
|
||||
{{else if eq .Page "topic.html"}}{{if .Body.CanPost}}<a href="/forum/area/{{.Body.Area.ID}}/new" class="glow">New Topic</a> <a href="#reply" class="glow">Reply</a>{{else}}<span class="sitename">{{.Body.Root.Subject}}</span>{{end}}
|
||||
{{else if eq .Page "post.html"}}<span class="posting">Post New Topic in:<br><a href="/forum/area/{{.Body.Area.ID}}">{{.Body.Area.Name}}</a></span>
|
||||
{{else}}<span class="sitename">{{.BBS}} Forums</span>{{end}}
|
||||
</div>
|
||||
<div class="menu">
|
||||
{{if not .User}}{{if .Register}}[<a href="/forum/register">Register</a>] {{end}}{{else}}[<a href="/forum/user/{{path .User.Name}}">Profile</a>] {{end}}[<a href="/forum/search">Search</a>] [<a href="/forum/online">Who's Online</a>]<br>
|
||||
{{if .Terminal}}[<a href="/terminal">Terminal</a>] {{end}}[{{if .User}}<form method="post" action="/forum/logout" class="inline-form"><input type="hidden" name="csrf" value="{{.CSRF}}"><button class="linkish">Logout</button></form>{{else}}<a href="/forum/login">Login</a>{{end}}]
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{if eq .Notice "welcome"}}<p class="notice">Welcome! Your account is made, and you are logged in.</p>{{end}}
|
||||
{{if .Crumbs}}<div class="crumbs">{{if eq .Page "area.html"}}<b class="fname">{{.Body.Area.Name}}</b><br>{{if .Body.Area.Description}}{{.Body.Area.Description}}<br>{{end}}{{end}}<a href="/forum/">{{.BBS}} Forum Index</a>{{range .Crumbs}} <b>»</b> {{if .URL}}<a href="{{.URL}}">{{.Name}}</a>{{else}}{{.Name}}{{end}}{{end}}</div>{{end}}
|
||||
{{end}}
|
||||
|
||||
{{define "foot"}}
|
||||
<div class="footbar">
|
||||
{{template "themepicker" .}}
|
||||
<form action="/forum/search" method="get" class="quicksearch"><input type="search" name="q" aria-label="Search"> <button class="button">Search</button></form>
|
||||
</div>
|
||||
<div class="tail">{{.BBS}} Forums · Powered by bbs-sec<br>{{longdate .Now}}</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
|
||||
{{define "pages"}}{{if gt .Total 1}}<span class="gotopage">Goto page ( {{if gt .Cur 1}}<a href="{{.URL .Prev}}" rel="prev">Previous Page</a> {{end}}{{$cur := .Cur}}{{$p := .}}{{range .Shown}}{{if eq . 0}}… {{else if eq . $cur}}<b>{{.}}</b> {{else}}<a href="{{$p.URL .}}">{{.}}</a> {{end}}{{end}}{{if .Next}}<a href="{{.URL .Next}}" rel="next">Next Page</a> {{end}})</span>{{end}}{{end}}
|
||||
@@ -0,0 +1,21 @@
|
||||
{{define "profile.html"}}{{template "head" .}}
|
||||
{{$u := .Body.U}}
|
||||
<div class="tbl narrowtbl"><table>
|
||||
<tr class="head"><td class="c1" colspan="2"><b>{{$u.Name}}'s Profile</b></td></tr>
|
||||
<tr><td class="c1 key">User Name:</td><td class="c2">{{template "avatar" (av $u.Name "mini")}} {{$u.Name}}</td></tr>
|
||||
<tr><td class="c1 key">Rank:</td><td class="c2">{{if $u.Sysop}}Administrator{{else}}{{group $u}}{{end}}</td></tr>
|
||||
<tr><td class="c1 key">Joined:</td><td class="c2">{{monthyear $u.Created}}</td></tr>
|
||||
<tr><td class="c1 key">Last visit:</td><td class="c2">{{stamp $u.LastLogin}}</td></tr>
|
||||
<tr><td class="c1 key">Posts:</td><td class="c2">{{num $u.Posts}}</td></tr>
|
||||
<tr><td class="c1 key">Calls:</td><td class="c2">{{num $u.Logins}}</td></tr>
|
||||
<tr><td class="c1 key">Location:</td><td class="c2">{{$u.Location}}</td></tr>
|
||||
<tr><td class="c1 key">Interests:</td><td class="c2">{{$u.About}}</td></tr>
|
||||
<tr><td class="c1 key">Online:</td><td class="c2">{{range .Body.On}}Node {{.Num}} by {{.Via}}: {{.Activity}}<br>{{else}}No{{end}}</td></tr>
|
||||
</table></div>
|
||||
<div class="tbl"><table>
|
||||
<tr class="head"><td class="c1">Topic</td><td class="c1 last">Date</td></tr>
|
||||
{{range .Body.Recent}}
|
||||
<tr><td class="c2"><a href="/forum/post/{{.ID}}">{{.Subject}}</a><br><span class="small">{{snippet .Body 140}}</span></td><td class="c1 last small">{{stamp .Created}}</td></tr>
|
||||
{{else}}<tr><td class="c2" colspan="2">No posts to show.</td></tr>{{end}}
|
||||
</table></div>
|
||||
{{template "foot" .}}{{end}}
|
||||
@@ -0,0 +1,68 @@
|
||||
{{define "topic.html"}}{{template "head" .}}
|
||||
{{$b := .Body}}{{$csrf := .CSRF}}{{$me := .User}}
|
||||
{{if gt $b.Pages.Total 1}}<div class="pagebar">{{template "pages" $b.Pages}}</div>{{end}}
|
||||
<div class="tbl"><table>
|
||||
<tr class="head"><td class="c1 author">Author</td><td class="c1">{{$b.Root.Subject}}</td></tr>
|
||||
{{with $b.Poll}}
|
||||
<tr class="c2row"><td class="poll" colspan="2">
|
||||
<b>Poll</b>
|
||||
<hr>
|
||||
{{if or .Voted (not $me)}}
|
||||
<table class="pollresults">{{range .Answers}}<tr><td>{{.Text}}{{if .Mine}} *{{end}}</td><td class="bar"><meter min="0" max="100" value="{{.Pct}}"></meter></td><td class="small">{{.Pct}}% [ {{.Count}} ]</td></tr>{{end}}</table>
|
||||
<p class="small">Total Votes: {{.Total}}{{if not $me}} · <a href="/forum/login">Login</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}}Submit vote{{end}}</button></div>
|
||||
</form>
|
||||
{{end}}
|
||||
</td></tr>
|
||||
{{end}}
|
||||
{{range $b.Posts}}
|
||||
<tr class="{{if odd .Num}}c2row{{else}}c1row{{end}}" id="entry{{.M.ID}}">
|
||||
<td class="author">
|
||||
<b>{{.M.From}}</b>
|
||||
{{if .Author}}<br><span class="small">{{if .Author.Sysop}}Administrator{{else}}{{group .Author}}{{end}}</span>
|
||||
<br><br><span class="small">Joined: {{monthyear .Author.Created}}<br>Posts: {{num .Author.Posts}}{{if .Author.Location}}<br>From: {{.Author.Location}}{{end}}</span>
|
||||
{{else if .Where}}<br><span class="small">From: {{.Where}}</span>{{end}}
|
||||
</td>
|
||||
<td class="said">
|
||||
<span class="small"><span class="posticon" aria-hidden="true"></span>Posted: {{stamp .M.Created}}{{if and .M.To (ne .M.To "All")}} To: {{.M.To}}{{end}} <a href="/forum/post/{{.M.ID}}">#{{.Num}}</a></span>
|
||||
<hr>
|
||||
<div class="postbody">{{body .M.Body}}</div>
|
||||
{{if .Likes}}<p class="small likes">{{plural .Likes "user likes" "users like"}} this post</p>{{end}}
|
||||
<hr>
|
||||
<div class="pbtns">
|
||||
{{if .Author}}<a href="/forum/user/{{path .Author.Name}}" class="pbtn"><span class="ico 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="pbtn"><span class="ico like" aria-hidden="true"></span>{{if .Liked}}unlike{{else}}like{{end}}</button></form>{{end}}
|
||||
<span class="div" aria-hidden="true"></span>
|
||||
{{if .CanDelete}}<form method="post" action="/forum/post/{{.M.ID}}/delete" class="inline-form"><input type="hidden" name="csrf" value="{{$csrf}}"><button class="pbtn"><span class="ico edit" aria-hidden="true"></span>delete</button></form>{{end}}
|
||||
{{if $b.CanPost}}<a href="/forum/topic/{{$b.Root.ID}}?quote={{.M.ID}}{{if gt $b.Pages.Cur 1}}&page={{$b.Pages.Cur}}{{end}}#reply" class="pbtn"><span class="ico quote" aria-hidden="true"></span>quote</a>{{end}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</table></div>
|
||||
<div class="legendrow">
|
||||
<div>{{if $b.CanPost}}<a href="/forum/area/{{$b.Area.ID}}/new" class="glow">New Topic</a> <a href="#reply" class="glow">Reply</a>{{end}}</div>
|
||||
<div class="right">{{template "pages" $b.Pages}}</div>
|
||||
</div>
|
||||
|
||||
{{if $b.CanPost}}
|
||||
<div class="tbl" id="reply"><table>
|
||||
<tr class="head"><td class="c1" colspan="2"><b>Reply to: {{$b.Root.Subject}}</b></td></tr>
|
||||
<tr class="c2row"><td class="author"><b>Message Body:</b><br><br><span class="small">Quote with > at the start of a line.<br>Links are made links.</span></td>
|
||||
<td><form method="post" action="/forum/topic/{{$b.Root.ID}}/reply">
|
||||
<input type="hidden" name="csrf" value="{{.CSRF}}">
|
||||
{{if $b.QuoteID}}<input type="hidden" name="reply_to" value="{{$b.QuoteID}}">{{end}}
|
||||
<textarea name="body" rows="10" required aria-label="Message body">{{$b.Quote}}</textarea>
|
||||
{{if $b.Aliases}}<br><label><input type="checkbox" name="alias"> Post as {{$me.Alias}}</label>{{end}}
|
||||
<div class="center"><button class="button">Submit</button></div>
|
||||
</form></td></tr>
|
||||
</table></div>
|
||||
{{else if not .User}}
|
||||
<p class="notice">You must be logged in to reply. <a href="/forum/login?back={{urlq (printf "/forum/topic/%d" $b.Root.ID)}}">Login</a>{{if .Register}} or <a href="/forum/register">Register</a>{{end}}.</p>
|
||||
{{end}}
|
||||
{{template "foot" .}}{{end}}
|
||||
Reference in new issue
Block a user