diff --git a/htdocs/js/AchievementList/achievementlist.js b/htdocs/js/AchievementList/achievementlist.js index 878a90fe8c..ae4e8059cd 100644 --- a/htdocs/js/AchievementList/achievementlist.js +++ b/htdocs/js/AchievementList/achievementlist.js @@ -1,20 +1,48 @@ (() => { // Action form validation. + const show_errors = (ids, elements) => { + for (const id of ids) elements.push(document.getElementById(id)); + for (const element of elements) { + if (element?.id.endsWith('_err_msg')) { + element?.classList.remove('d-none'); + } else { + element?.classList.add('is-invalid'); + element?.addEventListener('change', hide_errors([], elements)); + } + } + }; + + const hide_errors = (ids, elements) => { + return () => { + for (const id of ids) elements.push(document.getElementById(id)); + for (const element of elements) { + if (element?.id.endsWith('_err_msg')) { + element?.classList.add('d-none'); + if (element.id === 'select_achievement_err_msg') + document.getElementById('achievement-table')?.removeEventListener('change', hide_errors); + } else { + element?.classList.remove('is-invalid'); + element?.removeEventListener('change', hide_errors); + } + } + }; + }; + const is_achievement_selected = () => { for (const achievement of document.getElementsByName('selected_achievements')) { if (achievement.checked) return true; } - document.getElementById('select_achievement_err_msg')?.classList.remove('d-none'); - document.getElementById('achievement-table')?.addEventListener( - 'change', - () => { - document.getElementById('select_achievement_err_msg')?.classList.add('d-none'); - for (const id of ['filter_select', 'edit_select', 'assign_select', 'export_select', 'score_select']) { - document.getElementById(id)?.classList.remove('is-invalid'); - } - }, - { once: true } - ); + const err_msg = document.getElementById('select_achievement_err_msg'); + err_msg?.classList.remove('d-none'); + document + .getElementById('achievement-table') + ?.addEventListener( + 'change', + hide_errors( + ['filter_select', 'edit_select', 'assign_select', 'export_select', 'score_select'], + [err_msg] + ) + ); return false; }; @@ -28,158 +56,41 @@ if (filter === 'selected' && !is_achievement_selected()) { e.preventDefault(); e.stopPropagation(); - filter_select?.classList.add('is-invalid'); - filter_select?.addEventListener( - 'change', - () => { - document.getElementById('select_achievement_err_msg').classList.add('d-none'); - document.getElementById('filter_select').classList.remove('is-invalid'); - }, - { once: true } - ); + show_errors(['select_achievement_err_msg'], [filter_select]); } else if (filter === 'match_ids' && filter_text?.value === '') { e.preventDefault(); e.stopPropagation(); - document.getElementById('filter_text_err_msg')?.classList.remove('d-none'); - filter_select?.classList.add('is-invalid'); - filter_text?.classList.add('is-invalid'); - filter_text?.addEventListener( - 'change', - () => { - document.getElementById('filter_text_err_msg')?.classList.add('d-none'); - document.getElementById('filter_text')?.classList.remove('is-invalid'); - document.getElementById('filter_select')?.classList.remove('is-invalid'); - }, - { once: true } - ); - filter_select?.addEventListener( - 'change', - () => { - document.getElementById('filter_text_err_msg')?.classList.add('d-none'); - document.getElementById('filter_text')?.classList.remove('is-invalid'); - document.getElementById('filter_select')?.classList.remove('is-invalid'); - }, - { once: true } - ); + show_errors(['filter_text_err_msg'], [filter_select, filter_text]); } else if (filter === 'match_category' && filter_category?.value === '') { e.preventDefault(); e.stopPropagation(); - document.getElementById('filter_category_err_msg')?.classList.remove('d-none'); - filter_select?.classList.add('is-invalid'); - filter_category?.classList.add('is-invalid'); - filter_category?.addEventListener( - 'change', - () => { - document.getElementById('filter_category_err_msg')?.classList.add('d-none'); - document.getElementById('filter_category')?.classList.remove('is-invalid'); - document.getElementById('filter_select')?.classList.remove('is-invalid'); - }, - { once: true } - ); - filter_select?.addEventListener( - 'change', - () => { - document.getElementById('filter_category_err_msg')?.classList.add('d-none'); - document.getElementById('filter_category')?.classList.remove('is-invalid'); - document.getElementById('filter_select')?.classList.remove('is-invalid'); - }, - { once: true } - ); - } - } else if (action === 'edit') { - const edit_select = document.getElementById('edit_select'); - if (edit_select.value === 'selected' && !is_achievement_selected()) { - e.preventDefault(); - e.stopPropagation(); - edit_select.classList.add('is-invalid'); - edit_select.addEventListener( - 'change', - () => { - document.getElementById('select_achievement_err_msg')?.classList.add('d-none'); - document.getElementById('edit_select')?.classList.remove('is-invalid'); - }, - { once: true } - ); + show_errors(['filter_category_err_msg'], [filter_select, filter_category]); } - } else if (action === 'assign') { - const assign_select = document.getElementById('assign_select'); - if (assign_select.value === 'selected' && !is_achievement_selected()) { + } else if (['edit', 'assign', 'export', 'score'].includes(action)) { + const action_select = document.getElementById(`${action}_select`); + if (action_select.value === 'selected' && !is_achievement_selected()) { e.preventDefault(); e.stopPropagation(); - assign_select.classList.add('is-invalid'); - assign_select.addEventListener( - 'change', - () => { - document.getElementById('select_achievement_err_msg')?.classList.add('d-none'); - document.getElementById('assign_select')?.classList.remove('is-invalid'); - }, - { once: true } - ); + show_errors(['select_achievement_err_msg'], [action_select]); } } else if (action === 'import') { const import_file = document.getElementById('import_file_select'); if (!import_file.value.endsWith('.axp')) { e.preventDefault(); e.stopPropagation(); - document.getElementById('import_file_err_msg')?.classList.remove('d-none'); - import_file.classList.add('is-invalid'); - import_file.addEventListener( - 'change', - () => { - document.getElementById('import_file_err_msg')?.classList.add('d-none'); - document.getElementById('import_file_select')?.classList.remove('is-invalid'); - }, - { once: true } - ); - } - } else if (action === 'export') { - const export_select = document.getElementById('export_select'); - if (export_select.value === 'selected' && !is_achievement_selected()) { - e.preventDefault(); - e.stopPropagation(); - export_select.classList.add('is-invalid'); - export_select.addEventListener( - 'change', - () => { - document.getElementById('select_achievement_err_msg')?.classList.add('d-none'); - document.getElementById('export_select')?.classList.remove('is-invalid'); - }, - { once: true } - ); - } - } else if (action === 'score') { - const score_select = document.getElementById('score_select'); - if (export_select.value === 'selected' && !is_achievement_selected()) { - e.preventDefault(); - e.stopPropagation(); - score_select.classList.add('is-invalid'); - score_select.addEventListener( - 'change', - () => { - document.getElementById('select_achievement_err_msg')?.classList.add('d-none'); - document.getElementById('score_select')?.classList.remove('is-invalid'); - }, - { once: true } - ); + show_errors(['import_file_err_msg'], [import_file]); } } else if (action === 'create') { const create_text = document.getElementById('create_text'); + const create_select = document.getElementById('create_select'); if (create_text.value === '') { e.preventDefault(); e.stopPropagation(); - document.getElementById('create_file_err_msg')?.classList.remove('d-none'); - create_text.classList.add('is-invalid'); - create_text.addEventListener( - 'change', - () => { - document.getElementById('create_file_err_msg')?.classList.add('d-none'); - document.getElementById('create_text')?.classList.remove('is-invalid'); - }, - { once: true } - ); - } else if (document.getElementById('create_select')?.value == 'copy' && !is_achievement_selected()) { + show_errors(['create_file_err_msg'], [create_text]); + } else if (create_select?.value == 'copy' && !is_achievement_selected()) { e.preventDefault(); e.stopPropagation(); + show_errors(['select_achievement_err_msg'], [create_select]); } } else if (action === 'delete') { const delete_confirm = document.getElementById('delete_select'); @@ -189,16 +100,7 @@ } else if (delete_confirm.value != 'yes') { e.preventDefault(); e.stopPropagation(); - document.getElementById('delete_confirm_err_msg')?.classList.remove('d-none'); - delete_confirm.classList.add('is-invalid'); - delete_confirm.addEventListener( - 'change', - () => { - document.getElementById('delete_select')?.classList.remove('is-invalid'); - document.getElementById('delete_confirm_err_msg')?.classList.add('d-none'); - }, - { once: true } - ); + show_errors(['delete_confirm_err_msg'], [delete_confirm]); } } }); @@ -206,13 +108,10 @@ // Remove all error messages when changing tabs. for (const tab of document.querySelectorAll('a[data-bs-toggle="tab"]')) { tab.addEventListener('shown.bs.tab', () => { - const actionForm = document.getElementById('achievement-list'); - for (const err_msg of actionForm.querySelectorAll('div[id$=_err_msg]')) { - err_msg.classList.add('d-none'); - } - for (const invalid of actionForm.querySelectorAll('.is-invalid')) { - invalid.classList.remove('is-invalid'); - } + hide_errors( + [], + document.getElementById('achievement-list')?.querySelectorAll('div[id$=_err_msg], .is-invalid') + )(); }); } @@ -223,7 +122,7 @@ const filterElementToggle = () => { if (filter_select?.value === 'match_ids') filter_text_elements.style.display = 'flex'; else filter_text_elements.style.display = 'none'; - if (filter_select?.value === 'match_category' ) filter_category_elements.style.display = 'flex'; + if (filter_select?.value === 'match_category') filter_category_elements.style.display = 'flex'; else filter_category_elements.style.display = 'none'; }; diff --git a/htdocs/js/ProblemSetList/problemsetlist.js b/htdocs/js/ProblemSetList/problemsetlist.js index bdcfd6814a..7eaec0261f 100644 --- a/htdocs/js/ProblemSetList/problemsetlist.js +++ b/htdocs/js/ProblemSetList/problemsetlist.js @@ -1,157 +1,96 @@ (() => { // Action form validation. + const show_errors = (ids, elements) => { + for (const id of ids) elements.push(document.getElementById(id)); + for (const element of elements) { + if (element?.id.endsWith('_err_msg')) { + element?.classList.remove('d-none'); + } else { + element?.classList.add('is-invalid'); + element?.addEventListener('change', hide_errors([], elements)); + } + } + }; + + const hide_errors = (ids, elements) => { + return () => { + for (const id of ids) elements.push(document.getElementById(id)); + for (const element of elements) { + if (element?.id.endsWith('_err_msg')) { + element?.classList.add('d-none'); + if (element.id === 'select_set_err_msg') + document.getElementById('set_table_id')?.removeEventListener('change', hide_errors); + } else { + element?.classList.remove('is-invalid'); + element?.removeEventListener('change', hide_errors); + } + } + }; + }; + const is_set_selected = () => { for (const set of document.getElementsByName('selected_sets')) { if (set.checked) return true; } - document.getElementById('select_set_err_msg')?.classList.remove('d-none'); - document.getElementById('set_table_id')?.addEventListener( - 'change', - () => { - document.getElementById('select_set_err_msg')?.classList.add('d-none'); - for (const id of [ - 'filter_select', - 'edit_select', - 'publish_filter_select', - 'export_select', - 'score_select' - ]) { - document.getElementById(id)?.classList.remove('is-invalid'); - } - }, - { once: true } - ); + const err_msg = document.getElementById('select_set_err_msg'); + err_msg?.classList.remove('d-none'); + document + .getElementById('set_table_id') + ?.addEventListener( + 'change', + hide_errors( + ['filter_select', 'edit_select', 'publish_filter_select', 'export_select', 'score_select'], + [err_msg] + ) + ); return false; }; document.getElementById('problemsetlist')?.addEventListener('submit', (e) => { const action = document.getElementById('current_action')?.value || ''; if (action === 'filter') { - const filter = document.getElementById('filter_select')?.value || ''; + const filter_select = document.getElementById('filter_select'); + const filter = filter_select?.value || ''; const filter_text = document.getElementById('filter_text'); if (filter === 'selected' && !is_set_selected()) { e.preventDefault(); e.stopPropagation(); - document.getElementById('filter_select')?.addEventListener( - 'change', - () => { - document.getElementById('select_set_err_msg')?.classList.add('d-none'); - }, - { once: true } - ); + show_errors(['select_set_err_msg'], [filter_select]); } else if (filter === 'match_ids' && filter_text.value === '') { e.preventDefault(); e.stopPropagation(); - document.getElementById('filter_err_msg')?.classList.remove('d-none'); - filter_text.classList.add('is-invalid'); - filter_text.addEventListener( - 'change', - () => { - document.getElementById('filter_err_msg')?.classList.add('d-none'); - document.getElementById('filter_text')?.classList.remove('is-invalid'); - }, - { once: true } - ); - } - } else if (action === 'edit') { - const edit_select = document.getElementById('edit_select'); - if (edit_select.value === 'selected' && !is_set_selected()) { - e.preventDefault(); - e.stopPropagation(); - edit_select.classList.add('is-invalid'); - edit_select.addEventListener( - 'change', - () => { - document.getElementById('select_set_err_msg')?.classList.add('d-none'); - document.getElementById('edit_select')?.classList.remove('is-invalid'); - }, - { once: true } - ); - } - } else if (action === 'publish') { - const publish_select = document.getElementById('publish_filter_select'); - if (publish_select.value === 'selected' && !is_set_selected()) { - e.preventDefault(); - e.stopPropagation(); - publish_select.classList.add('is-invalid'); - publish_select.addEventListener( - 'change', - () => { - document.getElementById('select_set_err_msg')?.classList.add('d-none'); - document.getElementById('publish_filter_select')?.classList.remove('is-invalid'); - }, - { once: true } - ); + show_errors(['filter_err_msg'], [filter_select, filter_text]); } - } else if (action === 'export') { - const export_select = document.getElementById('export_select'); - if (export_select.value === 'selected' && !is_set_selected()) { + } else if (['edit', 'publish', 'export', 'score'].includes(action)) { + const action_select = document.getElementById(`${action}_select`); + if (action_select.value === 'selected' && !is_set_selected()) { e.preventDefault(); e.stopPropagation(); - export_select.classList.add('is-invalid'); - export_select.addEventListener( - 'change', - () => { - document.getElementById('select_set_err_msg')?.classList.add('d-none'); - document.getElementById('export_select')?.classList.remove('is-invalid'); - }, - { once: true } - ); + show_errors(['select_set_err_msg'], [action_select]); } } else if (action === 'save_export') { if (!is_set_selected()) { e.preventDefault(); e.stopPropagation(); } - } else if (action === 'score') { - const score_select = document.getElementById('score_select'); - if (score_select.value === 'selected' && !is_set_selected()) { - e.preventDefault(); - e.stopPropagation(); - score_select.classList.add('is-invalid'); - score_select.addEventListener( - 'change', - () => { - document.getElementById('select_set_err_msg')?.classList.add('d-none'); - document.getElementById('score_select')?.classList.remove('is-invalid'); - }, - { once: true } - ); - } } else if (action === 'import') { const import_select = document.getElementById('import_source_select'); if (!import_select.value.endsWith('.def')) { e.preventDefault(); e.stopPropagation(); - document.getElementById('import_file_err_msg')?.classList.remove('d-none'); - import_select.classList.add('is-invalid'); - import_select.addEventListener( - 'change', - () => { - document.getElementById('import_source_select')?.classList.remove('is-invalid'); - document.getElementById('import_file_err_msg')?.classList.add('d-none'); - }, - { once: true } - ); + show_errors(['import_file_err_msg'], [import_select]); } } else if (action === 'create') { const create_text = document.getElementById('create_text'); + const create_select = document.getElementById('create_select'); if (create_text.value === '') { e.preventDefault(); e.stopPropagation(); - document.getElementById('create_file_err_msg')?.classList.remove('d-none'); - create_text.classList.add('is-invalid'); - create_text.addEventListener( - 'change', - () => { - document.getElementById('create_file_err_msg')?.classList.add('d-none'); - document.getElementById('create_text')?.classList.remove('is-invalid'); - }, - { once: true } - ); - } else if (document.getElementById('create_select')?.value == 'copy' && !is_set_selected()) { + show_errors(['create_file_err_msg'], [create_text]); + } else if (create_select?.value == 'copy' && !is_set_selected()) { e.preventDefault(); e.stopPropagation(); + show_errors(['select_set_err_msg'], [create_select]); } } else if (action === 'delete') { const delete_confirm = document.getElementById('delete_select'); @@ -161,16 +100,7 @@ } else if (delete_confirm.value != 'yes') { e.preventDefault(); e.stopPropagation(); - document.getElementById('delete_confirm_err_msg')?.classList.remove('d-none'); - delete_confirm.classList.add('is-invalid'); - delete_confirm.addEventListener( - 'change', - () => { - document.getElementById('delete_select')?.classList.remove('is-invalid'); - document.getElementById('delete_confirm_err_msg')?.classList.add('d-none'); - }, - { once: true } - ); + show_errors(['delete_confirm_err_msg'], [delete_confirm]); } } }); @@ -178,13 +108,10 @@ // Remove all error messages when changing tabs. for (const tab of document.querySelectorAll('a[data-bs-toggle="tab"]')) { tab.addEventListener('shown.bs.tab', () => { - const actionForm = document.getElementById('problemsetlist'); - for (const err_msg of actionForm.querySelectorAll('div[id$=_err_msg]')) { - err_msg.classList.add('d-none'); - } - for (const invalid of actionForm.querySelectorAll('.is-invalid')) { - invalid.classList.remove('is-invalid'); - } + hide_errors( + [], + document.getElementById('problemsetlist')?.querySelectorAll('div[id$=_err_msg], .is-invalid') + )(); }); } diff --git a/htdocs/js/UserList/userlist.js b/htdocs/js/UserList/userlist.js index 338b9e6f8f..697298afff 100644 --- a/htdocs/js/UserList/userlist.js +++ b/htdocs/js/UserList/userlist.js @@ -26,21 +26,46 @@ } // Action form validation. + const show_errors = (ids, elements) => { + for (const id of ids) elements.push(document.getElementById(id)); + for (const element of elements) { + if (element?.id.endsWith('_err_msg')) { + element?.classList.remove('d-none'); + } else { + element?.classList.add('is-invalid'); + element?.addEventListener('change', hide_errors([], elements)); + } + } + }; + + const hide_errors = (ids, elements) => { + return () => { + for (const id of ids) elements.push(document.getElementById(id)); + for (const element of elements) { + if (element?.id.endsWith('_err_msg')) { + element?.classList.add('d-none'); + if (element.id === 'select_user_err_msg') + document.getElementById('classlist-table')?.removeEventListener('change', hide_errors); + } else { + element?.classList.remove('is-invalid'); + element?.removeEventListener('change', hide_errors); + } + } + }; + }; + const is_user_selected = () => { for (const user of document.getElementsByName('selected_users')) { if (user.checked) return true; } - document.getElementById('select_user_err_msg')?.classList.remove('d-none'); - document.getElementById('classlist-table')?.addEventListener( - 'change', - () => { - document.getElementById('select_user_err_msg')?.classList.add('d-none'); - for (const id of ['filter_select', 'edit_select', 'password_select', 'export_select_scope']) { - document.getElementById(id)?.classList.remove('is-invalid'); - } - }, - { once: true } - ); + const err_msg = document.getElementById('select_user_err_msg'); + err_msg?.classList.remove('d-none'); + document + .getElementById('classlist-table') + ?.addEventListener( + 'change', + hide_errors(['filter_select', 'edit_select', 'password_select', 'export_select_scope'], [err_msg]) + ); return false; }; @@ -53,101 +78,31 @@ if (filter === 'selected' && !is_user_selected()) { e.preventDefault(); e.stopPropagation(); - filter_select.classList.add('is-invalid'); - filter_select.addEventListener( - 'change', - () => { - document.getElementById('select_user_err_msg')?.classList.add('d-none'); - document.getElementById('filter_select')?.classList.remove('is-invalid'); - }, - { once: true } - ); + show_errors(['select_user_err_msg'], [filter_select]); } else if (filter === 'match_regex' && filter_text.value === '') { e.preventDefault(); e.stopPropagation(); - document.getElementById('filter_err_msg')?.classList.remove('d-none'); - filter_text.classList.add('is-invalid'); - filter_text.addEventListener( - 'change', - () => { - document.getElementById('filter_text')?.classList.remove('is-invalid'); - document.getElementById('filter_err_msg')?.classList.add('d-none'); - }, - { once: true } - ); + show_errors(['filter_err_msg'], [filter_select, filter_text]); } - } else if (action === 'edit') { - const edit_select = document.getElementById('edit_select'); - if (edit_select.value === 'selected' && !is_user_selected()) { + } else if (['edit', 'password'].includes(action)) { + const action_select = document.getElementById(`${action}_select`); + if (action_select.value === 'selected' && !is_user_selected()) { e.preventDefault(); e.stopPropagation(); - edit_select.classList.add('is-invalid'); - edit_select.addEventListener( - 'change', - () => { - document.getElementById('select_user_err_msg')?.classList.add('d-none'); - document.getElementById('edit_select')?.classList.remove('is-invalid'); - }, - { once: true } - ); - } - } else if (action === 'password') { - const password_select = document.getElementById('password_select'); - if (password_select.value === 'selected' && !is_user_selected()) { - e.preventDefault(); - e.stopPropagation(); - password_select.classList.add('is-invalid'); - password_select.addEventListener( - 'change', - () => { - document.getElementById('select_user_err_msg')?.classList.add('d-none'); - document.getElementById('password_select')?.classList.remove('is-invalid'); - }, - { once: true } - ); + show_errors(['select_user_err_msg'], [action_select]); } } else if (action == 'export') { const export_filename = document.getElementById('export_filename'); const export_select = document.getElementById('export_select_scope'); + const export_select_target = document.getElementById('export_select_target'); if (export_select.value === 'selected' && !is_user_selected()) { e.preventDefault(); e.stopPropagation(); - export_select.classList.add('is-invalid'); - export_select.addEventListener( - 'change', - () => { - document.getElementById('select_user_err_msg')?.classList.add('d-none'); - document.getElementById('export_select_scope')?.classList.remove('is-invalid'); - }, - { once: true } - ); - } else if ( - document.getElementById('export_select_target')?.value === 'new' && - export_filename.value === '' - ) { + show_errors(['select_user_err_msg'], [export_select]); + } else if (export_select_target?.value === 'new' && export_filename.value === '') { e.preventDefault(); e.stopPropagation(); - document.getElementById('export_file_err_msg')?.classList.remove('d-none'); - document.getElementById('export_select_target')?.classList.add('is-invalid'); - export_filename.classList.add('is-invalid'); - export_filename.addEventListener( - 'change', - () => { - document.getElementById('export_filename')?.classList.remove('is-invalid'); - document.getElementById('export_select_target')?.classList.remove('is-invalid'); - document.getElementById('export_file_err_msg')?.classList.add('d-none'); - }, - { once: true } - ); - document.getElementById('export_select_target')?.addEventListener( - 'change', - () => { - document.getElementById('export_filename')?.classList.remove('is-invalid'); - document.getElementById('export_select_target')?.classList.remove('is-invalid'); - document.getElementById('export_file_err_msg')?.classList.add('d-none'); - }, - { once: true } - ); + show_errors(['export_file_err_msg'], [export_filename, export_select_target]); } } else if (action === 'delete') { const delete_confirm = document.getElementById('delete_select'); @@ -157,16 +112,7 @@ } else if (delete_confirm.value != 'yes') { e.preventDefault(); e.stopPropagation(); - document.getElementById('delete_confirm_err_msg')?.classList.remove('d-none'); - delete_confirm.classList.add('is-invalid'); - delete_confirm.addEventListener( - 'change', - () => { - document.getElementById('delete_select')?.classList.remove('is-invalid'); - document.getElementById('delete_confirm_err_msg')?.classList.add('d-none'); - }, - { once: true } - ); + show_errors(['delete_confirm_err_msg'], [delete_confirm]); } } }); @@ -174,13 +120,10 @@ // Remove all error messages when changing tabs. for (const tab of document.querySelectorAll('a[data-bs-toggle="tab"]')) { tab.addEventListener('shown.bs.tab', () => { - const actionForm = document.getElementById('user-list-form'); - for (const err_msg of actionForm.querySelectorAll('div[id$=_err_msg]')) { - err_msg.classList.add('d-none'); - } - for (const invalid of actionForm.querySelectorAll('.is-invalid')) { - invalid.classList.remove('is-invalid'); - } + hide_errors( + [], + document.getElementById('user-list-form')?.querySelectorAll('div[id$=_err_msg], .is-invalid') + )(); }); } })(); diff --git a/templates/ContentGenerator/Instructor/ProblemSetList/publish_form.html.ep b/templates/ContentGenerator/Instructor/ProblemSetList/publish_form.html.ep index fe9b1f0c33..7314cd96a9 100644 --- a/templates/ContentGenerator/Instructor/ProblemSetList/publish_form.html.ep +++ b/templates/ContentGenerator/Instructor/ProblemSetList/publish_form.html.ep @@ -1,13 +1,13 @@
- <%= label_for publish_filter_select => maketext('Choose which sets to be affected') . ':', + <%= label_for publish_select => maketext('Choose which sets to be affected') . ':', class => 'col-form-label col-form-label-sm col-sm-auto' =%>
<%= select_field 'action.publish.scope' => [ [ maketext('all course sets') => 'all' ], [ maketext('selected sets') => 'selected', selected => undef ] ], - id => 'publish_filter_select', class => 'form-select form-select-sm' =%> + id => 'publish_select', class => 'form-select form-select-sm' =%>