Browse Source

Updated avatar settings.

Rafał Pitoń 11 years ago
parent
commit
f75ed9dffd

+ 10 - 8
docs/developers/settings.rst

@@ -110,14 +110,10 @@ Preffered way in which new user accounts are activated. Can be either of those:
 * **block** - turn new registrations off.
 
 
-avatars_types
--------------
+allow_custom_avatars
+--------------------
 
-List of avatar sources available to users:
-
-* **gravatar** - Gravatar.
-* **upload** - avatar uploads.
-* **gallery** - predefined gallery.
+Controls if users may set avatars from outside forums.
 
 
 avatar_upload_limit
@@ -129,7 +125,7 @@ Max allowed size of uploaded avatars in kilobytes.
 default_avatar
 --------------
 
-Default avatar assigned to new accounts. Can be either ``gravatar`` or ``gallery`` which will make Misago pick random avatar from gallery instead.
+Default avatar assigned to new accounts. Can be either ``initials`` for randomly generated pic with initials, ``gravatar`` or ``gallery`` which will make Misago pick random avatar from gallery instead.
 
 
 default_timezone
@@ -210,6 +206,12 @@ password_length_min
 Minimal required length of new user passwords.
 
 
+signature_length_max
+--------------------
+
+Maximal allowed length of users signatures.
+
+
 subscribe_reply
 ---------------
 

+ 1 - 0
misago/users/avatars/__init__.py

@@ -0,0 +1 @@
+AVATAR_TYPES = ('gravatar', 'initials', 'gallery', 'uploaded')

+ 10 - 13
misago/users/migrations/0002_users_settings.py

@@ -78,20 +78,16 @@ def create_users_settings_group(apps, schema_editor):
                     },
                 },
                 {
-                    'setting': 'avatars_types',
-                    'name': _("Available avatar types"),
+                    'setting': 'allow_custom_avatars',
+                    'name': _("Allow custom avatars"),
                     'legend': _("Avatars"),
-                    'python_type': 'list',
-                    'value': ['gravatar', 'upload'],
-                    'form_field': 'checkbox',
-                    'field_extra': {
-                        'choices': (
-                            ('gravatar', _("Gravatar")),
-                            ('upload', _("Uploaded avatar")),
-                            ('gallery', _("Avatars gallery"))
-                        ),
-                        'min': 1,
-                    },
+                    'description': _("Turning this option off will forbid "
+                                     "forum users from using avatars from "
+                                     "outside forums. Good for forums "
+                                     "adressed at young users."),
+                    'python_type': 'bool',
+                    'value': True,
+                    'form_field': 'yesno',
                 },
                 {
                     'setting': 'default_avatar',
@@ -100,6 +96,7 @@ def create_users_settings_group(apps, schema_editor):
                     'form_field': 'select',
                     'field_extra': {
                         'choices': (
+                            ('initials', _("Initials")),
                             ('gravatar', _("Gravatar")),
                             ('gallery', _("Random avatar from gallery")),
                         ),