1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 08:15:16 +00:00

Can change group registration level

This commit is contained in:
2020-05-01 21:04:50 +02:00
parent dbf2ed868a
commit d6f2df7002
3 changed files with 47 additions and 19 deletions

View File

@ -153,16 +153,37 @@ class _GroupSettingsScreenState extends SafeState<GroupSettingsScreen> {
),
MultiChoiceEntry(
id: GroupVisibilityLevel.PRIVATE,
title: tr("Private groupe"),
title: tr("Private group"),
subtitle: tr("The group is accessible to accepted members only."),
),
MultiChoiceEntry(
id: GroupVisibilityLevel.SECRETE,
title: tr("Secrete groupe"),
title: tr("Secrete group"),
subtitle: tr("The group is visible only to invited members."),
),
];
List<MultiChoiceEntry<GroupRegistrationLevel>> get _registrationLevels => [
MultiChoiceEntry(
id: GroupRegistrationLevel.OPEN,
title: tr("Open registration"),
subtitle: tr(
"Everyone can choose to join the group without moderator approval"),
),
MultiChoiceEntry(
id: GroupRegistrationLevel.MODERATED,
title: tr("Moderated registration"),
subtitle: tr(
"Everyone can request a membership, but a moderator review the request"),
),
MultiChoiceEntry(
id: GroupRegistrationLevel.CLOSED,
title: tr("Closed registration"),
subtitle: tr(
"The only way to join the group is to be invited by a moderator"),
),
];
Widget _buildAccessRestrictions() => SettingsSection(
title: tr("Access restrictions"),
tiles: [
@ -173,7 +194,15 @@ class _GroupSettingsScreenState extends SafeState<GroupSettingsScreen> {
onChanged: (v) {
_groupSettings.visibilityLevel = v;
_updateSettings();
})
}),
MultiChoicesSettingsTile(
title: tr("Group registration level"),
choices: _registrationLevels,
currentValue: _groupSettings.registrationLevel,
onChanged: (v) {
_groupSettings.registrationLevel = v;
_updateSettings();
}),
],
);
}