adds price_first_year to spending proposals

This commit is contained in:
Juanjo Bazán
2016-03-05 12:46:16 +01:00
parent b3486ede8b
commit 6929b7863d
9 changed files with 20 additions and 1 deletions

View File

@@ -62,6 +62,10 @@
<p><strong><%= t("admin.spending_proposals.show.price") %> (<%= t("admin.spending_proposals.show.currency") %>):</strong>
<%= @spending_proposal.price.present? ? @spending_proposal.price : t("admin.spending_proposals.show.undefined") %>
</p>
<p><strong><%= t("admin.spending_proposals.show.price_first_year") %> (<%= t("admin.spending_proposals.show.currency") %>):</strong>
<%= @spending_proposal.price_first_year.present? ? @spending_proposal.price_first_year : t("admin.spending_proposals.show.undefined") %>
</p>
<%= simple_format(safe_html_with_links(@spending_proposal.price_explanation.html_safe), {}, sanitize: false) if @spending_proposal.price_explanation.present? %>
<p><strong><%= t("admin.spending_proposals.show.feasibility") %>:</strong>

View File

@@ -57,6 +57,9 @@
<p><strong><%= t("valuation.spending_proposals.show.price") %> (<%= t("valuation.spending_proposals.show.currency") %>):</strong>
<%= @spending_proposal.price.present? ? @spending_proposal.price : t("valuation.spending_proposals.show.undefined") %>
</p>
<p><strong><%= t("valuation.spending_proposals.show.price_first_year") %> (<%= t("valuation.spending_proposals.show.currency") %>):</strong>
<%= @spending_proposal.price_first_year.present? ? @spending_proposal.price_first_year : t("valuation.spending_proposals.show.undefined") %>
</p>
<%= simple_format(safe_html_with_links(@spending_proposal.price_explanation.html_safe), {}, sanitize: false) if @spending_proposal.price_explanation.present? %>
<p><strong><%= t("valuation.spending_proposals.show.feasibility") %>:</strong>

View File

@@ -173,6 +173,7 @@ en:
geozone: Scope
dossier: Dossier
price: Price
price_first_year: Cost during the first year
currency: "€"
feasibility: Feasibility
feasible: Feasible

View File

@@ -173,6 +173,7 @@ es:
geozone: Ámbito
dossier: Informe
price: Coste
price_first_year: Coste en el primer año
currency: "€"
feasibility: Viabilidad
feasible: Viable

View File

@@ -29,6 +29,7 @@ en:
geozone: Scope
dossier: Dossier
price: Price
price_first_year: Cost during the first year
currency: "€"
feasibility: Feasibility
feasible: Feasible

View File

@@ -29,6 +29,7 @@ es:
geozone: Ámbito
dossier: Informe
price: Coste
price_first_year: Coste en el primer año
currency: "€"
feasibility: Viabilidad
feasible: Viable

View File

@@ -0,0 +1,5 @@
class AddPriceFieldsToSpendingProposals < ActiveRecord::Migration
def change
add_column :spending_proposals, :price_first_year, :float
end
end

View File

@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20160225171916) do
ActiveRecord::Schema.define(version: 20160305113707) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -309,6 +309,7 @@ ActiveRecord::Schema.define(version: 20160225171916) do
t.text "explanations_log"
t.integer "administrator_id"
t.integer "valuation_assignments_count", default: 0
t.float "price_first_year"
end
add_index "spending_proposals", ["author_id"], name: "index_spending_proposals_on_author_id", using: :btree

View File

@@ -169,6 +169,7 @@ feature 'Admin spending proposals' do
geozone: create(:geozone),
association_name: 'People of the neighbourhood',
price: 1234.56,
price_first_year: 1000,
feasible: false,
feasible_explanation: 'It is impossible',
administrator: administrator)
@@ -184,6 +185,7 @@ feature 'Admin spending proposals' do
expect(page).to have_content(spending_proposal.association_name)
expect(page).to have_content(spending_proposal.geozone.name)
expect(page).to have_content('1234.56')
expect(page).to have_content('1000')
expect(page).to have_content('Not feasible')
expect(page).to have_content('It is impossible')
expect(page).to have_select('spending_proposal[administrator_id]', selected: 'Ana (ana@admins.org)')