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

Add button to undo submission selection in evaluations #5512

Merged
merged 3 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions app/assets/stylesheets/components/table.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@
text-align: right;

&.submissions-table {
text-align: center;

// by default the size of the element in the col is used as width if width is smaller than that element.
// This width is just here to force everything to the right
width: 1px;
Expand Down
12 changes: 8 additions & 4 deletions app/views/feedbacks/_submissions_table.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,19 @@
</td>
<td class="actions submissions-table">
<% if @feedback.submission&.id == submission.id %>
<button class="btn btn-outline" disabled>
<%= t 'submissions.submissions_table.selected' %>
</button>
<%= link_to feedback_path(@feedback, feedback: { submission_id: nil }),
class: "btn btn-outline d-btn-danger",
title: t(".undo_selection_tip"),
data: { confirm: t('.undo_selection_confirm') },
method: :patch do %>
<%= (t '.undo_selection') %>
<% end %>
<% else %>
<%= link_to (t 'submissions.submissions_table.select'),
feedback_path(@feedback, feedback: { submission_id: submission.id }),
class: "btn btn-outline",
title: t(".update-submission"),
confirm: t('.confirm'),
data: { confirm: t('.confirm') },
method: :patch %>
<% end %>
</td>
Expand Down
3 changes: 3 additions & 0 deletions config/locales/views/feedbacks/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ en:
submissions_table:
update-submission: "Change to this submission"
confirm: "Are you sure? All comments on the previous submission will be deleted."
undo_selection: Deselect
undo_selection_tip: Undo the selection of this submission
undo_selection_confirm: Are you sure? All comments on the current submission will be deleted.
score_card:
total_score: Total grade
evaluation: Evaluation
Expand Down
3 changes: 3 additions & 0 deletions config/locales/views/feedbacks/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ nl:
submissions_table:
update-submission: "Veranderen naar deze oplossing"
confirm: "Ben je zeker? Alle opmerkingen op de vorige oplossing zullen verwijderd worden."
undo_selection: Selectie wissen
undo_selection_tip: Selectie van deze oplossing ongedaan maken
undo_selection_confirm: "Ben je zeker? Alle opmerkingen op de huidige oplossing zullen verwijderd worden."
score_card:
total_score: Totaalscore
evaluation: Evaluatie
Expand Down