pillar.git
2 weeks agoReplaced Gravatar with self-hosted avatars master production
Sybren A. Stüvel [Fri, 24 May 2019 15:36:06 +0000 (17:36 +0200)]
Replaced Gravatar with self-hosted avatars

Avatars are now obtained from Blender ID. They are downloaded from
Blender ID and stored in the users' home project storage.

Avatars can be synced via Celery and triggered from a webhook.

The avatar can be obtained from the current user object in Python, or
via pillar.api.users.avatar.url(user_dict).

Avatars can be shown in the web frontend by:

- an explicit image (like before but with a non-Gravatar URL)
- a Vue.js component `user-avatar`
- a Vue.js component `current-user-avatar`

The latter is the most efficient for the current user, as it uses user
info that's already injected into the webpage (so requires no extra
queries).

2 weeks agoReformatted code and added import to resolve PyCharm warnings
Sybren A. Stüvel [Fri, 31 May 2019 10:36:19 +0000 (12:36 +0200)]
Reformatted code and added import to resolve PyCharm warnings

2 weeks agoRemoved trailing spaces
Sybren A. Stüvel [Fri, 31 May 2019 10:28:25 +0000 (12:28 +0200)]
Removed trailing spaces

2 weeks agoFix for now-allowed PATCH on users
Sybren A. Stüvel [Fri, 31 May 2019 08:23:42 +0000 (10:23 +0200)]
Fix for now-allowed PATCH on users

Commit 0f0a4be4 introduced using PATCH on users to set the username.
An old unit test failed, as it checks that PATCH is not allowed (e.g.
tests for 405 Method Not Allowed response).

2 weeks agoMoved `user_to_dict()` function out of pillar.web.jinja module
Sybren A. Stüvel [Fri, 31 May 2019 08:23:25 +0000 (10:23 +0200)]
Moved `user_to_dict()` function out of pillar.web.jinja module

2 weeks agoFixed unit test by doing late import
Sybren A. Stüvel [Fri, 31 May 2019 08:22:46 +0000 (10:22 +0200)]
Fixed unit test by doing late import

For some reason the old pillar.auth stuck around, failing the
`isinstance(some_object, auth.UserClass)` check because it compared to the
old class and not the reloaded one.

3 weeks agoFixed updating username in settings view
Sybren A. Stüvel [Wed, 29 May 2019 16:37:01 +0000 (18:37 +0200)]
Fixed updating username in settings view

The timestamps used by the 'last viewed' property of the video progress
feature were converted to strings when sending to the frontend, but never
changed back to timestamps when PUTting via the SDK. I solved it by not
PUTing the user at all, but using PATCH to set the username instead.

3 weeks agoRan `npm audit fix --force`
Sybren A. Stüvel [Wed, 29 May 2019 15:06:36 +0000 (17:06 +0200)]
Ran `npm audit fix --force`

This fixed 64 security vulnerabilities and hopefully didn't break too much.

3 weeks agoSuppress warnings from Werkzeug
Sybren A. Stüvel [Wed, 29 May 2019 13:22:45 +0000 (15:22 +0200)]
Suppress warnings from Werkzeug

