-
-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add filter action to achievements manager.
Achievements can now be filtered based off of selected achievements, match multiple IDs, match a single category, enabled, and disabled. This also adds the javascript form validation.
- Loading branch information
Showing
5 changed files
with
190 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
templates/ContentGenerator/Instructor/AchievementList/filter_form.html.ep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<div> | ||
<div class="row mb-2"> | ||
<%= label_for filter_select => maketext('Show which achievements?'), | ||
class => 'col-form-label col-form-label-sm col-sm-auto' =%> | ||
<div class="col-auto"> | ||
<%= select_field 'action.filter.scope' => [ | ||
[ maketext('all course achievements') => 'all' ], | ||
[ maketext('selected achievements') => 'selected' ], | ||
[ maketext('enter matching achievement IDs below') => 'match_ids', selected => undef ], | ||
[ maketext('enter matching category below') => 'match_category' ], | ||
[ maketext('enabled achievements') => 'enabled' ], | ||
[ maketext('disabled achievements') => 'disabled' ] | ||
], | ||
id => 'filter_select', class => 'form-select form-select-sm' =%> | ||
</div> | ||
</div> | ||
<div id="filter_text_elements" class="row mb-2"> | ||
<%= label_for 'filter_text', class => 'col-form-label col-form-label-sm col-sm-auto', begin =%> | ||
<%= maketext('Match on what? (separate multiple IDs with commas)') =%> | ||
<span class="required-field">*</span> | ||
<% end =%> | ||
<div class="col-auto"> | ||
<%= text_field 'action.filter.achievement_ids' => '', id => 'filter_text', 'aria-required' => 'true', | ||
class => 'form-control form-control-sm', dir => 'ltr' =%> | ||
</div> | ||
</div> | ||
<div id="filter_text_err_msg" class="alert alert-danger p-1 mb-2 d-inline-flex d-none"> | ||
<%= maketext('Please enter a list of IDs to match.') %> | ||
</div> | ||
<div id="filter_category_elements" class="row mb-2"> | ||
<%= label_for 'filter_category', class => 'col-form-label col-form-label-sm col-sm-auto', begin =%> | ||
<%= maketext('Match on which category? (enter in exact match)') =%> | ||
<span class="required-field">*</span> | ||
<% end =%> | ||
<div class="col-auto"> | ||
<%= text_field 'action.filter.category' => '', id => 'filter_category', 'aria-required' => 'true', | ||
class => 'form-control form-control-sm', dir => 'ltr' =%> | ||
</div> | ||
</div> | ||
<div id="filter_category_err_msg" class="alert alert-danger p-1 mb-2 d-inline-flex d-none"> | ||
<%= maketext('Please enter a category to match.') %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters