From d7515a567236f3cb4a930604937b55db4fc5f07c Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Tue, 4 Jun 2024 09:49:00 +0200 Subject: [PATCH 1/3] Add option to deselect curent submission for evaluation --- app/views/feedbacks/show.html.erb | 5 +++++ config/locales/views/feedbacks/en.yml | 1 + config/locales/views/feedbacks/nl.yml | 1 + 3 files changed, 7 insertions(+) diff --git a/app/views/feedbacks/show.html.erb b/app/views/feedbacks/show.html.erb index 05bcd1bbfe..a2494db995 100644 --- a/app/views/feedbacks/show.html.erb +++ b/app/views/feedbacks/show.html.erb @@ -41,6 +41,11 @@ <%= link_to edit_feedback_path(@feedback) do %> <%= t("feedbacks.edit.select_another_submission") %> <% end %> + <% else %> +
+ <%= link_to edit_feedback_path(@feedback) do %> + <%= t("feedbacks.edit.select_no_submission") %> + <% end %> <% end %> <% elsif @feedback.total_attempts > 0 %> <%= t('.submission.total_attempts_html', count: @feedback.total_attempts) %> diff --git a/config/locales/views/feedbacks/en.yml b/config/locales/views/feedbacks/en.yml index 8f59b7cc6a..a9b49f9984 100644 --- a/config/locales/views/feedbacks/en.yml +++ b/config/locales/views/feedbacks/en.yml @@ -56,6 +56,7 @@ en: short_title: "Select another submission." select_a_submission: "Do select a submission." select_another_submission: "Select another submission." + select_no_submission: "De-select this submission." submissions_table: update-submission: "Change to this submission" confirm: "Are you sure? All comments on the previous submission will be deleted." diff --git a/config/locales/views/feedbacks/nl.yml b/config/locales/views/feedbacks/nl.yml index b1e6606dc3..fc5336cd86 100644 --- a/config/locales/views/feedbacks/nl.yml +++ b/config/locales/views/feedbacks/nl.yml @@ -56,6 +56,7 @@ nl: short_title: "Selecteer een andere ingediende oplossing." select_a_submission: "Selecteer toch een ingediende oplossing." select_another_submission: "Selecteer een andere ingediende oplossing." + select_no_submission: "Selectie van deze oplossing wissen." submissions_table: update-submission: "Veranderen naar deze oplossing" confirm: "Ben je zeker? Alle opmerkingen op de vorige oplossing zullen verwijderd worden." From 3570c6c03704b8109e4a3cf9fcf8d4e59ec18aae Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Tue, 4 Jun 2024 09:53:57 +0200 Subject: [PATCH 2/3] Simplify code --- app/views/feedbacks/show.html.erb | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/app/views/feedbacks/show.html.erb b/app/views/feedbacks/show.html.erb index a2494db995..e94dbca125 100644 --- a/app/views/feedbacks/show.html.erb +++ b/app/views/feedbacks/show.html.erb @@ -36,17 +36,14 @@
<%= t('.submission.later_attempts_html', count: @feedback.later_attempts) %> <% end %> - <% if @feedback.later_attempts + @feedback.previous_attempts > 0 %> -
+
<%= link_to edit_feedback_path(@feedback) do %> - <%= t("feedbacks.edit.select_another_submission") %> + <% if @feedback.later_attempts + @feedback.previous_attempts > 0 %> + <%= t("feedbacks.edit.select_another_submission") %> + <% else %> + <%= t("feedbacks.edit.select_no_submission") %> + <% end %> <% end %> - <% else %> -
- <%= link_to edit_feedback_path(@feedback) do %> - <%= t("feedbacks.edit.select_no_submission") %> - <% end %> - <% end %> <% elsif @feedback.total_attempts > 0 %> <%= t('.submission.total_attempts_html', count: @feedback.total_attempts) %> <%= link_to edit_feedback_path(@feedback) do %> From 75bf47419b1522ae5b84c557ea6e3e4e9284de23 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Tue, 4 Jun 2024 09:54:38 +0200 Subject: [PATCH 3/3] improve layout --- app/views/feedbacks/show.html.erb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/feedbacks/show.html.erb b/app/views/feedbacks/show.html.erb index e94dbca125..b63886611a 100644 --- a/app/views/feedbacks/show.html.erb +++ b/app/views/feedbacks/show.html.erb @@ -36,14 +36,14 @@
<%= t('.submission.later_attempts_html', count: @feedback.later_attempts) %> <% end %> -
- <%= link_to edit_feedback_path(@feedback) do %> - <% if @feedback.later_attempts + @feedback.previous_attempts > 0 %> - <%= t("feedbacks.edit.select_another_submission") %> - <% else %> - <%= t("feedbacks.edit.select_no_submission") %> - <% end %> +
+ <%= link_to edit_feedback_path(@feedback) do %> + <% if @feedback.later_attempts + @feedback.previous_attempts > 0 %> + <%= t("feedbacks.edit.select_another_submission") %> + <% else %> + <%= t("feedbacks.edit.select_no_submission") %> <% end %> + <% end %> <% elsif @feedback.total_attempts > 0 %> <%= t('.submission.total_attempts_html', count: @feedback.total_attempts) %> <%= link_to edit_feedback_path(@feedback) do %>