Adds budget investment location
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)
|
||||
params.require(:budget_investment).permit(:title, :description, :external_url, :heading_id, :terms_of_service, :location)
|
||||
end
|
||||
|
||||
def load_ballot
|
||||
|
||||
@@ -24,6 +24,11 @@
|
||||
<%= f.text_field :external_url, placeholder: t("budget.investments.form.external_url"), label: false %>
|
||||
</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 %>
|
||||
</div>
|
||||
|
||||
<% unless current_user.manager? %>
|
||||
|
||||
<div class="small-12 column">
|
||||
|
||||
@@ -26,10 +26,15 @@
|
||||
|
||||
<br>
|
||||
<p id="investment_code">
|
||||
<%= t("budget.investments.show.code") %>
|
||||
<strong><%= investment.id %></strong>
|
||||
<%= t("budget.investments.show.code_html", code: investment.id) %>
|
||||
</p>
|
||||
|
||||
<% if investment.location.present? %>
|
||||
<p id="investment_code">
|
||||
<%= t("budget.investments.show.location_html", location: investment.location) %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= safe_html_with_links investment.description.html_safe %>
|
||||
|
||||
<% if investment.external_url.present? %>
|
||||
|
||||
@@ -36,7 +36,7 @@ en:
|
||||
none: Whole City
|
||||
all: All scopes
|
||||
index:
|
||||
name: Budget's name
|
||||
name: Budget name
|
||||
phase: Phase
|
||||
title: Participatory budgets
|
||||
investments:
|
||||
@@ -46,6 +46,7 @@ en:
|
||||
description: Description
|
||||
external_url: Link to additional documentation
|
||||
heading: Choose if a proposed citywide or district
|
||||
location: "Location"
|
||||
submit_buttons:
|
||||
create: Create
|
||||
new: Create
|
||||
@@ -96,7 +97,9 @@ en:
|
||||
author_deleted: User deleted
|
||||
price_explanation: Price explanation
|
||||
unfeasibility_explanation: Unfeasibility explanation
|
||||
code: 'Investment project code:'
|
||||
code_html: 'Investment project code: <strong>%{code}</strong>'
|
||||
location_html: 'Location: <strong>%{location}</strong>'
|
||||
location: Location
|
||||
share: Share
|
||||
wrong_price_format: Only integer numbers
|
||||
investment:
|
||||
|
||||
@@ -46,6 +46,7 @@ es:
|
||||
description: Descripción detallada
|
||||
external_url: Enlace a documentación adicional
|
||||
heading: "Elige si es una propuesta para toda la ciudad o para un distrito"
|
||||
location: "Localización de la propuesta"
|
||||
submit_buttons:
|
||||
create: Crear
|
||||
new: Crear
|
||||
@@ -96,7 +97,8 @@ es:
|
||||
author_deleted: Usuario eliminado
|
||||
price_explanation: Informe de coste
|
||||
unfeasibility_explanation: Informe de inviabilidad
|
||||
code: 'Código propuesta de gasto:'
|
||||
code_html: 'Código propuesta de gasto: <strong>%{code}</strong>'
|
||||
location_html: 'Localización: <strong>%{location}</strong>'
|
||||
share: Compartir
|
||||
wrong_price_format: Solo puede incluir caracteres numéricos
|
||||
investment:
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddLocationToBudgetInvestments < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :budget_investments, :location, :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: 20161221172447) do
|
||||
ActiveRecord::Schema.define(version: 20161229153505) 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: 20161221172447) do
|
||||
t.integer "budget_id"
|
||||
t.integer "group_id"
|
||||
t.boolean "selected", default: false
|
||||
t.string "location"
|
||||
end
|
||||
|
||||
add_index "budget_investments", ["administrator_id"], name: "index_budget_investments_on_administrator_id", using: :btree
|
||||
@@ -572,7 +573,7 @@ ActiveRecord::Schema.define(version: 20161221172447) do
|
||||
t.boolean "email_digest", default: true
|
||||
t.boolean "email_on_direct_message", default: true
|
||||
t.boolean "official_position_badge", default: false
|
||||
t.datetime "password_changed_at", default: '2016-12-21 17:55:08', null: false
|
||||
t.datetime "password_changed_at", default: '2016-11-02 13:51:14', null: false
|
||||
t.boolean "created_from_signature", default: false
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user