From 64e3595c6e6cf81b762e7eccea0642acbbe83416 Mon Sep 17 00:00:00 2001 From: Damilola Oladele <98895460+activus-d@users.noreply.github.com> Date: Fri, 21 Oct 2022 00:32:50 +0100 Subject: [PATCH] Grammatical adjustments of advanced topic `Documents` (#9426) --- docs/advanced_topics/documents/custom_document_model.md | 6 +++--- .../advanced_topics/documents/title_generation_on_upload.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/advanced_topics/documents/custom_document_model.md b/docs/advanced_topics/documents/custom_document_model.md index c834a5a4ca..c0f9f79c94 100644 --- a/docs/advanced_topics/documents/custom_document_model.md +++ b/docs/advanced_topics/documents/custom_document_model.md @@ -41,15 +41,15 @@ WAGTAILDOCS_DOCUMENT_MODEL = 'app_label.CustomDocument' ``` ```{note} -Migrating from the builtin document model +Migrating from the built-in document model: When changing an existing site to use a custom document model, no documents will be copied to the new model automatically. Copying old documents to the new model would need to be done manually with a {ref}`data migration `. -Any templates that reference the builtin document model will still continue -to work as before. +Templates that reference the built-in document model will continue +to work as before ``` ## Referring to the document model diff --git a/docs/advanced_topics/documents/title_generation_on_upload.md b/docs/advanced_topics/documents/title_generation_on_upload.md index be00a975f6..1beac2b566 100644 --- a/docs/advanced_topics/documents/title_generation_on_upload.md +++ b/docs/advanced_topics/documents/title_generation_on_upload.md @@ -8,11 +8,11 @@ You can also customise this [same behaviour for images](../images/title_generati You can customise the resolved value of this title using a JavaScript [event listener](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener) which will listen to the `'wagtail:documents-upload'` event. -The simplest way to add JavaScript to the editor is via the [`insert_global_admin_js` hook](insert_global_admin_js), however any JavaScript that adds the event listener will work. +The simplest way to add JavaScript to the editor is via the [`insert_global_admin_js` hook](insert_global_admin_js). However, any JavaScript that adds an event listener will work. ## DOM Event -The event name to listen for is `'wagtail:documents-upload'`. It will be dispatched on the document upload `form`. The event's `detail` attribute will contain: +The event name to listen to is `'wagtail:documents-upload'`. It will be dispatched on the document upload `form`. The event's `detail` attribute will contain: - `data` - An object which includes the `title` to be used. It is the filename with the extension removed. - `maxTitleLength` - An integer (or `null`) which is the maximum length of the `Document` model title field. @@ -58,7 +58,7 @@ def get_global_admin_js(): ### Changing generated titles on the page editor only to remove dashes/underscores -Using the [`insert_editor_js` hook](insert_editor_js) instead so that this script will not run on the `Document` upload page, only on page editors. +Use the [`insert_editor_js` hook](insert_editor_js) instead so that this script will run only on page editors and not on the `Document`. ```python # wagtail_hooks.py