Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old url redirection and add form reset #1012

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,10 @@

<!-- Validate -->
<div class="btn-group pull-right mb-2">
<button type="button" class="btn btn-danger btn-block m-1 p-2 pl-4 pr-4" onclick="window.location.href='{{get_homepath()}}/admin/{{course.get_id()}}/new_submissions'">
<button id="reset_button" type="button" class="btn btn-danger btn-block m-1 p-2 pl-4 pr-4" onclick="document.getElementById('select_form').reset();document.getElementById('filter_button').click();">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This quite a stretch and not optimal. The actual solutions simply redirects to a page (with a url we need to change).
Your solution resets the form, submits the default filter to the server, the server handles it and responds to the frontend which redirects you to the page.

Just change the URL of the actual code : onclick="window.location.href='{{get_homepath()}}/admin/{{course.get_id()}}/submissions'"

<i class="fa fa-undo"></i> {{ _("Reset") }}
</button>
<button type="submit" class="btn btn-primary btn-block m-1 p-2 pl-4 pr-4">
<button id="filter_button" type="submit" class="btn btn-primary btn-block m-1 p-2 pl-4 pr-4">
<i class="fa fa-check"></i> {{ _("Filter") }}
</button>
</div>
Expand Down
Loading