diff --git a/scripts/games/app.js b/scripts/games/app.js index 41c189f..bcb7a32 100644 --- a/scripts/games/app.js +++ b/scripts/games/app.js @@ -145,10 +145,10 @@ try { // Parse testcase information out of the dat to reinject as shortcut values. var dat = toml.parse(datContents); if (dat.testcases == null || dat.testcases.length == 0) { - datContents = `compatibility = 99"\r\ntestcase_date = "2000-01-01"\r\n` + datContents; + datContents = `compatibility = \"99\"\r\ntestcase_date = "2000-01-01"\r\n` + datContents; } else { let recent = dat.testcases[0]; - datContents = `compatibility = ${recent.compatibility}\r\ntestcase_date = "${recent.date}"\r\n` + datContents; + datContents = `compatibility = \"${recent.compatibility}\"\r\ntestcase_date = "${recent.date}"\r\n` + datContents; } var wikiContents = ""; diff --git a/site/data/compatibility.json b/site/data/compatibility.json index 97b609a..743f38e 100644 --- a/site/data/compatibility.json +++ b/site/data/compatibility.json @@ -1,9 +1,9 @@ { - "0": { "name": "Perfect", "color": "#5c93ed", "description": "Game functions flawless with no audio or graphical glitches, all tested functionality works as intended without any workarounds needed." }, - "1": { "name": "Great", "color": "#47d35c", "description": "Game functions with minor graphical or audio glitches and is playable from start to finish. May require some workarounds." }, - "2": { "name": "Okay", "color": "#94b242", "description": "Game functions with major graphical or audio glitches, but game is playable from start to finish with workarounds." }, - "3": { "name": "Bad", "color": "#f2d624", "description": "Game functions, but with major graphical or audio glitches. Unable to progress in specific areas due to glitches even with workarounds." }, - "4": { "name": "Intro/Menu", "color": "red", "description": "Game is completely unplayable due to major graphical or audio glitches. Unable to progress past the Start Screen." }, - "5": { "name": "Won't Boot", "color": "#828282", "description": "The game crashes when attempting to startup." }, - "99": { "name": "Not Tested", "color": "black", "description": "This game has not yet been tested." } + "0": { "key": "0", "name": "Perfect", "color": "#5c93ed", "description": "Game functions flawless with no audio or graphical glitches, all tested functionality works as intended without any workarounds needed." }, + "1": { "key": "1", "name": "Great", "color": "#47d35c", "description": "Game functions with minor graphical or audio glitches and is playable from start to finish. May require some workarounds." }, + "2": { "key": "2", "name": "Okay", "color": "#94b242", "description": "Game functions with major graphical or audio glitches, but game is playable from start to finish with workarounds." }, + "3": { "key": "3", "name": "Bad", "color": "#f2d624", "description": "Game functions, but with major graphical or audio glitches. Unable to progress in specific areas due to glitches even with workarounds." }, + "4": { "key": "4", "name": "Intro/Menu", "color": "red", "description": "Game is completely unplayable due to major graphical or audio glitches. Unable to progress past the Start Screen." }, + "5": { "key": "5", "name": "Won't Boot", "color": "#828282", "description": "The game crashes when attempting to startup." }, + "99": { "key": "99", "name": "Not Tested", "color": "black", "description": "The game has not yet been tested." } } diff --git a/site/themes/citra-bs-theme/layouts/game/list.html b/site/themes/citra-bs-theme/layouts/game/list.html index ac0a103..febb8ab 100644 --- a/site/themes/citra-bs-theme/layouts/game/list.html +++ b/site/themes/citra-bs-theme/layouts/game/list.html @@ -5,8 +5,8 @@ {{ range .Site.Data.compatibility }} -
{{ .name }} - {{ .description }} +
{{ .name }} + {{ .description }} {{ end }} @@ -25,11 +25,11 @@ {{ range .Data.Pages }} - {{- $rating := index .Site.Data.compatibility ( string .Params.compatibility | default "99" ) }} + {{- $rating := index .Site.Data.compatibility .Params.compatibility }} {{ .Params.title }} -
{{ $rating.name }} +
{{ $rating.name }} {{ dateFormat "January 2, 2006" .Params.testcase_date }} {{ end }} @@ -49,13 +49,15 @@ Highcharts.chart('highchart-container', { exporting: { enabled: false }, title: { text: '' }, xAxis: { categories: [''] }, - yAxis: { min: 0, max: $(".compatibility-row").length, title: { text: '' } }, + yAxis: { min: 0, max: {{ len .Data.Pages }}, title: { text: '' } }, legend: { enabled: false }, plotOptions: { series: { stacking: 'normal' } }, series: [ - {{ range .Site.Data.compatibility }} - { "name": "{{ .name }}", "data": [$(".compatibility-{{ replace (.name | urlize) "/" "" }}").length] }, - {{ end }} + {{- $dataPages := .Data.Pages }} + {{- range .Site.Data.compatibility }} + {{- $dataPagesFiltered := where $dataPages ".Params.compatibility" .key }} + { "name": "{{ .name }}", "data": [ {{ len $dataPagesFiltered }} ] }, + {{- end }} ] }); diff --git a/site/themes/citra-bs-theme/layouts/game/meta.html b/site/themes/citra-bs-theme/layouts/game/meta.html index 011d68b..6ed0000 100644 --- a/site/themes/citra-bs-theme/layouts/game/meta.html +++ b/site/themes/citra-bs-theme/layouts/game/meta.html @@ -1,4 +1,4 @@ -{{- $rating := index .Site.Data.compatibility ( string .Params.compatibility | default "99" ) }} +{{- $rating := index .Site.Data.compatibility .Params.compatibility }} diff --git a/site/themes/citra-bs-theme/layouts/game/single.html b/site/themes/citra-bs-theme/layouts/game/single.html index cd6ec52..1ffcbb1 100644 --- a/site/themes/citra-bs-theme/layouts/game/single.html +++ b/site/themes/citra-bs-theme/layouts/game/single.html @@ -35,7 +35,7 @@ - {{- $rating := index .Site.Data.compatibility ( string .Params.compatibility | default "99" ) }} + {{- $rating := index .Site.Data.compatibility .Params.compatibility }} @@ -72,8 +72,7 @@ {{ if isset .Params "testcases" }} {{ $siteCompatibility := .Site.Data.compatibility }} {{ range .Params.testcases }} - {{ $testcase := . }} - {{ $rating := index $siteCompatibility ( string $testcase.compatibility | default "0" ) }} + {{- $rating := index $siteCompatibility .compatibility }}

Compatibility

@@ -88,9 +87,9 @@
- - - + + +
Status
{{ $rating.name }}

{{ $rating.description }}
{{ dateFormat "January 2, 2006" $testcase.date }}{{ $testcase.author }}{{ $testcase.version }}{{ dateFormat "January 2, 2006" .date }}{{ .author }}{{ .version }}
{{ $rating.name }}