move add new folder and move to folder into one dialog box

this lets us combine the two actions to create "Move to a new folder".
If the user hits enter rather than clicking a button, there is a hidden
submit button that (for now) prevents them from taking any action.
A future commit will try and understand what the user might be doing
based on which fields are populated/selected.
This commit is contained in:
Leo Hemsted
2018-11-15 17:31:07 +00:00
parent 9dec9ed626
commit 690585c017
4 changed files with 51 additions and 34 deletions

View File

@@ -2,6 +2,10 @@
{% from "components/page-footer.html" import page_footer %}
{% if templates_and_folders_form.move_to.choices and template_list.templates_to_show %}
<button type="submit" name="operation" value="unknown" hidden></button>
{{ radios(templates_and_folders_form.move_to) }}
{{ page_footer('Move selected', button_name='operation', button_value='move') }}
{{ page_footer('Move', button_name='operation', button_value='move_to_existing_folder') }}
{{ textbox(templates_and_folders_form.new_folder_name) }}
{{ page_footer('Move to a new folder', button_name='operation', button_value='move_to_new_folder') }}
{{ page_footer('New folder', button_name='operation', button_value='add_new_folder') }}
{% endif %}

View File

@@ -85,11 +85,6 @@
{% endwith %}
{% endcall %}
{% call form_wrapper() %}
{{ textbox(add_folder_form.name) }}
{{ page_footer('New folder', button_name='operation', button_value='add_new_folder') }}
{% endcall %}
{% else %}
{% include 'views/templates/_template_list.html' %}
{% endif %}