mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 21:09:21 +00:00
Can change group registration level
This commit is contained in:
parent
dbf2ed868a
commit
d6f2df7002
@ -26,7 +26,7 @@ class Group {
|
|||||||
final int numberMembers;
|
final int numberMembers;
|
||||||
GroupMembershipLevel membershipLevel;
|
GroupMembershipLevel membershipLevel;
|
||||||
GroupVisibilityLevel visibilityLevel;
|
GroupVisibilityLevel visibilityLevel;
|
||||||
final GroupRegistrationLevel registrationLevel;
|
GroupRegistrationLevel registrationLevel;
|
||||||
final GroupPostCreationLevel postCreationLevel;
|
final GroupPostCreationLevel postCreationLevel;
|
||||||
String virtualDirectory;
|
String virtualDirectory;
|
||||||
bool following;
|
bool following;
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:comunic/ui/widgets/auto_sized_dialog_content_widget.dart';
|
||||||
import 'package:comunic/utils/intl_utils.dart';
|
import 'package:comunic/utils/intl_utils.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@ -70,21 +71,19 @@ class __MultiChoicesEntryDialogState<T>
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: Text(widget.title),
|
title: Text(widget.title),
|
||||||
content: SingleChildScrollView(
|
content: AutoSizeDialogContentWidget(
|
||||||
child: IntrinsicHeight(
|
child: Column(
|
||||||
child: Column(
|
children: widget.choices
|
||||||
children: widget.choices
|
.map((f) => ListTile(
|
||||||
.map((f) => ListTile(
|
leading: Radio<T>(
|
||||||
leading: Radio<T>(
|
groupValue: _currChoice,
|
||||||
groupValue: _currChoice,
|
value: f.id,
|
||||||
value: f.id,
|
onChanged: (v) => setState(() => _currChoice = v),
|
||||||
onChanged: (v) => setState(() => _currChoice = v),
|
),
|
||||||
),
|
title: Text(f.title),
|
||||||
title: Text(f.title),
|
subtitle: Text(f.subtitle),
|
||||||
subtitle: Text(f.subtitle),
|
))
|
||||||
))
|
.toList(),
|
||||||
.toList(),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
|
@ -153,16 +153,37 @@ class _GroupSettingsScreenState extends SafeState<GroupSettingsScreen> {
|
|||||||
),
|
),
|
||||||
MultiChoiceEntry(
|
MultiChoiceEntry(
|
||||||
id: GroupVisibilityLevel.PRIVATE,
|
id: GroupVisibilityLevel.PRIVATE,
|
||||||
title: tr("Private groupe"),
|
title: tr("Private group"),
|
||||||
subtitle: tr("The group is accessible to accepted members only."),
|
subtitle: tr("The group is accessible to accepted members only."),
|
||||||
),
|
),
|
||||||
MultiChoiceEntry(
|
MultiChoiceEntry(
|
||||||
id: GroupVisibilityLevel.SECRETE,
|
id: GroupVisibilityLevel.SECRETE,
|
||||||
title: tr("Secrete groupe"),
|
title: tr("Secrete group"),
|
||||||
subtitle: tr("The group is visible only to invited members."),
|
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(
|
Widget _buildAccessRestrictions() => SettingsSection(
|
||||||
title: tr("Access restrictions"),
|
title: tr("Access restrictions"),
|
||||||
tiles: [
|
tiles: [
|
||||||
@ -173,7 +194,15 @@ class _GroupSettingsScreenState extends SafeState<GroupSettingsScreen> {
|
|||||||
onChanged: (v) {
|
onChanged: (v) {
|
||||||
_groupSettings.visibilityLevel = v;
|
_groupSettings.visibilityLevel = v;
|
||||||
_updateSettings();
|
_updateSettings();
|
||||||
})
|
}),
|
||||||
|
MultiChoicesSettingsTile(
|
||||||
|
title: tr("Group registration level"),
|
||||||
|
choices: _registrationLevels,
|
||||||
|
currentValue: _groupSettings.registrationLevel,
|
||||||
|
onChanged: (v) {
|
||||||
|
_groupSettings.registrationLevel = v;
|
||||||
|
_updateSettings();
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user