Fix schedule rendering

This commit is contained in:
Vencislav Atanasov 2024-09-21 23:21:09 +03:00
parent b53de67c6f
commit d1788e9e97
2 changed files with 43 additions and 37 deletions

View File

@ -35,42 +35,47 @@ export default function Schedule({
return (<> return (<>
{isLoading && <>Loading... <progress value={loadingProgress} /></>} {isLoading && <>Loading... <progress value={loadingProgress} /></>}
<div className="schedule"> <div className="schedule">
{halls && <table style={{ {header && <>
textAlign: 'center', <table style={{
}}> textAlign: 'center',
<thead> }}>
<tr> <thead>
{header.map(hall => <th key={hall.id}>{hall.name}</th>)} <tr>
</tr> {header.map(hall => <th key={hall.id}>{hall.name}</th>)}
</thead> </tr>
<tbody> </thead>
{rows.map(row => <tr key={row.id}> <tbody>
{row.cells.map(cell => <td key={cell.id} {...cell.attributes}> {rows.map(row => <tr key={row.id}>
<Event {...cell.event} /> {row.cells.map(cell => <td key={cell.id} {...cell.attributes}>
</td>)} <Event {...cell.event} />
</tr>)} </td>)}
</tbody> </tr>)}
<tfoot> </tbody>
<tr> <tfoot>
{header.map(hall => <th key={hall.id}>{hall.name}</th>)} <tr>
</tr> {header.map(hall => <th key={hall.id}>{hall.name}</th>)}
</tfoot> </tr>
</table>} </tfoot>
<div className="separator"/> </table>
{tracks && <table style={{ <div className="separator"/>
textAlign: 'center', </>}
}}> {tracks && <>
<tbody> <table style={{
{Object.entries(tracks).filter(([, track]) => textAlign: 'center',
!isTrackHidden(track) }}>
).map(([trackId, track]) => <tr key={trackId}> <tbody>
<td className={track.css_class}>{track.name[lang]}</td> {Object.entries(tracks).filter(([, track]) =>
</tr>)} !isTrackHidden(track)
{Object.entries(langs).map(([code, name]) => <tr key={code}> ).map(([trackId, track]) => <tr key={trackId}>
<td className={'schedule-'.concat(code)}>{name}</td> <td className={track.css_class}>{track.name[lang]}</td>
</tr>)} </tr>)}
</tbody> {Object.entries(langs).map(([code, name]) => <tr key={code}>
</table>} <td className={'schedule-'.concat(code)}>{name}</td>
</tr>)}
</tbody>
</table>
<div className="separator" />
</>}
{events && tracks && Object.entries(events).map(([eventId, event]) => <section key={eventId} id={'lecture-'.concat(eventId)}> {events && tracks && Object.entries(events).map(([eventId, event]) => <section key={eventId} id={'lecture-'.concat(eventId)}>
<p> <p>
<strong>{event.title}</strong> <strong>{event.title}</strong>
@ -95,7 +100,7 @@ export default function Schedule({
<a href={event.feedback_url}>Submit feedback</a> <a href={event.feedback_url}>Submit feedback</a>
</strong> </strong>
</p> </p>
<hr /> <div className="separator" />
</section>)} </section>)}
{speakers && <> {speakers && <>
<div> <div>

View File

@ -1,5 +1,6 @@
.schedule { .schedule {
table { table {
text-align: center;
width: 100%; width: 100%;
font-size: 0.8em; font-size: 0.8em;
margin: 0 0 3em 0; margin: 0 0 3em 0;