]> git.localhorst.tv Git - alttp.git/commitdiff
small fixes
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 11 Apr 2022 14:29:02 +0000 (16:29 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 11 Apr 2022 14:29:02 +0000 (16:29 +0200)
app/Models/Protocol.php
resources/js/components/protocol/Item.js
resources/js/i18n/de.js
resources/js/i18n/en.js

index 7a90851a706c43b0d0b5e0ce417eb30fdbe6df35..1214de6638962b8489cc537423b6f288528c4484 100644 (file)
@@ -110,7 +110,7 @@ class Protocol extends Model
                $protocol = static::create([
                        'tournament_id' => $tournament->id,
                        'user_id' => $user->id,
                $protocol = static::create([
                        'tournament_id' => $tournament->id,
                        'user_id' => $user->id,
-                       'type' => 'round.create',
+                       'type' => 'round.seed',
                        'details' => [
                                'tournament' => static::tournamentMemo($tournament),
                                'round' => static::roundMemo($round),
                        'details' => [
                                'tournament' => static::tournamentMemo($tournament),
                                'round' => static::roundMemo($round),
index 9fcc7e5c6e09b539b837a2056513714dae8af359..18b04cc7d6b96f5f5408f0af2d1e5cd6407038e2 100644 (file)
@@ -25,6 +25,13 @@ const getEntryDetailsUsername = entry => {
 const getEntryRoundNumber = entry =>
        (entry && entry.details && entry.details.round && entry.details.round.number) || '?';
 
 const getEntryRoundNumber = entry =>
        (entry && entry.details && entry.details.round && entry.details.round.number) || '?';
 
+const getEntryResultComment = entry => {
+       if (!entry || !entry.details || !entry.details.result || !entry.details.result.comment) {
+               return '';
+       }
+       return entry.details.result.comment;
+};
+
 const getEntryResultTime = entry => {
        if (!entry || !entry.details || !entry.details.result) return 'ERROR';
        const result = entry.details.result;
 const getEntryResultTime = entry => {
        if (!entry || !entry.details || !entry.details.result) return 'ERROR';
        const result = entry.details.result;
@@ -44,6 +51,12 @@ const getEntryDescription = entry => {
                                        username: getEntryDetailsUsername(entry),
                                },
                        );
                                        username: getEntryDetailsUsername(entry),
                                },
                        );
+               case 'result.comment': {
+                       const comment = getEntryResultComment(entry);
+                       return <Trans i18nKey={`protocol.description.${entry.type}`}>
+                               <Spoiler>{{comment}}</Spoiler>,
+                       </Trans>;
+               }
                case 'result.report': {
                        const time = getEntryResultTime(entry);
                        return <Trans i18nKey={`protocol.description.${entry.type}`}>
                case 'result.report': {
                        const time = getEntryResultTime(entry);
                        return <Trans i18nKey={`protocol.description.${entry.type}`}>
@@ -52,6 +65,7 @@ const getEntryDescription = entry => {
                }
                case 'round.create':
                case 'round.lock':
                }
                case 'round.create':
                case 'round.lock':
+               case 'round.seed':
                case 'round.unlock':
                        return i18n.t(
                                `protocol.description.${entry.type}`,
                case 'round.unlock':
                        return i18n.t(
                                `protocol.description.${entry.type}`,
@@ -60,7 +74,6 @@ const getEntryDescription = entry => {
                                        number: getEntryRoundNumber(entry),
                                },
                        );
                                        number: getEntryRoundNumber(entry),
                                },
                        );
-               case 'result.comment':
                case 'tournament.lock':
                        return i18n.t(
                                `protocol.description.${entry.type}`,
                case 'tournament.lock':
                        return i18n.t(
                                `protocol.description.${entry.type}`,
index cc98394db01a204ce211b8f84dcf35eb5046236f..92c64f67305c094fc83861f0db564ee030d58bb1 100644 (file)
@@ -139,12 +139,13 @@ export default {
                                        rejected: 'Anmeldung von {{username}} abgelehnt',
                                },
                                result: {
                                        rejected: 'Anmeldung von {{username}} abgelehnt',
                                },
                                result: {
-                                       comment: 'Ergebnis kommentiert: "{{details.result.comment}}"',
+                                       comment: 'Ergebnis kommentiert: <0>{{comment}}</0>',
                                        report: 'Ergebnis von <0>{{time}}</0> eingetragen',
                                },
                                round: {
                                        create: 'Runde #{{number}} hinzugefügt',
                                        lock: 'Runde #{{number}} gesperrt',
                                        report: 'Ergebnis von <0>{{time}}</0> eingetragen',
                                },
                                round: {
                                        create: 'Runde #{{number}} hinzugefügt',
                                        lock: 'Runde #{{number}} gesperrt',
+                                       seed: 'Seed für Runde #{{number}} eingetragen',
                                        unlock: 'Runde #{{number}} entsperrt',
                                },
                                tournament: {
                                        unlock: 'Runde #{{number}} entsperrt',
                                },
                                tournament: {
index cd6dea0c9c723665e97e2744c9439332cbdbd1ec..b361c682d40f31146d59de779a3ab4a85dd64699 100644 (file)
@@ -139,12 +139,13 @@ export default {
                                        rejected: 'Application from {{username}} rejected',
                                },
                                result: {
                                        rejected: 'Application from {{username}} rejected',
                                },
                                result: {
-                                       comment: 'Result commented: "{{details.result.comment}}"',
-                                       report: 'Result of {{time}} reported',
+                                       comment: 'Result commented: <0>{{comment}}</0>',
+                                       report: 'Result of <0>{{time}}</0> reported',
                                },
                                round: {
                                        create: 'Round #{{number}} added',
                                        lock: 'Round #{{number}} locked',
                                },
                                round: {
                                        create: 'Round #{{number}} added',
                                        lock: 'Round #{{number}} locked',
+                                       seed: 'Set seed for round #{{number}}',
                                        unlock: 'Round #{{number}} unlocked',
                                },
                                tournament: {
                                        unlock: 'Round #{{number}} unlocked',
                                },
                                tournament: {