return $this->belongsTo(Tournament::class);
}
+ protected $casts = [
+ 'code' => 'array',
+ ];
+
protected $fillable = [
'tournament_id',
];
--- /dev/null
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Schema::table('rounds', function(Blueprint $table) {
+ $table->text('code');
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::table('rounds', function(Blueprint $table) {
+ $table->dropColumn('code');
+ });
+ }
+};
--- /dev/null
+import PropTypes from 'prop-types';
+import React from 'react';
+import { withTranslation } from 'react-i18next';
+
+import i18n from '../../i18n';
+
+const getIconURL = name => {
+ switch (name) {
+ case 'big-key':
+ case 'blue-boomerang':
+ case 'blue-mail':
+ case 'blue-pendant':
+ case 'blue-potion':
+ case 'bombos':
+ case 'bomb':
+ case 'book':
+ case 'boots':
+ case 'bottle-bee':
+ case 'bottle':
+ case 'bow':
+ case 'bugnet':
+ case 'byrna':
+ case 'cape':
+ case 'compass':
+ case 'crystal':
+ case 'duck':
+ case 'ether':
+ case 'fairy':
+ case 'fighter-shield':
+ case 'fire-rod':
+ case 'fire-shield':
+ case 'flippers':
+ case 'flute':
+ case 'glove':
+ case 'green-mail':
+ case 'green-pendant':
+ case 'green-potion':
+ case 'hammer':
+ case 'heart-container':
+ case 'heart-piece':
+ case 'hookshot':
+ case 'ice-rod':
+ case 'lamp':
+ case 'map':
+ case 'mirror':
+ case 'mirror-shield':
+ case 'mitts':
+ case 'moonpearl':
+ case 'mushroom':
+ case 'powder':
+ case 'quake':
+ case 'red-bomb':
+ case 'red-boomerang':
+ case 'red-mail':
+ case 'red-pendant':
+ case 'red-potion':
+ case 'shovel':
+ case 'silvers':
+ case 'small-key':
+ case 'somaria':
+ return `/item/${name}.png`;
+ default:
+ return '';
+ }
+};
+
+const ZeldaIcon = ({ name }) =>
+<span className="zelda-icon">
+ <img
+ alt={i18n.t(`icon.zelda.${name}`)}
+ src={getIconURL(name)}
+ title={i18n.t(`icon.zelda.${name}`)}
+ />
+</span>;
+
+ZeldaIcon.propTypes = {
+ name: PropTypes.string,
+};
+
+export default withTranslation()(ZeldaIcon);
import PropTypes from 'prop-types';
import React from 'react';
-import { Button } from 'react-bootstrap';
import { withTranslation } from 'react-i18next';
import SeedButton from './SeedButton';
+import SeedCode from './SeedCode';
import List from '../results/List';
import ReportButton from '../results/ReportButton';
-import { maySetSeed, isParticipant } from '../../helpers/permissions';
+import { isParticipant } from '../../helpers/permissions';
import { findParticipant } from '../../helpers/Tournament';
import { withUser } from '../../helpers/UserContext';
import i18n from '../../i18n';
{i18n.t('rounds.date', { date: new Date(round.created_at) })}
</p>
<p className="seed">
+ {round.code ?
+ <SeedCode code={round.code} />
+ : null}
<SeedButton
round={round}
tournament={tournament}
Item.propTypes = {
index: PropTypes.number,
round: PropTypes.shape({
+ code: PropTypes.arrayOf(PropTypes.string),
created_at: PropTypes.string,
seed: PropTypes.string,
}),
--- /dev/null
+import PropTypes from 'prop-types';
+import React from 'react';
+
+import ZeldaIcon from '../common/ZeldaIcon';
+
+const SeedCode = ({ code }) =>
+<span className="seed-code">
+ {code.map((symbol, index) =>
+ <ZeldaIcon key={`${symbol}.${index}`} name={symbol} />
+ )}
+</span>;
+
+SeedCode.propTypes = {
+ code: PropTypes.arrayOf(PropTypes.string),
+};
+
+export default SeedCode;
PendingIcon: 'Ausstehend',
SecondPlaceIcon: 'Zweiter Platz',
ThirdPlaceIcon: 'Dritter Platz',
+ zelda: {
+ 'big-key': 'Big Key',
+ 'blue-boomerang': 'Boomerang',
+ 'blue-mail': 'Blue Mail',
+ 'blue-pendant': 'Pendant of Power',
+ 'blue-potion': 'Blue Potion',
+ bombos: 'Bombos',
+ bomb: 'Bomb',
+ book: 'Book',
+ boots: 'Boots',
+ 'bottle-bee': 'Bee in a Bottle',
+ bottle: 'Bottle',
+ bow: 'Bow',
+ bugnet: 'Bugnet',
+ byrna: 'Cane of Byrna',
+ cape: 'Cape',
+ compass: 'Compass',
+ crystal: 'Crystal',
+ duck: 'Duck',
+ ether: 'Ether',
+ fairy: 'Fairy in a Bottle',
+ 'fighter-shield': 'Fighter Shield',
+ 'fire-rod': 'Fire Rod',
+ 'fire-shield': 'Fire Shield',
+ flippers: 'Flippers',
+ flute: 'Flute',
+ glove: 'Power Glove',
+ 'green-mail': 'Green Mail',
+ 'green-pendant': 'Pendant of Courage',
+ 'green-potion': 'Green Potion',
+ hammer: 'Hammer',
+ 'heart-container': 'Heart Container',
+ 'heart-piece': 'Heart Piece',
+ hookshot: 'Hookshot',
+ 'ice-rod': 'Ice Rod',
+ lamp: 'Lamp',
+ map: 'Map',
+ mirror: 'Mirror',
+ 'mirror-shield': 'Mirror Shield',
+ mitts: 'Titan \'s Mitts',
+ moonpearl: 'Moonpearl',
+ mushroom: 'Mushroom',
+ powder: 'Powder',
+ quake: 'Quake',
+ 'red-bomb': 'Red Bomb',
+ 'red-boomerang': 'Red Boomerang',
+ 'red-mail': 'Red Mail',
+ 'red-pendant': 'Pendant of Wisdom',
+ 'red-potion': 'Red Potion',
+ shovel: 'Shovel',
+ silvers: 'Silvers',
+ 'small-key': 'Small Key',
+ somaria: 'Cane of Somaria',
+ },
},
participants: {
empty: 'Noch keine Teilnehmer eingetragen',
.text-bronze {
color: $bronze;
}
+
+.zelda-icon {
+ display: inline-flex;
+ align-items: center;
+ width: 2em;
+ height: 2em;
+
+ img {
+ margin: auto;
+ max-width: 100%;
+ max-height: 100%;
+ }
+}
.date {
font-size: 125%;
}
+
+ .seed-code {
+ margin: 1rem 0;
+ }
}
}
}
+
+.seed-code {
+ display: flex;
+ flex-direction: row;
+ flex-wrap: nowrap;
+ align-items: center;
+ align-content: center;
+ justify-content: flex-start;
+ gap: 0.5ex;
+}