diff --git a/app/views/admin/spending_proposals/show.html.erb b/app/views/admin/spending_proposals/show.html.erb index 304e6f792..536597545 100644 --- a/app/views/admin/spending_proposals/show.html.erb +++ b/app/views/admin/spending_proposals/show.html.erb @@ -1,4 +1,4 @@ -<%= link_to admin_spending_proposals_path, class: 'back' do %> +<%= link_to :back, class: 'back' do %> <%= t("admin.spending_proposals.show.back") %> <% end %> @@ -32,4 +32,9 @@

<%= t("admin.spending_proposals.show.dossier") %>

+ +

+ <%= link_to t("admin.spending_proposals.show.edit_dossier"), edit_valuation_spending_proposal_path(@spending_proposal) %> +

+ <%= render 'valuation/spending_proposals/written_by_valuators' %> diff --git a/app/views/valuation/spending_proposals/edit.html.erb b/app/views/valuation/spending_proposals/edit.html.erb index a3dba0b4b..8652fd070 100644 --- a/app/views/valuation/spending_proposals/edit.html.erb +++ b/app/views/valuation/spending_proposals/edit.html.erb @@ -3,25 +3,6 @@ <%= form_for(@spending_proposal, url: valuate_valuation_spending_proposal_path(@spending_proposal)) do |f| %> <%= render 'shared/errors', resource: @spending_proposal %> -
-
- <%= f.label :price, "#{t('valuation.spending_proposals.edit.price')} (#{t('valuation.spending_proposals.edit.currency')})" %> - <%= f.number_field :price, label: false %> -
- -
- <%= f.label :price_first_year, "#{t('valuation.spending_proposals.edit.price_first_year')} ( #{t('valuation.spending_proposals.edit.currency')})" %> - <%= f.number_field :price_first_year, label: false %> -
-
- -
-
- <%= f.label :price_explanation, t("valuation.spending_proposals.edit.price_explanation") %> - <%= f.text_area :price_explanation, label: false, rows: 3 %> -
-
-
@@ -45,14 +26,33 @@
- <%= f.label :feasible_explanation, t("valuation.spending_proposals.edit.feasible_explanation") %> + <%= f.label :feasible_explanation, t("valuation.spending_proposals.edit.feasible_explanation_html") %> <%= f.text_area :feasible_explanation, label: false, rows: 3 %>
+
+
+ <%= f.label :price, "#{t('valuation.spending_proposals.edit.price_html', currency: t('valuation.spending_proposals.edit.currency'))}" %> + <%= f.number_field :price, label: false, max: 1000000000000000 %> +
+ +
+ <%= f.label :price_first_year, "#{t('valuation.spending_proposals.edit.price_first_year_html', currency: t('valuation.spending_proposals.edit.currency'))}" %> + <%= f.number_field :price_first_year, label: false, max: 1000000000000000 %> +
+
+
- <%= f.label :time_scope, t("valuation.spending_proposals.edit.time_scope") %> + <%= f.label :price_explanation, t("valuation.spending_proposals.edit.price_explanation_html") %> + <%= f.text_area :price_explanation, label: false, rows: 3 %> +
+
+ +
+
+ <%= f.label :time_scope, t("valuation.spending_proposals.edit.time_scope_html") %> <%= f.text_field :time_scope, label: false %>
@@ -68,7 +68,7 @@
- <%= f.label :internal_comments, t("valuation.spending_proposals.edit.internal_comments") %> + <%= f.label :internal_comments, t("valuation.spending_proposals.edit.internal_comments_html") %> <%= f.text_area :internal_comments, label: false, rows: 3 %>
diff --git a/app/views/valuation/spending_proposals/show.html.erb b/app/views/valuation/spending_proposals/show.html.erb index b5b71fcdf..406ad00bf 100644 --- a/app/views/valuation/spending_proposals/show.html.erb +++ b/app/views/valuation/spending_proposals/show.html.erb @@ -1,4 +1,7 @@ -<%= link_to t("valuation.spending_proposals.show.back"), :back, class: 'back' %> +<%= link_to :back, class: 'back' do %> + <%= t("valuation.spending_proposals.show.back") %> +<% end %> +

<%= t("valuation.spending_proposals.show.heading") %> <%= @spending_proposal.id %>

<%= @spending_proposal.title %>

diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml index 3a8d1bf84..8b045dbd1 100755 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -173,6 +173,7 @@ en: sent: Sent geozone: Scope dossier: Dossier + edit_dossier: Edit dossier tags: Tags undefined: Undefined edit: diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml index 81af24d36..6dcf1c0c9 100644 --- a/config/locales/admin.es.yml +++ b/config/locales/admin.es.yml @@ -153,7 +153,7 @@ es: tags_filter_all: Todas las etiquetas filters: valuation_open: Abiertas - without_admin: Sin administrador asignado + without_admin: Sin administrador managed: Gestionando valuating: En evaluación valuation_finished: Evaluación finalizada @@ -173,6 +173,7 @@ es: sent: Fecha geozone: Ámbito dossier: Informe + edit_dossier: Editar informe tags: Etiquetas undefined: Sin definir edit: diff --git a/config/locales/valuation.en.yml b/config/locales/valuation.en.yml index 2aba2e89c..1fd016991 100644 --- a/config/locales/valuation.en.yml +++ b/config/locales/valuation.en.yml @@ -42,17 +42,17 @@ en: assigned_valuators: Assigned valuators edit: dossier: Dossier - price: Price - price_first_year: Cost during the first year + price_html: "Price (%{currency})" + price_first_year_html: "Cost during the first year (%{currency})" currency: "€" - price_explanation: Price explanation + price_explanation_html: Price explanation feasibility: Feasibility feasible: Feasible not_feasible: Not feasible - feasible_explanation: Feasibility explanation + feasible_explanation_html: Feasibility explanation valuation_finished: Valuation finished - time_scope: Time scope - internal_comments: Internal comments + time_scope_html: Time scope + internal_comments_html: Internal comments save: Save changes notice: valuate: "Dossier updated" diff --git a/config/locales/valuation.es.yml b/config/locales/valuation.es.yml index 94e9d1ec0..e3804beec 100644 --- a/config/locales/valuation.es.yml +++ b/config/locales/valuation.es.yml @@ -42,17 +42,17 @@ es: assigned_valuators: Evaluadores asignados edit: dossier: Informe - price: Coste - price_first_year: Coste en el primer año + price_html: "Coste (%{currency}) (dato público)" + price_first_year_html: "Coste en el primer año (%{currency}) (opcional, privado)" currency: "€" - price_explanation: Justificación del precio + price_explanation_html: "Informe de coste (opcional, dato público)" feasibility: Viabilidad feasible: Viable not_feasible: No viable - feasible_explanation: Justificación de la viabilidad + feasible_explanation_html: "Informe de inviabilidad (en caso de que lo sea, dato público)" valuation_finished: Informe finalizado - time_scope: Plazo de ejecución - internal_comments: Comentarios internos + time_scope_html: "Plazo de ejecución (opcional, dato no público)" + internal_comments_html: "Comentarios y observaciones (para responsables internos, dato no público)" save: Guardar cambios notice: valuate: "Informe actualizado" diff --git a/db/migrate/20160308184050_change_price_fields_to_bigint.rb b/db/migrate/20160308184050_change_price_fields_to_bigint.rb new file mode 100644 index 000000000..fd9000278 --- /dev/null +++ b/db/migrate/20160308184050_change_price_fields_to_bigint.rb @@ -0,0 +1,11 @@ +class ChangePriceFieldsToBigint < ActiveRecord::Migration + def up + change_column :spending_proposals, :price, :bigint + change_column :spending_proposals, :price_first_year, :bigint + end + + def down + change_column :spending_proposals, :price, :integer + change_column :spending_proposals, :price_first_year, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index 04f41722d..8d3a3caa9 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160308103548) do +ActiveRecord::Schema.define(version: 20160308184050) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -296,20 +296,20 @@ ActiveRecord::Schema.define(version: 20160308103548) do t.text "description" t.integer "author_id" t.string "external_url" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.integer "geozone_id" - t.integer "price" + t.integer "price", limit: 8 t.boolean "feasible" t.string "association_name" t.text "price_explanation" t.text "feasible_explanation" t.text "internal_comments" - t.boolean "valuation_finished", default: false + t.boolean "valuation_finished", default: false t.text "explanations_log" t.integer "administrator_id" - t.integer "valuation_assignments_count", default: 0 - t.integer "price_first_year" + t.integer "valuation_assignments_count", default: 0 + t.integer "price_first_year", limit: 8 t.string "time_scope" end