diff --git a/app/controllers/basil_controller.rb b/app/controllers/basil_controller.rb index 06803c4e..a7115012 100644 --- a/app/controllers/basil_controller.rb +++ b/app/controllers/basil_controller.rb @@ -559,16 +559,23 @@ class BasilController < ApplicationController end def help_rate - # Commissions without feedback: + @reviewed_commission_count = BasilFeedback.where(user: current_user).where.not(score_adjustment: nil).count + @reviewed_commission_ids = BasilFeedback.where(user: current_user) - .pluck(:basil_commission_id) - @commissions = BasilCommission.where.not(id: @reviewed_commission_ids) + if params.key?(:rating) + @reviewed_commission_ids = @reviewed_commission_ids.where(score_adjustment: params[:rating].to_i) + else + # Unreviewed commissions + @reviewed_commission_ids = @reviewed_commission_ids.where(score_adjustment: nil) + end + + @commissions = BasilCommission.where(id: @reviewed_commission_ids.pluck(:basil_commission_id)) .where.not(completed_at: nil) .where(user: current_user) .order(created_at: :desc) .limit(50) .includes(:entity) - .shuffle + .order(completed_at: :desc) end def save diff --git a/app/services/basil_service.rb b/app/services/basil_service.rb index c77b771f..8f39cdb8 100644 --- a/app/services/basil_service.rb +++ b/app/services/basil_service.rb @@ -4,7 +4,7 @@ class BasilService < Service def self.enabled_styles_for(page_type) case page_type when 'Character' - %w(realistic painting sketch digital abstract) + %w(realistic painting sketch digital abstract watercolor) when 'Location' %w(realistic painting sketch) when 'Item' @@ -27,7 +27,7 @@ class BasilService < Service def self.experimental_styles_for(page_type) case page_type when 'Character' - %w(realistic2 realistic3 painting2 painting3 horror watercolor anime) + %w(realistic2 realistic3 painting2 painting3 horror anime) else [] end diff --git a/app/views/basil/content.html.erb b/app/views/basil/content.html.erb index f22e92d1..5af1460f 100644 --- a/app/views/basil/content.html.erb +++ b/app/views/basil/content.html.erb @@ -226,7 +226,7 @@ function commission_basil(style) { <% if @commissions.count == 10 %>
Only your 10 most recent generations are displayed here, but you can still find all of your generated images on the <%= link_to 'Basil Feedback', basil_rating_queue_path %> pages. diff --git a/app/views/basil/help_rate.html.erb b/app/views/basil/help_rate.html.erb index 6d6de1ca..01b72ce6 100644 --- a/app/views/basil/help_rate.html.erb +++ b/app/views/basil/help_rate.html.erb @@ -1,124 +1,210 @@ + + +<% + 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', + } +%>
- 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' %> -
+ 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' %> +
+- Your images will appear here when you have any that you haven't rated. -
-+ Your images will appear here when you have any that you haven't rated. +
+NEW: You can also - <%= link_to 'help me get better by leaving feedback', basil_rating_queue_path %>. + <%= link_to 'help Basil get better by leaving feedback', basil_rating_queue_path %>.
- celebration - Image generation is a Premium feature, but is free for everyone to use for - the entire month of April. Images created during this time are yours to keep - forever! -
+ <% if Date.current <= 'April 20, 2023'.to_date %> ++ celebration + Image generation is a Premium feature, but is free for everyone to use until + April 14th. Images created during this time are yours to keep forever! +
+ <% end %><%= link_to 'Dismiss this message', notice_dismissal_dismiss_path(notice_id: 19), class: 'right blue-text text-darken-3' %> diff --git a/app/views/notice_dismissal/messages/_20.html.erb b/app/views/notice_dismissal/messages/_20.html.erb new file mode 100644 index 00000000..a1c593ee --- /dev/null +++ b/app/views/notice_dismissal/messages/_20.html.erb @@ -0,0 +1,20 @@ +<% if Date.current <= 'April 15, 2023'.to_date %> +