Skip to content

Commit

Permalink
Display bytes/chars instead of points on compact scores page (code-go…
Browse files Browse the repository at this point in the history
…lf#390)

* Display bytes/chars instead of points on compact scores page

Only for single hole mode

* Fix right border for compact scores page
  • Loading branch information
btnlq authored Mar 13, 2021
1 parent 4874cef commit 07b4a1b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion views/css/scores.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ td > a > span:nth-of-type(1) { flex: 1 }
td > a:hover > span:first-of-type { text-decoration: underline }

@media (max-width: 34rem) {
td:nth-child(5) { border-right: 1px solid var(--color) }
td:nth-child(5), td:nth-child(7) { border-right: 1px solid var(--color) }
}
16 changes: 8 additions & 8 deletions views/scores.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h1>
{{/* TODO <a class="btn blue" href=#me>{{ svg "search-light" }} Find Me</a> */}}
</h1>
<details class=nav>
{{ if eq $holeID "all-holes" }}
{{ if $allHoles }}
<summary>All Holes</summary>
{{ else }}
<a href="/scores/all-holes/{{ $langID }}/{{ $scoring }}">All Holes</a>
Expand Down Expand Up @@ -84,9 +84,9 @@ <h1>
<th>Rank
<th>Golfer
<th class=right>{{ if $allHoles }}Holes{{ else }}Lang{{ end }}
<th class=center colspan=2>Points
<th class="right wide">Bytes
<th class="right wide">Chars
<th class="center{{ if not $allHoles }} wide{{ end }}" colspan=2>Points
<th class="right{{ if $allHoles }} wide{{ end }}">Bytes
<th class="right{{ if $allHoles }} wide{{ end }}">Chars
<th class="right wide">Submitted
<tbody>
{{ $name := "" }}
Expand All @@ -105,16 +105,16 @@ <h1>
{{ end }}
</a>
<td class=right>{{ if $allHoles }}{{ .Holes }}{{ else }}{{ .Lang.Name }}{{ end }}
<td class=right><span{{ if $charsScoring }} class=inactive {{end}} data-tooltip="Points for Bytes scoring">{{ comma .BytesPoints }}
<td class=right><span{{ if $bytesScoring }} class=inactive {{end}} data-tooltip="Points for Chars scoring">{{ comma .CharsPoints }}
<td class="right wide">
<td class="right{{ if not $allHoles }} wide{{ end }}"><span{{ if $charsScoring }} class=inactive {{end}} data-tooltip="Points for Bytes scoring">{{ comma .BytesPoints }}
<td class="right{{ if not $allHoles }} wide{{ end }}"><span{{ if $bytesScoring }} class=inactive {{end}} data-tooltip="Points for Chars scoring">{{ comma .CharsPoints }}
<td class="right{{ if $allHoles }} wide{{ end }}">
<span{{ if $charsScoring }} class=inactive {{end}}
{{ if ne .Bytes 0 }}
data-tooltip="Bytes scoring is {{ comma .Bytes }} bytes, {{ comma .BytesChars }} chars.">{{ comma .Bytes }}
{{ else }}
>&nbsp;
{{ end }}
<td class="right wide">
<td class="right{{ if $allHoles }} wide{{ end }}">
<span{{ if $bytesScoring }} class=inactive {{end}}
{{ if ne .Chars 0 }}
data-tooltip="Chars scoring is {{ comma .CharsBytes }} bytes, {{ comma .Chars }} chars.">{{ comma .Chars }}
Expand Down

0 comments on commit 07b4a1b

Please sign in to comment.