- Werkzeug deprecated Request.is_xhr, but it works fine with jQuery and we
  don't need a reminder every time a unit test is run. When we upgrade to
  Werkzeug 1.0 (once that's released) we'll see things break and fix them.
- Werkzeug deprecated their Atom feed. This we should act on; tracked in
  https://developer.blender.org/T65274.

3 weeks agoSuppress Cerberus deprecation warning caused by Eve
Sybren A. Stüvel [Wed, 29 May 2019 12:32:46 +0000 (14:32 +0200)]
Suppress Cerberus deprecation warning caused by Eve

Eve is falling behind on Cerberus. See my bug report on
https://github.com/pyeve/eve/issues/1278 for more info.

3 weeks agoMongoDB: db.collection_names() is deprecated → db.list_collection_names()
Sybren A. Stüvel [Wed, 29 May 2019 11:43:31 +0000 (13:43 +0200)]
MongoDB: db.collection_names() is deprecated → db.list_collection_names()

3 weeks agoMongoDB: more changing count() → count_documents()
Sybren A. Stüvel [Wed, 29 May 2019 11:42:42 +0000 (13:42 +0200)]
MongoDB: more changing count() → count_documents()

3 weeks agoCerberus 1.3 renamed 'validator' → 'check_with'
Sybren A. Stüvel [Wed, 29 May 2019 10:56:13 +0000 (12:56 +0200)]
Cerberus 1.3 renamed 'validator' → 'check_with'

This results in a change in schemas as well as in validator function names.

3 weeks agoAdded some type declarations
Sybren A. Stüvel [Wed, 29 May 2019 10:54:11 +0000 (12:54 +0200)]
Added some type declarations

3 weeks agoCerberus 1.3 renamed '{value,key}schema' to '{values,keys}rules'
Sybren A. Stüvel [Wed, 29 May 2019 09:00:27 +0000 (11:00 +0200)]
Cerberus 1.3 renamed '{value,key}schema' to '{values,keys}rules'

'valueschema' and 'keyschema' have been replaced by 'valuesrules' and
'keysrules'. Note the change from 2x singular ('value' and 'schema') to
2x plural ('values' and 'rules').

3 weeks agoCompatibility with Eve 0.9.1
Sybren A. Stüvel [Wed, 29 May 2019 08:50:55 +0000 (10:50 +0200)]
Compatibility with Eve 0.9.1

Note that Eve's update from 0.9 → 0.9.1 had a breaking API change, as the
return type of `app.data.find(...)` changed...

3 weeks agoSome extra type annotations
Sybren A. Stüvel [Thu, 23 May 2019 15:35:10 +0000 (17:35 +0200)]
Some extra type annotations

3 weeks agoMore thorough retrying in Blender ID communication
Sybren A. Stüvel [Thu, 23 May 2019 11:42:30 +0000 (13:42 +0200)]
More thorough retrying in Blender ID communication

3 weeks agoRemoved and gitignored poetry.lock
Sybren A. Stüvel [Thu, 23 May 2019 14:23:45 +0000 (16:23 +0200)]
Removed and gitignored poetry.lock

The poetry.lock files are only relevant for repeatable deployments,
and the one in this project isn't used for that (only the Blender
Cloud project file is used, and that's still there).

3 weeks agoRe-locked dependencies
Sybren A. Stüvel [Thu, 23 May 2019 11:47:22 +0000 (13:47 +0200)]
Re-locked dependencies

3 weeks agoMongoCollection.count() and `update()` are deprecated
Sybren A. Stüvel [Fri, 10 May 2019 15:02:38 +0000 (17:02 +0200)]
MongoCollection.count() and `update()` are deprecated

Eve doesn't have any counting methods on `current_app.data`, so there is
no one-to-one translation for `cursor.count()` in
`file_storage/__init__.py`. Since the call was only used in a debug log
entry, I just removed it altogether.

I removed `pillar.cli.operations.index_users_rebuild()`, as it was
importing `pillar.api.utils.algolia.algolia_index_user_save` which doesn't
exist any more, so the code was dead anyway.

3 weeks ago`UnitTest.assertEquals` is deprecated, replaced by `assertEqual`
Sybren A. Stüvel [Fri, 10 May 2019 14:28:23 +0000 (16:28 +0200)]
`UnitTest.assertEquals` is deprecated, replaced by `assertEqual`

3 weeks agoRelaxed required versions of all our dependencies
Sybren A. Stüvel [Fri, 10 May 2019 14:17:02 +0000 (16:17 +0200)]
Relaxed required versions of all our dependencies

Some packages were upgraded; the rename from `CommonMark` to `commonmark`
was the only change breaking the unit tests.

3 weeks agoDependencies: remove requests, it's pulled in via python-pillar-sdk anyway
Sybren A. Stüvel [Fri, 10 May 2019 13:29:57 +0000 (15:29 +0200)]
Dependencies: remove requests, it's pulled in via python-pillar-sdk anyway

3 weeks agoDevelopment dependencies updates to their latest versions
Sybren A. Stüvel [Fri, 10 May 2019 13:28:42 +0000 (15:28 +0200)]
Development dependencies updates to their latest versions

4 weeks agoGenerate Blender ID URL based on configuration
Sybren A. Stüvel [Thu, 23 May 2019 11:47:39 +0000 (13:47 +0200)]
Generate Blender ID URL based on configuration

4 weeks agoMerge branch 'production'
Sybren A. Stüvel [Wed, 22 May 2019 08:27:25 +0000 (10:27 +0200)]
Merge branch 'production'

4 weeks agoput_project(project_dict): also log the error when we cannot PUT
Sybren A. Stüvel [Wed, 22 May 2019 08:15:25 +0000 (10:15 +0200)]
put_project(project_dict): also log the error when we cannot PUT

Previously only a ValueError was raised, which was sometimes swallowed.
Instead of looking up the culprit and solving this properly, I just log the
error now.

4 weeks agoAllow web projects to un-attach project pictures
Sybren A. Stüvel [Wed, 22 May 2019 08:14:19 +0000 (10:14 +0200)]
Allow web projects to un-attach project pictures

This makes it possible to PUT a project after attach_project_pictures()
has been called on it (which embeds the picture file documents).

This will be used in SVNman.

5 weeks agoAdded 'idna' package as dependency
Sybren A. Stüvel [Tue, 14 May 2019 09:19:03 +0000 (11:19 +0200)]
Added 'idna' package as dependency

It's required by pyopenssl but for some reason wasn't installed by Poetry.

5 weeks agoGitignore devdeps metadata directory
Sybren A. Stüvel [Fri, 10 May 2019 13:02:58 +0000 (15:02 +0200)]
Gitignore devdeps metadata directory

5 weeks agoDocumenting use of Poetry for dependency management
Sybren A. Stüvel [Fri, 10 May 2019 13:02:15 +0000 (15:02 +0200)]
Documenting use of Poetry for dependency management

5 weeks agoREADME: Removed trailing whitespace
Sybren A. Stüvel [Fri, 10 May 2019 13:02:02 +0000 (15:02 +0200)]
README: Removed trailing whitespace

5 weeks agoMoving to Poetry
Sybren A. Stüvel [Fri, 26 Apr 2019 09:49:38 +0000 (11:49 +0200)]
Moving to Poetry

8 weeks agoForms: Use own label element for fields instead of wtforms.
Pablo Vazquez [Wed, 24 Apr 2019 19:29:55 +0000 (21:29 +0200)]
Forms: Use own label element for fields instead of wtforms.

This way we can do two things:
* Tag the field for translation
* Use a filter (like undertitle for nicer labels)

2 months agoAttach all project pictures when viewing node
Francesco Siddi [Fri, 19 Apr 2019 13:30:55 +0000 (15:30 +0200)]
Attach all project pictures when viewing node

The Open Graph rendering code is not completely refactored yet,
so it still requires a mix of project.picture_header and
project.picture_16_9. By attaching all project pictures we prevent
unexpected errors.

2 months agoUse picture_16_9 as og_image
Francesco Siddi [Fri, 19 Apr 2019 12:12:43 +0000 (14:12 +0200)]
Use picture_16_9 as og_image

Previously we used picture_header, which did not guarantee a suitable
aspect ratio for an Open Graph image.

2 months agoEnhance project with attach_project_pictures
Francesco Siddi [Fri, 19 Apr 2019 12:11:42 +0000 (14:11 +0200)]
Enhance project with attach_project_pictures

Instead of individually attaching project images, use the utility
function.

2 months agoAdd picture_16_9 when attaching project pictures
Francesco Siddi [Fri, 19 Apr 2019 12:10:19 +0000 (14:10 +0200)]
Add picture_16_9 when attaching project pictures

2 months agoSave 16_9 picture via Project edit form
Francesco Siddi [Fri, 19 Apr 2019 12:09:54 +0000 (14:09 +0200)]
Save 16_9 picture via Project edit form

2 months agoRename 16x9 to 16_9
Francesco Siddi [Fri, 19 Apr 2019 09:50:41 +0000 (11:50 +0200)]
Rename 16x9 to 16_9

We do this to reduce ambiguity about resolution vs aspect ratio.

2 months agoAdd picture_16x9 attribute for Project
Francesco Siddi [Fri, 19 Apr 2019 08:57:46 +0000 (10:57 +0200)]
Add picture_16x9 attribute for Project

This image can be use as a source for Open Graph tags, as well as for
displaying a project thumbnail with a known (or at least expected)
aspect ratio.

2 months agoBumped Jinja2 2.10 → 2.10.1
Sybren A. Stüvel [Thu, 18 Apr 2019 08:15:41 +0000 (10:15 +0200)]
Bumped Jinja2 2.10 → 2.10.1

Github poked us about this being a security update.

2 months agoFix missing icons.
Pablo Vazquez [Mon, 15 Apr 2019 10:42:49 +0000 (12:42 +0200)]
Fix missing icons.

2 months agoCSS: Utility classes for column count property.
Pablo Vazquez [Fri, 12 Apr 2019 15:16:06 +0000 (17:16 +0200)]
CSS: Utility classes for column count property.

2 months agoTimeline: Less prominent project title.
Pablo Vazquez [Wed, 10 Apr 2019 15:08:14 +0000 (17:08 +0200)]
Timeline: Less prominent project title.

2 months agoCleanup CSS.
Pablo Vazquez [Wed, 10 Apr 2019 15:08:01 +0000 (17:08 +0200)]
Cleanup CSS.

Extend Bootstrap classes instead of using own styling.

2 months agoUI Asset List: Add custom class to meta items.
Pablo Vazquez [Wed, 10 Apr 2019 12:14:04 +0000 (14:14 +0200)]
UI Asset List: Add custom class to meta items.

2 months agoAllow PUT method for owner on comment creation
Francesco Siddi [Mon, 8 Apr 2019 23:09:08 +0000 (01:09 +0200)]
Allow PUT method for owner on comment creation

Make use of the permission system and allow PUT method for the creator
of a Node of type comment. This enables comment owners to edit their
own posts.

2 months agoPEP8 formatting
Francesco Siddi [Mon, 8 Apr 2019 23:01:58 +0000 (01:01 +0200)]
PEP8 formatting

2 months agoPEP8 formatting
Francesco Siddi [Mon, 8 Apr 2019 23:01:49 +0000 (01:01 +0200)]
PEP8 formatting

2 months agoCleanup: remove unused import and blank line
Francesco Siddi [Mon, 8 Apr 2019 21:55:26 +0000 (23:55 +0200)]
Cleanup: remove unused import and blank line

2 months agoExtend projects/view.html for page templates
Francesco Siddi [Mon, 8 Apr 2019 14:43:20 +0000 (16:43 +0200)]
Extend projects/view.html for page templates

Using projects/landing.html was causing exception since the landing
template expects project attributes that are available only for
projects that are setup_for_film.

2 months agoCleanup duplicate code.
Pablo Vazquez [Thu, 4 Apr 2019 12:21:25 +0000 (14:21 +0200)]
Cleanup duplicate code.

2 months agoJumbotron: Subtle text shadow on text
Pablo Vazquez [Thu, 4 Apr 2019 12:21:16 +0000 (14:21 +0200)]
Jumbotron: Subtle text shadow on text

2 months agoUI Timeline: Make buttons outline white when dark background.
Pablo Vazquez [Thu, 4 Apr 2019 12:21:04 +0000 (14:21 +0200)]
UI Timeline: Make buttons outline white when dark background.

2 months agoRemove unused import
Tobias Johansson [Thu, 4 Apr 2019 12:15:03 +0000 (14:15 +0200)]
Remove unused import

2 months agoClean up: Whitespace
Tobias Johansson [Thu, 4 Apr 2019 09:34:13 +0000 (11:34 +0200)]
Clean up: Whitespace

2 months agoUse kebab-case for vue names
Tobias Johansson [Thu, 4 Apr 2019 09:33:43 +0000 (11:33 +0200)]
Use kebab-case for vue names

https://vuejs.org/v2/guide/components-custom-events.html#Event-Names

2 months agowhite space clean up
Tobias Johansson [Thu, 4 Apr 2019 08:44:43 +0000 (10:44 +0200)]
white space clean up

2 months agoSpecify prop type
Tobias Johansson [Thu, 4 Apr 2019 08:44:22 +0000 (10:44 +0200)]
Specify prop type

2 months agoSilence warning about changing prop value
Tobias Johansson [Thu, 4 Apr 2019 08:18:24 +0000 (10:18 +0200)]
Silence warning about changing prop value

2 months agoWhitespace cleanup
Tobias Johansson [Wed, 3 Apr 2019 15:51:28 +0000 (17:51 +0200)]
Whitespace cleanup

2 months agoAdd missing closing bracket to components
Tobias Johansson [Wed, 3 Apr 2019 15:50:50 +0000 (17:50 +0200)]
Add missing closing bracket to components

2 months agoBetter initial component values
Tobias Johansson [Wed, 3 Apr 2019 15:50:15 +0000 (17:50 +0200)]
Better initial component values

2 months agoFix wrong prop type
Tobias Johansson [Wed, 3 Apr 2019 15:49:17 +0000 (17:49 +0200)]
Fix wrong prop type

2 months agoBind vue component key
Tobias Johansson [Wed, 3 Apr 2019 15:44:22 +0000 (17:44 +0200)]
Bind vue component key

2 months agoOnly use minified vue if built as production
Tobias Johansson [Wed, 3 Apr 2019 15:43:25 +0000 (17:43 +0200)]
Only use minified vue if built as production

2 months agoWrong type was passed into component
Tobias Johansson [Wed, 3 Apr 2019 15:41:52 +0000 (17:41 +0200)]
Wrong type was passed into component

2 months agoRemove unused parameter
Tobias Johansson [Wed, 3 Apr 2019 15:40:15 +0000 (17:40 +0200)]
Remove unused parameter

2 months agoAdd example of usage
Tobias Johansson [Wed, 3 Apr 2019 15:38:19 +0000 (17:38 +0200)]
Add example of usage

2 months agoUI Page: Fix link on header.
Pablo Vazquez [Wed, 3 Apr 2019 22:26:15 +0000 (00:26 +0200)]
UI Page: Fix link on header.

2 months agoUI Pages: Hide title if there is an image.
Pablo Vazquez [Wed, 3 Apr 2019 22:24:37 +0000 (00:24 +0200)]
UI Pages: Hide title if there is an image.

2 months agoUI Theatre: margin around comments container.
Pablo Vazquez [Wed, 3 Apr 2019 21:15:09 +0000 (23:15 +0200)]
UI Theatre: margin around comments container.

2 months agoCleanup: remove unused font-pillar link.
Pablo Vazquez [Wed, 3 Apr 2019 21:12:17 +0000 (23:12 +0200)]
Cleanup: remove unused font-pillar link.

They are now built into the main stylesheets.

2 months agoCSS: include font-pillar into the main stylesheets.
Pablo Vazquez [Wed, 3 Apr 2019 21:11:57 +0000 (23:11 +0200)]
CSS: include font-pillar into the main stylesheets.

2 months agoUI Alerts: minor style tweaks.
Pablo Vazquez [Wed, 3 Apr 2019 20:47:04 +0000 (22:47 +0200)]
UI Alerts: minor style tweaks.

Remove margin from paragraphs and remove redundant text-align.

2 months agoCleanup: remove blender-cloud specific pug component.
Pablo Vazquez [Wed, 3 Apr 2019 13:28:06 +0000 (15:28 +0200)]
Cleanup: remove blender-cloud specific pug component.

2 months agoUI Breadcrums: Always show.
Pablo Vazquez [Tue, 2 Apr 2019 14:39:54 +0000 (16:39 +0200)]
UI Breadcrums: Always show.

2 months agoUI Fix: Show sidebar on project edit.
Pablo Vazquez [Tue, 2 Apr 2019 13:20:10 +0000 (15:20 +0200)]
UI Fix: Show sidebar on project edit.

2 months agoRemove unused data property
Tobias Johansson [Tue, 2 Apr 2019 09:20:40 +0000 (11:20 +0200)]
Remove unused data property

2 months agoFix typo
Tobias Johansson [Mon, 1 Apr 2019 14:59:11 +0000 (16:59 +0200)]
Fix typo

2 months agoUI Comments: Minor style adjustments and fixes.
Pablo Vazquez [Tue, 2 Apr 2019 11:53:55 +0000 (13:53 +0200)]
UI Comments: Minor style adjustments and fixes.

2 months agoUI jstree: Fix collapse of folders with one click.
Pablo Vazquez [Tue, 2 Apr 2019 10:27:09 +0000 (12:27 +0200)]
UI jstree: Fix collapse of folders with one click.

Two clicks is too much work. It was removed by mistake on previous commit.

2 months agoUI Page: style the Edit bar.
Pablo Vazquez [Mon, 1 Apr 2019 12:29:12 +0000 (14:29 +0200)]
UI Page: style the Edit bar.

With light background color and border, so it stands out.

2 months agoUI Pages: Add page title.
Pablo Vazquez [Mon, 1 Apr 2019 12:28:24 +0000 (14:28 +0200)]
UI Pages: Add page title.

2 months agoUI Timeline: scale the placeholder to almost fit the screen.
Pablo Vazquez [Mon, 1 Apr 2019 12:28:04 +0000 (14:28 +0200)]
UI Timeline: scale the placeholder to almost fit the screen.

So the timeline has some initial height (75% of viewport height), and
once the content shows up the page doesn't jump much.

2 months agoCleanup: Tweak comments and sort classes.
Pablo Vazquez [Mon, 1 Apr 2019 10:37:01 +0000 (12:37 +0200)]
Cleanup: Tweak comments and sort classes.

2 months agoExport vue component user-avatar
Tobias Johansson [Mon, 1 Apr 2019 12:25:45 +0000 (14:25 +0200)]
Export vue component user-avatar

2 months agoVue getting started links
Tobias Johansson [Mon, 1 Apr 2019 09:23:25 +0000 (11:23 +0200)]
Vue getting started links

2 months agoAdded comments
Tobias Johansson [Fri, 29 Mar 2019 15:15:57 +0000 (16:15 +0100)]
Added comments

2 months agoMark as deprecated an recommend vue instead
Tobias Johansson [Fri, 29 Mar 2019 13:42:33 +0000 (14:42 +0100)]
Mark as deprecated an recommend vue instead

2 months agoUI Project: Show sidebar by default.
Pablo Vazquez [Fri, 29 Mar 2019 14:47:21 +0000 (15:47 +0100)]
UI Project: Show sidebar by default.

Change the logic to hide, instead.

2 months agoMerge branch 'production'
Sybren A. Stüvel [Fri, 29 Mar 2019 14:43:07 +0000 (15:43 +0100)]
Merge branch 'production'

2 months agoUI Page: Set page url as title.
Pablo Vazquez [Fri, 29 Mar 2019 14:35:19 +0000 (15:35 +0100)]
UI Page: Set page url as title.

So it's highlighted in the navigation.

2 months agoUI Page: style node description with its own class.
Pablo Vazquez [Fri, 29 Mar 2019 14:34:56 +0000 (15:34 +0100)]
UI Page: style node description with its own class.

Instead of relying on 'landing'.

2 months agoUI Pages: Show Edit Post link.
Pablo Vazquez [Fri, 29 Mar 2019 14:19:22 +0000 (15:19 +0100)]
UI Pages: Show Edit Post link.

2 months agoUI Pages: Only show header div if there is a picture.
Pablo Vazquez [Fri, 29 Mar 2019 14:18:49 +0000 (15:18 +0100)]
UI Pages: Only show header div if there is a picture.

2 months agoUI Page: Style like a regular page, not like the landing template (dark background).
Pablo Vazquez [Fri, 29 Mar 2019 14:17:50 +0000 (15:17 +0100)]
UI Page: Style like a regular page, not like the landing template (dark background).

2 months agoTemplate Cleanup: Remove unused 'title' variable.
Pablo Vazquez [Fri, 29 Mar 2019 14:17:08 +0000 (15:17 +0100)]
Template Cleanup: Remove unused 'title' variable.

'title' is set by the extended template ('landing').