fix card info layout & test code

Closes #1479

Related: #1470
This commit is contained in:
Damien Elmes 2021-11-12 16:18:19 +10:00
parent f40d3a299f
commit d668ac8f7f
2 changed files with 10 additions and 12 deletions

View file

@ -3,7 +3,6 @@ Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="ts">
import Container from "../components/Container.svelte";
import * as tr2 from "../lib/ftl";
import { Stats, unwrapOptionalNumber } from "../lib/proto";
import { Timestamp, timeSpan, DAY } from "../lib/time";
@ -95,16 +94,14 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
$: statsRows = rowsFromStats(stats);
</script>
<Container>
<table class="stats-table">
{#each statsRows as row, _index}
<tr>
<th style="text-align:start">{row.label}</th>
<td>{row.value}</td>
</tr>
{/each}
</table>
</Container>
<table class="stats-table">
{#each statsRows as row, _index}
<tr>
<th style="text-align:start">{row.label}</th>
<td>{row.value}</td>
</tr>
{/each}
</table>
<style>
.stats-table {

View file

@ -15,7 +15,8 @@
// use #testXXXX where XXXX is card ID to test
if (window.location.hash.startsWith("#test")) {
const cid = parseInt(window.location.hash.substr("#test".length), 10);
anki.cardInfo(document.getElementById("main"), cid, true);
const cardInfo = anki.cardInfo(document.getElementById("main"));
cardInfo.then((c) => c.$set({ cardId: cid, includeRevlog: true }));
}
</script>
</body>