Add labels to radio buttons automatically
This commit is contained in:
@@ -7,22 +7,19 @@
|
|||||||
<legend><%= t("valuation.budget_investments.edit.feasibility") %></legend>
|
<legend><%= t("valuation.budget_investments.edit.feasibility") %></legend>
|
||||||
<div class="small-4 column">
|
<div class="small-4 column">
|
||||||
<span class="radio">
|
<span class="radio">
|
||||||
<%= f.radio_button :feasibility, "undecided",
|
<%= f.radio_button :feasibility, "undecided" %>
|
||||||
label: t("valuation.budget_investments.edit.undefined_feasible") %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="small-4 column">
|
<div class="small-4 column">
|
||||||
<span class="radio">
|
<span class="radio">
|
||||||
<%= f.radio_button :feasibility, "feasible",
|
<%= f.radio_button :feasibility, "feasible" %>
|
||||||
label: t("valuation.budget_investments.edit.feasible") %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="small-4 column">
|
<div class="small-4 column">
|
||||||
<span class="radio">
|
<span class="radio">
|
||||||
<%= f.radio_button :feasibility, "unfeasible",
|
<%= f.radio_button :feasibility, "unfeasible" %>
|
||||||
label: t("valuation.budget_investments.edit.unfeasible") %>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|||||||
@@ -153,6 +153,9 @@ en:
|
|||||||
organization_name: "If you are proposing in the name of a collective/organization, or on behalf of more people, write its name"
|
organization_name: "If you are proposing in the name of a collective/organization, or on behalf of more people, write its name"
|
||||||
image: "Proposal descriptive image"
|
image: "Proposal descriptive image"
|
||||||
image_title: "Image title"
|
image_title: "Image title"
|
||||||
|
feasibility_feasible: "Feasible"
|
||||||
|
feasibility_undecided: "Undefined"
|
||||||
|
feasibility_unfeasible: "Unfeasible"
|
||||||
budget/investment/translation:
|
budget/investment/translation:
|
||||||
title: "Title"
|
title: "Title"
|
||||||
description: "Description"
|
description: "Description"
|
||||||
|
|||||||
@@ -60,9 +60,6 @@ en:
|
|||||||
price_first_year_html: "Cost during the first year (%{currency}) <small>(optional, data not public)</small>"
|
price_first_year_html: "Cost during the first year (%{currency}) <small>(optional, data not public)</small>"
|
||||||
price_explanation_html: Price explanation
|
price_explanation_html: Price explanation
|
||||||
feasibility: Feasibility
|
feasibility: Feasibility
|
||||||
feasible: Feasible
|
|
||||||
unfeasible: Not feasible
|
|
||||||
undefined_feasible: Pending
|
|
||||||
feasible_explanation_html: Feasibility explanation
|
feasible_explanation_html: Feasibility explanation
|
||||||
valuation_finished: Valuation finished
|
valuation_finished: Valuation finished
|
||||||
valuation_finished_alert: "Are you sure you want to mark this report as completed? If you do it, it can no longer be modified."
|
valuation_finished_alert: "Are you sure you want to mark this report as completed? If you do it, it can no longer be modified."
|
||||||
|
|||||||
@@ -155,6 +155,9 @@ es:
|
|||||||
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
|
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, o en nombre de más gente, escribe su nombre"
|
||||||
image: "Imagen descriptiva del proyecto de gasto"
|
image: "Imagen descriptiva del proyecto de gasto"
|
||||||
image_title: "Título de la imagen"
|
image_title: "Título de la imagen"
|
||||||
|
feasibility_feasible: "Viable"
|
||||||
|
feasibility_undecided: "Sin decidir"
|
||||||
|
feasibility_unfeasible: "Inviable"
|
||||||
budget/investment/translation:
|
budget/investment/translation:
|
||||||
title: "Título"
|
title: "Título"
|
||||||
description: "Descripción"
|
description: "Descripción"
|
||||||
|
|||||||
@@ -60,9 +60,6 @@ es:
|
|||||||
price_first_year_html: "Coste en el primer año (%{currency}) <small>(opcional, dato no público)</small>"
|
price_first_year_html: "Coste en el primer año (%{currency}) <small>(opcional, dato no público)</small>"
|
||||||
price_explanation_html: Informe de coste <small>(opcional, dato público)</small>
|
price_explanation_html: Informe de coste <small>(opcional, dato público)</small>
|
||||||
feasibility: Viabilidad
|
feasibility: Viabilidad
|
||||||
feasible: Viable
|
|
||||||
unfeasible: Inviable
|
|
||||||
undefined_feasible: Sin decidir
|
|
||||||
feasible_explanation_html: Informe de inviabilidad <small>(en caso de que lo sea, dato público)</small>
|
feasible_explanation_html: Informe de inviabilidad <small>(en caso de que lo sea, dato público)</small>
|
||||||
valuation_finished: Informe finalizado
|
valuation_finished: Informe finalizado
|
||||||
valuation_finished_alert: "¿Estás seguro/a de querer marcar este informe como completado? Una vez hecho, no se puede deshacer la acción."
|
valuation_finished_alert: "¿Estás seguro/a de querer marcar este informe como completado? Una vez hecho, no se puede deshacer la acción."
|
||||||
|
|||||||
@@ -27,6 +27,12 @@ class ConsulFormBuilder < FoundationRailsHelper::FormBuilder
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def radio_button(attribute, tag_value, options = {})
|
||||||
|
default_label = object.class.human_attribute_name("#{attribute}_#{tag_value}")
|
||||||
|
|
||||||
|
super(attribute, tag_value, { label: default_label }.merge(options))
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def label_with_hint(attribute, options)
|
def label_with_hint(attribute, options)
|
||||||
|
|||||||
Reference in New Issue
Block a user