diff options
Diffstat (limited to 'views/head.pug')
-rw-r--r-- | views/head.pug | 118 |
1 files changed, 60 insertions, 58 deletions
diff --git a/views/head.pug b/views/head.pug index cb5ab49..1fb90c6 100644 --- a/views/head.pug +++ b/views/head.pug @@ -36,68 +36,70 @@ mixin forumpost(row,show_buttons) mixin gametable(status,table,hide_title=0) table - tr - th ID - unless hide_title - th Title - th Scenario - th Players - th Description - case status - when 0 - th Created - when 1 - th Changed - th Turn - when 2 - th Finished - th Result - th - each row in table + thead tr - td= row.game_id + th ID unless hide_title - td.w: a(href="/"+row.title_id)= row.title_name - td.w= row.scenario - if row.player_names - td!= row.player_names - else - td.error Nobody - td= row.description + th Title + th Scenario + th Players + th Description case status when 0 - td.w= row.ctime + th Created when 1 - td.w= row.mtime - if (row.is_active) - td.is_active= row.active - else - td= row.active + th Changed + th Turn when 2 - td.w= row.mtime - td= row.result - td.command - if status === 0 - if row.is_ready - a(href="/join/"+row.game_id) Enter - else - a(href="/join/"+row.game_id) Join - else if status === 1 - if row.is_yours - if row.is_shared - a(href="/join/"+row.game_id)= "Play" + th Finished + th Result + th + tbody + each row in table + tr + td= row.game_id + unless hide_title + td.w: a(href="/"+row.title_id)= row.title_name + td.w= row.scenario + if row.player_names + td!= row.player_names + else + td.error Nobody + td= row.description + case status + when 0 + td.w= row.ctime + when 1 + td.w= row.mtime + if (row.is_active) + td.is_active= row.active else - a(href=`/${row.title_id}/play:${row.game_id}:${row.your_role}`)= "Play" - else - a(href=`/${row.title_id}/play:${row.game_id}`) View - else if status >= 2 - a(href=`/${row.title_id}/replay:${row.game_id}`) View - else - tr - case status - when 0 - td(colspan=7-hide_title) No open games. - when 1 - td(colspan=8-hide_title) No active games. - when 2 - td(colspan=8-hide_title) No finished games. + td= row.active + when 2 + td.w= row.mtime + td= row.result + td.command + if status === 0 + if row.is_ready + a(href="/join/"+row.game_id) Enter + else + a(href="/join/"+row.game_id) Join + else if status === 1 + if row.is_yours + if row.is_shared + a(href="/join/"+row.game_id)= "Play" + else + a(href=`/${row.title_id}/play:${row.game_id}:${row.your_role}`)= "Play" + else + a(href=`/${row.title_id}/play:${row.game_id}`) View + else if status >= 2 + a(href=`/${row.title_id}/replay:${row.game_id}`) View + else + tr + case status + when 0 + td(colspan=7-hide_title) No open games. + when 1 + td(colspan=8-hide_title) No active games. + when 2 + td(colspan=8-hide_title) No finished games. |