This commit is contained in:
Alicia 2019-02-23 14:16:37 +00:00
parent e7dbd3cc43
commit ea3b4aa7e0
3 changed files with 104 additions and 106 deletions

View File

@ -1,6 +1,6 @@
{{/*### {{/*###
Handler=/leaderboard Handler=/leaderboard
TitleBar=Leaderboard TitleBar=Vanilla Leaderboard
KyutGrill=leaderboard2.jpg KyutGrill=leaderboard2.jpg
*/}} */}}
{{ define "tpl" }} {{ define "tpl" }}

View File

@ -1,59 +1,58 @@
{{/*### {{/*###
Handler=/autoboard Handler=/autoboard
TitleBar=Leaderboard TitleBar=Autopilot Leaderboard
KyutGrill=leaderboard2.jpg KyutGrill=leaderboard2.jpg
*/}} */}}
{{ define "tpl" }} {{ define "tpl" }}
<div class="ui container"> <div class="ui container">
{{ $favModeRaw := .Get "users/self/favourite_mode" }} {{ $favModeRaw := .Get "users/self/favourite_mode" }}
{{ $favMode := _or (atoi (.Gin.Query "mode")) $favModeRaw.favourite_mode (float 0) }} {{ $favMode := _or (atoi (.Gin.Query "mode")) $favModeRaw.favourite_mode (float 0) }}
<script> <script>
var favouriteMode = {{ $favMode }}; var favouriteMode = {{ $favMode }};
var page = {{ .Gin.Query "p" | atoint | atLeastOne }}; var page = {{ .Gin.Query "p" | atoint | atLeastOne }};
var country = {{ .Gin.Query "country" }}.toLowerCase(); var country = {{ .Gin.Query "country" }}.toLowerCase();
if (country.length != 2) if (country.length != 2)
country = ""; country = "";
</script> </script>
<div class="ui four item menu" id="mode-menu"> <div class="ui four item menu" id="mode-menu">
{{ range $k, $v := modes }} {{ range $k, $v := modes }}
<a class="{{ favMode $favMode $k }}item" data-mode="{{ $k }}" href="/relaxboard?mode={{ $k }}">{{ $v }}</a> <a class="{{ favMode $favMode $k }}item" data-mode="{{ $k }}" href="/relaxboard?mode={{ $k }}">{{ $v }}</a>
{{ end }} {{ end }}
</div> </div>
<div class="ui twelve item stackable menu"> <div class="ui twelve item stackable menu">
{{ range countryList 11 }} {{ range countryList 11 }}
<a class="item lb-country" data-country="{{ . }}"><i class="{{ . }} flag nopad"></i></a> <a class="item lb-country" data-country="{{ . }}"><i class="{{ . }} flag nopad"></i></a>
{{ end }} {{ end }}
<a class="item" id="country-chooser-modal">...</a> <a class="item" id="country-chooser-modal">...</a>
</div> </div>
<table class="ui fixed table"> <table class="ui fixed table">
<thead> <thead>
{{ template "simplepag" 5 }} {{ template "simplepag" 5 }}
<tr> <tr>
<th class="two wide">{{ .T "Rank" }} </th> <th class="two wide">{{ .T "Rank" }} </th>
<th class="four wide">{{ .T "Player" }} </th> <th class="four wide">{{ .T "Player" }} </th>
<th class="four wide">{{ .T "PP/Score" }} </th> <th class="four wide">{{ .T "PP/Score" }} </th>
<th class="three wide">{{ .T "Accuracy" }} </th> <th class="three wide">{{ .T "Accuracy" }} </th>
<th class="three wide">{{ .T "Playcount" }} </th> <th class="three wide">{{ .T "Playcount" }} </th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
</tbody> </tbody>
<tfoot> <tfoot>
{{ template "simplepag" 5 }} {{ template "simplepag" 5 }}
</tfoot> </tfoot>
</table> </table>
<div class="ui modal"> <div class="ui modal">
<div class="content"> <div class="content">
<div class="ui four column grid"> <div class="ui four column grid">
{{ range countryList 500 }} {{ range countryList 500 }}
{{ $short := . }} {{ $short := . }}
{{ with country . true }} {{ with country . true }}
<div class="ui clickable column lb-country" data-country="{{ $short }}">{{ . }}</div> <div class="ui clickable column lb-country" data-country="{{ $short }}">{{ . }}</div>
{{ end }} {{ end }}
{{ end }} {{ end }}
</div>
</div> </div>
</div> </div>
</div> </div>
{{ end }} </div>
{{ end }}

