diff --git a/README.md b/README.md index 1616c4c..606782b 100644 --- a/README.md +++ b/README.md @@ -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 5, 4, 2 or 1, Ikonboard, vBulletin 6 back to 2 or Lite, Simple Machines Forum 3.0 back to 1, or phpBB 3.3 back to 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 5, 4, 2 or 1, Ikonboard, vBulletin 6 back to 2 or Lite, XenForo 2.3 back to 1, Simple Machines Forum 3.0 back to 1, or phpBB 3.3 back to 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 diff --git a/bbs.conf.sample b/bbs.conf.sample index 23d5428..a9bade0 100644 --- a/bbs.conf.sample +++ b/bbs.conf.sample @@ -217,8 +217,9 @@ address = 127.0.0.1:2513 ; IPB 2), ipb1 (retro, as IPB 1), ikon (grey, as Ikonboard 2), vb6 ; (clean, as vBulletin 6), vb5 (connect, as vBulletin 5), vb4 (steel, as ; vBulletin 4), vb3 (blue, as vBulletin 3), vb2 (purple, as vBulletin 2), -; vblite (lavender, as vBulletin Lite), smf30 (natural, as Simple -; Machines Forum 3.0), smf21 (simple, as SMF 2.1), smf20 (curve, as SMF +; vblite (lavender, as vBulletin Lite), xf23 (light, as XenForo 2.3), xf2 +; (xen, as XenForo 2), xf1 (classic, as XenForo 1), smf30 (natural, as +; Simple Machines Forum 3.0), smf21 (simple, as SMF 2.1), smf20 (curve, as SMF ; 2.0), smf1 (core, as SMF 1), phpbb33, phpbb32, phpbb31 and phpbb30 ; (prosilver, as phpBB 3.3, 3.2, 3.1 and 3.0), phpbb2 (silver, as phpBB 2) ; or phpbb1 (dark, as phpBB 1) diff --git a/docs/wiki/HTTP-API.md b/docs/wiki/HTTP-API.md index 3f220b0..c075bde 100644 --- a/docs/wiki/HTTP-API.md +++ b/docs/wiki/HTTP-API.md @@ -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`, `ipb5`, `ipb4`, `ipb2`, `ipb1`, `ikon`, `vb6`, `vb5`, `vb4`, `vb3`, `vb2`, `vblite`, `smf30`, `smf21`, `smf20`, `smf1`, `phpbb33`, `phpbb32`, `phpbb31`, `phpbb30`, `phpbb2` or `phpbb1`) | +| `forum`, `forum_guests`, `forum_theme` | `yes`, `yes`, `ipb3` | the [web forum](Web-Forum), guests reading it, and its theme (`ipb3`, `ipb5`, `ipb4`, `ipb2`, `ipb1`, `ikon`, `vb6`, `vb5`, `vb4`, `vb3`, `vb2`, `vblite`, `xf23`, `xf2`, `xf1`, `smf30`, `smf21`, `smf20`, `smf1`, `phpbb33`, `phpbb32`, `phpbb31`, `phpbb30`, `phpbb2` or `phpbb1`) | The OpenAPI 3.1 description is at `/api/v1/openapi.json`. diff --git a/docs/wiki/Home.md b/docs/wiki/Home.md index f6cf580..b86e7e7 100644 --- a/docs/wiki/Home.md +++ b/docs/wiki/Home.md @@ -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 5, 4, 2 or 1, Ikonboard, vBulletin 6 back to 2 or Lite, Simple Machines Forum 3.0 back to 1, or phpBB 3.3 back to 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 5, 4, 2 or 1, Ikonboard, vBulletin 6 back to 2 or Lite, XenForo 2.3 back to 1, Simple Machines Forum 3.0 back to 1, or phpBB 3.3 back to 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 diff --git a/docs/wiki/Web-Forum.md b/docs/wiki/Web-Forum.md index 6b63bd8..cb20fe2 100644 --- a/docs/wiki/Web-Forum.md +++ b/docs/wiki/Web-Forum.md @@ -85,6 +85,9 @@ On a post: | `vb3` | blue: a PHP board of 2004-2008 in the manner of vBulletin 3.5's default style: a white page in a grey one under the board's name, a breadcrumb box with the welcome (or a login form) beside it and a strip of blue menu buttons beneath, tables in a thin navy border with steel-blue gradient category bars and darker column heads, rows in two pale lavenders, the forum's last thread, poster and time in the *Last Post* column, *What's Going On?* with active users and statistics, each post a table of its own (date and *#N* above, the poster's name large with *Join Date* and *Posts* on the left, small *Quote* buttons beneath), *Quick Reply*, a deep blue foot with the theme chooser | | `vb2` | purple: a PHP board of 2001 in the manner of vBulletin 2.0: a white panel in a purple page, an oval logo over grey pill links, *Registered Members / Total Threads / Total Posts*, tables in a slate border with lilac headings and purple category bars in yellow, alternating greys, yellow *v* squares for new posts, *Last Post* in month-day-year with the time in grey, posts with *Junior Member*, *Registered* and *Posts* beside them and grey buttons beneath, *Currently Active Users*, a login row for guests | | `vblite` | lavender: a PHP board of 2000 in the manner of vBulletin Lite 1.0: a white page, a chrome italic logo beside five little icon links, navy table headings, rows in two lavenders, round bulbs for new posts, italic white *new thread* and *post reply* buttons, *Posted by:* with the date above it, *All dates are in Month-Day-Year format* | +| `xf23` | light: XenForo 2.3's refresh of 2.0-2.2 (the xf2 theme's pages): rounder corners, pill-shaped buttons, page links and reactions, round pictures, softer borders, and the dark variation when the reader's device asks for one | +| `xf2` | xen: a PHP board of 2017-2023 in the manner of XenForo 2's default style: a deep blue head, a lighter blue navigation bar whose chosen tab opens onto a pale row of section links, flat white blocks with blue-tinted heads, forums with comment icons that turn bright blue when unread and *Threads* / *Messages* stacked beside them, a side column with *Members online* and *Forum statistics*, an orange *Post thread* button, posts with the poster in a tinted cell and *Like* and *Reply* beneath, a dark foot | +| `xf1` | classic: a PHP board of 2010-2017 in the manner of XenForo 1's default style: a deep navy head, tabs opening onto a pale blue row of links, a breadcrumb of arrow-ended crumbs, blue gradient category strips, speech-bubble forum icons with *Discussions* and *Messages* beneath, *Members Online Now*, posts with the poster in a pale box whose arrow points at the message, *Discussion in '…' started by …*, a blue *Post New Thread* pill | | `smf30` | natural: Simple Machines Forum 3.0's refinement of 2.1 (the smf21 theme's pages): the top strip and the menu each on a soft blue-to-white band, a rounded breadcrumb, a deep slate foot, and a dark scheme in slate blues and warm orange when the reader's device asks for one | | `smf21` | simple: Simple Machines Forum 2.1's default look, grown out of Curve (the smf20 theme's pages): a white strip across the top with the member's name and a search box, a dark blue page edge, a bordered frame with the board's name in orange, orange pills for the current menu item, a boxed breadcrumb, flat steel-blue category bars, title bars edged in orange, posts as bordered boxes, small capital buttons in a row, a dark blue foot | | `smf20` | curve: a PHP board of 2011-2019 in the manner of Simple Machines Forum 2.0's Curve: a slate blue band fading to a pale page, a white rounded frame, *Hello* with the member's picture and the news beside it, rounded menu buttons, a breadcrumb with little arrows, rounded steel-blue category bars over rounded pale-blue blocks, orange board and poster names, *Posts / Topics* and *Last post by … in … on …*, an *Info Center*, posts with the poster's group, stars and post count on the left and *« Reply #1 on: … »* above, *Quick Reply* | @@ -101,7 +104,7 @@ they recall; no code or images are taken from them. `forum_theme` is the forum's; anyone (guests too) may choose another at the foot of every page, kept in a cookie (`bbs_forum_theme`) for a year. A theme lays out the board, topic lists, topics and profiles its own way, and shows the rest -(posting, searching, signing in) in its colors. A theme may build on another's templates (the phpBB 3.2 and 3.3 themes wear 3.1's, vBulletin 6's wears 5's, and SMF 3.0's and 2.1's wear Curve's, with stylesheets of their own). +(posting, searching, signing in) in its colors. A theme may build on another's templates (the phpBB 3.2 and 3.3 themes wear 3.1's, vBulletin 6's wears 5's, SMF 3.0's and 2.1's wear Curve's, and XenForo 2.3's wears 2's, with stylesheets of their own). ## Logins diff --git a/internal/forum/forum.go b/internal/forum/forum.go index 16908df..1f131aa 100644 --- a/internal/forum/forum.go +++ b/internal/forum/forum.go @@ -61,6 +61,9 @@ var Themes = []Theme{ {"vb3", "Blue (vBulletin 3 style)", ""}, {"vb2", "Purple (vBulletin 2 style)", ""}, {"vblite", "Lavender (vBulletin Lite style)", ""}, + {"xf23", "Light (XenForo 2.3 style)", "xf2"}, + {"xf2", "Xen (XenForo 2 style)", ""}, + {"xf1", "Classic (XenForo 1 style)", ""}, {"smf30", "Natural (SMF 3.0 style)", "smf21"}, {"smf21", "Simple (SMF 2.1 style)", "smf20"}, {"smf20", "Curve (SMF 2.0 style)", ""}, diff --git a/internal/forum/forum_test.go b/internal/forum/forum_test.go index 71eb119..32f49b7 100644 --- a/internal/forum/forum_test.go +++ b/internal/forum/forum_test.go @@ -420,6 +420,9 @@ func TestThemes(t *testing.T) { "phpbb1": {{"Author", "Posted:", "Reply to:", "Logout]"}, {"Our users have posted a total of", "You are not logged in.", "= New Posts since your last visit."}}, "ikon": {{"Log out", "Total Posts:", "Post a reply", `class="bottomline"`}, {"Guest: ", "Forum Info", "welcomes its newest member", "You must be logged in to view the post markers"}}, "ipb5": {{"Reply to this topic", `class="ipsEntry ipsBox`, "Go to topic listing", `class="ipsReact"`}, {"Who's Online", "Forum Statistics", "Sign Up", `class="ipsForumIcon`}}, + "xf1": {{"messageUserBlock", "Discussion in '", `id="QuickReply"`, "Post Reply"}, {"Members Online Now", "Forum Statistics", "Discussions:", "Log in or Sign up"}}, + "xf2": {{"message-cell--user", "Post reply", "Write your reply...", "/forum/static/xf2.css"}, {"Members online", "Forum statistics", "node-stats", "/forum/static/xf2.css"}}, + "xf23": {{"message-cell--user", "Post reply", "/forum/static/xf23.css"}, {"Members online", "node-stats", "/forum/static/xf23.css"}}, "smf1": {{"Author", "Quick Reply", "(Read ", "Reply #1 on:"}, {"Info Center", "Forum Stats", "Hello Guest", `class="board_icon`}}, "smf20": {{"Author Topic: ", "Quick Reply", `class="post_wrapper"`, "Reply #1 on:"}, {"Info Center", "Users Online", "Login with username and password", "/forum/static/smf20.css"}}, "smf21": {{"Author Topic: ", `class="post_wrapper"`, "/forum/static/smf21.css"}, {"Info Center", `id="top_info"`, "/forum/static/smf21.css"}}, diff --git a/internal/forum/static/xf1.css b/internal/forum/static/xf1.css new file mode 100644 index 0000000..79e23ee --- /dev/null +++ b/internal/forum/static/xf1.css @@ -0,0 +1,328 @@ +/* + * The forum's xen theme: laid out in the manner of the PHP boards of + * 2010-2017 (XenForo 1's default style and its kind): a deep navy head + * with the board's name, tabs that open onto a pale blue row of links, + * a breadcrumb of arrow-ended crumbs, a white page on a soft blue one, + * category strips in a blue gradient, forums with speech-bubble icons + * and their discussion and message counts beneath, a side column of + * soft blue boxes, posts with the poster in a pale box whose arrow + * points at the message, Like and Reply beneath, Trebuchet. Written + * for this BBS; it takes no code or images from any board. + */ + +:root { + --navy: #032a46; + --nav: #183e5b; + --tab-text: #c9e3f6; + --pale: #f0f7fc; + --pale2: #e1edf8; + --line: #d7edfc; + --line2: #a5cae4; + --link: #176093; + --text: #141414; + --muted: #969696; + --cat-a: #6cb2e4; + --cat-b: #176093; + --page: #eaf1f8; + --radius: 5px; +} + +* { box-sizing: border-box; } +body { margin: 0; background: var(--page); color: var(--text); font: 13px/1.4 "Trebuchet MS", Helvetica, Arial, sans-serif; } +a { color: var(--link); text-decoration: none; } +a:hover { text-decoration: underline; } +form { margin: 0; } +ol, ul { margin: 0; padding: 0; list-style: none; } +h1, h2, h3 { margin: 0; } +.muted, .small, .desc { color: var(--muted); } +.small, .desc { font-size: 11px; } +.inline-form { display: inline; } +.linkish { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--link); cursor: pointer; } +.linkish:hover { text-decoration: underline; } +.time { color: var(--muted); } +.pageWidth { max-width: 1200px; margin: 0 auto; padding: 0 10px; } + +/* --- the head */ +#header { background: var(--navy); } +#logoBlock { background: linear-gradient(#0a3c62, var(--navy)); } +#logo { padding: 16px 0 14px; } +#logo a { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; } +.logomark { position: relative; flex: none; width: 40px; height: 34px; border-radius: 8px; background: linear-gradient(#ffb02e, #e65c00); box-shadow: 0 1px 2px rgba(0,0,0,0.4); } +.logomark::before { content: ""; position: absolute; left: 9px; top: 8px; width: 22px; height: 14px; border-radius: 4px; background: #fff; } +.logomark::after { content: ""; position: absolute; left: 12px; top: 21px; border: 5px solid transparent; border-top-color: #fff; border-left-color: #fff; } +.logotext { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 600px; font: bold 26px "Trebuchet MS", Helvetica, sans-serif; letter-spacing: -0.5px; text-shadow: 0 1px 2px rgba(0,0,0,0.5); } +#navigation { position: relative; } +#navigation nav { position: relative; display: flex; align-items: flex-start; min-height: 64px; } +.navTabs { display: flex; flex-wrap: wrap; flex: 1; gap: 2px; align-items: flex-start; } +.navTab > .navLink, .navTab > form .navLink { display: block; padding: 7px 14px 8px; border-radius: 5px 5px 0 0; color: var(--tab-text); font: bold 13px "Trebuchet MS", sans-serif; text-shadow: 0 0 1px rgba(0,0,0,0.6); } +.navTab > .navLink:hover, .navTab > form .navLink:hover { background: var(--nav); color: #fff; text-decoration: none; } +.navTab.selected > .navLink { background: var(--pale2); color: var(--nav); text-shadow: none; } +.navTab.account { margin-left: auto; } +.navTab.account .navLink { display: inline-flex; align-items: center; gap: 6px; } +.tabLinks { display: none; } +.navTab.selected .tabLinks { display: block; position: absolute; left: -10px; right: -10px; top: 34px; height: 30px; padding: 0 20px; background: var(--pale2); border-bottom: 1px solid var(--line2); } +.tabLinks ul { display: flex; gap: 0; } +.tabLinks a { display: block; padding: 6px 10px; font-size: 12px; } +#QuickSearch { position: absolute; right: 0; top: 4px; } +#QuickSearch input { width: 180px; padding: 4px 8px; border: 1px solid #0a2a43; border-radius: 4px; background: #fff; font: 12px "Trebuchet MS", sans-serif; } +.navTabs { padding-right: 190px; } + +/* --- the page */ +#content { margin-top: 0; } +#content > .pageContent { display: grid; grid-template-columns: minmax(0, 1fr) 250px; column-gap: 14px; align-content: start; padding: 10px 14px 14px; background: #fff; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); } +#content > .pageContent > * { grid-column: 1 / -1; } +#content > .pageContent > .mainContainer { grid-column: 1; } +#content > .pageContent > .sidebar { grid-column: 2; grid-row: span 3; } +.importantMessage { margin: 8px 0; padding: 8px 12px; border: 1px solid #f9bc6d; border-radius: var(--radius); background: #fff4e5; } + +/* the breadcrumb: crumbs with arrowed ends */ +.breadBoxTop { margin: 4px 0 10px; } +.breadcrumb { margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--pale); overflow: hidden; } +.crumbs { display: flex; flex-wrap: wrap; } +.crust { position: relative; display: inline-flex; align-items: center; } +.crumb { display: block; padding: 0 24px 0 16px; line-height: 26px; color: var(--link); font-size: 12px; } +.crust:first-child .crumb { padding-left: 10px; } +.crumb:hover { background: #fff; text-decoration: none; } +.crust .arrow { position: absolute; right: -6px; top: 3px; width: 20px; height: 20px; border-top: 1px solid var(--line2); border-right: 1px solid var(--line2); transform: rotate(45deg); background: var(--pale); z-index: 1; overflow: hidden; } +.crust .arrow span { display: none; } +.crust + .crust .crumb { padding-left: 14px; } +.breadBoxTop:last-child { margin: 14px 0 0; } + +.titleBar { display: flow-root; margin: 0 0 10px; } +.titleBar h1 { color: #2b485c; font: 20px "Trebuchet MS", sans-serif; overflow-wrap: anywhere; } +#pageDescription { margin: 2px 0 0; font-size: 11px; } +.topCtrl { float: right; margin: 0 0 4px 10px; } + +/* the call to action: a bright pill */ +a.callToAction, .button { display: inline-block; text-decoration: none; } +a.callToAction span { display: inline-block; padding: 4px 14px; border-radius: 6px; border: 1px solid #176093; background: linear-gradient(#a5cae4, #2b85c4 60%, #176093); color: #fff; font: bold 13px "Trebuchet MS", sans-serif; text-shadow: 0 0 1px rgba(0,0,0,0.5); box-shadow: 0 1px 2px rgba(0,0,0,0.2); } +a.callToAction:hover span { background: linear-gradient(#c3dcef, #3d97d6 60%, #2271a8); } +.button, button.button { padding: 3px 12px; border: 1px solid var(--line2); border-radius: 7px; background: linear-gradient(#fff, var(--pale2)); color: #2b485c; font: bold 12px "Trebuchet MS", sans-serif; cursor: pointer; box-shadow: 0 1px 1px rgba(0,0,0,0.1); } +.button.primary, button.button.primary, .button.important { border-color: #176093; background: linear-gradient(#6cb2e4, #176093); color: #fff; } +.button:hover { border-color: #176093; } + +/* pages */ +.pageNavLinkGroup { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; font-size: 11px; } +.pageNavLinkGroup > .PageNav:only-child { margin-left: auto; } +.PageNav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; } +.pageNavHeader { margin-right: 4px; color: var(--muted); } +.PageNav nav { display: flex; gap: 2px; } +.PageNav a { min-width: 22px; padding: 1px 6px; border: 1px solid var(--line2); border-radius: 4px; background: var(--pale); text-align: center; } +.PageNav a.currentPage { background: #fff; border-color: var(--link); color: var(--text); font-weight: bold; } +.PageNav a.text { border: 0; background: none; } + +/* --- the forum list */ +.nodeList .category { margin-bottom: 12px; } +.categoryStrip { padding: 6px 10px; border-radius: var(--radius); background: linear-gradient(var(--cat-a), var(--cat-b)); } +.categoryStrip .nodeTitle { color: #fff; font: bold 12px "Trebuchet MS", sans-serif; text-shadow: 0 0 1px rgba(0,0,0,0.5); } +.forumNodeInfo { display: grid; grid-template-columns: 44px minmax(0, 1fr) 230px; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); } +.nodeIcon { position: relative; display: inline-block; width: 36px; height: 32px; } +.nodeIcon::before { content: ""; position: absolute; left: 0; top: 2px; width: 26px; height: 18px; border-radius: 6px; background: linear-gradient(#e8edf2, #b8c4cf); box-shadow: inset 0 0 0 1px #94a3b2; } +.nodeIcon::after { content: ""; position: absolute; left: 10px; top: 10px; width: 26px; height: 18px; border-radius: 6px; background: linear-gradient(#f4f6f8, #c8d2db); box-shadow: inset 0 0 0 1px #94a3b2; } +.unread .nodeIcon::before { background: linear-gradient(#bfe1fa, #5aa5dd); box-shadow: inset 0 0 0 1px #2b85c4; } +.unread .nodeIcon::after { background: linear-gradient(#d5ecfc, #6cb2e4); box-shadow: inset 0 0 0 1px #2b85c4; } +.nodeTitle { font: bold 13px "Trebuchet MS", sans-serif; } +.unread .nodeTitle a { font-weight: bold; } +.nodeDescription { margin: 2px 0 0; color: #646464; font-size: 11px; } +.nodeStats { display: flex; gap: 10px; margin-top: 3px; color: var(--muted); font-size: 11px; } +.nodeStats dl, .nodeStats dt, .nodeStats dd { display: inline; margin: 0; } +.nodeStats dd { color: var(--text); } +.nodeLastPost { padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--pale); font-size: 11px; line-height: 1.5; overflow: hidden; } +.nodeLastPost span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.lastThreadTitle > span { display: inline !important; color: var(--muted); } +.username { font-weight: bold; } + +/* the side column */ +.sidebar .section { margin-bottom: 10px; } +.sidebar .secondaryContent { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(#fff, var(--pale) 60px); } +.sidebar .loginButton .secondaryContent { text-align: center; background: var(--pale); } +.sidebar h3 { margin: 0 0 6px; padding-bottom: 3px; border-bottom: 1px solid var(--line); color: var(--cat-b); font: bold 13px "Trebuchet MS", sans-serif; } +.listInline { display: flex; flex-wrap: wrap; gap: 3px; font-size: 12px; } +.footnote { margin-top: 6px; padding-top: 4px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; } +.statsList dl { display: flex; justify-content: space-between; margin: 2px 0; font-size: 12px; } +.statsList dt { color: var(--muted); } +.statsList dd { margin: 0; } + +/* --- the thread list */ +.discussionList { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; } +.sectionHeaders { display: grid; grid-template-columns: 50px minmax(0, 1fr) 90px 160px; gap: 8px; margin: 0; padding: 4px 10px; background: linear-gradient(var(--pale), var(--pale2)); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; } +.sectionHeaders dd { margin: 0; } +.sectionHeaders .stats { text-align: center; } +.sectionHeaders .postDate { margin-left: 8px; } +.discussionListItem { display: grid; grid-template-columns: 50px minmax(0, 1fr) 90px 160px; gap: 8px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line); background: #fff; } +.discussionListItem:nth-child(even) { background: #fcfdfe; } +.discussionListItem .title { font: 13px "Trebuchet MS", sans-serif; } +.discussionListItem.unread .title a:last-of-type { font-weight: bold; } +.unreadLink { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--cat-a); box-shadow: 0 0 0 1px var(--cat-b); vertical-align: 1px; } +.prefix.hot { display: inline-block; padding: 0 6px; border-radius: 4px; background: #fbe3cf; color: #b35100; font-size: 10px; font-weight: bold; vertical-align: 1px; } +.secondRow { font-size: 11px; } +.itemPageNav a { margin-left: 3px; padding: 0 4px; border: 1px solid var(--line2); border-radius: 3px; background: var(--pale); font-size: 10px; } +.listBlock.stats { font-size: 11px; text-align: center; } +.listBlock.stats dl, .listBlock.stats dd { margin: 0; display: inline; } +.listBlock.stats dt { color: var(--muted); } +.lastPostInfo { margin: 0; font-size: 11px; text-align: right; } +.lastPostInfo dd { margin: 0; } +.sectionFooter { padding: 4px 10px; background: var(--pale); color: var(--muted); font-size: 11px; } +.noThreads { padding: 14px; text-align: center; color: var(--muted); } + +/* --- messages */ +.messageList { margin: 0 0 10px; } +.message { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); } +.messageUserBlock { position: relative; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(var(--pale2), var(--pale) 70px); text-align: center; } +.messageUserBlock .arrow { position: absolute; right: -10px; top: 18px; width: 0; height: 0; border: 10px solid transparent; border-right: 0; border-left-color: var(--line); } +.messageUserBlock .arrow span { position: absolute; left: -11px; top: -9px; border: 9px solid transparent; border-right: 0; border-left-color: var(--pale2); } +.avatarHolder { padding: 4px; border: 1px solid var(--line); border-radius: 4px; background: #fff; display: inline-block; } +.userText { margin-top: 6px; font: 12px "Trebuchet MS", sans-serif; } +.userText .username { display: block; font-size: 13px; overflow-wrap: anywhere; } +.userTitle { display: block; color: #646464; font-size: 11px; font-style: normal; } +.userBanner { position: relative; display: block; margin: 4px -11px 0; padding: 1px 6px; border-radius: 3px; background: linear-gradient(#8aa8c4, #2b485c); color: #fff; font: bold 11px "Trebuchet MS", sans-serif; font-style: normal; box-shadow: 0 1px 2px rgba(0,0,0,0.3); } +.userBanner .before, .userBanner .after { display: none; } +.extraUserInfo { margin-top: 6px; padding-top: 4px; border-top: 1px solid var(--line); font-size: 11px; text-align: left; } +.extraUserInfo dl { display: flex; justify-content: space-between; gap: 4px; margin: 1px 0; } +.extraUserInfo dt { color: var(--muted); } +.extraUserInfo dd { margin: 0; overflow-wrap: anywhere; } +.messageInfo { display: flex; flex-direction: column; min-width: 0; } +.messageContent { flex: 1; } +.messageText { margin: 0; padding: 4px 0 10px; font: 13px/1.5 "Trebuchet MS", Helvetica, sans-serif; overflow-wrap: anywhere; } +.messageMeta { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 4px; font-size: 11px; } +.privateControls, .publicControls { display: flex; gap: 10px; align-items: center; } +.publicControls .item, .privateControls .item { font-size: 11px; } +.control.like::before { content: "\2665 "; } +.control.reply::before { content: "\21B5 "; } +.likesSummary { margin-top: 6px; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--pale); font-size: 11px; } +.LikeText::before { content: "\2665 "; color: #d9534f; } + +/* quotes, as XenForo 1 set them */ +.citation { margin: 6px 0 0; padding: 4px 8px; border: 1px solid var(--line2); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: var(--pale2); color: #2b485c; font-size: 11px; font-weight: bold; } +blockquote.quote { margin: 0 0 10px; padding: 6px 10px; border: 1px solid var(--line2); border-radius: 0 0 var(--radius) var(--radius); background: var(--pale); font-size: 12px; } +blockquote.quote:not(.citation + blockquote.quote) { margin-top: 6px; border-radius: var(--radius); } +.bbc_url { text-decoration: underline; } + +/* polls */ +.PollContainer { margin-bottom: 10px; } +.pollBlock .secondaryContent { position: relative; padding: 10px 14px 10px 54px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(#fff, var(--pale)); } +.questionMark { position: absolute; left: 12px; top: 8px; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(var(--cat-a), var(--cat-b)); color: #fff; font: bold 20px/30px "Trebuchet MS", sans-serif; text-align: center; } +.question { margin-bottom: 8px; color: #2b485c; font: 15px "Trebuchet MS", sans-serif; } +.pollResult { display: grid; grid-template-columns: minmax(0, 35%) 1fr 70px 40px; gap: 8px; align-items: center; margin: 4px 0; font-size: 12px; } +.optionText { font: 12px "Trebuchet MS", sans-serif; } +.pollResult.voted .optionText { font-weight: bold; } +meter { width: 100%; height: 12px; } +meter::-webkit-meter-bar { background: #fff; border: 1px solid var(--line2); border-radius: 6px; } +meter::-webkit-meter-optimum-value { background: linear-gradient(var(--cat-a), var(--cat-b)); border-radius: 6px; } +meter::-moz-meter-bar { background: var(--cat-b); } +.pollNotes { margin: 6px 0 0; font-size: 11px; } +.pollVote { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); } + +/* the quick reply */ +.quickReply { border-bottom: 0; } +.quickReply .messageInfo { gap: 6px; } +.textCtrl, input[type=text], input[type=password], input[type=email], input[type=search], select, textarea { padding: 4px 6px; border: 1px solid #c8c8c8; border-radius: 4px; background: #fff; color: var(--text); font: 13px "Trebuchet MS", Helvetica, sans-serif; } +textarea { width: 100%; } +textarea:focus, input:focus { border-color: var(--line2); background: #fffff0; outline: none; } +.submitUnit { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; } + +/* the profile */ +.profilePage { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; } +.mast .avatarScaler { padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-align: center; } +.infoBlock { margin-top: 10px; } +.infoBlock .secondaryContent { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--pale); font-size: 12px; } +.infoBlock dl { display: flex; justify-content: space-between; gap: 6px; margin: 2px 0; } +.infoBlock dt { color: var(--muted); } +.infoBlock dd { margin: 0; } +.primaryUserBlock .mainText { padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; background: linear-gradient(#fff, var(--pale)); } +.primaryUserBlock h1.username { color: #2b485c; font: bold 22px "Trebuchet MS", sans-serif; } +.userBlurb { margin: 2px 0; color: #646464; } +.primaryUserBlock .userBanner { display: inline-block; margin: 4px 0; } +.lastActivity { margin: 6px 0 0; font-size: 11px; color: var(--muted); } +.lastActivity dt, .lastActivity dd { display: inline; margin: 0; } +.tabs { display: flex; gap: 2px; padding: 0 10px; border: 1px solid var(--line); border-top: 0; background: var(--pale2); } +.tabs a { display: block; padding: 5px 12px; font-size: 12px; } +.tabs .active a { background: #fff; color: var(--text); font-weight: bold; } +.recentActivity li { display: flex; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); } +.recentActivity .description { font: 12px "Trebuchet MS", sans-serif; } +.recentActivity .snippet { margin: 3px 0; padding-left: 8px; border-left: 2px solid var(--line); font-size: 12px; } +.recentActivity abbr { font-size: 11px; } +.aboutText { margin-top: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--pale); } +.aboutText h3 { color: var(--cat-b); font-size: 13px; } + +/* --- the default theme's pages that this one shows as they are */ +.box { margin: 0 0 10px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; } +.box > h2.maintitle { display: flex; gap: 8px; margin: 0; padding: 6px 10px; background: linear-gradient(var(--cat-a), var(--cat-b)); color: #fff; font: bold 13px "Trebuchet MS", sans-serif; } +.box .count { margin-left: auto; font-weight: normal; } +.box-body { padding: 10px; background: var(--pale); } +.box.narrow { max-width: 560px; 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; font-weight: bold; } +.searchform { display: flex; gap: 6px; } +.searchform input { flex: 1; } +.message.error { color: #c00; font-weight: bold; display: block; } +p.message { display: block; padding: 8px 12px; border: 1px solid var(--line2); border-radius: var(--radius); background: var(--pale); } +table.board { width: 100%; border-collapse: collapse; } +table.board th { padding: 4px 10px; background: linear-gradient(var(--pale), var(--pale2)); color: var(--muted); font-size: 11px; font-weight: normal; text-align: left; } +table.board td { padding: 7px 10px; border-top: 1px solid var(--line); vertical-align: top; } +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; flex: none; color: #fff; font: bold 14px "Trebuchet MS", sans-serif; vertical-align: middle; } +.avatar.tiny { width: 18px; height: 18px; font-size: 10px; border-radius: 2px; } +.avatar.mini { width: 24px; height: 24px; font-size: 12px; } +.avatar.small { width: 36px; height: 36px; font-size: 16px; border-radius: 3px; } +.avatar.large { width: 96px; height: 96px; font-size: 44px; } +.avatar.huge { width: 192px; height: 192px; font-size: 90px; } +.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 */ +footer { margin-top: 14px; } +.footer .pageContent { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 12px; border-radius: var(--radius) var(--radius) 0 0; background: var(--nav); } +.footerLinks { display: flex; flex-wrap: wrap; gap: 14px; } +.footerLinks a, .footer .themepicker { color: var(--tab-text); font-size: 12px; } +.footerLegal .pageContent { display: flex; justify-content: space-between; gap: 10px; padding: 6px 12px 20px; color: var(--muted); font-size: 11px; } +.themepicker { display: inline-flex; align-items: center; gap: 4px; } +.themepicker select { padding: 2px 4px; font-size: 11px; } +.themepicker .button { padding: 1px 8px; font-size: 11px; } + +/* --- narrow screens */ +@media (max-width: 860px) { + #content > .pageContent { grid-template-columns: minmax(0, 1fr); } + #content > .pageContent > .sidebar { grid-column: 1; grid-row: auto; } +} +@media (max-width: 760px) { + .pageWidth { padding: 0; } + #logo { padding: 10px 10px; } + .logotext { font-size: 20px; max-width: 260px; } + #navigation nav { flex-direction: column; min-height: 0; padding-bottom: 36px; } + .navTab.account { margin: 0; } + .navTabs { padding-right: 6px; } + #QuickSearch { position: static; padding: 4px 10px; } + #QuickSearch input { width: 100%; } + .navTab.selected .tabLinks { top: auto; bottom: 0; left: 0; right: 0; position: absolute; } + .navTabs { padding: 0 6px; } + #content > .pageContent { padding: 8px; border-radius: 0; } + .forumNodeInfo { grid-template-columns: 40px minmax(0, 1fr); } + .nodeLastPost { grid-column: 1 / -1; } + .sectionHeaders { display: none; } + .discussionListItem { grid-template-columns: 40px minmax(0, 1fr); } + .discussionListItem .stats, .discussionListItem .lastPost { display: none; } + .message { grid-template-columns: 1fr; gap: 6px; } + .messageUserBlock { display: flex; align-items: center; gap: 10px; text-align: left; } + .messageUserBlock .arrow { display: none; } + .messageUserBlock .avatar.large { width: 40px; height: 40px; font-size: 18px; } + .avatarHolder { padding: 2px; } + .userText { margin: 0; } + .extraUserInfo { display: none; } + .userBanner { margin: 2px 0 0; display: inline-block; } + .profilePage { grid-template-columns: 1fr; } + .mast .avatar.huge { width: 96px; height: 96px; font-size: 44px; } + .pollResult { grid-template-columns: 1fr 1fr; } + .field { grid-template-columns: 1fr; } +} diff --git a/internal/forum/static/xf2.css b/internal/forum/static/xf2.css new file mode 100644 index 0000000..886e821 --- /dev/null +++ b/internal/forum/static/xf2.css @@ -0,0 +1,351 @@ +/* + * The forum's xen theme, second generation: laid out in the manner of + * the PHP boards of 2017-2023 (XenForo 2's default style and its kind): + * a deep blue head with the board's name, a lighter blue navigation bar + * whose chosen tab opens onto a pale row of section links, flat white + * blocks with blue-tinted heads, forums with comment icons that turn + * bright blue when unread and their thread and message counts stacked, + * a side column, threads with the starter's picture, posts with the + * poster's picture and title in a tinted cell beside them, an orange + * button for a new thread, Like and Reply beneath posts, a dark foot. + * Written for this BBS; it takes no code or images from any board. + */ + +:root { + --header: #185886; + --nav: #2577b1; + --nav-text: #e1edf8; + --section: #e4eef7; + --body: #fafafa; + --block: #ffffff; + --border: #d8d8d8; + --line: #e7e7e7; + --head-bg: #edf6fd; + --feature: #2577b1; + --feature-dark: #185886; + --link: #2577b1; + --text: #141414; + --muted: #8c8c8c; + --soft: #f5f9fd; + --unread: #47a7eb; + --cta: #e37400; + --cta-dark: #c25f00; + --footer: #183354; + --footer-text: #c5d4e4; + --radius: 4px; + --font: "Segoe UI", "Helvetica Neue", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", sans-serif; +} + +* { box-sizing: border-box; } +body { margin: 0; background: var(--body); color: var(--text); font: 15px/1.4 var(--font); } +a { color: var(--link); text-decoration: none; } +a:hover { text-decoration: underline; } +form { margin: 0; } +ul, ol { margin: 0; padding: 0; list-style: none; } +h1, h2, h3, h4, h5 { margin: 0; font-weight: normal; } +.u-muted, .muted, .small, .desc { color: var(--muted); } +.small, .desc { font-size: 13px; } +.u-concealed, .u-concealed a { color: inherit; } +.u-srOnly { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } +.inline-form { display: inline; } +.linkish { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--link); cursor: pointer; } +.linkish:hover { text-decoration: underline; } +.time { color: var(--muted); } +.username { font-weight: bold; } + +/* little pictures drawn with CSS */ +.ic { position: relative; display: inline-block; width: 1em; height: 1em; vertical-align: -0.13em; } +.ic-search::before { content: ""; position: absolute; left: 0; top: 0; width: 65%; height: 65%; border: 2px solid currentColor; border-radius: 50%; box-sizing: border-box; } +.ic-search::after { content: ""; position: absolute; right: 2%; bottom: 8%; width: 40%; height: 2px; background: currentColor; transform: rotate(45deg); transform-origin: right; } +.ic-comments::before { content: ""; position: absolute; left: 0; top: 4%; width: 70%; height: 52%; border-radius: 30%; background: currentColor; opacity: 0.55; } +.ic-comments::after { content: ""; position: absolute; right: 0; bottom: 6%; width: 72%; height: 54%; border-radius: 30%; background: currentColor; } +.ic-pen::before { content: ""; position: absolute; left: 40%; top: -8%; width: 24%; height: 100%; border: 2px solid currentColor; border-radius: 1px 1px 0 0; transform: rotate(45deg); box-sizing: border-box; } +.ic-user::before { content: ""; position: absolute; left: 28%; top: 2%; width: 44%; height: 44%; border-radius: 50%; background: currentColor; } +.ic-user::after { content: ""; position: absolute; left: 8%; right: 8%; bottom: 2%; height: 40%; border-radius: 50% 50% 0 0; background: currentColor; } +.ic-clock::before { content: ""; position: absolute; inset: 4%; border: 2px solid currentColor; border-radius: 50%; } +.ic-clock::after { content: ""; position: absolute; left: 46%; top: 22%; width: 26%; height: 32%; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; } +.ic-share::before { content: ""; position: absolute; inset: 12%; border: 2px solid currentColor; border-radius: 2px; border-top-color: transparent; border-right-color: transparent; } +.ic-share::after { content: ""; position: absolute; right: 4%; top: 4%; width: 45%; height: 45%; border-top: 2px solid currentColor; border-right: 2px solid currentColor; } +.ic-reply::before { content: ""; position: absolute; left: 30%; top: 30%; width: 62%; height: 50%; border-top: 2px solid currentColor; border-right: 2px solid currentColor; border-radius: 0 60% 0 0; } +.ic-reply::after { content: ""; position: absolute; left: 8%; top: 14%; width: 34%; height: 34%; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); } +.ic-check::before { content: ""; position: absolute; left: 30%; top: 4%; width: 35%; height: 70%; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); } +.ic-up::before { content: ""; position: absolute; left: 25%; top: 35%; width: 45%; height: 45%; border-left: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); } +.reaction-sprite { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: #2577b1; position: relative; vertical-align: -3px; } +.reaction-sprite::after { content: ""; position: absolute; left: 4px; top: 4px; width: 8px; height: 7px; background: #fff; clip-path: polygon(0 40%, 30% 40%, 30% 100%, 0 100%, 0 40%, 38% 40%, 58% 0, 70% 10%, 64% 40%, 100% 40%, 92% 100%, 38% 100%); } + +/* --- the head */ +.p-header { background: var(--header); color: #fff; } +.p-header-inner, .p-nav-inner, .p-sectionLinks-inner, .p-body-inner, .p-footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 10px; } +.p-header-content { padding: 14px 0; } +.p-header-logo a { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; } +.p-logo-mark { position: relative; flex: none; width: 36px; height: 36px; border-radius: 8px; background: linear-gradient(135deg, #ffb04a, var(--cta)); } +.p-logo-mark::before { content: ""; position: absolute; left: 8px; top: 9px; width: 20px; height: 13px; border-radius: 4px; background: #fff; } +.p-logo-mark::after { content: ""; position: absolute; left: 11px; top: 21px; border: 5px solid transparent; border-top-color: #fff; border-left-color: #fff; } +.p-logo-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 600px; font: 600 26px var(--font); letter-spacing: -0.01em; } +.p-nav { background: var(--nav); color: var(--nav-text); } +.p-nav-inner { display: flex; align-items: flex-end; gap: 8px; min-height: 42px; } +.p-nav-scroller { flex: 1; min-width: 0; } +.p-nav-list { display: flex; flex-wrap: wrap; gap: 2px; padding-top: 6px; } +.p-navEl-link { display: block; padding: 7px 14px 8px; border-radius: var(--radius) var(--radius) 0 0; color: var(--nav-text); font-weight: 600; } +.p-navEl-link:hover { background: rgba(255,255,255,0.12); color: #fff; text-decoration: none; } +.p-navEl.is-selected .p-navEl-link { background: var(--section); color: var(--feature-dark); } +.p-nav-opposite { align-self: center; } +.p-navgroup { display: flex; align-items: center; gap: 0; border-radius: var(--radius); background: rgba(0,0,0,0.12); } +.p-navgroup-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; color: var(--nav-text); font-size: 14px; } +.p-navgroup-link + .p-navgroup-link, .p-navgroup > form { border-left: 1px solid rgba(255,255,255,0.15); } +.p-navgroup-link:hover { background: rgba(255,255,255,0.12); color: #fff; text-decoration: none; } +.p-navgroup .linkish { color: var(--nav-text); } +.p-sectionLinks { background: var(--section); border-bottom: 1px solid #d0dde9; } +.p-sectionLinks-list { display: flex; flex-wrap: wrap; } +.p-sectionLinks-list a { display: block; padding: 6px 10px; color: var(--feature-dark); font-size: 13px; } + +/* --- the body */ +.p-body { padding: 12px 0 20px; } +.p-breadcrumbs { display: flex; flex-wrap: wrap; margin: 0 0 10px; font-size: 14px; } +.p-breadcrumbs li { display: inline-flex; align-items: center; } +.p-breadcrumbs li + li::before { content: "\203A"; margin: 0 8px; color: var(--muted); } +.p-breadcrumbs a { color: var(--feature-dark); } +.p-breadcrumbs:last-child { margin: 16px 0 0; } +.p-body-header { margin-bottom: 12px; } +.p-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; } +.p-title-value { font: 400 24px/1.25 var(--font); overflow-wrap: anywhere; } +.p-description { margin-top: 4px; color: var(--muted); font-size: 13px; } +.p-description .listInline { display: flex; gap: 0; } +.p-body-main--withSidebar { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 20px; align-items: start; } +.p-body-sidebar { display: flex; flex-direction: column; gap: 12px; } +.blockMessage { margin-bottom: 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--block); } +.blockMessage--success { border-color: #b4d9b4; background: #edf8ed; } +.blockMessage--loginPrompt { text-align: center; } + +.listInline { display: inline; } +.listInline li { display: inline; } +.listInline--bullet li + li::before { content: "\00B7"; margin: 0 5px; color: var(--muted); } +.listInline--comma li + li::before { content: ", "; } +.p-description .listInline li { display: inline-flex; align-items: center; gap: 5px; } +.p-description .listInline--bullet li + li::before { margin: 0 8px; } + +/* blocks */ +.block { margin-bottom: 14px; } +.block-container { background: var(--block); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; } +.block-header { padding: 8px 12px; background: var(--head-bg); border-bottom: 1px solid #dbe6f0; color: var(--feature); font: 400 17px var(--font); } +.block-header a { color: inherit; } +.block-minorHeader { padding: 8px 10px 4px; color: var(--feature); font: 400 16px var(--font); } +.block-minorHeader a { color: inherit; } +.block-row { padding: 8px 10px; } +.block-row--minor { font-size: 13px; } +.block-row--separated + .block-row--separated { border-top: 1px solid var(--line); } +.block-footer { padding: 6px 10px; border-top: 1px solid var(--line); background: var(--soft); color: var(--muted); font-size: 13px; } +.block-outer { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; } +.block-outer:empty { display: none; } +.block-outer--after { margin: 6px 0 0; } +.block-outer > .pageNavWrapper:only-child { margin-left: 0; } +.block-filterBar { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--soft); font-size: 13px; color: var(--muted); } +.block-tabHeader { display: flex; gap: 2px; padding: 0 10px; border-top: 1px solid var(--line); background: var(--soft); } +.tabs-tab { padding: 8px 10px; border-bottom: 3px solid transparent; color: var(--muted); font-size: 14px; } +.tabs-tab.is-active { border-bottom-color: var(--feature); color: var(--feature-dark); } +.pairs dt { color: var(--muted); } +.pairs dd { margin: 0; } +.pairs--justified { display: flex; justify-content: space-between; gap: 8px; margin: 2px 0; } +.pairs--rows { display: inline-flex; flex-direction: column; align-items: center; margin: 0; } +.pairs--rows dt { font-size: 12px; } +.pairs--inline dt, .pairs--inline dd { display: inline; } +.pairs--inline dt::after { content: ":"; } + +/* buttons */ +.button, a.button, button.button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid transparent; border-radius: var(--radius); background: var(--head-bg); color: var(--feature-dark); font: 400 14px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; } +.button:hover { text-decoration: none; filter: brightness(0.97); } +.button--primary, a.button--primary, button.button--primary, .button.important { background: var(--feature); border-color: var(--feature-dark); color: #fff; } +.button--cta, a.button--cta { background: var(--cta); border-color: var(--cta-dark); color: #fff; } +.button--link, a.button--link { background: none; border-color: var(--border); color: var(--link); } +.button--small, a.button--small { padding: 4px 10px; font-size: 13px; } + +/* pages */ +.pageNav { display: flex; align-items: center; gap: 4px; font-size: 13px; } +.pageNav-main { display: flex; gap: 0; } +.pageNav-page a, .pageNav-page span, .pageNav-jump { display: block; min-width: 28px; padding: 3px 7px; border: 1px solid var(--border); background: var(--block); text-align: center; color: var(--link); } +.pageNav-page + .pageNav-page a, .pageNav-page + .pageNav-page span { border-left: 0; } +.pageNav-page:first-child a { border-radius: var(--radius) 0 0 var(--radius); } +.pageNav-page:last-child a { border-radius: 0 var(--radius) var(--radius) 0; } +.pageNav-jump { border-radius: var(--radius); } +.pageNav-page--current a { background: var(--head-bg); color: var(--feature-dark); font-weight: 600; } + +/* --- the forum list */ +.node + .node { border-top: 1px solid var(--line); } +.node-body { display: grid; grid-template-columns: 46px minmax(0, 1fr) 140px 250px; gap: 10px; align-items: center; padding: 10px 12px; } +.node-icon { color: var(--unread); font-size: 30px; opacity: 0.35; text-align: center; } +.node--unread .node-icon { opacity: 1; } +.node-title { font: 400 16px var(--font); } +.node--unread .node-title { font-weight: 700; } +.node-description { margin-top: 2px; color: var(--muted); font-size: 13px; } +.node-stats { display: flex; justify-content: space-around; font-size: 14px; } +.node-extra { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 8px; font-size: 13px; min-width: 0; } +.node-extra-icon { grid-row: span 2; } +.node-extra-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.node-extra-row { min-width: 0; overflow: hidden; color: var(--muted); } +.node-extra-row .username { font-weight: normal; color: var(--muted); } +.node-extra-placeholder { grid-column: 1 / -1; color: var(--muted); font-style: italic; } + +/* --- the thread list */ +.structItem { display: grid; grid-template-columns: 52px minmax(0, 1fr) 120px 150px 30px; gap: 10px; align-items: center; padding: 8px 10px; } +.structItem + .structItem { border-top: 1px solid var(--line); } +.structItem--empty { display: block; color: var(--muted); } +.structItem-title { font-size: 15px; } +.structItem.is-unread .structItem-title a { font-weight: 700; } +.structItem-minor { color: var(--muted); font-size: 13px; } +.structItem-parts { display: flex; flex-wrap: wrap; } +.structItem-parts li + li::before { content: "\00B7"; margin: 0 5px; } +.structItem-parts .username { color: var(--muted); font-weight: normal; } +.structItem-pageJump a { display: inline-block; margin-left: 2px; padding: 0 5px; border: 1px solid var(--border); border-radius: 3px; font-size: 11px; } +.structItem-cell--meta { font-size: 13px; } +.structItem-cell--latest { text-align: right; font-size: 13px; } +.structItem-cell--latest .username { font-weight: normal; color: var(--muted); } +.label { display: inline-block; padding: 0 6px; border-radius: 3px; font-size: 12px; vertical-align: 1px; } +.label--hot { background: #fde3cf; color: #b45100; } + +/* --- posts */ +.message + .message { border-top: 1px solid var(--line); } +.message-inner { display: flex; } +.message-cell--user { flex: none; width: 160px; padding: 10px; background: var(--soft); border-right: 1px solid var(--line); } +.message-user { position: relative; text-align: center; } +.message-userArrow { position: absolute; right: -11px; top: 30px; width: 0; height: 0; border: 10px solid transparent; border-left: 0; border-right-color: var(--line); } +.message-userArrow::after { content: ""; position: absolute; left: 1px; top: -9px; border: 9px solid transparent; border-left: 0; border-right-color: var(--block); } +.message-avatar-wrapper { display: inline-block; } +.message-name { margin-top: 6px; font: 700 15px var(--font); overflow-wrap: anywhere; } +.message-userTitle { color: var(--muted); font-size: 12px; } +.userBanner { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 3px; background: var(--feature-dark); color: #fff; font-size: 11px; font-style: normal; } +.message-userExtras { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 12px; text-align: left; } +.message-cell--main { flex: 1; min-width: 0; padding: 10px 14px; } +.message-main { display: flex; flex-direction: column; height: 100%; } +.message-attribution { display: flex; justify-content: space-between; padding-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; } +.message-attribution-opposite { display: flex; gap: 10px; } +.message-attribution-opposite li { display: inline-flex; align-items: center; } +.message-attribution a { color: var(--muted); } +.message-content { flex: 1; padding: 10px 0; } +.bbWrapper { font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; } +.message-footer { font-size: 13px; } +.actionBar { display: flex; justify-content: space-between; gap: 10px; } +.actionBar-set { display: flex; gap: 12px; align-items: center; } +.actionBar-action { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); } +.actionBar-action:hover { color: var(--link); text-decoration: none; } +.actionBar-action.has-reaction { color: var(--link); font-weight: 600; } +.reactionsBar { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); } +.reactionSummary { display: inline-flex; } + +/* quotes, as XenForo 2 set them */ +.citation { margin: 8px 0 0; padding: 4px 10px; border: 1px solid #d0dde9; border-left: 3px solid var(--feature); border-bottom: 0; background: var(--head-bg); color: var(--feature-dark); font-size: 13px; font-weight: 600; } +blockquote.quote { margin: 0 0 10px; padding: 8px 10px; border: 1px solid #d0dde9; border-left: 3px solid var(--feature); background: var(--soft); font-size: 14px; } +blockquote.quote:not(.citation + blockquote.quote) { margin-top: 8px; } +.bbc_url { text-decoration: underline; } + +/* polls */ +.pollResults { padding: 10px 12px; } +.pollResult { display: grid; grid-template-columns: minmax(0, 1fr) 80px 50px; gap: 2px 10px; align-items: center; margin-bottom: 8px; font-size: 14px; } +.pollResult-response { font: 14px var(--font); } +.pollResult.is-voted .pollResult-response { font-weight: 700; } +.pollResult-votes, .pollResult-percentage { color: var(--muted); font-size: 13px; text-align: right; } +.pollResult-graph { grid-column: 1 / -1; } +meter { display: block; width: 100%; height: 10px; } +meter::-webkit-meter-bar { background: var(--line); border: 0; border-radius: 5px; height: 10px; } +meter::-webkit-meter-optimum-value { background: var(--unread); border-radius: 5px; } +meter::-moz-meter-bar { background: var(--unread); } +.pollFooter { border-top: 1px solid var(--line); color: var(--muted); } +.pollVote { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; border-top: 1px solid var(--line); } + +/* the quick reply */ +.message--quickReply .message-cell--user { width: 90px; } +.message-editorWrapper textarea { width: 100%; min-height: 140px; } +.formButtonGroup { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; } + +/* the profile */ +.memberHeader { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px; } +.memberHeader-main { display: flex; gap: 14px; } +.memberHeader-name { font: 400 24px var(--font); } +.memberHeader-name .username { font-weight: 400; } +.memberHeader-blurb { margin-top: 3px; color: var(--muted); font-size: 14px; } +.memberHeader-blurb dd { color: var(--text); } +.memberHeader-stats .pairJustifier { display: flex; gap: 24px; font-size: 18px; } +.contentRow { display: flex; gap: 10px; } +.contentRow-title { font-size: 14px; } +.contentRow-snippet { margin: 4px 0; padding-left: 8px; border-left: 2px solid var(--line); font-size: 14px; } +.contentRow-minor { color: var(--muted); font-size: 12px; } + +/* --- forms and the default theme's pages */ +.input, input[type=text], input[type=password], input[type=email], input[type=search], select, textarea { padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--text); font: 15px var(--font); } +textarea { width: 100%; } +textarea:focus, input:focus { border-color: var(--unread); outline: none; box-shadow: 0 0 0 2px rgba(71, 167, 235, 0.25); } +.box { margin: 0 0 14px; background: var(--block); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; } +.box > h2.maintitle { display: flex; gap: 8px; margin: 0; padding: 8px 12px; background: var(--head-bg); border-bottom: 1px solid #dbe6f0; color: var(--feature); font: 400 17px var(--font); } +.box .count { margin-left: auto; font-size: 13px; color: var(--muted); } +.box-body { padding: 12px; } +.box.narrow { max-width: 560px; margin-left: auto; margin-right: auto; } +.field { display: grid; grid-template-columns: 35% 1fr; align-items: center; gap: 8px; padding: 5px 0; color: var(--muted); font-size: 14px; } +.editor .field { grid-template-columns: 1fr; } +.editor-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; } +.signin .desc { margin-bottom: 8px; } +.poll-maker { margin: 10px 0; } +.poll-maker summary { cursor: pointer; color: var(--feature); } +.searchform { display: flex; gap: 8px; } +.searchform input { flex: 1; } +.message.error { color: #c00; display: block; } +p.message { display: block; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--soft); } +table.board { width: 100%; border-collapse: collapse; } +table.board th { padding: 6px 12px; background: var(--soft); color: var(--muted); font-size: 13px; font-weight: 400; text-align: left; } +table.board td { padding: 8px 12px; border-top: 1px solid var(--line); vertical-align: top; } +table.board h3 { margin: 0; font-size: 15px; } +.snippet { color: var(--muted); font-size: 13px; } +td.none { text-align: center; color: var(--muted); } + +/* letter pictures for those without one */ +.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: var(--radius); color: #fff; font: 600 14px var(--font); vertical-align: middle; } +.avatar.xxs { width: 24px; height: 24px; font-size: 12px; } +.avatar.xs { width: 36px; height: 36px; font-size: 16px; } +.avatar.s { width: 48px; height: 48px; font-size: 21px; } +.avatar.m { width: 96px; height: 96px; font-size: 42px; } +.avatar.l { width: 150px; height: 150px; font-size: 66px; } +.avatar.tiny { width: 18px; height: 18px; font-size: 10px; } +.avatar.mini { width: 24px; height: 24px; font-size: 12px; } +.avatar.large { width: 96px; height: 96px; font-size: 42px; } +.avatar.huge { width: 150px; height: 150px; font-size: 66px; } +.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 */ +.p-footer { background: var(--footer); color: var(--footer-text); font-size: 13px; } +.p-footer a { color: var(--footer-text); } +.p-footer-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.1); } +.p-footer-row-opposite ul { display: flex; gap: 16px; } +.p-footer-copyright { padding: 10px 0 20px; text-align: center; font-size: 12px; opacity: 0.8; } +.themepicker { display: inline-flex; align-items: center; gap: 6px; } +.themepicker select { padding: 3px 6px; font-size: 13px; } +.themepicker .button { padding: 3px 10px; font-size: 13px; } + +/* --- narrow screens */ +@media (max-width: 900px) { + .p-body-main--withSidebar { grid-template-columns: minmax(0, 1fr); } + .node-body { grid-template-columns: 46px minmax(0, 1fr) 120px; } + .node-extra { display: none; } +} +@media (max-width: 760px) { + .p-logo-text { font-size: 20px; max-width: 260px; } + .p-nav-inner { flex-wrap: wrap; padding-bottom: 6px; } + .p-nav-scroller { flex-basis: 100%; } + .p-nav-opposite { margin-left: auto; } + .p-nav-list { padding-top: 4px; } + .p-navEl-link { padding: 6px 10px; } + .p-navgroup-link--search .p-navgroup-linkText, .p-navgroup-link--user .p-navgroup-linkText { display: none; } + .node-body { grid-template-columns: 40px minmax(0, 1fr); } + .node-stats { display: none; } + .structItem { grid-template-columns: 40px minmax(0, 1fr); } + .structItem .avatar.s { width: 36px; height: 36px; font-size: 16px; } + .structItem-cell--meta, .structItem-cell--latest, .structItem-cell--iconEnd { display: none; } + .message-inner { flex-direction: column; } + .message-cell--user { width: auto !important; border-right: 0; border-bottom: 1px solid var(--line); } + .message-user { display: flex; align-items: center; gap: 10px; text-align: left; } + .message-user .avatar.m { width: 40px; height: 40px; font-size: 18px; } + .message-name { margin: 0; } + .message-userExtras, .message-userArrow { display: none; } + .memberHeader-main { flex-direction: column; } + .field { grid-template-columns: 1fr; } +} diff --git a/internal/forum/static/xf23.css b/internal/forum/static/xf23.css new file mode 100644 index 0000000..4e1248b --- /dev/null +++ b/internal/forum/static/xf23.css @@ -0,0 +1,78 @@ +/* + * The forum's light theme: laid out in the manner of XenForo 2.3's + * default style, a refresh of 2.0-2.2's (this theme wears the xf2 + * theme's templates and builds on its stylesheet): rounder corners and + * buttons, softer borders, a slightly cooler blue head, round pictures, + * pill-shaped page links and reactions, and the dark variation for + * readers whose device asks for one. Written for this BBS; it takes no + * code or images from any board. + */ +@import url("xf2.css"); + +:root { + --header: #1d4f80; + --nav: #2a6db0; + --section: #e8f0f8; + --body: #f7f8fa; + --border: #dde1e6; + --line: #eceef1; + --head-bg: #f1f6fc; + --soft: #f7f9fc; + --radius: 8px; + --footer: #1b2a3c; +} +@media (prefers-color-scheme: dark) { + :root { + --header: #10263d; + --nav: #1b4f7e; + --nav-text: #d5e2ef; + --section: #1e2c3b; + --body: #15181c; + --block: #1e2227; + --border: #31363d; + --line: #2a2f35; + --head-bg: #222f3d; + --feature: #79b8f0; + --feature-dark: #9ccaf5; + --link: #6fb3f2; + --text: #dfe3e8; + --muted: #8b949e; + --soft: #23282e; + --unread: #5cb4f0; + --footer: #0e1319; + --footer-text: #aab8c6; + color-scheme: dark; + } + .p-sectionLinks { border-bottom-color: var(--border); } + .block-header, .box > h2.maintitle { border-bottom-color: var(--border); } + .citation, blockquote.quote { border-color: var(--border); border-left-color: var(--feature); } + .blockMessage--success { background: #1d2e22; border-color: #2f5a3a; } + .label--hot { background: #4a2a12; color: #f3a35c; } + .input, input[type=text], input[type=password], input[type=email], input[type=search], select, textarea { background: #171a1e; border-color: var(--border); color: var(--text); } + .p-header-logo a, .p-logo-text { color: #fff; } +} + +body { font-size: 15px; } +.p-header-content { padding: 18px 0; } +.p-navEl-link { border-radius: var(--radius) var(--radius) 0 0; } +.p-navgroup { border-radius: 999px; overflow: hidden; } +.block-container, .blockMessage, .box { border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); } +.block-header { font-weight: 500; } +.button, a.button, button.button { border-radius: 999px; padding: 6px 16px; font-weight: 500; } +.button--small, a.button--small { padding: 4px 12px; } +.pageNav-main { gap: 4px; } +.pageNav-page a, .pageNav-page span, .pageNav-jump { border-radius: 999px !important; border-left: 1px solid var(--border) !important; } +.pageNav-page--current a { background: var(--feature); border-color: var(--feature) !important; color: #fff; } +.node-icon { opacity: 0.3; } +.node--unread .node-icon { opacity: 1; filter: drop-shadow(0 1px 2px rgba(37, 119, 177, 0.35)); } +.message-cell--user { background: transparent; } +.message-userArrow { display: none; } +.reactionsBar, .citation, blockquote.quote, .label { border-radius: var(--radius); } +.citation { border-radius: var(--radius) var(--radius) 0 0; } +blockquote.quote { border-radius: 0 0 var(--radius) var(--radius); } +blockquote.quote:not(.citation + blockquote.quote) { border-radius: var(--radius); } +.reactionsBar { border-radius: 999px; padding: 4px 12px; } +.userBanner { border-radius: 999px; } +.avatar { border-radius: 50%; } +.input, input[type=text], input[type=password], input[type=email], input[type=search], select, textarea { border-radius: var(--radius); } +.p-footer-copyright { opacity: 0.7; } diff --git a/internal/forum/themes/xf1/area.html b/internal/forum/themes/xf1/area.html new file mode 100644 index 0000000..87e5f3a --- /dev/null +++ b/internal/forum/themes/xf1/area.html @@ -0,0 +1,44 @@ +{{define "area.html"}}{{template "head" .}} +{{$b := .Body}} +
+ {{if $b.CanPost}}
Post New Thread
{{end}} +

{{$b.Area.Name}}

+ {{if $b.Area.Description}}

{{$b.Area.Description}}

{{end}} +
+ +
+
+
Sort by:
+
Title
+
Replies
+
Last Message
+
+
    + {{range $b.Topics}} +
  1. +
    {{template "avatar" (av .Root.From "small")}}
    +
    +
    +

    {{if .Unread}}{{end}}{{.Root.Subject}}{{if ge .Replies 15}} Hot{{end}}

    +
    {{.Root.From}}, {{ago .Root.Created}}{{if gt .Pages 1}} ...{{$root := .Root.ID}}{{range (seq .Pages)}}{{.}}{{end}}{{end}}
    +
    +
    +
    Replies:
    {{num .Replies}}
    + +
  2. + {{else}} +
  3. There are no threads in this forum.
  4. + {{end}} +
+
Showing {{plural $b.Count "thread" "threads"}}
+
+ +{{template "foot" .}}{{end}} diff --git a/internal/forum/themes/xf1/index.html b/internal/forum/themes/xf1/index.html new file mode 100644 index 0000000..092a4db --- /dev/null +++ b/internal/forum/themes/xf1/index.html @@ -0,0 +1,53 @@ +{{define "index.html"}}{{template "head" .}} +{{$st := .Body.Stats}} +

{{.BBS}}

+
+
+
    + {{range .Body.Categories}} +
  1. +

    {{.Name}}

    +
      + {{range $f := .Forums}} +
    1. +
      + +
      +

      {{$f.Area.Name}}

      + {{if $f.Area.Description}}
      {{$f.Area.Description}}
      {{end}} +
      Discussions:
      {{num $f.Topics}}
      Messages:
      {{num $f.Area.Messages}}
      +
      +
      + {{with $f.Last}}Latest: {{truncate $f.LastTopic.Subject 30}} + {{.From}}, {{ago .Created}} + {{else}}(Contains no messages){{end}} +
      +
      +
    2. + {{end}} +
    +
  2. + {{end}} +
+
+
+ +{{template "foot" .}}{{end}} diff --git a/internal/forum/themes/xf1/layout.html b/internal/forum/themes/xf1/layout.html new file mode 100644 index 0000000..f2d19da --- /dev/null +++ b/internal/forum/themes/xf1/layout.html @@ -0,0 +1,66 @@ +{{define "head"}} + + + + +{{if eq .Title .BBS}}{{.BBS}}{{else}}{{.Title}} | {{.BBS}}{{end}} + + + +
+ +
+
+ {{template "crumbs" .}} + {{if and (eq .Notice "welcome") .User}}
Thank you for creating an account, {{.User.Name}}. You are now logged in.
{{end}} +{{end}} + +{{define "crumbs"}}{{end}} + +{{define "foot"}} + {{template "crumbs" .}} +
+ + + +{{end}} + +{{define "pages"}}{{if gt .Total 1}}{{$cur := .Cur}}{{$p := .}}{{end}}{{end}} diff --git a/internal/forum/themes/xf1/profile.html b/internal/forum/themes/xf1/profile.html new file mode 100644 index 0000000..9deb6fc --- /dev/null +++ b/internal/forum/themes/xf1/profile.html @@ -0,0 +1,31 @@ +{{define "profile.html"}}{{template "head" .}} +{{$u := .Body.U}} +
+
+
{{template "avatar" (av $u.Name "huge")}}
+
+
Last Activity:
{{ago $u.LastLogin}}
+
Joined:
{{monthyear $u.Created}}
+
Messages:
{{num $u.Posts}}
+
Calls:
{{num $u.Logins}}
+
+
+
+
+
+

{{$u.Name}}

+

{{if $u.Sysop}}Administrator{{else}}{{group $u}}{{end}}{{if $u.Location}}, from {{$u.Location}}{{end}}

+ {{if $u.Sysop}}Staff Member{{end}} +
{{$u.Name}} was last seen:
{{if .Body.On}}{{range .Body.On}}On node {{.Num}} by {{.Via}}: {{.Activity}}{{end}}{{else}}{{ago $u.LastLogin}}{{end}}
+
+ +
+
    + {{range .Body.Recent}} +
  1. {{template "avatar" (av $u.Name "small")}}

    {{$u.Name}} replied to the thread {{.Subject}}.

    {{snippet .Body 200}}

    {{ago .Created}}
  2. + {{else}}
  3. {{$u.Name}} has not posted any messages yet.
  4. {{end}} +
+ {{if $u.About}}

About

{{$u.About}}

{{end}} +
+
+{{template "foot" .}}{{end}} diff --git a/internal/forum/themes/xf1/topic.html b/internal/forum/themes/xf1/topic.html new file mode 100644 index 0000000..2f4f659 --- /dev/null +++ b/internal/forum/themes/xf1/topic.html @@ -0,0 +1,86 @@ +{{define "topic.html"}}{{template "head" .}} +{{$b := .Body}}{{$csrf := .CSRF}}{{$me := .User}} +
+

{{$b.Root.Subject}}

+

Discussion in '{{$b.Area.Name}}' started by {{$b.Root.From}}, {{ago $b.Root.Created}}.

+
+ + +{{with $b.Poll}} +
+
+
+

?

+

{{$b.Root.Subject}}

+ {{if or .Voted (not $me)}} +
    + {{range $i, $a := .Answers}}
  1. {{$a.Text}}{{if $a.Mine}} (you voted){{end}}

    {{$a.Count}} vote(s){{$a.Pct}}%
  2. {{end}} +
+

Total voters: {{.Total}}{{if not $me}} · Log in to vote{{end}}

+ {{end}} + {{if $me}} +
+ + {{range .Answers}}{{end}} + +
+ {{end}} +
+
+
+{{end}} + +
    + {{range $b.Posts}} +
  1. +
    +
    +
    {{if .Author}}{{template "avatar" (av .M.From "large")}}{{else}}{{template "avatar" (av .M.From "large")}}{{end}}
    +

    + {{if .Author}}{{.M.From}}{{else}}{{.M.From}}{{end}} + {{if .Author}}{{if .Author.Sysop}}Administrator{{else if ge .Author.Posts 100}}Well-Known Member{{else if ge .Author.Posts 30}}Active Member{{else}}New Member{{end}}{{else}}Guest{{end}} + {{if .Author}}{{if .Author.Sysop}}Staff Member{{end}}{{end}} +

    + {{if .Author}}
    +
    Joined:
    {{monthyear .Author.Created}}
    +
    Messages:
    {{num .Author.Posts}}
    + {{if .Author.Location}}
    Location:
    {{.Author.Location}}
    {{end}} +
    {{end}} + +
    +
    +
    +
    {{body .M.Body}}
    +
    +
    {{.M.From}}, {{ago .M.Created}}{{if .CanDelete}}
    {{end}}
    +
    + #{{.Num}} + {{if .CanLike}}
    {{end}} + {{if $b.CanPost}}Reply{{end}} +
    +
    + {{if .Likes}}
    {{plural .Likes "person likes" "people like"}} this.
    {{end}} +
    +
  2. + {{end}} +
+ + + +{{if $b.CanPost}} +
+ + {{if $b.QuoteID}}{{end}} +
{{template "avatar" (av $me.Name "large")}}
+
+ +
{{if $b.Aliases}}{{else}}Quote with > at the start of a line.{{end}}
+
+
+{{else if not .User}} +
You must log in or sign up to reply here.
+{{end}} +{{template "foot" .}}{{end}} diff --git a/internal/forum/themes/xf2/area.html b/internal/forum/themes/xf2/area.html new file mode 100644 index 0000000..02fa32d --- /dev/null +++ b/internal/forum/themes/xf2/area.html @@ -0,0 +1,41 @@ +{{define "area.html"}}{{template "head" .}} +{{$b := .Body}} +
+
+

{{$b.Area.Name}}

+ {{if $b.CanPost}}{{end}} +
+ {{if $b.Area.Description}}
{{$b.Area.Description}}
{{end}} +
+
+
{{template "pages" $b.Pages}}
+
+
+ Sort by: Last message + {{if .User}}
{{end}} +
+
+ {{range $b.Topics}} +
+
{{template "avatar" (av .Root.From "s")}}
+
+
{{if ge .Replies 15}}Hot {{end}}{{.Root.Subject}}
+
  • {{.Root.From}}
  • {{ago .Root.Created}}
  • {{if gt .Pages 1}}
  • {{$root := .Root.ID}}{{range (seq .Pages)}}{{.}}{{end}}
  • {{end}}
+
+
+
Replies
{{num .Replies}}
+
+ +
{{template "avatar" (av .Last.From "xxs")}}
+
+ {{else}} +
There are no threads in this forum.
+ {{end}} +
+
+
{{template "pages" $b.Pages}}{{if $b.CanPost}}Post thread{{end}}
+
+{{template "foot" .}}{{end}} diff --git a/internal/forum/themes/xf2/index.html b/internal/forum/themes/xf2/index.html new file mode 100644 index 0000000..85c7c26 --- /dev/null +++ b/internal/forum/themes/xf2/index.html @@ -0,0 +1,61 @@ +{{define "index.html"}}{{template "head" .}} +{{$st := .Body.Stats}} +

Forums

+
+
+ {{range .Body.Categories}} +
+
+

{{.Name}}

+
+ {{range $f := .Forums}} +
+
+ +
+

{{$f.Area.Name}}

+ {{if $f.Area.Description}}
{{$f.Area.Description}}
{{end}} +
+
+
Threads
{{num $f.Topics}}
+
Messages
{{num $f.Area.Messages}}
+
+
+ {{with $f.Last}} +
{{template "avatar" (av .From "xs")}}
+ + + {{else}}None{{end}} +
+
+
+ {{end}} +
+
+
+ {{end}} +
+
+
+
+

Members online

+
+
    {{range .Body.Online}}
  • {{.User}}
  • {{else}}
  • No members online now.
  • {{end}}
+
+ +
+
+
+
+

Forum statistics

+
+
Threads
{{num $st.Topics}}
+
Messages
{{num $st.Posts}}
+
Members
{{num $st.Members}}
+ {{with $st.Newest}}
Latest member
{{.Name}}
{{end}} +
+
+
+
+
+{{template "foot" .}}{{end}} diff --git a/internal/forum/themes/xf2/layout.html b/internal/forum/themes/xf2/layout.html new file mode 100644 index 0000000..fb0d522 --- /dev/null +++ b/internal/forum/themes/xf2/layout.html @@ -0,0 +1,73 @@ +{{define "head"}} + + + + +{{if eq .Title .BBS}}{{.BBS}}{{else}}{{.Title}} | {{.BBS}}{{end}} + + + +
+ +
+ + +
+
+ {{template "crumbs" .}} + {{if and (eq .Notice "welcome") .User}}
Thank you for registering, {{.User.Name}}. You are now logged in.
{{end}} +{{end}} + +{{define "crumbs"}}{{end}} + +{{define "foot"}} + {{template "crumbs" .}} +
+ +
+ + +{{end}} + +{{define "pages"}}{{if gt .Total 1}}{{$cur := .Cur}}{{$p := .}}{{end}}{{end}} diff --git a/internal/forum/themes/xf2/profile.html b/internal/forum/themes/xf2/profile.html new file mode 100644 index 0000000..2723fb9 --- /dev/null +++ b/internal/forum/themes/xf2/profile.html @@ -0,0 +1,36 @@ +{{define "profile.html"}}{{template "head" .}} +{{$u := .Body.U}} +
+
+
+ {{template "avatar" (av $u.Name "l")}} +
+

{{$u.Name}}

+
{{if $u.Sysop}}Staff member{{end}}
+
{{if $u.Sysop}}Administrator{{else}}{{group $u}}{{end}}{{if $u.Location}} · From {{$u.Location}}{{end}}
+
Joined
{{smfdate $u.Created}}
+
Last seen
{{if .Body.On}}{{range .Body.On}}On node {{.Num}} by {{.Via}}: {{.Activity}}{{end}}{{else}}{{ago $u.LastLogin}}{{end}}
+
+
+
+
Messages
{{num $u.Posts}}
+
Calls
{{num $u.Logins}}
+
+
+
Latest activity
+
+
+
+
+ +
+
+{{if $u.About}}

About

{{$u.About}}
{{end}} +{{template "foot" .}}{{end}} diff --git a/internal/forum/themes/xf2/topic.html b/internal/forum/themes/xf2/topic.html new file mode 100644 index 0000000..a7f30ff --- /dev/null +++ b/internal/forum/themes/xf2/topic.html @@ -0,0 +1,103 @@ +{{define "topic.html"}}{{template "head" .}} +{{$b := .Body}}{{$csrf := .CSRF}}{{$me := .User}} +
+

{{$b.Root.Subject}}

+
+
+ +{{with $b.Poll}} +
+
+

{{$b.Root.Subject}}

+
+ {{if or .Voted (not $me)}} +
    + {{range $i, $a := .Answers}}
  • {{$a.Text}}{{if $a.Mine}} {{end}}

    {{$a.Count}} vote(s){{$a.Pct}}%
  • {{end}} +
+
Total voters {{.Total}}{{if not $me}} · Log in to vote{{end}}
+ {{end}} + {{if $me}} +
+ + {{range .Answers}}{{end}} + +
+ {{end}} +
+
+
+{{end}} + +
+
{{template "pages" $b.Pages}}
+
+
+ {{range $b.Posts}} +
+
+
+
+
{{if .Author}}{{template "avatar" (av .M.From "m")}}{{else}}{{template "avatar" (av .M.From "m")}}{{end}}
+
+

{{if .Author}}{{.M.From}}{{else}}{{.M.From}}{{end}}

+
{{if .Author}}{{if .Author.Sysop}}Administrator{{else if ge .Author.Posts 100}}Well-known member{{else if ge .Author.Posts 30}}Active member{{else}}New member{{end}}{{else}}Guest{{end}}
+ {{if .Author}}{{if .Author.Sysop}}
Staff member
{{end}}{{end}} +
+ {{if .Author}}
+
Joined
{{monthyear .Author.Created}}
+
Messages
{{num .Author.Posts}}
+ {{if .Author.Location}}
Location
{{.Author.Location}}
{{end}} +
{{end}} + +
+
+
+
+
+ + +
+
{{body .M.Body}}
+
+
+
{{if .CanDelete}}
{{end}}
+
+ {{if .CanLike}}
{{end}} + {{if $b.CanPost}} Reply{{end}} +
+
+ {{if .Likes}}
{{plural .Likes "member" "members"}}
{{end}} +
+
+
+
+
+ {{end}} +
+
+
{{template "pages" $b.Pages}}{{$b.Area.Name}}
+
+ +{{if $b.CanPost}} +
+ + {{if $b.QuoteID}}{{end}} +
+
+
{{template "avatar" (av $me.Name "s")}}
+
+
+ +
{{if $b.Aliases}}{{else}}Quote with > at the start of a line.{{end}}
+
+
+
+
+
+{{else if not .User}} +
You must log in{{if .Register}} or register{{end}} to reply here.
+{{end}} +{{template "foot" .}}{{end}}