aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlban Peignier2015-05-22 09:55:56 +0200
committerAlban Peignier2015-05-22 09:55:56 +0200
commitcf631225e96227395cc0f852e73ad83bc7aaf06b (patch)
tree89e811e719b67c1a7d22c5d85556f6d4526b3e52
parent5d4413c208f7e0fcb86a2c4e464025c5ab37d159 (diff)
downloadchouette-core-cf631225e96227395cc0f852e73ad83bc7aaf06b.tar.bz2
Revert "Revert label boolean css and formtastic input"
This reverts commit 5d4413c208f7e0fcb86a2c4e464025c5ab37d159.
-rw-r--r--app/assets/stylesheets/vendor/formtastic_changes.css.scss24
-rw-r--r--app/inputs/boolean_input.rb14
-rw-r--r--app/inputs/custom_simple_form/boolean_input.rb4
-rw-r--r--app/views/devise/sessions/new.html.erb2
-rw-r--r--config/initializers/simple_form.rb2
5 files changed, 21 insertions, 25 deletions
diff --git a/app/assets/stylesheets/vendor/formtastic_changes.css.scss b/app/assets/stylesheets/vendor/formtastic_changes.css.scss
index 72b4d735f..8eab55de1 100644
--- a/app/assets/stylesheets/vendor/formtastic_changes.css.scss
+++ b/app/assets/stylesheets/vendor/formtastic_changes.css.scss
@@ -5,17 +5,17 @@
text-align: right;
}
- /* .boolean {
- /* // to align horizontally boolean label with other labels
- /* // (with the help of customized BooleanInput)
- /* label {
- /* padding-left: inherit;
- /* }
- /* // to align vertically checkbox with align text
- /* input[type="checkbox"] {
- /* margin-top: 0.3em;
- /* }
- /* }
+ .boolean {
+ // to align horizontally boolean label with other labels
+ // (with the help of customized BooleanInput)
+ label {
+ padding-left: inherit;
+ }
+ // to align vertically checkbox with align text
+ input[type="checkbox"] {
+ margin-top: 0.3em;
+ }
+ }
.stringish input{
width: auto;
@@ -51,4 +51,4 @@
display: initial;
}
/* Hack to remove!!!! */
-}
+} \ No newline at end of file
diff --git a/app/inputs/boolean_input.rb b/app/inputs/boolean_input.rb
index da23c3b93..a2b9b92ca 100644
--- a/app/inputs/boolean_input.rb
+++ b/app/inputs/boolean_input.rb
@@ -1,9 +1,9 @@
class BooleanInput < Formtastic::Inputs::BooleanInput
- # def label_with_nested_checkbox
- # builder.label(
- # method,
- # label_text,
- # label_html_options.merge(class: "label")
- # ) << "" << check_box_html
- # end
+ def label_with_nested_checkbox
+ builder.label(
+ method,
+ label_text,
+ label_html_options.merge(class: "label")
+ ) << "" << check_box_html
+ end
end
diff --git a/app/inputs/custom_simple_form/boolean_input.rb b/app/inputs/custom_simple_form/boolean_input.rb
deleted file mode 100644
index 1dd456356..000000000
--- a/app/inputs/custom_simple_form/boolean_input.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-module CustomSimpleForm
- class BooleanInput < SimpleForm::Inputs::BooleanInput
- end
-end
diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb
index ceb8624c2..279eb3ca8 100644
--- a/app/views/devise/sessions/new.html.erb
+++ b/app/views/devise/sessions/new.html.erb
@@ -24,7 +24,7 @@
<div class="row options">
<div class="col-md-6">
<% if devise_mapping.rememberable? %>
- <%= form.input :remember_me, :as => :boolean %>
+ <%= form.input :remember_me, :as => :boolean if devise_mapping.rememberable? %>
<% end %>
</div>
<div class="col-md-6 new_password">
diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb
index 13809abcd..d5492e529 100644
--- a/config/initializers/simple_form.rb
+++ b/config/initializers/simple_form.rb
@@ -134,7 +134,7 @@ SimpleForm.setup do |config|
# Namespaces where SimpleForm should look for custom input classes that
# override default inputs.
- config.custom_inputs_namespaces << "CustomSimpleForm"
+ # config.custom_inputs_namespaces << "CustomInputs"
# Default priority for time_zone inputs.
# config.time_zone_priority = nil