View File

@ -1,59 +1,58 @@
{{/*### {{/*###
Handler=/relaxboard Handler=/relaxboard
TitleBar=Leaderboard TitleBar=Relax Leaderboard
KyutGrill=leaderboard2.jpg KyutGrill=leaderboard2.jpg
*/}} */}}
{{ define "tpl" }} {{ define "tpl" }}
<div class="ui container"> <div class="ui container">
{{ $favModeRaw := .Get "users/self/favourite_mode" }} {{ $favModeRaw := .Get "users/self/favourite_mode" }}
{{ $favMode := _or (atoi (.Gin.Query "mode")) $favModeRaw.favourite_mode (float 0) }} {{ $favMode := _or (atoi (.Gin.Query "mode")) $favModeRaw.favourite_mode (float 0) }}
<script> <script>
var favouriteMode = {{ $favMode }}; var favouriteMode = {{ $favMode }};
var page = {{ .Gin.Query "p" | atoint | atLeastOne }}; var page = {{ .Gin.Query "p" | atoint | atLeastOne }};
var country = {{ .Gin.Query "country" }}.toLowerCase(); var country = {{ .Gin.Query "country" }}.toLowerCase();
if (country.length != 2) if (country.length != 2)
country = ""; country = "";
</script> </script>
<div class="ui four item menu" id="mode-menu"> <div class="ui four item menu" id="mode-menu">
{{ range $k, $v := modes }} {{ range $k, $v := modes }}
<a class="{{ favMode $favMode $k }}item" data-mode="{{ $k }}" href="/relaxboard?mode={{ $k }}">{{ $v }}</a> <a class="{{ favMode $favMode $k }}item" data-mode="{{ $k }}" href="/relaxboard?mode={{ $k }}">{{ $v }}</a>
{{ end }} {{ end }}
</div> </div>
<div class="ui twelve item stackable menu"> <div class="ui twelve item stackable menu">
{{ range countryList 11 }} {{ range countryList 11 }}
<a class="item lb-country" data-country="{{ . }}"><i class="{{ . }} flag nopad"></i></a> <a class="item lb-country" data-country="{{ . }}"><i class="{{ . }} flag nopad"></i></a>
{{ end }} {{ end }}
<a class="item" id="country-chooser-modal">...</a> <a class="item" id="country-chooser-modal">...</a>
</div> </div>
<table class="ui fixed table"> <table class="ui fixed table">
<thead> <thead>
{{ template "simplepag" 5 }} {{ template "simplepag" 5 }}
<tr> <tr>
<th class="two wide">{{ .T "Rank" }} </th> <th class="two wide">{{ .T "Rank" }} </th>
<th class="four wide">{{ .T "Player" }} </th> <th class="four wide">{{ .T "Player" }} </th>
<th class="four wide">{{ .T "PP/Score" }} </th> <th class="four wide">{{ .T "PP/Score" }} </th>
<th class="three wide">{{ .T "Accuracy" }} </th> <th class="three wide">{{ .T "Accuracy" }} </th>
<th class="three wide">{{ .T "Playcount" }} </th> <th class="three wide">{{ .T "Playcount" }} </th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
</tbody> </tbody>
<tfoot> <tfoot>
{{ template "simplepag" 5 }} {{ template "simplepag" 5 }}
</tfoot> </tfoot>
</table> </table>
<div class="ui modal"> <div class="ui modal">
<div class="content"> <div class="content">
<div class="ui four column grid"> <div class="ui four column grid">
{{ range countryList 500 }} {{ range countryList 500 }}
{{ $short := . }} {{ $short := . }}
{{ with country . true }} {{ with country . true }}
<div class="ui clickable column lb-country" data-country="{{ $short }}">{{ . }}</div> <div class="ui clickable column lb-country" data-country="{{ $short }}">{{ . }}</div>
{{ end }} {{ end }}
{{ end }} {{ end }}
</div>
</div> </div>
</div> </div>
</div> </div>
{{ end }} </div>
{{ end }}