//- vim:ts=4:sw=4:
meta(name="viewport" content="width=device-width,initial-scale=1")
link(rel="icon" type="image/svg+xml" href="/favicon.svg")
link(rel="stylesheet" href="/fonts/fonts.css")
link(rel="stylesheet" href="/style.css")
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
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
.head
.from: a(href="/user/"+row.author_name)= row.author_name
.time= row.ctime
if row.edited
|
| (edited #{row.mtime})
.body!= row.body
if show_buttons && user
.edit
if user.user_id === 1
| #[a(href="/admin/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"
if (item.your_turn) className += " your_turn"
if (item.is_unread) className += " unread"
if (item.status === 0 && !item.is_ready) className += " open"
else if (item.status === 0 && item.is_ready) className += " ready"
else if (item.status === 1 && !item.is_ready) className += " replacement"
else if (item.status === 1 && item.is_ready) className += " active"
else if (item.status === 2) className += " finished"
div(class=className)
div.game_head
if item.scenario.length <= 2
div
| #{item.game_id} –
| #{item.title_name}
| (#{item.scenario})
else
div
| #{item.game_id} –
| #{item.title_name}
case item.status
when 0
if item.is_ready && item.your_turn
a(class="command" href=`/join/${item.game_id}`) Start
else
a(class="command" href=`/join/${item.game_id}`) Join
when 1
if item.is_yours
if item.your_role
a(class="command" href=`/${item.title_id}/play:${item.game_id}:${item.your_role}`) Play
else
a(class="command" href="/join/"+item.game_id) Play
else
a(class="command" href=`/${item.title_id}/play:${item.game_id}`) View
when 2
if item.is_yours
if item.your_role
a(class="command" href=`/${item.title_id}/play:${item.game_id}:${item.your_role}`) Review
else
a(class="command" href="/join/"+item.game_id) Review
else
a(class="command" href=`/${item.title_id}/play:${item.game_id}`) Review
div.game_main
div.game_info
if item.description
i= item.description
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: #{item.ctime}
when 1
div Changed: #{item.mtime}
when 2
div Finished: #{item.mtime}
div Result: !{item.result}
unless hide_title
img(src=`/${item.title_id}/thumbnail.jpg`)