Translate room info

Change-Id: I7f3121da3c910592ecfcb4bca9dee34f2757f567
This commit is contained in:
Michael Albert 2020-05-25 21:22:04 +02:00
parent f6ca169fbc
commit a4662c2557
3 changed files with 46 additions and 2 deletions

View File

@ -9,6 +9,7 @@ import {
Pagination, Pagination,
ReferenceArrayField, ReferenceArrayField,
ReferenceArrayInput, ReferenceArrayInput,
SelectField,
Show, Show,
Tab, Tab,
TabbedForm, TabbedForm,
@ -145,6 +146,7 @@ const RoomTitle = ({ record }) => {
</span> </span>
); );
}; };
export const RoomShow = props => ( export const RoomShow = props => (
<Show {...props} title={<RoomTitle />}> <Show {...props} title={<RoomTitle />}>
<TabbedShowLayout> <TabbedShowLayout>
@ -152,14 +154,29 @@ export const RoomShow = props => (
<TextField source="id" disabled /> <TextField source="id" disabled />
<TextField source="name" /> <TextField source="name" />
<TextField source="canonical_alias" /> <TextField source="canonical_alias" />
<TextField source="join_rules" /> <SelectField
<TextField source="guest_access" /> source="join_rules"
choices={[
{ id: 'public', name: 'resources.rooms.enums.join_rules.public' },
{ id: 'knock', name: 'resources.rooms.enums.join_rules.knock' },
{ id: 'invite', name: 'resources.rooms.enums.join_rules.invite' },
{ id: 'private', name: 'resources.rooms.enums.join_rules.private' },
]}
/>
<SelectField
source="guest_access"
choices={[
{ id: 'can_join', name: 'resources.rooms.enums.guest_access.can_join' },
{ id: 'forbidden', name: 'resources.rooms.enums.guest_access.forbidden' },
]}
/>
</Tab> </Tab>
<Tab label="resources.rooms.fields.joined_members" icon={<UserIcon />}> <Tab label="resources.rooms.fields.joined_members" icon={<UserIcon />}>
<ReferenceArrayField reference="users" source="members"> <ReferenceArrayField reference="users" source="members">
<Datagrid> <Datagrid>
<TextField source="id" /> <TextField source="id" />
<TextField source="displayname" /> <TextField source="displayname" />
<TextField source="power_level" />
</Datagrid> </Datagrid>
</ReferenceArrayField> </ReferenceArrayField>
</Tab> </Tab>

View File

@ -71,6 +71,21 @@ export default {
joined_members: "Mitglieder", joined_members: "Mitglieder",
invite_members: "Mitglieder einladen", invite_members: "Mitglieder einladen",
invitees: "Einladungen", invitees: "Einladungen",
guest_access: "Gastzugang",
join_rules: "Zugang zum Raum",
members: "Mitglieder",
},
enums: {
join_rules: {
public: "Öffentlich",
knock: "Auf Anfrage",
invite: "Nur auf Einladung",
private: "Privat",
},
guest_access: {
can_join: "Gäste können beitreten",
forbidden: "Gäste können nicht beitreten"
},
}, },
}, },
connections: { connections: {

View File

@ -73,6 +73,18 @@ export default {
invitees: "Invitations", invitees: "Invitations",
}, },
enums: {
join_rules: {
public: "Public",
knock: "Knock",
invite: "Invite",
private: "Private",
},
guest_access: {
can_join: "Guests can join",
forbidden: "Guests can not join"
},
},
}, },
connections: { connections: {
name: "Connections", name: "Connections",