Merge pull request #2792 from alphagov/Fix-sticky-menu-content

Updated new template menu content
This commit is contained in:
Chris Hill-Scott
2019-02-20 16:02:39 +00:00
committed by GitHub
5 changed files with 20 additions and 20 deletions

View File

@@ -197,7 +197,7 @@
<div id="items_selected">
<div class="js-stick-at-bottom-when-scrolling">
<button class="button-secondary" value="move-to-existing-folder">Move</button>
<button class="button-secondary" value="move-to-new-folder">Add to a new folder</button>
<button class="button-secondary" value="move-to-new-folder">Add to new folder</button>
<div class="template-list-selected-counter">
<span class="template-list-selected-counter-count">1</span> selected
</div>

View File

@@ -1233,10 +1233,10 @@ class TemplateAndFoldersSelectionForm(Form):
]
self.add_template_by_template_type.choices = list(filter(None, [
('email', 'Email template'),
('sms', 'Text message template'),
('letter', 'Letter template') if allow_adding_letter_template else None,
('copy-existing', 'Copy of an existing template') if allow_adding_copy_of_template else None,
('email', 'Email'),
('sms', 'Text message'),
('letter', 'Letter') if allow_adding_letter_template else None,
('copy-existing', 'Copy an existing template') if allow_adding_copy_of_template else None,
]))
def is_selected(self, template_folder_id):
@@ -1277,7 +1277,7 @@ class TemplateAndFoldersSelectionForm(Form):
add_new_folder_name = StringField('Folder name', validators=[required_for_ops('add-new-folder')])
move_to_new_folder_name = StringField('Folder name', validators=[required_for_ops('move-to-new-folder')])
add_template_by_template_type = RadioFieldWithRequiredMessage('Add new', validators=[
add_template_by_template_type = RadioFieldWithRequiredMessage('New template', validators=[
required_for_ops('add-new-template'),
Optional(),
], required_message='Select the type of template you want to add')

View File

@@ -15,17 +15,17 @@
</div>
<div id="move_to_new_folder_form">
<fieldset class="js-will-stick-at-bottom-when-scrolling">
<legend class="visuallyhidden">Move to a new folder</legend>
<legend class="visuallyhidden">Add to new folder</legend>
{{ textbox(templates_and_folders_form.move_to_new_folder_name, width='1-1') }}
{{ page_footer('Move to a new folder', button_name='operation', button_value='move-to-new-folder') }}
{{ page_footer('Add to new folder', button_name='operation', button_value='move-to-new-folder') }}
</fieldset>
</div>
{% endif %}
<div id="add_new_folder_form">
<fieldset class="js-will-stick-at-bottom-when-scrolling">
<legend class="visuallyhidden">Add a new folder</legend>
<legend class="visuallyhidden">Add new folder</legend>
{{ textbox(templates_and_folders_form.add_new_folder_name, width='1-1') }}
{{ page_footer('New folder', button_name='operation', button_value='add-new-folder') }}
{{ page_footer('Add new folder', button_name='operation', button_value='add-new-folder') }}
</fieldset>
</div>
<div id="add_new_template_form">

View File

@@ -55,11 +55,11 @@ def test_letters_lets_in_without_permission(
@pytest.mark.parametrize('permissions, choices', [
(
['email', 'sms', 'letter'],
['Email template', 'Text message template', 'Letter template', 'Copy of an existing template']
['Email', 'Text message', 'Letter', 'Copy an existing template']
),
(
['email', 'sms'],
['Email template', 'Text message template', 'Copy of an existing template']
['Email', 'Text message', 'Copy an existing template']
),
])
def test_given_option_to_add_letters_if_allowed(

View File

@@ -290,9 +290,9 @@ def test_should_show_live_search_if_service_has_lots_of_folders(
'sms',
'copy-existing',
], [
'Email template',
'Text message template',
'Copy of an existing template',
'Email',
'Text message',
'Copy an existing template',
]),
pytest.param(['letter'], [
'email',
@@ -300,10 +300,10 @@ def test_should_show_live_search_if_service_has_lots_of_folders(
'letter',
'copy-existing',
], [
'Email template',
'Text message template',
'Letter template',
'Copy of an existing template',
'Email',
'Text message',
'Letter',
'Copy an existing template',
]),
))
def test_should_show_new_template_choices_if_service_has_folder_permission(
@@ -327,7 +327,7 @@ def test_should_show_new_template_choices_if_service_has_folder_permission(
raise ElementNotFound()
assert normalize_spaces(page.select_one('#add_new_template_form fieldset legend').text) == (
'Add new'
'New template'
)
assert [
choice['value'] for choice in page.select('#add_new_template_form input[type=radio]')