add fieldsets to template/folder form and update docstrings

also remove erroneous pytest.ini cfg and reset button
This commit is contained in:
Leo Hemsted
2018-11-27 14:33:50 +00:00
parent d07de58cd9
commit 1bb7e98722
3 changed files with 26 additions and 8 deletions

View File

@@ -1148,6 +1148,21 @@ def required_for_ops(*operations):
class TemplateAndFoldersSelectionForm(Form):
"""
This form also expects the form data to include an operation, based on which submit button is clicked.
If enter is pressed, unknown will be sent by a hidden submit button at the top of the form.
The value of this operation affects which fields are required, expected to be empty, or optional.
* unknown
currently not implemented, but in the future will try and work out if there are any obvious commands that can be
assumed based on which fields are empty vs populated.
* move_to_existing_folder
must have data for templates_and_folders checkboxes, and move_to radios
* move_to_new_folder
must have data for move_to_new_folder_name, cannot have data for move_to_existing_folder_name
* add_new_folder
must have data for move_to_existing_folder_name, cannot have data for move_to_new_folder_name
"""
ALL_TEMPLATES_FOLDER = {
'name': 'All templates',

View File

@@ -8,12 +8,17 @@
{{ page_footer('Move', button_name='operation', button_value='move_to_existing_folder') }}
</div>
<div id="move_to_new_folder_form">
{{ textbox(templates_and_folders_form.move_to_new_folder_name) }}
{{ page_footer('Move to a new folder', button_name='operation', button_value='move_to_new_folder') }}
<fieldset>
<legend class="visuallyhidden">Move to a new folder</legend>
{{ textbox(templates_and_folders_form.move_to_new_folder_name) }}
{{ page_footer('Move to a new folder', button_name='operation', button_value='move_to_new_folder') }}
</fieldset>
</div>
<div id="add_new_folder_form">
{{ textbox(templates_and_folders_form.add_new_folder_name) }}
{{ page_footer('New folder', button_name='operation', button_value='add_new_folder') }}
<fieldset>
<legend class="visuallyhidden">Add a new folder</legend>
{{ textbox(templates_and_folders_form.add_new_folder_name) }}
{{ page_footer('New folder', button_name='operation', button_value='add_new_folder') }}
</fieldset>
</div>
<button type="reset">reset</button>
{% endif %}

View File

@@ -1,4 +1,5 @@
[pytest]
xfail_strict=true
testpaths = tests
log_level = 999
env =
@@ -10,6 +11,3 @@ env =
ZENDESK_API_KEY=test
STATSD_PREFIX=stats-prefix
REDIS_ENABLED=0
# :thinking_face:
filterwarnings =
ignore::pytest.RemovedInPytest4Warning