Download tasks/boardgamegeek/solution/site/implementation/clone/app.py from TIGER-Lab/WebsiteBench: direct link, hf CLI and curl.
- Browser
- Download file 263 kB
-
https://huggingface.co/datasets/TIGER-Lab/WebsiteBench/resolve/main/tasks/boardgamegeek/solution/site/implementation/clone/app.py
- Command line
-
hf download hf://datasets/TIGER-Lab/WebsiteBench/tasks/boardgamegeek/solution/site/implementation/clone/app.py
-
curl -L -o app.py https://huggingface.co/datasets/TIGER-Lab/WebsiteBench/resolve/main/tasks/boardgamegeek/solution/site/implementation/clone/app.py
263 kB
| """BoardGameGeek desktop-only offline clone. | |
| The public entry follows direct 1440x900 source evidence. Most deep source | |
| pages were blocked by Cloudflare; the five anonymous Help wiki pages are the | |
| exception and render sanitized, network-closed source fragments. | |
| """ | |
| from __future__ import annotations | |
| import html | |
| import json | |
| import pathlib | |
| import re | |
| import sys | |
| from contextvars import ContextVar | |
| from urllib.parse import parse_qs | |
| from fastapi import FastAPI, Request | |
| from fastapi.responses import HTMLResponse, JSONResponse, RedirectResponse | |
| from fastapi.staticfiles import StaticFiles | |
| ROOT = pathlib.Path(__file__).resolve().parent | |
| if str(ROOT) not in sys.path: | |
| sys.path.insert(0, str(ROOT)) | |
| from backend import service | |
| from backend.site_backend_integration import open_site_services | |
| from websitebench.local_clone_auth import AuthError | |
| BACKEND, AUTH = open_site_services() | |
| COOKIE = dict(BACKEND.session_cookie) | |
| COOKIE_NAME = str(COOKIE.pop("name")) | |
| AUTH.seed_account(subject_id="bgg-member-001", email="local.member@websitebench.test", display_name="Local Member", password="Boardgame-demo-2026", email_verified=True) | |
| CURRENT_SESSION: ContextVar[dict[str, object]] = ContextVar("boardgamegeek_current_session", default={"authenticated": False, "account": None}) | |
| app = FastAPI(title="BoardGameGeek", docs_url=None, redoc_url=None, openapi_url=None) | |
| app.mount("/static", StaticFiles(directory=ROOT / "static"), name="static") | |
| async def local_session(request: Request, call_next): | |
| token, session = AUTH.ensure_session(request.cookies.get(COOKIE_NAME)) | |
| marker = CURRENT_SESSION.set(session) | |
| try: | |
| result = await call_next(request) | |
| finally: | |
| CURRENT_SESSION.reset(marker) | |
| if "set-cookie" not in result.headers: | |
| result.set_cookie(COOKIE_NAME, token, **COOKIE) | |
| return result | |
| CSP = "default-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; script-src 'self'; connect-src 'self'; font-src 'self'; object-src 'none'; frame-src 'none'; base-uri 'self'" | |
| def e(value: object) -> str: | |
| return html.escape(str(value), quote=True) | |
| def response(markup: str, status: int = 200) -> HTMLResponse: | |
| return HTMLResponse(markup, status_code=status, headers={"Content-Security-Policy": CSP}) | |
| async def fields(request: Request) -> dict[str, list[str]]: | |
| body = (await request.body()).decode("utf-8", errors="replace") | |
| return parse_qs(body, keep_blank_values=True) | |
| def first(data: dict[str, list[str]], key: str, default: str = "") -> str: | |
| values = data.get(key, [default]) | |
| return values[0] if values else default | |
| NAV_MENUS = ( | |
| ( | |
| "Browse", | |
| ( | |
| ("", ( | |
| (("All Boardgames", "/browse/boardgame"), ("Categories", "/browse/boardgamecategory"), ("Artists", "/browse/boardgameartist"), ("Publishers", "/browse/boardgamepublisher"), ("Honors", "/browse/boardgamehonor"), ("Gone Cardboard", "/gonecardboard"), ("Recent Additions", "/recentadditions"), ("Previews", "/previews")), | |
| (("Families", "/browse/boardgamefamily"), ("Mechanics", "/browse/boardgamemechanic"), ("Designers", "/browse/boardgamedesigner"), ("Accessories", "/browse/boardgameaccessory"), ("Random Game", "/boardgame/random"), ("Podcasts", "/browse/boardgamepodcast"), ("Wiki", "/wiki/page/Index"), ("Hall of Fame", "/geekpreview/72/the-boardgamegeek-hall-of-fame")), | |
| )), | |
| ("Trends", ( | |
| (("The Hotness", "/hotness"), ("Most Played", "/trends/mostplayed")), | |
| (("Bestsellers", "/trends/bestsellers"), ("Trending Plays", "/trends/trendingplays")), | |
| )), | |
| ), | |
| ), | |
| ( | |
| "Forums", | |
| ( | |
| ("General Forums", ( | |
| (("All", "/forums"), ("Recent", "/threads/region/1?sort=recent"), ("Search", "/forums/search")), | |
| (("Hot", "/threads/region/1?sort=hot&interval=twodays"), ("Active", "/threads/region/1?sort=active"), ("Post Thread", "/thread/new")), | |
| )), | |
| ("Game Forums", ( | |
| (("Recent", "/threads/gameforums?sort=recent"), ("Search", "/forums/search?parentSearchType=boardgame")), | |
| (("Hot", "/threads/gameforums?sort=hot&interval=twodays"), ("Active", "/threads/gameforums?sort=active")), | |
| )), | |
| ("Utilities", ( | |
| (("Subscriptions", "/subscriptions"), ("Bookmarks", "/threads/bookmarks")), | |
| (("Moderators", "/wiki/page/Forum_Moderators"), ("Community Rules", "/community_rules")), | |
| )), | |
| ), | |
| ), | |
| ( | |
| "GeekLists", | |
| ( | |
| ("", ((("Hot", "/geeklists?sort=hot&interval=twodays"), ("Recent", "/geeklists?sort=recent"), ("Bookmarks", "/geeklists/bookmarks"), ("My Geeklists", "/geeklists/mylists"), ("Create New", "/geeklist/new")),)), | |
| ), | |
| ), | |
| ( | |
| "Shopping", | |
| ( | |
| ("", ((("GeekMarket", "/market"), ("Trades", "/trade"), ("BGG Store", "/store"), ("Auction Search", "/geekshopper"), ("eBay Listings", "/geekbay/browse?sort=hot")),)), | |
| ), | |
| ), | |
| ( | |
| "Community", | |
| ( | |
| ("", ( | |
| (("Guilds", "/guild/home"), ("Stats", "/stats.php"), ("Bugs", "/forum/88/bgg/bugs")), | |
| (("GeekMod", "/geekmod"), ("Find Users", "/users.php"), ("GeekExchange", "/geekexchange/browse")), | |
| )), | |
| ("Submitted Content", ( | |
| (("Files", "/files/boardgame/all"), ("Reviews", "/threads/reviews"), ("Videos", "/videos/boardgame/all"), ("Podcasts", "/browse/boardgamepodcast")), | |
| (("Images", "/images/boardgame/all?sort=recent"), ("Session Reports", "/threads/sessions"), ("Blogs", "/blogs/posts"), ("Podcast Episodes", "/browse/boardgamepodcastepisode")), | |
| )), | |
| ("Contribute", ( | |
| (("Board Game", "/item/create/boardgame"), ("Family", "/item/create/boardgamefamily"), ("Publisher", "/item/create/boardgamepublisher")), | |
| (("Person", "/item/create/boardgameperson"), ("Accessory", "/item/create/boardgameaccessory"), ("Podcast", "/item/create/boardgamepodcast")), | |
| )), | |
| ), | |
| ), | |
| ( | |
| "Help", | |
| ( | |
| ("", ((("Welcome to BGG", "/wiki/page/Welcome_to_BoardGameGeek"), ("Guide to BGG", "/wiki/page/Guide_To_BoardGameGeek"), ("FAQ", "/wiki/page/BoardGameGeek_FAQ"), ("Glossary", "/wiki/page/Glossary"), ("Admins", "/wiki/page/Admins")),)), | |
| ), | |
| ), | |
| ) | |
| def nav_menu(name: str, groups: tuple, index: int) -> str: | |
| sections = [] | |
| for heading, link_lists in groups: | |
| label = f'<h2 class="menu-panel-heading">{e(heading)}</h2>' if heading else "" | |
| lists = [] | |
| for links in link_lists: | |
| items = "".join(f'<li><a href="{e(href)}">{e(text)}</a></li>' for text, href in links) | |
| lists.append(f'<ul>{items}</ul>') | |
| sections.append(f'<section class="menu-panel-group">{label}{"".join(lists)}</section>') | |
| return ( | |
| f'<li class="menu"><button class="menu-trigger" type="button" id="nav-menu-{index}" ' | |
| f'aria-expanded="false" aria-controls="nav-panel-{index}">{e(name)}</button>' | |
| f'<div class="menu-panel menu-panel--{e(name.lower())}" id="nav-panel-{index}" ' | |
| f'role="region" aria-labelledby="nav-menu-{index}" hidden>{"".join(sections)}</div></li>' | |
| ) | |
| def nav() -> str: | |
| session = CURRENT_SESSION.get() | |
| authenticated = bool(session.get("authenticated")) | |
| account = session.get("account") if isinstance(session.get("account"), dict) else {} | |
| display_name = str(account.get("display_name") or "Local Member") | |
| menus = "".join(nav_menu(name, groups, index) for index, (name, groups) in enumerate(NAV_MENUS, 1)) | |
| profile_links_left = ( | |
| ("Collection", "/collection/user/local-member"), | |
| ("Logged Plays", "/plays/bygame/user/local-member/subtype/boardgame"), | |
| ("Tags", "/tags/user/local-member"), | |
| ("Subscriptions", "/subscriptions"), | |
| ("Trades", "/trade"), | |
| ("GeekMarket", "/market/dashboard"), | |
| ("Fan Items", "/fan/user/local-member?subtype=boardgame"), | |
| ) | |
| profile_links_right = ( | |
| ("Wishlist", "/wishlist/local-member"), | |
| ("Guilds", "/profile/local-member/guilds"), | |
| ("Gallery", "/profile/local-member/images"), | |
| ("GeekBuddies", "/geekbuddy.php"), | |
| ("GeekLists", "/geeklists/mylists"), | |
| ("Blogs", "/blogs/myblogs"), | |
| ("GeekExchanges", "/geekexchange/myexchanges"), | |
| ) | |
| profile_columns = "".join( | |
| '<ul>' + "".join(f'<li><a href="{e(href)}">{e(label)}</a></li>' for label, href in links) + '</ul>' | |
| for links in (profile_links_left, profile_links_right) | |
| ) | |
| account_markup = f'''<nav class="member-tools" aria-label="Member notifications"><a href="/geekmail" aria-label="0 GeekMail Messages"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M2 5h20v14H2V5Zm2 2v1l8 5 8-5V7l-8 5-8-5Z"/></svg></a><a href="/subscriptions" aria-label="0 Subscription Notifications"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 10h3l9-5v14l-9-5H4v-4Zm3 6 3 4h3l-3-4H7Zm11-7a4 4 0 0 1 0 6V9Z"/></svg></a></nav><div class="profile-menu"><button class="profile-trigger" type="button" aria-expanded="false" aria-controls="profile-panel"><span class="profile-avatar" aria-hidden="true">{e(display_name[:1].upper())}</span><span class="sr-only">Profile Menu</span><span class="profile-caret" aria-hidden="true"></span></button><div class="profile-panel" id="profile-panel" hidden><a class="profile-summary" href="/profile/local-member"><span class="profile-avatar" aria-hidden="true">{e(display_name[:1].upper())}</span><span><strong>View Profile</strong><small>{e(display_name)}</small></span></a><div class="profile-columns">{profile_columns}</div><a class="profile-footer-link" href="/settings">Settings</a><a class="profile-footer-link" href="/logout">Sign Out</a></div></div>''' if authenticated else '''<nav class="account-nav" aria-label="Account"><a href="/login">Sign In</a><a href="/join">Join (it's free)!</a></nav>''' | |
| return f""" | |
| <header class="topbar" data-region="header"> | |
| <button class="nav-skip-link sr-only" type="button" data-skip-main>Skip Navigation</button> | |
| <a class="nav-skip-link sr-only" href="/contact">Accessibility Feedback</a> | |
| <button class="hamburger" type="button" aria-label="Toggle Sidebar" aria-controls="site-sidebar" aria-expanded="false"><svg width="14" height="13" viewBox="0 0 14 13" aria-hidden="true"><path d="M14 12v1H0v-1h14zm0-6v1H0V6h14zm0-6v1H0V0h14z"/></svg></button> | |
| <div class="brand"><a class="brand-link" href="/" aria-label="BoardGameGeek home"><img src="/static/assets/navbar-logo-bgg.svg" width="80" height="38" alt="boardgame geek logo"></a> | |
| <button class="site-selector-trigger" type="button" aria-label="More Geek Sites" aria-expanded="false" aria-controls="geek-sites-panel"><span class="site-selector-caret" aria-hidden="true"></span></button> | |
| <div class="geek-sites-panel" id="geek-sites-panel" hidden><h2>More Geek Sites</h2><ul><li><a href="/">BoardGameGeek</a></li><li><a href="/geek-sites/rpggeek">RPGGeek</a></li><li><a href="/geek-sites/videogamegeek">VideoGameGeek</a></li><li><a href="/bggcon">Geek Events</a></li></ul></div> | |
| </div> | |
| <nav class="global-nav" aria-label="Primary navigation"> | |
| <ul class="global-nav-list">{menus}</ul> | |
| </nav> | |
| {account_markup} | |
| <form class="header-search" action="/geeksearch.php" method="get"><input type="hidden" name="action" value="search"><label class="sr-only" for="header-q">Search Site</label><input id="header-q" name="q" type="search" role="combobox" placeholder="Search" aria-label="Search Site" aria-autocomplete="list" aria-expanded="false"><input type="hidden" name="objecttype" value="boardgame"><button class="header-search-submit" type="submit" aria-label="Search"><svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true"><path d="M9.5 4a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11Zm-7 5.5a7 7 0 1 1 12.15 4.75l5.05 5.05-1.4 1.4-5.05-5.05A7 7 0 0 1 2.5 9.5Z"/></svg></button></form> | |
| </header>""" | |
| def member_sidebar_sections(prefix: str) -> str: | |
| quickbar_id = f"{prefix}-quickbar-body" | |
| recent_id = f"{prefix}-recently-viewed-body" | |
| return f'''<section class="member-sidebar-section quickbar-section"><button class="member-sidebar-heading" type="button" aria-expanded="true" aria-controls="{quickbar_id}">Quickbar</button><div class="member-sidebar-body quickbar-body" id="{quickbar_id}"><span class="quickbar-plus" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M13 2 6 13h5l-1 9 8-13h-5V2Z"/></svg></span><p>Add shortcuts to your favorite games, designers, forums, or any other page within the Geek.</p><button class="quickbar-add" type="button">Add Current Page</button></div></section> | |
| <section class="member-sidebar-section recently-viewed-section"><button class="member-sidebar-heading" type="button" aria-expanded="true" aria-controls="{recent_id}">Recently Viewed</button><div class="member-sidebar-body recently-viewed-body" id="{recent_id}"><ul><li><a href="/boardgame/30549/pandemic">Pandemic</a></li><li><a href="/recent">See All »</a></li></ul></div></section>''' | |
| def compact_sidebar_navigation() -> str: | |
| menus = [] | |
| for name, groups in NAV_MENUS: | |
| sections = [] | |
| for heading, link_lists in groups: | |
| section_heading = f'<h3>{e(heading)}</h3>' if heading else "" | |
| links = "".join( | |
| f'<a href="{e(href)}">{e(label)}</a>' | |
| for link_list in link_lists | |
| for label, href in link_list | |
| ) | |
| sections.append(f'<section>{section_heading}{links}</section>') | |
| menus.append( | |
| f'<details class="sidebar-primary-menu"><summary>{e(name)}</summary>' | |
| f'<div class="sidebar-primary-menu-links">{"".join(sections)}</div></details>' | |
| ) | |
| return "".join(menus) | |
| def site_sidebar() -> str: | |
| session = CURRENT_SESSION.get() | |
| member_sections = member_sidebar_sections("global-sidebar") if session.get("authenticated") else "" | |
| return f'''<aside id="site-sidebar" class="site-sidebar anonymous-site-sidebar" aria-label="Sidebar" hidden> | |
| <div class="site-sidebar-inner"><button class="sr-only sidebar-skip" type="button" data-close-sidebar>Skip Sidebar</button> | |
| <section class="anonymous-sidebar-section sidebar-primary-navigation" aria-labelledby="anonymous-sidebar-bgg"><h2 id="anonymous-sidebar-bgg">BoardGameGeek</h2><nav aria-label="BoardGameGeek navigation">{compact_sidebar_navigation()}</nav></section> | |
| {member_sections}{source_search_sidebar()}</div> | |
| </aside>''' | |
| def site_footer() -> str: | |
| return '''<footer class="footer" aria-labelledby="footer-title"><div class="footer-grid"> | |
| <section class="footer-brand"><h2 class="sr-only" id="footer-title">Footer Links</h2><a href="/" aria-label="BoardGameGeek home"><svg class="footer-brand-shard" viewBox="0 0 26 38" aria-hidden="true" focusable="false"><polygon points="24.87 7.01 21.107 8.035 24.792 0 .9 8.794 2.206 19.327 0 21.454 6.577 37.93 20.558 32.779 25.418 21.37 23.331 19.358"></polygon></svg><span class="footer-brand-wordmark" aria-hidden="true"><span>Board</span><span>Game</span><span>Geek</span></span></a></section> | |
| <section><h2>Company</h2><ul><li><a href="/wiki/page/Welcome_to_BoardGameGeek">About</a></li><li><a href="/contact">Contact</a></li><li><a href="/advertise">Advertise</a></li><li><a href="/support">Support BGG</a></li></ul></section> | |
| <section><h2>Policies</h2><ul><li><a href="/community_rules">Community Guidelines</a></li><li><a href="/privacy">Privacy</a></li><li><a href="/terms">Terms</a></li><li><button class="footer-cookie-button" type="button" aria-expanded="false" aria-controls="footer-cookie-notice">Manage Cookies</button></li></ul></section> | |
| <section class="footer-connect"><h2>Connect</h2><ul class="footer-social"><li><a href="/social/facebook" aria-label="Facebook">f</a></li><li><a href="/social/bluesky" aria-label="Bluesky">🦋</a></li><li><a href="/social/instagram" aria-label="Instagram">◎</a></li><li><a href="/social/youtube" aria-label="YouTube">▶</a></li><li><a href="/social/twitch" aria-label="Twitch">◧</a></li><li><a href="/social/discord" aria-label="Discord">◉</a></li></ul><div class="footer-apps"><a href="/apps/ios"><small>Download on the</small><strong>App Store</strong></a><a href="/apps/android"><small>GET IT ON</small><strong>Google Play</strong></a></div></section> | |
| </div><div class="footer-cookie-notice" id="footer-cookie-notice" hidden>Cookie preferences are available for this offline experience.</div><p class="footer-legal">Geekdo, BoardGameGeek, the Geekdo logo, and the BoardGameGeek logo are trademarks of BoardGameGeek, LLC.</p></footer>''' | |
| def shell(title: str, body: str, *, consent: bool = False, footer: bool = True) -> str: | |
| modal = """ | |
| <div class="consent-backdrop" aria-hidden="true"></div><section class="consent" role="dialog" aria-modal="true" aria-labelledby="consent-title"> | |
| <div class="consent-scroll"><header class="consent-header"><img class="consent-logo" src="/static/assets/consent-logo.png" width="110" height="60" alt="Welcome to BoardGameGeek"><h2 id="consent-title">We ask for your consent to use your data to:</h2></header> | |
| <ul class="consent-choices"><li class="consent-choice"><span class="consent-icon"><svg width="18" height="18" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m0 9c2.7 0 5.8 1.29 6 2v1H6v-.99c.2-.72 3.3-2.01 6-2.01m0-11C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4z"/></svg></span><span>Personalised advertising and content, advertising and content measurement, audience research and services development</span></li> | |
| <li class="consent-choice"><span class="consent-icon"><svg width="18" height="18" viewBox="0 0 24 24" aria-hidden="true"><path d="M5 6h16V4H5c-1.1 0-2 .9-2 2v11H1v3h11v-3H5V6zm16 2h-6c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1zm-1 9h-4v-7h4v7z"/></svg></span><span>Store and/or access information on a device</span></li></ul> | |
| <button class="consent-more" type="button"><span class="consent-more-icon"><svg width="14" height="14" viewBox="0 0 24 24" aria-hidden="true"><path d="M5.41 7.59 4 9l8 8 8-8-1.41-1.41L12 14.17z"/></svg></span><span>Learn more</span></button> | |
| <div class="consent-copy"><p>Your personal data will be processed and information from your device (cookies, unique identifiers, and other device data) may be stored by, accessed by and shared with 210 partners, or used specifically by this site. We and our partners may use precise geolocation data. <a href="/privacy">List of partners.</a></p> | |
| <p>Some vendors may process your personal data on the basis of legitimate interest, which you can object to by managing your options below. Look for a link at the bottom of this page or in the site menu to manage or withdraw consent in privacy and cookie settings.</p></div></div> | |
| <footer class="consent-footer"><div class="consent-actions"><button data-dismiss-consent>Reject All</button><button class="btn-dark" data-dismiss-consent>I'm OK with that</button></div><button class="consent-options" type="button" data-dismiss-consent>My Options</button></footer> | |
| </section>""" if consent else "" | |
| footer_markup = site_footer() if footer else "" | |
| return f"""<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{e(title)}</title><link rel="stylesheet" href="/static/site.css"><link rel="stylesheet" href="/static/site/extra.css"><link rel="stylesheet" href="/static/site/interactions.css"><link rel="stylesheet" href="/static/site/source-home.css?v=8"><link rel="stylesheet" href="/static/site/source-search.css?v=4"><link rel="stylesheet" href="/static/site/source-game.css?v=2"><link rel="stylesheet" href="/static/site/wiki.css?v=1"><link rel="stylesheet" href="/static/site/consent.css"><link rel="stylesheet" href="/static/site/responsive.css?v=1"><script defer src="/static/app.js?v=6"></script></head><body>{nav()}{site_sidebar()}<main class="page">{body}</main>{footer_markup}{modal}</body></html>""" | |
| def cover(game: object, small: bool = False) -> str: | |
| cls = "thumb" if small else "cover" | |
| return f'<div class="{cls} {e(game["cover_class"])}" aria-label="{e(game["title"])} cover">{e(game["title"])}</div>' | |
| def game_row(game: object) -> str: | |
| return f"""<article class="game-row"><div class="rank">{e(game['rank'])}</div>{cover(game, True)}<div><a class="game-name" href="/boardgame/{game['game_id']}/{e(game['slug'])}">{e(game['title'])} <span class="year">({game['year']})</span></a><div class="secondary">{e(game['categories'].replace(',', ' · '))}</div></div><div><span class="score-badge">{game['rating']:.1f}</span><div class="secondary">Geek Rating</div></div><div>{game['min_players']}–{game['max_players']} players</div><div>{game['min_minutes']}–{game['max_minutes']} min</div></article>""" | |
| HOME_HOTNESS = ( | |
| ("Medico", "/boardgame/472021/medico", "Medieval traveling barbers on their way to becoming a famous medicus.", "hotness-01.png", "up"), | |
| ("Horror on the Orient Express: The Board Game", "/boardgame/394897/horror-on-the-orient-express-the-board-game", "Investigate clues and battle monsters while traveling on the Orient Express!", "hotness-02.png", "down"), | |
| ("Avalon: The Riven Veil", "/boardgame/402276/avalon-the-riven-veil", "Explore the misty isle of Avalon with your faction after the death of King Arthur.", "hotness-03.png", "up"), | |
| ("Jisogi: Anime Studio Tycoon", "/boardgame/429845/jisogi-anime-studio-tycoon", "Manage your own anime studio.", "hotness-04.png", "up"), | |
| ("Raiders of Scythia: Omens", "/boardgameexpansion/474403/raiders-of-scythia-omens", "Omens bring new rules and variation to each play.", "hotness-05.png", "down"), | |
| ("Magical Athlete", "/boardgame/454103/magical-athlete", "Pit a cast of crazy characters against each other in a madcap race to the finish.", "hotness-source-06.png", "flat"), | |
| ("Dewan", "/boardgame/439742/dewan", "You are a tribe leader in a world where every territory and resource matters.", "hotness-source-07.png", "new"), | |
| ("The Lord of the Rings: Fate of the Fellowship", "/boardgame/436217/the-lord-of-the-rings-fate-of-the-fellowship", "As members of The Fellowship, embark on a journey to save—or doom—Middle-earth.", "hotness-source-08.png", "up"), | |
| ("Drillers", "/boardgame/465669/drillers", "Mine for minerals, upgrade your deck and manage your resources carefully.", "hotness-source-09.png", "up"), | |
| ("Courtroom: The Noir Trilogy", "/boardgame/477069/courtroom-the-noir-trilogy", "Two teams investigate the same case, then build opposing arguments to sway the jury.", "hotness-source-10.png", "down"), | |
| ("Dino Racer", "/boardgame/462945/dino-racer", "A wild racing card game of prehistoric proportions.", "hotness-source-11.png", "down"), | |
| ("Wingspan Pocket", "/boardgame/473508/wingspan-pocket", "Swiftly build and activate a row of colorful birds.", "hotness-source-12.png", "flat"), | |
| ("Entropy", "/boardgame/462941/entropy", "Create stars, form planets, and guide life from microbes to animals.", "hotness-source-13.png", "up"), | |
| ("SETI: Search for Extraterrestrial Intelligence", "/boardgame/418059/seti-search-for-extraterrestrial-intelligence", "Search for signs of alien life by launching probes and analyzing distant signals.", "hotness-source-14.png", "flat"), | |
| ("Kingdom Come: Deliverance – The Board Game", "/boardgame/473897/kingdom-come-deliverance-the-board-game", "Develop your character, fulfill quests, and shape history in 15th-century Bohemia.", "hotness-source-15.png", "down"), | |
| ("Ark Nova", "/boardgame/342942/ark-nova", "Plan and build a modern, scientifically managed zoo to support conservation projects.", "hotness-source-16.png", "down"), | |
| ("Harmonies", "/boardgame/414317/harmonies", "Create your own landscape and habitats to welcome animals.", "hotness-source-17.png", "flat"), | |
| ("Rebirth", "/boardgame/417197/rebirth", "Rebuild old lands in a lush, hopeful future.", "hotness-source-18.png", "down"), | |
| ("Ostia", "/boardgame/347767/ostia", "1-4 players create trade routes in the Mediterranean using a mancala/resource system!", "hotness-source-19.png", "flat"), | |
| ("Brass: Birmingham", "/boardgame/224517/brass-birmingham", "Build networks, grow industries, and navigate the world of the Industrial Revolution.", "hotness-source-20.png", "down"), | |
| ("Heat: Pedal to the Metal", "/boardgame/366013/heat-pedal-to-the-metal", "Push your car to the limit in the pursuit of victory, but don’t overheat!", "hotness-source-21.png", "up"), | |
| ("Lost Ruins of Arnak", "/boardgame/312484/lost-ruins-of-arnak", "Explore an island to find resources and discover the lost ruins of Arnak.", "hotness-source-22.png", "down"), | |
| ("The Old King's Crown", "/boardgame/357873/the-old-kings-crown", "Out-manoeuvre your rivals as you vie for control of an ancient, crumbling kingdom.", "hotness-source-23.png", "up"), | |
| ("Arcs", "/boardgame/359871/arcs", "Rule the galaxy with your court, fleet, and cities.", "hotness-source-24.png", "up"), | |
| ("Pondscape", "/boardgame/435330/pondscape", "The most vibrant frog pond you’ve ever seen!", "hotness-source-25.png", "down"), | |
| ("Spirit Island", "/boardgame/162886/spirit-island", "Island Spirits join forces using elemental powers to defend their home from invaders.", "hotness-source-26.png", "down"), | |
| ("Dune: Imperium – Uprising", "/boardgame/397598/dune-imperium-uprising", "Deploy agents, build your deck, and engage in strategic battles to control Arrakis.", "hotness-source-27.png", "up"), | |
| ("Eternal Decks", "/boardgame/424981/eternal-decks", "Can you solve each stage before your deck runs out?", "hotness-source-28.png", "up"), | |
| ("Root", "/boardgame/237182/root", "Decide the fate of the woodland as asymmetric factions fight for contrasting goals.", "hotness-source-29.png", "down"), | |
| ("Scythe", "/boardgame/169786/scythe", "Five factions vie for dominance in a war-torn, mech-filled, dieselpunk 1920s Europe.", "hotness-source-30.png", "up"), | |
| ("Marvel Champions: The Card Game", "/boardgame/285774/marvel-champions-the-card-game", "Battle Marvel villains with unique teams of iconic heroes in this LCG.", "hotness-source-31.png", "down"), | |
| ("Clank!: Catacombs", "/boardgame/365717/clank-catacombs", "Deck-building adventure meets tile-laying in the newest incarnation of Clank!", "hotness-source-32.png", "flat"), | |
| ("Wingspan", "/boardgame/266192/wingspan", "Attract a beautiful and diverse collection of birds to your wildlife preserve.", "hotness-source-33.png", "down"), | |
| ("Terraforming Mars", "/boardgame/167791/terraforming-mars", "Compete with rival CEOs to make Mars habitable and build your corporate empire.", "hotness-source-34.png", "up"), | |
| ("Endeavor: Deep Sea", "/boardgame/367966/endeavor-deep-sea", "Lead your research institute to explore ocean depths and publish your findings!", "hotness-source-35.png", "up"), | |
| ("Vantage", "/boardgame/420033/vantage", "Explore an entire planet's open world from a first-person perspective.", "hotness-source-36.png", "down"), | |
| ("World Order", "/boardgame/403150/world-order", "Simulate the modern global political system in this area-majority game.", "hotness-source-37.png", "up"), | |
| ("Wildscape", "/boardgame/462932/wildscape", "Restore natural habitats and compete for the most thriving animal ecosystem.", "hotness-source-38.png", "down"), | |
| ("Star Trek: Captain's Chair", "/boardgame/422541/star-trek-captains-chair", "Step into the shoes of an iconic Star Trek captain and explore the galaxy!", "hotness-source-39.png", "up"), | |
| ("Moon Colony Bloodbath", "/boardgame/425549/moon-colony-bloodbath", "Whatever can go wrong will go wrong. Players compete to keep their colonists alive.", "hotness-source-40.png", "down"), | |
| ("Psychic Pizza Deliverers Go to the Ghost Town", "/boardgame/272666/psychic-pizza-deliverers-go-to-the-ghost-town", "Use psychic powers to deduce where to deliver the pizza...and avoid ghosts.", "hotness-source-41.png", "new"), | |
| ("Revenant", "/boardgame/428099/revenant", "Evacuate a besieged starfleet, navigating external threats and internal allegiances.", "hotness-source-42.png", "down"), | |
| ("Container", "/boardgame/453740/container", "Set prices as you produce, sell, and ship containers in a tight economic simulation.", "hotness-source-43.png", "down"), | |
| ("Voidfall", "/boardgame/337627/voidfall", "Repel the Voidborn and restore Domineum in this space themed, heavy Euro.", "hotness-source-44.png", "up"), | |
| ("Cascadia", "/boardgame/295947/cascadia", "Create the most harmonious ecosystem as you puzzle together habitats and wildlife.", "hotness-source-45.png", "up"), | |
| ("Dune: Imperium", "/boardgame/316554/dune-imperium", "Influence, intrigue, and combat in the universe of Dune.", "hotness-source-46.png", "up"), | |
| ("Raiders of Scythia", "/boardgame/301880/raiders-of-scythia", "Raid and plunder your way through ancient empires on horseback.", "hotness-source-47.png", "down"), | |
| ("Slay the Spire: The Board Game", "/boardgame/338960/slay-the-spire-the-board-game", "Craft a unique deck, discover powerful relics, and Slay the Spire together!", "hotness-source-48.png", "down"), | |
| ("Hell of a Deal", "/boardgame/463605/hell-of-a-deal", "A cooperative poker game against The Devil Himself!", "hotness-source-49.png", "down"), | |
| ("Flip 7", "/boardgame/420087/flip-7", "Score the cards in front of you, or take another card, risking everything you hold?", "hotness-source-50.png", "down"), | |
| ) | |
| HOME_CROWDFUNDING = ( | |
| ("Raiders of Scythia: Omens", "/boardgameexpansion/474403/raiders-of-scythia-omens", "Ends 9月3日", "1724 Backers", "Omens bring new rules and variation to each play.", True, "crowdfunding-01.png", "+ 1 more", "/project/link/version/807632?featured=1&location=bggexplorehome"), | |
| ("Medici Traders", "/boardgame/468582/medici-traders", "Ends in 3 hours", "606 Backers", "Merchants win auctioned goods and shrewdly pack their ships in 15th century Florence.", False, "crowdfunding-medici.png", "+ 3 more", "/project/link/version/797778?location=bggexplorehome"), | |
| ("Rift Zone: Contact", "/boardgame/404270/rift-zone-contact", "Ends in 4 hours", "78 Backers", "Command sci-fi units using real minis with app-driven combat.", False, "crowdfunding-02.png", "", "/project/link/version/686155?location=bggexplorehome"), | |
| ("Wyvern Moor: The Dungeon Crawl Card Game", "/boardgame/401639/wyvern-moor-the-dungeon-crawl-card-game", "Ends in 11 hours", "925 Backers", "Manage your abilities, defeat threats, and explore the dungeons of Wyvern Moor.", False, "crowdfunding-03.png", "", "/project/link/version/681482?location=bggexplorehome"), | |
| ("Mexica", "/boardgame/2955/mexica", "Ends in 16 hours", "922 Backers", "Build the old Aztec city of Tenochtitlan with flowing canals and beautiful temples.", False, "crowdfunding-04.png", "+ 3 more", "/project/link/version/802862?location=bggexplorehome"), | |
| ("Snowp", "/boardgame/452143/snowp", "Ends 8月27日", "462 Backers", "Flick rings to snatch colorful bells in a fast, frosty showdown.", False, "crowdfunding-source-06.png", "", "/project/link/version/808028?location=bggexplorehome"), | |
| ("Out of Print: Base Set", "/boardgame/474762/out-of-print-base-set", "Ends 8月29日", "1549 Backers", "Escape the book before the book traps you inside forever.", False, "crowdfunding-source-07.png", "+ 1 more", "/project/link/version/808222?location=bggexplorehome"), | |
| ("Steel Wolves and German Fleet Boats: Deluxe Edition", "/boardgame/439437/steel-wolves-and-german-fleet-boats-deluxe-edition", "Ends 8月30日", "150 Backers", "Lead German submarine against British and Allied shipping", False, "crowdfunding-source-08.png", "", "/project/link/version/746873?location=bggexplorehome"), | |
| ("City of Demons", "/boardgame/417457/city-of-demons", "Ends 8月31日", "51 Backers", "Race into the heart of a post-apocalytic city, evading demons and collecting gear.", False, "crowdfunding-source-09.png", "", "/project/link/version/707231?location=bggexplorehome"), | |
| ("Cirque", "/boardgame/473993/cirque", "Ends 9月1日", "217 Backers", "Welcome to the Big Top! Build the most wondrous circus and become top Ringleader.", False, "crowdfunding-source-10.png", "", "/project/link/version/806936?location=bggexplorehome"), | |
| ("Omega: The Dome", "/boardgame/475252/omega-the-dome", "Ends 9月1日", "145 Backers", "Highrollers rig bets on twelve galactic gladiators fighting to survive The Dome.", False, "crowdfunding-source-11.png", "", "/project/link/version/809099?location=bggexplorehome"), | |
| ("Echoes of Artemis", "/boardgame/445634/echoes-of-artemis", "Ends 9月1日", "320 Backers", "Factions compete for control of the galaxy in an epic space adventure.", False, "crowdfunding-source-12.png", "", "/project/link/version/757678?location=bggexplorehome"), | |
| ("Dead by Daylight: The Board Game – Auris Box", "/boardgameexpansion/466738/dead-by-daylight-the-board-game-auris-box", "Ends 9月2日", "2316 Backers", "The ultimate storage solution for Killers and Survivors alike!", False, "crowdfunding-source-13.png", "", "/project/link/version/794669?location=bggexplorehome"), | |
| ("Aldarra: New Empire", "/boardgameexpansion/470041/aldarra-new-empire", "Ends 9月2日", "592 Backers", "The conflict for Aldarra expands and evolves into a new stage of empire building!", False, "crowdfunding-source-14.png", "", "/project/link/version/800182?location=bggexplorehome"), | |
| ("Whisperwood", "/boardgame/450830/whisperwood", "Ends 9月3日", "2750 Backers", "Use druidic magic to restore the flora and fauna of a corrupted forest.", False, "crowdfunding-source-15.png", "", "/project/link/version/766723?location=bggexplorehome"), | |
| ("TworDuel", "/boardgame/473283/tworduel", "Ends 9月3日", "141 Backers", "Two person, competitive, point-scoring Wordle with 6 & 7 letter words.", False, "crowdfunding-source-16.png", "", "/project/link/version/805583?location=bggexplorehome"), | |
| ("Lords of the Manor", "/boardgame/471764/lords-of-the-manor", "Ends 9月3日", "183 Backers", "Four years. Four lords. Feed, trade, tax, produce, and scheme your way to greatness.", False, "crowdfunding-source-17.png", "", "/project/link/version/802975?location=bggexplorehome"), | |
| ("Otsuki", "/boardgame/464230/otsuki", "Ends 9月3日", "218 Backers", "Animals strive to achieve their highest spiritual self and become a guide to all.", False, "crowdfunding-source-18.png", "", "/project/link/version/790252?location=bggexplorehome"), | |
| ("The Priest", "/boardgame/476473/the-priest", "Ends 9月4日", "272 Backers", "A priest stands alone against an endless undead siege.", False, "crowdfunding-source-19.png", "", "/project/link/version/811342?location=bggexplorehome"), | |
| ("Ladybird", "/boardgame/457313/ladybird", "Ends 9月5日", "128 Backers", "Build ladybird life cycles in a cozy but tense garden showdown!", False, "crowdfunding-source-20.png", "", "/project/link/version/778387?location=bggexplorehome"), | |
| ("River Dragons Giant", "/boardgame/634/river-dragons", "Ends 9月8日", "79 Backers", "Cross the river by building bridges, disturbing other players, and avoiding falling!", False, "crowdfunding-source-21.png", "", "/project/link/version/812803?location=bggexplorehome"), | |
| ("Mykerinos: Special Edition", "/boardgame/473010/mykerinos-special-edition", "Ends 9月8日", "380 Backers", "Lead archaeological expeditions across Egypt and turn your discoveries into prestige.", False, "crowdfunding-source-22.png", "", "/project/link/version/805143?location=bggexplorehome"), | |
| ("Gay Dating Game", "/boardgame/477246/gay-dating-game", "Ends 9月10日", "650 Backers", "Compete to earn the highest body count by \"dating\" with as many guys as possible.", False, "crowdfunding-source-23.png", "", "/project/link/version/812495?location=bggexplorehome"), | |
| ("Snap Ships Tactics", "/boardgame/363841/snap-ships-tactics", "Ends 9月11日", "885 Backers", "Build modular miniature spacecraft and test their unique capabilities in battle.", False, "crowdfunding-source-24.png", "+ 6 more", "/project/link/version/811857?location=bggexplorehome"), | |
| ("Spirit Train", "/boardgame/472506/spirit-train", "Ends 9月15日", "1816 Backers", "Conductors aboard an ancient railway befriend and carry spirits toward the afterlife.", False, "crowdfunding-source-25.png", "", "/project/link/version/804289?location=bggexplorehome"), | |
| ("Tank Clash: Eastern Front", "/boardgame/426146/tank-clash-eastern-front", "Ends 9月17日", "99 Backers", "The stage is set for the largest clash of late-WW2 heavy armour.", False, "crowdfunding-source-26.png", "", "/project/link/version/723355?location=bggexplorehome"), | |
| ("The Monolith", "/boardgame/469969/the-monolith", "Ends 9月17日", "1211 Backers", "Slaughter your foes and offer their hearts to the almighty Monolith!", False, "crowdfunding-source-27.png", "", "/project/link/version/800069?location=bggexplorehome"), | |
| ("Star Squadron: Eisenkiesel vs Vermarine", "/boardgame/477449/star-squadron-eisenkiesel-vs-vermarine", "Ends 9月18日", "228 Backers", "Secretly plot maneuvers to outfly and outgun a rival starfighter squadron.", False, "crowdfunding-source-28.png", "+ 1 more", "/project/link/version/812764?location=bggexplorehome"), | |
| ("Overclock", "/boardgame/473667/overclock", "Ends 9月22日", "120 Backers", "A solo 4x card game of network building, faction deals, and digital survival.", False, "crowdfunding-source-29.png", "", "/project/link/version/806330?location=bggexplorehome"), | |
| ("Uncantations", "/boardgame/474283/uncantations", "Ends 9月23日", "53 Backers", "Teams of mages cast spells across a chasm to thwart their foes.", False, "crowdfunding-source-30.png", "", "/project/link/version/807422?location=bggexplorehome"), | |
| ("The Altered: Anomaly Containment Archives", "/boardgame/476350/the-altered-anomaly-containment-archives", "Ends 10月10日", "1153 Backers", "Review anomalous case files and rule who remains human and who must be contained.", False, "crowdfunding-source-31.png", "", "/project/link/version/811108?location=bggexplorehome"), | |
| ) | |
| HOME_RAIL_MODULES = ( | |
| { | |
| "title": "Featured Videos", "filename": "featured-videos.png", "height": 338, | |
| "image_y": 83, "image_height": 143, | |
| "items": ( | |
| (38, "Top 10 Big Deck Games", "Aug 21", ""), | |
| (306, "Market Fresh - GameNight! Se14 Ep14 - How to Play & Playthrough", "Aug 20", ""), | |
| (574, "Top 5 for August 2026 - Top 5's w/ Our Family Plays Games", "Aug 19", ""), | |
| (841, "GameNight! LIVE!! Tonight! Seashells w/ Nikki & Lincoln...", "Aug 18", ""), | |
| (1109, "Outremer - BGG How to Play", "Aug 17 · Sponsored", ""), | |
| ), | |
| }, | |
| { | |
| "title": "Bestsellers", "subtitle": "Week of Aug 17–Aug 23", "filename": "bestsellers.png", "height": 418, | |
| "image_y": 111, "image_height": 143, | |
| "items": ( | |
| (38, "Wingspan Pocket", "1 · trending up", "Swiftly build and activate a row of colorful birds."), | |
| (306, "Magical Athlete", "2 · trending down", "Pit a cast of crazy characters against each other in a madcap race to the finish."), | |
| (574, "Flip 7", "3 · trending down", "Score the cards in front of you, or take another card, risking everything you hold?"), | |
| (841, "Harmonies", "4 · trending up", "Create your own landscape and habitats to welcome animals."), | |
| (1109, "dnup", "5 · trending down", "Flip cards to get the right numbers and ditch your cards."), | |
| ), | |
| }, | |
| { | |
| "title": "Giveaway Contests", "subtitle": "Answer questions for a chance to win – Sponsored", "filename": "contests.png", "height": 364, | |
| "image_y": 111, "image_height": 142, | |
| "items": ( | |
| (38, "Medico Contest", "Pegasus Spiele · Ends Aug 28", ""), | |
| (306, "The Crew: Journey to the Ends of the Earth Contest", "Thames & Kosmos · Ended Aug 19", ""), | |
| (574, "Crab Rage! Contest", "Osprey Games · Ended Aug 5", ""), | |
| (841, "Sniper Elite: Operation Kraken Contest", "Rebellion Unplugged · Ended Jul 31", ""), | |
| (1109, "Pandasaurus Games Contest", "Pandasaurus Games · Ended Jul 27", ""), | |
| ), | |
| }, | |
| { | |
| "title": "Most Played Games", "subtitle": "Month of July", "filename": "most-played.png", "height": 419, | |
| "image_y": 112, "image_height": 142, | |
| "items": ( | |
| (38, "Flip 7", "1 · flat", "Score the cards in front of you, or take another card, risking everything you hold?"), | |
| (306, "Harmonies", "2 · flat", "Create your own landscape and habitats to welcome animals."), | |
| (574, "Ark Nova", "3 · trending up", "Plan and build a modern, scientifically managed zoo to support conservation projects."), | |
| (841, "Castle Combo", "4 · trending down", "Combine medieval villagers and castle dwellers to score points."), | |
| (1109, "Wingspan", "5 · flat", "Attract a beautiful and diverse collection of birds to your wildlife preserve."), | |
| ), | |
| }, | |
| { | |
| "title": "Hot In-Depth Reviews", "filename": "reviews.png", "height": 335, | |
| "image_y": 82, "image_height": 141, | |
| "items": ( | |
| (38, "Why High Frontier?", "hombrepollo · 👍 83 · 💬 9", ""), | |
| (306, "Wingspan Pocket: Headlines from a Solo Player", "headlines_soloplayer · 👍 50 · 💬 2", ""), | |
| (574, "Whisperwood - A Meeple Mountain Review", "mozartsmimi · 👍 50 · 💬 9", ""), | |
| (841, "It's the end of the world as we know it and I feel fine", "broonski · 👍 43 · 💬 3", ""), | |
| (1109, "Arcs Blew Me Away - Don't Judge a Book by Its Tutorial", "Kwis · 👍 42 · 💬 30", ""), | |
| ), | |
| }, | |
| { | |
| "title": "Hot GeekLists", "filename": "geeklists.png", "height": 295, | |
| "image_y": 84, "image_height": 100, | |
| "items": ( | |
| (38, "10 Board Games I'd Buy If I Had to Start my Collection Over", "BoardGaymesJames · 👍 25", ""), | |
| (306, "Your Thrift Store/Bargain Finds 24-30 Aug 2026", "CinMel · 👍 17", ""), | |
| (574, "What Did You Play This Week? #904 - August 17 - 23, 2026", "pkunes · 👍 15", ""), | |
| (841, "GCL Phoenix 816-Read the Room (23 August 2026)", "MelbaMo · 👍 13", ""), | |
| (1109, "DoaMcoN VI - Kansas City, MO", "jwgeist00 · 👍 13", ""), | |
| ), | |
| }, | |
| { | |
| "title": "Hot Videos", "filename": "hot-videos.png", "height": 338, | |
| "image_y": 84, "image_height": 142, | |
| "items": ( | |
| (38, "Market Fresh - GameNight! Se14 Ep14 - How to Play & Playthrough", "heccubus · 👍 32 · 💬 3", ""), | |
| (306, "The Discriminating Gamer: Cody's Top 100 Games 2026 (#70-61)", "discriminatingGamer · 👍 17 · 💬 4", ""), | |
| (574, "How to Play World Order in 27 Minutes", "RTFMShow · 👍 15 · 💬 6", ""), | |
| (841, "Coast Watchers [Gameplay overview] (GMT Games 2026)", "Amnese · 👍 14 · 💬 1", ""), | |
| (1109, "The Discriminating Gamer: Flying Fortress: B-17 Missions Over Europe", "discriminatingGamer · 👍 12", ""), | |
| ), | |
| }, | |
| { | |
| "title": "The Geek Weekly", "subtitle": "Our recap of things you might have missed this week.", "filename": "geek-weekly.png", "height": 433, | |
| "image_y": 111, "image_height": 180, "wide": True, | |
| "items": ( | |
| (38, "This couple is giving away games to celebrate their wedding", "AROUND THE GEEK", "Come celebrate with them!"), | |
| (373, "A Perfect Dominion Gift", "AROUND THE GEEK · by ButtercupVB", "This touching story surrounding Dominion is worth a read."), | |
| (708, "Combat!: Eastern Front", "VIDEO OF THE WEEK · by chezinkle", ""), | |
| (1042, "Orloj: The Prague Astronomical Clock", "PIC OF THE WEEK · by HoopyFroodJay", ""), | |
| ), | |
| }, | |
| { | |
| "title": "Geek Shopping", "subtitle": "Fresh gaming deals from our stores.", "filename": "shopping.png", "height": 482, | |
| "image_y": 134, "image_height": 144, | |
| "items": ( | |
| (53, "Little Plastic Train Co – Set of 48 Trains", "New", "$19.99 BGG Store"), | |
| (321, "Tenpenny Parks: Fast Pass Mini Expansion", "New", "$5.00 BGG Store"), | |
| (589, "Gamegenic – Prime Sleeves, Standard (66 x 91 mm)", "New", "$11.99 BGG Store"), | |
| (857, "GeekUp Bit Set: Cubitos – Metal Coins", "New", "$19.00 BGG Store"), | |
| (1125, "GeekUp Box Set: Cubitos – Storage Box Set", "New", "$20.00 BGG Store"), | |
| ), | |
| }, | |
| { | |
| "title": "New Releases", "subtitle": "Weekly list of the most recent game releases.", "filename": "new-releases.png", "height": 415, | |
| "image_y": 112, "image_height": 142, | |
| "items": ( | |
| (38, "Wingspan Pocket", "by Stonemaier Games", "Swiftly build and activate a row of colorful birds."), | |
| (306, "Duel of Meloch", "by Stonemaier Games", "Scythe vs Expeditions: Clash head-to-head on a tight map in a race to victory."), | |
| (574, "King of Tokyo - Godzilla", "by Iello", "The True King of Monsters finally joins King of Tokyo!"), | |
| (841, "Ostia (Mariner Edition)", "by uchibacoya", "Amass a merchant fleet, establish ports and trade goods in ancient Rome."), | |
| (1109, "Children of Blood Small Campaign Expansion", "by Fantasy Flight Games", "Struggle against vampires over three scenarios in Arkham."), | |
| ), | |
| }, | |
| ) | |
| HOME_SPLIT_MODULES = ( | |
| { | |
| "filename": "news-discussions.png", "height": 525, | |
| "columns": ( | |
| ("Board Gaming News", (("Sure, I'll Play Monopoly", "Justin Bell · BoardGameGeek Blog · 👍 233 · 💬 55"), ("Designer Diary: Countryball Cards", "Jakov J · BoardGameGeek Blog · 👍 55 · 💬 14"), ("Design Diary - Pintó", "fernando marecos · BoardGameGeek Blog · 👍 64 · 💬 8"), ("Gifts and Guides – The Geek Weekly Issue #632", "Brad Cummings · The Geek Weekly · 💬 22"), ("The Mandalorian Saved the Falling Bird from the Pop Art below", "Steph Hodge · BoardGameGeek Blog · 👍 72 · 💬 7"))), | |
| ("Hot Discussions", (("Board Game Sporcle Quiz 156: -- Game of Frames – Board Games by Famous Artists --", "Kire · General Gaming · 👍 47 · 💬 27"), ("New Scam Website", "DenverZeppo · General Gaming · 👍 59 · 💬 7"), ("AI in Board Game Quiz Creation: Creative Tool or Turn-Off?", "Kire · General Gaming · 👍 30 · 💬 76"), ("Suchmaschine für Spielertreffen", "JensG610 · Germany · 👍 29 · 💬 10"), ("What's the real appeal of a big board game collection?", "EnviousSaturn · General Gaming · 👍 21 · 💬 47"))), | |
| ), | |
| }, | |
| { | |
| "filename": "blogs-forums.png", "height": 525, | |
| "columns": ( | |
| ("Blogs", (("Number 9", "Anthony Boydell · Everyone Needs A Shed · 👍 94 · 💬 3"), ("“You better put how I beat you in your blog Graham!”", "Graham S · GrahamS Games · 👍 52 · 💬 4"), ("'Twas in the darkest depths of Mordor, I met a girl so fair", "Warren White · My Board Game Life · 👍 36 · 💬 12"), ("Every Day Gotham Looks Less Crazy", "SeerMagic · Thematic Colors of Gaming · 👍 31 · 💬 2"), ("Triple Threat - Science Fiction (Sci-Fi) Games", "Josiah Matson · Journey Into the Unknown · 👍 30 · 💬 23"))), | |
| ("Game Forums", (("Anachrony – Anachrony Solo Assistant for Chronossus and Chronobot", "shawnmarx · General · 👍 40 · 💬 4"), ("Eleven: Football Manager Board Game – I assume everyone has probably moved on from this game", "JK777 · General · 👍 32 · 💬 9"), ("Holland '44: Operation Market-Garden – Addictive Game", "smalsom · General · 👍 27 · 💬 4"), ("On Hell's Highway – Preorder is live", "Marty S · News · 👍 24 · 💬 3"), ("Burning Banners – Burning Banners on Steam!", "Kevin Rhorer · General · 👍 24 · 💬 4"))), | |
| ), | |
| }, | |
| { | |
| "filename": "community-lists.png", "height": 525, | |
| "columns": ( | |
| ("Women and Gaming", (("What does your perfect boardgame look like?", "Esmeralda de Vries · 👍 9 · 💬 19"), ("Decluttering - All the Things", "weyrbrat · 👍 35 · 💬 17"), ("A woman board game designer from Vietnam", "plumtran · 👍 106 · 💬 30"), ("Women Publishers", "BlueSkyGames · 👍 18 · 💬 16"), ("What are your favourite people/characters in your board games?", "Leila_Drake · 👍 9 · 💬 19"))), | |
| ("Rainbow BGGers", (("Third Space in Durham, NC: Guildhall Games has moved to downtown!", "UnawareWolfe · 👍 7"), ("Above the Rainbow ~~", "Tiantiangame · 👍 6 · 💬 2"), ("What Did You Get Played in July 2026?", "blueseqperl · 👍 4 · 💬 10"), ("Your July 2026 Purges?", "blueseqperl · 💬 5"), ("Your July 2026 Acquisitions?", "blueseqperl · 👍 3 · 💬 11"))), | |
| ), | |
| }, | |
| ) | |
| def home_module_header(title: str, subtitle: str = "", href: str = "#") -> str: | |
| sub = f'<p class="home-module-subtitle">{e(subtitle)}</p>' if subtitle else "" | |
| return f'''<header class="home-module-header"><h2>{e(title)} <a href="{e(href)}">See All <span aria-hidden="true">›</span></a></h2>{sub}</header>''' | |
| def home_hotness_cards() -> str: | |
| cards = [] | |
| for index, (title, href, description, asset, trend) in enumerate(HOME_HOTNESS, 1): | |
| cards.append(f'''<li class="home-media-card"><article><a class="home-media-image" href="{e(href)}"><img src="/static/assets/home/{e(asset)}?v=3" width="288" height="162" alt="{e(title)} Artwork"></a><div class="home-media-body"><h3><a href="{e(href)}"><span class="home-rank home-rank-{e(trend)}">{index}</span>{e(title)}</a></h3><p>{e(description)}</p></div></article></li>''') | |
| return "".join(cards) | |
| def home_crowdfunding_cards() -> str: | |
| cards = [] | |
| for title, href, ending, backers, description, promoted, asset, extra, project_href in HOME_CROWDFUNDING: | |
| badge = '<span class="promoted">★ Promoted</span>' if promoted else "" | |
| extra_markup = f'<span class="more-projects">, {e(extra)}</span>' if extra else "" | |
| cards.append(f'''<li class="home-media-card crowdfunding-card"><article><a class="home-media-image" href="{e(href)}"><img src="/static/assets/home/{e(asset)}?v=3" width="288" height="162" alt="{e(title)} Artwork">{badge}</a><span class="funding-progress"></span><div class="home-media-body"><h3><a href="{e(href)}">{e(title)}</a>{extra_markup}</h3><p class="funding-meta"><span>{e(ending)}</span><span>{e(backers)}</span></p><p>{e(description)}</p></div></article><a class="visit-project" href="{e(project_href)}">Visit Project <span aria-hidden="true">↗</span></a></li>''') | |
| return "".join(cards) | |
| def source_sprite(filename: str, x: int, y: int, width: int, height: int, alt: str) -> str: | |
| return f'''<span class="source-sprite" style="--crop-x:{x};--crop-y:{y};--crop-width:{width};--crop-height:{height}"><img src="/static/assets/home/sections/{e(filename)}" width="1400" alt="{e(alt)}"></span>''' | |
| HOME_MODULE_DESTINATIONS = { | |
| "Featured Videos": "/videos/boardgame/all", | |
| "Bestsellers": "/trends/bestsellers", | |
| "Giveaway Contests": "/contests", | |
| "Most Played Games": "/trends/mostplayed", | |
| "Hot In-Depth Reviews": "/threads/reviews", | |
| "Hot GeekLists": "/geeklists", | |
| "Hot Videos": "/videos/boardgame/all?sort=hot", | |
| "The Geek Weekly": "/blog/1/boardgamegeek-blog", | |
| "Geek Shopping": "/market", | |
| "New Releases": "/recentadditions", | |
| } | |
| HOME_SPLIT_DESTINATIONS = { | |
| "Board Gaming News": "/blogs/posts", | |
| "Hot Discussions": "/threads/region/1?sort=hot&interval=twodays", | |
| "Blogs": "/blogs/posts", | |
| "Game Forums": "/threads/gameforums", | |
| "Women and Gaming": "/guild/home", | |
| "Rainbow BGGers": "/guild/home", | |
| } | |
| def home_rail_module(module: dict[str, object]) -> str: | |
| wide = bool(module.get("wide")) | |
| image_width = 320 if wide else 253 | |
| cards = [] | |
| destination = HOME_MODULE_DESTINATIONS[str(module["title"])] | |
| for x, title, meta, description in module["items"]: | |
| image = source_sprite(str(module["filename"]), int(x), int(module["image_y"]), image_width, int(module["image_height"]), str(title)) | |
| description_markup = f'<p>{e(description)}</p>' if description else "" | |
| price = str(description).startswith("$") | |
| if price: | |
| description_markup = f'<a class="shop-price" href="/store">{e(description)}</a>' | |
| cards.append(f'''<li class="home-source-card"><article><a class="home-source-image" href="{e(destination)}">{image}</a><h3><a href="{e(destination)}">{e(title)}</a></h3><p class="home-source-meta">{e(meta)}</p>{description_markup}</article></li>''') | |
| classes = "home-dom-module home-source-rail" + (" home-source-wide" if wide else "") + (" home-shopping" if module["title"] == "Geek Shopping" else "") | |
| return f'''<section class="{classes}" style="--module-height:{int(module['height'])}px" aria-label="{e(module['title'])}">{home_module_header(str(module['title']), str(module.get('subtitle', '')), destination)}<div class="home-source-overflow"><button class="rail-control rail-previous" type="button" aria-label="Previous {e(module['title'])}">‹</button><ul class="home-source-list">{"".join(cards)}</ul><button class="rail-control rail-next" type="button" aria-label="Next {e(module['title'])}">›</button></div></section>''' | |
| def home_split_module(module: dict[str, object]) -> str: | |
| columns = [] | |
| for column_index, (heading, items) in enumerate(module["columns"]): | |
| destination = HOME_SPLIT_DESTINATIONS[str(heading)] | |
| rows = [] | |
| for index, (title, meta) in enumerate(items): | |
| x = 38 if column_index == 0 else 739 | |
| y = 83 + (index * 85) | |
| thumb = source_sprite(str(module["filename"]), x, y, 60, 60, str(title)) | |
| rows.append(f'''<li><a class="split-thumb" href="{e(destination)}">{thumb}</a><div><h3><a href="{e(destination)}">{e(title)}</a></h3><p>{e(meta)}</p></div></li>''') | |
| columns.append(f'''<section class="home-split-column"><header><h2>{e(heading)}</h2><a href="{e(destination)}">See All <span aria-hidden="true">›</span></a></header><ul>{"".join(rows)}</ul></section>''') | |
| return f'''<section class="home-dom-module home-split-module" style="--module-height:{int(module['height'])}px">{"".join(columns)}</section>''' | |
| def home_hot_images() -> str: | |
| crops = ((38, 112, 255, 306), (305, 112, 122, 131), (439, 112, 121, 131), (572, 112, 254, 131), (840, 112, 122, 131), (973, 112, 122, 131), (1107, 112, 121, 131), (1240, 112, 121, 131), (305, 254, 122, 131), (439, 254, 121, 131), (572, 254, 122, 131), (706, 254, 120, 131)) | |
| destination = "/images/boardgame/all?sort=hot" | |
| tiles = "".join(f'''<li><a href="{destination}">{source_sprite("hot-images.png", x, y, width, height, f"Hot board game image {index}")}</a></li>''' for index, (x, y, width, height) in enumerate(crops, 1)) | |
| return f'''<section class="home-dom-module home-images-module" style="--module-height:425px">{home_module_header("Hot Images", "The top trending images on BGG today.", destination)}<ul class="home-image-mosaic">{tiles}</ul></section>''' | |
| def home_creator_module(filename: str, creator: str, description: str, dates: tuple[str, ...]) -> str: | |
| titles = ( | |
| "Hell of a Deal - Unboxing", | |
| "Questline", | |
| "Shards of Creation - Unboxing", | |
| "Viking Traders - Unboxing", | |
| "Latest tabletop playthrough", | |
| ) if creator == "Dad vs Daughter" else ( | |
| "Final Girl Series 4 - Raptor games! Board game solo playthrough", | |
| "Defenders of the Wild 2nd edition - what's new?", | |
| "Nemesis Aliens Board Game Solo Play Campaign", | |
| "Nemesis untold stories 1 - board game solo", | |
| "Defenders of the Wild expansion: Critter Moon", | |
| ) | |
| channel = source_sprite(filename, 38, 83, 200, 200, f"{creator} channel artwork") | |
| cards = [] | |
| for index, (title, date) in enumerate(zip(titles, dates)): | |
| cards.append(f'''<li><article><a class="creator-video-image" href="/videos/boardgame/all">{source_sprite(filename, 38 + index * 268, 321, 253, 143, title)}</a><h3><a href="/videos/boardgame/all">{e(title)}</a></h3><p>{e(date)}</p></article></li>''') | |
| return f'''<section class="home-dom-module home-creator-module" style="--module-height:576px"><header><h2>Creator Spotlight</h2><a href="/videos/boardgame/all">View Channel <span aria-hidden="true">›</span></a></header><div class="creator-profile"><a href="/videos/boardgame/all">{channel}</a><div><h3>{e(creator)}</h3><p>YouTube Channel</p><p>{e(description)}</p></div></div><div class="home-source-overflow"><button class="rail-control rail-previous" type="button" aria-label="Previous creator videos">‹</button><ul class="creator-video-list">{"".join(cards)}</ul><button class="rail-control rail-next" type="button" aria-label="Next creator videos">›</button></div></section>''' | |
| def home_long_modules() -> str: | |
| rail = {str(item["filename"]): home_rail_module(item) for item in HOME_RAIL_MODULES} | |
| split = {str(item["filename"]): home_split_module(item) for item in HOME_SPLIT_MODULES} | |
| creator_dad = home_creator_module("creator-dad.png", "Dad vs Daughter", "This is a collection of play through videos of various games between a dad and his daughter (and sometimes Dad and his friends) to help show how a game is played.", ("Yesterday", "Aug 23", "Aug 21", "Aug 20", "Aug 19")) | |
| creator_queen = home_creator_module("creator-queen.png", "Queen of the Board", "Join Queen of the Board as they dive into the world of tabletop gaming with fun playthroughs and reviews of the latest crowdfunding releases and cooperative or solo games.", ("Aug 16", "Mar 3", "Feb 28", "Feb 28", "Feb 25")) | |
| return "".join(( | |
| rail["featured-videos.png"], rail["bestsellers.png"], split["news-discussions.png"], rail["contests.png"], | |
| rail["most-played.png"], rail["reviews.png"], rail["geeklists.png"], split["blogs-forums.png"], | |
| home_hot_images(), rail["hot-videos.png"], creator_dad, rail["geek-weekly.png"], rail["shopping.png"], | |
| rail["new-releases.png"], creator_queen, split["community-lists.png"], | |
| )) | |
| def home() -> HTMLResponse: | |
| body = f"""<div class="home-root"><div class="home-leaderboard inert-ad-slot" role="note" aria-label="Advertisement slot"><span>Advertisement</span></div><section class="card home-shell" data-region="main"><nav class="subnav" aria-label="Explore navigation"><a class="active" href="/">Explore</a><a href="/dashboard">Dashboard</a></nav> | |
| <div class="section feature-grid"><h2>Featured Stories</h2><div class="feature-story"><figure class="feature-hero"><a href="/blog/1/blogpost/190141/sure-ill-play-monopoly"><img src="/static/assets/home-hero.jpg" width="825" height="450" alt="Sure, I'll Play Monopoly w/ Justin Bell Primary Thumbnail"></a><figcaption><h3><a href="/blog/1/blogpost/190141/sure-ill-play-monopoly">Sure, I'll Play Monopoly w/ Justin Bell</a></h3><p>by <a href="/blog/1?bloggerid=19795">Justin Bell</a> · <a href="/blog/1/boardgamegeek-blog">BoardGameGeek Blog</a></p></figcaption></figure> | |
| <ul class="feature-list"><li><img src="/static/assets/secondary-bariloche.jpg" alt="Designer Diary: Bariloche Secondary Thumbnail"><div><h3><a href="/blog/1/blogpost/190061/designer-diary-bariloche">Designer Diary: Bariloche</a></h3><p>by Martin Oddino · BoardGameGeek Blog</p></div></li><li><img src="/static/assets/secondary-countryball.png" alt="Designer Diary: Countryball Cards Secondary Thumbnail"><div><h3><a href="/blog/1/blogpost/188807/designer-diary-countryball-cards">Designer Diary: Countryball Cards</a></h3><p>by Jakov J · BoardGameGeek Blog</p></div></li><li><img src="/static/assets/secondary-big-deck.jpg" alt="Top 10 Big Deck Games Secondary Thumbnail"><div><h3><a href="/video/626255/boardgamegeektv/top-10-big-deck-games">Top 10 Big Deck Games</a></h3><p>by boardgamegeektv</p></div></li><li><img src="/static/assets/secondary-game-night.jpg" alt="Market Fresh - GameNight! Secondary Thumbnail"><div><h3><a href="/video/626076/market-fresh">Market Fresh - GameNight!</a></h3><p>by heccubus</p></div></li></ul></div></div> | |
| <section class="home-module home-hotness">{home_module_header("The Hotness", "Top 50 trending games today", "/hotness")}<div class="home-media-overflow"><ul class="home-media-rail">{home_hotness_cards()}</ul><nav class="home-rail-controls" aria-label="The Hotness carousel"><button type="button" data-rail-previous aria-label="Previous">‹</button><button type="button" data-rail-next aria-label="Next">›</button></nav></div></section> | |
| <section class="home-module home-crowdfunding">{home_module_header("Crowdfunding Countdown", "Projects ending soon", "/crowdfunding")}<div class="home-media-overflow"><ul class="home-media-rail">{home_crowdfunding_cards()}</ul><nav class="home-rail-controls" aria-label="Crowdfunding Countdown carousel"><button type="button" data-rail-previous aria-label="Previous">‹</button><button type="button" data-rail-next aria-label="Next">›</button></nav></div></section> | |
| {home_long_modules()} | |
| </section></div>""" | |
| return response(shell("BoardGameGeek | Gaming Unplugged Since 2000", body)) | |
| def source_game_icon(name: str, *, label: str = "") -> str: | |
| paths = { | |
| "link": '<path d="M9.4 14.6 7.3 16.7a4 4 0 0 1-5.7-5.7l3-3a4 4 0 0 1 5.2-.4L8.2 9.2a2 2 0 0 0-2.2.2l-3 3a2 2 0 1 0 2.8 2.8l2.1-2.1 1.5 1.5Zm1.2-9.2 2.1-2.1A4 4 0 1 1 18.4 9l-3 3a4 4 0 0 1-5.2.4l1.6-1.6a2 2 0 0 0 2.2-.2l3-3a2 2 0 1 0-2.8-2.8l-2.1 2.1-1.5-1.5Zm-4 8 6.8-6.8 1.4 1.4L8 14.8l-1.4-1.4Z"/>', | |
| "rank": '<path d="m3 6 4 4 5-7 5 7 4-4-2 11H5L3 6Zm3.2 9h11.6l.8-4.7-1.9 2-4.7-6.5-4.7 6.5-1.9-2 .8 4.7Z"/>', | |
| "settings": '<path d="M19.4 13a7.3 7.3 0 0 0 0-2l2-1.6-2-3.5-2.5 1A8 8 0 0 0 15.2 6L14.8 3h-4l-.4 3a8 8 0 0 0-1.7.9l-2.5-1-2 3.5 2 1.6a7.3 7.3 0 0 0 0 2l-2 1.6 2 3.5 2.5-1a8 8 0 0 0 1.7.9l.4 3h4l.4-3a8 8 0 0 0 1.7-.9l2.5 1 2-3.5-2-1.6ZM12 15.5a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7Z"/>', | |
| "share": '<path d="M18 16a3 3 0 0 0-2.3 1.1L8.9 13a3.2 3.2 0 0 0 0-2l6.8-4.1A3 3 0 1 0 15 5l-6.8 4.1A3 3 0 1 0 8.2 15l6.8 4.1A3 3 0 1 0 18 16Z"/>', | |
| "rss": '<path d="M5 4a15 15 0 0 1 15 15h-3A12 12 0 0 0 5 7V4Zm0 6a9 9 0 0 1 9 9h-3a6 6 0 0 0-6-6v-3Zm2 6a2 2 0 1 1 0 4 2 2 0 0 1 0-4Z"/>', | |
| "edit": '<path d="m4 17-.8 3.8L7 20l10.9-10.9-3-3L4 17Zm16.7-10.7a1 1 0 0 0 0-1.4l-1.6-1.6a1 1 0 0 0-1.4 0l-1.5 1.5 3 3 1.5-1.5Z"/>', | |
| "info": '<path d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm0 17a1.2 1.2 0 1 1 0-2.4A1.2 1.2 0 0 1 12 19Zm1.3-5.1v.8h-2.5v-1.4c0-1.1.7-1.8 1.6-2.5.8-.6 1.3-1 1.3-1.8 0-.9-.7-1.5-1.8-1.5-1 0-1.8.5-2.6 1.3L7.8 7.2A5.6 5.6 0 0 1 12 5.3c2.6 0 4.4 1.5 4.4 3.7 0 1.9-1.2 2.9-2.2 3.6-.6.5-.9.8-.9 1.3Z"/>', | |
| "star": '<path d="m12 2.4 3 6.1 6.8 1-4.9 4.8 1.2 6.7-6.1-3.2L5.9 21l1.2-6.7-4.9-4.8 6.8-1 3-6.1Z"/>', | |
| "cart": '<path d="M3 4h2l2.3 10.2a2 2 0 0 0 2 1.6h7.8a2 2 0 0 0 1.9-1.4L21 8H7l-.5-2H3V4Zm6.5 13.5a1.7 1.7 0 1 0 0 3.4 1.7 1.7 0 0 0 0-3.4Zm7.5 0a1.7 1.7 0 1 0 0 3.4 1.7 1.7 0 0 0 0-3.4Z"/>', | |
| "tag": '<path d="m3 12 9 9 9-9-9-9H3v9Zm5-5.5A1.5 1.5 0 1 1 8 9a1.5 1.5 0 0 1 0-3Z"/>', | |
| "grid": '<path d="M3 3h5v5H3V3Zm6.5 0h5v5h-5V3ZM16 3h5v5h-5V3ZM3 9.5h5v5H3v-5Zm6.5 0h5v5h-5v-5Zm6.5 0h5v5h-5v-5ZM3 16h5v5H3v-5Zm6.5 0h5v5h-5v-5Zm6.5 0h5v5h-5v-5Z"/>', | |
| "heart": '<path d="M12 21 4.1 13.8A6 6 0 0 1 12 4.9a6 6 0 0 1 7.9 8.9L12 21Z"/>', | |
| "chevron": '<path d="m7 9 5 5 5-5H7Z"/>', | |
| } | |
| accessible = f'<title>{e(label)}</title>' if label else "" | |
| hidden = "" if label else ' aria-hidden="true"' | |
| return f'<svg class="source-icon source-icon-{e(name)}" viewBox="0 0 24 24" focusable="false"{hidden}>{accessible}{paths[name]}</svg>' | |
| def source_pandemic_markup(game: object, status: object, saved: str) -> str: | |
| fan = bool(status and status["fan"]) | |
| gallery = ( | |
| ("gallery-01.jpg", "All the components"), | |
| ("gallery-02.jpg", "Trouble lurking in Asia!"), | |
| ("gallery-03.jpg", "Pandemic game board"), | |
| ("gallery-04.jpg", "Board"), | |
| ("gallery-05.jpg", "Pandemic cover artwork"), | |
| ("gallery-06.png", "New game pieces"), | |
| ("gallery-07.jpg", "All components unboxed"), | |
| ("gallery-08.jpg", "Player roles"), | |
| ("gallery-09.jpg", "The Scientist"), | |
| ("gallery-10.jpg", "A game in progress"), | |
| ("gallery-11.jpg", "Losing Europe"), | |
| ("gallery-12.jpg", "Beating the germs"), | |
| ) | |
| gallery_markup = "".join(f'<li><a href="/boardgame/30549/pandemic/images"><img src="/static/assets/detail/{e(filename)}" width="100" height="100" alt="{e(alt)}"></a></li>' for filename, alt in gallery) | |
| saved_rating = int(status["rating"]) if status and status["rating"] else 0 | |
| saved_comment = str(status["comment"]) if status and status["comment"] else "" | |
| in_collection = bool(status and (status["owned"] or status["wishlist"])) | |
| rating_stars = "".join( | |
| source_game_icon("star").replace('source-icon-star"', f'source-icon-star{" is-rated" if index <= saved_rating else ""}"') | |
| for index in range(1, 11) | |
| ) | |
| if saved == "rating": | |
| notice = '<div class="source-game-notice" role="status">Your rating and comment were saved.</div>' | |
| elif saved == "fan": | |
| notice = '<div class="source-game-notice" role="status">Fan status saved to your local collection.</div>' | |
| else: | |
| notice = "" | |
| rating_summary = f'<span class="source-rating-summary" data-rating-summary>Your rating: {saved_rating}/10{f" — {e(saved_comment)}" if saved_comment else ""}</span>' if saved_rating else '<span class="source-rating-summary" data-rating-summary hidden></span>' | |
| body = f'''<div class="source-game-page"> | |
| <div class="source-game-ad" aria-label="Advertisement"><img src="/static/assets/home/leaderboard.png" width="1200" height="125" alt=""></div> | |
| <div class="source-game-layout"><aside class="source-search-member-sidebar source-game-sidebar" aria-label="Member sidebar">{member_sidebar_sections("game")}{source_search_sidebar()}</aside> | |
| <article class="source-game-content"> | |
| <section class="source-game-header" aria-labelledby="game-title"><div class="source-game-background" aria-hidden="true"></div> | |
| <img class="source-game-cover" src="/static/assets/detail/pandemic-cover.jpg" width="175" height="240" alt="Pandemic Cover Artwork"> | |
| <div class="source-game-meta">{source_game_icon("link")} REIMPLEMENTED BY: <a href="/boardgame/30549/pandemic/reimplementations">FALL OF ROME + 12 MORE</a><span class="source-ranks">{source_game_icon("rank")} RANK: OVERALL <a href="/browse/boardgame">174</a><span class="source-rank-category">STRATEGY <a href="/browse/boardgame?rank=179">179</a></span><span class="source-rank-category">FAMILY <a href="/browse/boardgame?rank=35">35</a></span></span></div> | |
| <div class="source-game-tools"><button type="button" data-game-panel="settings">{source_game_icon("settings")}Settings</button><button type="button" data-game-panel="share">{source_game_icon("share")}Share {source_game_icon("chevron")}</button><a href="/subscriptions" aria-label="RSS Feed">{source_game_icon("rss", label="RSS Feed")}</a><a href="/boardgame/30549/pandemic/edit">Edit</a></div> | |
| <div class="source-game-copy"><div class="source-rating-badge">7.5</div><h1 id="game-title">Pandemic <span>(2008)</span></h1><p class="source-game-tagline">Your team of experts must prevent the world from succumbing to a viral pandemic. {source_game_icon("edit")}</p><p class="source-game-community"><a href="/boardgame/30549/pandemic/ratings">136K Ratings</a> & <a href="/boardgame/30549/pandemic/ratings?comment=1">21K Comments</a> · <a href="/geekbuddy/analyze/boardgame/30549">GeekBuddy Analysis</a></p></div> | |
| <dl class="source-game-stats"><div><dt>2–4 Players</dt><dd><a href="/boardgame/30549/pandemic/players">Community: 1–4 — Best: 4</a></dd></div><div><dt>45 Min</dt><dd>Playing Time</dd></div><div><dt>Age: 8+</dt><dd><a href="/boardgame/30549/pandemic/age">Community: 10+</a></dd></div><div><dt>Weight: <strong>2.39</strong> / 5</dt><dd><a href="/boardgame/30549/pandemic/weight">'Complexity' Rating {source_game_icon("info")}</a></dd></div></dl> | |
| <div class="source-game-credits"><p><strong>Alternate Names:</strong> EPIZOotic, Pandemic: 10th Anniversary Edition + 22 more</p><p><strong>Designer:</strong> <a href="/boardgamedesigner/378/matt-leacock">Matt Leacock</a></p><p><strong>Artist:</strong> Josh Cappel, Christian Hanisch, Régis Moulun, Chris Quilliams, Tom Thiel</p><p><strong>Publisher:</strong> Z-Man Games + 35 more</p><a class="source-full-credits" href="/boardgame/30549/pandemic/credits">See Full Credits</a></div> | |
| <div class="source-my-rating"><strong>My rating</strong><button type="button" data-game-panel="rating" data-current-rating="{saved_rating}" aria-label="{f'Your rating: {saved_rating} out of 10' if saved_rating else 'Rate Pandemic'}">{rating_stars}</button>{rating_summary}</div> | |
| <div class="source-game-actions"><a class="source-buy" href="/market/browse?objecttype=thing&objectid=30549">{source_game_icon("cart")}Buy a Copy</a><a class="source-sleeve" href="/boardgame/30549/pandemic/sleeves">{source_game_icon("tag")}Sleeve It</a><button class="source-collection" type="button" data-game-panel="collection" data-in-collection="{str(in_collection).lower()}">{source_game_icon("grid")}{'In Collection' if in_collection else 'Add To Collection'}</button><a class="source-log" href="/geekplay.php?action=new&objecttype=thing&objectid=30549">Log Play</a><form action="/collection/fan/30549" method="post"><button type="submit" aria-label="{('Remove fan status' if fan else 'Add as fan')}">{source_game_icon("heart")}</button></form><a class="source-fans" href="/fan/user/local-member?subtype=boardgame">8.8K</a><button class="source-subscribe" type="button" data-game-panel="subscribe" aria-pressed="false">Subscribe</button><button type="button" data-game-panel="subscribe-options" aria-label="Subscribe Options">{source_game_icon("chevron")}</button></div> | |
| {notice}<div class="source-game-popover" data-game-popover hidden><button type="button" data-close-game-popover aria-label="Close">×</button><div data-game-popover-content></div></div> | |
| </section> | |
| <nav class="source-game-tabs" aria-label="Game sections"><a class="active" href="/boardgame/30549/pandemic">Overview</a><a href="/boardgame/30549/pandemic/ratings">Ratings</a><a href="/boardgame/30549/pandemic/forums/0">Forums</a><a href="/boardgame/30549/pandemic/images">Images</a><a href="/boardgame/30549/pandemic/videos">Videos</a><a href="/boardgame/30549/pandemic/files">Files</a><a href="/boardgame/30549/pandemic/stats">Stats</a><a href="/boardgame/30549/pandemic/versions">Versions</a><a href="/boardgame/30549/pandemic/expansions">Expansions</a><a href="/boardgame/30549/pandemic/mygames">My Games</a><a href="/boardgame/30549/pandemic/shopping">Shopping</a><button type="button" data-game-panel="more">More {source_game_icon("chevron")}</button></nav> | |
| <section class="source-instructional"><img src="/static/assets/detail/watch-it-played.svg" width="135" height="60" alt="Watch it Played"><span>Instructional Video</span></section> | |
| <section class="source-gallery"><ul>{gallery_markup}</ul><a class="source-gallery-count" href="/boardgame/30549/pandemic/images">2,456 IMAGES</a></section> | |
| <section class="source-game-below"> | |
| <div class="source-game-information-grid"> | |
| <section class="source-game-description"><header><h2>Description</h2><a href="/boardgame/30549/pandemic/edit">Edit</a></header> | |
| <p>In Pandemic, several virulent diseases have broken out simultaneously all over the world! The players are disease-fighting specialists whose mission is to treat disease hotspots while researching cures for each of four plagues before they get out of hand.</p> | |
| <p>The game board depicts several major population centers on Earth. On each turn, a player can use up to four actions to travel between cities, treat infected populations, discover a cure, or build a research station. A deck of cards provides these abilities, while Epidemic cards accelerate and intensify the diseases.</p> | |
| <p>Taking a unique role within the team, players must plan their strategy to combine their specialists' strengths. If one or more diseases spreads beyond recovery or too much time elapses, the players all lose. If they cure the four diseases, they all win.</p> | |
| <p>The 2013 edition includes two additional characters—the Contingency Planner and the Quarantine Specialist—not available in earlier editions.</p> | |
| </section> | |
| <section class="source-game-classification"><header><h2>Classification</h2><a href="/boardgame/30549/pandemic/edit">Edit</a></header> | |
| <dl><dt>Type</dt><dd><a href="/boardgamefamily/5497/family-games">Family</a>, <a href="/boardgamefamily/5498/strategy-games">Strategy</a></dd> | |
| <dt>Category</dt><dd><a href="/boardgamecategory/2145/medical">Medical</a><br><a href="/boardgamecategory/1097/travel">Travel</a></dd> | |
| <dt>Mechanism</dt><dd><a href="/boardgamemechanic/2001/action-points">Action Points</a><br><a href="/boardgamemechanic/2902/chaining">Chaining</a><br><a href="/boardgamemechanic/2912/contracts">Contracts</a><br><a href="/boardgamemechanic/2023/cooperative-game">Cooperative Game</a><br><a href="/boardgamemechanic/2040/hand-management">Hand Management</a><br><a href="/boardgamemechanic/2007/pick-up-and-deliver">Pick-up and Deliver</a><br><a href="/boardgamemechanic/2011/player-elimination">Player Elimination</a><br><a href="/boardgamemechanic/2035/roll-spin-and-move">Set Collection</a></dd> | |
| <dt>Family</dt><dd><a href="/boardgamefamily/5856/components-map-global-scale">Components: Map (Global Scale)</a><br><a href="/boardgamefamily/70948/components-multi-use-cards">Components: Multi-Use Cards</a><br><a href="/boardgamefamily/66465/digital-implementations-apple-app-store">Digital Implementations: Apple App Store</a><br><a href="/boardgamefamily/70360/digital-implementations-board-game-arena">Digital Implementations: Board Game Arena</a><br><a href="/boardgamefamily/65940/digital-implementations-google-play">Digital Implementations: Google Play</a><br><a href="/boardgame/30549/pandemic/families">+ 14 more</a></dd> | |
| <dt>Reimplemented By</dt><dd><a href="/boardgame/260428/pandemic-fall-rome">Fall of Rome</a><br><a href="/boardgame/198928/pandemic-iberia">Iberia</a><br><a href="/boardgame/436217/lord-rings-fate-fellowship">The Lord of the Rings: Fate of the Fellowship</a><br><a href="/boardgame/314040/pandemic-legacy-season-0">Pandemic Legacy: Season 0</a><br><a href="/boardgame/30549/pandemic/reimplementations">+ 9 more</a></dd> | |
| </dl> | |
| </section> | |
| <section class="source-game-awards"><h2>Awards & Honors</h2><ul><li><a href="/boardgamehonor/112490/2025-boardgamegeek-hall-fame-inductee">2025 BoardGameGeek Hall of Fame Inductee</a></li><li><a href="/boardgamehonor/32559/2015-hungarian-board-game-award-nominee">2015 Hungarian Board Game Award Nominee</a></li><li><a href="/boardgamehonor/31908/2015-guldbrikken-special-jury-prize-winner">2015 Guldbrikken Special Jury Prize Winner</a></li><li><a href="/boardgamehonor/31903/2015-guldbrikken-best-adult-game-nominee">2015 Guldbrikken Best Adult Game Nominee</a></li><li><a href="/boardgame/30549/pandemic/honors">+ More</a></li></ul></section> | |
| <section class="source-game-official"><h2>Official Links</h2><ul><li><a href="/boardgame/30549/pandemic/links">🔗 Pandemic Game page at Z-Man Games</a><small>(www.zmangames.com)</small></li></ul></section> | |
| <section class="source-game-suggestions"><h2>Additional Suggestions</h2><h3>Language Dependence ⓘ</h3><p>Some necessary text - easily memorized or small crib sheet ▥</p></section> | |
| <section class="source-game-community-stats"><h2>Community Stats</h2><dl class="source-community-values"><div><dt>Own:</dt><dd>228K</dd></div><div><dt>Want In Trade:</dt><dd>612</dd></div><div><dt>Wishlist:</dt><dd>12K</dd></div><div><dt>Has Parts:</dt><dd>83</dd></div><div><dt>For Trade:</dt><dd>3.4K</dd></div><div><dt>Wants Parts:</dt><dd>52</dd></div></dl><p><a href="/boardgame/30549/pandemic/stats">See All Stats</a></p><small>BGG Item ID: 30549</small></section> | |
| </div> | |
| <section class="source-game-shopping" id="shopping"> | |
| <header><div><h2>Shopping</h2><p>We may earn a commission when you buy through these links.</p></div></header> | |
| <article class="source-shop-product"><img src="/static/assets/detail/pandemic-cover.jpg" width="76" height="76" alt="Pandemic"><div><h3>Pandemic</h3><p>Your team of experts must prevent the world from succumbing to a viral pandemic.</p><strong>Released: 2008</strong></div></article> | |
| <div class="source-shopping-grid"> | |
| <section class="source-shopping-stores"><h3>Stores</h3><div class="source-shopping-row"><img src="/static/assets/detail/ebay-logo.png" width="60" height="35" alt="eBay"><strong>eBay <small>(2301 listings)</small></strong><a class="source-price-link" href="/boardgame/30549/pandemic/shopping">from $1.87 <span aria-hidden="true">↗</span></a></div></section> | |
| <div class="source-shopping-market"> | |
| <section><h3>GeekMarket</h3><div class="source-compact-products"> | |
| <article><img src="/static/assets/detail/pandemic-cover.jpg" alt=""><div><strong>Pandemic</strong><p>🇺🇸 New · 3 days ago</p></div><a href="/market/browse?objecttype=thing&objectid=30549">US$30.00 <span aria-hidden="true">↗</span></a></article> | |
| <article><img src="/static/assets/search/pandemic-01.jpg" alt=""><div><strong>Pandemic (English edition 2012)</strong><p>🇺🇸 Like New · 4 days ago</p></div><a href="/market/browse?objecttype=thing&objectid=30549">US$10.00 <span aria-hidden="true">↗</span></a></article> | |
| <article><img src="/static/assets/detail/pandemic-cover.jpg" alt=""><div><strong>Pandemic (English edition 2020)</strong><p>🇺🇸 New · 5 days ago</p></div><a href="/market/browse?objecttype=thing&objectid=30549">US$9.99 <span aria-hidden="true">↗</span></a></article> | |
| <article><img src="/static/assets/search/pandemic-05.jpg" alt=""><div><strong>Pandemic (German second edition 2009)</strong><p>🇨🇦 Like New · 6 days ago</p></div><a href="/market/browse?objecttype=thing&objectid=30549">CA$20.00 <span aria-hidden="true">↗</span></a></article> | |
| <article><img src="/static/assets/detail/pandemic-cover.jpg" alt=""><div><strong>Pandemic</strong><p>🇺🇸 Like New · 11 days ago</p></div><a href="/market/browse?objecttype=thing&objectid=30549">US$25.00 <span aria-hidden="true">↗</span></a></article> | |
| </div><p class="source-shop-links"><a href="/market/browse?objecttype=thing&objectid=30549">See All (372)</a> <a href="/market/dashboard">Sell a Copy</a> <a href="/boardgame/30549/pandemic/shopping">GeekMarket Price History</a></p></section> | |
| <section class="source-expansions"><h3>Expansions</h3><div class="source-compact-products"> | |
| <article><img src="/static/assets/search/on-the-brink.jpg" alt=""><div><strong>Pandemic: On the Brink</strong><p>Amazon, Cardhaus Games, Cats In Hat Inc +3 more...</p></div><a href="/boardgameexpansion/40849/pandemic-on-the-brink">from US$15.00</a></article> | |
| <article><img src="/static/assets/search/state-of-emergency.png" alt=""><div><strong>Pandemic: State of Emergency</strong><p>Noble Knight Games</p></div><a href="/boardgameexpansion/168703/pandemic-state-of-emergency">from US$140.00</a></article> | |
| </div><p class="source-shop-links"><a href="/boardgame/30549/pandemic/expansions">See All (2)</a></p></section> | |
| <section class="source-accessories"><h3>Accessories</h3><p>No listings found.</p></section> | |
| </div> | |
| </div> | |
| <aside class="source-sleeve-ad" aria-label="Card sleeve finder"><div><h3>Looking for Card Sleeves?</h3><p>We have the sizes you need across the various brands gamers prefer.</p><form action="/boardgame/30549/pandemic/sleeves" method="get"><label class="sr-only" for="sleeve-copy">Copy</label><select id="sleeve-copy" name="copy"><option>What best matches your copy?</option></select><button type="submit">◇ Find Sleeves</button></form></div></aside> | |
| </section> | |
| <section class="source-game-videos" id="videos"><header><h2>Videos</h2><a class="source-add-link" href="/boardgame/30549/pandemic/videos">+ Add</a></header><div class="source-video-list"> | |
| <article><p>Hot Review</p><a class="source-video-thumb" href="/boardgame/30549/pandemic/videos"><img src="/static/assets/detail/video-review.png" alt="Pandemic review with Tom Vasel"><span>▣ 11:48</span></a><h3><a href="/boardgame/30549/pandemic/videos">Dice Tower Reviews: Pandemic, 2nd Edition</a></h3><div class="source-byline"><span>Review</span> TomVasel · 13 years ago · English</div><small>♟ 173 · ▰ 4</small></article> | |
| <article><p>Hot "How To Play"</p><a class="source-video-thumb" href="/boardgame/30549/pandemic/videos"><img src="/static/assets/detail/video-how-to.png" alt="Pandemic how to play by Watch It Played"><span>▣ 15:49</span></a><h3><a href="/boardgame/30549/pandemic/videos">Pandemic - How To Play, by Watch It Played</a></h3><div class="source-byline"><span>Instructional</span> Watch It Played · 9 years ago · English</div><small>♟ 85 · ▰ 10</small></article> | |
| <article><p>Latest Video</p><a class="source-video-thumb" href="/boardgame/30549/pandemic/videos"><img src="/static/assets/detail/video-gameplay.png" alt="Pandemic board game sample gameplay"><span>▣ 22:21</span></a><h3><a href="/boardgame/30549/pandemic/videos">Pandemic board game - sample gameplay</a></h3><div class="source-byline"><span>Session</span> Le5zczu · 1 month ago · Polish</div><small>♟ 0 · ▰ 0</small></article> | |
| </div><a class="source-see-all" href="/boardgame/30549/pandemic/videos">See All (488)</a></section> | |
| <section class="source-community-section source-reviews" id="reviews"><header><h2>In-Depth Reviews</h2><a class="source-add-link" href="/boardgame/30549/pandemic/community">+ Add</a></header> | |
| <h3>Hot Reviews</h3><div class="source-topic-list"> | |
| <article><span>♟ 463 · ▰ 39</span><div><a href="/boardgame/30549/pandemic/community">The PLAYMOBIL® Legion reviews "Pandemic"</a><p>EmeraldYam (24 reviews) · 17 years ago</p></div></article> | |
| <article><span>♟ 312 · ▰ 28</span><div><a href="/boardgame/30549/pandemic/community">⚑ Hitler Plays Pandemic</a><p>Tuttle757 (182 reviews) · 16 years ago · English</p></div></article> | |
| </div> | |
| <h3>Recent Reviews</h3><div class="source-topic-list"> | |
| <article><span>♟ 6 · ▰ 0</span><div><a href="/boardgame/30549/pandemic/community">Two Co-ops, One Designer, and a Pug in a Tunnel</a><p>Dip_here (1 review) · 5 days ago</p></div></article> | |
| <article><span>♟ 6 · ▰ 3</span><div><a href="/boardgame/30549/pandemic/community">A clean, pressurized machine that rewards tactical triage but can be...</a><p>gabrielin (35 reviews) · 4 months ago</p></div></article> | |
| <article><span>♟ 1 · ▰ 0</span><div><a href="/boardgame/30549/pandemic/community">▰ Pandemic</a><p>Melaniebarr (484 reviews) · 7 months ago · English</p></div></article> | |
| <article><span>♟ 1 · ▰ 0</span><div><a href="/boardgame/30549/pandemic/community">▰ Pandemic</a><p>Melaniebarr (484 reviews) · 7 months ago · English</p></div></article> | |
| <article><span>♟ 2 · ▰ 0</span><div><a href="/boardgame/30549/pandemic/community">▰ Pandemic</a><p>Melaniebarr (484 reviews) · 8 months ago · English</p></div></article> | |
| </div><div class="source-button-row"><a href="/boardgame/30549/pandemic/community">All Text Reviews (251)</a><a href="/boardgame/30549/pandemic/videos">All Video Reviews (170)</a></div> | |
| </section> | |
| <section class="source-community-section source-fans-like" id="fans-also-like"><header><h2>Fans Also Like</h2></header><div class="source-fans-grid"> | |
| <a href="/geeksearch.php?q=Carcassonne&objecttype=boardgame"><img src="/static/assets/detail/fans-like-1.png" alt=""><strong>Carcassonne</strong><small>♟ 240 · ♥ 9502</small></a> | |
| <a href="/geeksearch.php?q=Splendor&objecttype=boardgame"><img src="/static/assets/detail/fans-like-2.png" alt=""><strong>Splendor</strong><small>♟ 243 · ♥ 4725</small></a> | |
| <a href="/geeksearch.php?q=Codenames&objecttype=boardgame"><img src="/static/assets/detail/fans-like-3.png" alt=""><strong>Codenames</strong><small>♟ 163 · ♥ 3626</small></a> | |
| <a href="/geeksearch.php?q=Love+Letter&objecttype=boardgame"><img src="/static/assets/detail/fans-like-4.png" alt=""><strong>Love Letter</strong><small>♟ 370 · ♥ 2863</small></a> | |
| <a href="/geeksearch.php?q=King+of+Tokyo&objecttype=boardgame"><img src="/static/assets/detail/fans-like-5.png" alt=""><strong>King of Tokyo</strong><small>♟ 504 · ♥ 3984</small></a> | |
| <a href="/geeksearch.php?q=7+Wonders&objecttype=boardgame"><img src="/static/assets/detail/fans-like-6.png" alt=""><strong>7 Wonders</strong><small>♟ 118 · ♥ 7958</small></a> | |
| </div><a class="source-see-all" href="/boardgame/30549/pandemic/community">See All (28)</a></section> | |
| <section class="source-community-section source-forums" id="forums"><header><h2>Forums</h2><div><a class="source-add-link" href="/boardgame/30549/pandemic/forums/0">Go to Forum⌄</a> <a class="source-add-link" href="/forum/new/30549">+ New Post</a></div></header> | |
| <h3>Hot Threads</h3><div class="source-topic-list"> | |
| <article><span>♟ 6 · ▰ 0</span><div><a href="/boardgame/30549/pandemic/forums/0">Two Co-ops, One Designer, and a Pug in a Tunnel</a><p><em>Reviews</em> Dip_here · 5 days ago</p></div></article> | |
| <article><span>♟ 541 · ▰ 343</span><div><a href="/boardgame/30549/pandemic/forums/0">📌 Common mistakes</a><p><em>Rules</em> ekted · 18 years ago</p></div></article> | |
| </div> | |
| <h3>Recent Threads</h3><div class="source-topic-list"> | |
| <article><span>♟ 1 · ▰ 2</span><div><a href="/boardgame/30549/pandemic/forums/0">Virulent Strain Rate Effect card clarification</a><p><em>Rules</em> Bolero07 · 2 months ago</p></div></article> | |
| <article><span>♟ 2 · ▰ 2</span><div><a href="/boardgame/30549/pandemic/forums/0">Expansions out of print?</a><p><em>General</em> SirKittyJuice · 3 months ago</p></div></article> | |
| <article><span>♟ 6 · ▰ 4</span><div><a href="/boardgame/30549/pandemic/forums/0">Camerounian and digital adaptation of PANDEMIC</a><p><em>General</em> loweigor · 3 months ago</p></div></article> | |
| <article><span>♟ 0 · ▰ 2</span><div><a href="/boardgame/30549/pandemic/forums/0">The redeemer</a><p><em>Variants</em> Crowle · 3 months ago</p></div></article> | |
| <article><span>♟ 2 · ▰ 10</span><div><a href="/boardgame/30549/pandemic/forums/0">Relay liaison(custom role)</a><p><em>Variants</em> Crowle · 4 months ago</p></div></article> | |
| </div><a class="source-see-all" href="/boardgame/30549/pandemic/forums/0">See All (2,900)</a> | |
| </section> | |
| <section class="source-community-section source-files" id="files"><header><h2>Files</h2><a class="source-add-link" href="/boardgame/30549/pandemic/files">+ Upload</a></header> | |
| <h3>Top Files</h3><div class="source-topic-list"> | |
| <article><span>♟ 283 · ▰ 6</span><div><a href="/boardgame/30549/pandemic/files"><b>PDF</b> Universal Head PANDEMIC Rules Summary</a><p>The Universal Head PANDEMIC Rules Summary v3 (Dec13). Rules summary (new edition, core game only)...</p><small>UniversalHead · 18 years ago · English</small></div></article> | |
| <article><span>♟ 204 · ▰ 6</span><div><a href="/boardgame/30549/pandemic/files"><b>PDF</b> Pandemic Rules (with permission from Z-Man Games)</a><p>Pandemic rulebook PDF with searchable text.</p><small>Outside Lime · 19 years ago · English</small></div></article> | |
| </div> | |
| <h3>Recent Files</h3><div class="source-topic-list"> | |
| <article><span>♟ 2 · ▰ 0</span><div><a href="/boardgame/30549/pandemic/files"><b>PDF</b> Pandemic Expansion Cards</a><p>23 Expansions cards to be used with - On the Brink and State of Emergency...</p><small>RobertZZ · 3 months ago · English</small></div></article> | |
| <article><span>♟ 0 · ▰ 0</span><div><a href="/boardgame/30549/pandemic/files"><b>PDF</b> Pandemic Legacy: Projeto Reconstrução</a><p>Mudei algumas regras no mês 5, estava muito difícil eliminar os focos da doença incurável.</p><small>marcioqrz · 7 months ago · Portuguese</small></div></article> | |
| </div><a class="source-see-all" href="/boardgame/30549/pandemic/files">See All (244)</a> | |
| </section> | |
| <section class="source-community-section source-wiki" id="community-wiki"><header><h2>Community Wiki</h2><a class="source-add-link" href="/boardgame/30549/pandemic/community">✎ Edit</a></header><h3><a href="/boardgame/30549/pandemic/files">Rules PDF</a></h3><h3>Contents</h3><ul><li>7 Role cards</li><li>7 Pawns</li><li>59 Player cards <em>(48 City cards, 6 Epidemic cards, 5 Event cards)</em></li><li>4 Reference cards</li><li>48 Infection cards</li><li>96 Disease cubes <em>(24 in 4 colors)</em></li><li>4 Cure markers</li><li>1 Infection rate marker</li><li>1 Outbreaks marker</li><li>6 Research stations</li></ul><a href="/boardgame/30549/pandemic/community">+ More</a></section> | |
| <div class="source-links-columns"> | |
| <section><h2>More of This Game</h2><dl><div><dt><a href="/boardgame/30549/pandemic/expansions">Expansions</a></dt><dd>10</dd></div><div><dt><a href="/boardgame/30549/pandemic/versions">Versions</a></dt><dd>87</dd></div><div><dt><a href="/boardgame/30549/pandemic/accessories">Accessories</a></dt><dd>20</dd></div><div><dt><a href="/boardgame/30549/pandemic/community">Contains</a></dt><dd>0</dd></div><div><dt><a href="/boardgame/30549/pandemic/community">Contained in</a></dt><dd>0</dd></div><div><dt><a href="/boardgame/30549/pandemic/reimplementations">Reimplemented By</a></dt><dd>13</dd></div><div><dt><a href="/boardgame/30549/pandemic/reimplementations">Reimplements</a></dt><dd>0</dd></div><div><dt><a href="/boardgame/30549/pandemic/community">Video Game Adaptations</a></dt><dd>1</dd></div><div><dt><a href="/boardgame/30549/pandemic/community">Integrates With</a></dt><dd>0</dd></div><div><dt><a href="/boardgame/30549/pandemic/community">Community Tags</a></dt><dd></dd></div></dl></section> | |
| <section><h2>News & Links</h2><dl><div><dt><a href="/boardgame/30549/pandemic/links">Web Links</a></dt><dd>198</dd></div><div><dt><a href="/blogs">BGG News</a></dt><dd>41</dd></div><div><dt><a href="/blogs">BGG Blog Posts</a></dt><dd>1313</dd></div><div><dt><a href="/browse/boardgamepodcast">Podcasts</a></dt><dd>131</dd></div></dl></section> | |
| </div> | |
| <section class="source-community-section source-geeklists" id="geeklists"><header><h2>GeekLists with This Board Game</h2></header><div class="source-geeklist-grid"> | |
| <article><a href="/geeklist/1/modern-strategy-night">Proposed BoardGameArena.com games</a><p>BoardGameArena · 15 years ago</p><small>♟ 8.1K · ▰ 5.6K</small></article> | |
| <article><a href="/geeklist/1/modern-strategy-night">Card Sleeve Sizes for Games</a><p>Taeraresh · 13 years ago</p><small>♟ 7.7K · ▰ 6.9K</small></article> | |
| <article><a href="/geeklist/1/modern-strategy-night">Sebastian Sohn's SoftBoard Games: Free,...</a><p>chaosbreaker · 20 years ago</p><small>♟ 3.7K · ▰ 352</small></article> | |
| <article><a href="/geeklist/1/modern-strategy-night">Rahdo Runs Through... Games!</a><p>rahdo · 14 years ago</p><small>♟ 3.4K · ▰ 2.7K</small></article> | |
| </div><a class="source-see-all" href="/geeklists?objectid=30549">See All (10,064)</a></section> | |
| </section> | |
| </article> | |
| </div> | |
| </div>''' | |
| return shell("Pandemic | Board Game | BoardGameGeek", body) | |
| def game_page_markup(game_id: int, saved: str = "") -> tuple[str, int]: | |
| game = service.game(game_id) | |
| if game is None: | |
| observed = observed_hotness_game_markup("boardgame", game_id) | |
| if observed is not None: | |
| return observed, 200 | |
| return shell("Game not found | BoardGameGeek", '<div class="empty"><h1>Game not found</h1><a href="/browse/boardgame">Browse games</a></div>'), 404 | |
| status = service.collection(game_id) | |
| if game_id == 30549: | |
| return source_pandemic_markup(game, status, saved), 200 | |
| fan = bool(status and status["fan"]) | |
| notice = '<div class="notice success">Saved — Fan status is now visible in your collection.</div>' if saved == "fan" else "" | |
| rating_notice = '<div class="notice success">Your rating and comment were saved to your contribution.</div>' if saved == "rating" else "" | |
| play_url = f"/geekplay.php?action=new&objecttype=thing&objectid={game_id}" | |
| forum_url = f"/boardgame/{game_id}/{game['slug']}/forums/0" | |
| body = f"""<div class="crumbs"><a href="/browse/boardgame">Games</a> › {e(game['title'])}</div> | |
| <article class="hero">{cover(game)}<div class="hero-main"><div class="eyebrow">Board Game</div><h1>{e(game['title'])} <span class="year">({game['year']})</span></h1><p class="tagline">{e(game['description'])}</p> | |
| <div class="stat-grid"><div class="stat"><strong>{game['min_players']}–{game['max_players']}</strong><span>Players</span></div><div class="stat"><strong>{game['min_minutes']}–{game['max_minutes']}</strong><span>Playing Time</span></div><div class="stat"><strong class="rating-big">{game['rating']:.1f}</strong><span>Geek Rating</span></div><div class="stat"><strong>#{game['rank']}</strong><span>Overall Rank</span></div></div> | |
| <div class="actions"><a class="btn btn-primary" href="{play_url}">Log Play</a><form action="/collection/fan/{game_id}" method="post"><button class="btn {'fan-on' if fan else ''}" type="submit">{'★ Fan' if fan else '☆ Add as Fan'}</button></form><a class="btn" href="/collection/user/local-member">View Collection</a><a class="btn" href="{forum_url}">Forums</a></div>{notice}{rating_notice}</div></article> | |
| <nav class="tabs" aria-label="Game sections"><a class="active" href="/boardgame/{game_id}/{game['slug']}">Overview</a><a href="/boardgame/{game_id}/{game['slug']}/ratings">Ratings</a><a href="/boardgame/{game_id}/{game['slug']}/files">Files</a><a href="{forum_url}">Forums</a><a href="/boardgame/{game_id}/{game['slug']}/community">Community</a></nav> | |
| <div class="columns"><section class="card section"><h2>About this game</h2><p>{e(game['description'])}</p><h3>Mechanisms</h3>{''.join(f'<span class="pill">{e(item)}</span>' for item in game['mechanics'].split(','))}<h3>Categories</h3>{''.join(f'<span class="pill">{e(item)}</span>' for item in game['categories'].split(','))}</section> | |
| <aside><section class="card section"><h2>Your contribution</h2><form action="/collection/rating/{game_id}" method="post"><div class="field"><label for="rating">Rating</label><select id="rating" name="rating">{''.join(f'<option value="{n}" {"selected" if status and status["rating"]==n else ""}>{n}</option>' for n in range(10,0,-1))}</select></div><div class="field"><label for="comment">Comment</label><textarea id="comment" name="comment">{e(status['comment'] if status else '')}</textarea></div><button class="btn btn-primary">Save rating</button></form></section></aside></div>""" | |
| return shell(f"{game['title']} ({game['year']}) | BoardGameGeek", body), 200 | |
| def game_page(game_id: int, slug: str, saved: str = "") -> HTMLResponse: | |
| markup, status = game_page_markup(game_id, saved) | |
| return response(markup, status) | |
| def fan(game_id: int) -> RedirectResponse: | |
| game = service.game(game_id) | |
| if game is None: | |
| return RedirectResponse("/browse/boardgame", status_code=303) | |
| service.save_fan(game_id, True) | |
| return RedirectResponse(f"/boardgame/{game_id}/{game['slug']}?saved=fan", status_code=303) | |
| async def collection_status(game_id: int, request: Request): | |
| game = service.game(game_id) | |
| if game is None: | |
| return JSONResponse({"error": "game not found"}, status_code=404) | |
| data = await fields(request) | |
| try: | |
| service.save_collection_status(game_id, first(data, "choice")) | |
| except ValueError as exc: | |
| return JSONResponse({"error": str(exc)}, status_code=422) | |
| return JSONResponse({"saved": True, "label": "In Collection"}) | |
| async def rate(game_id: int, request: Request): | |
| data = await fields(request) | |
| existing = service.collection(game_id) | |
| comment = first(data, "comment") if "comment" in data else str(existing["comment"] if existing else "") | |
| try: | |
| service.save_rating(game_id, int(first(data, "rating", "0")), comment) | |
| except (ValueError, TypeError) as exc: | |
| if request.headers.get("x-requested-with") == "fetch": | |
| return JSONResponse({"error": str(exc)}, status_code=422) | |
| markup, _ = game_page_markup(game_id) | |
| markup = markup.replace('<div class="columns">', f'<div class="notice error">{e(exc)}</div><div class="columns">', 1) | |
| return response(markup, 422) | |
| game = service.game(game_id) | |
| if request.headers.get("x-requested-with") == "fetch": | |
| return JSONResponse({"saved": True, "rating": int(first(data, "rating", "0"))}) | |
| return RedirectResponse(f"/boardgame/{game_id}/{game['slug']}?saved=rating", status_code=303) | |
| HOTNESS_ITEMS = ( | |
| ("Medico", "2026", "flat", 41, "search/hotness-01.png", "/boardgame/472021/medico"), | |
| ("Dewan", "2025", "up", 41, "search/hotness-07.png", "/boardgame/439742/dewan"), | |
| ("Horror on the Orient Express: The Board Game", "2026", "down", 65, "search/hotness-02.png", "/boardgame/394897/horror-on-the-orient-express-the-board-game"), | |
| ("Avalon: The Riven Veil", "2026", "down", 52, "search/hotness-03.png", "/boardgame/402276/avalon-the-riven-veil"), | |
| ("Jisogi: Anime Studio Tycoon", "2025", "down", 52, "search/hotness-04.png", "/boardgame/429845/jisogi-anime-studio-tycoon"), | |
| ("Drillers", "2026", "up", 41, "search/hotness-09.png", "/boardgame/465669/drillers"), | |
| ("Magical Athlete", "2025", "down", 41, "search/hotness-06.png", "/boardgame/454103/magical-athlete"), | |
| ("The Lord of the Rings: Fate of the Fellowship", "2025", "up", 65, "search/hotness-08.png", "/boardgame/436217/the-lord-of-the-rings-fate-of-the-fellowship"), | |
| ("Raiders of Scythia: Omens", "2027", "down", 52, "search/hotness-05.png", "/boardgameexpansion/474403/raiders-of-scythia-omens"), | |
| ("Wingspan Pocket", "2026", "flat", 52, "search/hotness-12.png", "/boardgame/473508/wingspan-pocket"), | |
| ("Entropy", "2026", "up", 41, "search/hotness-13.png", "/boardgame/462941/entropy"), | |
| ("SETI: Search for Extraterrestrial Intelligence", "2024", "flat", 52, "search/hotness-14.png", "/boardgame/418059/seti-search-for-extraterrestrial-intelligence"), | |
| ("Dino Racer", "2026", "down", 41, "search/hotness-11.png", "/boardgame/462945/dino-racer"), | |
| ("Rebirth", "2024", "down", 41, "home/hotness-source-18.png", "/boardgame/417197/rebirth"), | |
| ("Ark Nova", "2021", "down", 41, "home/hotness-source-16.png", "/boardgame/342942/ark-nova"), | |
| ("Kingdom Come: Deliverance – The Board Game", "2026", "down", 65, "home/hotness-source-15.png", "/boardgame/473897/kingdom-come-deliverance-the-board-game"), | |
| ) | |
| PANDEMIC_SEARCH_RESULTS = ( | |
| {"rank":"174", "href":"/boardgame/30549/pandemic", "title":"Pandemic", "year":"2008", "description":"Your team of experts must prevent the world from succumbing to a viral pandemic.", "geek":"7.401", "average":"7.51", "voters":"136094", "image":"pandemic-01.jpg", "shop":"Amazon: $49.99", "compact":False}, | |
| {"rank":"3", "href":"/boardgame/161936/pandemic-legacy-season-1", "title":"Pandemic Legacy: Season 1", "year":"2015", "description":"Mutating diseases are spreading around the world - can your team save humanity?", "geek":"8.344", "average":"8.50", "voters":"57733", "image":"pandemic-02.png", "shop":"List: $99.99|Amazon: $79.99", "compact":True}, | |
| {"rank":"74", "href":"/boardgame/221107/pandemic-legacy-season-2", "title":"Pandemic Legacy: Season 2", "year":"2017", "description":"The world is a mystery after a devastating pandemic—where will your team go?", "geek":"7.686", "average":"8.01", "voters":"18444", "image":"pandemic-03.jpg", "shop":"", "compact":True}, | |
| {"rank":"N/A", "href":"/boardgameexpansion/40849/pandemic-on-the-brink", "title":"Pandemic: On the Brink", "year":"2009", "description":"Three new challenges for your pandemic fighting team to conquer.", "geek":"7.687", "average":"8.03", "voters":"18441", "image":"pandemic-04.jpg", "shop":"List: $49.99|Amazon: $44.95", "compact":False}, | |
| {"rank":"59", "href":"/boardgame/314040/pandemic-legacy-season-0", "title":"Pandemic Legacy: Season 0", "year":"2020", "description":"Work together during the Cold War to prevent a Soviet bio-threat.", "geek":"7.734", "average":"8.33", "voters":"9709", "image":"pandemic-05.jpg", "shop":"", "compact":True}, | |
| {"rank":"626", "href":"/boardgame/150658/pandemic-the-cure", "title":"Pandemic: The Cure", "year":"2014", "description":"Roll dice to defeat four diseases threatening the world.", "geek":"6.902", "average":"7.23", "voters":"11176", "image":"pandemic-06.jpg", "shop":"", "compact":False}, | |
| {"rank":"N/A", "href":"/boardgameexpansion/137136/pandemic-in-the-lab", "title":"Pandemic: In the Lab", "year":"2013", "description":"Alters how to cure diseases. Adds roles and events, plus team and solo play.", "geek":"7.092", "average":"7.83", "voters":"5766", "image":"pandemic-07.jpg", "shop":"", "compact":False}, | |
| {"rank":"N/A", "href":"/boardgameexpansion/168703/pandemic-state-of-emergency", "title":"Pandemic: State of Emergency", "year":"2015", "description":"Adds three more challenges, plus roles, events, and quarantines to help you.", "geek":"6.385", "average":"7.56", "voters":"2027", "image":"pandemic-08.png", "shop":"", "compact":False}, | |
| {"rank":"1044", "href":"/boardgame/234671/pandemic-rising-tide", "title":"Pandemic: Rising Tide", "year":"2017", "description":"Build dikes and pumps to protect the Netherlands from flooding by the North Sea.", "geek":"6.637", "average":"7.53", "voters":"3144", "image":"pandemic-09.jpg", "shop":"", "compact":False}, | |
| {"rank":"3082", "href":"/boardgame/157789/pandemic-contagion", "title":"Pandemic: Contagion", "year":"2014", "description":"You are the disease. There is no cure.", "geek":"6.022", "average":"6.40", "voters":"3550", "image":"pandemic-10.png", "shop":"Amazon: $16.49", "compact":False}, | |
| {"rank":"2818", "href":"/boardgame/280789/pandemic-rapid-response", "title":"Pandemic: Rapid Response", "year":"2019", "description":"Cooperatively organize and manage the response to pandemic viral threats in real time", "geek":"6.074", "average":"6.55", "voters":"3177", "image":"pandemic-11.jpg", "shop":"", "compact":False}, | |
| {"rank":"2121", "href":"/boardgame/301919/pandemic-hot-zone-north-america", "title":"Pandemic: Hot Zone – North America", "year":"2020", "description":"30 minutes to save North America from a viral pandemic — all in a day's work.", "geek":"6.234", "average":"6.96", "voters":"2668", "image":"pandemic-12.png", "shop":"List: $19.99|Amazon: $17.49", "compact":False}, | |
| {"rank":"N/A", "href":"/boardgameexpansion/207017/pandemic-the-cure-experimental-meds", "title":"Pandemic: The Cure – Experimental Meds", "year":"2016", "description":"Adds two threats, the purple virus and hot zones, plus new roles and events.", "geek":"6.160", "average":"7.82", "voters":"966", "image":"pandemic-13.jpg", "shop":"Amazon: $39.99", "compact":False}, | |
| {"rank":"3356", "href":"/boardgame/329670/pandemic-hot-zone-europe", "title":"Pandemic: Hot Zone – Europe", "year":"2021", "description":"30 minutes to save Europe from a viral pandemic — it's all in a day's work.", "geek":"5.977", "average":"7.04", "voters":"1131", "image":"pandemic-14.png", "shop":"List: $19.99|Amazon: $11.50", "compact":False}, | |
| {"rank":"N/A", "href":"/boardgameexpansion/185403/pandemic-promo-roles", "title":"Pandemic: Promo Roles", "year":"2015", "description":"", "geek":"5.577", "average":"6.98", "voters":"128", "image":"pandemic-15.jpg", "shop":"", "compact":True}, | |
| {"rank":"N/A", "href":"/boardgameexpansion/221935/pandemic-survival-promos-crisis-mitigatorrelocatio", "title":"Pandemic: Survival Promos – Crisis Mitigator/Relocation Specialist", "year":"2016", "description":"", "geek":"N/A", "average":"6.13", "voters":"15", "image":"pandemic-16.jpg", "shop":"", "compact":True}, | |
| {"rank":"N/A", "href":"/boardgameexpansion/205666/pandemic-gen-con-2016-promos-z-force-team-memberga", "title":"Pandemic: Gen Con 2016 Promos – Z-Force Team Member/Game Convention", "year":"2016", "description":"", "geek":"N/A", "average":"7.38", "voters":"13", "image":"pandemic-17.png", "shop":"", "compact":True}, | |
| {"rank":"N/A", "href":"/boardgameexpansion/429445/pandemic-iberia-festival", "title":"Pandemic Iberia: Festival", "year":"2024", "description":"Five new brave characters with original abilities join forces against the pandemic!", "geek":"N/A", "average":"7.61", "voters":"9", "image":"pandemic-18.jpg", "shop":"", "compact":False}, | |
| {"rank":"N/A", "href":"/boardgameexpansion/382181/pandemic-teacher-promo-card", "title":"Pandemic: Teacher Promo Card", "year":"2021", "description":"Teachers rock!", "geek":"N/A", "average":"7.50", "voters":"4", "image":"pandemic-19.jpg", "shop":"", "compact":False}, | |
| {"rank":"N/A", "href":"/boardgameexpansion/446028/pandemic-government-shutdown", "title":"Pandemic: Government Shutdown", "year":"2014", "description":"When your government finally comes to its senses, will it be too late?", "geek":"N/A", "average":"6.75", "voters":"4", "image":"pandemic-20.png", "shop":"", "compact":True}, | |
| {"rank":"N/A", "href":"/boardgameexpansion/446025/pandemic-isolation", "title":"Pandemic: Isolation", "year":"2013", "description":"How will isolationism affect curing the world?", "geek":"N/A", "average":"6.80", "voters":"5", "image":"pandemic-21.png", "shop":"", "compact":True}, | |
| {"rank":"566", "href":"/boardgame/192153/reign-of-cthulhu", "title":"Pandemic: Reign of Cthulhu", "year":"2016", "description":"Close portals, shut down cultists, and stave off insanity before an Old One awakens.", "geek":"6.952", "average":"7.36", "voters":"11134", "image":"pandemic-22.png", "shop":"List: $54.99|Amazon: $43.99", "compact":False}, | |
| {"rank":"162", "href":"/boardgame/198928/iberia", "title":"Pandemic: Iberia", "year":"2016", "description":"Travel from Barcelona to Lisboa to cure malaria, typhus, yellow fever, and cholera.", "geek":"7.428", "average":"7.87", "voters":"11925", "image":"pandemic-23.jpg", "shop":"", "compact":False}, | |
| {"rank":"484", "href":"/boardgame/260428/fall-of-rome", "title":"Pandemic: Fall of Rome", "year":"2018", "description":"Will you be strong enough to protect the Imperium from the Barbarians?", "geek":"7.024", "average":"7.58", "voters":"7048", "image":"pandemic-24.jpg", "shop":"", "compact":False}, | |
| {"rank":"N/A", "href":"/boardgameexpansion/307384/clinic-deluxe-edition-covid-19-pandemic", "title":"Clinic: Deluxe Edition – COVID-19 Pandemic", "year":"2020", "description":"", "geek":"5.566", "average":"7.32", "voters":"102", "image":"pandemic-25.jpg", "shop":"", "compact":False}, | |
| {"rank":"N/A", "href":"/boardgameexpansion/304868/rapid-response-system-fan-expansion-for-pandemic-t", "title":"Rapid Response System (fan expansion for Pandemic: The Cure)", "year":"2020", "description":"", "geek":"N/A", "average":"8.64", "voters":"7", "image":"pandemic-26.jpg", "shop":"", "compact":True}, | |
| {"rank":"N/A", "href":"/boardgame/329712/american-pandemic-the-party-card-game", "title":"American Pandemic: The Party Card Game", "year":"2021", "description":"A hilarious party card game of quarantine, memes, and the pursuit of bad luck.", "geek":"N/A", "average":"5.72", "voters":"9", "image":"pandemic-27.jpg", "shop":"", "compact":False}, | |
| {"rank":"N/A", "href":"/boardgame/375090/3rd-world-labour-pandemic-edition", "title":"3rd World Labour: Pandemic Edition", "year":"2022", "description":"Labourer try to survive in the 3rd world country under pandemic situation.", "geek":"N/A", "average":"9.50", "voters":"2", "image":"pandemic-28.jpg", "shop":"", "compact":False}, | |
| {"rank":"N/A", "href":"/boardgameexpansion/374540/hero-the-pandemic", "title":"HE.R.O: The Pandemic", "year":"2023", "description":"Experience the pandemic game mode, handle infections and manage the clean up.", "geek":"N/A", "average":"7.00", "voters":"1", "image":"pandemic-29.jpg", "shop":"", "compact":False}, | |
| {"rank":"N/A", "href":"/boardgame/324628/people-vs-pandemic", "title":"People Vs Pandemic", "year":"2020", "description":"Human are pitted against the Virus in a hilarious race for survival.", "geek":"N/A", "average":"N/A", "voters":"N/A", "image":"pandemic-30.jpg", "shop":"", "compact":False}, | |
| {"rank":"N/A", "href":"/boardgame/466784/the-pandemic-wars", "title":"The Pandemic Wars", "year":"2020", "description":"Gain the highest net worth in the era of Covid-19.", "geek":"N/A", "average":"5.00", "voters":"1", "image":"pandemic-31.jpg", "shop":"", "compact":False}, | |
| ) | |
| def search_item(game: object) -> dict[str, object]: | |
| rating = float(game["rating"]) | |
| return { | |
| "rank": str(game["rank"]), | |
| "href": f'/boardgame/{game["game_id"]}/{game["slug"]}', | |
| "title": str(game["title"]), | |
| "year": str(game["year"]), | |
| "description": str(game["description"]), | |
| "geek": f"{rating:.3f}", | |
| "average": f"{rating:.2f}", | |
| "voters": str(8200 + int(game["game_id"]) % 128000), | |
| "image": "", | |
| "cover_class": str(game["cover_class"]), | |
| "shop": "", | |
| "compact": False, | |
| } | |
| def source_search_sidebar() -> str: | |
| entries = [] | |
| for title, year, trend, height, image, href in HOTNESS_ITEMS: | |
| entries.append( | |
| f'<li style="height:{height}px"><a href="{e(href)}" title="{e(title)}">' | |
| f'<img src="/static/assets/{e(image)}" width="30" height="30" alt="">' | |
| f'<span class="search-hotness-copy"><strong>{e(title)}</strong><small>{e(year)}</small></span>' | |
| f'<span class="search-hotness-trend {e(trend)}" aria-label="{e(trend)}"></span></a></li>' | |
| ) | |
| return f'''<aside class="search-hotness" aria-label="The Hotness"> | |
| <h2>THE HOTNESS</h2> | |
| <div class="search-hotness-body"><div class="search-hotness-tools"><button class="search-hotness-type" type="button" aria-expanded="false">GAMES<span class="search-caret" aria-hidden="true"></span></button><button class="search-kebab" type="button" aria-label="Change hotness display style"></button></div> | |
| <ol>{"".join(entries)}</ol><a class="search-hotness-more" href="/hotness">+ Show more</a></div> | |
| </aside>''' | |
| def observed_hotness_game_markup(object_type: str, game_id: int) -> str | None: | |
| prefix = f"/{object_type}/{game_id}/" | |
| item = next((entry for entry in HOTNESS_ITEMS if entry[5].startswith(prefix)), None) | |
| if item is None: | |
| return None | |
| title, year, _trend, _height, _sidebar_image, href = item | |
| home_item = next((entry for entry in HOME_HOTNESS if entry[0] == title), None) | |
| if home_item is None: | |
| return None | |
| _home_title, _home_href, description, image, _home_trend = home_item | |
| kind = "Board Game Expansion" if object_type == "boardgameexpansion" else "Board Game" | |
| body = f'''<div class="public-index hotness-game-terminal"><nav class="crumbs"><a href="/">Home</a> <span aria-hidden="true">›</span> <a href="/hotness">The Hotness</a> <span aria-hidden="true">›</span> {e(title)}</nav><article class="public-index-hero hotness-game-card"><img src="/static/assets/home/{e(image)}?v=3" width="289" height="162" alt=""><div><p class="eyebrow">{e(kind)} · observed Hotness entry</p><h1>{e(title)} <span class="year">({e(year)})</span></h1><p>{e(description)}</p><p><a class="btn btn-primary" href="/hotness">Return to The Hotness</a></p></div></article></div>''' | |
| return shell(f"{title} ({year}) | BoardGameGeek", body) | |
| def observed_hotness_expansion(game_id: int, slug: str) -> HTMLResponse: | |
| markup = observed_hotness_game_markup("boardgameexpansion", game_id) | |
| if markup is None: | |
| return response(shell("Expansion not found | BoardGameGeek", '<div class="empty"><h1>Expansion not found</h1><a href="/hotness">The Hotness</a></div>'), 404) | |
| return response(markup) | |
| def source_search_featured_row() -> str: | |
| featured = ( | |
| ("featured-arydia.png", "Arydia: The Paths We Dare Tread", "$350.00", "Noble Knight Games", "/geekaffiliate/link/50329946?context=browse"), | |
| ("featured-everdell.png", "Everdell", "$79.99", "Board Haven Games", "/geekaffiliate/link/50343012?context=browse"), | |
| ("featured-dune.jpg", "Dune: Imperium – Uprising", "$60.00", "Gamers Guild AZ", "/geekaffiliate/link/50416535?context=browse"), | |
| ) | |
| cards = "".join( | |
| f'''<li><img src="/static/assets/search/{e(image)}" width="85" height="85" alt=""><div><h3><a href="{e(href)}">{e(title)}</a></h3><p><strong>{e(price)}</strong><span>{e(store)}</span></p></div></li>''' | |
| for image, title, price, store, href in featured | |
| ) | |
| return f'''<tr class="search-featured-row"><td colspan="10"><section class="search-featured"><h2>Expand Your Collection</h2><ul>{cards}</ul></section></td></tr>''' | |
| def source_search_rows(items: tuple[dict[str, object], ...]) -> str: | |
| rows = [] | |
| for index, item in enumerate(items): | |
| image = ( | |
| f'<img src="/static/assets/search/{e(item["image"])}" alt="Board Game: {e(item["title"])}">' | |
| if item.get("image") | |
| else f'<span class="search-cover-fallback {e(item.get("cover_class", ""))}">{e(item["title"])}</span>' | |
| ) | |
| price_lines = [] | |
| for part in (part for part in str(item.get("shop", "")).split("|") if part): | |
| label, separator, price = part.partition(": ") | |
| price_markup = f': <strong>{e(price)}</strong>' if separator else "" | |
| price_lines.append(f'<span class="search-shop-line {"amazon" if label == "Amazon" else ""}">{e(label)}{price_markup}</span>') | |
| prices = "".join(price_lines) | |
| row_class = " search-result-row--compact" if item.get("compact") else "" | |
| rows.append(f'''<tr class="search-result-row{row_class}"> | |
| <td class="search-rank"><span>{e(item["rank"])}</span></td> | |
| <td class="search-thumbnail"><a href="{e(item["href"])}">{image}</a></td> | |
| <td class="search-title"><div><a href="{e(item["href"])}">{e(item["title"])}</a> <span>({e(item["year"])})</span></div><p>{e(item["description"])}</p></td> | |
| <td class="search-number search-your-rating"><strong>N/A</strong></td><td class="search-number"><span>{e(item["geek"])}</span></td><td class="search-number"><span>{e(item["average"])}</span></td><td class="search-number"><span>{e(item["voters"])}</span></td> | |
| <td class="search-status"></td><td class="search-plays"></td> | |
| <td class="search-shop">{prices}</td> | |
| </tr>''') | |
| if index == 14: | |
| rows.append(source_search_featured_row()) | |
| if index == 29: | |
| rows.append('<tr class="search-inline-ad-gap" aria-hidden="true"><td colspan="10"></td></tr>') | |
| return "".join(rows) | |
| def source_search_page(items: tuple[dict[str, object], ...]) -> str: | |
| return f'''<div class="source-search-page"> | |
| <div class="source-search-ad" aria-label="Advertisement"><img src="/static/assets/search/leaderboard.png" width="1200" height="125" alt=""></div> | |
| <div class="source-search-layout"><aside class="source-search-member-sidebar" aria-label="Member sidebar">{member_sidebar_sections("search")}{source_search_sidebar()}</aside> | |
| <section class="source-search-results" data-region="search-results"> | |
| <p class="search-commission">We may earn a commission when you buy through our links.</p> | |
| <table class="search-results-table"><colgroup><col class="rank-col"><col class="thumb-col"><col><col class="your-rating-col"><col class="geek-col"><col class="average-col"><col class="voters-col"><col class="status-col"><col class="plays-col"><col class="shop-col"></colgroup> | |
| <thead><tr><th><a href="/geeksearch.php?action=search&q=Pandemic&objecttype=boardgame">Board Game<br>Rank</a></th><th><span class="sr-only">Thumbnail image</span></th><th><a href="/geeksearch.php?action=search&q=Pandemic&objecttype=boardgame">Title</a></th><th>Your<br>Rating</th><th><a href="/geeksearch.php?action=search&q=Pandemic&objecttype=boardgame">Geek Rating</a></th><th><a href="/geeksearch.php?action=search&q=Pandemic&objecttype=boardgame">Avg Rating</a></th><th><a href="/geeksearch.php?action=search&q=Pandemic&objecttype=boardgame">Num Voters</a></th><th>Status</th><th>Your<br>Plays</th><th>Shop</th></tr></thead> | |
| <tbody>{source_search_rows(items)}</tbody> | |
| </table> | |
| </section> | |
| </div> | |
| </div>''' | |
| def search(q: str = "", objecttype: str = "boardgame") -> HTMLResponse: | |
| results = service.games(q) | |
| if q and not results: | |
| main = f'<div class="empty"><h1>No results found</h1><p>We could not find games matching <strong>{e(q)}</strong>.</p><a class="btn" href="/browse/boardgame">Browse available games</a> <a class="btn" href="/plays/bygame/user/local-member/subtype/boardgame">Play logs</a> <a class="btn" href="/forums">Discussions</a></div>' | |
| else: | |
| items = PANDEMIC_SEARCH_RESULTS if q.strip().casefold() == "pandemic" else tuple(search_item(game) for game in results) | |
| main = source_search_page(items) | |
| return response(shell("Search | BoardGameGeek", main)) | |
| BROWSE_DIRECTORY_PAGES: dict[str, tuple[str, str, tuple[tuple[str, str], ...]]] = { | |
| "/browse/boardgamecategory": ( | |
| "Board Game Categories", "Browse games by subject and style", ( | |
| ("Abstract Strategy", "/boardgamecategory/1009/abstract-strategy"), ("Action / Dexterity", "/boardgamecategory/1032/action-dexterity"), | |
| ("Adventure", "/boardgamecategory/1022/adventure"), ("Age of Reason", "/boardgamecategory/2726/age-of-reason"), | |
| ("American Civil War", "/boardgamecategory/1048/american-civil-war"), ("American Indian Wars", "/boardgamecategory/1108/american-indian-wars"), | |
| ("American Revolutionary War", "/boardgamecategory/1075/american-revolutionary-war"), ("American West", "/boardgamecategory/1055/american-west"), | |
| ("Ancient", "/boardgamecategory/1050/ancient"), ("Animals", "/boardgamecategory/1089/animals"), | |
| ("Arabian", "/boardgamecategory/1052/arabian"), ("Aviation / Flight", "/boardgamecategory/2650/aviation-flight"), | |
| ("Bluffing", "/boardgamecategory/1023/bluffing"), ("Book", "/boardgamecategory/1117/book"), | |
| ("Card Game", "/boardgamecategory/1002/card-game"), ("Children's Game", "/boardgamecategory/1041/childrens-game"), | |
| ("City Building", "/boardgamecategory/1029/city-building"), ("Civil War", "/boardgamecategory/1102/civil-war"), | |
| ("Civilization", "/boardgamecategory/1015/civilization"), ("Collectible Components", "/boardgamecategory/1044/collectible-components"), | |
| ("Comic Book / Strip", "/boardgamecategory/1116/comic-book-strip"), ("Deduction", "/boardgamecategory/1039/deduction"), | |
| ("Dice", "/boardgamecategory/1017/dice"), ("Economic", "/boardgamecategory/1021/economic"), | |
| ("Educational", "/boardgamecategory/1094/educational"), ("Electronic", "/boardgamecategory/1072/electronic"), | |
| ("Environmental", "/boardgamecategory/1084/environmental"), ("Expansion for Base-game", "/boardgamecategory/1042/expansion-for-base-game"), | |
| ("Exploration", "/boardgamecategory/1020/exploration"), ("Fan Expansion", "/boardgamecategory/2687/fan-expansion"), | |
| ("Fantasy", "/boardgamecategory/1010/fantasy"), ("Farming", "/boardgamecategory/1013/farming"), | |
| ("Fighting", "/boardgamecategory/1046/fighting"), ("Game System", "/boardgamecategory/1119/game-system"), | |
| ("Horror", "/boardgamecategory/1024/horror"), ("Humor", "/boardgamecategory/1079/humor"), | |
| ("Industry / Manufacturing", "/boardgamecategory/1088/industry-manufacturing"), ("Korean War", "/boardgamecategory/1069/korean-war"), | |
| ("Mafia", "/boardgamecategory/1033/mafia"), ("Math", "/boardgamecategory/1104/math"), | |
| ("Mature / Adult", "/boardgamecategory/1118/mature-adult"), ("Maze", "/boardgamecategory/1059/maze"), | |
| ("Medical", "/boardgamecategory/2145/medical"), ("Medieval", "/boardgamecategory/1035/medieval"), | |
| ("Memory", "/boardgamecategory/1045/memory"), ("Miniatures", "/boardgamecategory/1047/miniatures"), | |
| ("Modern Warfare", "/boardgamecategory/1068/modern-warfare"), ("Movies / TV / Radio theme", "/boardgamecategory/1064/movies-tv-radio-theme"), | |
| ("Murder / Mystery", "/boardgamecategory/1040/murder-mystery"), ("Music", "/boardgamecategory/1054/music"), | |
| ("Mythology", "/boardgamecategory/1082/mythology"), ("Napoleonic", "/boardgamecategory/1051/napoleonic"), | |
| ("Nautical", "/boardgamecategory/1008/nautical"), ("Negotiation", "/boardgamecategory/1026/negotiation"), | |
| ("Novel-based", "/boardgamecategory/1093/novel-based"), ("Number", "/boardgamecategory/1098/number"), | |
| ("Party Game", "/boardgamecategory/1030/party-game"), ("Pike and Shot", "/boardgamecategory/2725/pike-and-shot"), | |
| ("Pirates", "/boardgamecategory/1090/pirates"), ("Political", "/boardgamecategory/1001/political"), | |
| ("Post-Napoleonic", "/boardgamecategory/2710/post-napoleonic"), ("Prehistoric", "/boardgamecategory/1036/prehistoric"), | |
| ("Print & Play", "/boardgamecategory/1120/print-and-play"), ("Puzzle", "/boardgamecategory/1028/puzzle"), | |
| ("Racing", "/boardgamecategory/1031/racing"), ("Real-time", "/boardgamecategory/1037/real-time"), | |
| ("Religious", "/boardgamecategory/1115/religious"), ("Renaissance", "/boardgamecategory/1070/renaissance"), | |
| ("Science Fiction", "/boardgamecategory/1016/science-fiction"), ("Space Exploration", "/boardgamecategory/1113/space-exploration"), | |
| ("Spies / Secret Agents", "/boardgamecategory/1081/spies-secret-agents"), ("Sports", "/boardgamecategory/1038/sports"), | |
| ("Territory Building", "/boardgamecategory/1086/territory-building"), ("Third-party Expansion", "/boardgamecategory/2892/third-party-expansion"), | |
| ("Trains", "/boardgamecategory/1034/trains"), ("Transportation", "/boardgamecategory/1011/transportation"), | |
| ("Travel", "/boardgamecategory/1097/travel"), ("Trivia", "/boardgamecategory/1027/trivia"), | |
| ("Video Game Theme", "/boardgamecategory/1101/video-game-theme"), ("Vietnam War", "/boardgamecategory/1109/vietnam-war"), | |
| ("Wargame", "/boardgamecategory/1019/wargame"), ("Word Game", "/boardgamecategory/1025/word-game"), | |
| ("World War I", "/boardgamecategory/1065/world-war-i"), ("World War II", "/boardgamecategory/1049/world-war-ii"), | |
| ("Zombies", "/boardgamecategory/2481/zombies"), | |
| ), | |
| ), | |
| "/browse/boardgameartist": ( | |
| "Board Game Artists", "Directory of credited board game artists", ( | |
| ("(Uncredited)", "/boardgameartist/3/uncredited"), ("@&~R~&", "/boardgameartist/171219/at-and-r-and"), | |
| ("↑もつなべ太郎← (Ue Motunabetarou Hidari)", "/boardgameartist/80819/motsunabetai-lang-ue-motunabetarou-hidari"), ("00323z", "/boardgameartist/120231/00323z"), | |
| ("101 Coding and Design", "/boardgameartist/112151/101-coding-and-design"), ("123RF", "/boardgameartist/76223/123rf"), | |
| ("13smok", "/boardgameartist/173879/13smok"), ("15 Shapes", "/boardgameartist/67996/15-shapes"), | |
| ("152°", "/boardgameartist/69643/152deg"), ("21", "/boardgameartist/164128/21"), | |
| ("221B Studio", "/boardgameartist/146214/221b-studio"), ("2D (Damien Henceval)", "/boardgameartist/155670/2d-damien-henceval"), | |
| ("2tar", "/boardgameartist/114332/2tar"), ("2号", "/boardgameartist/48564/2hao"), | |
| ("3 Deuces Design", "/boardgameartist/167015/3-deuces-design"), ("326", "/boardgameartist/112767/326"), | |
| ("4steex", "/boardgameartist/129211/4steex"), ("5 byte", "/boardgameartist/126604/5-byte"), | |
| ("53C", "/boardgameartist/123177/53c"), ("8Rad", "/boardgameartist/68614/8rad"), | |
| ("9B Collective", "/boardgameartist/170984/9b-collective"), ("Ahmet A", "/boardgameartist/143474/ahmet-a"), | |
| ("Carly A-F", "/boardgameartist/145596/carly-a-f"), ("a-tan-pic (aたん)", "/boardgameartist/92218/a-tan-pic-atan"), | |
| ), | |
| ), | |
| "/browse/boardgamepublisher": ( | |
| "Board Game Publishers", "Directory of board game publishers", ( | |
| ("(Looking for a publisher)", "/boardgamepublisher/772/looking-for-a-publisher"), ("(Public Domain)", "/boardgamepublisher/171/public-domain"), | |
| ("(Self-Developed Video Game)", "/boardgamepublisher/14029/self-developed-video-game"), ("(Self-Published)", "/boardgamepublisher/4/self-published"), | |
| ("(Unknown)", "/boardgamepublisher/3320/unknown"), ("(Web published)", "/boardgamepublisher/1001/web-published"), | |
| ("@BUDAcafe (アットブダカフェ)", "/boardgamepublisher/44495/budacafe-atsutobudakahue"), ("@games online", "/boardgamepublisher/6116/at-games-online"), | |
| ("@GorillaPressComics", "/boardgamepublisher/51414/at-gorillapresscomics"), ("@liehs Communications", "/boardgamepublisher/25582/at-liehs-communications"), | |
| ("@rchival storage", "/boardgamepublisher/53278/at-rchival-storage"), ("# Hashtag 64", "/boardgamepublisher/57829/hashtag-64"), | |
| ("+PlusOut!! Game", "/boardgamepublisher/62803/plus-plusout-game"), ("0 hr art & technology", "/boardgamepublisher/11073/0-hr-art-and-technology"), | |
| ("029 Products", "/boardgamepublisher/50604/029-products"), ("1 Armadillo", "/boardgamepublisher/57250/1-armadillo"), | |
| ("The 1 Game", "/boardgamepublisher/4004/the-1-game"), ("1 More Time Games", "/boardgamepublisher/43879/1-more-time-games"), | |
| ("1 Stein Spiele", "/boardgamepublisher/12483/1-stein-spiele"), ("1-2-3-Games Éditions", "/boardgamepublisher/5055/1-2-3-games-editions"), | |
| ("1% Inspiration Games, Inc.", "/boardgamepublisher/4658/1-percent-inspiration-games-inc"), ("1+1 Studios", "/boardgamepublisher/60248/1-plus-1-studios"), | |
| ("10 Traders", "/boardgamepublisher/51819/10-traders"), ("10-Productions", "/boardgamepublisher/30026/10-productions"), | |
| ), | |
| ), | |
| "/browse/boardgamehonor": ( | |
| "Board Game Honors", "Awards, nominations, winners, and hall-of-fame records", ( | |
| ("1974 Charles S. Roberts Best Amateur Game Nominee", "/boardgamehonor/10866/1974-charles-s-roberts-best-amateur-game-nominee"), | |
| ("1974 Charles S. Roberts Best Amateur Game Winner", "/boardgamehonor/10865/1974-charles-s-roberts-best-amateur-game-winner"), | |
| ("1974 Charles S. Roberts Best Professional Game Nominee", "/boardgamehonor/10862/1974-charles-s-roberts-best-professional-game-nomi"), | |
| ("1974 Charles S. Roberts Best Professional Game Winner", "/boardgamehonor/10861/1974-charles-s-roberts-best-professional-game-winn"), | |
| ("1974 Charles S. Roberts Hall of Fame Inductee", "/boardgamehonor/21580/1974-charles-s-roberts-hall-of-fame-inductee"), | |
| ("1975 Charles S. Roberts Best Amateur Game Nominee", "/boardgamehonor/10868/1975-charles-s-roberrts-best-amateur-game-nominee"), | |
| ("1975 Charles S. Roberts Best Amateur Game Winner", "/boardgamehonor/10867/1975-charles-s-roberts-best-amateur-game-winner"), | |
| ("1975 Charles S. Roberts Best Professional Game Nominee", "/boardgamehonor/10864/1975-charles-s-roberts-best-professional-game-nomi"), | |
| ("1975 Charles S. Roberts Best Professional Game Winner", "/boardgamehonor/10863/1975-charles-s-roberts-best-professional-game-winn"), | |
| ("1975 Charles S. Roberts Hall of Fame Inductee", "/boardgamehonor/21581/1975-charles-s-roberts-hall-of-fame-inductee"), | |
| ("1976 Charles S. Roberts Best Graphics and Physical Systems Nominee", "/boardgamehonor/21583/1976-charles-s-roberts-best-graphics-and-physical"), | |
| ("1976 Charles S. Roberts Best Graphics and Physical Systems Winner", "/boardgamehonor/21584/1976-charles-s-roberts-best-graphics-and-physical"), | |
| ("1976 Charles S. Roberts Best Strategic Game Nominee", "/boardgamehonor/10876/1976-charles-s-roberts-best-strategic-game-nominee"), | |
| ("1976 Charles S. Roberts Best Strategic Game Winner", "/boardgamehonor/10875/1976-charles-s-roberts-best-strategic-game-winner"), | |
| ("1976 Charles S. Roberts Best Tactical Game Winner", "/boardgamehonor/10871/1976-charles-s-roberts-best-tactical-game-winner"), | |
| ("1976 Charles S. Roberts Best Tactical Nominee", "/boardgamehonor/10872/1976-charles-s-roberts-best-tactical-nominee"), | |
| ("1976 Charles S. Roberts Hall of Fame Inductee", "/boardgamehonor/21585/1976-charles-s-roberts-hall-of-fame-inductee"), | |
| ("1977 Charles S. Roberts Best Fantasy Board Game Nominee", "/boardgamehonor/10886/1977-charles-s-roberts-best-fantasy-board-game-nom"), | |
| ("1977 Charles S. Roberts Best Fantasy Board Game Winner", "/boardgamehonor/10884/1977-charles-s-roberts-best-fantasy-board-game-win"), | |
| ("1977 Charles S. Roberts Hall of Fame Inductee", "/boardgamehonor/21586/1977-charles-s-roberts-hall-of-fame-inductee"), | |
| ), | |
| ), | |
| "/browse/boardgamefamily": ( | |
| "Families", "Board games grouped into related families", ( | |
| ("Admin: Better Description Needed!", "/boardgamefamily/22783/admin-better-description-needed"), ("Admin: Book entries that should be split", "/boardgamefamily/59217/admin-book-entries-that-should-be-split"), | |
| ("Admin: Cancelled Games", "/boardgamefamily/22185/admin-cancelled-games"), ("Admin: Game System Entries", "/boardgamefamily/49247/admin-game-system-entries"), | |
| ("Admin: Miscellaneous Placeholder", "/boardgamefamily/4347/admin-miscellaneous-placeholder"), ("Admin: Outside the Scope of BGG", "/boardgamefamily/49282/admin-outside-the-scope-of-bgg"), | |
| ("Admin: Test Family", "/boardgamefamily/1/admin-test-family"), ("Admin: Unreleased Games", "/boardgamefamily/72071/admin-unreleased-games"), | |
| ("Admin: Upcoming Releases", "/boardgamefamily/22184/admin-upcoming-releases"), ("Ancient: Babylon", "/boardgamefamily/27524/ancient-babylon"), | |
| ("Ancient: Bagan", "/boardgamefamily/69139/ancient-bagan"), ("Ancient: Carthage", "/boardgamefamily/68956/ancient-carthage"), | |
| ("Ancient: Corinth", "/boardgamefamily/67857/ancient-corinth"), ("Ancient: Egypt", "/boardgamefamily/72535/ancient-egypt"), | |
| ("Ancient: Greece", "/boardgamefamily/52373/ancient-greece"), ("Ancient: Indus Valley", "/boardgamefamily/67873/ancient-indus-valley"), | |
| ("Ancient: Jericho", "/boardgamefamily/27485/ancient-jericho"), ("Ancient: Magna Graecia", "/boardgamefamily/54198/ancient-magna-graecia"), | |
| ("Ancient: Mesopotamia", "/boardgamefamily/57934/ancient-mesopotamia"), ("Ancient: Persia", "/boardgamefamily/117048/ancient-persia"), | |
| ("Ancient: Pompeii", "/boardgamefamily/27539/ancient-pompeii"), ("Ancient: Rome", "/boardgamefamily/5606/ancient-rome"), | |
| ("Ancient: Sparta", "/boardgamefamily/24921/ancient-sparta"), ("Animals: Bears", "/boardgamefamily/7265/animals-bears"), | |
| ), | |
| ), | |
| "/browse/boardgamemechanic": ( | |
| "Mechanics", "Browse the mechanisms that shape how games are played", ( | |
| ("Acting", "/boardgamemechanic/2073/acting"), ("Action / Event", "/boardgamemechanic/2840/action-event"), | |
| ("Action Drafting", "/boardgamemechanic/2838/action-drafting"), ("Action Points", "/boardgamemechanic/2001/action-points"), | |
| ("Action Queue", "/boardgamemechanic/2689/action-queue"), ("Action Retrieval", "/boardgamemechanic/2839/action-retrieval"), | |
| ("Action Timer", "/boardgamemechanic/2834/action-timer"), ("Advantage Token", "/boardgamemechanic/2847/advantage-token"), | |
| ("Algorithmic Resolution", "/boardgamemechanic/3140/algorithmic-resolution"), ("Alliances", "/boardgamemechanic/2916/alliances"), | |
| ("Area Majority / Influence", "/boardgamemechanic/2080/area-majority-influence"), ("Area Movement", "/boardgamemechanic/2046/area-movement"), | |
| ("Area-Impulse", "/boardgamemechanic/2021/area-impulse"), ("Auction / Bidding", "/boardgamemechanic/2012/auction-bidding"), | |
| ("Auction Compensation", "/boardgamemechanic/3098/auction-compensation"), ("Auction: Dexterity", "/boardgamemechanic/2930/auction-dexterity"), | |
| ("Auction: Dutch", "/boardgamemechanic/2924/auction-dutch"), ("Auction: Dutch Priority", "/boardgamemechanic/2932/auction-dutch-priority"), | |
| ("Auction: English", "/boardgamemechanic/2918/auction-english"), ("Auction: Fixed Placement", "/boardgamemechanic/2931/auction-fixed-placement"), | |
| ("Auction: Multiple Lot", "/boardgamemechanic/2927/auction-multiple-lot"), ("Auction: Sealed Bid", "/boardgamemechanic/2920/auction-sealed-bid"), | |
| ("Betting and Bluffing", "/boardgamemechanic/2014/betting-and-bluffing"), ("Campaign / Battle Card Driven", "/boardgamemechanic/2018/campaign-battle-card-driven"), | |
| ), | |
| ), | |
| "/browse/boardgamedesigner": ( | |
| "Board Game Designers", "Directory of board game designers", ( | |
| ("Robert Barrile", "/boardgamedesigner/171655/robert-barrile"), ("Mark Mangan", "/boardgamedesigner/158831/mark-mangan"), | |
| ("Aaron C. Smith (II)", "/boardgamedesigner/155251/aaron-c-smith-ii"), ("– – (2traces)", "/boardgamedesigner/164398/2traces"), | |
| ("(Uncredited)", "/boardgamedesigner/3/uncredited"), ("↑もつなべ太郎← (Ue Motunabetarou Hidari)", "/boardgamedesigner/80819/motsunabetai-lang-ue-motunabetarou-hidari"), | |
| ("138 Games", "/boardgamedesigner/150077/138-games"), ("13Rentgen", "/boardgamedesigner/28167/13rentgen"), | |
| ("23", "/boardgamedesigner/122367/23"), ("274", "/boardgamedesigner/144326/274"), | |
| ("2No (Nino)", "/boardgamedesigner/168968/2no-nino"), ("326", "/boardgamedesigner/112767/326"), | |
| ("39", "/boardgamedesigner/157296/39"), ("5th Door Designs", "/boardgamedesigner/47090/5th-door-designs"), | |
| ("6jizo", "/boardgamedesigner/163935/6jizo"), ("6ちゃんねる (6 Channel)", "/boardgamedesigner/172371/6chiyanneru-6-channel"), | |
| ("7.7", "/boardgamedesigner/50917/77"), ("8Rad", "/boardgamedesigner/68614/8rad"), | |
| ("Ahmet A", "/boardgamedesigner/143474/ahmet-a"), ("a-tan-pic (aたん)", "/boardgamedesigner/92218/a-tan-pic-atan"), | |
| ("César Dabián A.", "/boardgamedesigner/10415/cesar-dabian-a"), ("Florian A.", "/boardgamedesigner/122854/florian-a"), | |
| ("A.B. Jack", "/boardgamedesigner/152181/ab-jack"), ("A20 Dino the game designer", "/boardgamedesigner/129384/a20-dino-the-game-designer"), | |
| ), | |
| ), | |
| "/browse/boardgameaccessory": ( | |
| "Board Game Accessories", "Top-rated accessories in the board game database", ( | |
| ("The Quacks of Quedlinburg: GeekUp Bit Set", "/boardgameaccessory/285658/the-quacks-of-quedlinburg-geekup-bit-set"), | |
| ("Iron Clays", "/boardgameaccessory/233281/iron-clays"), ("Terraforming Mars: Dual Layer Player Boards", "/boardgameaccessory/293310/terraforming-mars-dual-layer-player-boards"), | |
| ("The Quacks of Quedlinburg: The Herb Witches – GeekUp Bit Set", "/boardgameaccessory/291712/the-quacks-of-quedlinburg-the-herb-witches-geekup"), | |
| ("Scythe: Realistic Resource Tokens", "/boardgameaccessory/238417/scythe-realistic-resource-tokens"), ("Viticulture: Custom Metal Lira Coins", "/boardgameaccessory/156417/viticulture-custom-metal-lira-coins"), | |
| ("Scythe: Metal Coins", "/boardgameaccessory/211947/scythe-metal-coins"), ("7 Wonders Duel: Metal Coins", "/boardgameaccessory/219880/7-wonders-duel-metal-coins"), | |
| ("Lords of Waterdeep: Character Meeples", "/boardgameaccessory/145782/lords-of-waterdeep-character-meeples"), ("Too Many Bones: Premium Health", "/boardgameaccessory/224901/too-many-bones-premium-health"), | |
| ("High Frontier: Poster Map", "/boardgameaccessory/94454/high-frontier-poster-map"), ("Scythe: Promo Pack #10 – $2 Albion Metal Coins", "/boardgameaccessory/216392/scythe-promo-pack-10-2-dollars-albion-metal-coins"), | |
| ("Scythe: Neoprene Playmat", "/boardgameaccessory/266152/scythe-neoprene-playmat"), ("7 Wonders: Metal Coins", "/boardgameaccessory/196929/7-wonders-metal-coins"), | |
| ("Anachrony: Exosuit Miniature Set", "/boardgameaccessory/297527/anachrony-exosuit-miniature-set"), ("Scythe: Complete Rulebook", "/boardgameaccessory/317056/scythe-complete-rulebook"), | |
| ), | |
| ), | |
| "/browse/boardgamepodcast": ( | |
| "Podcasts", "Board game podcasts in the public directory", ( | |
| ("1 Player podcast", "/boardgamepodcast/10719/1-player-podcast"), ("10 Minute Design Chat", "/boardgamepodcast/70152/10-minute-design-chat"), | |
| ("2 Asians 1 Board", "/boardgamepodcast/102187/2-asians-1-board"), ("2 Champs and a Chump", "/boardgamepodcast/24245/2-champs-and-a-chump"), | |
| ("The 2 Half-Squads: Advanced Squad Leader Podcast", "/boardgamepodcast/7160/the-2-half-squads-advanced-squad-leader-podcast"), | |
| ("2.1: A Netrunner Reboot Project Podcast", "/boardgamepodcast/80022/21-a-netrunner-reboot-project-podcast"), | |
| ("20 Minute Tabletop", "/boardgamepodcast/101975/20-minute-tabletop"), ("The 20 Minutes of Filler Podcast", "/boardgamepodcast/24570/the-20-minutes-of-filler-podcast"), | |
| ("2Pionki", "/boardgamepodcast/55676/2pionki"), ("4VP - The Gaming Podcast", "/boardgamepodcast/19713/4vp-the-gaming-podcast"), | |
| ("7LandHand.com", "/boardgamepodcast/26644/7landhandcom"), ("⑨的完美桌游教室", "/boardgamepodcast/26667/9de-wan-mei-zhuo-you-jiao-shi"), | |
| ("A Bit of Board Games: A Board Game Design Journey", "/boardgamepodcast/77085/a-bit-of-board-games-a-board-game-design-journey"), | |
| ("A Double Double 'n Dice - A Tabletop Gaming Podcast", "/boardgamepodcast/60997/a-double-double-n-dice-a-tabletop-gaming-podcast"), | |
| ("Abenteuer Brettspiele Podcast", "/boardgamepodcast/53545/abenteuer-brettspiele-podcast"), ("Ablagestapel - Der Podcast über Spiele", "/boardgamepodcast/46030/ablagestapel-der-podcast-uber-spiele"), | |
| ("Across The Board - A Board Game Podcast", "/boardgamepodcast/46857/across-the-board-a-board-game-podcast"), ("Action Points! » Podcast", "/boardgamepodcast/25663/action-points-podcast"), | |
| ("Ad Hominem: The Podcast of Illogical Debate", "/boardgamepodcast/46971/ad-hominem-the-podcast-of-illogical-debate"), ("Adamantly Analog: A Board Game Podcast", "/boardgamepodcast/104584/adamantly-analog-a-board-game-podcast"), | |
| ), | |
| ), | |
| } | |
| BROWSE_ENTRY_LABELS = { | |
| href: (title, label) | |
| for _route, (title, _subtitle, entries) in BROWSE_DIRECTORY_PAGES.items() | |
| for label, href in entries | |
| } | |
| def browse_layout(content: str) -> str: | |
| return f'''<div class="browse-source-page"><div class="browse-source-ad" role="note" aria-label="Advertisement"></div><div class="browse-source-layout"><aside class="browse-visible-hotness">{source_search_sidebar()}</aside><section class="browse-source-content">{content}</section></div></div>''' | |
| def browse_pagination(path: str) -> str: | |
| return f'''<nav class="browse-pagination" aria-label="Pagination"><a class="active" aria-current="page" href="{e(path)}">1</a><a href="{e(path)}?page=2">2</a><a href="{e(path)}?page=3">3</a><a href="{e(path)}?page=4">4</a><a href="{e(path)}?page=5">5</a><a href="{e(path)}?page=2">Next »</a></nav>''' | |
| def browse() -> HTMLResponse: | |
| content = f'''<header class="browse-source-heading"><h1>Browse Board Games</h1>{browse_pagination("/browse/boardgame")}</header><p class="browse-commission">We may earn a commission when you buy through our links.</p><div class="game-list">{''.join(game_row(g) for g in service.games())}</div>''' | |
| return response(shell("Browse Board Games | BoardGameGeek", browse_layout(content))) | |
| def browse_directory(request: Request) -> HTMLResponse: | |
| title, subtitle, entries = BROWSE_DIRECTORY_PAGES[request.url.path] | |
| page = max(1, min(5, int(request.query_params.get("page", "1")))) if request.query_params.get("page", "1").isdigit() else 1 | |
| links = "".join(f'<li><a href="{e(href)}">{e(label)}</a></li>' for label, href in entries) | |
| category_single_page = request.url.path == "/browse/boardgamecategory" | |
| pagination = "" if category_single_page else browse_pagination(request.url.path) | |
| page_marker = "" if category_single_page else f'<p class="browse-page-marker">Page {page} of the captured public directory</p>' | |
| content = f'''<header class="browse-source-heading"><div><h1>{e(title)}</h1><p>{e(subtitle)}</p></div>{pagination}</header>{page_marker}<ul class="browse-directory-grid">{links}</ul>''' | |
| return response(shell(f"{title} | BoardGameGeek", browse_layout(content))) | |
| def browse_entry(request: Request, item_id: int, slug: str) -> HTMLResponse: | |
| directory_title, label = BROWSE_ENTRY_LABELS.get(request.url.path, ("BoardGameGeek Directory", slug.replace("-", " ").title())) | |
| related = "".join(game_row(game) for game in service.games()) | |
| content = f'''<nav class="crumbs"><a href="/browse/boardgame">Browse</a> <span aria-hidden="true">›</span> {e(directory_title)}</nav><article class="browse-entry-card"><p class="eyebrow">{e(directory_title)}</p><h1>{e(label)}</h1><p>This public directory record is connected to the local board game catalog.</p></article><section><h2 class="browse-related-title">Related board games</h2><div class="game-list">{related}</div></section>''' | |
| return response(shell(f"{label} | BoardGameGeek", browse_layout(content))) | |
| def random_game() -> RedirectResponse: | |
| return RedirectResponse("/boardgame/30549/pandemic", status_code=307) | |
| GONE_CARDBOARD_ROWS = ( | |
| ("122", "LEGO: NINJAGO – Destiny's Bounty Adventures", "Dotted Games", "Jonas Resting-Jeppesen", "Jul 30, 2026", "2026-01-17"), | |
| ("105", "Rolling Seas", "Nuts! Publishing", "George Jaros", "2026-07-28", "English edition"), | |
| ("273", "Grendel: The Game of Crime and Mayhem", "Off the Page Games", "Alara Cameron · Sen-Foong Lim", "Jul 2026", "2025-04-21"), | |
| ("140", "Battle Monsters: Godzilla vs. King Ghidorah", "Restoration Games", "Stephen Baker · Rob Daviau", "Aug 2026", "2025-07-12"), | |
| ("370", "Camp Grizzly: Second Edition", "Trick or Treat Studios", "Jason Topolski", "Aug 2026", "2025-07-14"), | |
| ("948", "Excalibur", "Roxley", "Manny Trembley", "Aug 2026", "2026-05-09"), | |
| ("225", "Mystic Lands", "Alderac Entertainment Group", "John D. Clair", "Nov 2026", "2025-11-13"), | |
| ("1182", "Sail Legacy", "Allplay", "Taylor Reiner", "Mar 24, 2027", "2026-08-01"), | |
| ("290", "Savage Bowl", "Allplay", "URiO", "Aug 2026", "2025-08-28"), | |
| ("169", "Sick Tricks", "Allplay", "Masato Uesugi", "Aug 2026", "2025-08-28"), | |
| ) | |
| def gone_cardboard(request: Request) -> HTMLResponse: | |
| rows = "".join( | |
| f'''<tr><td>{e(wishlist)}</td><td><a href="/gonecardboard?item={e(public_item_key(title))}"><strong>{e(title)}</strong></a><small>English edition</small></td><td>{e(publisher)}</td><td>{e(designer)}</td><td>{e(release)}</td><td>{e(updated)}</td></tr>''' | |
| for wishlist, title, publisher, designer, release, updated in GONE_CARDBOARD_ROWS | |
| ) | |
| selected_key = request.query_params.get("item", "") | |
| selected = next((row for row in GONE_CARDBOARD_ROWS if public_item_key(row[1]) == selected_key), None) | |
| selected_markup = f'''<section class="browse-entry-card"><p class="eyebrow">Gone Cardboard</p><h2>{e(selected[1])}</h2><p>{e(selected[2])} · {e(selected[3])} · release {e(selected[4])}</p><a href="/gonecardboard">Back to all listings</a></section>''' if selected else "" | |
| content = f'''<header class="browse-source-heading"><div><h1>Gone Cardboard</h1><p>Upcoming and recently announced board game versions</p></div>{browse_pagination("/gonecardboard")}</header><form class="gone-filters" action="/gonecardboard" method="get"><label>Sort <select name="sort"><option>Game</option><option>Publisher</option><option>Release Date</option><option>Latest Updates</option></select></label><label>Status <select name="status"><option>All</option><option>Released</option><option>Unreleased</option></select></label><button class="btn btn-small" type="submit">Apply</button></form>{selected_markup}<div class="browse-table-wrap"><table class="browse-data-table"><caption>Gone Cardboard listings</caption><thead><tr><th># Wishlist</th><th>Game</th><th>Publisher</th><th>Designer</th><th>Release Date</th><th>Updated</th></tr></thead><tbody>{rows}</tbody></table></div>''' | |
| return response(shell("Browse Board Game Versions | BoardGameGeek", browse_layout(content))) | |
| PREVIEW_EVENTS = ( | |
| ("SPIEL Essen 2026", "Oct 22, 2026 – Oct 25, 2026", "Essen, Germany", "A list highlighting new games introduced at SPIEL Essen '26."), | |
| ("Test List", "Aug 1, 2026 – Aug 30, 2026", "", "A public preview list used to organize upcoming titles."), | |
| ("Gen Con 2026 Preview", "Jul 30, 2026 – Aug 2, 2026", "Indianapolis, Indiana, USA", "Gen Con is the largest and longest-running game convention in the U.S."), | |
| ("Origins Game Fair 2026 Preview", "Jun 17, 2026 – Jun 21, 2026", "Columbus, Ohio, USA", "This preview highlights titles debuting at Origins 2026."), | |
| ("UK Games Expo", "May 29, 2026 – May 31, 2026", "Birmingham, UK", "A preview of games appearing at the UK's largest hobby games convention."), | |
| ("Game Market Spring 2026", "May 23, 2026 – May 24, 2026", "Tokyo, Japan", "A public list of releases presented at Game Market."), | |
| ) | |
| def previews(request: Request) -> HTMLResponse: | |
| selected_key = request.query_params.get("item", "") | |
| cards = "".join(f'''<article class="preview-event"><p class="preview-date">{e(dates)}</p><h2><a href="/previews?item={e(public_item_key(title))}">{e(title)}</a></h2><p class="preview-place">{e(place)}</p><p>{e(description)}</p></article>''' for title, dates, place, description in PREVIEW_EVENTS) | |
| selected = next((event for event in PREVIEW_EVENTS if public_item_key(event[0]) == selected_key), None) | |
| selected_markup = f'''<section class="browse-entry-card"><p class="eyebrow">Selected preview</p><h2>{e(selected[0])}</h2><p>{e(selected[1])} · {e(selected[2])}</p><p>{e(selected[3])}</p><a href="/previews">Back to all previews</a></section>''' if selected else "" | |
| content = f'''<header class="browse-source-heading"><div><h1>Previews</h1><p>Convention and release preview lists</p></div></header>{selected_markup}<div class="preview-event-list">{cards}</div>''' | |
| return response(shell("Previews | BoardGameGeek", browse_layout(content))) | |
| WIKI_INDEX_GROUPS = ( | |
| ("BoardGameGeek Wiki", (("About the BoardGameGeek Wiki", "/wiki/page/Welcome_to_BoardGameGeek"), ("Game Description Guidelines", "/wiki/page/Guide_To_BoardGameGeek"), ("Wiki Content Guidelines", "/community_rules"), ("BoardGameGeek Wiki Style Guide", "/wiki/page/Glossary"), ("Wiki Formatting", "/wiki/page/Glossary"))), | |
| ("BoardGameGeek.com Related", (("Welcome to BoardGameGeek", "/wiki/page/Welcome_to_BoardGameGeek"), ("Guide to BoardGameGeek", "/wiki/page/Guide_To_BoardGameGeek"), ("BoardGameGeek FAQ", "/wiki/page/BoardGameGeek_FAQ"), ("BoardGameGeek Glossary", "/wiki/page/Glossary"), ("BoardGameGeek Admins", "/wiki/page/Admins"))), | |
| ("Boardgame Categorization", (("Games by category", "/browse/boardgamecategory"), ("Games by family", "/browse/boardgamefamily"), ("Games by mechanic", "/browse/boardgamemechanic"), ("Games by designer", "/browse/boardgamedesigner"), ("Games by publisher", "/browse/boardgamepublisher"))), | |
| ("General Gaming", (("All Boardgames", "/browse/boardgame"), ("Board Game Honors", "/browse/boardgamehonor"), ("Board Game Accessories", "/browse/boardgameaccessory"), ("Podcasts", "/browse/boardgamepodcast"), ("Community Rules", "/community_rules"))), | |
| ) | |
| def wiki_index() -> HTMLResponse: | |
| groups = "".join(f'''<section><h2>{e(title)}</h2><ul>{''.join(f'<li><a href="{e(href)}">{e(label)}</a></li>' for label, href in links)}</ul></section>''' for title, links in WIKI_INDEX_GROUPS) | |
| content = f'''<article class="wiki-index-card"><nav class="wiki-tools" aria-label="Wiki tools"><label>Search: <input type="search" name="q"></label><a href="/wiki/page/Index">Index</a><a href="/recentadditions">Recent</a><a href="/wiki/page/Guide_To_BoardGameGeek">Guidelines</a></nav><h1>Index</h1><p>This is the top level map of all Geekdo wiki content.</p><div class="wiki-index-groups">{groups}</div></article>''' | |
| return response(shell("Index | Wiki | BoardGameGeek", browse_layout(content))) | |
| HALL_OF_FAME_GAMES = ( | |
| ("1830: Railways & Robber Barons", "1986", "A classic game of managing railroads and investing wisely."), | |
| ("Pandemic", "2008", "Work together as disease-fighting specialists to stop global outbreaks."), | |
| ("Ticket to Ride", "2004", "Build railway routes across a shared map."), | |
| ("Catan", "1995", "Trade resources and build settlements on a modular island."), | |
| ("Brass: Birmingham", "2018", "Build networks and industries during the Industrial Revolution."), | |
| ("Wingspan", "2019", "Attract birds to a growing wildlife preserve."), | |
| ("Ark Nova", "2021", "Plan a modern zoo supporting conservation projects."), | |
| ("Twilight Struggle", "2005", "A two-player contest tracing the political tension of the Cold War."), | |
| ("Carcassonne", "2000", "Place tiles and followers to shape a medieval landscape."), | |
| ("Dominion", "2008", "Build a deck while developing a medieval kingdom."), | |
| ) | |
| def hall_of_fame(request: Request) -> HTMLResponse: | |
| selected_key = request.query_params.get("item", "") | |
| cards = "".join(f'''<article class="hall-game-card"><span class="hall-score">{index}</span><div><h2><a href="/geekpreview/72/the-boardgamegeek-hall-of-fame?item={e(public_item_key(title))}">{e(title)} <small>({e(year)})</small></a></h2><p>{e(description)}</p><dl><dt>Players</dt><dd>2–5</dd><dt>Play time</dt><dd>60–120 min</dd><dt>Age</dt><dd>10+</dd></dl></div></article>''' for index, (title, year, description) in enumerate(HALL_OF_FAME_GAMES, 1)) | |
| selected = next((game for game in HALL_OF_FAME_GAMES if public_item_key(game[0]) == selected_key), None) | |
| selected_markup = f'''<section class="browse-entry-card"><p class="eyebrow">Hall of Fame title</p><h2>{e(selected[0])}</h2><p>{e(selected[2])}</p><a href="/geekpreview/72/the-boardgamegeek-hall-of-fame">Back to all titles</a></section>''' if selected else "" | |
| content = f'''<header class="hall-hero"><h1>The BoardGameGeek Hall Of Fame</h1><p>The BoardGameGeek Hall of Fame honors games that have made meaningful contributions to the board game hobby in innovation, artistry, and impact.</p></header><div class="hall-toolbar"><strong>Showing {len(HALL_OF_FAME_GAMES)} captured titles</strong><label>Search titles <input type="search" name="q"></label><label>Sort by <select><option>Title</option><option>Year</option></select></label></div>{selected_markup}<div class="hall-game-list">{cards}</div>''' | |
| return response(shell("GeekPreview: The BoardGameGeek Hall of Fame | BoardGameGeek", browse_layout(content))) | |
| def trending_plays() -> HTMLResponse: | |
| rows = "".join(f'''<li><span class="trend-position">{index}</span><img src="/static/assets/home/{e(asset)}?v=3" width="88" height="50" alt=""><div><h2><a href="{e(href)}">{e(title)}</a></h2><p>{e(description)}</p><small>{index} month{'s' if index != 1 else ''} on the list</small></div></li>''' for index, (title, href, description, asset, _direction) in enumerate(HOME_HOTNESS[:25], 1)) | |
| content = f'''<header class="trend-hero"><h1>Trending Plays</h1><p>Top 25 games with the fastest growing number of plays by month</p></header><nav class="trend-period" aria-label="Period"><a href="/trends/trendingplays?month=previous">Previous</a><strong>July 2026</strong><a href="/trends/trendingplays?month=next">Next</a></nav><ol class="trend-page-list">{rows}</ol>''' | |
| return response(shell("Trending Plays | BoardGameGeek", browse_layout(content))) | |
| def hotness() -> HTMLResponse: | |
| items = "".join(f'''<li><span class="hotness-page-rank">{index}</span><img src="/static/assets/home/{e(asset)}?v=3" width="120" height="68" alt=""><div><h2><a href="{e(href)}">{e(title)}</a></h2><p>{e(description)}</p></div></li>''' for index, (title, href, description, asset, _trend) in enumerate(HOME_HOTNESS, 1)) | |
| body = f'''<div class="public-index hotness-page"><nav class="crumbs"><a href="/">Home</a> <span aria-hidden="true">›</span> The Hotness</nav><header class="public-index-hero"><p class="eyebrow">BoardGameGeek</p><h1>The Hotness</h1><p>Top 50 trending games today</p></header><ol class="hotness-page-list">{items}</ol></div>''' | |
| return response(shell("The Hotness | BoardGameGeek", body)) | |
| def forum_markup(game_id: int, saved: bool = False) -> tuple[str, int]: | |
| game = service.game(game_id) | |
| if game is None: | |
| return shell("Forums | BoardGameGeek", '<div class="empty"><h1>Forum not found</h1></div>'), 404 | |
| rows = service.topics(game_id) | |
| notice = '<div class="notice success">Question posted. It now appears at the top of the Ticket to Ride forum.</div>' if saved else '' | |
| items = ''.join(f'<article class="topic-row"><div><a class="topic-title" href="/thread/{t["topic_id"]}/{re.sub(r"[^a-z0-9]+","-",t["title"].lower()).strip("-")}">{e(t["title"])}</a><div class="secondary">{e(t["body"])}</div></div><div>{e(t["owner"])}</div><div>{e(t["created_at"][:10])}</div></article>' for t in rows) | |
| body = f'<div class="crumbs"><a href="/boardgame/{game_id}/{game["slug"]}">{e(game["title"])}</a> › Forums</div><div class="thread-tools"><h1 class="layout-title">{e(game["title"])} Forums</h1><a class="btn btn-primary" href="/forum/new/{game_id}">Post a Question</a></div>{notice}<nav class="subnav"><a class="active" href="#">All Forums</a><a href="#strategy">Strategy</a><a href="#rules">Rules</a><a href="#general">General</a></nav><section class="forum-table"><div class="forum-head"><div>Topic</div><div>Author</div><div>Last post</div></div>{items}</section>' | |
| return shell(f"{game['title']} Forums | BoardGameGeek", body), 200 | |
| def forum(game_id: int, slug: str, saved: int = 0) -> HTMLResponse: | |
| markup, status = forum_markup(game_id, bool(saved)) | |
| return response(markup, status) | |
| def forum_new(game_id: int) -> HTMLResponse: | |
| game = service.game(game_id) | |
| if game is None: | |
| return response(shell("Post a Question | BoardGameGeek", '<div class="empty"><h1>Game not found</h1></div>'), 404) | |
| body = f'<div class="crumbs"><a href="/boardgame/{game_id}/{game["slug"]}/forums/0">{e(game["title"])} Forums</a> › Post a Question</div><h1>Post a Question</h1><form class="form-card" action="/forum/new/{game_id}" method="post"><div class="field"><label for="subject">Subject <span class="required">*</span></label><input id="subject" name="subject" placeholder="Best strategy for long routes"></div><div class="field"><label for="question">Question <span class="required">*</span></label><textarea id="question" name="question" placeholder="What is the best strategy for completing long routes?"></textarea></div><button class="btn btn-primary">Post Question</button> <a class="btn" href="/boardgame/{game_id}/{game["slug"]}/forums/0">Cancel</a></form>' | |
| return response(shell("Post a Question | BoardGameGeek", body)) | |
| async def forum_create(game_id: int, request: Request): | |
| data = await fields(request) | |
| try: | |
| service.create_topic(game_id, first(data, "subject"), first(data, "question")) | |
| except ValueError as exc: | |
| game = service.game(game_id) | |
| body = f'<h1>Post a Question</h1><div class="notice error">{e(exc)}. Correct the required fields before continuing.</div><form class="form-card" action="/forum/new/{game_id}" method="post"><div class="field"><label>Subject <span class="required">*</span></label><input name="subject" value="{e(first(data,"subject"))}"></div><div class="field"><label>Question <span class="required">*</span></label><textarea name="question">{e(first(data,"question"))}</textarea></div><button class="btn btn-primary">Post Question</button></form>' | |
| return response(shell("Post a Question | BoardGameGeek", body), 422) | |
| game = service.game(game_id) | |
| return RedirectResponse(f"/boardgame/{game_id}/{game['slug']}/forums/0?saved=1", status_code=303) | |
| def health() -> JSONResponse: | |
| service.services() | |
| return JSONResponse({"status":"ok","site_id":"boardgamegeek"}) | |
| def reset(request: Request) -> JSONResponse: | |
| service.reset() | |
| return JSONResponse({"status":"reset","site_id":"boardgamegeek"}) | |
| def play_form(game_id: int, error: str = "", values: dict[str, list[str]] | None = None) -> str: | |
| game = service.game(game_id) | |
| if game is None: | |
| return shell("Log a Play | BoardGameGeek", '<div class="empty"><h1>Game not found</h1></div>') | |
| values = values or {} | |
| names = [first(values, f"p{i}", default) for i, default in enumerate(("Alex", "Casey", "Jordan", "Morgan", "", ""), 1)] | |
| scores = [first(values, f"score{i}", default) for i, default in enumerate(("12", "9", "8", "7", "", ""), 1)] | |
| count = first(values, "players", "4") | |
| rows = "".join(f'<div class="participant-grid" data-player-row><strong>{i}</strong><input aria-label="Player {i} name" name="p{i}" value="{e(names[i-1])}" placeholder="Player name"><input aria-label="Player {i} score" name="score{i}" value="{e(scores[i-1])}" placeholder="Score"></div>' for i in range(1, 7)) | |
| error_html = f'<div class="notice error">{e(error)}. Correct the highlighted fields before continuing.</div>' if error else "" | |
| body = f"""<div class="crumbs"><a href="/boardgame/{game_id}/{game['slug']}">{e(game['title'])}</a> › Log Play</div><h1 class="layout-title">Log a Play: {e(game['title'])}</h1>{error_html} | |
| <form class="form-card" action="/geekplay.php" method="post"><input type="hidden" name="game_id" value="{game_id}"> | |
| <div class="field"><label for="played_on">Date played <span class="required">*</span></label><input id="played_on" name="played_on" type="date" value="{e(first(values,'played_on','2026-08-24'))}" required></div> | |
| <div class="field"><label for="duration">Duration in minutes <span class="required">*</span></label><input id="duration" name="duration" type="number" min="1" value="{e(first(values,'duration','60'))}" required><div class="hint">Enter total play time, excluding setup.</div></div> | |
| <div class="field"><label for="players">Number of players <span class="required">*</span></label><input id="players" name="players" type="number" min="1" max="6" value="{e(count)}" required></div> | |
| <h2>Participants and scores</h2>{rows} | |
| <div class="field"><label for="comments">Comments</label><textarea id="comments" name="comments">{e(first(values,'comments','Four-player cooperative game.'))}</textarea></div> | |
| <button class="btn btn-primary" type="submit">Save Play</button> <a class="btn" href="/boardgame/{game_id}/{game['slug']}">Cancel</a> | |
| </form>""" | |
| return shell(f"Log a Play: {game['title']} | BoardGameGeek", body) | |
| def new_play(objectid: int = 30549, action: str = "new", objecttype: str = "thing") -> HTMLResponse: | |
| return response(play_form(objectid)) | |
| async def create_play(request: Request): | |
| data = await fields(request) | |
| try: | |
| game_id = int(first(data, "game_id", "0")) | |
| duration = int(first(data, "duration", "0")) | |
| count = int(first(data, "players", "0")) | |
| if count < 1 or count > 6: | |
| raise ValueError("number of players must be from 1 to 6") | |
| names = [first(data, f"p{i}") for i in range(1, count + 1)] | |
| scores = [first(data, f"score{i}") for i in range(1, count + 1)] | |
| play_id = service.create_play(game_id, first(data, "played_on"), duration, first(data, "comments"), names, scores) | |
| except (ValueError, TypeError) as exc: | |
| game_id = int(first(data, "game_id", "30549") or 30549) | |
| return response(play_form(game_id, str(exc), data), 422) | |
| return RedirectResponse(f"/plays/bygame/user/local-member/subtype/boardgame?created={play_id}", status_code=303) | |
| def play_history(created: int = 0) -> HTMLResponse: | |
| items = service.plays() | |
| notice = '<div class="notice success">Play logged. The saved play appears below.</div>' if created else "" | |
| rows = "" | |
| for item in items: | |
| people = "".join(f'<span class="avatar">{e(p["name"])}{f" · {e(p["score"])}" if p["score"] else ""}</span>' for p in item["participants"]) | |
| rows += f'<article class="play-row" id="play-{item["play_id"]}"><div><strong>{e(item["played_on"])}</strong><div class="secondary">Play #{item["play_id"]}</div></div><div><h3><a href="/boardgame/{item["game_id"]}/{e(item["slug"])}">{e(item["title"])}</a></h3><p>{e(item["comments"])}</p><div class="avatars">{people}</div></div><div class="play-meta">{len(item["participants"])} players</div><div class="play-meta">{item["duration_minutes"]} minutes</div></article>' | |
| body = f'<div class="thread-tools"><div><h1 class="layout-title">Local Member — Play History</h1><p>Board game plays, newest first</p></div><a class="btn" href="/collection/user/local-member">View Collection</a></div>{notice}{rows}' | |
| return response(shell("Play History | BoardGameGeek", body)) | |
| def collection_page() -> HTMLResponse: | |
| rows = [] | |
| for game in service.games(): | |
| status = service.collection(game["game_id"]) | |
| if not status: | |
| continue | |
| markers = [] | |
| if status["owned"]: markers.append("Owned") | |
| if status["wishlist"]: markers.append("Wishlist") | |
| if status["fan"]: markers.append("★ Fan") | |
| if status["rating"]: markers.append(f'Rated {status["rating"]}/10') | |
| rows.append(f'<article class="game-row">{cover(game,True)}<div><a class="game-name" href="/boardgame/{game["game_id"]}/{game["slug"]}">{e(game["title"])} ({game["year"]})</a><div>{e(status["comment"])}</div></div><div>{" · ".join(markers)}</div><div>{e(status["updated_at"][:10])}</div><div></div><div></div></article>') | |
| body = '<div class="thread-tools"><div><h1 class="layout-title">Local Member — Collection</h1><p>Games and contribution status</p></div><a class="btn" href="/plays/bygame/user/local-member/subtype/boardgame">Play History</a></div><div class="game-list">'+''.join(rows)+'</div>' | |
| return response(shell("Collection | BoardGameGeek", body)) | |
| def files_page(game_id: int, slug: str) -> HTMLResponse: | |
| game = service.game(game_id) | |
| if not game: | |
| return response(shell("Files | BoardGameGeek", '<div class="empty"><h1>Game not found</h1></div>'),404) | |
| body = f'<div class="crumbs"><a href="/boardgame/{game_id}/{game["slug"]}">{e(game["title"])}</a> › Files</div><h1>{e(game["title"])} Files</h1><section class="card section"><h2>Files</h2><p><strong>Player aid and setup reference</strong></p><p>Community-created reference · English · PDF</p><button class="btn" type="button">Preview file details</button></section><a class="btn" href="/boardgame/{game_id}/{game["slug"]}/forums/0">Community discussions</a>' | |
| return response(shell(f"{game['title']} Files | BoardGameGeek",body)) | |
| def ratings_page(game_id: int, slug: str) -> HTMLResponse: | |
| markup, status = game_page_markup(game_id) | |
| markup = markup.replace("About this game", "Ratings & comments", 1) | |
| return response(markup,status) | |
| def community_page(game_id: int, slug: str) -> HTMLResponse: | |
| game = service.game(game_id) | |
| if not game: return response(shell("Community | BoardGameGeek",'<div class="empty"><h1>Game not found</h1></div>'),404) | |
| body = f'<div class="crumbs"><a href="/boardgame/{game_id}/{game["slug"]}">{e(game["title"])}</a> › Community</div><h1>{e(game["title"])} Community</h1><div class="help-grid"><section class="help-card"><h2>Forums</h2><p>Strategy, rules, and general discussion.</p><a href="/boardgame/{game_id}/{game["slug"]}/forums/0">Open forums</a></section><section class="help-card"><h2>GeekLists</h2><p>Curated lists from players.</p><a href="/geeklist/1/modern-strategy-night">Open GeekList</a></section><section class="help-card"><h2>Fans</h2><p>See collection interest and contributions.</p><a href="/collection/user/local-member">View collection</a></section></div>' | |
| return response(shell(f"{game['title']} Community | BoardGameGeek",body)) | |
| def thread_page(topic_id: int, slug: str, order: str = "oldest") -> HTMLResponse: | |
| topic = service.topic(topic_id) | |
| if not topic: return response(shell("Thread not found | BoardGameGeek",'<div class="empty"><h1>Thread not found</h1></div>'),404) | |
| game = service.game(topic["game_id"]) | |
| replies = service.replies(topic_id, newest=order=="newest") | |
| posts = f'<article class="post"><div class="post-user">{e(topic["owner"])}<div class="secondary">Original poster</div></div><div class="post-body"><strong>{e(topic["title"])}</strong><p>{e(topic["body"])}</p><span class="secondary">{e(topic["created_at"])}</span></div></article>' | |
| posts += ''.join(f'<article class="post"><div class="post-user">{e(row["owner"])}</div><div class="post-body"><p>{e(row["body"])}</p><span class="secondary">{e(row["created_at"])}</span></div></article>' for row in replies) | |
| body = f'<div class="crumbs"><a href="/boardgame/{game["game_id"]}/{game["slug"]}/forums/0">{e(game["title"])} Forums</a> › Thread</div><h1>{e(topic["title"])}</h1><div class="thread-tools"><div><a href="?order=oldest">Oldest first</a> · <a href="?order=newest">Newest first</a></div><form action="/thread/{topic_id}/subscription" method="post"><button class="btn btn-small">{"Subscribed ✓" if topic["subscribed"] else "Subscribe"}</button></form></div>{posts}<form class="form-card" action="/thread/{topic_id}/reply" method="post"><h2>Reply</h2><div class="field"><label for="reply">Your reply <span class="required">*</span></label><textarea id="reply" name="reply"></textarea></div><button class="btn btn-primary">Post Reply</button></form>' | |
| return response(shell(f"{topic['title']} | BoardGameGeek",body)) | |
| async def reply(topic_id: int, request: Request): | |
| data=await fields(request) | |
| try: service.add_reply(topic_id,first(data,"reply")) | |
| except ValueError as exc: return response(shell("Reply | BoardGameGeek",f'<div class="notice error">{e(exc)}</div><a href="/thread/{topic_id}/topic">Return to thread</a>'),422) | |
| return RedirectResponse(f"/thread/{topic_id}/topic",status_code=303) | |
| def subscription(topic_id: int) -> RedirectResponse: | |
| topic=service.topic(topic_id) | |
| if topic: service.set_subscription(topic_id,not bool(topic["subscribed"])) | |
| return RedirectResponse(f"/thread/{topic_id}/topic",status_code=303) | |
| def geeklist() -> HTMLResponse: | |
| entries=[] | |
| for index,game_id in enumerate((224517,30549,9209),1): | |
| game=service.game(game_id) | |
| entries.append(f'<article class="geeklist-entry"><div class="entry-number">{index}</div>{cover(game,True)}<div><h2><a href="/boardgame/{game_id}/{game["slug"]}">{e(game["title"])}</a></h2><p>{e(game["description"])}</p><a href="#comments">3 comments</a></div></article>') | |
| body='<div class="thread-tools"><div><h1>Modern Strategy Night</h1><p>A GeekList by Local Member · 28 members following</p></div><button class="btn">Follow GeekList</button></div><section class="card">'+''.join(entries)+'</section><section id="comments" class="card section"><h2>Comments</h2><p><strong>Sam:</strong> A great mix of cooperative and competitive choices.</p><div class="field"><label>Add a comment</label><textarea></textarea></div><button class="btn">Add comment</button></section>' | |
| return response(shell("Modern Strategy Night | BoardGameGeek",body)) | |
| def auth_page( | |
| kind: str, | |
| error: str = "", | |
| identity: str = "", | |
| registration_values: dict[str, str] | None = None, | |
| ) -> str: | |
| if kind=="login": | |
| failure = f'<div class="notice error" role="alert">{e(error)}</div>' if error else '' | |
| body=f'''<div class="auth"><h1>Sign In</h1><a class="provider" href="/login?provider=google">Continue with Google</a><a class="provider" href="/login?provider=apple">Continue with Apple</a><div class="divider">or</div>{failure}<form method="post" action="/login"><div class="field"><label for="identity">Username or email</label><input id="identity" name="identity" value="{e(identity)}" autocomplete="username" required></div><div class="field"><label for="password">Password</label><input id="password" name="password" type="password" autocomplete="current-password" required></div><button class="btn btn-primary" type="submit">Sign In</button></form><p><a href="/forgot">Forgot your password?</a> · <a href="/join">Create an account</a></p><p class="hint">Review account: local.member@websitebench.test / Boardgame-demo-2026</p></div>''' | |
| elif kind=="join": | |
| values = registration_values or {} | |
| failure = f'<div class="notice error" role="alert">{e(error)}</div>' if error else '' | |
| body=f'''<div class="auth"><h1>Join BoardGameGeek</h1>{failure}<form method="post" action="/register"><div class="field"><label for="join-username">Username</label><input id="join-username" name="username" value="{e(values.get('username', ''))}" autocomplete="username" required></div><div class="field"><label for="join-email">Email address</label><input id="join-email" name="email" value="{e(values.get('email', ''))}" type="email" autocomplete="email" required></div><div class="field"><label for="join-password">Password</label><input id="join-password" name="password" type="password" autocomplete="new-password" required><div class="hint">Use at least 8 characters. We will send verification guidance before activation.</div></div><div class="field"><label for="join-display-name">Display name <span class="secondary">optional</span></label><input id="join-display-name" name="display_name" value="{e(values.get('display_name', ''))}" autocomplete="name"></div><p>By joining, you agree to the <a href="/terms">Terms of Service</a> and <a href="/privacy">Privacy Policy</a>.</p><button class="btn btn-primary" type="submit">Create account</button></form><p><a href="/login">Return to sign in</a></p></div>''' | |
| else: | |
| body='<div class="auth"><h1>Reset your password</h1><p>Enter the email address for your BoardGameGeek account. No message is sent until you choose Continue.</p><div class="field"><label for="reset-email">Email address</label><input id="reset-email" type="email" aria-describedby="reset-help"><div id="reset-help" class="hint">Enter a valid address such as name@example.com.</div></div><button class="btn btn-primary" type="button">Continue</button><p><a href="/login">Return to sign in</a></p></div>' | |
| return shell(("Sign In" if kind=="login" else "Join" if kind=="join" else "Password Reset")+" | BoardGameGeek",body) | |
| def registration_verify_page(session_token: str, error: str = "") -> str: | |
| mail = AUTH.local_mail_for_session(session_token, purpose="registration") | |
| failure = f'<div class="notice error" role="alert">{e(error)}</div>' if error else '' | |
| if mail is None: | |
| body = f'''<div class="auth"><h1>Verify your email</h1>{failure}<p>No registration verification is waiting in this browser.</p><p><a href="/join">Return to registration</a></p></div>''' | |
| else: | |
| code = str(mail["verification_code"]) | |
| body = f'''<div class="auth"><h1>Verify your email</h1>{failure}<div class="auth-local-outbox"><strong>Local email outbox</strong><p>This verification message is <b>LOCAL_ONLY</b>. No real email provider was contacted.</p><output class="local-verification-code" aria-label="Local outbox verification code">{e(code)}</output></div><form method="post" action="/join/verify"><div class="field"><label for="join-code">Verification code</label><input id="join-code" name="code" inputmode="numeric" autocomplete="one-time-code" required></div><button class="btn btn-primary" type="submit">Verify and join</button></form><p><a href="/join">Start over</a> · <a href="/login">Return to sign in</a></p></div>''' | |
| return shell("Verify your email | BoardGameGeek", body) | |
| def login() -> HTMLResponse: return response(auth_page("login")) | |
| async def login_submit(request: Request): | |
| token, _ = AUTH.ensure_session(request.cookies.get(COOKIE_NAME)) | |
| data = await fields(request) | |
| identity = first(data, "identity") | |
| try: | |
| signed_in = AUTH.sign_in(token, email=identity, password=first(data, "password")) | |
| except AuthError: | |
| return response(auth_page("login", "Could not sign in. Check the local email and password.", identity), 401) | |
| result = RedirectResponse("/", status_code=303) | |
| result.set_cookie(COOKIE_NAME, str(signed_in["session_token"]), **COOKIE) | |
| return result | |
| def logout(request: Request) -> RedirectResponse: | |
| token, _ = AUTH.ensure_session(request.cookies.get(COOKIE_NAME)) | |
| AUTH.sign_out(token) | |
| result = RedirectResponse("/", status_code=303) | |
| result.set_cookie(COOKIE_NAME, AUTH.create_anonymous_session(), **COOKIE) | |
| return result | |
| def join() -> HTMLResponse: return response(auth_page("join")) | |
| async def join_submit(request: Request): | |
| token, _ = AUTH.ensure_session(request.cookies.get(COOKIE_NAME)) | |
| data = await fields(request) | |
| values = { | |
| "username": first(data, "username").strip(), | |
| "email": first(data, "email").strip(), | |
| "display_name": first(data, "display_name").strip(), | |
| } | |
| display_name = values["display_name"] or values["username"] | |
| try: | |
| AUTH.start_registration( | |
| token, | |
| email=values["email"], | |
| display_name=display_name, | |
| password=first(data, "password"), | |
| restart_invalid_flow=True, | |
| ) | |
| except AuthError as failure: | |
| return response( | |
| auth_page( | |
| "join", | |
| str(failure), | |
| registration_values=values, | |
| ), | |
| 422, | |
| ) | |
| result = RedirectResponse("/join/verify", status_code=303) | |
| result.set_cookie(COOKIE_NAME, token, **COOKIE) | |
| return result | |
| def join_verify(request: Request) -> HTMLResponse: | |
| token, _ = AUTH.ensure_session(request.cookies.get(COOKIE_NAME)) | |
| return response(registration_verify_page(token)) | |
| async def join_verify_submit(request: Request): | |
| token, _ = AUTH.ensure_session(request.cookies.get(COOKIE_NAME)) | |
| data = await fields(request) | |
| try: | |
| AUTH.verify_registration_code(token, first(data, "code")) | |
| completed = AUTH.complete_registration(token) | |
| except AuthError as failure: | |
| return response(registration_verify_page(token, str(failure)), 422) | |
| result = RedirectResponse("/", status_code=303) | |
| result.set_cookie( | |
| COOKIE_NAME, | |
| str(completed["session_token"]), | |
| **COOKIE, | |
| ) | |
| return result | |
| def forgot() -> HTMLResponse: return response(auth_page("forgot")) | |
| WIKI_HELP_PAGES = { | |
| "/wiki/page/Welcome_to_BoardGameGeek": ("Welcome to BoardGameGeek", "Welcome_to_BoardGameGeek.html"), | |
| "/wiki/page/Guide_To_BoardGameGeek": ("Guide To BoardGameGeek", "Guide_To_BoardGameGeek.html"), | |
| "/wiki/page/BoardGameGeek_FAQ": ("BoardGameGeek FAQ", "BoardGameGeek_FAQ.html"), | |
| "/wiki/page/Glossary": ("Glossary", "Glossary.html"), | |
| "/wiki/page/Admins": ("Admins", "Admins.html"), | |
| } | |
| def help_page() -> RedirectResponse: | |
| return RedirectResponse("/wiki/page/Guide_To_BoardGameGeek", status_code=307) | |
| def wiki_help_page(request: Request) -> HTMLResponse: | |
| title, filename = WIKI_HELP_PAGES[request.url.path] | |
| fragment = (ROOT / "static" / "content" / "wiki" / filename).read_text(encoding="utf-8") | |
| body = ( | |
| '<div class="wiki-page-shell">' | |
| f'<aside class="wiki-visible-hotness">{source_search_sidebar()}</aside>' | |
| f'<article class="wiki-source-content" data-source-wiki="true">{fragment}</article>' | |
| "</div>" | |
| ) | |
| return response(shell(f"{title} | BoardGameGeek", body)) | |
| def forums_index() -> HTMLResponse: | |
| rows = ( | |
| ("Recent Discussions", "New topics across the BoardGameGeek community.", "/threads/region/1?sort=recent"), | |
| ("Hot Discussions", "Popular conversations from the last two days.", "/threads/region/1?sort=hot&interval=twodays"), | |
| ("Active Discussions", "Topics receiving replies right now.", "/threads/region/1?sort=active"), | |
| ("Game Forums", "Rules, strategy, news, and questions tied to board games.", "/threads/gameforums?sort=recent"), | |
| ("Ticket to Ride Forums", "A representative game-specific forum.", "/boardgame/9209/ticket-to-ride/forums/0"), | |
| ("Search Forums", "Find public discussions by title and forum.", "/forums/search"), | |
| ) | |
| cards = "".join(f'<article class="deep-nav-card"><h2><a href="{e(href)}">{e(label)}</a></h2><p>{e(description)}</p></article>' for label, description, href in rows) | |
| body = f'''<div class="public-index"><nav class="crumbs"><a href="/">Home</a> <span aria-hidden="true">›</span> Forums</nav><header class="public-index-hero"><p class="eyebrow">Community Discussions</p><h1>Forums</h1><p>Choose a live discussion view or open a game-specific forum.</p></header><section class="deep-nav-grid" data-content-type="forum-directory">{cards}</section></div>''' | |
| return response(shell("Forums | BoardGameGeek", body)) | |
| def dashboard() -> HTMLResponse: | |
| session = CURRENT_SESSION.get() | |
| authenticated = bool(session.get("authenticated")) | |
| account = session.get("account") if isinstance(session.get("account"), dict) else {} | |
| display_name = str(account.get("display_name") or "Local Member") | |
| tabs = '<nav class="subnav" aria-label="Explore navigation"><a href="/">Explore</a><a class="active" href="/dashboard">Dashboard</a></nav>' | |
| if not authenticated: | |
| hotness = "".join( | |
| f'<li><a href="{e(href)}"><span>{index}</span><strong>{e(title)}</strong><small>{e(description)}</small><b class="dashboard-arrow" aria-hidden="true">›</b></a></li>' | |
| for index, (title, href, description, _asset, _trend) in enumerate(HOME_HOTNESS[:6], 1) | |
| ) | |
| community = "".join( | |
| f'<li><a href="{e(href)}"><strong>{e(title)}</strong><span>{e(detail)}</span><b class="dashboard-arrow" aria-hidden="true">›</b></a></li>' | |
| for title, detail, href in ( | |
| ("Recent Forums", "New public community discussions", "/threads/region/1?sort=recent"), | |
| ("Hot GeekLists", "Community-curated board game lists", "/geeklists?sort=hot&interval=twodays"), | |
| ("In-Depth Reviews", "Recent public game reviews", "/threads/reviews"), | |
| ("Session Reports", "Stories from recent plays", "/threads/sessions"), | |
| ) | |
| ) | |
| discover = "".join( | |
| f'<li><a href="{e(href)}"><strong>{e(title)}</strong><span>{e(detail)}</span><b class="dashboard-arrow" aria-hidden="true">›</b></a></li>' | |
| for title, detail, href in ( | |
| ("Categories", "Browse games by theme and subject", "/browse/boardgamecategory"), | |
| ("Mechanics", "Explore how board games are played", "/browse/boardgamemechanic"), | |
| ("Designers", "Find creators and related games", "/browse/boardgamedesigner"), | |
| ("Recent Additions", "New database contributions", "/recentadditions"), | |
| ) | |
| ) | |
| def dashboard_media(route: str, title: str, subtitle: str) -> str: | |
| if route == "/videos/boardgame/all": | |
| items = [] | |
| for module in HOME_RAIL_MODULES: | |
| if module["title"] not in {"Featured Videos", "Hot Videos"}: | |
| continue | |
| scale = 112 / 253 | |
| for x, item_title, meta, description in module["items"]: | |
| thumb = ( | |
| f'<span class="dashboard-thumb" role="img" aria-label="{e(item_title)}" ' | |
| f'style="background-image:url(/static/assets/home/sections/{e(module["filename"])});' | |
| f'background-size:{1400 * scale:.2f}px auto;' | |
| f'background-position:-{int(x) * scale:.2f}px -{int(module["image_y"]) * scale:.2f}px"></span>' | |
| ) | |
| items.append({"title": str(item_title), "meta": str(meta), "description": str(description), "image": thumb}) | |
| if len(items) >= 6: | |
| break | |
| items = tuple(items[:6]) | |
| else: | |
| items = rich_public_items(route)[:6] | |
| cards = "".join( | |
| f'''<li><a href="{e(route)}?item={e(public_item_key(item["title"]))}">{item["image"]}<span><strong>{e(item["title"])}</strong><small>{e(item["meta"])}{(" · " + e(item["description"])) if item["description"] else ""}</small></span></a></li>''' | |
| for item in items | |
| ) | |
| return f'''<section class="dashboard-feature"><header><div><h2>{e(title)}</h2><p>{e(subtitle)}</p></div><a href="{e(route)}">See All ›</a></header><ul class="dashboard-media-grid">{cards}</ul></section>''' | |
| content = f'''<header class="dashboard-intro"><p class="eyebrow">BoardGameGeek</p><h1>Dashboard</h1><p>Current games, community activity, discovery tools, videos, and crowdfunding — available without signing in.</p></header><div class="dashboard-grid"> | |
| <section class="dashboard-panel dashboard-community"><h2>The Hotness</h2><p>Games trending with the community.</p><ul>{hotness}</ul><a class="dashboard-see-all" href="/hotness">See All ›</a></section> | |
| <section class="dashboard-panel dashboard-community"><h2>Community</h2><p>Public discussions, lists, reviews, and reports.</p><ul>{community}</ul><a class="dashboard-see-all" href="/threads/region/1?sort=recent">See All ›</a></section> | |
| <section class="dashboard-panel dashboard-discover"><h2>Discover</h2><p>Browse the public board game database.</p><ul>{discover}</ul><a class="dashboard-see-all" href="/browse/boardgame">Browse All Boardgames ›</a></section> | |
| <section class="dashboard-panel dashboard-discover"><h2>Personalize</h2><p>Dashboard content is public. Signing in additionally enables Quickbar, collection, recently viewed items, and subscriptions.</p><ul><li><a href="/login"><strong>Sign In</strong><span>Open your member tools</span><b class="dashboard-arrow" aria-hidden="true">›</b></a></li><li><a href="/join"><strong>Join BoardGameGeek</strong><span>Create a local review account</span><b class="dashboard-arrow" aria-hidden="true">›</b></a></li></ul></section> | |
| </div>{dashboard_media("/videos/boardgame/all", "Featured Videos", "Recent public BoardGameGeek videos")}{dashboard_media("/crowdfunding", "Crowdfunding Countdown", "Projects ending soon")}''' | |
| else: | |
| collection_sources = ( | |
| (30549, "Pandemic", "/boardgame/30549/pandemic"), | |
| (224517, "Brass: Birmingham", "/boardgame/224517/brass-birmingham"), | |
| (9209, "Ticket to Ride", "/boardgame/9209/ticket-to-ride"), | |
| ) | |
| collection_items = [] | |
| for game_id, title, href in collection_sources: | |
| status = service.collection(game_id) | |
| if not status or not (status["owned"] or status["wishlist"] or status["rating"]): | |
| continue | |
| markers = [] | |
| if status["owned"]: | |
| markers.append("Owned") | |
| if status["wishlist"]: | |
| markers.append("Wishlist") | |
| if status["rating"]: | |
| markers.append(f'Rated {status["rating"]}/10') | |
| collection_items.append(f'<li><a href="{href}"><strong>{e(title)}</strong><span>{e(" · ".join(markers))}</span></a></li>') | |
| collection_markup = "".join(collection_items) or '<li class="dashboard-empty">No games saved yet. Open a game and use Add To Collection or rate it.</li>' | |
| content = f'''<header class="dashboard-intro"><p class="eyebrow">BoardGameGeek</p><h1>{e(display_name)}'s Dashboard</h1><p>Your personal shortcuts and activity.</p></header><div class="dashboard-member-grid"> | |
| <section class="dashboard-member-card dashboard-quickbar"><header><h2>Quickbar</h2><a href="/settings">Edit</a></header><p>Add shortcuts to your favorite games, designers, forums, or any other page within the Geek.</p><nav aria-label="Quickbar"><a href="/boardgame/30549/pandemic">Pandemic</a><a href="/threads/region/1?sort=recent">Recent Forums</a><a href="/geeklists">GeekLists</a></nav></section> | |
| <section class="dashboard-member-card"><header><h2>Recently Viewed</h2><a href="/recent">See All »</a></header><ul><li><a href="/boardgame/30549/pandemic"><strong>Pandemic</strong><span>Board Game · 2008</span></a></li></ul></section> | |
| <section class="dashboard-member-card dashboard-collection"><header><h2>Your Collection</h2><a href="/collection/user/local-member">View Collection</a></header><ul>{collection_markup}</ul></section> | |
| <section class="dashboard-member-card"><header><h2>Subscriptions</h2><a href="/subscriptions">Manage</a></header><ul><li><a href="/threads/region/1?sort=active"><strong>Active discussions</strong><span>Follow replies from forums you subscribe to.</span></a></li><li><a href="/geeklists/bookmarks"><strong>Bookmarked GeekLists</strong><span>Open your saved community lists.</span></a></li></ul></section> | |
| </div>''' | |
| body=f'''<div class="home-root"><div class="home-leaderboard inert-ad-slot" role="note" aria-label="Advertisement slot"><span>Advertisement</span></div><section class="card home-shell dashboard-shell">{tabs}{content}</section></div>''' | |
| return response(shell("Dashboard | BoardGameGeek",body)) | |
| DISCUSSION_VIEWS: dict[tuple[str, str], tuple[dict[str, str], ...]] = { | |
| ("general", "recent"): ( | |
| {"title": "Genie in a Bottle", "forum": "Cassandra Project", "author": "WerewolfRaven1207", "created": "Today at 10:26 PM", "replies": "2", "latest": "1 hour ago · WerewolfRaven1207"}, | |
| {"title": "Feedback and discussion, GameSquire, a board game shelf and friends tracker", "forum": "General Gaming", "author": "Printerpapier", "created": "Today at 9:54 PM", "replies": "0", "latest": "2 hours ago · Printerpapier"}, | |
| {"title": "Everdell-like games for travel?", "forum": "Recommendations", "author": "TwoCouldPlayThatGame", "created": "Today at 9:53 PM", "replies": "0", "latest": "2 hours ago · TwoCouldPlayThatGame"}, | |
| {"title": "Unable to sign in on iOS app or safari", "forum": "Technical Help", "author": "Azarro", "created": "Today at 9:00 PM", "replies": "1", "latest": "2 hours ago · Azarro"}, | |
| {"title": "[WIP] Yaban: 6 Gün - 2 Kişilik Hayatta Kalma Oyunu", "forum": "Works in Progress", "author": "Gokhan_Caglayan", "created": "Today at 8:50 PM", "replies": "0", "latest": "3 hours ago · Gokhan_Caglayan"}, | |
| {"title": "DEADHOLT - Renders for preview page!", "forum": "Art and Graphic Design", "author": "K0LS", "created": "Today at 8:45 PM", "replies": "0", "latest": "3 hours ago · K0LS"}, | |
| {"title": "3D printer. I need some advice", "forum": "Chit Chat", "author": "Orangemoose", "created": "Today at 7:54 PM", "replies": "5", "latest": "2 hours ago · Trrble2s"}, | |
| {"title": "[Barnes & Noble] Honey Buzz $27.99", "forum": "Hot Deals", "author": "civ2boss", "created": "Today at 7:46 PM", "replies": "1", "latest": "2 hours ago · im1insane1"}, | |
| {"title": "Hello from Belgium", "forum": "Introduce Yourself", "author": "genkie", "created": "Today at 7:28 PM", "replies": "1", "latest": "2 hours ago · dbm_"}, | |
| {"title": "Hotel Room available Moxy Essen City", "forum": "SPIEL", "author": "zocktol", "created": "Today at 5:53 PM", "replies": "0", "latest": "6 hours ago · zocktol"}, | |
| {"title": "Cloudflare verification not allowing me to get to the files page", "forum": "Bugs", "author": "Ichirou", "created": "Today at 5:01 PM", "replies": "4", "latest": "5 hours ago · russ"}, | |
| {"title": "GameNerdz DotD: Defenders of the Realm Hero Expansion", "forum": "Hot Deals", "author": "H___", "created": "Today at 5:01 PM", "replies": "11", "latest": "32 minutes ago · noriloxic"}, | |
| ), | |
| ("general", "hot"): ( | |
| {"title": "What's the real appeal of a big board game collection?", "forum": "General Gaming", "author": "EnviousSaturn", "created": "Aug 24 at 7:52 PM", "replies": "98", "latest": "2 hours ago · Sarcasmorator"}, | |
| {"title": "RIP: Dolly Parton", "forum": "Chit Chat", "author": "DKahnt", "created": "Yesterday at 6:07 PM", "replies": "10", "latest": "7 hours ago · claymore_57"}, | |
| {"title": "Top 100 Analysis August 25, 2026", "forum": "General Gaming", "author": "jmsr525", "created": "Yesterday at 1:52 PM", "replies": "3", "latest": "7 hours ago · jgbaxter"}, | |
| {"title": "Pandasaurus Games Machi Koro Life Contest", "forum": "Sponsored Promotions", "author": "BGG Contest", "created": "Today at 5:01 AM", "replies": "9", "latest": "7 hours ago · Luds"}, | |
| {"title": "Very short rant: Stickers instead of shrink-wrap", "forum": "General Gaming", "author": "black_daveth", "created": "Today at 3:16 AM", "replies": "41", "latest": "50 minutes ago · blankfrancis"}, | |
| {"title": "New Scam Website", "forum": "General Gaming", "author": "DenverZeppo", "created": "Aug 22 at 12:54 AM", "replies": "7", "latest": "Yesterday · Strom40"}, | |
| {"title": "RIP: Tim Curry", "forum": "Chit Chat", "author": "DKahnt", "created": "Today at 3:54 PM", "replies": "12", "latest": "41 minutes ago · Ryan Keane"}, | |
| {"title": "Miniature Market Now Offering Free Shipping Over $59", "forum": "Discussing Retailers", "author": "oaklandsberg", "created": "Aug 24 at 7:18 PM", "replies": "8", "latest": "Yesterday · mwctz"}, | |
| {"title": "AI in Board Game Quiz Creation: Creative Tool or Turn-Off?", "forum": "General Gaming", "author": "Kire", "created": "Aug 24 at 9:58 AM", "replies": "114", "latest": "2 hours ago · dancj"}, | |
| {"title": "Summer South/Central New England No-Ship Game Auction Post-Mortem", "forum": "Northeast", "author": "UvulaBob", "created": "Yesterday at 2:18 PM", "replies": "43", "latest": "2 hours ago · constelp"}, | |
| {"title": "Who Would Like to Create a 2026 User Survey?", "forum": "General Gaming", "author": "EllenCaroline", "created": "Aug 24 at 11:58 AM", "replies": "3", "latest": "5 hours ago · EllenCaroline"}, | |
| {"title": "On Luck (and how it's really skill with bad branding)", "forum": "General Gaming", "author": "broonski", "created": "Aug 19 at 9:42 PM", "replies": "138", "latest": "32 minutes ago · odinsgrandson"}, | |
| ), | |
| ("general", "active"): ( | |
| {"title": "Heroes Are Overrated: The Evil We Didn't Know We Needed", "forum": "Werewolf", "author": "SarahBoBara", "created": "Jun 12, 2025", "replies": "3443", "latest": "3 minutes ago · Cassandra Project"}, | |
| {"title": "Allplay & Partners Summer Sale 2026", "forum": "Hot Deals", "author": "Xenzoro", "created": "Aug 24 at 12:31 PM", "replies": "52", "latest": "6 minutes ago · spicysaucepickle"}, | |
| {"title": "What is a COIN Game?", "forum": "Geek Lobby", "author": "L0wlyH0bbit", "created": "Nov 7, 2016", "replies": "23", "latest": "7 minutes ago · L0wlyH0bbit"}, | |
| {"title": "Worst Kickstarter Ever?", "forum": "General Gaming", "author": "RandomGraham", "created": "Dec 5, 2013", "replies": "36031", "latest": "12 minutes ago · odinsgrandson"}, | |
| {"title": "73 Little Riddles a.k.a. Help Me With Those Components", "forum": "General Gaming", "author": "2578", "created": "Today at 3:13 PM", "replies": "18", "latest": "16 minutes ago · panzer6"}, | |
| {"title": "Do you have an unpopular opinion that is TRULY unpopular?", "forum": "General Gaming", "author": "mihailomsmandic", "created": "Jun 23 at 6:53 PM", "replies": "601", "latest": "23 minutes ago · odinsgrandson"}, | |
| {"title": "On Luck (and how it's really skill with bad branding)", "forum": "General Gaming", "author": "broonski", "created": "Aug 19 at 9:42 PM", "replies": "138", "latest": "32 minutes ago · odinsgrandson"}, | |
| {"title": "GameNerdz DotD: Defenders of the Realm Hero Expansion", "forum": "Hot Deals", "author": "H___", "created": "Today at 5:01 PM", "replies": "11", "latest": "33 minutes ago · noriloxic"}, | |
| {"title": "Word Association Game #7", "forum": "Chit Chat", "author": "dmcallahan", "created": "May 27, 2023", "replies": "16240", "latest": "37 minutes ago · paulidale"}, | |
| {"title": "RIP: Tim Curry", "forum": "Chit Chat", "author": "DKahnt", "created": "Today at 3:54 PM", "replies": "12", "latest": "41 minutes ago · Ryan Keane"}, | |
| {"title": "[WIP] Last Prime Minister", "forum": "Works in Progress", "author": "QuietOne", "created": "Jul 7 at 10:23 AM", "replies": "16", "latest": "44 minutes ago · cabbagekingaf"}, | |
| {"title": "Pecunia Sanguinus: The Lobbyist’s Game", "forum": "Works in Progress", "author": "boardlemur", "created": "Aug 16 at 2:20 PM", "replies": "32", "latest": "45 minutes ago · cabbagekingaf"}, | |
| ), | |
| ("game", "recent"): ( | |
| {"title": "Bomb Busters – Bomb Busters Mission 64", "forum": "Strategy", "author": "Lmmorley", "created": "Today at 11:09 PM", "replies": "0", "latest": "23 minutes ago · Lmmorley"}, | |
| {"title": "Bloomhunter – Bloomhunter Update #1: Countdown to February", "forum": "News", "author": "cuttlefishcrossbow", "created": "Today at 11:04 PM", "replies": "0", "latest": "29 minutes ago · cuttlefishcrossbow"}, | |
| {"title": "The Lord of the Rings: The Two Towers – Trick-Taking Game – Chapter 35 two players", "forum": "Rules", "author": "joaovicente", "created": "Today at 11:02 PM", "replies": "0", "latest": "30 minutes ago · joaovicente"}, | |
| {"title": "Gloom of Kilforth: A Fantasy Quest Game – Is a Saga Finale Card treated as an Encounter Card", "forum": "Rules", "author": "Planesman", "created": "Today at 10:57 PM", "replies": "0", "latest": "36 minutes ago · Planesman"}, | |
| {"title": "Bardwood Grove – KS card question", "forum": "Rules", "author": "Felisardo", "created": "Today at 10:52 PM", "replies": "0", "latest": "40 minutes ago · Felisardo"}, | |
| {"title": "Legendary: A Marvel Deck Building Game – Legendary app", "forum": "General", "author": "kurnousorion", "created": "Today at 10:47 PM", "replies": "0", "latest": "46 minutes ago · kurnousorion"}, | |
| {"title": "Colt Express: Bandits – Belle – Linnen finish on cards", "forum": "General", "author": "gunnerFR", "created": "Today at 10:46 PM", "replies": "0", "latest": "46 minutes ago · gunnerFR"}, | |
| {"title": "Dune: Imperium – Conspiracy – Oct 31st Release?", "forum": "General", "author": "dlestarge", "created": "Today at 10:46 PM", "replies": "1", "latest": "20 minutes ago · El Dudelino"}, | |
| {"title": "Camping Season – Symbol on the projects board for Laundry Facilities", "forum": "Rules", "author": "FizzleStix", "created": "Today at 10:41 PM", "replies": "0", "latest": "52 minutes ago · FizzleStix"}, | |
| {"title": "Trials of Maya – I was interested in this game but...", "forum": "General", "author": "Lemonpips", "created": "Today at 10:39 PM", "replies": "0", "latest": "54 minutes ago · Lemonpips"}, | |
| {"title": "Galactic Empires – Looking for interesting card behaviour", "forum": "General", "author": "GalacticGurpz", "created": "Today at 10:27 PM", "replies": "0", "latest": "1 hour ago · GalacticGurpz"}, | |
| {"title": "Playground Empires – Streaming with the Designer", "forum": "General", "author": "BoardGameGeek", "created": "Today at 10:16 PM", "replies": "0", "latest": "1 hour ago · BoardGameGeek"}, | |
| ), | |
| } | |
| GENERAL_DISCUSSION_SUPPLEMENT: tuple[dict[str, str], ...] = ( | |
| {"title": "Has anyone here actually switched to a board game/dining table?", "forum": "Recommendations", "author": "realbecca", "created": "Today at 4:35 PM", "replies": "3", "latest": "4 hours ago · poisonivy"}, | |
| {"title": "RIP: Tim Curry", "forum": "Chit Chat", "author": "DKahnt", "created": "Today at 3:54 PM", "replies": "13", "latest": "56 seconds ago · GaryCollins68"}, | |
| {"title": "Seeking Feedback on Sell Sheet for Steam to Solar", "forum": "Works in Progress", "author": "andwat", "created": "Today at 3:27 PM", "replies": "2", "latest": "3 hours ago · andwat"}, | |
| {"title": "73 Little Riddles a.k.a. Help Me With Those Components", "forum": "General Gaming", "author": "2578", "created": "Today at 3:13 PM", "replies": "18", "latest": "16 minutes ago · panzer6"}, | |
| {"title": "[HIRING] Paid commission: painterly sci-fi box cover + 120 illustrations to follow", "forum": "Art and Graphic Design", "author": "Ralmnjir", "created": "Today at 2:42 PM", "replies": "0", "latest": "9 hours ago · Ralmnjir"}, | |
| {"title": "Battle of the Dice Lists", "forum": "Articles & Blogs", "author": "Skello496", "created": "Today at 2:24 PM", "replies": "4", "latest": "7 hours ago · Skello496"}, | |
| {"title": "Worker placement suggestions for 2 players", "forum": "Recommendations", "author": "pablodavila", "created": "Today at 2:14 PM", "replies": "8", "latest": "56 minutes ago · invervegas"}, | |
| {"title": "Scooby-Doo Escape from the Haunted Mansion | Inside with João Ricardo Ep906", "forum": "Videos & Podcasts", "author": "table_talks", "created": "Today at 8:37 AM", "replies": "0", "latest": "15 hours ago · table_talks"}, | |
| {"title": "[WIP] Strike Twelve - An entry into the 2026 Solitaire Print and Play Contest", "forum": "Works in Progress", "author": "dgrgich", "created": "Today at 5:58 AM", "replies": "0", "latest": "18 hours ago · dgrgich"}, | |
| {"title": "Pandasaurus Games Machi Koro Life Contest! Ends September 1st!", "forum": "Sponsored Promotions", "author": "BGG Contest", "created": "Today at 5:01 AM", "replies": "9", "latest": "7 hours ago · Luds"}, | |
| {"title": "Very short rant: Stickers instead of shrink-wrap", "forum": "General Gaming", "author": "black_daveth", "created": "Today at 3:16 AM", "replies": "41", "latest": "50 minutes ago · blankfrancis"}, | |
| {"title": "[WIP] Lawman - Solo Card and Dice Game", "forum": "Works in Progress", "author": "davidfstewart", "created": "Today at 2:44 AM", "replies": "0", "latest": "21 hours ago · davidfstewart"}, | |
| {"title": "BGG.CON Designer events", "forum": "BGG.CON", "author": "engelstein", "created": "Today at 2:21 AM", "replies": "5", "latest": "5 hours ago · engelstein"}, | |
| {"title": "Are Zombies Still A Thing? aka To Kickstart or Not to Kickstart?", "forum": "Design Queries and Problems", "author": "greasykid1", "created": "Yesterday at 10:34 PM", "replies": "7", "latest": "14 hours ago · russ"}, | |
| {"title": "Simple, Yet Intriguing Podcast #69: The Hobbit An Unexpected Journey", "forum": "Videos & Podcasts", "author": "simpleyetintriguing", "created": "Yesterday at 9:29 PM", "replies": "0", "latest": "Yesterday · simpleyetintriguing"}, | |
| {"title": "16-Game Olympics", "forum": "General Gaming", "author": "bitterblossom12", "created": "Yesterday at 9:12 PM", "replies": "5", "latest": "8 hours ago · bitterblossom12"}, | |
| {"title": "Atlanta Game Fest 50 · September 24-27, 2026 · Hilton Atlanta Northeast", "forum": "Southeast", "author": "Wardo", "created": "Yesterday at 9:07 PM", "replies": "1", "latest": "15 hours ago · RA_gamer"}, | |
| {"title": "Been here for a while, figured its time to say hello!", "forum": "Introduce Yourself", "author": "KaijoWolf", "created": "Yesterday at 8:27 PM", "replies": "3", "latest": "10 hours ago · Syvanis"}, | |
| {"title": "Artist seeking designer", "forum": "Introduce Yourself", "author": "Miniheroes", "created": "Yesterday at 7:56 PM", "replies": "0", "latest": "Yesterday · Miniheroes"}, | |
| {"title": "Preferred weight for games?", "forum": "General Gaming", "author": "KaijoWolf", "created": "Yesterday at 7:53 PM", "replies": "31", "latest": "1 hour ago · TedW"}, | |
| {"title": "Maria, Sekigahara and _", "forum": "Recommendations", "author": "Nactra", "created": "Yesterday at 7:23 PM", "replies": "4", "latest": "6 hours ago · Nactra"}, | |
| {"title": "Eurogames like my favorite thematic games??", "forum": "Recommendations", "author": "Nathan17w", "created": "Yesterday at 7:00 PM", "replies": "14", "latest": "8 hours ago · Schoolmarm5"}, | |
| {"title": "[WIP] PINOCHLE THRONES: The Original Trick-Taking Game", "forum": "Works in Progress", "author": "Rauschy", "created": "Yesterday at 6:48 PM", "replies": "1", "latest": "Yesterday · Rauschy"}, | |
| {"title": "Why a lot boardgames you need to stick with one identity", "forum": "General Gaming", "author": "oriad", "created": "Yesterday at 6:21 PM", "replies": "23", "latest": "14 hours ago · oriad"}, | |
| {"title": "RIP: Dolly Parton", "forum": "Chit Chat", "author": "DKahnt", "created": "Yesterday at 6:07 PM", "replies": "10", "latest": "7 hours ago · claymore_57"}, | |
| {"title": "[New Game] Null State: Terminal 01 — Exploit Zero-Days, Manipulate Markets & Breach Subnets", "forum": "Press Releases", "author": "crkbbyx", "created": "Yesterday at 5:51 PM", "replies": "0", "latest": "Yesterday · crkbbyx"}, | |
| {"title": "La partita di Wings of Glory più grande del mondo al Combo Festival", "forum": "Italy", "author": "angiolillo", "created": "Yesterday at 5:12 PM", "replies": "0", "latest": "Yesterday · angiolillo"}, | |
| {"title": "GameNerdz DotD: Boonlake Folded Space Insert $10.97", "forum": "Hot Deals", "author": "H___", "created": "Yesterday at 5:01 PM", "replies": "0", "latest": "Yesterday · H___"}, | |
| {"title": "Il festival dei Sensi in Val d'Itria è dedicato al gioco", "forum": "Italy", "author": "angiolillo", "created": "Yesterday at 4:58 PM", "replies": "0", "latest": "Yesterday · angiolillo"}, | |
| {"title": "LTT Sentinels of the Multiverse - Open to Trade Offers", "forum": "Trades", "author": "Niorion", "created": "Yesterday at 4:24 PM", "replies": "0", "latest": "Yesterday · Niorion"}, | |
| {"title": "Mid-heavy travel games for 3+ players", "forum": "Recommendations", "author": "amanwithtwodogs", "created": "Yesterday at 3:32 PM", "replies": "10", "latest": "3 hours ago · HerGr"}, | |
| {"title": "Introducing Quiet Quitting, a Hilarious Game of Corporate Avoidance", "forum": "Press Releases", "author": "ArlingtonGameStudios", "created": "Yesterday at 3:32 PM", "replies": "0", "latest": "Yesterday · ArlingtonGameStudios"}, | |
| {"title": "Open Owl Studios Summer Sale: 30% off games like Mythwind and Storyfold", "forum": "Hot Deals", "author": "CanSolo", "created": "Yesterday at 2:38 PM", "replies": "2", "latest": "Yesterday · Cassidy666"}, | |
| {"title": "Summer South/Central New England No-Ship Game Auction Post-Mortem", "forum": "Northeast", "author": "UvulaBob", "created": "Yesterday at 2:18 PM", "replies": "43", "latest": "2 hours ago · constelp"}, | |
| {"title": "Medium Weight Solo recommendations?", "forum": "Recommendations", "author": "PlotUndPlaettchen", "created": "Yesterday at 2:04 PM", "replies": "3", "latest": "11 hours ago · HistorianTeacher"}, | |
| {"title": "Top 100 Analysis August 25, 2026", "forum": "General Gaming", "author": "jmsr525", "created": "Yesterday at 1:52 PM", "replies": "3", "latest": "7 hours ago · jgbaxter"}, | |
| {"title": "[WIP] Karda", "forum": "Works in Progress", "author": "Sibachian", "created": "Yesterday at 1:47 PM", "replies": "9", "latest": "5 hours ago · Sibachian"}, | |
| {"title": "Insert for The Voyages of Marco Polo with all 3 Expansions", "forum": "3D Printing", "author": "Chillmaster666", "created": "Yesterday at 12:46 PM", "replies": "4", "latest": "3 hours ago · SoloMyGames"}, | |
| ) | |
| def _discussion_key(item: dict[str, str]) -> str: | |
| return public_item_key(f'{item["forum"]}-{item["title"]}') | |
| def _discussion_view(family: str, sort: str) -> tuple[dict[str, str], ...]: | |
| rows = DISCUSSION_VIEWS.get((family, sort)) | |
| if not rows: | |
| base = DISCUSSION_VIEWS[(family, "recent")] | |
| rows = tuple(reversed(base)) if sort == "hot" else base[3:] + base[:3] | |
| if family != "general": | |
| return rows | |
| seen = {_discussion_key(item) for item in rows} | |
| supplement = tuple(item for item in GENERAL_DISCUSSION_SUPPLEMENT if _discussion_key(item) not in seen) | |
| return rows + supplement | |
| def discussion_terminal(discussion_key: str) -> HTMLResponse: | |
| item = next( | |
| ( | |
| row | |
| for rows in (*DISCUSSION_VIEWS.values(), GENERAL_DISCUSSION_SUPPLEMENT) | |
| for row in rows | |
| if _discussion_key(row) == discussion_key | |
| ), | |
| None, | |
| ) | |
| if not item: | |
| return response(shell("Discussion not found | BoardGameGeek", '<div class="empty"><h1>Discussion not found</h1><p>This local discussion is unavailable.</p><a class="btn" href="/threads/region/1?sort=recent">Return to forums</a></div>'), 404) | |
| body = f'''<div class="discussion-terminal"><nav class="crumbs"><a href="/forums">Forums</a> <span aria-hidden="true">›</span> <a href="/threads/region/1?sort=recent">{e(item["forum"])}</a></nav><article class="discussion-post"><header><p class="eyebrow">{e(item["forum"])}</p><h1>{e(item["title"])}</h1><p class="discussion-byline">Started by <strong>{e(item["author"])}</strong> · {e(item["created"])}</p></header><p>This local discussion terminal preserves the topic, forum, author, reply count, and latest-activity structure captured from the anonymous public listing.</p><footer><span>Replies: {e(item["replies"])}</span><span>Latest activity: {e(item["latest"])}</span></footer></article><section class="discussion-replies"><h2>Replies</h2><article><strong>{e(item["author"])}</strong><p>The opening message is represented locally for review without contacting BoardGameGeek.</p></article><article><strong>{e(item["latest"].split(" · ")[-1])}</strong><p>Latest activity recorded for this discussion: {e(item["latest"].split(" · ")[0])}.</p></article></section></div>''' | |
| return response(shell(f'{item["title"]} | BoardGameGeek', body)) | |
| def discussion_utility_rail() -> str: | |
| return '''<aside class="discussion-utility-rail" aria-label="Forum utilities"> | |
| <section class="discussion-utility-section"><h2>Quick Links</h2><ul> | |
| <li><a href="/subscriptions">Subscriptions</a></li> | |
| <li><a href="/threads/bookmarks">Bookmarks</a></li> | |
| <li><a href="/community_rules">Community Rules</a></li> | |
| <li><a href="/wiki/page/Forum_Moderators">Moderators</a></li> | |
| </ul></section> | |
| <section class="discussion-utility-section"><h2>Search Forums</h2><form action="/forums/search" method="get"><label class="sr-only" for="discussion-search-q">Search Forums</label><input id="discussion-search-q" name="q" type="search" placeholder="What are you excited about?"><button class="sr-only" type="submit">Search</button></form></section> | |
| <section class="discussion-utility-section"><h2>Global Stats</h2><dl><dt>Threads</dt><dd>3,510,134</dd><dt>Replies</dt><dd>41,776,727</dd><dt>Thumbs</dt><dd>125,899,327</dd></dl></section> | |
| </aside>''' | |
| def discussion_index(request: Request) -> HTMLResponse: | |
| family = "game" if request.url.path == "/threads/gameforums" else "general" | |
| sort = str(request.query_params.get("sort") or "recent").lower() | |
| if sort not in {"recent", "hot", "active"}: | |
| sort = "recent" | |
| try: | |
| page = max(1, int(str(request.query_params.get("page") or "1"))) | |
| except ValueError: | |
| page = 1 | |
| rows = _discussion_view(family, sort) | |
| offset = ((page - 1) * 4) % len(rows) | |
| visible_rows = rows[offset:] + rows[:offset] | |
| base = request.url.path | |
| label = "Game Forums" if family == "game" else "Forums" | |
| sort_label = {"recent": "Recent", "hot": "Hot - 2 Days", "active": "Active"}[sort] | |
| tabs = [] | |
| for tab, tab_label in (("recent", "Recent"), ("hot", "Hot"), ("active", "Active")): | |
| href = f'{base}?sort={tab}' + ("&interval=twodays" if tab == "hot" else "") | |
| active = ' class="active" aria-current="page"' if tab == sort else "" | |
| tabs.append(f'<a{active} href="{e(href)}">{tab_label}</a>') | |
| items = "".join(f'''<article class="discussion-row"><div class="discussion-topic"><a href="/threads/discussion/{e(_discussion_key(item))}">{e(item["title"])}</a><span class="discussion-forum">{e(item["forum"])}</span></div><div class="discussion-author"><strong>{e(item["author"])}</strong><span>{e(item["created"])}</span></div><div class="discussion-reply-count"><strong>{e(item["replies"])}</strong><span>Replies</span></div><div class="discussion-latest">{e(item["latest"])}</div></article>''' for item in visible_rows) | |
| previous = max(1, page - 1) | |
| next_page = page + 1 | |
| page_link = lambda value: f'{base}?sort={sort}' + ("&interval=twodays" if sort == "hot" else "") + f'&page={value}' | |
| pagination = f'''<nav class="discussion-pagination" aria-label="Forum pages"><a href="{e(page_link(previous))}" aria-label="Previous Page">Previous Page</a><span>Results - Page {page}</span><a class="active" href="{e(page_link(page))}">{page}</a><a href="{e(page_link(next_page))}">{next_page}</a><a href="{e(page_link(next_page + 1))}">{next_page + 1}</a><a href="{e(page_link(next_page))}" aria-label="Next Page">Next Page</a></nav>''' | |
| center = f'''<div class="discussion-index"><nav class="crumbs"><a href="/">Home</a> <span aria-hidden="true">›</span> {e(label)}</nav><header class="discussion-header"><div><h1>{e(label)}</h1><p>{e(sort_label)}</p></div><a class="btn btn-primary" href="/thread/new">Post Thread</a></header><nav class="subnav discussion-tabs" aria-label="{e(label)} sort">{"".join(tabs)}</nav>{pagination}<section class="discussion-list" aria-label="{e(sort_label)} discussion results"><header><span>Topic</span><span>Author</span><span>Replies</span><span>Latest reply</span></header>{items}</section>{pagination}</div>''' | |
| body = f'''<div class="discussion-source-layout" data-content-type="forum-discussion-layout"><div class="discussion-hotness-rail">{source_search_sidebar()}</div>{center}{discussion_utility_rail()}</div>''' | |
| return response(shell(f'{label} - {sort_label} | BoardGameGeek', body)) | |
| PUBLIC_INDEXES: dict[str, tuple[str, str, tuple[str, ...]]] = { | |
| "/crowdfunding": ("Crowdfunding Countdown", "Projects ending soon", ("Medici Traders", "Football clubs", "Power Vacuum", "Snowp", "Out of Print: Base Set")), | |
| "/videos/boardgame/all": ("Board Game Videos", "Featured and trending videos from the public home", ("Top 10 Big Deck Games", "Market Fresh - GameNight!", "Questline", "Final Girl Series 4")), | |
| "/geeklists": ("GeekLists", "Community-curated lists", ("Hot GeekLists", "Community Lists", "Women and Gaming", "Rainbow BGGers")), | |
| "/threads/reviews": ("In-Depth Reviews", "Recent public board game reviews", ("Hot In-Depth Reviews", "Board Game Reviews", "Community Commentary")), | |
| "/trends/mostplayed": ("Most Played Games", "Games receiving the most reported plays", ("Most Played Games", "Trending Plays", "The Hotness")), | |
| "/market": ("Geek Shopping", "Board game marketplace and shopping discovery", ("GeekMarket", "BGG Store", "Auction Search", "Bestsellers")), | |
| "/trends/bestsellers": ("Bestsellers", "Popular games from the shopping section", ("Bestselling Board Games", "Geek Shopping", "New Releases")), | |
| "/recentadditions": ("Recent Additions", "New public contributions across BoardGameGeek", ("Inis: Nemed — Our First Game", "Schwarz Rot Gelb Extreme — German Review", "Kanagawa — German Review", "War of the Ring: Second Edition — Two Decades Edition", "Works in Progress — Last Prime Minister", "An alternate XL map", "Pecunia Sanguinus: The Lobbyist’s Game", "Ticket to Ride — GCL Phoenix", "Eclipse: Second Dawn for the Galaxy", "Recent community comments and files")), | |
| "/images/boardgame/all": ("Hot Images", "The top trending board game images", ("Community Images", "Recent Images", "Image Galleries")), | |
| "/contests": ("Giveaway Contests", "Current community contests", ("Giveaway Contests", "Community Events", "Recent Winners")), | |
| "/blogs/posts": ("Blogs", "Recent posts from BoardGameGeek contributors", ("Board Gaming News", "The Geek Weekly", "Community Blogs")), | |
| "/blog/1/boardgamegeek-blog": ("The Geek Weekly", "BoardGameGeek news, gifts, guides, and editorial posts", ("The Geek Weekly", "Board Gaming News", "Designer Diaries")), | |
| "/guild/home": ("Guilds", "BoardGameGeek community groups", ("Women and Gaming", "Rainbow BGGers", "Find a Guild")), | |
| "/contact": ("Contact BoardGameGeek", "Ways to reach the BoardGameGeek team", ("Help with the site", "Accessibility feedback", "Advertising inquiries")), | |
| "/advertise": ("Advertise on BoardGameGeek", "Information for advertisers", ("Board game audience", "Available placements", "Contact the advertising team")), | |
| "/support": ("Support BoardGameGeek", "Help sustain BoardGameGeek", ("Supporter information", "Community benefits", "Questions about support")), | |
| "/community_rules": ("Community Guidelines", "Standards for participating in the community", ("Be respectful", "Keep contributions relevant", "Use reporting and moderation tools responsibly")), | |
| "/privacy": ("Privacy", "Introduction to BoardGameGeek privacy information", ("Information choices", "Cookies and preferences", "Privacy questions")), | |
| "/terms": ("Terms of Service", "Introduction to the terms for using BoardGameGeek", ("Using the service", "Community content", "Account responsibilities")), | |
| } | |
| RICH_PUBLIC_MODULES: dict[str, tuple[str, ...]] = { | |
| "/videos/boardgame/all": ("Featured Videos", "Hot Videos"), | |
| "/geeklists": ("Hot GeekLists",), | |
| "/threads/reviews": ("Hot In-Depth Reviews",), | |
| "/trends/mostplayed": ("Most Played Games",), | |
| "/market": ("Geek Shopping",), | |
| "/trends/bestsellers": ("Bestsellers",), | |
| } | |
| def public_item_key(title: str) -> str: | |
| return re.sub(r"[^a-z0-9]+", "-", title.lower()).strip("-") | |
| def rich_public_items(route: str) -> tuple[dict[str, str], ...]: | |
| if route == "/crowdfunding": | |
| return tuple({ | |
| "title": title, | |
| "meta": f"{ending} · {backers}", | |
| "description": description, | |
| "image": f'<img src="/static/assets/home/{e(asset)}?v=3" width="288" height="162" alt="">', | |
| } for title, _href, ending, backers, description, _promoted, asset, _extra, _project_href in HOME_CROWDFUNDING[:12]) | |
| module_names = RICH_PUBLIC_MODULES.get(route, ()) | |
| modules = [module for module in HOME_RAIL_MODULES if str(module["title"]) in module_names] | |
| items: list[dict[str, str]] = [] | |
| for module in modules: | |
| width = 320 if module.get("wide") else 253 | |
| for x, title, meta, description in module["items"]: | |
| items.append({ | |
| "title": str(title), | |
| "meta": str(meta), | |
| "description": str(description), | |
| "image": source_sprite(str(module["filename"]), int(x), int(module["image_y"]), width, int(module["image_height"]), str(title)), | |
| }) | |
| return tuple(items) | |
| def public_detail_href(route: str, index: int, title: str) -> str: | |
| """Bind public index records to a local terminal with a matching content form.""" | |
| key = public_item_key(title) | |
| if route == "/videos/boardgame/all": | |
| return f"/video/{626255 + index}/boardgamegeektv/{key}" | |
| if route == "/geeklists": | |
| return f"/geeklist/{1001 + index}/{key}" | |
| if route == "/threads/reviews": | |
| return f"/review/{190141 + index}/{key}" | |
| if route == "/crowdfunding": | |
| return f"/crowdfunding/project/{key}" | |
| if route in {"/market", "/trends/bestsellers"}: | |
| return f"/market/listing/{key}" | |
| if route == "/trends/mostplayed": | |
| return f"/trends/mostplayed/{index + 1}/{key}" | |
| return f"{route}?item={key}" | |
| def rich_selected_markup(route: str, title: str, items: tuple[dict[str, str], ...], selected_key: str) -> str: | |
| selected = next((item for item in items if public_item_key(item["title"]) == selected_key), None) | |
| if not selected: | |
| return "" | |
| return f'''<section class="public-index-selected" aria-live="polite"><p class="eyebrow">Selected from {e(title)}</p><h2>{e(selected["title"])}</h2><p><strong>{e(selected["meta"])}</strong></p><p>{e(selected["description"])}</p><a href="{e(route)}">Back to all {e(title)}</a></section>''' | |
| def rich_public_content(route: str, title: str, items: tuple[dict[str, str], ...], selected_key: str) -> str: | |
| """Render source-appropriate list forms instead of one universal card shell.""" | |
| selected_markup = rich_selected_markup(route, title, items, selected_key) | |
| if route == "/videos/boardgame/all": | |
| cards = "".join( | |
| f'''<article class="public-family-card media-stream-card"><a class="public-family-image" href="{e(public_detail_href(route, index, item["title"]))}">{item["image"]}<span class="media-play" aria-hidden="true">Play</span></a><div><p class="public-family-meta">{e(item["meta"])}</p><h2><a href="{e(route)}?item={e(public_item_key(item["title"]))}">{e(item["title"])}</a></h2><p>{e(item["description"])}</p><a href="{e(public_detail_href(route, index, item["title"]))}">Watch video</a></div></article>''' | |
| for index, item in enumerate(items) | |
| ) | |
| return f'''{selected_markup}<section class="public-index-rich" data-content-type="media-stream"><header><div><h2>Board Game Video Stream</h2><p>Featured videos, playthroughs, and how-to presentations</p></div></header><div class="public-family-grid">{cards}</div></section>''' | |
| if route == "/geeklists": | |
| cards = "".join( | |
| f'''<article class="public-family-card geeklist-listing-row"><span class="entry-number">{index + 1}</span><div><p class="public-family-meta">{e(item["meta"])}</p><h2><a href="{e(public_detail_href(route, index, item["title"]))}">{e(item["title"])}</a></h2><p>{e(item["description"])}</p><a href="{e(route)}?item={e(public_item_key(item["title"]))}">Preview list</a></div></article>''' | |
| for index, item in enumerate(items) | |
| ) | |
| return f'''{selected_markup}<section class="public-index-rich" data-content-type="geeklist-directory"><header><div><h2>Hot GeekLists</h2><p>Numbered, community-curated collections with comments</p></div><a href="/geeklist/1/modern-strategy-night">Featured local GeekList</a></header><div class="geeklist-directory">{cards}</div></section>''' | |
| if route == "/threads/reviews": | |
| cards = "".join( | |
| f'''<article class="public-family-card review-listing-row"><div><p class="public-family-meta">{e(item["meta"])}</p><h2><a href="{e(public_detail_href(route, index, item["title"]))}">{e(item["title"])}</a></h2><p>{e(item["description"])}</p><a href="{e(route)}?item={e(public_item_key(item["title"]))}">Review summary</a></div></article>''' | |
| for index, item in enumerate(items) | |
| ) | |
| return f'''{selected_markup}<section class="public-index-rich" data-content-type="article-list"><header><div><h2>Recent In-Depth Reviews</h2><p>Long-form community criticism and analysis</p></div></header><div class="review-article-list">{cards}</div></section>''' | |
| if route == "/crowdfunding": | |
| cards = "".join( | |
| f'''<article class="public-family-card crowdfunding-project-card"><a class="public-family-image" href="{e(public_detail_href(route, index, item["title"]))}">{item["image"]}</a><div><p class="public-family-meta">{e(item["meta"])}</p><h2><a href="{e(public_detail_href(route, index, item["title"]))}">{e(item["title"])}</a></h2><p>{e(item["description"])}</p><a href="{e(route)}?item={e(public_item_key(item["title"]))}">Quick project view</a></div></article>''' | |
| for index, item in enumerate(items) | |
| ) | |
| return f'''{selected_markup}<section class="public-index-rich" data-content-type="crowdfunding-listing"><header><div><h2>Projects Ending Soon</h2><p>Campaign summaries, backer counts, and deadlines</p></div></header><div class="public-family-grid">{cards}</div></section>''' | |
| if route == "/market": | |
| cards = "".join( | |
| f'''<article class="public-family-card market-listing-row"><div><p class="public-family-meta">{e(item["meta"])}</p><h2><a href="{e(public_detail_href(route, index, item["title"]))}">{e(item["title"])}</a></h2><p>{e(item["description"])}</p><dl><dt>Condition</dt><dd>New</dd><dt>Seller</dt><dd>GeekMarket listing</dd></dl><a href="{e(route)}?item={e(public_item_key(item["title"]))}">Quick listing view</a></div></article>''' | |
| for index, item in enumerate(items) | |
| ) | |
| return f'''{selected_markup}<section class="public-index-rich" data-content-type="market-listing"><header><div><h2>GeekMarket Listings</h2><p>Board game accessories and components offered by community sellers</p></div></header><div class="market-listing-table">{cards}</div></section>''' | |
| if route in {"/trends/mostplayed", "/trends/bestsellers"}: | |
| metric = "Reported plays" if route == "/trends/mostplayed" else "Sales rank" | |
| cards = "".join( | |
| f'''<li class="public-family-card ranked-data-row"><span class="trend-position">{index + 1}</span><div><p class="public-family-meta">{e(metric)} · {e(item["meta"])}</p><h2><a href="{e(public_detail_href(route, index, item["title"]))}">{e(item["title"])}</a></h2><p>{e(item["description"])}</p><a href="{e(route)}?item={e(public_item_key(item["title"]))}">Quick rank view</a></div></li>''' | |
| for index, item in enumerate(items) | |
| ) | |
| heading = "Most Played Ranking" if route == "/trends/mostplayed" else "Board Game Bestseller Ranking" | |
| return f'''{selected_markup}<section class="public-index-rich" data-content-type="ranked-directory"><header><div><h2>{heading}</h2><p>Position, movement, and public activity</p></div></header><ol class="ranked-data-directory">{cards}</ol></section>''' | |
| return "" | |
| def public_index(request: Request) -> HTMLResponse: | |
| title, subtitle, items = PUBLIC_INDEXES[request.url.path] | |
| selected_key = request.query_params.get("item", "") | |
| rich_items = rich_public_items(request.url.path) | |
| if rich_items: | |
| content = rich_public_content(request.url.path, title, rich_items, selected_key) | |
| elif request.url.path == "/images/boardgame/all": | |
| gallery = "".join( | |
| f'''<figure class="public-index-card image-gallery-item"><a href="/image/{index + 410001}/{e(public_item_key(item))}"><span class="image-gallery-placeholder" role="img" aria-label="{e(item)}">BGG</span></a><figcaption><strong>{e(item)}</strong><span>Board game gallery · community upload</span><a href="/image/{index + 410001}/{e(public_item_key(item))}">Open image details</a></figcaption></figure>''' | |
| for index, item in enumerate(items) | |
| ) | |
| content = f'''<section data-content-type="image-gallery"><header><h2>Community Image Gallery</h2><p>Browse visual contributions with captions and attribution.</p></header><div class="image-gallery-grid">{gallery}</div></section>''' | |
| elif request.url.path == "/contests": | |
| contest_rows = "".join( | |
| f'''<article class="public-index-card contest-listing-row"><p class="eyebrow">Entry window open</p><h2><a href="/contest/{index + 1}/{e(public_item_key(item))}">{e(item)}</a></h2><p>Read eligibility, entry dates, and winner information for this community event.</p></article>''' | |
| for index, item in enumerate(items) | |
| ) | |
| content = f'''<section data-content-type="contest-list"><header><h2>Current Contests</h2><p>Time-bounded community events and recent winners</p></header><div class="contest-list">{contest_rows}</div></section>''' | |
| elif request.url.path in {"/blogs/posts", "/blog/1/boardgamegeek-blog"}: | |
| posts = ( | |
| (190141, "Sure, I'll Play Monopoly", "Justin Bell", "A thoughtful look at returning to a familiar mass-market classic."), | |
| (188807, "Designer Diary: Countryball Cards", "Jakov J", "The designer explains how history, humor, and card play came together."), | |
| (189401, "Board Gaming News: August", "BoardGameGeek News", "New releases, convention previews, and community announcements."), | |
| ) | |
| article_rows = "".join( | |
| f'''<article class="public-index-card blog-post-row"><p class="public-family-meta">By {e(author)} · BoardGameGeek Blog</p><h2><a href="/blog/1/blogpost/{post_id}/{e(public_item_key(post_title))}">{e(post_title)}</a></h2><p>{e(summary)}</p><a href="/blog/1/blogpost/{post_id}/{e(public_item_key(post_title))}">Read article</a></article>''' | |
| for post_id, post_title, author, summary in posts | |
| ) | |
| content = f'''<section data-content-type="article-list"><header><h2>Recent Blog Posts</h2><p>News, designer diaries, and editorial features</p></header><div class="blog-article-list">{article_rows}</div></section>''' | |
| elif request.url.path in {"/contact", "/advertise", "/support", "/community_rules", "/privacy", "/terms"}: | |
| sections = "".join( | |
| f'''<section class="information-section"><h2>{e(item)}</h2><p>{e(subtitle)}. This offline page preserves the public guidance and directs visitors to the relevant local help material.</p></section>''' | |
| for item in items | |
| ) | |
| contact_form = '''<section class="information-section"><h2>Before contacting the team</h2><p>Check the FAQ and site guide for account, contribution, moderation, and navigation questions.</p><p><a href="/wiki/page/BoardGameGeek_FAQ">Read the FAQ</a> · <a href="/wiki/page/Guide_To_BoardGameGeek">Open the Guide to BGG</a></p><form class="deep-search-form" action="/contact" method="get"><label for="contact-topic">Find contact guidance</label><select id="contact-topic" name="topic"><option>Site help</option><option>Accessibility feedback</option><option>Advertising</option></select><button class="btn btn-primary" type="submit">Show guidance</button></form></section>''' if request.url.path == "/contact" else "" | |
| content = f'''<article data-content-type="information-article">{sections}{contact_form}</article>''' | |
| else: | |
| entries = "".join(f'<li><a href="{e(request.url.path)}?item={e(public_item_key(item))}"><span aria-hidden="true">›</span><strong>{e(item)}</strong></a></li>' for item in items) | |
| selected_item = next((item for item in items if public_item_key(item) == selected_key), None) | |
| selected_markup = f'''<section class="public-index-selected" aria-live="polite"><p class="eyebrow">Selected from {e(title)}</p><h2>{e(selected_item)}</h2><p>{e(subtitle)}</p><a href="{e(request.url.path)}">Back to all {e(title)}</a></section>''' if selected_item else "" | |
| content_type = "data-directory" if request.url.path == "/recentadditions" else "public-directory" | |
| content = f'''{selected_markup}<section class="public-index-card" data-content-type="{content_type}"><h2>Explore {e(title)}</h2><ul>{entries}</ul></section>''' | |
| ad_slot = '<div class="inert-ad-slot public-index-ad" role="note" aria-label="Advertisement slot"><span>Advertisement</span></div>' if request.url.path == "/advertise" else "" | |
| body = f'''<div class="public-index"><nav class="crumbs"><a href="/">Home</a> <span aria-hidden="true">›</span> {e(title)}</nav><header class="public-index-hero"><p class="eyebrow">BoardGameGeek</p><h1>{e(title)}</h1><p>{e(subtitle)}</p></header>{ad_slot}{content}<p class="public-index-return"><a href="/">Return to Explore</a></p></div>''' | |
| return response(shell(f"{title} | BoardGameGeek", body)) | |
| def anonymous_member_route() -> RedirectResponse: | |
| """Source navigation exposes these links, but anonymous use needs an account.""" | |
| return RedirectResponse("/login", status_code=303) | |
| def anonymous_item_create(item_type: str) -> RedirectResponse: | |
| if item_type not in { | |
| "boardgame", "boardgamefamily", "boardgamepublisher", | |
| "boardgameperson", "boardgameaccessory", "boardgamepodcast", | |
| }: | |
| return RedirectResponse("/", status_code=303) | |
| return RedirectResponse("/login", status_code=303) | |
| DEEP_PUBLIC_PAGES: dict[str, tuple[str, str, tuple[tuple[str, str, str], ...]]] = { | |
| "/trade": ( | |
| "Trade", "Find games offered by community members and review trade guidance.", | |
| ( | |
| ("Browse trade lists", "Review games members have marked as available for trade.", "/market"), | |
| ("Your trade list", "Sign in to maintain games you want or can offer.", "/login"), | |
| ("Trade matching", "Compare wanted and offered games before contacting another member.", "/geekexchange/browse"), | |
| ("Safe trading", "Confirm condition, shipping, and terms before arranging an exchange.", "/community_rules"), | |
| ), | |
| ), | |
| "/store": ( | |
| "BGG Store", "The official store is a separate online service; this offline clone keeps shopping local and inert.", | |
| ( | |
| ("Board game accessories", "Browse local accessory directory entries.", "/browse/boardgameaccessory"), | |
| ("GeekMarket", "Explore the locally represented marketplace index.", "/market"), | |
| ("Bestsellers", "Review popular shopping items without starting a transaction.", "/trends/bestsellers"), | |
| ("Support BGG", "Read information about supporting the community.", "/support"), | |
| ), | |
| ), | |
| "/geekbay/browse": ( | |
| "eBay Listings", "Recent board game listings grouped for comparison.", | |
| ( | |
| ("Pandemic", "Board game listings · ending soon · condition varies", "/boardgame/30549/pandemic"), | |
| ("Brass: Birmingham", "Strategy game listings · new and used copies", "/boardgame/224517/brass-birmingham"), | |
| ("Ticket to Ride", "Family game listings · multiple editions", "/boardgame/9209/ticket-to-ride"), | |
| ("Search auctions", "Refine a local auction search by title and category.", "/geekshopper"), | |
| ), | |
| ), | |
| "/stats.php": ( | |
| "BoardGameGeek Stats", "Public database and community activity summaries.", | |
| ( | |
| ("Board games", "Rankings, ratings, categories, mechanics, designers, and publishers.", "/browse/boardgame"), | |
| ("Community", "Guilds, discussions, reviews, files, images, and session reports.", "/guild/home"), | |
| ("Recent additions", "New database contributions and community updates.", "/recentadditions"), | |
| ("Trending plays", "Games with rapidly increasing play activity.", "/trends/trendingplays"), | |
| ), | |
| ), | |
| "/forum/88/bgg/bugs": ( | |
| "BoardGameGeek Bugs", "Public reports about problems using BoardGameGeek.", | |
| ( | |
| ("Unable to sign in on iOS app or Safari", "Authentication · recent replies", "/threads/region/1?sort=recent"), | |
| ("Cloudflare verification not allowing access to files", "Access and files · active discussion", "/threads/region/1?sort=recent"), | |
| ("Search results fail to retain filters", "Search · issue report", "/forums/search"), | |
| ("Report a site issue", "Sign in before posting a new public report.", "/thread/new"), | |
| ), | |
| ), | |
| "/geekmod": ( | |
| "GeekMod", "Community moderation and contribution review tools.", | |
| ( | |
| ("Contribution review", "Community-submitted database changes are reviewed before publication.", "/recentadditions"), | |
| ("Image moderation", "Review image submissions and community standards.", "/images/boardgame/all?sort=recent"), | |
| ("Community guidelines", "Read the participation and moderation policies.", "/community_rules"), | |
| ("Forum moderators", "Learn about forum moderation roles.", "/wiki/page/Forum_Moderators"), | |
| ), | |
| ), | |
| "/geekexchange/browse": ( | |
| "GeekExchange", "Community exchanges organized by status and schedule.", | |
| ( | |
| ("Open exchanges", "Review exchanges currently accepting participants.", "/geekexchange/browse?status=open"), | |
| ("In progress", "Exchanges currently matching or shipping items.", "/geekexchange/browse?status=active"), | |
| ("Completed exchanges", "Browse completed community exchanges.", "/geekexchange/browse?status=complete"), | |
| ("Trade center", "Review other community trading options.", "/trade"), | |
| ), | |
| ), | |
| "/files/boardgame/all": ( | |
| "Board Game Files", "Recent player aids, rules references, translations, and variants.", | |
| ( | |
| ("Pandemic rules reference", "English · rules summary · PDF", "/boardgame/30549/pandemic/files"), | |
| ("Pandemic player aid", "English · player aid · community file", "/boardgame/30549/pandemic/files"), | |
| ("Ticket to Ride reference", "English · rules aid · community file", "/boardgame/9209/ticket-to-ride/files"), | |
| ("Browse recent additions", "Review other newly submitted community content.", "/recentadditions"), | |
| ), | |
| ), | |
| "/threads/sessions": ( | |
| "Session Reports", "Recent public reports describing played board game sessions.", | |
| ( | |
| ("Pandemic — cooperative four-player session", "Session report · Pandemic", "/boardgame/30549/pandemic"), | |
| ("Brass: Birmingham — two-player session", "Session report · Brass: Birmingham", "/boardgame/224517/brass-birmingham"), | |
| ("Ticket to Ride — family game night", "Session report · Ticket to Ride", "/boardgame/9209/ticket-to-ride"), | |
| ("Recent game forums", "Browse current game discussions.", "/threads/gameforums?sort=recent"), | |
| ), | |
| ), | |
| "/browse/boardgamepodcastepisode": ( | |
| "Board Game Podcast Episodes", "Recent episodes from podcasts in the public directory.", | |
| ( | |
| ("Board game news and new releases", "Latest episode · board game news", "/browse/boardgamepodcast"), | |
| ("Design diaries and creator interviews", "Recent episode · interviews", "/browse/boardgamepodcast"), | |
| ("Reviews and weekly recommendations", "Recent episode · reviews", "/browse/boardgamepodcast"), | |
| ("Podcast directory", "Browse all represented board game podcasts.", "/browse/boardgamepodcast"), | |
| ), | |
| ), | |
| "/wiki/page/Forum_Moderators": ( | |
| "Forum Moderators", "Information about moderation of BoardGameGeek forums.", | |
| ( | |
| ("Community moderation", "Moderators help organize discussion and apply community guidelines.", "/community_rules"), | |
| ("Site and technical help", "Use the public help pages before opening a new discussion.", "/wiki/page/Guide_To_BoardGameGeek"), | |
| ("Report a problem", "Browse the public bugs forum for existing reports.", "/forum/88/bgg/bugs"), | |
| ("BoardGameGeek administrators", "Review the captured administrators help page.", "/wiki/page/Admins"), | |
| ), | |
| ), | |
| } | |
| def deep_public_markup(title: str, subtitle: str, items: tuple[tuple[str, str, str], ...], extra: str = "") -> str: | |
| cards = "".join( | |
| f'<article class="deep-nav-card"><h2><a href="{e(href)}">{e(label)}</a></h2><p>{e(description)}</p><a class="deep-nav-open" href="{e(href)}">Open <span aria-hidden="true">›</span></a></article>' | |
| for label, description, href in items | |
| ) | |
| return f'''<div class="public-index deep-nav-index"><nav class="crumbs"><a href="/">Home</a> <span aria-hidden="true">›</span> {e(title)}</nav><header class="public-index-hero"><p class="eyebrow">BoardGameGeek</p><h1>{e(title)}</h1><p>{e(subtitle)}</p></header>{extra}<section class="deep-nav-grid">{cards}</section><p class="public-index-return"><a href="/">Return to Explore</a></p></div>''' | |
| def forum_search(request: Request) -> HTMLResponse: | |
| board_games = request.query_params.get("parentSearchType") == "boardgame" | |
| query = str(request.query_params.get("q") or "") | |
| scope = "Game Forums" if board_games else "All Forums" | |
| results = "" if not query else "".join( | |
| f'<li><a href="/threads/discussion/{e(_discussion_key(item))}"><strong>{e(item["title"])}</strong><span>{e(item["forum"])} · {e(item["author"])}</span></a></li>' | |
| for item in DISCUSSION_VIEWS[("game" if board_games else "general", "recent")][:8] | |
| if query.lower() in f'{item["title"]} {item["forum"]}'.lower() | |
| ) | |
| result_markup = f'<section class="deep-search-results"><h2>Search results</h2><ul>{results or "<li>No matching discussions in the local public index.</li>"}</ul></section>' if query else '<section class="deep-search-help"><h2>Search public discussions</h2><p>Enter words from a topic title, choose a forum scope, and submit the form.</p></section>' | |
| form = f'''<form class="deep-search-form" action="/forums/search" method="get"><label for="forum-search-q">Search terms</label><input id="forum-search-q" name="q" type="search" value="{e(query)}" required><label for="forum-search-scope">Forum scope</label><select id="forum-search-scope" name="parentSearchType"><option value="">All Forums</option><option value="boardgame"{" selected" if board_games else ""}>Game Forums</option></select><button class="btn btn-primary" type="submit">Search</button></form>''' | |
| body = deep_public_markup("Forum Search", f"Search topics in {scope}.", (("Recent", "Browse recently created discussions.", "/threads/region/1?sort=recent"), ("Hot", "Browse hot discussions from the last two days.", "/threads/region/1?sort=hot&interval=twodays")), form + result_markup) | |
| return response(shell("Forum Search | BoardGameGeek", body)) | |
| def auction_search(request: Request) -> HTMLResponse: | |
| query = str(request.query_params.get("q") or "") | |
| form = f'''<form class="deep-search-form" action="/geekshopper" method="get"><label for="auction-q">Auction Search</label><input id="auction-q" name="q" type="search" value="{e(query)}" placeholder="Game title"><button class="btn btn-primary" type="submit">Search</button></form>''' | |
| items = (("Pandemic", "Cooperative strategy game listings.", "/boardgame/30549/pandemic"), ("Brass: Birmingham", "Economic strategy game listings.", "/boardgame/224517/brass-birmingham"), ("Ticket to Ride", "Family game listings.", "/boardgame/9209/ticket-to-ride")) | |
| body = deep_public_markup("Auction Search", "Find board game auctions by title.", items, form) | |
| return response(shell("Auction Search | BoardGameGeek", body)) | |
| def user_search(request: Request) -> HTMLResponse: | |
| query = str(request.query_params.get("q") or "") | |
| form = f'''<form class="deep-search-form" action="/users.php" method="get"><label for="user-q">Find Users</label><input id="user-q" name="q" type="search" value="{e(query)}" placeholder="Username"><button class="btn btn-primary" type="submit">Search</button></form>''' | |
| items = (("Gamer database", "Search public profiles by username.", "/users.php?q=local"), ("Guilds", "Find groups of BoardGameGeek members.", "/guild/home"), ("Community guidelines", "Read the rules for contacting and interacting with members.", "/community_rules")) | |
| body = deep_public_markup("Find Users", "Search the public BoardGameGeek member directory.", items, form) | |
| return response(shell("Find Users | BoardGameGeek", body)) | |
| def deep_public_page(request: Request) -> HTMLResponse: | |
| title, subtitle, items = DEEP_PUBLIC_PAGES[request.url.path] | |
| return response(shell(f"{title} | BoardGameGeek", deep_public_markup(title, subtitle, items))) | |
| def browse_hub() -> HTMLResponse: | |
| groups = ( | |
| ("Board Game Database", (("All Boardgames", "/browse/boardgame"), ("Categories", "/browse/boardgamecategory"), ("Families", "/browse/boardgamefamily"), ("Mechanics", "/browse/boardgamemechanic"))), | |
| ("People and Publishers", (("Designers", "/browse/boardgamedesigner"), ("Artists", "/browse/boardgameartist"), ("Publishers", "/browse/boardgamepublisher"), ("Honors", "/browse/boardgamehonor"))), | |
| ("Discovery", (("The Hotness", "/hotness"), ("Most Played", "/trends/mostplayed"), ("Bestsellers", "/trends/bestsellers"), ("Trending Plays", "/trends/trendingplays"))), | |
| ("More Directories", (("Accessories", "/browse/boardgameaccessory"), ("Podcasts", "/browse/boardgamepodcast"), ("Previews", "/previews"), ("Wiki Index", "/wiki/page/Index"))), | |
| ) | |
| sections = "".join(f'''<section class="deep-nav-card"><h2>{e(heading)}</h2><ul>{''.join(f'<li><a href="{e(href)}">{e(label)}</a></li>' for label, href in links)}</ul></section>''' for heading, links in groups) | |
| body = f'''<div class="public-index"><header class="public-index-hero"><p class="eyebrow">BoardGameGeek Database</p><h1>Browse</h1><p>Ranked games, subject directories, contributors, releases, and trends.</p></header><section class="deep-nav-grid" data-content-type="directory-hub">{sections}</section></div>''' | |
| return response(shell("Browse | BoardGameGeek", body)) | |
| def shopping_hub() -> HTMLResponse: | |
| items = ( | |
| ("GeekMarket", "Community marketplace listings and item condition.", "/market"), | |
| ("Crowdfunding Countdown", "Projects, campaign deadlines, and backer counts.", "/crowdfunding"), | |
| ("Bestsellers", "Ranked popular board games and movement.", "/trends/bestsellers"), | |
| ("Trades", "Community trade lists and safe trading guidance.", "/trade"), | |
| ("Auction Search", "Search local representations of board game auctions.", "/geekshopper"), | |
| ) | |
| return response(shell("Shopping | BoardGameGeek", deep_public_markup("Shopping", "Marketplace, crowdfunding, rankings, trades, and auction discovery.", items))) | |
| def community_hub() -> HTMLResponse: | |
| items = ( | |
| ("Videos", "Featured presentations, how-to videos, and playthroughs.", "/videos/boardgame/all"), | |
| ("Reviews", "Long-form community criticism and game analysis.", "/threads/reviews"), | |
| ("Images", "Community-contributed board game galleries.", "/images/boardgame/all?sort=recent"), | |
| ("Contests", "Current events, entry details, and recent winners.", "/contests"), | |
| ("Blogs", "News, designer diaries, and editorial posts.", "/blogs/posts"), | |
| ("GeekLists", "Numbered, curated lists with community comments.", "/geeklists"), | |
| ) | |
| return response(shell("Community | BoardGameGeek", deep_public_markup("Community", "Public media, articles, galleries, events, and curated lists.", items))) | |
| def rich_record(route: str, key: str) -> dict[str, str] | None: | |
| return next((item for item in rich_public_items(route) if public_item_key(item["title"]) == key), None) | |
| def video_detail(video_id: int, channel: str, slug: str) -> HTMLResponse: | |
| item = rich_record("/videos/boardgame/all", slug) | |
| title = item["title"] if item else slug.replace("-", " ").title() | |
| meta = item["meta"] if item else "BoardGameGeek video" | |
| description = item["description"] if item else "A public board game video presentation." | |
| body = f'''<article class="public-index media-detail" data-content-type="video-detail"><nav class="crumbs"><a href="/videos/boardgame/all">Board Game Videos</a> <span aria-hidden="true">›</span> Video</nav><header class="public-index-hero"><p class="eyebrow">{e(channel)}</p><h1>{e(title)}</h1><p>{e(meta)}</p></header><div class="video-player-placeholder" role="img" aria-label="Video player for {e(title)}"><span aria-hidden="true">▶</span><strong>Offline video preview</strong></div><section class="information-section"><h2>About this video</h2><p>{e(description)}</p><dl><dt>Channel</dt><dd>{e(channel)}</dd><dt>Video ID</dt><dd>{video_id}</dd><dt>Type</dt><dd>Board game video</dd></dl></section><section class="information-section"><h2>Discussion</h2><p>This presentation is represented without remote playback. Browse public game discussions for related questions and commentary.</p><a href="/threads/gameforums?sort=recent">Open game forums</a></section></article>''' | |
| return response(shell(f"{title} | Video | BoardGameGeek", body)) | |
| def geeklist_detail(list_id: int, slug: str) -> HTMLResponse: | |
| item = rich_record("/geeklists", slug) | |
| title = item["title"] if item else slug.replace("-", " ").title() | |
| meta = item["meta"] if item else "Community GeekList" | |
| entries = [] | |
| for index, game_id in enumerate((224517, 30549, 9209), 1): | |
| game = service.game(game_id) | |
| if game: | |
| entries.append(f'''<article class="geeklist-entry"><div class="entry-number">{index}</div>{cover(game, True)}<div><h2><a href="/boardgame/{game_id}/{e(game["slug"])}">{e(game["title"])}</a></h2><p>{e(game["description"])}</p><a href="#comments">{index + 1} comments</a></div></article>''') | |
| body = f'''<div class="public-index" data-content-type="geeklist-detail"><nav class="crumbs"><a href="/geeklists">GeekLists</a> <span aria-hidden="true">›</span> List #{list_id}</nav><header class="public-index-hero"><p class="eyebrow">{e(meta)}</p><h1>{e(title)}</h1><p>A numbered community collection of games, notes, and discussion.</p></header><section class="card">{"".join(entries)}</section><section id="comments" class="card section"><h2>Comments</h2><p><strong>tabletop-reader:</strong> This list has a useful mix of styles and player counts.</p><p><strong>map-and-meeple:</strong> I added two of these to our next game night.</p></section></div>''' | |
| return response(shell(f"{title} | GeekList | BoardGameGeek", body)) | |
| def review_detail(review_id: int, slug: str) -> HTMLResponse: | |
| item = rich_record("/threads/reviews", slug) | |
| title = item["title"] if item else slug.replace("-", " ").title() | |
| meta = item["meta"] if item else "Community review" | |
| summary = item["description"] if item else "A detailed community perspective on a board game." | |
| body = f'''<article class="public-index long-form-article" data-content-type="review-detail"><nav class="crumbs"><a href="/threads/reviews">In-Depth Reviews</a> <span aria-hidden="true">›</span> Review #{review_id}</nav><header class="public-index-hero"><p class="eyebrow">{e(meta)}</p><h1>{e(title)}</h1><p>{e(summary)}</p></header><section class="information-section"><h2>First impressions</h2><p>The opening turns establish the decisions, pacing, and table presence that shape the rest of the game. The review considers how quickly players understand those choices and whether the rules support them.</p></section><section class="information-section"><h2>How the game develops</h2><p>Repeated plays reveal the interaction between planning and adaptation. Player count, experience, and the available strategies all change the texture of the session.</p></section><section class="information-section"><h2>Final thoughts</h2><p>This review weighs the strongest moments against the friction of setup, teaching, and replay. Readers can continue the conversation in the public game forums.</p><a href="/threads/gameforums?sort=recent">Discuss recent games</a></section></article>''' | |
| return response(shell(f"{title} | Review | BoardGameGeek", body)) | |
| def crowdfunding_detail(slug: str) -> HTMLResponse: | |
| item = rich_record("/crowdfunding", slug) | |
| title = item["title"] if item else slug.replace("-", " ").title() | |
| meta = item["meta"] if item else "Campaign summary" | |
| description = item["description"] if item else "A board game crowdfunding project." | |
| body = f'''<article class="public-index" data-content-type="crowdfunding-detail"><nav class="crumbs"><a href="/crowdfunding">Crowdfunding Countdown</a> <span aria-hidden="true">›</span> Project</nav><header class="public-index-hero"><p class="eyebrow">Campaign overview</p><h1>{e(title)}</h1><p>{e(meta)}</p></header><section class="information-section"><h2>Project summary</h2><p>{e(description)}</p><dl><dt>Status</dt><dd>Campaign active in captured public listing</dd><dt>Funding</dt><dd>See backer count and deadline above</dd><dt>Transaction availability</dt><dd>Informational offline preview only</dd></dl></section><p><a href="/crowdfunding">Back to all crowdfunding projects</a></p></article>''' | |
| return response(shell(f"{title} | Crowdfunding | BoardGameGeek", body)) | |
| def market_listing_detail(slug: str) -> HTMLResponse: | |
| item = rich_record("/market", slug) or rich_record("/trends/bestsellers", slug) | |
| title = item["title"] if item else slug.replace("-", " ").title() | |
| description = item["description"] if item else "A board game marketplace record." | |
| body = f'''<article class="public-index" data-content-type="market-detail"><nav class="crumbs"><a href="/market">GeekMarket</a> <span aria-hidden="true">›</span> Listing</nav><header class="public-index-hero"><p class="eyebrow">Marketplace listing</p><h1>{e(title)}</h1><p>{e(description)}</p></header><section class="information-section"><h2>Listing details</h2><dl><dt>Condition</dt><dd>New</dd><dt>Availability</dt><dd>Captured public listing</dd><dt>Checkout</dt><dd>Unavailable in this offline experience</dd></dl></section><section class="information-section"><h2>Compare and discover</h2><p>Use the marketplace, accessory directory, and bestseller ranking to compare related public records.</p><a href="/browse/boardgameaccessory">Browse accessories</a></section></article>''' | |
| return response(shell(f"{title} | GeekMarket | BoardGameGeek", body)) | |
| def most_played_detail(rank: int, slug: str) -> HTMLResponse: | |
| item = rich_record("/trends/mostplayed", slug) | |
| title = item["title"] if item else slug.replace("-", " ").title() | |
| body = f'''<article class="public-index" data-content-type="rank-detail"><nav class="crumbs"><a href="/trends/mostplayed">Most Played Games</a> <span aria-hidden="true">›</span> Rank {rank}</nav><header class="public-index-hero"><p class="eyebrow">Reported play ranking</p><h1>{e(title)}</h1><p>Rank #{rank} in the captured most-played directory.</p></header><section class="information-section"><h2>Activity summary</h2><p>This position reflects reported community plays. Open the broader ranking to compare movement and neighboring games.</p></section></article>''' | |
| return response(shell(f"{title} | Most Played | BoardGameGeek", body)) | |
| def image_detail(image_id: int, slug: str) -> HTMLResponse: | |
| title = slug.replace("-", " ").title() | |
| body = f'''<article class="public-index" data-content-type="image-detail"><nav class="crumbs"><a href="/images/boardgame/all">Community Image Gallery</a> <span aria-hidden="true">›</span> Image</nav><header class="public-index-hero"><p class="eyebrow">Community image #{image_id}</p><h1>{e(title)}</h1><p>Board game gallery contribution with caption and attribution.</p></header><div class="image-detail-placeholder" role="img" aria-label="{e(title)}"><strong>{e(title)}</strong></div><section class="information-section"><h2>Image information</h2><dl><dt>Category</dt><dd>Board game image</dd><dt>Visibility</dt><dd>Public community contribution</dd><dt>Attribution</dt><dd>BoardGameGeek community member</dd></dl></section></article>''' | |
| return response(shell(f"{title} | Image | BoardGameGeek", body)) | |
| def contest_detail(contest_id: int, slug: str) -> HTMLResponse: | |
| title = slug.replace("-", " ").title() | |
| body = f'''<article class="public-index" data-content-type="contest-detail"><nav class="crumbs"><a href="/contests">Giveaway Contests</a> <span aria-hidden="true">›</span> Contest</nav><header class="public-index-hero"><p class="eyebrow">Community event #{contest_id}</p><h1>{e(title)}</h1><p>Contest schedule, entry guidance, and winner information.</p></header><section class="information-section"><h2>How to participate</h2><p>Review the public eligibility and closing date. Entries and prize fulfillment are unavailable in this offline experience.</p></section><section class="information-section"><h2>Recent winners</h2><p>Winner announcements appear after the public event closes.</p></section></article>''' | |
| return response(shell(f"{title} | Contest | BoardGameGeek", body)) | |
| def blog_post_detail(post_id: int, slug: str) -> HTMLResponse: | |
| posts = { | |
| 190141: ("Sure, I'll Play Monopoly", "Justin Bell"), | |
| 188807: ("Designer Diary: Countryball Cards", "Jakov J"), | |
| 189401: ("Board Gaming News: August", "BoardGameGeek News"), | |
| } | |
| title, author = posts.get(post_id, (slug.replace("-", " ").title(), "BoardGameGeek Blog")) | |
| body = f'''<article class="public-index long-form-article" data-content-type="blog-detail"><nav class="crumbs"><a href="/blog/1/boardgamegeek-blog">BoardGameGeek Blog</a> <span aria-hidden="true">›</span> Post</nav><header class="public-index-hero"><p class="eyebrow">By {e(author)} · BoardGameGeek Blog</p><h1>{e(title)}</h1><p>News, perspective, and stories from around the board game hobby.</p></header><section class="information-section"><h2>At the table</h2><p>Games create a shared space where familiar systems can feel different with a new group. This article looks at the expectations players bring with them and the conversation that develops around the table.</p></section><section class="information-section"><h2>What changed</h2><p>Design, publishing, and community habits continue to evolve. Looking closely at one experience offers a useful way to understand those broader changes without losing the people at the center of play.</p></section><section class="information-section"><h2>Continue reading</h2><p>Browse recent posts for more news, designer diaries, and community features.</p><a href="/blogs/posts">All recent blog posts</a></section></article>''' | |
| return response(shell(f"{title} | BoardGameGeek Blog", body)) | |
| def fallback(path: str) -> HTMLResponse: | |
| label=path.replace('-',' ').replace('/',' · ').title() or "Page" | |
| body=f'<div class="empty"><h1>{e(label)}</h1><p>This public section is represented by a compact local index.</p><a class="btn" href="/browse/boardgame">Browse games</a> <a class="btn" href="/plays/bygame/user/local-member/subtype/boardgame">Play logs</a> <a class="btn" href="/forums">Discussions</a></div>' | |
| return response(shell(f"{label} | BoardGameGeek",body)) | |