Skip to content

Commit

Permalink
Improve help texts
Browse files Browse the repository at this point in the history
  • Loading branch information
Nigel2392 committed Apr 20, 2024
1 parent ddfbaa1 commit 6924ff6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions wagtail_fedit/adapters/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class BlockAdapter(BlockFieldReplacementAdapter):
usage_description = "This adapter is used to edit a block of a streamfield."
help_text_dict = {
"block": "the block instance to edit. This can be a regular block isntance or a BoundBlock.",
"block_id": "the block ID to edit, required if block is not a BoundBlock.",
"admin": "if passed; the adapter will display admin URLs.",
"block_id": "the ID of the block to edit, required if block is not a BoundBlock.",
"admin": "if passed; the adapter will a quick- link to the Wagtail Admin for this block.",
}
required_kwargs = [
"block",
Expand Down
2 changes: 1 addition & 1 deletion wagtail_fedit/adapters/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class BackgroundImageFieldAdapter(BaseFieldFuncAdapter):
identifier = "field_bg_image"
usage_description = "This adapter is used for changing a css property of a target element to a background-image."
help_text_dict = {
"target": "the target element to apply the background-image to.",
"target": "the target element to apply the background-image to - this should be a css selector.",
"css_variable_name": "the CSS variable name to apply the background-image to. element.style.setProperty(css_variable_name, url);",
}
required_kwargs = FieldAdapter.required_kwargs + [
Expand Down
3 changes: 2 additions & 1 deletion wagtail_fedit/management/commands/adapter_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def handle(self, *args, **options):
" * The second argument is the model and field to edit. instance.modelfield",
" * Absolute arguments (missing an equal sign) are optional and treated as booleans.",
" * Keyword arguments wrapped in square brackets are optional. [key=value]",
" * The value of the adapter is the value of the field.",
" * Extra keyword arguments are optional; must be serializable to JSON and should not be too complex.",
" This is due to limits in URL-size when sharing context between views.",
]

for identifier, adapter_class in adapter_registry.adapters.items():
Expand Down

0 comments on commit 6924ff6

Please sign in to comment.