]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/protocol/Item.js
allow admins to lock/unlock rounds
[alttp.git] / resources / js / components / protocol / Item.js
index 3337d04621cbd4ae7380c2f0fb880e7ee8535145..3b16eeb11c9da1307a9f7b142affaba2e89c7060 100644 (file)
@@ -16,6 +16,9 @@ const getEntryDate = entry => {
                : dateStr;
 };
 
+const getEntryRoundNumber = entry =>
+       (entry && entry.details && entry.details.round && entry.details.round.number) || '?';
+
 const getEntryResultTime = entry => {
        if (!entry || !entry.details || !entry.details.result) return 'ERROR';
        const result = entry.details.result;
@@ -33,6 +36,14 @@ const getEntryDescription = entry => {
                }
                case 'round.create':
                case 'round.lock':
+               case 'round.unlock':
+                       return i18n.t(
+                               `protocol.description.${entry.type}`,
+                               {
+                                       ...entry,
+                                       number: getEntryRoundNumber(entry),
+                               },
+                       );
                case 'tournament.lock':
                        return i18n.t(
                                `protocol.description.${entry.type}`,