diff --git a/app/assets/stylesheets/ltags/PollTag.scss b/app/assets/stylesheets/ltags/PollTag.scss index e37fabd88..0bc4efb31 100644 --- a/app/assets/stylesheets/ltags/PollTag.scss +++ b/app/assets/stylesheets/ltags/PollTag.scss @@ -1,4 +1,5 @@ @import 'variables'; +@import 'mixins'; .ltag-poll { width: 600px; @@ -74,7 +75,11 @@ font-weight: bold; } &.ltag-optionnotvotedfor { - background: $light-medium-gray; + @include themeable( + background, + theme-container-accent-background, + $light-medium-gray + ); } } .ltag-votepercenttext { diff --git a/app/controllers/html_variants_controller.rb b/app/controllers/html_variants_controller.rb index 72b50219c..f5e13cf53 100644 --- a/app/controllers/html_variants_controller.rb +++ b/app/controllers/html_variants_controller.rb @@ -4,11 +4,13 @@ class HtmlVariantsController < ApplicationController def index authorize HtmlVariant @html_variants = if params[:state] == "mine" - current_user.html_variants.order("created_at DESC").includes(:user).page(params[:page]).per(15) + current_user.html_variants.order("created_at DESC").includes(:user).page(params[:page]).per(30) elsif params[:state] == "admin" - HtmlVariant.where(published: true, approved: false).order("created_at DESC").includes(:user).page(params[:page]).per(15) + HtmlVariant.where(published: true, approved: false).order("created_at DESC").includes(:user).page(params[:page]).per(30) + elsif params[:state].present? + HtmlVariant.where(published: true, approved: true, group: params[:state]).order("success_rate DESC").includes(:user).page(params[:page]).per(30) else - HtmlVariant.where(published: true, approved: true).order("success_rate DESC").includes(:user).page(params[:page]).per(15) + HtmlVariant.where(published: true, approved: true).order("success_rate DESC").includes(:user).page(params[:page]).per(30) end end diff --git a/app/models/user.rb b/app/models/user.rb index 2c786d5dc..cc2387ad0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -117,8 +117,8 @@ class User < ApplicationRecord message: "%{value} must be either v1 or v2" } validates :config_theme, - inclusion: { in: %w[default night_theme pink_theme], - message: "%{value} must be either default, pink theme, or night theme" } + inclusion: { in: %w[default night_theme pink_theme minimal_light_theme], + message: "%{value} is not a valid theme" } validates :config_font, inclusion: { in: %w[default sans_serif comic_sans], message: "%{value} must be either default or sans serif" } diff --git a/app/views/html_variants/index.html.erb b/app/views/html_variants/index.html.erb index 3c74c5e9d..39fc85876 100644 --- a/app/views/html_variants/index.html.erb +++ b/app/views/html_variants/index.html.erb @@ -7,6 +7,9 @@ <% if params[:state] == "mine" %>