Skip to content

Commit

Permalink
Ensure all admin users stay unchecked after error.
Browse files Browse the repository at this point in the history
When adding a new course, and someone unchecks all admin users to
be copied to the new course, ensure they stay unchecked if an error
occurs and the page is reloaded.
  • Loading branch information
somiaj committed Nov 11, 2024
1 parent 864cd8f commit 7dd7140
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<div class="form-check">
<label class="form-check-label">
<%= check_box 'add-admin-users' => $user, class => 'form-check-input',
$val == 20 ? (checked => undef) : () =%>
$val == 20 && !param('last_page_was_add_course') ? (checked => undef) : () =%>
<%= "$user ($role)" %>
</label>
</div>
Expand Down Expand Up @@ -211,6 +211,7 @@
</label>
</div>
</fieldset>
<%= hidden_field add_dbLayout => 'sql_single' =%>
<%= hidden_field add_dbLayout => 'sql_single' =%>
<%= hidden_field last_page_was_add_course => 1 =%>
<%= submit_button maketext('Add Course'), name => 'add_course', class => 'btn btn-primary' =%>
<% end =%>

0 comments on commit 7dd7140

Please sign in to comment.