<% color_for_rating = { -2 => 'red lighten-3', -1 => 'orange lighten-3', 0 => 'grey lighten-3', 1 => 'green lighten-3', 2 => 'blue lighten-3', 3 => 'red lighten-4', } %>

<%= number_with_delimiter @reviewed_commission_count %>

Images rated
<% if params.key?(:rating) %>
Showing <%= pluralize @commissions.count, 'image' %> you rated "<%= case params[:rating].to_i when -2 then 'Very Bad' when -1 then 'Bad' when 0 then 'Meh' when 1 then 'Good' when 2 then 'Great' when 3 then 'Loved' end -%>".
<% else %>
You have <%= 'at least' if @commissions.count >= 50 %> <%= pluralize @commissions.count, 'generated images' %> without feedback.

Feedback is optional but helps Basil understand what he does well and what he could improve on. Below are 50 random images of yours that haven't been rated. You can refresh the page at any time for 50 more. <%= link_to 'View global stats.', basil_stats_path, class: 'orange-text' %>

<% end %>
<%= link_to basil_rating_queue_path do %>
Unrated images
<% end %>
Your ratings
<%= link_to basil_rating_queue_path(rating: 3) do %>
Loved images
<% end %> <%= link_to basil_rating_queue_path(rating: 2) do %>
Very good images
<% end %> <%= link_to basil_rating_queue_path(rating: 1) do %>
Good images
<% end %> <%= link_to basil_rating_queue_path(rating: 0) do %>
Meh images
<% end %> <%= link_to basil_rating_queue_path(rating: -1) do %>
Bad images
<% end %> <%= link_to basil_rating_queue_path(rating: -2) do %>
Very bad images
<% end %>
<%= link_to basil_path do %> chevron_left Back to Basil <% end %>
<% if @commissions.empty? %>

Hurrah, inbox zero!


Your images will appear here when you have any that you haven't rated.

<% end %> <% @commissions.each do |commission| %>
<% if commission.complete? %>
<%= link_to commission.image do %> <%= image_tag commission.image %> <% end %>
<%= link_to commission.entity.name, basil_content_path(content_type: commission.entity_type, id: commission.entity_id) %> <% if commission.style? %> (<%= commission.style.humanize %>) <% end %>
Completed <%= time_ago_in_words commission.completed_at %> ago · Took <%= distance_of_time_in_words commission.completed_at - commission.created_at %>
Feedback for Basil
<%= form_for commission.basil_feedbacks.find_or_initialize_by(user: current_user), url: basil_feedback_path(commission.job_id), method: :POST, remote: true do |f| %> <% f.object.score_adjustment = nil if !f.object.persisted? %>
<% end %>
<% else %>
Basil is still working on this commission... (style: <%= commission.style %>)
(Requested <%= time_ago_in_words(commission.created_at) %> ago)
<% end %>
<% end %>