diff --git a/calsocial/__init__.py b/calsocial/__init__.py index a4e105c..d03e802 100644 --- a/calsocial/__init__.py +++ b/calsocial/__init__.py @@ -78,6 +78,16 @@ class CalendarSocialApp(Flask, RoutedMixin): self.config['SECURITY_USER_IDENTITY_ATTRIBUTES'] = ('username', 'email') self.config['SECURITY_LOGIN_USER_TEMPLATE'] = 'login.html' + # The builtin avatars to use + self.config['BUILTIN_AVATARS'] = ( + 'doctor', + 'engineer', + 'scientist', + 'statistician', + 'user', + 'whoami', + ) + self.jinja_env.policies['ext.i18n.trimmed'] = True # pylint: disable=no-member db.init_app(self) diff --git a/calsocial/models.py b/calsocial/models.py index 61fde67..b0c4dff 100644 --- a/calsocial/models.py +++ b/calsocial/models.py @@ -285,6 +285,9 @@ class Profile(db.Model): # pylint: disable=too-few-public-methods #: If locked, a profile cannot be followed without the owner’s consent locked = db.Column(db.Boolean(), default=False) + #: If set, the profile will display this builtin avatar + builtin_avatar = db.Column(db.String(length=40), nullable=True) + @property def fqn(self): """The fully qualified name of the profile diff --git a/calsocial/static/avatars/doctor.svg b/calsocial/static/avatars/doctor.svg new file mode 100644 index 0000000..48acf64 --- /dev/null +++ b/calsocial/static/avatars/doctor.svg @@ -0,0 +1,35 @@ + + + \ No newline at end of file diff --git a/calsocial/static/avatars/engineer.svg b/calsocial/static/avatars/engineer.svg new file mode 100644 index 0000000..eedfe90 --- /dev/null +++ b/calsocial/static/avatars/engineer.svg @@ -0,0 +1,54 @@ + + + \ No newline at end of file diff --git a/calsocial/static/avatars/scientist.svg b/calsocial/static/avatars/scientist.svg new file mode 100644 index 0000000..564855b --- /dev/null +++ b/calsocial/static/avatars/scientist.svg @@ -0,0 +1,91 @@ + + + \ No newline at end of file diff --git a/calsocial/static/avatars/statistician.svg b/calsocial/static/avatars/statistician.svg new file mode 100644 index 0000000..26bb043 --- /dev/null +++ b/calsocial/static/avatars/statistician.svg @@ -0,0 +1,39 @@ + + + \ No newline at end of file diff --git a/calsocial/static/avatars/user.svg b/calsocial/static/avatars/user.svg new file mode 100644 index 0000000..5956a5b --- /dev/null +++ b/calsocial/static/avatars/user.svg @@ -0,0 +1,11 @@ + + + \ No newline at end of file diff --git a/calsocial/static/avatars/whoami.svg b/calsocial/static/avatars/whoami.svg new file mode 100644 index 0000000..c0ac8f9 --- /dev/null +++ b/calsocial/static/avatars/whoami.svg @@ -0,0 +1,26 @@ + + + \ No newline at end of file diff --git a/calsocial/templates/profile-details.html b/calsocial/templates/profile-details.html index 7c1fe51..cf75d74 100644 --- a/calsocial/templates/profile-details.html +++ b/calsocial/templates/profile-details.html @@ -1,14 +1,17 @@ {% extends 'base.html' %} {% block content %} -