Modify UI for "accept terms" checkbox (#321)

* <Changed terms and conditions checkbox>

* <Fixed code style>
This commit is contained in:
John Ma 2018-11-15 12:56:00 -05:00 committed by Jesus Federico
parent 9f26485fb5
commit 0e7277a046
3 changed files with 14 additions and 1 deletions

View File

@ -61,7 +61,10 @@
</div>
<% if Rails.configuration.terms %>
<div class="form-inline">
<%= f.check_box :accepted_terms, class: "form-control #{form_is_invalid?(@user, :accepted_terms)}", placeholder: t("signup.password_confirm") %>
<label class="custom-switch">
<%= f.check_box :accepted_terms, class: "custom-switch-input form-control #{form_is_invalid?(@user, :accepted_terms)}", placeholder: t("signup.password_confirm") %>
<span class="custom-switch-indicator"></span>
</label>
<%= f.label :accepted_terms, t("terms.accept", href: link_to(t("terms.title"), terms_path, target: "_blank", class: "ml-1 text-blue")).html_safe, class: "ml-1" %>
<div class="invalid-feedback d-block"><%= @user.errors.full_messages_for(:accepted_terms).first %></div>
</div>

View File

@ -28,6 +28,11 @@ Rails.application.configure do
config.cache_store = :null_store
end
# Don't wrap form components in field_with_error divs
ActionView::Base.field_error_proc = proc do |html_tag|
html_tag.html_safe
end
# Tell Action Mailer to use smtp server, if configured
config.action_mailer.delivery_method = ENV['SMTP_SERVER'].present? ? :smtp : :sendmail

View File

@ -51,6 +51,11 @@ Rails.application.configure do
# Prepend all log lines with the following tags.
config.log_tags = [:request_id]
# Don't wrap form components in field_with_error divs
ActionView::Base.field_error_proc = proc do |html_tag|
html_tag.html_safe
end
# Use a different cache store in production.
# config.cache_store = :mem_cache_store