Adds organization_name attribute to budget investments
This commit is contained in:
@@ -80,7 +80,7 @@ module Budgets
|
||||
end
|
||||
|
||||
def investment_params
|
||||
params.require(:budget_investment).permit(:title, :description, :external_url, :heading_id, :terms_of_service, :location)
|
||||
params.require(:budget_investment).permit(:title, :description, :external_url, :heading_id, :terms_of_service, :location, :organization_name)
|
||||
end
|
||||
|
||||
def load_ballot
|
||||
|
||||
@@ -3,30 +3,29 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="small-12 medium-8 column">
|
||||
<%= f.label :heading_id, t("budget.investments.form.heading") %>
|
||||
<%= f.select :heading_id, budget_heading_select_options(@budget), {include_blank: true, label: false} %>
|
||||
<%= f.select :heading_id, budget_heading_select_options(@budget), {include_blank: true, } %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.label :title, t("budget.investments.form.title") %>
|
||||
<%= f.text_field :title, maxlength: SpendingProposal.title_max_length, placeholder: t("budget.investments.form.title"), label: false %>
|
||||
<%= f.text_field :title, maxlength: SpendingProposal.title_max_length %>
|
||||
</div>
|
||||
|
||||
<%= f.invisible_captcha :subtitle %>
|
||||
|
||||
<div class="ckeditor small-12 column">
|
||||
<%= f.label :description, t("budget.investments.form.description") %>
|
||||
<%= f.cktext_area :description, maxlength: SpendingProposal.description_max_length, ckeditor: { language: I18n.locale }, label: false %>
|
||||
<%= f.cktext_area :description, maxlength: SpendingProposal.description_max_length, ckeditor: { language: I18n.locale } %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.label :external_url, t("budget.investments.form.external_url") %>
|
||||
<%= f.text_field :external_url, placeholder: t("budget.investments.form.external_url"), label: false %>
|
||||
<%= f.text_field :external_url %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.label :location, t("budget.investments.form.location") %>
|
||||
<%= f.text_field :location, placeholder: t("budget.investments.form.location"), label: false %>
|
||||
<%= f.text_field :location %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.text_field :organization_name %>
|
||||
</div>
|
||||
|
||||
<% unless current_user.manager? %>
|
||||
@@ -45,7 +44,7 @@
|
||||
<% end %>
|
||||
|
||||
<div class="actions small-12 medium-6 large-4 end column">
|
||||
<%= f.submit(class: "button expanded", value: t("budget.investments.form.submit_buttons.#{action_name}")) %>
|
||||
<%= f.submit(nil, class: "button expanded") %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -24,11 +24,17 @@
|
||||
</p>
|
||||
|
||||
<% if investment.location.present? %>
|
||||
<p id="investment_code">
|
||||
<p>
|
||||
<%= t("budget.investments.show.location_html", location: investment.location) %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<% if investment.organization_name.present? %>
|
||||
<p>
|
||||
<%= t("budget.investments.show.organization_name_html", name: investment.organization_name) %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= safe_html_with_links investment.description.html_safe %>
|
||||
|
||||
<% if investment.external_url.present? %>
|
||||
|
||||
@@ -58,6 +58,8 @@ en:
|
||||
external_url: "Link to additional documentation"
|
||||
heading_id: "Heading"
|
||||
title: "Title"
|
||||
location: "Location"
|
||||
organization_name: "If you are proposing in the name of a collective/organization, write its name"
|
||||
comment:
|
||||
body: "Comment"
|
||||
user: "User"
|
||||
|
||||
@@ -58,6 +58,8 @@ es:
|
||||
external_url: "Enlace a documentación adicional"
|
||||
heading_id: "Partida presupuestaria"
|
||||
title: "Título"
|
||||
location: "Ubicación"
|
||||
organization_name: "Si estás proponiendo en nombre de una organización o colectivo, escribe su nombre"
|
||||
comment:
|
||||
body: "Comentario"
|
||||
user: "Usuario"
|
||||
|
||||
@@ -104,6 +104,7 @@ en:
|
||||
unfeasibility_explanation: Unfeasibility explanation
|
||||
code_html: 'Investment project code: <strong>%{code}</strong>'
|
||||
location_html: 'Location: <strong>%{location}</strong>'
|
||||
organization_name_html: 'Organization: <strong>%{name}</strong>'
|
||||
location: Location
|
||||
share: Share
|
||||
wrong_price_format: Only integer numbers
|
||||
|
||||
@@ -104,6 +104,7 @@ es:
|
||||
unfeasibility_explanation: Informe de inviabilidad
|
||||
code_html: 'Código propuesta de gasto: <strong>%{code}</strong>'
|
||||
location_html: 'Ubicación: <strong>%{location}</strong>'
|
||||
organization_name_html: 'Organización: <strong>%{name}</strong>'
|
||||
share: Compartir
|
||||
wrong_price_format: Solo puede incluir caracteres numéricos
|
||||
investment:
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddOrganizationNameFieldToBudgetInvestment < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :budget_investments, :organization_name, :string
|
||||
end
|
||||
end
|
||||
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20170103170147) do
|
||||
ActiveRecord::Schema.define(version: 20170106130838) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
@@ -142,6 +142,7 @@ ActiveRecord::Schema.define(version: 20170103170147) do
|
||||
t.integer "group_id"
|
||||
t.boolean "selected", default: false
|
||||
t.string "location"
|
||||
t.string "organization_name"
|
||||
end
|
||||
|
||||
add_index "budget_investments", ["administrator_id"], name: "index_budget_investments_on_administrator_id", using: :btree
|
||||
|
||||
Reference in New Issue
Block a user