Files
grecia/app/components/budgets/investments/form_component.html.erb
Javi Martín 46f43236bb 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.
2023-10-23 18:19:48 +02:00

99 lines
3.2 KiB
Plaintext

<%= translatable_form_for(investment, url: url, html: { class: "budget-investment-form" }) do |f| %>
<%= render "shared/errors", resource: investment %>
<fieldset class="required-fields">
<legend><%= t("shared.required") %></legend>
<% unless budget.single_heading? %>
<div>
<%= f.select :heading_id, budget_heading_select_options(budget), { include_blank: true } %>
</div>
<% end %>
<div>
<%= render "shared/globalize_locales", resource: investment %>
</div>
<%= f.translatable_fields do |translations_form| %>
<div>
<%= translations_form.text_field :title,
maxlength: Budget::Investment.title_max_length,
data: suggest_data(investment) %>
</div>
<div class="js-suggest" data-locale="<%= translations_form.locale %>"></div>
<div>
<%= translations_form.text_area :description,
maxlength: Budget::Investment.description_max_length,
class: "html-area" %>
</div>
<% end %>
</fieldset>
<%= f.invisible_captcha :subtitle %>
<fieldset>
<legend><%= t("shared.optional") %></legend>
<% if feature?(:allow_images) %>
<%= render Images::NestedComponent.new(f) %>
<% end %>
<% if feature?(:allow_attached_documents) %>
<%= render Documents::NestedComponent.new(f) %>
<% end %>
<% if feature?(:map) %>
<div>
<%= render "map_locations/form_fields",
form: f,
map_location: investment.map_location || MapLocation.new,
label: t("budgets.investments.form.map_location"),
help: t("budgets.investments.form.map_location_instructions"),
i18n_namespace: "budgets.investments" %>
</div>
<% end %>
<div>
<%= f.text_field :location %>
</div>
<div>
<%= f.text_field :organization_name %>
</div>
<div>
<%= f.label :tag_list, t("budgets.investments.form.tags_label") %>
<p class="help-text" id="tags-list-help-text"><%= t("budgets.investments.form.tags_instructions") %></p>
<div id="category_tags" class="tags">
<%= f.label :category_tag_list, t("budgets.investments.form.tag_category_label") %>
<% categories.each do |tag| %>
<a class="js-add-tag-link"><%= tag.name %></a>
<% end %>
</div>
<br>
<%= f.text_field :tag_list, value: investment.tag_list.to_s,
label: false,
placeholder: t("budgets.investments.form.tags_placeholder"),
aria: { describedby: "tags-list-help-text" },
class: "js-tag-list tag-autocomplete",
data: { js_url: suggest_tags_path } %>
</div>
<%= render SDG::RelatedListSelectorComponent.new(f) %>
</fieldset>
<div class="actions">
<% unless current_user.manager? || investment.persisted? %>
<div>
<%= render Shared::AgreeWithTermsOfServiceFieldComponent.new(f) %>
</div>
<% end %>
<%= f.submit %>
</div>
<% end %>