feat: add lock picto and hide team on register admin + show registration information on user page
This commit is contained in:
parent
b419e2f58d
commit
78d22b466d
@ -322,6 +322,7 @@ public class CompetitionService {
|
||||
return uni
|
||||
.call(l -> Mutiny.fetch(c.getGuests())
|
||||
.onItem().transformToMulti(Multi.createFrom()::iterable)
|
||||
.filter(g -> !g.isTeam())
|
||||
.onItem().call(guest -> Mutiny.fetch(guest.getCategoriesInscrites()))
|
||||
.map(guest -> SimpleRegisterComb.fromModel(guest)
|
||||
.setCategorieInscrite(guest.getCategoriesInscrites()))
|
||||
|
||||
@ -558,6 +558,7 @@
|
||||
"validée": "Validated",
|
||||
"voir/modifierLesParticipants": "View/Edit participants",
|
||||
"voirLesStatues": "View statues",
|
||||
"vousNêtesPasEncoreInscrit": "You are not yet registered or your registration has not yet been entered on the intranet",
|
||||
"à": "at",
|
||||
"étatDeLaDemande": "Request status"
|
||||
}
|
||||
|
||||
@ -558,6 +558,7 @@
|
||||
"validée": "Validée",
|
||||
"voir/modifierLesParticipants": "Voir/Modifier les participants",
|
||||
"voirLesStatues": "Voir les statues",
|
||||
"vousNêtesPasEncoreInscrit": "Vous n'êtes pas encore inscrit ou votre inscription n'a pas encore été rentrée sur l'intranet",
|
||||
"à": "à",
|
||||
"étatDeLaDemande": "État de la demande"
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@ import {apiAxios, applyOverCategory, CatList, getCatName, getToastMessage} from
|
||||
import {toast} from "react-toastify";
|
||||
import {SimpleReducer} from "../../utils/SimpleReducer.jsx";
|
||||
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
|
||||
import {faAdd, faGavel, faTrashCan} from "@fortawesome/free-solid-svg-icons";
|
||||
import {faAdd, faGavel, faLock, faTrashCan} from "@fortawesome/free-solid-svg-icons";
|
||||
import "./CompetitionRegisterAdmin.css"
|
||||
import * as XLSX from "xlsx-js-style";
|
||||
import {useCountries} from "../../hooks/useCountries.jsx";
|
||||
@ -67,7 +67,7 @@ export function CompetitionRegisterAdmin({source}) {
|
||||
data={state.filter(s => (clubFilter.length === 0 || s.data.club.name === clubFilter)
|
||||
&& (catAgeFilter.length === 0 || s.data.categorie === catAgeFilter)
|
||||
&& (catFilter === -1 || s.data.categoriesInscrites.includes(catFilter)))}
|
||||
dispatch={dispatch} id={id} setModalState={setModalState} source={source}/>
|
||||
data2={data2} dispatch={dispatch} id={id} setModalState={setModalState} source={source}/>
|
||||
</div> : error ? <AxiosError error={error}/> : <Def/>}
|
||||
</div>
|
||||
<div className="col-lg-3">
|
||||
@ -132,7 +132,7 @@ function QuickAdd({sendRegister, source, data2, error2}) {
|
||||
<label htmlFor="inputState2" className="form-label align-self-center" style={{margin: "0 0.5em 0 0"}}>
|
||||
{t('catégorieàAjouter')}<br/> <small>({t('siDisponiblePourLaCatégorieDages')})</small>
|
||||
</label>
|
||||
<CategoriesList error2={error2} availableCats={data2.sort((a, b) => a.name.localeCompare(b.name))} categories={categories}
|
||||
<CategoriesList error2={error2} availableCats={data2?.sort((a, b) => a.name.localeCompare(b.name))} categories={categories}
|
||||
setCategories={setCategories_}/>
|
||||
</div>
|
||||
|
||||
@ -590,7 +590,7 @@ function FiltreBar({data, data2, clubFilter, setClubFilter, catFilter, setCatFil
|
||||
</div>
|
||||
}
|
||||
|
||||
function MakeCentralPanel({data, dispatch, id, setModalState, source}) {
|
||||
function MakeCentralPanel({data, data2, dispatch, id, setModalState, source}) {
|
||||
const [searchParams] = useSearchParams();
|
||||
const registerType = searchParams.get("type") || "FREE";
|
||||
const {t} = useTranslation();
|
||||
@ -610,14 +610,22 @@ function MakeCentralPanel({data, dispatch, id, setModalState, source}) {
|
||||
<div className="row">
|
||||
<span className="col-auto">{req.data.licence ? String(req.data.licence).padStart(5, '0') : "-------"}</span>
|
||||
<div className="ms-2 col-auto">
|
||||
<div><strong>{req.data.fname} {req.data.lname}</strong> <small>{req.data.genre}</small></div>
|
||||
<div><strong>{req.data.fname} {req.data.lname}</strong> <small>{req.data.lockEdit &&
|
||||
<FontAwesomeIcon icon={faLock} style={{color: "#e40101",}}/>}{req.data.genre}</small></div>
|
||||
<small>{req.data.club?.name || t("club", {count: 0})}</small>
|
||||
</div>
|
||||
</div>
|
||||
<div className="row">
|
||||
<div className="col-auto" style={{textAlign: "right"}}>
|
||||
<small>{t("comp.surclassement", {count: req.data.overCategory, cat: getCatName(req.data.categorie)})}<br/>
|
||||
{req.data.weight ? req.data.weight : "---"} kg
|
||||
<small>{t("comp.surclassement", {
|
||||
count: req.data.overCategory,
|
||||
cat: getCatName(req.data.categorie)
|
||||
})} | {req.data.weight ? req.data.weight : "---"} kg</small>
|
||||
<br/>
|
||||
<small>
|
||||
{req.data.categoriesInscrites.map(catId => data2?.find(c => c.id === catId)).filter(o => o !== undefined)
|
||||
.sort((a, b) => a.name.localeCompare(b.name)).map(cat =>
|
||||
<span key={cat.id} className="badge text-bg-secondary" style={{margin: "0 0.125em"}}>{cat.name}</span>)}
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -74,8 +74,8 @@ function MakeContent({data}) {
|
||||
disabled={new Date() < new Date(data.startRegister.split('+')[0]) || new Date() > new Date(data.endRegister.split('+')[0])}
|
||||
onClick={_ => navigate("/competition/" + data.id + "/club/register")}>{t('comp.inscription')}</button>
|
||||
}
|
||||
{data.registerMode === "FREE" && !isClubAdmin(userinfo) &&
|
||||
<SelfRegister data2={data}/>
|
||||
{data.registerMode === "FREE" && !isClubAdmin(userinfo) && <SelfRegister/>
|
||||
|| <ShowRegister/>
|
||||
}
|
||||
{data.registerMode === "HELLOASSO" &&
|
||||
<p><strong>{t('comp.billetterie')} :</strong> <a
|
||||
@ -207,6 +207,40 @@ function SelfRegister({data2}) {
|
||||
</>
|
||||
}
|
||||
|
||||
function ShowRegister() {
|
||||
const {id} = useParams()
|
||||
const setLoading = useLoadingSwitcher()
|
||||
const {data, error} = useFetch(`/competition/${id}/register/user`, setLoading, 1)
|
||||
const {data: data3, error: error2} = useFetch(`/competition/${id}/categories`, setLoading, 1)
|
||||
const {t} = useTranslation();
|
||||
|
||||
|
||||
return <>
|
||||
{data ? data.length > 0
|
||||
? <div style={{textAlign: "right", maxWidth: "30em"}}>
|
||||
<h4 style={{textAlign: "left"}}>{t('comp.monInscription')}</h4>
|
||||
<div style={{textAlign: "left"}}>{t('comp.catégorieNormalisée')} : {getCatName(data[0].categorie)}</div>
|
||||
<div style={{textAlign: "left"}}>{t('comp.modal.surclassement')} :
|
||||
{data[0].overCategory === 0 && ` ${t('aucun')}`}
|
||||
{data[0].overCategory === 1 && ` ${t('1Catégorie')}`}
|
||||
{data[0].overCategory === 2 && ` ${t('2Catégorie')}`}
|
||||
</div>
|
||||
<div style={{textAlign: "left"}}>{t("comp.modal.poids")} : {data[0].weight}</div>
|
||||
<div style={{textAlign: "left"}}>{t('catégorie')} :
|
||||
{error2 ? <AxiosError error={error2}/> : <>
|
||||
{data3 && data3.length === 0 && <div>{t('aucuneCatégorieDisponible')}</div>}
|
||||
{data3 && data3.filter(c => data[0].categoriesInscrites.includes(c.id)).sort((a, b) => a.name.localeCompare(b.name)).map(cat =>
|
||||
<span key={cat.id} className="badge text-bg-secondary" style={{margin: "0 0.25em"}}>{cat.name}</span>)}
|
||||
</>}
|
||||
</div>
|
||||
</div> : <span>{t('vousNêtesPasEncoreInscrit')}</span>
|
||||
: error
|
||||
? <AxiosError error={error}/>
|
||||
: <Def/>
|
||||
}
|
||||
</>
|
||||
}
|
||||
|
||||
function Def() {
|
||||
return <div className="list-group">
|
||||
<li className="list-group-item"><ThreeDots/></li>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user