Add customizable avatar services
Review Request #8205 — Created June 1, 2016 and submitted
Djblets now supports avatar services that can be customized per-user via
a configuration form. It currently includes one such avatar service, the
FileUploadAvatarService
, which allows users to upload an avatar of
their choosing.The customization form uses nested configuration page forms to
dynamically show and hide the required fields, as well as include the
necessary CSS and JavaScript bundles for the forms.Each avatar service that is customizable requires a
SettingsManager
,
which is set per-registry. The settings manager is responsible for
loading and saving the per-user configuration of each avatar service.
Djblets does not come with a default one (as it depends on the database
schema).
- Ran unit tests.
- Changed my avatar to an uploaded avatar in Review Board.
Description | From | Last Updated |
---|---|---|
'AvatarSettingsManager' imported but unused |
reviewbot | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
Col: 1 W391 blank line at end of file |
reviewbot | |
Col: 1 W391 blank line at end of file |
reviewbot | |
Col: 1 W391 blank line at end of file |
reviewbot | |
Can you add a file docstring? |
david | |
Can you add a file docstring? |
david | |
Can you add a file docstring? |
david | |
We repeat this loop in several places. Perhaps we should add an iterator to the registry that yields enabled services … |
david | |
Do we want to mark this string for translation? |
david | |
Can you add a file docstring? |
david | |
Docstring? |
david | |
These lines can be combined. |
david | |
Can you add a file docstring? |
david | |
I think for properties we want to write the docstring as if it were for regular data rather than a … |
david | |
Same here. |
david | |
Can remove this line. |
david | |
This should be indented 4 more spaces. |
david | |
Many of these class names don't look like they need to be nested. You can probably put each of the … |
david | |
These can be combined. Perhaps also make this .avatar-missing for consistency, and put it at the top-level? |
david | |
If we have dependencies right, this shouldn't be necessary. |
david | |
Trailing whitespace. |
david | |
Trailing whitespace. |
david | |
Trailing whitespace. |
david | |
More trailing whitespace. |
david | |
And here... |
david | |
I've used constructor here but either way callable is a python thing, and this should be, at a minimum, function. |
david | |
Rather than have this method and the global readyPromise/ready, how about put the promise directly here as a property called … |
david | |
Trailing whitespace. |
david | |
This should probably happen inside of a render method. |
david | |
no animated GIF avatars? |
david | |
More here. |
david | |
We can delay constructing the FileReader until inside the conditional. |
david | |
This line can be removed. |
david | |
This line can be removed. |
david | |
Docstring? |
david | |
Docstring? |
david | |
Docstring? |
david | |
Docstring? |
david | |
Doc comment? |
david | |
Trailing whitespace. |
david | |
Trailing whitespace. |
david | |
Col: 5 E303 too many blank lines (2) |
reviewbot | |
I don't understand why the text is inside a list. You don't do that for other ValidationErrors. |
david | |
There's an extra line here. |
david | |
I think we usually list classes before element types. |
david | |
We should call Backbone.View.initialize here. |
david | |
{} aren't needed in the fat arrow function. If it doesn't fit all on one line, put the fat arrow … |
david | |
const works here?? I'm pretty sure that it needs to be let because it will assign multiple times as it … |
david | |
Can we be more specific than just cls and type? Maybe something like formClass? |
david | |
Add another blank line here. |
david | |
Add another blank line here. |
david | |
Add another blank line here. |
david |
- Change Summary:
-
PEP8
- Commit:
-
ae17acacc6c2617d64afdcbcc0f8f4984c7bd0228c7cde518928dd79e0bdde9d9aba4e269c1bde44
-
Tool: Pyflakes Processed Files: djblets/avatars/forms.py djblets/staticbundles.py djblets/avatars/services/file_upload.py djblets/avatars/services/base.py djblets/avatars/apps.py djblets/avatars/settings.py djblets/avatars/__init__.py djblets/avatars/tests.py djblets/avatars/registry.py djblets/avatars/pages.py Ignored Files: djblets/avatars/templates/avatars/settings_form.html djblets/static/djblets/js/avatars/views/fileUploadSettingsFormView.es6.js djblets/static/djblets/js/avatars/views/avatarSettingsFormView.es6.js djblets/static/djblets/js/avatars/base.js djblets/avatars/templates/avatars/services/file_upload_form.html djblets/static/djblets/css/avatars.less djblets/configforms/templates/configforms/config.html djblets/avatars/templates/avatars/service_form.html djblets/static/djblets/js/avatars/views/avatarServiceSettingsFormView.es6.js djblets/static/djblets/js/avatars/models/avatarSettingsModel.es6.js Tool: PEP8 Style Checker Processed Files: djblets/avatars/forms.py djblets/staticbundles.py djblets/avatars/services/file_upload.py djblets/avatars/services/base.py djblets/avatars/apps.py djblets/avatars/settings.py djblets/avatars/__init__.py djblets/avatars/tests.py djblets/avatars/registry.py djblets/avatars/pages.py Ignored Files: djblets/avatars/templates/avatars/settings_form.html djblets/static/djblets/js/avatars/views/fileUploadSettingsFormView.es6.js djblets/static/djblets/js/avatars/views/avatarSettingsFormView.es6.js djblets/static/djblets/js/avatars/base.js djblets/avatars/templates/avatars/services/file_upload_form.html djblets/static/djblets/css/avatars.less djblets/configforms/templates/configforms/config.html djblets/avatars/templates/avatars/service_form.html djblets/static/djblets/js/avatars/views/avatarServiceSettingsFormView.es6.js djblets/static/djblets/js/avatars/models/avatarSettingsModel.es6.js
- Change Summary:
-
Rename FileUploadAvatarService to FileUplaodService
- Commit:
-
8c7cde518928dd79e0bdde9d9aba4e269c1bde44058d061e724b0c4c103cf5a6bae2838e876b99c1
-
Tool: Pyflakes Processed Files: djblets/avatars/forms.py djblets/staticbundles.py djblets/avatars/services/file_upload.py djblets/avatars/services/base.py djblets/avatars/apps.py djblets/avatars/settings.py djblets/avatars/__init__.py djblets/avatars/tests.py djblets/avatars/registry.py djblets/avatars/pages.py Ignored Files: djblets/avatars/templates/avatars/settings_form.html djblets/static/djblets/js/avatars/views/fileUploadSettingsFormView.es6.js djblets/static/djblets/js/avatars/views/avatarSettingsFormView.es6.js djblets/static/djblets/js/avatars/base.js djblets/avatars/templates/avatars/services/file_upload_form.html djblets/static/djblets/css/avatars.less djblets/configforms/templates/configforms/config.html djblets/avatars/templates/avatars/service_form.html djblets/static/djblets/js/avatars/views/avatarServiceSettingsFormView.es6.js djblets/static/djblets/js/avatars/models/avatarSettingsModel.es6.js Tool: PEP8 Style Checker Processed Files: djblets/avatars/forms.py djblets/staticbundles.py djblets/avatars/services/file_upload.py djblets/avatars/services/base.py djblets/avatars/apps.py djblets/avatars/settings.py djblets/avatars/__init__.py djblets/avatars/tests.py djblets/avatars/registry.py djblets/avatars/pages.py Ignored Files: djblets/avatars/templates/avatars/settings_form.html djblets/static/djblets/js/avatars/views/fileUploadSettingsFormView.es6.js djblets/static/djblets/js/avatars/views/avatarSettingsFormView.es6.js djblets/static/djblets/js/avatars/base.js djblets/avatars/templates/avatars/services/file_upload_form.html djblets/static/djblets/css/avatars.less djblets/configforms/templates/configforms/config.html djblets/avatars/templates/avatars/service_form.html djblets/static/djblets/js/avatars/views/avatarServiceSettingsFormView.es6.js djblets/static/djblets/js/avatars/models/avatarSettingsModel.es6.js
-
- Change Summary:
-
PEP8
- Commit:
-
058d061e724b0c4c103cf5a6bae2838e876b99c14388555603d07abd8569f48c227459db0925b7c7
-
Tool: Pyflakes Processed Files: djblets/avatars/forms.py djblets/staticbundles.py djblets/avatars/services/file_upload.py djblets/avatars/services/base.py djblets/avatars/apps.py djblets/avatars/settings.py djblets/avatars/__init__.py djblets/avatars/tests.py djblets/avatars/registry.py djblets/avatars/pages.py Ignored Files: djblets/avatars/templates/avatars/settings_form.html djblets/static/djblets/js/avatars/views/fileUploadSettingsFormView.es6.js djblets/static/djblets/js/avatars/views/avatarSettingsFormView.es6.js djblets/static/djblets/js/avatars/base.js djblets/avatars/templates/avatars/services/file_upload_form.html djblets/static/djblets/css/avatars.less djblets/configforms/templates/configforms/config.html djblets/avatars/templates/avatars/service_form.html djblets/static/djblets/js/avatars/views/avatarServiceSettingsFormView.es6.js djblets/static/djblets/js/avatars/models/avatarSettingsModel.es6.js Tool: PEP8 Style Checker Processed Files: djblets/avatars/forms.py djblets/staticbundles.py djblets/avatars/services/file_upload.py djblets/avatars/services/base.py djblets/avatars/apps.py djblets/avatars/settings.py djblets/avatars/__init__.py djblets/avatars/tests.py djblets/avatars/registry.py djblets/avatars/pages.py Ignored Files: djblets/avatars/templates/avatars/settings_form.html djblets/static/djblets/js/avatars/views/fileUploadSettingsFormView.es6.js djblets/static/djblets/js/avatars/views/avatarSettingsFormView.es6.js djblets/static/djblets/js/avatars/base.js djblets/avatars/templates/avatars/services/file_upload_form.html djblets/static/djblets/css/avatars.less djblets/configforms/templates/configforms/config.html djblets/avatars/templates/avatars/service_form.html djblets/static/djblets/js/avatars/views/avatarServiceSettingsFormView.es6.js djblets/static/djblets/js/avatars/models/avatarSettingsModel.es6.js
-
Tool: Pyflakes Processed Files: djblets/avatars/forms.py djblets/staticbundles.py djblets/avatars/services/file_upload.py djblets/avatars/services/base.py djblets/avatars/apps.py djblets/avatars/settings.py djblets/avatars/__init__.py djblets/avatars/registry.py djblets/avatars/pages.py Ignored Files: djblets/avatars/templates/avatars/settings_form.html djblets/static/djblets/js/avatars/views/fileUploadSettingsFormView.es6.js djblets/static/djblets/js/avatars/views/avatarSettingsFormView.es6.js djblets/static/djblets/js/avatars/base.js djblets/avatars/templates/avatars/services/file_upload_form.html djblets/static/djblets/css/avatars.less djblets/avatars/templates/avatars/service_form.html djblets/static/djblets/js/avatars/views/avatarServiceSettingsFormView.es6.js djblets/static/djblets/js/avatars/models/avatarSettingsModel.es6.js Tool: PEP8 Style Checker Processed Files: djblets/avatars/forms.py djblets/staticbundles.py djblets/avatars/services/file_upload.py djblets/avatars/services/base.py djblets/avatars/apps.py djblets/avatars/settings.py djblets/avatars/__init__.py djblets/avatars/registry.py djblets/avatars/pages.py Ignored Files: djblets/avatars/templates/avatars/settings_form.html djblets/static/djblets/js/avatars/views/fileUploadSettingsFormView.es6.js djblets/static/djblets/js/avatars/views/avatarSettingsFormView.es6.js djblets/static/djblets/js/avatars/base.js djblets/avatars/templates/avatars/services/file_upload_form.html djblets/static/djblets/css/avatars.less djblets/avatars/templates/avatars/service_form.html djblets/static/djblets/js/avatars/views/avatarServiceSettingsFormView.es6.js djblets/static/djblets/js/avatars/models/avatarSettingsModel.es6.js
-
Tool: PEP8 Style Checker Processed Files: djblets/avatars/forms.py djblets/staticbundles.py djblets/avatars/services/file_upload.py djblets/avatars/services/base.py djblets/avatars/apps.py djblets/avatars/settings.py djblets/avatars/__init__.py djblets/avatars/registry.py djblets/avatars/pages.py Ignored Files: djblets/avatars/templates/avatars/settings_form.html djblets/static/djblets/js/avatars/views/fileUploadSettingsFormView.es6.js djblets/static/djblets/js/avatars/views/avatarSettingsFormView.es6.js djblets/static/djblets/js/avatars/base.js djblets/avatars/templates/avatars/services/file_upload_form.html djblets/static/djblets/css/avatars.less djblets/avatars/templates/avatars/service_form.html djblets/static/djblets/js/avatars/views/avatarServiceSettingsFormView.es6.js djblets/static/djblets/js/avatars/models/avatarSettingsModel.es6.js Tool: Pyflakes Processed Files: djblets/avatars/forms.py djblets/staticbundles.py djblets/avatars/services/file_upload.py djblets/avatars/services/base.py djblets/avatars/apps.py djblets/avatars/settings.py djblets/avatars/__init__.py djblets/avatars/registry.py djblets/avatars/pages.py Ignored Files: djblets/avatars/templates/avatars/settings_form.html djblets/static/djblets/js/avatars/views/fileUploadSettingsFormView.es6.js djblets/static/djblets/js/avatars/views/avatarSettingsFormView.es6.js djblets/static/djblets/js/avatars/base.js djblets/avatars/templates/avatars/services/file_upload_form.html djblets/static/djblets/css/avatars.less djblets/avatars/templates/avatars/service_form.html djblets/static/djblets/js/avatars/views/avatarServiceSettingsFormView.es6.js djblets/static/djblets/js/avatars/models/avatarSettingsModel.es6.js
-
Tool: PEP8 Style Checker Processed Files: djblets/avatars/forms.py djblets/staticbundles.py djblets/avatars/services/file_upload.py djblets/avatars/services/base.py djblets/avatars/apps.py djblets/avatars/settings.py djblets/avatars/__init__.py djblets/avatars/registry.py djblets/avatars/pages.py Ignored Files: djblets/avatars/templates/avatars/settings_form.html djblets/static/djblets/js/avatars/views/fileUploadSettingsFormView.es6.js djblets/static/djblets/js/avatars/views/avatarSettingsFormView.es6.js djblets/static/djblets/js/avatars/base.js djblets/avatars/templates/avatars/services/file_upload_form.html djblets/static/djblets/css/avatars.less djblets/avatars/templates/avatars/service_form.html djblets/static/djblets/js/avatars/views/avatarServiceSettingsFormView.es6.js djblets/static/djblets/js/avatars/models/avatarSettingsModel.es6.js Tool: Pyflakes Processed Files: djblets/avatars/forms.py djblets/staticbundles.py djblets/avatars/services/file_upload.py djblets/avatars/services/base.py djblets/avatars/apps.py djblets/avatars/settings.py djblets/avatars/__init__.py djblets/avatars/registry.py djblets/avatars/pages.py Ignored Files: djblets/avatars/templates/avatars/settings_form.html djblets/static/djblets/js/avatars/views/fileUploadSettingsFormView.es6.js djblets/static/djblets/js/avatars/views/avatarSettingsFormView.es6.js djblets/static/djblets/js/avatars/base.js djblets/avatars/templates/avatars/services/file_upload_form.html djblets/static/djblets/css/avatars.less djblets/avatars/templates/avatars/service_form.html djblets/static/djblets/js/avatars/views/avatarServiceSettingsFormView.es6.js djblets/static/djblets/js/avatars/models/avatarSettingsModel.es6.js
-
-
-
-
-
We repeat this loop in several places. Perhaps we should add an iterator to the registry that yields enabled services that are configurable?
-
-
-
-
-
-
I think for properties we want to write the docstring as if it were for regular data rather than a method. I'm not sure how adding a docstring on the setter affects things.
-
-
-
-
Many of these class names don't look like they need to be nested. You can probably put each of the
.avatar-*
ones at the top-level. As-is, you'll end up creating selectors like.avatar-service-configuration .avatar-service-fields .avatar-preview .missing-avatar::before
, which isn't very efficient. -
These can be combined. Perhaps also make this
.avatar-missing
for consistency, and put it at the top-level? -
-
-
-
-
-
-
I've used
constructor
here but either waycallable
is a python thing, and this should be, at a minimum,function
. -
Rather than have this method and the global
readyPromise/ready
, how about put the promise directly here as a property calledready
? You can then set the resolver as something like:ready: new Promise((resolve, reject) => { Djblets.Avatars.SettingsFormView._readyResolver = resolve; }),
-
-
-
-
-
-
-
-
Tool: Pyflakes Processed Files: djblets/avatars/forms.py djblets/staticbundles.py djblets/avatars/services/file_upload.py djblets/avatars/services/base.py djblets/avatars/apps.py djblets/avatars/settings.py djblets/avatars/__init__.py djblets/avatars/registry.py Ignored Files: djblets/avatars/templates/avatars/settings_form.html djblets/static/djblets/js/utils/promise.es6.js djblets/static/djblets/js/avatars/views/fileUploadSettingsFormView.es6.js djblets/static/djblets/js/avatars/views/avatarSettingsFormView.es6.js djblets/static/djblets/js/avatars/base.js djblets/avatars/templates/avatars/services/file_upload_form.html djblets/static/djblets/css/avatars.less djblets/avatars/templates/avatars/service_form.html djblets/static/djblets/js/avatars/views/avatarServiceSettingsFormView.es6.js djblets/static/djblets/js/avatars/models/avatarSettingsModel.es6.js Tool: PEP8 Style Checker Processed Files: djblets/avatars/forms.py djblets/staticbundles.py djblets/avatars/services/file_upload.py djblets/avatars/services/base.py djblets/avatars/apps.py djblets/avatars/settings.py djblets/avatars/__init__.py djblets/avatars/registry.py Ignored Files: djblets/avatars/templates/avatars/settings_form.html djblets/static/djblets/js/utils/promise.es6.js djblets/static/djblets/js/avatars/views/fileUploadSettingsFormView.es6.js djblets/static/djblets/js/avatars/views/avatarSettingsFormView.es6.js djblets/static/djblets/js/avatars/base.js djblets/avatars/templates/avatars/services/file_upload_form.html djblets/static/djblets/css/avatars.less djblets/avatars/templates/avatars/service_form.html djblets/static/djblets/js/avatars/views/avatarServiceSettingsFormView.es6.js djblets/static/djblets/js/avatars/models/avatarSettingsModel.es6.js
-
Tool: Pyflakes Processed Files: djblets/avatars/forms.py djblets/staticbundles.py djblets/avatars/services/file_upload.py djblets/avatars/services/base.py djblets/avatars/apps.py djblets/avatars/settings.py djblets/avatars/__init__.py djblets/avatars/registry.py Ignored Files: djblets/avatars/templates/avatars/settings_form.html djblets/static/djblets/js/utils/promise.es6.js djblets/static/djblets/js/avatars/views/fileUploadSettingsFormView.es6.js djblets/static/djblets/js/avatars/views/avatarSettingsFormView.es6.js djblets/static/djblets/js/avatars/base.js djblets/avatars/templates/avatars/services/file_upload_form.html djblets/static/djblets/css/avatars.less djblets/avatars/templates/avatars/service_form.html djblets/static/djblets/js/avatars/views/avatarServiceSettingsFormView.es6.js djblets/static/djblets/js/avatars/models/avatarSettingsModel.es6.js Tool: PEP8 Style Checker Processed Files: djblets/avatars/forms.py djblets/staticbundles.py djblets/avatars/services/file_upload.py djblets/avatars/services/base.py djblets/avatars/apps.py djblets/avatars/settings.py djblets/avatars/__init__.py djblets/avatars/registry.py Ignored Files: djblets/avatars/templates/avatars/settings_form.html djblets/static/djblets/js/utils/promise.es6.js djblets/static/djblets/js/avatars/views/fileUploadSettingsFormView.es6.js djblets/static/djblets/js/avatars/views/avatarSettingsFormView.es6.js djblets/static/djblets/js/avatars/base.js djblets/avatars/templates/avatars/services/file_upload_form.html djblets/static/djblets/css/avatars.less djblets/avatars/templates/avatars/service_form.html djblets/static/djblets/js/avatars/views/avatarServiceSettingsFormView.es6.js djblets/static/djblets/js/avatars/models/avatarSettingsModel.es6.js
-
-
Tool: Pyflakes Processed Files: djblets/avatars/forms.py djblets/staticbundles.py djblets/avatars/services/file_upload.py djblets/avatars/services/base.py djblets/avatars/apps.py djblets/avatars/settings.py djblets/avatars/__init__.py djblets/avatars/registry.py Ignored Files: djblets/avatars/templates/avatars/settings_form.html djblets/static/djblets/js/utils/promise.es6.js djblets/static/djblets/js/avatars/views/fileUploadSettingsFormView.es6.js djblets/static/djblets/js/avatars/views/avatarSettingsFormView.es6.js djblets/static/djblets/js/avatars/base.js djblets/avatars/templates/avatars/services/file_upload_form.html djblets/static/djblets/css/avatars.less djblets/avatars/templates/avatars/service_form.html djblets/static/djblets/js/avatars/views/avatarServiceSettingsFormView.es6.js djblets/static/djblets/js/avatars/models/avatarSettingsModel.es6.js Tool: PEP8 Style Checker Processed Files: djblets/avatars/forms.py djblets/staticbundles.py djblets/avatars/services/file_upload.py djblets/avatars/services/base.py djblets/avatars/apps.py djblets/avatars/settings.py djblets/avatars/__init__.py djblets/avatars/registry.py Ignored Files: djblets/avatars/templates/avatars/settings_form.html djblets/static/djblets/js/utils/promise.es6.js djblets/static/djblets/js/avatars/views/fileUploadSettingsFormView.es6.js djblets/static/djblets/js/avatars/views/avatarSettingsFormView.es6.js djblets/static/djblets/js/avatars/base.js djblets/avatars/templates/avatars/services/file_upload_form.html djblets/static/djblets/css/avatars.less djblets/avatars/templates/avatars/service_form.html djblets/static/djblets/js/avatars/views/avatarServiceSettingsFormView.es6.js djblets/static/djblets/js/avatars/models/avatarSettingsModel.es6.js
-
Tool: Pyflakes Processed Files: djblets/avatars/forms.py djblets/staticbundles.py djblets/avatars/services/file_upload.py djblets/avatars/services/base.py djblets/avatars/apps.py djblets/avatars/settings.py djblets/avatars/__init__.py djblets/avatars/registry.py Ignored Files: djblets/avatars/templates/avatars/settings_form.html djblets/static/djblets/js/utils/promise.es6.js djblets/static/djblets/js/avatars/views/fileUploadSettingsFormView.es6.js djblets/static/djblets/js/avatars/views/avatarSettingsFormView.es6.js djblets/static/djblets/js/avatars/base.js djblets/avatars/templates/avatars/services/file_upload_form.html djblets/static/djblets/css/avatars.less djblets/avatars/templates/avatars/service_form.html djblets/static/djblets/js/avatars/views/avatarServiceSettingsFormView.es6.js djblets/static/djblets/js/avatars/models/avatarSettingsModel.es6.js Tool: PEP8 Style Checker Processed Files: djblets/avatars/forms.py djblets/staticbundles.py djblets/avatars/services/file_upload.py djblets/avatars/services/base.py djblets/avatars/apps.py djblets/avatars/settings.py djblets/avatars/__init__.py djblets/avatars/registry.py Ignored Files: djblets/avatars/templates/avatars/settings_form.html djblets/static/djblets/js/utils/promise.es6.js djblets/static/djblets/js/avatars/views/fileUploadSettingsFormView.es6.js djblets/static/djblets/js/avatars/views/avatarSettingsFormView.es6.js djblets/static/djblets/js/avatars/base.js djblets/avatars/templates/avatars/services/file_upload_form.html djblets/static/djblets/css/avatars.less djblets/avatars/templates/avatars/service_form.html djblets/static/djblets/js/avatars/views/avatarServiceSettingsFormView.es6.js djblets/static/djblets/js/avatars/models/avatarSettingsModel.es6.js