diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/create-index.pug | 2 | ||||
-rw-r--r-- | views/create.pug | 25 | ||||
-rw-r--r-- | views/games_finished.pug | 5 | ||||
-rw-r--r-- | views/games_public.pug | 2 | ||||
-rw-r--r-- | views/head.pug | 11 | ||||
-rw-r--r-- | views/profile.pug | 4 | ||||
-rw-r--r-- | views/tm_active.pug | 4 | ||||
-rw-r--r-- | views/tm_finished.pug | 5 | ||||
-rw-r--r-- | views/tm_list.pug | 4 | ||||
-rw-r--r-- | views/tm_pool.pug | 30 | ||||
-rw-r--r-- | views/tm_seed.pug | 4 | ||||
-rw-r--r-- | views/user.pug | 32 |
12 files changed, 96 insertions, 32 deletions
diff --git a/views/create-index.pug b/views/create-index.pug index d038810..c508be7 100644 --- a/views/create-index.pug +++ b/views/create-index.pug @@ -3,7 +3,7 @@ doctype html html head include head - title= SITE_NAME + title Create game body include header article diff --git a/views/create.pug b/views/create.pug index d45903e..c4c5c2a 100644 --- a/views/create.pug +++ b/views/create.pug @@ -19,27 +19,36 @@ html p.error You are not logged in! form(method="post" action="/create/"+title.title_id) - if Array.isArray(scenarios) - if scenarios.length > 1 + if Array.isArray(rules.scenarios) + if rules.scenarios.length > 1 p Scenario: br select(name="scenario") - each scenario in scenarios - option(value=scenario)= scenario + each scenario in rules.scenarios + if scenario === rules.default_scenario + option(value=scenario selected)= scenario + else + option(value=scenario)= scenario else - input(type="hidden" name="scenario" value=scenarios[0]) + input(type="hidden" name="scenario" value=rules.scenarios[0]) else p Scenario: br select(name="scenario") - each list, name in scenarios + each list, name in rules.scenarios if name === "" each scenario in list - option(value=scenario)= scenario + if scenario === rules.default_scenario + option(value=scenario selected)= scenario + else + option(value=scenario)= scenario else optgroup(label=name) each scenario in list - option(value=scenario)= scenario + if scenario === rules.default_scenario + option(value=scenario selected)= scenario + else + option(value=scenario)= scenario | !{ title.create_html } diff --git a/views/games_finished.pug b/views/games_finished.pug index 8d71717..90ec9a2 100644 --- a/views/games_finished.pug +++ b/views/games_finished.pug @@ -3,7 +3,10 @@ doctype html html head include head - title= SITE_NAME + if user && user.user_id === who.user_id + title Your finished games + else + title #{who.name}’s finished games body include header article.wide diff --git a/views/games_public.pug b/views/games_public.pug index 54591cd..8cfd541 100644 --- a/views/games_public.pug +++ b/views/games_public.pug @@ -3,7 +3,7 @@ doctype html html head include head - title= SITE_NAME + title Public room if user meta(http-equiv="refresh" content=900) body diff --git a/views/head.pug b/views/head.pug index 61ca688..75e1135 100644 --- a/views/head.pug +++ b/views/head.pug @@ -109,7 +109,16 @@ mixin gamelist(list,hide_title=0) else a(class="command" href=`/${item.title_id}/play.html?game=${item.game_id}`) Review when 3 - | Archived + if ENABLE_ARCHIVE + 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)}`) Archived + else + a(class="command" href="/join/"+item.game_id) Archived + else + a(class="command" href=`/${item.title_id}/play.html?game=${item.game_id}&role=Observer`) Archived + else + | Archived div.game_main div.game_info diff --git a/views/profile.pug b/views/profile.pug index 391fca0..4ecf289 100644 --- a/views/profile.pug +++ b/views/profile.pug @@ -3,13 +3,13 @@ doctype html html head include head - title= SITE_NAME + title Profile body include header article h1= SITE_NAME - p Welcome, #{user.name}! + p Welcome, <a class="black" href="/user/#{user.name}">#{user.name}</a>! p Your mail address is #{user.mail} if ENABLE_MAIL diff --git a/views/tm_active.pug b/views/tm_active.pug index cc821b2..625eac2 100644 --- a/views/tm_active.pug +++ b/views/tm_active.pug @@ -3,11 +3,11 @@ doctype html html head include head - title= SITE_NAME + title Your tournaments body include header article.wide - h1 Your Tournaments + h1 Your tournaments if seeds && seeds.length > 0 +seedlist(seeds, "Registrations") diff --git a/views/tm_finished.pug b/views/tm_finished.pug index efe193d..5d077c6 100644 --- a/views/tm_finished.pug +++ b/views/tm_finished.pug @@ -3,7 +3,10 @@ doctype html html head include head - title= SITE_NAME + if user && user.user_id === who.user_id + title Your finished tournaments + else + title #{who.name}’s finished tournaments body include header article.wide diff --git a/views/tm_list.pug b/views/tm_list.pug index bc7fd83..f5efa26 100644 --- a/views/tm_list.pug +++ b/views/tm_list.pug @@ -12,7 +12,3 @@ html p See <a href="/docs/tournaments.html">tournament information</a>. +seedlist(seeds, "Mini Cup") - - h2 Active - each pools, seed_name in pools_by_seed - +poollist(pools, `<a href="/tm/seed/${seed_name}">${seed_name}</a>`) diff --git a/views/tm_pool.pug b/views/tm_pool.pug index 1690535..e6c7715 100644 --- a/views/tm_pool.pug +++ b/views/tm_pool.pug @@ -49,9 +49,9 @@ html tr td Started td= human_date(pool.start_date) - tr - td Finished - if pool.finish_date + if pool.finish_date + tr + td Finished td= human_date(pool.finish_date) if seed.player_count === 2 @@ -84,7 +84,10 @@ html if ix > 0 | if gs[1] === null - a.black(href="/join/" + gs[0]) − + if games.find(game => game.game_id === gs[0]).is_abandoned + a.black(href="/join/" + gs[0]) × + else + a.black(href="/join/" + gs[0]) − else a.black(href="/join/" + gs[0])= gs[1] td.r= row.points @@ -116,7 +119,10 @@ html each gs in result td.c if gs[1] === null - a.black(href="/join/" + gs[0]) − + if games.find(game => game.game_id === gs[0]).is_abandoned + a.black(href="/join/" + gs[0]) × + else + a.black(href="/join/" + gs[0]) − else a.black(href="/join/" + gs[0])= gs[1] td.r= row.points @@ -150,10 +156,16 @@ html if game.status > 1 td.w.r - each role, ix in roles - if ix > 0 - | : - | #{role_scores[role]} + if game.is_abandoned + | None + else + each role, ix in roles + if ix > 0 + | : + if role_scores[role] === null + | × + else + | #{role_scores[role]} else td.r if game.status > 0 diff --git a/views/tm_seed.pug b/views/tm_seed.pug index 9902f4f..ea31a41 100644 --- a/views/tm_seed.pug +++ b/views/tm_seed.pug @@ -70,8 +70,8 @@ html form(method="post" action="/api/tm/withdraw/" + seed.seed_id + "/" + (ix+1)) button(disabled) Register button(type="submit") Withdraw - else if ix === 0 && may_register - form(method="post" action="/api/tm/register/" + seed.seed_id) + else if may_register && may_join_seed_level(user.user_id, seed.seed_id, ix+1) + form(method="post" action="/api/tm/register/" + seed.seed_id + "/" + (ix+1)) button(type="submit") Register button(disabled) Withdraw else diff --git a/views/user.pug b/views/user.pug index fc55b42..c3e8925 100644 --- a/views/user.pug +++ b/views/user.pug @@ -42,6 +42,38 @@ html br a(href="/contacts/add-enemy/"+who.name) Add to blacklist + if (who.move_time_mean !== null) + h3 Response time + div Average response time: #{format_minutes(who.move_time_mean)} + if (who.move_time_q2 !== null) + div Median response time: #{format_minutes(who.move_time_q2)} + if (who.move_time_q1 !== null && who.move_time_q2 !== null) + div Middle half of response times: #{format_minutes(who.move_time_q1)} to #{format_minutes(who.move_time_q3)} + + h3 Timeouts + div Total number of timeouts: #{who.timeout_total} + div Games completed since last timeout: #{who.games_since_timeout} + + if ratings.length > 0 + h3 Most played games + table + thead + tr + th Title + th Count + th Last played + if user && user.user_id === 1 + th Elo + tbody + each row in ratings + tr + td + a.black(href="/" + row.title_id)= row.title_name + td.r= row.count + td.r= row.last + if user && user.user_id === 1 + td.r= row.rating + +tourlist(null, active_pools, finished_pools) if open_games.length > 0 |