mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-10-31 10:14:50 +00:00 
			
		
		
		
	Can change group posts creation level
This commit is contained in:
		| @@ -27,7 +27,7 @@ class Group { | ||||
|   GroupMembershipLevel membershipLevel; | ||||
|   GroupVisibilityLevel visibilityLevel; | ||||
|   GroupRegistrationLevel registrationLevel; | ||||
|   final GroupPostCreationLevel postCreationLevel; | ||||
|   GroupPostCreationLevel postCreationLevel; | ||||
|   String virtualDirectory; | ||||
|   bool following; | ||||
|  | ||||
|   | ||||
| @@ -184,9 +184,25 @@ class _GroupSettingsScreenState extends SafeState<GroupSettingsScreen> { | ||||
|         ), | ||||
|       ]; | ||||
|  | ||||
|   List<MultiChoiceEntry<GroupPostCreationLevel>> get _postsCreationLevels => [ | ||||
|         MultiChoiceEntry( | ||||
|           id: GroupPostCreationLevel.MEMBERS, | ||||
|           title: tr("All members"), | ||||
|           subtitle: | ||||
|               tr("All the members of the group can create posts on the group"), | ||||
|         ), | ||||
|         MultiChoiceEntry( | ||||
|           id: GroupPostCreationLevel.MODERATORS, | ||||
|           title: tr("Moderators only"), | ||||
|           subtitle: tr( | ||||
|               "Only moderators and administrators of the group can create posts on it"), | ||||
|         ), | ||||
|       ]; | ||||
|  | ||||
|   Widget _buildAccessRestrictions() => SettingsSection( | ||||
|         title: tr("Access restrictions"), | ||||
|         tiles: [ | ||||
|           // Group visibility | ||||
|           MultiChoicesSettingsTile( | ||||
|               title: tr("Group visibility"), | ||||
|               choices: _visibilityLevels, | ||||
| @@ -195,6 +211,8 @@ class _GroupSettingsScreenState extends SafeState<GroupSettingsScreen> { | ||||
|                 _groupSettings.visibilityLevel = v; | ||||
|                 _updateSettings(); | ||||
|               }), | ||||
|  | ||||
|           // Group registration level | ||||
|           MultiChoicesSettingsTile( | ||||
|               title: tr("Group registration level"), | ||||
|               choices: _registrationLevels, | ||||
| @@ -203,6 +221,16 @@ class _GroupSettingsScreenState extends SafeState<GroupSettingsScreen> { | ||||
|                 _groupSettings.registrationLevel = v; | ||||
|                 _updateSettings(); | ||||
|               }), | ||||
|  | ||||
|           // Group posts creation levels | ||||
|           MultiChoicesSettingsTile( | ||||
|               title: tr("Posts creation level"), | ||||
|               choices: _postsCreationLevels, | ||||
|               currentValue: _groupSettings.postCreationLevel, | ||||
|               onChanged: (s) { | ||||
|                 _groupSettings.postCreationLevel = s; | ||||
|                 _updateSettings(); | ||||
|               }), | ||||
|         ], | ||||
|       ); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user