Files
grecia/app/components/proposals/votes_component.html.erb
Javi Martín f384451d9f Always generate <button> tags with button_to
In Rails 6.1 and earlier, `button_to` generated a <button> tag when it
received the content as a block, but an <input> tag when receiving
the content as the first parameter.

That's why we were using blocks with `button_to` most of the time; for
starters, <button> tags accept pseudocontent and so are easier to style.

In Rails 7.0, `button_to` always generates a <button> tag [1], so we're
simplifying the code what uses `button_to`, passing the content as a
first parameter instead of passing it as a block.

[1] https://guides.rubyonrails.org/v7.1/configuring.html#config-action-view-button-to-generates-button-tag
2024-04-15 15:39:28 +02:00

28 lines
939 B
Plaintext

<div class="supports text-center">
<%= render "proposals/supports", proposal: proposal %>
<div class="in-favor">
<% if voted? %>
<div class="supported callout success">
<%= t("proposals.proposal.already_supported") %>
</div>
<% else %>
<%= button_to t("proposals.proposal.support"),
vote_url,
class: "button button-support small expanded",
title: t("proposals.proposal.support_title"),
method: "post",
remote: true,
"aria-label": support_aria_label %>
<% end %>
</div>
<%= render Shared::ParticipationNotAllowedComponent.new(proposal, cannot_vote_text: cannot_vote_text) %>
<% if voted? && setting["twitter_handle"] %>
<div class="share-supported">
<%= render "proposals/social_share", proposal: proposal, share_title: false %>
</div>
<% end %>
</div>