Commit Graph

549 Commits

Author SHA1 Message Date
Francesco Siddi e69f991aa6 Update flask_wtf to 0.14.2 and make CSRFProtect available to current_app
By default CSRF protection is disabled for all views, since most
web endpoints and all API endpoints do not need it.
On the views that require it, we use the 
current_app.csrf.protect() method.
2018-03-28 22:05:54 +02:00
Pablo Vazquez dcde2a4551 Merge branch 'master' into wip-asset-obscure 2018-03-28 12:42:42 +02:00
Pablo Vazquez 5eb464a1f3 Minor tweaks to layout when able to re-new subscriptions 2018-03-28 12:17:11 +02:00
Pablo Vazquez ab6b277293 Minor tweaks and cleanup on group_hdri, group_texture and texture templates 2018-03-27 19:47:48 +02:00
Pablo Vazquez a4e415f1e3 Assets: Trim the first part of the asset type
Usually "image" or "application".

Also special treatment for .blend files
e.g. application/x-blender becomes blend logo
2018-03-27 19:46:34 +02:00
Pablo Vazquez ebfd3d542c Generic template for node preview when not subscribed 2018-03-27 19:40:44 +02:00
Pablo Vazquez 8f227076fd Node details is now part of view_base 2018-03-27 19:40:18 +02:00
Pablo Vazquez a7cb3b9658 Use view_base for assets 2018-03-27 19:39:49 +02:00
Pablo Vazquez 641f29ab30 Introducing: view_base template for nodes
Contains all the basics divided in blocks:
* node_preview
* node_details
* node_details_meta_extra (for additional list items)
* node_download - to override the download button
* node_comments
* node_scripts - for node specific scripts, like hdri or video
* footer_scripts
2018-03-27 19:38:45 +02:00
Pablo Vazquez 17792df85e Cleanup: Unused block 2018-03-27 19:13:14 +02:00
Pablo Vazquez bca8fac4cd Cleanup: Unused templates 2018-03-27 19:08:28 +02:00
Sybren A. Stüvel 218c3f0dca Fixed comment rendering 2018-03-27 17:13:12 +02:00
Sybren A. Stüvel dfaac59e20 Cache Markdown'ed HTML in database
This is done via coercion rules. To cache the field 'content' in the
database, include this in your Eve schema:

    {'content': {'type': 'string', 'coerce': 'markdown'},
     '_content_html': {'type': 'string'}}

The `_content_html` field will be filled automatically when saving the
document via Eve.

To display the cached HTML, and fall back to display-time rendering if it
is not there, use `{{ document | markdowned('content') }}` in your template.

Still needs unit testing, a CLI command for regenerating the caches, and
a CLI command for migrating the node type definitions in existing projects.
2018-03-27 16:34:32 +02:00
Sybren A. Stüvel 12272750c3 T53890: Improving static content serving
Static files are now served with an 8-character hash before the last
extension. For example, `tutti.min.js` is now served as
`tutti.min.abcd1234.js`. When doing a request the hash is removed before
serving the static file.

The hash must be 8 characters long, and is taken from STATIC_FILE_HASH.
It is up to the deployment to change this configuration variable
whenever static files change. This forces browsers that download newly
deployed HTML to also refresh the dependencies (most importantly
JS/CSS).

