1943 Commits

Author SHA1 Message Date
aaf452e18b Fixed Cerberus canary unit test
Apparently it's no longer possible for Cerberus to validate its own schemas.
2018-07-13 12:02:40 +02:00
c607eaf23d Added magic custom validation rule schemas in docstrings 2018-07-13 12:02:18 +02:00
baa77a7de5 Merge branch 'master' into wip-flask-one 2018-07-13 11:43:57 +02:00
5fb40eb32b Simple unittests for Cerberus validation 2018-07-13 11:42:31 +02:00
c83a1a21b8 Unpinned a bunch of package versions
This helps us get the latest versions and test with those, instead.
2018-07-13 11:01:22 +02:00
549cf0a3e8 WIP on libraries upgrade 2018-07-12 15:23:57 +02:00
9f380751f5 Support for capabilities check in any shortcode
Use the @capcheck decorator on any shortcode that should support
this. Currently used by iframe and youtube.
2018-07-11 12:32:00 +02:00
49075cbc60 Local development server uses http, not https 2018-06-23 01:25:35 +02:00
81848c2c44 Introducing package-lock.json 2018-06-22 19:38:49 +02:00
9ee7b742ab Make more consistent use of BLENDER_ID_ENDPOINT
Now BLENDER_ID_ENDPOINT is used for the Blender ID OAuth config,
and it's directly accessed when building requests for Blender ID token
validation (without using utility functions).
2018-06-22 19:38:27 +02:00
58c33074c3 Fix unittest for jinja.do_markdown
We were passing invalid html to do_markdown, which was returning a valid
version, by closing the <script> tag.
2018-06-22 17:10:38 +02:00
756427b34e Link Markdown Cheatsheet to CommonMark help 2018-06-10 10:03:56 +02:00
7e06212cd5 CSS: Tweaks to pre/code 2018-06-10 09:41:26 +02:00
ef3912b647 CSS: Fix for emojis on lists 2018-06-10 09:01:44 +02:00
151484dee3 Support parsing of bare links in Markdown text 2018-06-08 19:35:14 +02:00
bec1f209ba Update bleach library from 1.4.3 to 2.1.3 2018-06-08 19:34:39 +02:00
0e14bdd09f Introduce rating functions
These hotness and confidence calculation algorithms come from Reddit
and have been tweaked based on our experience on the Dillo project.
2018-06-03 02:09:20 +02:00
ce6df542cc Add ratings_embedded_schema to node_types
Ratings, like attachments, are a common feature in node_types.
By adding this schema definition, we reduce code duplication.
No functional changes are introduced introduced in this commit.
2018-05-11 01:32:39 +02:00
530302b74f Fix deprecation warning, rename Form to FlaskForm
Starting with flask_wtform version 1.0, Form will be dropped in favor
of FlaskForm.
2018-05-09 22:50:26 +02:00
1bfb6cd2f6 Use high-res image for page and blog headers 2018-05-07 15:26:42 +02:00
53b6210531 Remove unneeded file opening
The statement has been moved to the Docker file of blender-cloud,
where we actually append a generated STATIC_FILE_HASH.
2018-04-21 18:09:42 +02:00
aeaa03ed80 Handle embedded featured nodes to get node_id 2018-04-16 17:30:02 +02:00
3319a578b9 Move secondary navigation rendering to a macro 2018-04-16 16:23:19 +02:00
24d47f0848 Add page node_type to CUSTOM_VIEW_NODE_TYPES
Due to the new templates, we do not need to embed pages in the
project view anymore.
2018-04-16 16:22:38 +02:00
505e3c3a6d New design for project landing pages and blogs 2018-04-16 14:33:38 +02:00
e5259bb56c Config: provide a correct suggestion for SERVER_NAME 2018-04-14 19:31:57 +02:00
8c0c22d801 Home project: sort synced Blender versions by _updated 2018-04-09 13:41:16 +02:00
Kael Baldwin
157eed8321 Fix layout template is_authenticated call
Differential revision: https://developer.blender.org/D3136
2018-04-07 21:39:38 +02:00
9ed526510f Fix preview on public assets 2018-04-05 16:47:06 +02:00
ec2e4dee46 Minor style tweak to assets 2018-04-05 16:47:06 +02:00
c9789f46db {iframe} shortcode no longer requires cap=xxx 2018-04-04 15:44:52 +02:00
289dc39e50 Fixed T54149: Link markup in project description doesn't work
Don't convert MarkDown in JavaScript when we already do it in Python.
2018-04-03 16:23:58 +02:00
22b6673346 Link to {attachment} shortcode documentation 2018-04-03 15:58:23 +02:00
3e7722a567 Expand image for {attachment slug link=self}
Clicking on the image will no longer open it directly, but expand it
instead.
2018-04-03 15:44:24 +02:00
1ba1da49c3 Pass positional arguments to attachment render functions
This allows handling `{attachment slug link}` as a synonym for
`{attachment slug link=self}`.
2018-04-03 15:42:47 +02:00
a71de3a727 Added link to shortcodes documentation
https://pillarframework.org/shortcodes/
2018-04-03 14:43:47 +02:00
67e8e7c082 Disallow spaces in attachment slugs
Slugs shouldn't have spaces. It also interferes with using slugs in
shortcodes.
2018-04-03 13:59:31 +02:00
cbb5d546ef Fixed CLI cmd upgrade_attachment_schema
It didn't add the {'coerce': 'markdown'}, which caused the
upgrade_attachment_usage CLI command to skip 'upgraded' nodes.
2018-04-03 12:49:34 +02:00
a86920fc73 Disallow spaces in attachment slugs 2018-04-03 12:24:42 +02:00
14b31174dc Fixes to upgrade_attachment_schema() for URL-less projects 2018-04-03 11:47:18 +02:00
1cb3a24e2f Only load clipboard.min.js when authenticated
This is used in the attachments form, which is only available to
authenticated users.
2018-04-03 11:27:20 +02:00
a052e754f9 Button "Copy to clipboard" instead of "Add to description"
This allows the user to paste the code wherever they need. For example,
a blog post takes its contents from 'properties.content' and not from
the description field.

