# HG changeset patch # User Nattee Niparnan # Date 2022-09-23 03:59:26 # Node ID 8ff5fd21c79c6b4bb74a72b7f7ab8557dd339f07 # Parent a7f456a02c5bad047dbfbad22e7402921fb66f5e DRY problem select diff --git a/Gemfile b/Gemfile --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,6 @@ # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] gem "sprockets-rails" -gem 'activerecord-session_store' gem 'puma' # Reduces boot times through caching; required in config/boot.rb diff --git a/Gemfile.lock b/Gemfile.lock --- a/Gemfile.lock +++ b/Gemfile.lock @@ -66,12 +66,6 @@ activerecord (7.0.4) activemodel (= 7.0.4) activesupport (= 7.0.4) - activerecord-session_store (2.0.0) - actionpack (>= 5.2.4.1) - activerecord (>= 5.2.4.1) - multi_json (~> 1.11, >= 1.11.2) - rack (>= 2.0.8, < 3) - railties (>= 5.2.4.1) activestorage (7.0.4) actionpack (= 7.0.4) activejob (= 7.0.4) @@ -145,7 +139,6 @@ importmap-rails (1.1.5) actionpack (>= 6.0.0) railties (>= 6.0.0) - in_place_editing (1.2.0) jbuilder (2.11.5) actionview (>= 5.0.0) activesupport (>= 5.0.0) @@ -176,7 +169,6 @@ momentjs-rails (2.29.4.1) railties (>= 3.1) msgpack (1.5.6) - multi_json (1.15.0) mysql2 (0.5.4) net-imap (0.2.3) digest @@ -299,7 +291,6 @@ DEPENDENCIES ace-rails-ap - activerecord-session_store best_in_place! bootsnap bootstrap (~> 5.2) @@ -310,7 +301,6 @@ haml haml-rails importmap-rails (~> 1.1) - in_place_editing jbuilder jquery-rails listen (>= 3.0.5, < 3.2) diff --git a/app/javascript/custom.js b/app/javascript/custom.js --- a/app/javascript/custom.js +++ b/app/javascript/custom.js @@ -26,14 +26,6 @@ } } }); - $(".go-button").on('click', function(event) { - var link, url; - link = $(this).attr("data-source"); - url = $(link).val(); - if (url) { - window.location.href = url; - } - }); $('.ajax-toggle').on('click', function(event) { var target; target = $(event.target); diff --git a/app/views/application/_problem_chooser.html.haml b/app/views/application/_problem_chooser.html.haml new file mode 100644 --- /dev/null +++ b/app/views/application/_problem_chooser.html.haml @@ -0,0 +1,23 @@ +.card.border-info.mb-2 + .card-header.text-bg-info.border-info + Select a Task + .card-body + .row + .col-6 + = select 'submission', + 'problem_id', + problems.collect {|p| ["[#{p.name}] #{p.full_name}", send(target_url_method,p.id)]}, + { selected: (selected_problem ? problem_submissions_url(selected_problem) : -1) }, + { class: 'select2 form-control'} + .col-6 + %a.btn.btn-primary.go-button#problem_go{data: {source: '#submission_problem_id'}} Go +:javascript + $(".go-button").on('click', function(event) { + var link, url; + link = $(this).attr("data-source"); + url = $(link).val(); + if (url) { + window.location.href = url; + } + }); + diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -29,5 +29,6 @@ = render 'layouts/header' /= content_tag(:p,flash[:notice],class: 'alert alert-success') if flash[:notice]!=nil - = flash_messages - = yield + .container-fluid + = flash_messages + = yield diff --git a/app/views/main/_login_box.html.haml b/app/views/main/_login_box.html.haml --- a/app/views/main/_login_box.html.haml +++ b/app/views/main/_login_box.html.haml @@ -1,43 +1,88 @@ -%b= GraderConfiguration['ui.front.welcome_message'] -%br/ + +.card + .card-body + .card-title + %h3= GraderConfiguration['ui.front.welcome_message'] + - if !@hidelogin + .card-subtitle=t 'login.message' + + - if flash[:notice] + %hr/ + %b= flash[:notice] + %hr/ -- if !@hidelogin - =t 'login.message' - %br/ + .card + .card-body{ style: "background: #eeeeff;"} + = form_with url: login_login_path do |f| + .mb-3 + = f.label :login, "Login", class: 'form-label' + = f.text_field :login, class: 'form-control' + .mb-3 + = f.label :password, "Password", class: 'form-label' + = f.password_field :password, class: 'form-control' + - unless GraderConfiguration['right.bypass_agreement'] + .col-sm-offset-3.col-sm-9 + .checkbox + %label + = check_box_tag 'accept_agree' + ยอมรับข้อตกลงการใช้งาน + .mb-3 + .col-sm-offset-3.col-sm-9 + = submit_tag t('login.login_submit'), class: 'btn btn-primary' + - else + Login is not possible right now + + %br/ + + - if GraderConfiguration['system.online_registration'] + =t 'login.participation' + %b + = "#{t 'login.please'} " + = link_to "#{t 'login.register'}", :controller => :users, :action => :new + %br/ + = link_to "#{t 'login.forget_password'}", :controller => :users, :action => :forget +-# %br/ - - if flash[:notice] - %hr/ - %b= flash[:notice] - %hr/ + - if !@hidelogin + =t 'login.message' + %br/ + %br/ + + - if flash[:notice] + %hr/ + %b= flash[:notice] + %hr/ - %div{ :style => "border: solid 1px gray; padding: 4px; background: #eeeeff;"} - = form_tag login_login_path, {class: 'form-horizontal'} do - .form-group - =label_tag :login, "Login",class: 'col-sm-3 control-label' - .col-sm-9 - =text_field_tag :login, nil, class: 'form-control' - .form-group - =label_tag :password, "Password", class: 'col-sm-3 control-label' - .col-sm-9 - =password_field_tag :password, nil, class: 'form-control' - - unless GraderConfiguration['right.bypass_agreement'] + %div{ :style => "border: solid 1px gray; padding: 4px; background: #eeeeff;"} + = form_tag login_login_path, {class: 'form-horizontal'} do + .form-group + =label_tag :login, "Login",class: 'col-sm-3 control-label' + .col-sm-9 + =text_field_tag :login, nil, class: 'form-control' + .form-group + =label_tag :password, "Password", class: 'col-sm-3 control-label' + .col-sm-9 + =password_field_tag :password, nil, class: 'form-control' + - unless GraderConfiguration['right.bypass_agreement'] + .form-group + .col-sm-offset-3.col-sm-9 + .checkbox + %label + = check_box_tag 'accept_agree' + ยอมรับข้อตกลงการใช้งาน + .form-group .col-sm-offset-3.col-sm-9 - .checkbox - %label - = check_box_tag 'accept_agree' - ยอมรับข้อตกลงการใช้งาน + = submit_tag t('login.login_submit'), class: 'btn btn-primary' + - else + + %br/ - .form-group - .col-sm-offset-3.col-sm-9 - = submit_tag t('login.login_submit'), class: 'btn btn-primary' -%br/ - -- if GraderConfiguration['system.online_registration'] - =t 'login.participation' - %b - = "#{t 'login.please'} " - = link_to "#{t 'login.register'}", :controller => :users, :action => :new - %br/ - = link_to "#{t 'login.forget_password'}", :controller => :users, :action => :forget + - if GraderConfiguration['system.online_registration'] + =t 'login.participation' + %b + = "#{t 'login.please'} " + = link_to "#{t 'login.register'}", :controller => :users, :action => :new + %br/ + = link_to "#{t 'login.forget_password'}", :controller => :users, :action => :forget diff --git a/app/views/report/_task_hof.html.haml b/app/views/report/_task_hof.html.haml --- a/app/views/report/_task_hof.html.haml +++ b/app/views/report/_task_hof.html.haml @@ -24,33 +24,32 @@ } -.container-fluid - .row - .col-md-8 - .card - .card-body - %h2.card-title Submission History - %canvas#chart{height: '50px'} +.row.mb-3 + .col-md-8 + .card + .card-body + %h2.card-title Submission History + %canvas#chart{height: '50px'} - .col-md-4 - .card - .card-body - %h2.card-title General Info - .row - .col-sm-6 - Subs - .col-sm-6 - = @summary[:count] - .row - .col-sm-6 - Solved/Attempted User - .col-sm-6 - #{@summary[:solve]}/#{@summary[:attempt]} (#{(@summary[:solve]*100.0/@summary[:attempt]).round(1)}%) - .row - .col-md-4 - .card - .card-body - %h2.card-title Model submission + .col-md-4 + .card + .card-body + %h2.card-title General Info + .row + .col-sm-6 + Subs + .col-sm-6 + = @summary[:count] + .row + .col-sm-6 + Solved/Attempted User + .col-sm-6 + #{@summary[:solve]}/#{@summary[:attempt]} (#{(@summary[:solve]*100.0/@summary[:attempt]).round(1)}%) +.row.mb-3 + .col-md-4 + .card + .card-body + %h2.card-title Model submission %table.table.table-hover %thead %tr @@ -63,11 +62,11 @@ = link_to "##{sub.id}", submission_path(sub) = "(#{sub.language.pretty_name})" %td= sub.user.full_name - .col-md-8 - - if @best - .card - .card-body - %h2.card-title Top Submissions + .col-md-8 + - if @best + .card + .card-body + %h2.card-title Top Submissions %table.table.table-hover %thead %tr diff --git a/app/views/report/problem_hof.html.haml b/app/views/report/problem_hof.html.haml --- a/app/views/report/problem_hof.html.haml +++ b/app/views/report/problem_hof.html.haml @@ -5,24 +5,14 @@ /- else / %h1 All-Time Hall of Fame -.panel.panel-info - .panel-heading - Select Task - .panel-body - .form-inline - = select 'report', - 'problem_id', - @problems.collect {|p| ["[#{p.name}] #{p.full_name}", problem_hof_report_path(p)]}, - {:selected => problem_hof_report_path(@problem)}, - { class: 'select2 form-control' } - %button.btn.btn-primary.btn-sm.go-button#problem_go{data: {source: "#report_problem_id"}} Go - +.row.mb-5 + .col-md-6 + = render 'problem_chooser', {problems: @problems, selected_problem: @problem, target_url_method: :problem_hof_report_path} - unless params[:id] - /=render partial: 'all_time_hof' Please select a problem. - else - %h1 + %h1.mt-3 [#{Problem.find(params[:id]).name}] #{Problem.find(params[:id]).full_name} - if @current_user.has_role?('ta') %a{href:stat_problem_path(@problem)} (stat) diff --git a/app/views/submissions/index.html.haml b/app/views/submissions/index.html.haml --- a/app/views/submissions/index.html.haml +++ b/app/views/submissions/index.html.haml @@ -1,16 +1,4 @@ -.card.border-info.mb-2 - .card-header.text-bg-info.border-info - Select Problems - .card-body - .row - .col-6 - = select 'submission', - 'problem_id', - @problems.collect {|p| ["[#{p.name}] #{p.full_name}", problem_submissions_url(p.id)]}, - { selected: (@problem ? problem_submissions_url(@problem) : -1) }, - { class: 'select2 form-control'} - .col-6 - %a.btn.btn-primary.go-button#problem_go{data: {source: '#submission_problem_id'}} Go += render 'problem_chooser', {problems: @problems, selected_problem: @problem, target_url_method: :problem_submissions_path} - if @problem!=nil %h2= "Task: #{@problem.full_name} (#{@problem.name})" diff --git a/app/views/user_admin/index.html.haml b/app/views/user_admin/index.html.haml --- a/app/views/user_admin/index.html.haml +++ b/app/views/user_admin/index.html.haml @@ -1,26 +1,26 @@ %h1 Users -.panel.panel-primary - .panel-title.panel-heading +.card.border-primary + .card-header.text-bg-primary.border-primary Quick Add - .panel-body - = form_tag( {method: 'post'}, {class: 'form-inline'}) do - .form-group - = label_tag 'user_login', 'Login' - = text_field 'user', 'login', :size => 10,class: 'form-control' + .card-body + = form_with url: 'asd', class: 'row row-cols-lg-auto g-3 align-items-center' do |f| + .col-12 + = f.label 'user_login', 'Login' + = f.text_field 'login', :size => 10,class: 'form-control' .form-group - = label_tag 'user_full_name', 'Full Name' - = text_field 'user', 'full_name', :size => 10,class: 'form-control' + = f.label 'user_full_name', 'Full Name' + = f.text_field 'full_name', :size => 10,class: 'form-control' .form-group - = label_tag 'user_password', 'Password' - = text_field 'user', 'password', :size => 10,class: 'form-control' + = f.label 'user_password', 'Password' + = f.text_field 'password', :size => 10,class: 'form-control' .form-group - = label_tag 'user_password_confirmation', 'Confirm' - = text_field 'user', 'password_confirmation', :size => 10,class: 'form-control' + = f.label 'user_password_confirmation', 'Confirm' + = f.text_field 'password_confirmation', :size => 10,class: 'form-control' .form-group - = label_tag 'user_email', 'email' - = text_field 'user', 'email', :size => 10,class: 'form-control' - =submit_tag "Create", class: 'btn btn-primary' + = f.label 'user_email', 'email' + = f.text_field 'email', :size => 10,class: 'form-control' + =submit_tag "Create", class: 'btn btn-primary align-items-bottom' .panel.panel-primary .panel-title.panel-heading diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb --- a/config/initializers/simple_form.rb +++ b/config/initializers/simple_form.rb @@ -2,7 +2,7 @@ # # Uncomment this and change the path if necessary to include your own # components. -# See https://github.com/plataformatec/simple_form#custom-components to know +# See https://github.com/heartcombo/simple_form#custom-components to know # more about custom components. # Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f } # @@ -129,9 +129,6 @@ # change this configuration to true. config.browser_validations = false - # Collection of methods to detect if a file type was given. - # config.file_methods = [ :mounted_as, :file?, :public_filename, :attached? ] - # Custom mappings for input types. This should be a hash containing a regexp # to match as key, and the input type that will be used when the field name # matches the regexp as value. diff --git a/config/initializers/simple_form_bootstrap.rb b/config/initializers/simple_form_bootstrap.rb --- a/config/initializers/simple_form_bootstrap.rb +++ b/config/initializers/simple_form_bootstrap.rb @@ -4,11 +4,11 @@ # This generator is maintained by the community around simple_form-bootstrap: # https://github.com/rafaelfranca/simple_form-bootstrap # All future development, tests, and organization should happen there. -# Background history: https://github.com/plataformatec/simple_form/issues/1561 +# Background history: https://github.com/heartcombo/simple_form/issues/1561 # Uncomment this and change the path if necessary to include your own # components. -# See https://github.com/plataformatec/simple_form#custom-components +# See https://github.com/heartcombo/simple_form#custom-components # to know more about custom components. # Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f } @@ -57,7 +57,7 @@ b.optional :pattern b.optional :min_max b.optional :readonly - b.use :label, class: 'form-control-label' + b.use :label b.use :input, class: 'form-control', error_class: 'is-invalid', valid_class: 'is-valid' b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' } b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } @@ -76,7 +76,7 @@ end # vertical input for radio buttons and check boxes - config.wrappers :vertical_collection, item_wrapper_class: 'form-check', tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + config.wrappers :vertical_collection, item_wrapper_class: 'form-check', item_label_class: 'form-check-label', tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| b.use :html5 b.optional :readonly b.wrapper :legend_tag, tag: 'legend', class: 'col-form-label pt-0' do |ba| @@ -88,7 +88,7 @@ end # vertical input for inline radio buttons and check boxes - config.wrappers :vertical_collection_inline, item_wrapper_class: 'form-check form-check-inline', tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + config.wrappers :vertical_collection_inline, item_wrapper_class: 'form-check form-check-inline', item_label_class: 'form-check-label', tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| b.use :html5 b.optional :readonly b.wrapper :legend_tag, tag: 'legend', class: 'col-form-label pt-0' do |ba| @@ -108,7 +108,7 @@ b.optional :readonly b.use :label b.use :input, class: 'form-control-file', error_class: 'is-invalid', valid_class: 'is-valid' - b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' } + b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' } b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } end @@ -116,7 +116,7 @@ config.wrappers :vertical_multi_select, tag: 'div', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| b.use :html5 b.optional :readonly - b.use :label, class: 'form-control-label' + b.use :label b.wrapper tag: 'div', class: 'd-flex flex-row justify-content-between align-items-center' do |ba| ba.use :input, class: 'form-control mx-1', error_class: 'is-invalid', valid_class: 'is-valid' end @@ -174,10 +174,10 @@ end # horizontal input for radio buttons and check boxes - config.wrappers :horizontal_collection, item_wrapper_class: 'form-check', tag: 'div', class: 'form-group row', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + config.wrappers :horizontal_collection, item_wrapper_class: 'form-check', item_label_class: 'form-check-label', tag: 'div', class: 'form-group row', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| b.use :html5 b.optional :readonly - b.use :label, class: 'col-sm-3 form-control-label' + b.use :label, class: 'col-sm-3 col-form-label pt-0' b.wrapper :grid_wrapper, tag: 'div', class: 'col-sm-9' do |ba| ba.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid' ba.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' } @@ -186,10 +186,10 @@ end # horizontal input for inline radio buttons and check boxes - config.wrappers :horizontal_collection_inline, item_wrapper_class: 'form-check form-check-inline', tag: 'div', class: 'form-group row', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + config.wrappers :horizontal_collection_inline, item_wrapper_class: 'form-check form-check-inline', item_label_class: 'form-check-label', tag: 'div', class: 'form-group row', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| b.use :html5 b.optional :readonly - b.use :label, class: 'col-sm-3 form-control-label' + b.use :label, class: 'col-sm-3 col-form-label pt-0' b.wrapper :grid_wrapper, tag: 'div', class: 'col-sm-9' do |ba| ba.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid' ba.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' } @@ -204,7 +204,7 @@ b.optional :maxlength b.optional :minlength b.optional :readonly - b.use :label, class: 'col-sm-3 form-control-label' + b.use :label, class: 'col-sm-3 col-form-label' b.wrapper :grid_wrapper, tag: 'div', class: 'col-sm-9' do |ba| ba.use :input, error_class: 'is-invalid', valid_class: 'is-valid' ba.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' } @@ -216,7 +216,7 @@ config.wrappers :horizontal_multi_select, tag: 'div', class: 'form-group row', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| b.use :html5 b.optional :readonly - b.use :label, class: 'col-sm-3 control-label' + b.use :label, class: 'col-sm-3 col-form-label' b.wrapper :grid_wrapper, tag: 'div', class: 'col-sm-9' do |ba| ba.wrapper tag: 'div', class: 'd-flex flex-row justify-content-between align-items-center' do |bb| bb.use :input, class: 'form-control mx-1', error_class: 'is-invalid', valid_class: 'is-valid' @@ -232,7 +232,7 @@ b.use :placeholder b.optional :readonly b.optional :step - b.use :label, class: 'col-sm-3 form-control-label' + b.use :label, class: 'col-sm-3 col-form-label' b.wrapper :grid_wrapper, tag: 'div', class: 'col-sm-9' do |ba| ba.use :input, class: 'form-control-range', error_class: 'is-invalid', valid_class: 'is-valid' ba.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' } @@ -260,7 +260,7 @@ end # inline input for boolean - config.wrappers :inline_boolean, tag: 'span', class: 'form-check flex-wrap justify-content-start mr-sm-2', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + config.wrappers :inline_boolean, tag: 'span', class: 'form-check mb-2 mr-sm-2', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| b.use :html5 b.optional :readonly b.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid' @@ -284,10 +284,11 @@ end end + # custom input switch for boolean config.wrappers :custom_boolean_switch, tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| b.use :html5 b.optional :readonly - b.wrapper :form_check_wrapper, tag: 'div', class: 'custom-control custom-checkbox-switch' do |bb| + b.wrapper :form_check_wrapper, tag: 'div', class: 'custom-control custom-switch' do |bb| bb.use :input, class: 'custom-control-input', error_class: 'is-invalid', valid_class: 'is-valid' bb.use :label, class: 'custom-control-label' bb.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' } @@ -296,7 +297,7 @@ end # custom input for radio buttons and check boxes - config.wrappers :custom_collection, item_wrapper_class: 'custom-control', tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + config.wrappers :custom_collection, item_wrapper_class: 'custom-control', item_label_class: 'custom-control-label', tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| b.use :html5 b.optional :readonly b.wrapper :legend_tag, tag: 'legend', class: 'col-form-label pt-0' do |ba| @@ -308,7 +309,7 @@ end # custom input for inline radio buttons and check boxes - config.wrappers :custom_collection_inline, item_wrapper_class: 'custom-control custom-control-inline', tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| + config.wrappers :custom_collection_inline, item_wrapper_class: 'custom-control custom-control-inline', item_label_class: 'custom-control-label', tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| b.use :html5 b.optional :readonly b.wrapper :legend_tag, tag: 'legend', class: 'col-form-label pt-0' do |ba| @@ -326,7 +327,7 @@ b.optional :maxlength b.optional :minlength b.optional :readonly - b.use :label, class: 'form-control-label' + b.use :label b.wrapper :custom_file_wrapper, tag: 'div', class: 'custom-file' do |ba| ba.use :input, class: 'custom-file-input', error_class: 'is-invalid', valid_class: 'is-valid' ba.use :label, class: 'custom-file-label' @@ -339,7 +340,7 @@ config.wrappers :custom_multi_select, tag: 'div', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| b.use :html5 b.optional :readonly - b.use :label, class: 'form-control-label' + b.use :label b.wrapper tag: 'div', class: 'd-flex flex-row justify-content-between align-items-center' do |ba| ba.use :input, class: 'custom-select mx-1', error_class: 'is-invalid', valid_class: 'is-valid' end @@ -353,7 +354,7 @@ b.use :placeholder b.optional :readonly b.optional :step - b.use :label, class: 'form-control-label' + b.use :label b.use :input, class: 'custom-range', error_class: 'is-invalid', valid_class: 'is-valid' b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' } b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } @@ -370,7 +371,7 @@ # b.optional :pattern # b.optional :min_max # b.optional :readonly - # b.use :label, class: 'form-control-label' + # b.use :label # b.wrapper :input_group_tag, tag: 'div', class: 'input-group' do |ba| # ba.optional :prepend # ba.use :input, class: 'form-control', error_class: 'is-invalid', valid_class: 'is-valid' @@ -393,7 +394,7 @@ b.optional :min_max b.optional :readonly b.use :input, class: 'form-control', error_class: 'is-invalid', valid_class: 'is-valid' - b.use :label, class: 'form-control-label' + b.use :label b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' } b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } end @@ -402,8 +403,8 @@ config.wrappers :floating_labels_select, tag: 'div', class: 'form-label-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b| b.use :html5 b.optional :readonly - b.use :input, class: 'custom-select custom-select-lg', error_class: 'is-invalid', valid_class: 'is-valid' - b.use :label, class: 'form-control-label' + b.use :input, class: 'custom-select', error_class: 'is-invalid', valid_class: 'is-valid' + b.use :label b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' } b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } end