Extract component to render the "I agree" checkbox
IMHO the best solution would be to completely remove this checkbox on forms that require registration. Other than the fact that people have already agreed with these terms when registering (although I guess these terms might have changed since then) and that approximately 0% of the population will read the conditions every time they agree with them, there's the fact that these links are inside a label and people might accidentally click on them while trying to click on the label in order to check the checkbox. I guess the idea is that these conditions might have changed since the moment people registered. In a fair world, checking "I agree" would have no legal meaning because it's unreasonable to expect that people will read these conditions every time they fill in a form, so whatever we're trying to do here would be pointless. But, since I'm not sure about the legal implications of removing this field in a world where you have to inform people that websites requiring identification use cookies, for now the field will stay where it is.
This commit is contained in:
@@ -89,10 +89,7 @@
|
||||
<div class="actions">
|
||||
<% unless current_user.manager? || investment.persisted? %>
|
||||
<div>
|
||||
<%= f.check_box :terms_of_service,
|
||||
label: t("form.accept_terms",
|
||||
policy: link_to(t("form.policy"), "/privacy", target: "_blank"),
|
||||
conditions: link_to(t("form.conditions"), "/conditions", target: "_blank")) %>
|
||||
<%= render Shared::AgreeWithTermsOfServiceFieldComponent.new(f) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -41,10 +41,7 @@
|
||||
<div class="actions">
|
||||
<% if debate.new_record? %>
|
||||
<div>
|
||||
<%= f.check_box :terms_of_service,
|
||||
label: t("form.accept_terms",
|
||||
policy: link_to(t("form.policy"), "/privacy", target: "_blank"),
|
||||
conditions: link_to(t("form.conditions"), "/conditions", target: "_blank")) %>
|
||||
<%= render Shared::AgreeWithTermsOfServiceFieldComponent.new(f) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -96,10 +96,7 @@
|
||||
<div class="actions">
|
||||
<% if proposal.new_record? %>
|
||||
<div>
|
||||
<%= f.check_box :terms_of_service,
|
||||
label: t("form.accept_terms",
|
||||
policy: link_to(t("form.policy"), "/privacy", target: "_blank"),
|
||||
conditions: link_to(t("form.conditions"), "/conditions", target: "_blank")) %>
|
||||
<%= render Shared::AgreeWithTermsOfServiceFieldComponent.new(f) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<%= form.check_box :terms_of_service, label: label %>
|
||||
@@ -0,0 +1,15 @@
|
||||
class Shared::AgreeWithTermsOfServiceFieldComponent < ApplicationComponent
|
||||
attr_reader :form
|
||||
|
||||
def initialize(form)
|
||||
@form = form
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def label
|
||||
t("form.accept_terms",
|
||||
policy: link_to(t("form.policy"), "/privacy", target: "_blank"),
|
||||
conditions: link_to(t("form.conditions"), "/conditions", target: "_blank"))
|
||||
end
|
||||
end
|
||||
@@ -62,10 +62,7 @@
|
||||
|
||||
<div class="small-12 column">
|
||||
<% if @proposal.new_record? %>
|
||||
<%= f.check_box :terms_of_service,
|
||||
label: t("form.accept_terms",
|
||||
policy: link_to(t("form.policy"), "/privacy", target: "_blank"),
|
||||
conditions: link_to(t("form.conditions"), "/conditions", target: "_blank")) %>
|
||||
<%= render Shared::AgreeWithTermsOfServiceFieldComponent.new(f) %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user