-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd866e4
commit 32ef681
Showing
5 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/components/Admin/resources/base/flat-page/FlatpageCreate.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {FC} from 'react' | ||
import {NumberInput, required, SimpleForm, TextInput} from 'react-admin' | ||
|
||
import {MyCreate} from '@/components/Admin/custom/MyCreate' | ||
import {SitesCheckboxInput} from '@/components/Admin/custom/SitesCheckboxInput' | ||
|
||
export const FlatpageCreate: FC = () => ( | ||
<MyCreate> | ||
<SimpleForm> | ||
<NumberInput source="id" fullWidth disabled /> | ||
<TextInput source="url" fullWidth validate={required()} /> | ||
<TextInput source="title" fullWidth validate={required()} /> | ||
<TextInput source="content" fullWidth validate={required()} /> | ||
<SitesCheckboxInput source="sites" validate={required()} /> | ||
</SimpleForm> | ||
</MyCreate> | ||
) |
17 changes: 17 additions & 0 deletions
17
src/components/Admin/resources/base/flat-page/FlatpageEdit.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {FC} from 'react' | ||
import {NumberInput, required, SimpleForm, TextInput} from 'react-admin' | ||
|
||
import {MyEdit} from '@/components/Admin/custom/MyEdit' | ||
import {SitesCheckboxInput} from '@/components/Admin/custom/SitesCheckboxInput' | ||
|
||
export const FlatpageEdit: FC = () => ( | ||
<MyEdit> | ||
<SimpleForm> | ||
<NumberInput source="id" fullWidth disabled /> | ||
<TextInput source="url" fullWidth validate={required()} /> | ||
<TextInput source="title" fullWidth validate={required()} /> | ||
<TextInput source="content" fullWidth validate={required()} /> | ||
<SitesCheckboxInput source="sites" validate={required()} /> | ||
</SimpleForm> | ||
</MyEdit> | ||
) |
19 changes: 19 additions & 0 deletions
19
src/components/Admin/resources/base/flat-page/FlatpageList.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {FC} from 'react' | ||
import {BooleanField, Datagrid, List, NumberField, TextField} from 'react-admin' | ||
|
||
import {SitesArrayField} from '@/components/Admin/custom/SitesArrayField' | ||
import {TruncatedTextField} from '@/components/Admin/custom/TruncatedTextField' | ||
|
||
export const FlatpageList: FC = () => ( | ||
<List> | ||
<Datagrid rowClick="show"> | ||
<NumberField source="id" /> | ||
<TextField source="url" /> | ||
<TextField source="title" /> | ||
<TruncatedTextField source="content" maxTextWidth={30} /> | ||
<BooleanField source="enable_comments" /> | ||
<BooleanField source="registration_required" /> | ||
<SitesArrayField source="sites" /> | ||
</Datagrid> | ||
</List> | ||
) |
20 changes: 20 additions & 0 deletions
20
src/components/Admin/resources/base/flat-page/FlatpageShow.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {FC} from 'react' | ||
import {BooleanField, NumberField, Show, SimpleShowLayout, TextField} from 'react-admin' | ||
|
||
import {MyShowActions} from '@/components/Admin/custom/MyShowActions' | ||
import {SitesArrayField} from '@/components/Admin/custom/SitesArrayField' | ||
import {TruncatedTextField} from '@/components/Admin/custom/TruncatedTextField' | ||
|
||
export const FlatpageShow: FC = () => ( | ||
<Show actions={<MyShowActions />}> | ||
<SimpleShowLayout> | ||
<NumberField source="id" /> | ||
<TextField source="url" /> | ||
<TextField source="title" /> | ||
<TruncatedTextField source="content" maxTextWidth={200} expandable /> | ||
<BooleanField source="enable_comments" /> | ||
<BooleanField source="registration_required" /> | ||
<SitesArrayField source="sites" /> | ||
</SimpleShowLayout> | ||
</Show> | ||
) |