Simplify generating checkboxes in forms

Using the block syntax to generate the label with a <span> tag inside
isn't necessary after upgrading foundation_rails_helpers. Before the
upgrade, we couldn't do so because the <span> tag was escaped.
This commit is contained in:
Javi Martín
2019-10-03 18:53:26 +02:00
parent 5fe56a62f1
commit 8d9cb4d8e3
14 changed files with 98 additions and 152 deletions

View File

@@ -32,82 +32,40 @@
</div>
<div>
<%= f.label :public_activity do %>
<%= f.check_box :public_activity, title: t("account.show.public_activity_label"), label: false %>
<span class="checkbox">
<%= t("account.show.public_activity_label") %>
</span>
<% end %>
<%= f.check_box :public_activity, label: t("account.show.public_activity_label") %>
</div>
<div>
<%= f.label :public_interests do %>
<%= f.check_box :public_interests, title: t("account.show.public_interests_label"), label: false %>
<span class="checkbox">
<%= t("account.show.public_interests_label") %>
</span>
<% end %>
<%= f.check_box :public_interests, label: t("account.show.public_interests_label") %>
</div>
<% if @account.email.present? %>
<h2><%= t("account.show.notifications") %></h2>
<div>
<%= f.label :email_on_comment do %>
<%= f.check_box :email_on_comment, title: t("account.show.email_on_comment_label"), label: false %>
<span class="checkbox">
<%= t("account.show.email_on_comment_label") %>
</span>
<% end %>
<%= f.check_box :email_on_comment, label: t("account.show.email_on_comment_label") %>
</div>
<div>
<%= f.label :email_on_comment_reply do %>
<%= f.check_box :email_on_comment_reply, title: t("account.show.email_on_comment_reply_label"), label: false %>
<span class="checkbox">
<%= t("account.show.email_on_comment_reply_label") %>
</span>
<% end %>
<%= f.check_box :email_on_comment_reply, label: t("account.show.email_on_comment_reply_label") %>
</div>
<div>
<%= f.label :email_newsletter_subscribed do %>
<%= f.check_box :newsletter, title: t("account.show.subscription_to_website_newsletter_label"), label: false %>
<span class="checkbox">
<%= t("account.show.subscription_to_website_newsletter_label") %>
</span>
<% end %>
<%= f.check_box :newsletter, label: t("account.show.subscription_to_website_newsletter_label") %>
</div>
<div>
<%= f.label :email_digest do %>
<%= f.check_box :email_digest, title: t("account.show.email_digest_label"), label: false %>
<span class="checkbox">
<%= t("account.show.email_digest_label") %>
</span>
<% end %>
<%= f.check_box :email_digest, label: t("account.show.email_digest_label") %>
</div>
<div>
<%= f.label :email_on_direct_message do %>
<%= f.check_box :email_on_direct_message, title: t("account.show.email_on_direct_message_label"), label: false %>
<span class="checkbox">
<%= t("account.show.email_on_direct_message_label") %>
</span>
<% end %>
<%= f.check_box :email_on_direct_message, label: t("account.show.email_on_direct_message_label") %>
</div>
<% end %>
<% if @account.official_level == 1 %>
<div>
<%= f.label :official_position_badge do %>
<%= f.check_box :official_position_badge,
title: t("account.show.official_position_badge_label"),
label: false %>
<span class="checkbox">
<%= t("account.show.official_position_badge_label") %>
</span>
<% end %>
<%= f.check_box :official_position_badge, label: t("account.show.official_position_badge_label") %>
</div>
<% end %>
@@ -116,23 +74,13 @@
<% if feature?("user.recommendations_on_debates") %>
<div>
<%= f.label :recommended_debates do %>
<%= f.check_box :recommended_debates, title: t("account.show.show_debates_recommendations"), label: false %>
<span class="checkbox">
<%= t("account.show.show_debates_recommendations") %>
</span>
<% end %>
<%= f.check_box :recommended_debates, label: t("account.show.show_debates_recommendations") %>
</div>
<% end %>
<% if feature?("user.recommendations_on_proposals") %>
<div>
<%= f.label :recommended_proposals do %>
<%= f.check_box :recommended_proposals, title: t("account.show.show_proposals_recommendations"), label: false %>
<span class="checkbox">
<%= t("account.show.show_proposals_recommendations") %>
</span>
<% end %>
<%= f.check_box :recommended_proposals, label: t("account.show.show_proposals_recommendations") %>
</div>
<% end %>
<% end %>