//- vim:ts=4:sw=4:
meta(name="viewport" content="width=device-width,initial-scale=1")
meta(name="theme-color" content="#444")
link(rel="icon" type="image/svg+xml" href="/favicon.svg")
link(rel="stylesheet" href="/fonts/fonts.css")
link(rel="stylesheet" href="/style.css")
if SITE_THEME
link(rel="stylesheet" href="/themes/"+SITE_THEME)
mixin social(title,description,game)
meta(property="og:title" content=title)
meta(property="og:type" content="website")
if game
meta(property="og:image" content=SITE_URL+"/"+game+"/cover.2x.jpg")
else
if SITE_ICON
meta(property="og:image" content=SITE_URL+"/images/"+SITE_ICON)
else
meta(property="og:image" content=SITE_URL+"/images/rally-the-troops.png")
meta(property="og:description" content=description)
mixin gamecover(title_id)
a(href="/"+title_id)
img(src=`/${title_id}/cover.1x.jpg` srcset=`/${title_id}/cover.2x.jpg 2x`)
mixin forumpost(row,show_buttons)
.post(id=row.post_id)
.head
.from: b: a.black(href="/user/"+row.author_name)= row.author_name
.time= human_date(row.ctime)
if row.edited
|
| (edited #{human_date(row.mtime)})
.body!= row.body
if show_buttons && user
.edit
if user.user_id === 1
| #[a(href="/forum/delete-post/"+row.post_id) DELETE]
|
if row.author_id === user.user_id
| #[a(href="/forum/edit/"+row.post_id) Edit]
|
| #[a(href="/forum/reply/"+row.post_id) Reply]
mixin gamelist(list,hide_title=0)
div.game_list
each item in list
div
-
let className = "game_item"
let pace_icon = ""
let pace_text = ""
let chat_icon = ""
if (item.your_turn) className += " your_turn"
if (item.status === 0 && item.join_count === 0) className += " open replacement"
else if (item.status === 0 && item.join_count !== item.player_count) className += " open"
else if (item.status === 0 && item.join_count === item.player_count) className += " ready"
else if (item.status === 1 && item.join_count !== item.player_count) className += " replacement"
else if (item.status === 1 && item.join_count === item.player_count) className += " active"
else if (item.status === 2) className += " finished"
else if (item.status === 3) className += " archived"
if (item.is_unread) chat_icon = "\u{1f4dd}"
if (item.is_private) pace_icon += EMOJI_PRIVATE
if (item.is_match)
pace_icon += EMOJI_MATCH
else if (item.pace > 0)
pace_icon += PACE_ICON[item.pace], pace_text = PACE_TEXT[item.pace]
div(class=className)
div.game_head
if item.scenario.length <= 2
div
| #{pace_icon} ##{item.game_id} – #{item.title_name} (#{item.scenario}) #{chat_icon}
else
div
| #{pace_icon} ##{item.game_id} – #{item.title_name} #{chat_icon}
case item.status
when 0
a(class="command" href=`/join/${item.game_id}`) Join
when 1
if !item.is_ready
a(class="command" href="/join/"+item.game_id) Join
else if item.is_yours
if item.your_role
a(class="command" href=`/${item.title_id}/play.html?game=${item.game_id}&role=${encodeURIComponent(item.your_role)}`) Play
else
a(class="command" href="/join/"+item.game_id) Play
else
a(class="command" href=`/${item.title_id}/play.html?game=${item.game_id}`) Watch
when 2
if item.is_yours
if item.your_role
a(class="command" href=`/${item.title_id}/play.html?game=${item.game_id}&role=${encodeURIComponent(item.your_role)}`) Review
else
a(class="command" href="/join/"+item.game_id) Review
else
a(class="command" href=`/${item.title_id}/play.html?game=${item.game_id}`) Review
when 3
| Archived
div.game_main
div.game_info
if item.is_match
i
a(href="/tm/pool/"+item.notice)= item.notice
else if item.notice
i= item.notice
else
i= pace_text
unless item.is_match
if item.scenario !== "Standard" && item.scenario !== "Historical" && item.scenario.length > 2
div Scenario: #{item.scenario}
unless item.human_options === "None"
div Options: #{item.human_options}
if item.player_names
div Players: !{item.player_names}
else
div Players: Nobody
case item.status
when 0
div Created: #{human_date(item.ctime)}
when 1
div Last move: #{human_date(item.mtime)}
if item.your_turn
if item.time_left <= 0
div Time left: none.
else if item.time_left <= 2
div Time left: #{ item.time_left * 24 | 0 } hours
else if item.time_left <= 5
div Time left: #{ item.time_left | 0 } days
when 2
div Finished: #{human_date(item.mtime)}
div Result: !{item.result}
when 3
div Finished: #{human_date(item.mtime)}
div Result: !{item.result}
unless hide_title
a(href=`/${item.title_id}`)
img(src=`/${item.title_id}/thumbnail.jpg`)
mixin seedlist(list, title)
if list && list.length > 0
table.half.seeds
if title
thead
tr
th= title
td
td= TM_ICON_QUEUE
tbody
each seed in list
tr
td
a(href="/tm/seed/" + seed.seed_name)= seed.seed_name
td.n #{seed.queue_size}
if user && seed.is_queued
td= TM_ICON_TICKET
else
td
mixin poollist(list, title, icon)
if list && list.length > 0
table.half.pools
if title
thead
tr
th!= title
td= icon
tbody
each pool in list
tr
td
a(href="/tm/pool/" + pool.pool_name)= pool.pool_name
if pool.is_finished
if pool.status
td!= pool.status.split(",").map(p => `${p}`).join(", ")
else
td Nobody
else
td.w= pool.status
mixin tourlist(seeds, pools, fin)
if (seeds && seeds.length > 0) || (pools && pools.length > 0) || (fin && fin.length > 0)
h2 Tournaments
div.tour_list
div
+seedlist(seeds, "Registrations")
+poollist(pools, "Active", TM_ICON_ACTIVE)
div
+poollist(fin, "Finished", TM_ICON_FINISHED)