I also added an explanation for new attachment shortcode.
2018-04-03 10:59:20 +02:00
3b452d14ce Render attachments with shortcodes rather than slugs
The attachments should now be rendered using `{attachment slug}` instead
of `@[slug]`. The `link` attribute can be specified in the shortcode
(for attachments that support it), rather than in the attachment itself.

The attachment subdocument is now reduced to `{oid: File ObjectID}`, and
nodes without attachments should NOT have an `attachment` property at
all (previously it would be an empty dict). This makes querying for
nodes with/out attachments easier.

The CLI command `upgrade_attachment_schema` can do dry-run and remove
empty attachments:

- Added --go to actually perform the database changes.
- Remove empty attachments, so that a node either has one or more
  attachments or no attachments sub-document at all.

The CLI command `upgrade_attachment_usage` converts `@[slug]` to
`{attachment slug}`. It also takes into account 'link' and 'link_custom'
fields on the attachment. After conversion those fields are removed from
the attachment itself.

Simplified maintentance CLI commands that iterate over all projects:
I've moved the common approach (either run on one project or all of
them, skipping deleted ones, giving a message upon dry-run, and showing
duration of the command) to a new _db_projects() function. The new
function is now used by two recently-touched CLI commands; more of them
could be migrated to use this.
2018-04-03 10:59:20 +02:00
f4e0b9185b Shortcodes for YouTube and iframes
Added shortcodes 2.5.0 as dependency; Earlier versions corrupted
non-ASCII characters, see
https://github.com/dmulholland/shortcodes/issues/6

The rendered elements have a `shortcode` CSS class.

The YouTube shortcode supports various ways to refer to a video:

    - `{youtube VideoID}`
    - `{youtube youtube.com or youtu.be URL}`

URLs containing an '=' should be quoted, or otherwise the shortcodes
library will parse it as "key=value" pair.

The IFrame shortcode supports the `cap` and `nocap` attributes. `cap`
indicates the required capability the user should have in order to
render the tag. If `nocap` is given, its contents are shown as a message
to users who do not have this tag; without it, the iframe is silently
hidden.

`{iframe src='https://source' cap='subscriber' nocap='Subscribe to view'}`

Merged test code + added HTML class for shortcode iframes
2018-04-03 10:49:00 +02:00
0841d52dd1 Removed unused imports 2018-04-03 10:48:40 +02:00
f32630237a Fix Cerberus github URL so that it doesn't require SSH authentication 2018-03-29 16:49:20 +02:00
9ee816d366 Ignore _xxx properties in form generation 2018-03-29 10:38:25 +02:00
d10bdea6c5 Use typewatch for previewing comments 2018-03-28 23:35:59 +02:00
5b061af3a5 WIP on using the new nodes.preview_markdown for comments 2018-03-28 22:53:27 +02:00
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