Skip to content

Commit

Permalink
feat: add competition announcement and dynamic problem score
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamerblue committed Dec 17, 2023
1 parent 3ba95fe commit f00cb79
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/common
14 changes: 14 additions & 0 deletions src/pages/competitions/$id/baseSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,19 @@ class CompetitionBaseSettings extends React.Component<Props, State> {
maxSize: 32,
},
},
{
name: 'Announcement (visible to participants, only in competition)',
field: 'announcement',
component: 'richtext',
initialValue: detail?.announcement || '',
rules: [],
contentStyle: { height: '250px' },
uploadTarget: 'asset',
uploadOption: {
prefix: 'competition',
maxSize: 32,
},
},
{
name: 'Hidden',
field: 'hidden',
Expand Down Expand Up @@ -269,6 +282,7 @@ class CompetitionBaseSettings extends React.Component<Props, State> {
isTeam: values.isTeam === 'true',
isRating: values.isRating === 'true',
introduction: values.introduction.toHTML(),
announcement: values.announcement.toHTML(),
hidden: values.hidden === 'true',
};
}
Expand Down
8 changes: 7 additions & 1 deletion src/pages/competitions/$id/overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,13 @@ class CompetitionOverview extends React.Component<Props, State> {
}}
timeSyncInterval={30000}
/>
) : null}
) : (
<div
dangerouslySetInnerHTML={{ __html: xss(detail.announcement) }}
className="content-area"
style={{ marginTop: '15px' }}
/>
)}
</Card>
{timeStatus !== 'Pending' && (
<Card bordered={false} className="list-card">
Expand Down

0 comments on commit f00cb79

Please sign in to comment.