citra-emu
/
citra-web
Archived
1
0
Fork 0
This repository has been archived on 2024-03-23. You can view files and clone it, but cannot push or open issues or pull requests.
citra-web/site/themes/citra-bs-theme/layouts/game/list.html

181 lines
5.3 KiB
HTML
Raw Normal View History

2017-06-03 22:00:44 +00:00
{{ define "main" }}
2017-06-03 23:19:19 +00:00
<h1>Game Compatibility List</h1>
<p>The Citra Emulator compatibility list contains all the games we tested, sorted by how well they work on the emulator.</p>
2017-06-04 18:06:33 +00:00
<table class="table table-striped table-bordered">
2017-06-03 23:19:19 +00:00
<tbody>
2017-06-11 12:38:58 +00:00
{{ range .Site.Data.compatibility }}
<tr>
2017-06-11 12:38:58 +00:00
<td style="width: 120px;"><div class="square-icon" style="background-color: {{ .color }}"></div> {{ .name }}</td>
<td class="row-compat-desc">{{ .description }}</td>
</tr>
{{ end }}
2017-06-03 23:19:19 +00:00
</tbody>
</table>
<div id="highchart-container" style="height: 100px; margin: 0 auto"></div>
2017-06-11 12:38:58 +00:00
<hr />
<div id="game-listing">
<div>
<form class="pull-right">
<div class="form-group">
<table>
<tr>
<td>
<div class="input-group search-box">
2017-07-25 01:16:08 +00:00
<input type="text" class="form-control search" id="search-box" placeholder="Search...">
<span class="clear-search input-group-addon">X</span>
</div>
</td>
</tr>
</table>
</div>
</form>
2017-06-11 12:38:58 +00:00
</div>
<ul class="pagination paginationTop pull-left"></ul>
2017-06-11 12:38:58 +00:00
<table id="compatibility-list" class="table table-responsive">
<thead>
<tr>
<th></th>
<th class="sort" data-sort="title">Title</th>
<th class="sort" data-sort="type">Type</th>
<th class="sort" data-sort="compatibility">Compatibility</th>
<th class="sort" data-sort="date-tested">Date Tested</th>
</tr>
</thead>
<tbody class="list">
{{ range .Pages }}
2017-07-18 23:10:57 +00:00
{{- $rating := index .Site.Data.compatibility .Params.compatibility }}
{{- $type := index .Site.Data.gameTypes (.Params.game_type | default "3ds") }}
<tr data-key="{{ .Params.section_id }}">
<td class="hidden listing-metadata">
2019-03-30 16:35:00 +00:00
<span>{{ .Params.title }} {{ $type.name }} {{ $rating.name }}</span>
</td>
<td class="col-md-1 icon">
2019-08-07 23:35:27 +00:00
{{ if (fileExists (print "static/images/game/icons/" .File.BaseFileName ".png")) }}
<img src="/images/game/icons/{{ .File.BaseFileName }}.png" />
{{ end }}
</td>
<td class="col-md-6 title" data-title="{{ strings.TrimPrefix "The " .Params.title }}">
<a href="{{ .Permalink }}">{{ .Params.title }}</a>
</td>
2017-07-18 23:21:09 +00:00
<td class="col-md-1 type" data-type="{{ $type.name }}">
<img src="/images/game/types/{{ $type.key }}.png" title="{{ $type.name }}" />
</td>
2017-07-18 23:21:09 +00:00
<td class="col-md-1 compatibility" data-compatibility="{{ $rating.key }}">
2017-07-18 23:10:57 +00:00
<div class="square-icon" style="background-color: {{ $rating.color }}"></div> <span>{{ $rating.name }}</span>
</td>
2017-07-18 23:21:09 +00:00
<td class="col-md-3 date-tested" data-timestamp="{{ .Params.testcase_date }}">
2019-03-30 16:35:00 +00:00
{{ if .Params.testcase_date }}
<span>{{ dateFormat "January 2, 2006" .Params.testcase_date }}</span>
{{ else }}
<span></span>
{{ end }}
</td>
</tr>
{{ end }}
</tbody>
</table>
<ul class="pagination paginationBottom pull-left"></ul>
</div>
2017-06-03 22:00:44 +00:00
{{ end }}
{{ define "scripts" }}
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script type="text/javascript">
$(function() {
function getLastSorted(list){
var currentSorted = $(list.listContainer).find(".asc, .desc").attr("data-sort");
if ('undefined' !== typeof currentSorted)
list.lastSorted = currentSorted;
return list.lastSorted;
}
function filterTable(_) {
var rating = this.name;
var index = this.index;
$("#search-box").val(rating);
list.search(index, ['compatibility']);
}
function clearSearch() {
$("#search-box").val("");
list.search();
}
var options = {
valueNames: [
'listing-metadata',
{ name: 'title', attr: 'data-title' },
{ name: 'type', attr: 'data-type' },
{ name: 'compatibility', attr: 'data-compatibility' },
{ name: 'date-tested', attr: 'data-timestamp' }
],
searchColumns: [ 'listing-metadata' ],
pagination: [
{ paginationClass: "paginationTop" },
{ paginationClass: "paginationBottom" }
],
indexAsync: true,
page: 50
};
var list = new List('game-listing', options);
list.sort("title", {order: "asc"});
list.on("updated", function(list){
var $list = $(list.list);
var $items = $list.children();
$items.removeClass("key");
if ('title' == getLastSorted(list)){
$items.each(function(){
var key = $(this).attr("data-key")
if (
$list
.children("[data-key='" + key + "']")
.first()
.is( $(this) )
){
$(this).addClass("key");
}
})
}
});
$('#game-listing .clear-search').click(clearSearch);
Highcharts.chart('highchart-container', {
chart: { type: 'bar' },
colors: [{{ range .Site.Data.compatibility }}"{{ .color }}", {{- end }}],
credits: { enabled: false },
exporting: { enabled: false },
title: { text: '' },
xAxis: { categories: [''] },
yAxis: { min: 0, max: {{ len .Data.Pages }}, title: { text: '' } },
legend: { enabled: false },
plotOptions: { series: {
stacking: 'normal',
cursor: 'pointer',
events: {
click: filterTable
}
} },
series: [
{{- $dataPages := .Data.Pages }}
{{- range .Site.Data.compatibility }}
{{- $dataPagesFiltered := where $dataPages ".Params.compatibility" .key }}
{ "name": "{{ .name }}", "data": [ {{ len $dataPagesFiltered }} ] },
{{- end }}
]
});
});
</script>
{{ end }}