From a1fc47d386773ce28837458f1430f26ab7aa925a Mon Sep 17 00:00:00 2001 From: ArtOfCode- Date: Fri, 18 May 2018 21:29:50 +0100 Subject: [PATCH] Responses view --- app/views/review_queues/_responses.html.erb | 37 +++++++++++---------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/app/views/review_queues/_responses.html.erb b/app/views/review_queues/_responses.html.erb index 6c125f068..9d5353fe0 100644 --- a/app/views/review_queues/_responses.html.erb +++ b/app/views/review_queues/_responses.html.erb @@ -2,25 +2,26 @@
<% if (item.completed and ReviewResult.where(item: item).where.not(result: "skip").exists?) or ReviewResult.where(user: current_user, item: item).where.not(result: "skip").exists? %> -
- <% if item.completed %> - Review completed. - <% else %> - You have already reviewed this item. It needs more reviews from other users to be completed. - <% end %> -
- <% ReviewResult.where(item: item).each do |result| %> - <%= result.user.username %> - <%= time_ago_in_words(result.created_at.to_s) %> - - ago: <%= result.result.titleize %> -
- <% end %> +
+ <% if item.completed %> + Review completed. + <% else %> + You have already reviewed this item. It needs more reviews from other users to be completed. + <% end %> +
+ +

+ <% item.results.each do |result| %> + <%= result.user.username %> + + <%= time_ago_in_words(result.created_at.to_s) %> + + ago: <%= result.result == 'skip' ? 'Skip' : queue.responses.to_h[result.result] %> +
+ <% end %> +

- <%= link_to 'Next', 'javascript:void(0)', class: 'btn btn-primary review-next-link' %> + <%= link_to 'Next', 'javascript:void(0)', class: 'btn btn-primary review-next-link' %> <% else %> <% queue.responses.each do |r| %> <%= link_to r[0], submit_review_path(name: queue.name, item_id: item.id, response: r[1]), class: 'btn btn-primary review-submit-link',