For this to work, the URL must be built with `url_for('static_xxx',
filename='/path/to/file')`. The 'static' module still returns regular,
hashless URLs.
2018-03-23 17:36:14 +01:00
Pablo Vazquez 479a435ec5 Work in progress in blurring asset preview and minor CSS/template cleanups 2018-03-21 20:15:29 +01:00
Pablo Vazquez 6f69fe5b8a CSS: Style kbd tag in node description 2018-03-14 21:59:50 +01:00
Pablo Vazquez 7292c534ed Fix scrollToLinkedComment()
The test was done against location.hash, which contains a hash symbol.
Strip it for the test.
2018-03-14 21:59:50 +01:00
Sybren A. Stüvel df6297d40f Fixed project search
The project ID wasn't used at all when searching in a project's context.
2018-03-13 12:24:29 +01:00
Pablo Vazquez 6e1d255dfc CSS: Style buttons with 'disabled' class 2018-03-11 23:40:23 +01:00
Pablo Vazquez f236845374 CSS Login: Minor tweaks and maintenance 2018-03-07 21:16:35 +01:00
Sybren A. Stüvel 0c7abdb99a Avoid error when there is no #cloud-search element 2018-02-14 10:22:13 +01:00
Sybren A. Stüvel d0520484bb User admin: Show selected user as 'active' 2018-02-13 10:24:49 +01:00
Sybren A. Stüvel d114b5631a User admin: removed cancel button
It didn't do anything useful, but did break the GUI.
2018-02-13 10:21:43 +01:00
Sybren A. Stüvel d85c45f10f Not using let in JS, as Gulp minify doesn't understand it :( 2018-02-01 14:28:12 +01:00
Sybren A. Stüvel 1ca2f336c4 Proper error handling for node type editor 2018-02-01 14:13:01 +01:00
Sybren A. Stüvel 284873ddd4 Unify and simplify texture map type labels 2018-02-01 12:04:12 +01:00
Sybren A. Stüvel 08a814525b Implement project undelete as PATCH
This is done via a custom PATCH due to the lack of transactions of MongoDB;
we cannot undelete both project-referenced files and file-referenced
projects in one atomic operation.
2018-01-31 14:15:23 +01:00
Francesco Siddi ed1e348d67 Display publishing status of a texture node only to editors 2018-01-26 16:11:56 +01:00
Sybren A. Stüvel ae7489d8e7 Don't hide form items in CSS
If those should be hidden, it should be done in the form_schema of the
node types, and not with CSS.
2018-01-25 17:31:13 +01:00
Sybren A. Stüvel 666da0adda Show status in texture view_embed 2018-01-25 16:17:26 +01:00
Sybren A. Stüvel 889b5dc1c5 Removed redundant if around for 2018-01-25 16:17:18 +01:00
Sybren A. Stüvel b3a36f2833 Fix T49930: bug in texture count 2018-01-25 15:51:15 +01:00
Sybren A. Stüvel 840e8ba29b Fix issue when editing org without IP range.
Stupid JavaScript ''.split('\n') results in Array('') instead of Array().
2018-01-25 14:35:33 +01:00
Sybren A. Stüvel 6a17949fdf Added Roles & Capabilities page to user settings
Thanks @fsiddi for helping with the explanatory text.
2018-01-25 14:01:28 +01:00
Sybren A. Stüvel 0a0c47205f Use Jinja2 inheritance to render settings pages.
This gives us more flexibility than using {% include %}.
2018-01-25 14:01:28 +01:00
Sybren A. Stüvel 270bb21646 Support IP range editing in Organization view_embed 2018-01-25 14:01:28 +01:00
Francesco Siddi 0eca0c706f Introducing overridable comments list rendering
By refactoring part of comments_for_node into a dedicated function called render_comments_for_node, we enable Pillar apps to override the comment url and determine in each app what are the conditions that allow a user to post.
Further, we introduce an extensible and overridable list_embed.pug, which currently defines custom blocks for when the user is allowed and not allowed to post a comment,
2018-01-20 00:43:54 +01:00
Francesco Siddi 4da7a84c86 Fix for broken urls in blog list
This actually undoes commits 90c62664a6 and 18fe240b93 and simply adds the node.url property when rendering a post in the posts_view function. This is what the template macro actually expected in the first place.
2018-01-18 16:02:29 +01:00
Francesco Siddi 90c62664a6 Fix for broken url in blog post title and meta 2018-01-18 12:30:06 +01:00
Francesco Siddi 18fe240b93 Fix for broken url in blog post header image 2018-01-18 11:37:55 +01:00
Francesco Siddi bdff391440 Support for rendering of video file attachments 2018-01-17 15:55:25 +01:00
Sybren A. Stüvel ca3d99c52c Search JS: fixed node type display 2018-01-10 17:23:11 +01:00
Sybren A. Stüvel 55ccd39960 removed debug log entries 2018-01-10 17:23:06 +01:00
Sybren A. Stüvel 61673ef273 Search: implemented pagination
- Got rid of the nasty off-by-one logic in the JavaScript.
- Implemented pagination at the API.
2018-01-10 17:07:21 +01:00
Sybren A. Stüvel 6a9c27f8bf Removed console.log JS 2018-01-05 17:39:38 +01:00
Sybren A. Stüvel 36aad45b26 Asset search JS: show creation timestamps 2018-01-05 17:23:40 +01:00
Sybren A. Stüvel 67851752fa Search JS: more stupid and thus more reliable repeat query filtering 2018-01-05 17:02:42 +01:00
Sybren A. Stüvel 999c1a3fa6 Formatting 2018-01-05 16:26:41 +01:00
Sybren A. Stüvel a574a75610 Advanced search JS: avoid re-querying for the same thing 2018-01-05 16:10:24 +01:00
Sybren A. Stüvel 72c01cc743 Admin user search actually uses the right end-point 2018-01-05 15:51:41 +01:00