Skip to content

Commit

Permalink
Events page - info about current semester (#170)
Browse files Browse the repository at this point in the history
* rename archive styles

* add competition info and registration info

* rename event_set for history_events

* add current event information and clickable link for publications

* add links for registration

* change style types

* change style names

* change link for publications to open instead of download
  • Loading branch information
vikibrezinova authored Nov 11, 2023
1 parent 400b105 commit e551af0
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 14 deletions.
59 changes: 49 additions & 10 deletions src/pages/strom/akcie/[[...params]].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,72 @@ const StaticPage: NextPage<CompetitionPageProps> = ({competition, is_rules}) =>
{competition.who_can_participate && <p>Pre koho? {competition.who_can_participate}</p>}
<p>{competition.description}</p>
</div>
{competition.rules && (
<div className={styles.container}>
<div className={styles.actions}>
<div className={styles.mainText}>
{competition.upcoming_or_current_event ? (
<div className={styles.mainText}>
<p>
<b>Nadchádzajúci ročník:</b>
</p>
{competition.upcoming_or_current_event.start && (
<p>Odkedy? {competition.upcoming_or_current_event.start} </p>
)}
{competition.upcoming_or_current_event.end && <p>Dokedy? {competition.upcoming_or_current_event.end}</p>}
{competition.upcoming_or_current_event.publication_set.length > 0 && (
<p>
<Link href={`/api/${competition.upcoming_or_current_event.publication_set[0].file}`}>Pozvánka</Link>
</p>
)}
{competition.upcoming_or_current_event.registration_link && (
<div>
<p>
Registrácia prebieha do:
{competition.upcoming_or_current_event.registration_link.end}
<Link href={competition.upcoming_or_current_event.registration_link.url}>Registračný formulár</Link>
</p>

<p>{competition.upcoming_or_current_event.registration_link.additional_info}</p>
</div>
)}
</div>
) : (
<p>
<b>Nadchádzajúci ročník:</b> Pripravujeme
</p>
)}
</div>

<div className={styles.container}>
<div className={styles.actions}>
<div className={styles.actionButton}>
<RulesLink />
</div>
</div>
)}
</div>

<div className={styles.h2}>
<h2>Archív: </h2>
</div>
{competition.competition_type.name === 'Tábor' ? (
<div className={styles.archiveCamp}>
<div className={styles.archiveWithoutPublications}>
{competition.history_events.map((event) => (
<div key={event.id}>
{competition.name} {event.school_year}
</div>
<Fragment key={event.id}>
<div>
{competition.name + ' '} {event.school_year}
</div>
</Fragment>
))}
</div>
) : (
<div className={styles.archive}>
<div className={styles.archiveWithPublications}>
{competition.history_events.map((event) => (
<Fragment key={event.id}>
<div>
{competition.name} {event.school_year}
</div>
{event.publication_set.map((publication) => (
<div key={publication.id}> {publication.name}</div>
<Link key={publication.id} href={`/api/${publication.file}`}>
{publication.name}
</Link>
))}
</Fragment>
))}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/strom/akcie/competition.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
}
}

.archive{
.archiveWithPublications{
display: grid;
width: 50%;
grid-template-columns: 1fr max-content max-content;
Expand All @@ -60,7 +60,7 @@
}
}

.archiveCamp{
.archiveWithoutPublications{
font-weight: bold;
text-transform: uppercase;
margin-top: 10px;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/strom/akcie/competition.module.scss.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export type Styles = {
actionButton: string
actions: string
archive: string
archiveCamp: string
archiveWithoutPublications: string
archiveWithPublications: string
commentActions: string
container: string
disabled: string
Expand Down

0 comments on commit e551af0

Please sign in to comment.