Skip to content

Commit

Permalink
Added tab labels
Browse files Browse the repository at this point in the history
  • Loading branch information
vgeffer committed Nov 24, 2024
1 parent e14cde0 commit 0fe7dbb
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import {SitesCheckboxInput} from '@/components/Admin/custom/SitesCheckboxInput'
export const FlatpageCreate: FC = () => (
<MyCreate>
<TabbedForm>
<FormTab label="general">
<FormTab label="content.labels.general">
<NumberInput source="id" fullWidth disabled />
<TextInput source="url" fullWidth validate={required()} />
<TextInput source="title" fullWidth validate={required()} />
<TextInput source="content" multiline fullWidth validate={required()} />
<SitesCheckboxInput source="sites" validate={required()} />
</FormTab>
<FormTab label="preview">
<FormTab label="content.labels.preview">
<FlatpagePreview />
</FormTab>
</TabbedForm>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import {SitesCheckboxInput} from '@/components/Admin/custom/SitesCheckboxInput'
export const FlatpageEdit: FC = () => (
<MyEdit>
<TabbedForm>
<FormTab label="general">
<FormTab label="content.labels.general">
<NumberInput source="id" fullWidth disabled />
<TextInput source="url" fullWidth validate={required()} />
<TextInput source="title" fullWidth validate={required()} />
<TextInput source="content" multiline fullWidth validate={required()} />
<SitesCheckboxInput source="sites" validate={required()} />
</FormTab>
<FormTab label="preview">
<FormTab label="content.labels.preview">
<FlatpagePreview />
</FormTab>
</TabbedForm>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Admin/resources/cms/post/PostCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const PostCreate: FC = () => {
return (
<MyCreate>
<TabbedForm>
<FormTab label="general">
<FormTab label="content.labels.general">
<TextInput source="caption" fullWidth validate={required()} />
<TextInput source="short_text" fullWidth validate={maxLength(200, 'Text musí mať najviac 200 znakov.')} />
<TextInput source="details" multiline fullWidth />
Expand All @@ -19,15 +19,15 @@ export const PostCreate: FC = () => {
<MyDateTimeInput source="visible_until" fullWidth validate={required()} />
<SitesCheckboxInput source="sites" validate={required()} />
</FormTab>
<FormTab label="links">
<FormTab label="content.labels.links">
<ArrayInput source="links" defaultValue={[]}>
<SimpleFormIterator>
<TextInput source="caption" fullWidth validate={required()} />
<TextInput source="url" fullWidth validate={required()} />
</SimpleFormIterator>
</ArrayInput>
</FormTab>
<FormTab label="preview">
<FormTab label="content.labels.preview">
<PostPreview />
</FormTab>
</TabbedForm>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Admin/resources/cms/post/PostEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {SitesCheckboxInput} from '@/components/Admin/custom/SitesCheckboxInput'
export const PostEdit: FC = () => (
<MyEdit>
<TabbedForm>
<FormTab label="controls.test">
<FormTab label="content.labels.general">
<TextInput source="caption" fullWidth validate={required()} />
<TextInput source="short_text" fullWidth validate={maxLength(200, 'Text musí mať najviac 200 znakov.')} />
<TextInput source="details" multiline fullWidth />
Expand All @@ -18,15 +18,15 @@ export const PostEdit: FC = () => (
<MyDateTimeInput source="visible_until" fullWidth validate={required()} />
<SitesCheckboxInput source="sites" validate={required()} />
</FormTab>
<FormTab label="links">
<FormTab label="content.labels.links">
<ArrayInput source="links" defaultValue={[]}>
<SimpleFormIterator>
<TextInput source="caption" fullWidth validate={required()} />
<TextInput source="url" fullWidth validate={required()} />
</SimpleFormIterator>
</ArrayInput>
</FormTab>
<FormTab label="preview">
<FormTab label="content.labels.preview">
<PostPreview />
</FormTab>
</TabbedForm>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Admin/resources/cms/post/PostShow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {SitesArrayField} from '@/components/Admin/custom/SitesArrayField'
export const PostShow: FC = () => (
<Show actions={<MyShowActions />}>
<TabbedShowLayout>
<Tab label="general">
<Tab label="content.labels.general">
<SimpleShowLayout>
<TextField source="caption" />
<TextField source="short_text" />
Expand All @@ -19,7 +19,7 @@ export const PostShow: FC = () => (
<SitesArrayField source="sites" />
</SimpleShowLayout>
</Tab>
<Tab label="links">
<Tab label="content.labels.links">
<SimpleShowLayout>
<ArrayField source="links">
<Datagrid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {UpcomingOrCurrentEvent} from './UpcomingOrCurrentEvent'
export const CompetitionShow: FC = () => (
<MyShow>
<TabbedShowLayout>
<Tab label="general">
<Tab label="content.labels.general">
<SimpleShowLayout>
<TextField source="name" />
<TextField source="slug" />
Expand All @@ -38,7 +38,7 @@ export const CompetitionShow: FC = () => (
<UpcomingOrCurrentEvent />
</SimpleShowLayout>
</Tab>
<Tab label="history_events">
<Tab label="content.labels.history_events">
<SimpleShowLayout>
<ArrayField source="history_events">
<Datagrid rowClick={(id) => `/competition/event/${id}/show`}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {MyShow} from '@/components/Admin/custom/MyShow'
export const EventShow: FC = () => (
<MyShow>
<TabbedShowLayout>
<Tab label="general">
<Tab label="content.labels.general">
<SimpleShowLayout>
<ReferenceField source="competition" reference="competition/competition" link="show" />
<NumberField source="year" />
Expand All @@ -33,7 +33,7 @@ export const EventShow: FC = () => (
<TextField source="registration_link.additional_info" />
</SimpleShowLayout>
</Tab>
<Tab label="publications">
<Tab label="content.labels.publications">
<SimpleShowLayout>
<ArrayField source="publication_set">
<Datagrid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const ProblemCreate: FC = () => (
}}
>
<TabbedForm>
<FormTab label="general">
<FormTab label="content.labels.general">
<ReferenceInput source="series" reference="competition/series">
<SelectInput fullWidth validate={required()} />
</ReferenceInput>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const ProblemEdit: FC = () => (
}}
>
<TabbedForm>
<FormTab label="general">
<FormTab label="content.labels.general">
<ReferenceInput source="series" reference="competition/series">
<SelectInput fullWidth validate={required()} />
</ReferenceInput>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const SemesterEdit: FC = () => (
}}
>
<TabbedForm>
<FormTab label="general">
<FormTab label="content.labels.general">
<ReferenceInput source="competition" reference="competition/competition">
<SelectInput fullWidth validate={required()} />
</ReferenceInput>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {seasonCodeStrings} from './seasonCodeStrings'
export const SemesterShow: FC = () => (
<MyShow>
<TabbedShowLayout>
<Tab label="general">
<Tab label="content.labels.general">
<SimpleShowLayout>
<ReferenceField source="competition" reference="competition/competition" link="show" />
<NumberField source="year" />
Expand All @@ -40,7 +40,7 @@ export const SemesterShow: FC = () => (
<NumberField source="registration_link" />
</SimpleShowLayout>
</Tab>
<Tab label="series">
<Tab label="content.labels.series">
<SimpleShowLayout>
<ArrayField source="series_set">
<Datagrid rowClick={(id) => `/competition/series/${id}/show`}>
Expand All @@ -55,7 +55,7 @@ export const SemesterShow: FC = () => (
</ArrayField>
</SimpleShowLayout>
</Tab>
<Tab label="publications">
<Tab label="content.labels.publications">
<SimpleShowLayout>
<ArrayField source="publication_set">
<Datagrid>
Expand All @@ -70,7 +70,7 @@ export const SemesterShow: FC = () => (
</ArrayField>
</SimpleShowLayout>
</Tab>
<Tab label="late tags">
<Tab label="content.labels.late_tags">
<SimpleShowLayout>
<ReferenceArrayField source="late_tags" reference="competition/late-tag">
<Datagrid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {MyDateTimeInput} from '@/components/Admin/custom/MyDateTimeInput'
export const SeriesCreate: FC = () => (
<MyCreate>
<TabbedForm>
<FormTab label="general">
<FormTab label="content.labels.general">
<ReferenceInput source="semester" reference="competition/semester">
<SelectInput fullWidth validate={required()} />
</ReferenceInput>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const SeriesEdit: FC = () => (
}}
>
<TabbedForm>
<FormTab label="general">
<FormTab label="content.labels.general">
<ReferenceInput source="semester" reference="competition/semester">
<SelectInput fullWidth validate={required()} />
</ReferenceInput>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ import {TruncatedTextField} from '@/components/Admin/custom/TruncatedTextField'
export const SeriesShow: FC = () => (
<MyShow>
<TabbedShowLayout>
<Tab label="general">
<Tab label="content.labels.general">
<SimpleShowLayout>
<ReferenceField source="semester" reference="competition/semester" link="show" />
<DateTimeField source="deadline" />
<TextField source="order" />
<BooleanField source="complete" />
</SimpleShowLayout>
</Tab>
<Tab label="problems">
<Tab label="content.labels.problems">
<SimpleShowLayout>
<ArrayField source="problems">
<Datagrid>
Expand Down
11 changes: 10 additions & 1 deletion src/components/Admin/translations/sk_SK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,16 @@ export const sk_SK = {
},

content: {
labels: {},
labels: {
general: 'Generala',
preview: 'Náhľad',
links: 'Odkazy',
publications: 'Publikácie',
series: 'Série',
late_tags: 'Late_tags',
problems: 'Úlohy',
history_events: 'History_Events',
},
footer: {
timezone_message: 'Všetky časy sú uvedené v časovom pásme Europe/Bratislava',
},
Expand Down

0 comments on commit 0fe7dbb

Please sign in to comment.