From b27a83336ff215aa7a0eef55e39b9af36d7547ab Mon Sep 17 00:00:00 2001
From: Daniel Karbach
Date: Wed, 9 Nov 2022 09:38:13 +0100
Subject: [PATCH] show number of results for open asyncs
---
resources/js/components/rounds/Item.js | 6 ++++++
resources/js/i18n/de.js | 2 ++
resources/js/i18n/en.js | 2 ++
3 files changed, 10 insertions(+)
diff --git a/resources/js/components/rounds/Item.js b/resources/js/components/rounds/Item.js
index 3197f6d..817069f 100644
--- a/resources/js/components/rounds/Item.js
+++ b/resources/js/components/rounds/Item.js
@@ -73,6 +73,9 @@ const Item = ({
/>
: null}
+ {tournament.type === 'open-async' && round.results && round.results.length ?
+ {i18n.t('rounds.numberOfResults', { count: round.results.length })}
+ : null}
{mayEditRound(user, tournament, round) ?
@@ -91,12 +94,15 @@ Item.propTypes = {
game: PropTypes.string,
locked: PropTypes.bool,
number: PropTypes.number,
+ results: PropTypes.arrayOf(PropTypes.shape({
+ })),
seed: PropTypes.string,
title: PropTypes.string,
}),
tournament: PropTypes.shape({
participants: PropTypes.arrayOf(PropTypes.shape({
})),
+ type: PropTypes.string,
}),
user: PropTypes.shape({
}),
diff --git a/resources/js/i18n/de.js b/resources/js/i18n/de.js
index ace2f3d..5717413 100644
--- a/resources/js/i18n/de.js
+++ b/resources/js/i18n/de.js
@@ -434,6 +434,8 @@ export default {
heading: 'Runden',
new: 'Neue Runde',
noSeed: 'Noch kein Seed',
+ numberOfResults: '{{ count }} Ergebniss',
+ numberOfResults_plural: '{{ count }} Ergebnisse',
lock: 'Runde sperren',
lockDescription: 'Wenn die Runde gesperrt wird, können Runner keine Ãnderungen an ihrem Ergebnis mehr vornehmen.',
locked: 'Die Runde ist für weitere Ãnderungen am Ergebnis gesperrt.',
diff --git a/resources/js/i18n/en.js b/resources/js/i18n/en.js
index 9bd5213..ab70e38 100644
--- a/resources/js/i18n/en.js
+++ b/resources/js/i18n/en.js
@@ -434,6 +434,8 @@ export default {
heading: 'Rounds',
new: 'New round',
noSeed: 'No seed set',
+ numberOfResults: '{{ count }} submission',
+ numberOfResults_plural: '{{ count }} submissions',
lock: 'Lock round',
lockDescription: 'When a round is locked, runners cannot submit or change results.',
locked: 'Results for this round have been locked.',
--
2.39.2