From d611bc90eab94fbce54e9e5485f15c20abf1ad31 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Sun, 20 Mar 2022 23:49:17 +0100 Subject: [PATCH 1/1] show roles in participation table --- .../js/components/users/Participation.js | 40 ++++++++++++++----- resources/js/i18n/de.js | 6 +++ resources/js/i18n/en.js | 6 +++ 3 files changed, 41 insertions(+), 11 deletions(-) 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: { -- 2.39.2