From: Daniel Karbach Date: Sun, 20 Mar 2022 22:49:17 +0000 (+0100) Subject: show roles in participation table X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=d611bc90eab94fbce54e9e5485f15c20abf1ad31;p=alttp.git show roles in participation table --- diff --git a/resources/js/components/users/Participation.js b/resources/js/components/users/Participation.js index e45fcf6..d0d5d68 100644 --- a/resources/js/components/users/Participation.js +++ b/resources/js/components/users/Participation.js @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; -import { Alert, Button } from 'react-bootstrap'; +import { Alert, Button, Table } from 'react-bootstrap'; import { withTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; @@ -14,16 +14,34 @@ const Participation = ({ user }) => { {i18n.t('users.participationEmpty')} ; } - return
- {user.participation.map(p =>
- -
)} -
; + return + + + + + + + + {user.participation.map(p => + + + )} + +
{i18n.t('participants.tournament')}{i18n.t('participants.roles')}
+ + + {p.roles ? p.roles.map((role, index) => + + {index === 0 ? '' : ', '} + {i18n.t(`participants.roleNames.${role}`)} + + ) : null} +
; }; Participation.propTypes = { diff --git a/resources/js/i18n/de.js b/resources/js/i18n/de.js index 87806b2..9552005 100644 --- a/resources/js/i18n/de.js +++ b/resources/js/i18n/de.js @@ -105,6 +105,12 @@ export default { empty: 'Noch keine Teilnehmer eingetragen', heading: 'Teilnehmer', participant: 'Teilnehmer', + roleNames: { + admin: 'Administrator', + runner: 'Runner', + }, + roles: 'Teilnahme als', + tournament: 'Turnier', score: 'Punktzahl', }, protocol: { diff --git a/resources/js/i18n/en.js b/resources/js/i18n/en.js index 533ba51..24be59f 100644 --- a/resources/js/i18n/en.js +++ b/resources/js/i18n/en.js @@ -105,6 +105,12 @@ export default { empty: 'No participants on record', heading: 'Participants', participant: 'Participant', + roleNames: { + admin: 'Administrator', + runner: 'Runner', + }, + roles: 'Participated as', + tournament: 'Tournament', score: 'Score', }, protocol: {