From e6f6a34054316fa382ba56f1f0c26573ab018492 Mon Sep 17 00:00:00 2001 From: Susana Truebano Date: Mon, 27 Feb 2017 13:04:56 +0100 Subject: [PATCH 01/74] fix close div and close thead in admin budgets groups edit partial --- app/views/admin/budgets/_group.html.erb | 56 ++++++++++++------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/app/views/admin/budgets/_group.html.erb b/app/views/admin/budgets/_group.html.erb index 422834f61..e90bd4905 100644 --- a/app/views/admin/budgets/_group.html.erb +++ b/app/views/admin/budgets/_group.html.erb @@ -7,23 +7,24 @@ - <% if headings.blank? %> - - - -
- <%= t("admin.budgets.form.no_heading") %> -
- - - <% else %> - - <%= t("admin.budgets.form.table_heading") %> - <%= t("admin.budgets.form.table_amount") %> - - - - <% end %> + <% if headings.blank? %> + + + + +
+ <%= t("admin.budgets.form.no_heading") %> +
+ + + <% else %> + + <%= t("admin.budgets.form.table_heading") %> + <%= t("admin.budgets.form.table_amount") %> + + + + <% end %> @@ -52,16 +53,15 @@ <% headings.each do |heading| %> - - - <%= heading.name %> - - - <%= heading.price %> - - + + + <%= heading.name %> + + + <%= heading.price %> + + <% end %> - - - + + From 580ed6e4c670f8e5863198a150d9f52f467baf2a Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Mon, 6 Mar 2017 13:15:12 +0100 Subject: [PATCH 02/74] adds alternative text for share on WhatsApp links --- app/views/budgets/investments/_investment_show.html.erb | 1 + app/views/debates/show.html.erb | 1 + app/views/proposals/show.html.erb | 1 + app/views/spending_proposals/show.html.erb | 1 + config/locales/social_share_button.en.yml | 1 + config/locales/social_share_button.es.yml | 1 + 6 files changed, 6 insertions(+) diff --git a/app/views/budgets/investments/_investment_show.html.erb b/app/views/budgets/investments/_investment_show.html.erb index 17abf4faf..37ddc8930 100644 --- a/app/views/budgets/investments/_investment_show.html.erb +++ b/app/views/budgets/investments/_investment_show.html.erb @@ -105,6 +105,7 @@ <% if browser.device.mobile? %> + <%= t("social_share_button.whatsapp") %> <% end %> diff --git a/app/views/debates/show.html.erb b/app/views/debates/show.html.erb index 363a3bab3..f28691727 100644 --- a/app/views/debates/show.html.erb +++ b/app/views/debates/show.html.erb @@ -55,6 +55,7 @@ <% if browser.device.mobile? %> + <%= t("social_share_button.whatsapp") %> <% end %> diff --git a/app/views/proposals/show.html.erb b/app/views/proposals/show.html.erb index 6209805cf..869417777 100644 --- a/app/views/proposals/show.html.erb +++ b/app/views/proposals/show.html.erb @@ -128,6 +128,7 @@ <% if browser.device.mobile? %> + <%= t("social_share_button.whatsapp") %> <% end %> diff --git a/app/views/spending_proposals/show.html.erb b/app/views/spending_proposals/show.html.erb index 0da045860..96468eb4c 100644 --- a/app/views/spending_proposals/show.html.erb +++ b/app/views/spending_proposals/show.html.erb @@ -47,6 +47,7 @@ <% if browser.device.mobile? %> + <%= t("social_share_button.whatsapp") %> <% end %> diff --git a/config/locales/social_share_button.en.yml b/config/locales/social_share_button.en.yml index b06cb5ad3..a4ba5436f 100644 --- a/config/locales/social_share_button.en.yml +++ b/config/locales/social_share_button.en.yml @@ -17,3 +17,4 @@ en: plurk: "Plurk" pinterest: "Pinterest" email: "Email" + whatsapp: "WhatsApp" \ No newline at end of file diff --git a/config/locales/social_share_button.es.yml b/config/locales/social_share_button.es.yml index 45e4ab2a5..4647fc010 100644 --- a/config/locales/social_share_button.es.yml +++ b/config/locales/social_share_button.es.yml @@ -17,3 +17,4 @@ es: plurk: "Plurk" pinterest: "Pinterest" email: "Correo electrónico" + whatsapp: "WhatsApp" \ No newline at end of file From ad9d6d0713ddc3ce38cee6903827fce14c874ecd Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Mon, 6 Mar 2017 13:31:18 +0100 Subject: [PATCH 03/74] fixes tabs role on proposals show --- app/views/proposals/_filter_subnav.html.erb | 2 +- app/views/proposals/show.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/proposals/_filter_subnav.html.erb b/app/views/proposals/_filter_subnav.html.erb index fe875c9a9..6347d56b0 100644 --- a/app/views/proposals/_filter_subnav.html.erb +++ b/app/views/proposals/_filter_subnav.html.erb @@ -1,6 +1,6 @@
-
    +
    • <%= link_to "#tab-comments" do %>

      diff --git a/app/views/proposals/show.html.erb b/app/views/proposals/show.html.erb index 869417777..22d17d29f 100644 --- a/app/views/proposals/show.html.erb +++ b/app/views/proposals/show.html.erb @@ -137,7 +137,7 @@

<% end %> -
+
<%= render "proposals/filter_subnav" %> <%= render "proposals/notifications" %> From 5cf9a98e6a79f0251eaf115880880250cdc3ccf4 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Mon, 6 Mar 2017 13:38:40 +0100 Subject: [PATCH 04/74] adds lang attribute on error pages --- public/404.html | 2 +- public/422.html | 2 +- public/500.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/404.html b/public/404.html index cc6820bba..5b5362192 100644 --- a/public/404.html +++ b/public/404.html @@ -1,5 +1,5 @@ - + Error 404 | Not found diff --git a/public/422.html b/public/422.html index e68d2956f..cca90e5a3 100644 --- a/public/422.html +++ b/public/422.html @@ -1,5 +1,5 @@ - + Error 422 | The change you wanted was rejected diff --git a/public/500.html b/public/500.html index 71978cdce..0b563452a 100644 --- a/public/500.html +++ b/public/500.html @@ -1,5 +1,5 @@ - + Error 500 | Internal server error From 24920e73f6538a807b93ba4497795c3fc47170eb Mon Sep 17 00:00:00 2001 From: kikito Date: Mon, 6 Mar 2017 13:42:52 +0100 Subject: [PATCH 05/74] Adds permissions for authors to destroy budget investments --- app/models/abilities/common.rb | 1 + spec/models/abilities/common_spec.rb | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/app/models/abilities/common.rb b/app/models/abilities/common.rb index e324540d2..7ac6a12f4 100644 --- a/app/models/abilities/common.rb +++ b/app/models/abilities/common.rb @@ -46,6 +46,7 @@ module Abilities can :create, SpendingProposal can :create, Budget::Investment, budget: { phase: "accepting" } + can :destroy, Budget::Investment, budget: { phase: ["accepting", "reviewing"] }, author_id: user.id can :vote, Budget::Investment, budget: { phase: "selecting" } can [:show, :create], Budget::Ballot, budget: { phase: "balloting" } can [:create, :destroy], Budget::Ballot::Line, budget: { phase: "balloting" } diff --git a/spec/models/abilities/common_spec.rb b/spec/models/abilities/common_spec.rb index ce90ab967..f82bcc839 100644 --- a/spec/models/abilities/common_spec.rb +++ b/spec/models/abilities/common_spec.rb @@ -10,12 +10,18 @@ describe "Abilities::Common" do let(:comment) { create(:comment) } let(:proposal) { create(:proposal) } let(:accepting_budget) { create(:budget, phase: 'accepting') } + let(:reviewing_budget) { create(:budget, phase: 'reviewing') } let(:selecting_budget) { create(:budget, phase: 'selecting') } let(:balloting_budget) { create(:budget, phase: 'balloting') } let(:investment_in_accepting_budget) { create(:budget_investment, budget: accepting_budget) } + let(:investment_in_reviewing_budget) { create(:budget_investment, budget: reviewing_budget) } let(:investment_in_selecting_budget) { create(:budget_investment, budget: selecting_budget) } let(:investment_in_balloting_budget) { create(:budget_investment, budget: balloting_budget) } + let(:own_investment_in_accepting_budget) { create(:budget_investment, budget: accepting_budget, author: user) } + let(:own_investment_in_reviewing_budget) { create(:budget_investment, budget: reviewing_budget, author: user) } + let(:own_investment_in_selecting_budget) { create(:budget_investment, budget: selecting_budget, author: user) } + let(:own_investment_in_balloting_budget) { create(:budget_investment, budget: balloting_budget, author: user) } let(:ballot_in_accepting_budget) { create(:budget_ballot, budget: accepting_budget) } let(:ballot_in_selecting_budget) { create(:budget_ballot, budget: selecting_budget) } let(:ballot_in_balloting_budget) { create(:budget_ballot, budget: balloting_budget) } @@ -117,6 +123,16 @@ describe "Abilities::Common" do it { should be_able_to(:vote, investment_in_selecting_budget) } it { should_not be_able_to(:vote, investment_in_balloting_budget) } + it { should_not be_able_to(:destroy, investment_in_accepting_budget) } + it { should_not be_able_to(:destroy, investment_in_reviewing_budget) } + it { should_not be_able_to(:destroy, investment_in_selecting_budget) } + it { should_not be_able_to(:destroy, investment_in_balloting_budget) } + + it { should be_able_to(:destroy, own_investment_in_accepting_budget) } + it { should be_able_to(:destroy, own_investment_in_reviewing_budget) } + it { should_not be_able_to(:destroy, own_investment_in_selecting_budget) } + it { should_not be_able_to(:destroy, investment_in_balloting_budget) } + it { should_not be_able_to(:create, ballot_in_accepting_budget) } it { should_not be_able_to(:create, ballot_in_selecting_budget) } it { should be_able_to(:create, ballot_in_balloting_budget) } From 737d347c4a3f0de76c6de8fb723eacccbea1e5d1 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Mon, 6 Mar 2017 13:45:11 +0100 Subject: [PATCH 06/74] changes alt text of header logo --- config/locales/en.yml | 2 +- config/locales/es.yml | 2 +- config/locales/fr.yml | 2 +- config/locales/pt-BR.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index dd9624188..b09ab94cd 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -195,7 +195,7 @@ en: external_link_transparency: Transparency external_link_transparency_url: https://transparency.consul locale: 'Language:' - logo: Consul + logo: Consul logo management: Management moderation: Moderation valuation: Valuation diff --git a/config/locales/es.yml b/config/locales/es.yml index 0b8fa4b1c..7f8164335 100755 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -195,7 +195,7 @@ es: external_link_transparency: Transparencia external_link_transparency_url: https://transparency.consul locale: 'Idioma:' - logo: Consul + logo: Consul logo management: Gestión moderation: Moderar valuation: Evaluación diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 596531c0d..cc0b1c590 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -874,7 +874,7 @@ fr: external_link_transparency: Transparence external_link_transparency_url: https://transparency.consul locale: 'Langue :' - logo: Consul + logo: Consul logo moderation: Modération more_information: Plus d'information my_account_link: Mon compte diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 75e7aebb6..febe0ed5c 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -860,7 +860,7 @@ pt-BR: external_link_transparency: Transparência external_link_transparency_url: https://transparency.consul locale: 'Idioma:' - logo: Consul + logo: Consul logotipo moderation: Moderação more_information: Mais informações my_account_link: Minha conta From 1e3ea14c9939d5ef950f85cf2c59be28eb105d4a Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Mon, 6 Mar 2017 14:00:08 +0100 Subject: [PATCH 07/74] improves color contrast on hollow buttons --- app/assets/stylesheets/layout.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 7c3300fa3..1511910b1 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -70,6 +70,11 @@ a { } } +.button.hollow { + border: 1px solid $link; + color: $link; +} + .postfix.button { padding: 0; } From b5fd8cc8b293d52d29b52ffc8156537352031da0 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Mon, 6 Mar 2017 14:04:17 +0100 Subject: [PATCH 08/74] fixes missing i18n --- app/views/budgets/investments/_investment_show.html.erb | 2 +- app/views/debates/show.html.erb | 2 +- app/views/proposals/show.html.erb | 2 +- app/views/spending_proposals/show.html.erb | 2 +- config/locales/en.yml | 1 + config/locales/es.yml | 1 + config/locales/social_share_button.en.yml | 3 +-- config/locales/social_share_button.es.yml | 3 +-- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/budgets/investments/_investment_show.html.erb b/app/views/budgets/investments/_investment_show.html.erb index 37ddc8930..ebac39186 100644 --- a/app/views/budgets/investments/_investment_show.html.erb +++ b/app/views/budgets/investments/_investment_show.html.erb @@ -105,7 +105,7 @@ <% if browser.device.mobile? %> - <%= t("social_share_button.whatsapp") %> + <%= t("social.whatsapp") %> <% end %>
diff --git a/app/views/debates/show.html.erb b/app/views/debates/show.html.erb index f28691727..096369bc3 100644 --- a/app/views/debates/show.html.erb +++ b/app/views/debates/show.html.erb @@ -55,7 +55,7 @@ <% if browser.device.mobile? %> - <%= t("social_share_button.whatsapp") %> + <%= t("social.whatsapp") %> <% end %>
diff --git a/app/views/proposals/show.html.erb b/app/views/proposals/show.html.erb index 22d17d29f..5d184088d 100644 --- a/app/views/proposals/show.html.erb +++ b/app/views/proposals/show.html.erb @@ -128,7 +128,7 @@ <% if browser.device.mobile? %> - <%= t("social_share_button.whatsapp") %> + <%= t("social.whatsapp") %> <% end %>
diff --git a/app/views/spending_proposals/show.html.erb b/app/views/spending_proposals/show.html.erb index 96468eb4c..4cdfb688b 100644 --- a/app/views/spending_proposals/show.html.erb +++ b/app/views/spending_proposals/show.html.erb @@ -47,7 +47,7 @@ <% if browser.device.mobile? %> - <%= t("social_share_button.whatsapp") %> + <%= t("social.whatsapp") %> <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index b09ab94cd..0bd238892 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -472,6 +472,7 @@ en: facebook: Facebook twitter: Twitter youtube: YouTube + whatsapp: WhatsApp spending_proposals: form: association_name_label: 'If you propose in name of an assocation or collective add the name here' diff --git a/config/locales/es.yml b/config/locales/es.yml index 7f8164335..4df6e870e 100755 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -472,6 +472,7 @@ es: facebook: Facebook twitter: Twitter youtube: YouTube + whatsapp: WhatsApp spending_proposals: form: association_name_label: 'Si propones en nombre de una asociación o colectivo añade el nombre aquí' diff --git a/config/locales/social_share_button.en.yml b/config/locales/social_share_button.en.yml index a4ba5436f..84ee6baba 100644 --- a/config/locales/social_share_button.en.yml +++ b/config/locales/social_share_button.en.yml @@ -16,5 +16,4 @@ en: tumblr: "Tumblr" plurk: "Plurk" pinterest: "Pinterest" - email: "Email" - whatsapp: "WhatsApp" \ No newline at end of file + email: "Email" \ No newline at end of file diff --git a/config/locales/social_share_button.es.yml b/config/locales/social_share_button.es.yml index 4647fc010..aa0c3f224 100644 --- a/config/locales/social_share_button.es.yml +++ b/config/locales/social_share_button.es.yml @@ -16,5 +16,4 @@ es: tumblr: "Tumblr" plurk: "Plurk" pinterest: "Pinterest" - email: "Correo electrónico" - whatsapp: "WhatsApp" \ No newline at end of file + email: "Correo electrónico" \ No newline at end of file From 3dbdc8f455e5fe18ff25079b0745c934a5608392 Mon Sep 17 00:00:00 2001 From: kikito Date: Mon, 6 Mar 2017 19:24:10 +0100 Subject: [PATCH 09/74] Adds delete link to budget investment list in user activities --- .../budgets/investments_controller.rb | 2 +- app/views/users/_budget_investments.html.erb | 5 +++++ config/locales/en.yml | 1 + config/locales/es.yml | 1 + config/routes.rb | 2 +- spec/features/budgets/investments_spec.rb | 18 +++++++++++++++++- 6 files changed, 26 insertions(+), 3 deletions(-) diff --git a/app/controllers/budgets/investments_controller.rb b/app/controllers/budgets/investments_controller.rb index 0a5e78eef..7f9c6e7ee 100644 --- a/app/controllers/budgets/investments_controller.rb +++ b/app/controllers/budgets/investments_controller.rb @@ -55,7 +55,7 @@ module Budgets end def destroy - investment.destroy + @investment.destroy redirect_to user_path(current_user, filter: 'budget_investments'), notice: t('flash.actions.destroy.budget_investment') end diff --git a/app/views/users/_budget_investments.html.erb b/app/views/users/_budget_investments.html.erb index b5773cbdf..d16f022ce 100644 --- a/app/views/users/_budget_investments.html.erb +++ b/app/views/users/_budget_investments.html.erb @@ -4,6 +4,11 @@ <%= link_to budget_investment.title, budget_investment_path(budget_investment.budget, budget_investment) %> + + <% if can? :destroy, budget_investment %> + <%= link_to t('shared.delete'), budget_investment_path(budget_investment.budget, budget_investment), method: :delete %> + <% end %> + <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index dd9624188..0e8462cb8 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -428,6 +428,7 @@ en: search: 'Filter' title: 'Advanced search' to: 'To' + delete: Delete author_info: author_deleted: User deleted back: Go back diff --git a/config/locales/es.yml b/config/locales/es.yml index 0b8fa4b1c..ba9b2c706 100755 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -428,6 +428,7 @@ es: search: 'Filtrar' title: 'Búsqueda avanzada' to: 'Hasta' + delete: 'Borrar' author_info: author_deleted: Usuario eliminado back: Volver diff --git a/config/routes.rb b/config/routes.rb index cc76297f6..8d5e84ad3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -298,7 +298,7 @@ Rails.application.routes.draw do get :support_investments get :print_investments end - resources :investments, only: [:index, :new, :create, :show], controller: 'budgets/investments' do + resources :investments, only: [:index, :new, :create, :show, :destroy], controller: 'budgets/investments' do post :vote, on: :member get :print, on: :collection end diff --git a/spec/features/budgets/investments_spec.rb b/spec/features/budgets/investments_spec.rb index a6feb6f44..323948c16 100644 --- a/spec/features/budgets/investments_spec.rb +++ b/spec/features/budgets/investments_spec.rb @@ -315,6 +315,20 @@ feature 'Budget Investments' do end end + scenario "Author can destroy while on the selecting phase" do + user = create(:user, :level_two) + sp1 = create(:budget_investment, :selected, heading: heading, price: 10000, author: user) + + login_as(user) + visit user_path(user, tab: :budget_investments) + + within("#budget_investment_#{sp1.id}") do + expect(page).to have_content(sp1.title) + click_link('Delete') + end + + visit user_path(user, tab: :budget_investments) + end end context "Selecting Phase" do @@ -476,6 +490,8 @@ feature 'Budget Investments' do expect(page).to have_content "€10,000" end + + scenario "Sidebar in show should display vote text" do investment = create(:budget_investment, :selected, budget: budget) visit budget_investment_path(budget, investment) @@ -561,4 +577,4 @@ feature 'Budget Investments' do end end -end \ No newline at end of file +end From f67b8d8aeebe3806213e1390d5ca0927b7e25986 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Mon, 6 Mar 2017 19:34:47 +0100 Subject: [PATCH 10/74] improves styles of delete button --- app/views/users/_budget_investments.html.erb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/users/_budget_investments.html.erb b/app/views/users/_budget_investments.html.erb index d16f022ce..64cad676d 100644 --- a/app/views/users/_budget_investments.html.erb +++ b/app/views/users/_budget_investments.html.erb @@ -4,9 +4,10 @@ <%= link_to budget_investment.title, budget_investment_path(budget_investment.budget, budget_investment) %> - + <% if can? :destroy, budget_investment %> - <%= link_to t('shared.delete'), budget_investment_path(budget_investment.budget, budget_investment), method: :delete %> + <%= link_to t('shared.delete'), budget_investment_path(budget_investment.budget, budget_investment), + method: :delete, class: "button hollow alert" %> <% end %> From 8f91b1e2cc064377a913aa8e6e3459439d3b61e1 Mon Sep 17 00:00:00 2001 From: kikito Date: Tue, 7 Mar 2017 16:42:45 +0100 Subject: [PATCH 11/74] fixes incorrect title/setup in spec --- spec/features/budgets/investments_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/features/budgets/investments_spec.rb b/spec/features/budgets/investments_spec.rb index 323948c16..1d812bd7e 100644 --- a/spec/features/budgets/investments_spec.rb +++ b/spec/features/budgets/investments_spec.rb @@ -315,9 +315,9 @@ feature 'Budget Investments' do end end - scenario "Author can destroy while on the selecting phase" do + scenario "Author can destroy while on the accepting phase" do user = create(:user, :level_two) - sp1 = create(:budget_investment, :selected, heading: heading, price: 10000, author: user) + sp1 = create(:budget_investment, heading: heading, price: 10000, author: user) login_as(user) visit user_path(user, tab: :budget_investments) From 712d5f2d9a6ebbc1da46099dd41770f58b3a95de Mon Sep 17 00:00:00 2001 From: rgarcia Date: Tue, 7 Mar 2017 18:17:49 +0100 Subject: [PATCH 12/74] displays only valuation tags for filtering --- app/helpers/budgets_helper.rb | 4 ++++ app/views/admin/budget_investments/index.html.erb | 2 +- spec/features/admin/budget_investments_spec.rb | 15 +++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/app/helpers/budgets_helper.rb b/app/helpers/budgets_helper.rb index 84f04139c..4b9dfd311 100644 --- a/app/helpers/budgets_helper.rb +++ b/app/helpers/budgets_helper.rb @@ -38,4 +38,8 @@ module BudgetsHelper def current_ballot Budget::Ballot.where(user: current_user, budget: @budget).first end + + def investment_tags_select_options + Budget::Investment.tags_on(:valuation).order(:name).select(:name).distinct + end end diff --git a/app/views/admin/budget_investments/index.html.erb b/app/views/admin/budget_investments/index.html.erb index 126a933b7..beb5eb856 100644 --- a/app/views/admin/budget_investments/index.html.erb +++ b/app/views/admin/budget_investments/index.html.erb @@ -28,7 +28,7 @@
<%= select_tag :tag_name, - options_for_select(spending_proposal_tags_select_options, params[:tag_name]), + options_for_select(investment_tags_select_options, params[:tag_name]), { prompt: t("admin.budget_investments.index.tags_filter_all"), label: false, class: "js-submit-on-change" } %> diff --git a/spec/features/admin/budget_investments_spec.rb b/spec/features/admin/budget_investments_spec.rb index ede09ec4f..f4dde2425 100644 --- a/spec/features/admin/budget_investments_spec.rb +++ b/spec/features/admin/budget_investments_spec.rb @@ -252,6 +252,21 @@ feature 'Admin budget investments' do expect(page).to have_content("More schools") end + scenario "Filtering by tag, display only valuation tags" do + investment1 = create(:budget_investment, budget: @budget, tag_list: 'Education') + investment2 = create(:budget_investment, budget: @budget, tag_list: 'Health') + + investment1.set_tag_list_on(:valuation, 'Teachers') + investment2.set_tag_list_on(:valuation, 'Hospitals') + + investment1.save + investment2.save + + visit admin_budget_budget_investments_path(budget_id: @budget.id) + + expect(page).to have_select("tag_name", options: ["All tags", "Hospitals", "Teachers"]) + end + end scenario 'Show' do From dcb0e03cf4314a076618d7759ad365eca13fdaaa Mon Sep 17 00:00:00 2001 From: kikito Date: Wed, 8 Mar 2017 13:32:12 +0100 Subject: [PATCH 13/74] small i18n change --- config/locales/es.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/es.yml b/config/locales/es.yml index e674f2106..495a940a3 100755 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -569,8 +569,8 @@ es: one: 1 Propuesta other: "%{count} Propuestas" budget_investments: - one: 1 Propuesta de inversión - other: "%{count} Propuestas de inversión" + one: 1 Proyecto de presupuestos participativos + other: "%{count} Proyectos de presupuestos participativos" no_activity: Usuario sin actividad pública no_private_messages: "Este usuario no acepta mensajes privados." private_activity: Este usuario ha decidido mantener en privado su lista de actividades From 9e582245d367f1cafdb1b0e0498fac2742b892a8 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Fri, 10 Mar 2017 12:04:47 +0100 Subject: [PATCH 14/74] avoids use tabindex attribute --- app/views/devise/sessions/new.html.erb | 10 ++++------ app/views/users/registrations/new.html.erb | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index ad375e772..910135853 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -11,18 +11,18 @@ <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
- <%= f.email_field :email, autofocus: true, placeholder: t("devise_views.sessions.new.email_label"), tabindex: "1" %> + <%= f.email_field :email, autofocus: true, placeholder: t("devise_views.sessions.new.email_label") %>
- <%= link_to t("devise_views.shared.links.new_password"), new_password_path(resource_name), class: "float-right", tabindex: "3" %> - <%= f.password_field :password, autocomplete: "off", placeholder: t("devise_views.sessions.new.password_label"), tabindex: "2" %> + <%= f.password_field :password, autocomplete: "off", placeholder: t("devise_views.sessions.new.password_label") %> + <%= link_to t("devise_views.shared.links.new_password"), new_password_path(resource_name), class: "float-right" %>
<% if devise_mapping.rememberable? -%>
<%= f.label :remember_me do %> - <%= f.check_box :remember_me, title: t('devise_views.sessions.new.remember_me'), label: false, tabindex: "4" %> + <%= f.check_box :remember_me, title: t('devise_views.sessions.new.remember_me'), label: false %> <%= t("devise_views.sessions.new.remember_me") %> <% end %>
@@ -35,5 +35,3 @@ <% end %> <%= render "devise/shared/links" %> - - diff --git a/app/views/users/registrations/new.html.erb b/app/views/users/registrations/new.html.erb index 1c6f81455..3ae3156f7 100644 --- a/app/views/users/registrations/new.html.erb +++ b/app/views/users/registrations/new.html.erb @@ -19,7 +19,7 @@ <%= f.label :username %>

<%= t("devise_views.users.registrations.new.username_note") %>

- <%= f.text_field :username, maxlength: User.username_max_length, placeholder: t("devise_views.users.registrations.new.username_label"), label: false %> + <%= f.text_field :username, autofocus: true, maxlength: User.username_max_length, placeholder: t("devise_views.users.registrations.new.username_label"), label: false %> <%= f.invisible_captcha :family_name %> From a7b9f830164b4e1e12b6fb8a33a15665ba81af9d Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Fri, 10 Mar 2017 12:06:33 +0100 Subject: [PATCH 15/74] fixes contrast color on form social buttons --- app/assets/stylesheets/layout.scss | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 1511910b1..baa6853d2 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -1167,6 +1167,9 @@ table { .button.button-twitter, .button.button-facebook, .button.button-google { + background: white; + color: $text; + font-weight: bold; height: $line-height*2; line-height: $line-height*2; padding: 0; @@ -1174,9 +1177,11 @@ table { } .button.button-twitter { - background: #45B0E3; + background: #ECF7FC; + border-left: 3px solid #45B0E3; &:before { + color: #45B0E3; content: "f"; font-family: "icons" !important; font-size: rem-calc(24); @@ -1214,9 +1219,11 @@ table { } .button.button-facebook { - background: #3B5998; + background: #EBEEF4; + border-left: 3px solid #3B5998; &:before { + color: #3B5998; content: "A"; font-family: "icons" !important; font-size: rem-calc(24); @@ -1254,9 +1261,11 @@ table { } .button.button-google { - background: #DE4C34; + background: #FCEDEA; + border-left: 3px solid #DE4C34; &:before { + color: #DE4C34; content: "B"; font-family: "icons" !important; font-size: rem-calc(24); From f3da84bc20c9602441ac395d1b6446d418e10aff Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Fri, 10 Mar 2017 12:55:56 +0100 Subject: [PATCH 16/74] improves colors contrast --- app/assets/stylesheets/layout.scss | 5 +++-- app/assets/stylesheets/participation.scss | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 1511910b1..e6d7dc5a2 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -1104,11 +1104,12 @@ img.avatar, img.admin-avatar, img.moderator-avatar, img.initialjs-avatar { // -------------------- [class^="level-"] { - color: white; + color: black; } .is-author { - background: #008CCF; + background: #00A5F1; + color: black; } .is-association { diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index c72b981c7..235b58291 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -455,7 +455,7 @@ } .bullet { - color: $border; + color: $text; } .investment-project-show p, .budget-investment-show p { From 11e5dee9a3bf639150d18fef50f37452561a1ca3 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Fri, 10 Mar 2017 12:57:40 +0100 Subject: [PATCH 17/74] removes placeholder on input date --- app/views/shared/_advanced_search.html.erb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/views/shared/_advanced_search.html.erb b/app/views/shared/_advanced_search.html.erb index 7ce6108b4..56157c4a7 100644 --- a/app/views/shared/_advanced_search.html.erb +++ b/app/views/shared/_advanced_search.html.erb @@ -37,7 +37,6 @@ <%= text_field_tag 'advanced_search[date_min]', params[:advanced_search].try(:[], :date_min), type: "date", - placeholder: t("shared.advanced_search.date_placeholder"), class: 'js-calendar' %>
@@ -47,7 +46,6 @@ <%= text_field_tag 'advanced_search[date_max]', params[:advanced_search].try(:[], :date_max), type: "date", - placeholder: t("shared.advanced_search.date_placeholder"), class: 'js-calendar' %>
From c6617e5c4af9092676880d47075be403ec7ee04c Mon Sep 17 00:00:00 2001 From: rgarcia Date: Mon, 13 Mar 2017 11:57:58 +0100 Subject: [PATCH 18/74] updates minor gem versions --- Gemfile | 38 +++++++-------- Gemfile.lock | 128 +++++++++++++++++++++++++++------------------------ 2 files changed, 86 insertions(+), 80 deletions(-) diff --git a/Gemfile b/Gemfile index 13a0b3567..81b87806d 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,7 @@ gem 'pg', '~> 0.19.0' # Use SCSS for stylesheets gem 'sass-rails', '~> 5.0', '>= 5.0.4' # Use Uglifier as compressor for JavaScript assets -gem 'uglifier', '>= 3.0.4' +gem 'uglifier', '~> 3.1.6' # Use CoffeeScript for .coffee assets and views gem 'coffee-rails', '~> 4.2.1' # See https://github.com/rails/execjs#readme for more supported runtimes @@ -40,11 +40,11 @@ gem 'foundation_rails_helper', '~> 2.0.0' gem 'acts_as_votable' gem 'ckeditor', '~> 4.2.2' gem 'invisible_captcha', '~> 0.9.2' -gem 'cancancan' +gem 'cancancan', '~> 1.16.0' gem 'social-share-button' gem 'initialjs-rails', '0.2.0.4' gem 'unicorn', '~> 5.2.0' -gem 'paranoia', '~> 2.2.0' +gem 'paranoia', '~> 2.2.1' gem 'rinku', '~> 2.0.2', require: 'rails_rinku' gem 'savon' gem 'dalli' @@ -52,18 +52,18 @@ gem 'rollbar', '~> 2.14.0' gem 'delayed_job_active_record', '~> 4.1.0' gem 'daemons' gem 'devise-async' -gem 'newrelic_rpm', '~> 3.17.2.327' +gem 'newrelic_rpm', '~> 3.18.1.330' gem 'whenever', require: false gem 'pg_search' -gem 'sitemap_generator' +gem 'sitemap_generator', '~> 5.3.1' gem 'ahoy_matey', '~> 1.5.3' -gem 'groupdate', '~> 3.1.0' # group temporary data +gem 'groupdate', '~> 3.2.0' # group temporary data gem 'tolk', '~> 2.0.0' # Web interface for translations gem 'browser' gem 'turnout', '~> 2.4.0' -gem 'redcarpet' +gem 'redcarpet', '~> 3.4.0' group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console @@ -72,28 +72,28 @@ group :development, :test do gem 'spring' gem 'spring-commands-rspec' gem 'rspec-rails', '~> 3.5' - gem 'capybara' - gem 'factory_girl_rails' + gem 'capybara', '~> 2.12.1' + gem 'factory_girl_rails', '~> 4.8.0' gem 'fuubar' gem 'launchy' gem 'quiet_assets' - gem 'letter_opener_web', '~> 1.3.0' - gem 'i18n-tasks' - gem 'capistrano', '3.5.0', require: false + gem 'letter_opener_web', '~> 1.3.1' + gem 'i18n-tasks', '~> 0.9.12' + gem 'capistrano', '~> 3.7.2', require: false gem 'capistrano-bundler', '~> 1.2', require: false - gem "capistrano-rails", '1.1.8', require: false + gem "capistrano-rails", '~> 1.2.3', require: false gem 'rvm1-capistrano3', require: false - gem 'capistrano3-delayed-job', '~> 1.0' - gem "bullet" - gem "faker" - gem 'rubocop', '~> 0.45.0', require: false + gem 'capistrano3-delayed-job', '~> 1.7.3' + gem "bullet", '~> 5.5.1' + gem "faker", '~> 1.7.3' + gem 'rubocop', '~> 0.47.1', require: false gem 'knapsack' end group :test do gem 'database_cleaner' - gem 'poltergeist' - gem 'coveralls', require: false + gem 'poltergeist', '~> 1.13.0' + gem 'coveralls', '~> 0.8.19', require: false gem 'email_spec' end diff --git a/Gemfile.lock b/Gemfile.lock index e2c21605c..f8e67edab 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -39,8 +39,9 @@ GEM acts-as-taggable-on (3.5.0) activerecord (>= 3.2, < 5) acts_as_votable (0.10.0) - addressable (2.4.0) - ahoy_matey (1.5.3) + addressable (2.5.0) + public_suffix (~> 2.0, >= 2.0.2) + ahoy_matey (1.5.4) addressable browser (~> 2.0) geocoder @@ -51,14 +52,14 @@ GEM safely_block (>= 0.1.1) user_agent_parser uuidtools - airbrussh (1.1.1) + airbrussh (1.1.2) sshkit (>= 1.6.1, != 1.7.0) akami (1.3.1) gyoku (>= 0.4.0) nokogiri ancestry (2.2.2) activerecord (>= 3.0.0) - arel (6.0.3) + arel (6.0.4) ast (2.3.0) babel-source (5.8.35) babel-transpiler (0.7.0) @@ -66,13 +67,13 @@ GEM execjs (~> 2.0) bcrypt (3.1.11) browser (2.3.0) - builder (3.2.2) - bullet (5.4.2) + builder (3.2.3) + bullet (5.5.1) activesupport (>= 3.0.0) uniform_notifier (~> 1.10.0) byebug (9.0.6) - cancancan (1.15.0) - capistrano (3.5.0) + cancancan (1.16.0) + capistrano (3.7.2) airbrussh (>= 1.0.0) capistrano-harrow i18n @@ -82,12 +83,13 @@ GEM capistrano (~> 3.1) sshkit (~> 1.2) capistrano-harrow (0.5.3) - capistrano-rails (1.1.8) + capistrano-rails (1.2.3) capistrano (~> 3.1) capistrano-bundler (~> 1.1) - capistrano3-delayed-job (1.7.2) + capistrano3-delayed-job (1.7.3) capistrano (~> 3.0, >= 3.0.0) - capybara (2.7.1) + daemons (~> 1.2.4) + capybara (2.12.1) addressable mime-types (>= 1.16) nokogiri (>= 1.3.3) @@ -111,7 +113,7 @@ GEM execjs coffee-script-source (1.10.0) concurrent-ruby (1.0.4) - coveralls (0.8.17) + coveralls (0.8.19) json (>= 1.8, < 3) simplecov (~> 0.12.0) term-ansicolor (~> 1.3) @@ -151,12 +153,12 @@ GEM errbase (0.0.3) erubis (2.7.0) execjs (2.7.0) - factory_girl (4.7.0) + factory_girl (4.8.0) activesupport (>= 3.0.0) - factory_girl_rails (4.7.0) - factory_girl (~> 4.7.0) + factory_girl_rails (4.8.0) + factory_girl (~> 4.8.0) railties (>= 3.0.0) - faker (1.6.6) + faker (1.7.3) i18n (~> 0.5) faraday (0.9.2) multipart-post (>= 1.2, < 3) @@ -173,10 +175,10 @@ GEM fuubar (2.2.0) rspec-core (~> 3.0) ruby-progressbar (~> 1.4) - geocoder (1.4.1) + geocoder (1.4.3) globalid (0.3.7) activesupport (>= 4.1.0) - groupdate (3.1.1) + groupdate (3.2.0) activesupport (>= 3) gyoku (1.3.1) builder (>= 2.1.2) @@ -185,8 +187,8 @@ GEM htmlentities (4.3.4) httpi (2.4.1) rack - i18n (0.7.0) - i18n-tasks (0.9.6) + i18n (0.8.1) + i18n-tasks (0.9.12) activesupport (>= 4.0.2) ast (>= 2.1.0) easy_translate (>= 0.5.0) @@ -219,7 +221,7 @@ GEM addressable (~> 2.3) letter_opener (1.4.1) launchy (~> 2.2) - letter_opener_web (1.3.0) + letter_opener_web (1.3.1) actionmailer (>= 3.2) letter_opener (~> 1.0) railties (>= 3.2) @@ -237,9 +239,9 @@ GEM multipart-post (2.0.0) net-scp (1.2.1) net-ssh (>= 2.6.5) - net-ssh (3.2.0) - newrelic_rpm (3.17.2.327) - nokogiri (1.6.8.1) + net-ssh (4.1.0) + newrelic_rpm (3.18.1.330) + nokogiri (1.7.0.1) mini_portile2 (~> 2.1.0) nori (2.6.0) oauth (0.5.0) @@ -269,20 +271,21 @@ GEM json (~> 1.3) omniauth-oauth (~> 1.1) orm_adapter (0.5.0) - paranoia (2.2.0) + paranoia (2.2.1) activerecord (>= 4.0, < 5.1) - parser (2.3.3.1) + parser (2.4.0.0) ast (~> 2.2) pg (0.19.0) pg_search (1.0.6) activerecord (>= 3.1) activesupport (>= 3.1) arel - poltergeist (1.10.0) + poltergeist (1.13.0) capybara (~> 2.1) cliver (~> 0.3.1) websocket-driver (>= 0.2.0) powerpack (0.1.1) + public_suffix (2.0.5) quiet_assets (1.1.0) railties (>= 3.1, < 5.0) rack (1.6.5) @@ -305,9 +308,9 @@ GEM sprockets-rails rails-deprecated_sanitizer (1.0.3) activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.7) + rails-dom-testing (1.0.8) activesupport (>= 4.2.0.beta, < 5.0) - nokogiri (~> 1.6.0) + nokogiri (~> 1.6) rails-deprecated_sanitizer (>= 1.0.1) rails-html-sanitizer (1.0.3) loofah (~> 2.0) @@ -316,12 +319,12 @@ GEM activesupport (= 4.2.7.1) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rainbow (2.1.0) + rainbow (2.2.1) raindrops (0.17.0) rake (12.0.0) - redcarpet (3.3.4) + redcarpet (3.4.0) referer-parser (0.3.0) - request_store (1.3.1) + request_store (1.3.2) responders (2.3.0) railties (>= 4.2.0, < 5.1) rinku (2.0.2) @@ -344,8 +347,8 @@ GEM rspec-mocks (~> 3.5.0) rspec-support (~> 3.5.0) rspec-support (3.5.0) - rubocop (0.45.0) - parser (>= 2.3.1.1, < 3.0) + rubocop (0.47.1) + parser (>= 2.3.3.1, < 3.0) powerpack (~> 0.1) rainbow (>= 1.99.1, < 3.0) ruby-progressbar (~> 1.7) @@ -355,7 +358,7 @@ GEM capistrano (~> 3.0) sshkit (>= 1.2) safe_yaml (1.0.4) - safely_block (0.1.1) + safely_block (0.2.0) errbase sass (3.4.22) sass-rails (5.0.6) @@ -377,7 +380,7 @@ GEM json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.0) - sitemap_generator (5.2.0) + sitemap_generator (5.3.1) builder (~> 3.0) social-share-button (0.3.1) coffee-rails @@ -396,7 +399,7 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - sshkit (1.11.4) + sshkit (1.12.0) net-scp (>= 1.1.2) net-ssh (>= 2.8.0) term-ansicolor (1.4.0) @@ -405,10 +408,10 @@ GEM unicode-display_width (~> 1.1.1) thor (0.19.4) thread (0.2.2) - thread_safe (0.3.5) + thread_safe (0.3.6) tilt (2.0.5) timecop (0.8.1) - tins (1.13.0) + tins (1.13.2) tolk (2.0.0) rails (>= 4.0) safe_yaml (>= 0.8.6) @@ -421,9 +424,9 @@ GEM tilt (>= 1.4, < 3) tzinfo (1.2.2) thread_safe (~> 0.1) - uglifier (3.0.4) + uglifier (3.1.6) execjs (>= 0.3.0, < 3) - unicode-display_width (1.1.1) + unicode-display_width (1.1.3) unicorn (5.2.0) kgio (~> 2.6) raindrops (~> 0.7) @@ -439,7 +442,7 @@ GEM activemodel (>= 4.2) debug_inspector railties (>= 4.2) - websocket-driver (0.6.4) + websocket-driver (0.6.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.2) whenever (0.9.7) @@ -456,17 +459,17 @@ DEPENDENCIES ahoy_matey (~> 1.5.3) ancestry (~> 2.2.2) browser - bullet + bullet (~> 5.5.1) byebug - cancancan - capistrano (= 3.5.0) + cancancan (~> 1.16.0) + capistrano (~> 3.7.2) capistrano-bundler (~> 1.2) - capistrano-rails (= 1.1.8) - capistrano3-delayed-job (~> 1.0) - capybara + capistrano-rails (~> 1.2.3) + capistrano3-delayed-job (~> 1.7.3) + capybara (~> 2.12.1) ckeditor (~> 4.2.2) coffee-rails (~> 4.2.1) - coveralls + coveralls (~> 0.8.19) daemons dalli database_cleaner @@ -475,13 +478,13 @@ DEPENDENCIES devise-async devise_security_extension email_spec - factory_girl_rails - faker + factory_girl_rails (~> 4.8.0) + faker (~> 1.7.3) foundation-rails (~> 6.2.4.0) foundation_rails_helper (~> 2.0.0) fuubar - groupdate (~> 3.1.0) - i18n-tasks + groupdate (~> 3.2.0) + i18n-tasks (~> 0.9.12) initialjs-rails (= 0.2.0.4) invisible_captcha (~> 0.9.2) jquery-rails (~> 4.2.2) @@ -489,28 +492,28 @@ DEPENDENCIES kaminari knapsack launchy - letter_opener_web (~> 1.3.0) - newrelic_rpm (~> 3.17.2.327) + letter_opener_web (~> 1.3.1) + newrelic_rpm (~> 3.18.1.330) omniauth omniauth-facebook (~> 3.0.0) omniauth-google-oauth2 (~> 0.4.0) omniauth-twitter - paranoia (~> 2.2.0) + paranoia (~> 2.2.1) pg (~> 0.19.0) pg_search - poltergeist + poltergeist (~> 1.13.0) quiet_assets rails (= 4.2.7.1) - redcarpet + redcarpet (~> 3.4.0) responders (~> 2.3.0) rinku (~> 2.0.2) rollbar (~> 2.14.0) rspec-rails (~> 3.5) - rubocop (~> 0.45.0) + rubocop (~> 0.47.1) rvm1-capistrano3 sass-rails (~> 5.0, >= 5.0.4) savon - sitemap_generator + sitemap_generator (~> 5.3.1) social-share-button spring spring-commands-rspec @@ -518,7 +521,10 @@ DEPENDENCIES tolk (~> 2.0.0) turbolinks turnout (~> 2.4.0) - uglifier (>= 3.0.4) + uglifier (~> 3.1.6) unicorn (~> 5.2.0) web-console (= 3.3.0) whenever + +BUNDLED WITH + 1.13.7 From d0ada346319193b4a55e5bf211d058be0e82aec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Tue, 14 Mar 2017 12:01:46 +0100 Subject: [PATCH 19/74] rails version up to 4.2.8 --- Gemfile | 2 +- Gemfile.lock | 65 ++++++++++++++++++++++++++-------------------------- 2 files changed, 33 insertions(+), 34 deletions(-) diff --git a/Gemfile b/Gemfile index 81b87806d..262a44ba4 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '4.2.7.1' +gem 'rails', '4.2.8' # Use PostgreSQL gem 'pg', '~> 0.19.0' # Use SCSS for stylesheets diff --git a/Gemfile.lock b/Gemfile.lock index f8e67edab..738087adf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,38 +1,37 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (4.2.7.1) - actionpack (= 4.2.7.1) - actionview (= 4.2.7.1) - activejob (= 4.2.7.1) + actionmailer (4.2.8) + actionpack (= 4.2.8) + actionview (= 4.2.8) + activejob (= 4.2.8) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.7.1) - actionview (= 4.2.7.1) - activesupport (= 4.2.7.1) + actionpack (4.2.8) + actionview (= 4.2.8) + activesupport (= 4.2.8) rack (~> 1.6) rack-test (~> 0.6.2) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.7.1) - activesupport (= 4.2.7.1) + actionview (4.2.8) + activesupport (= 4.2.8) builder (~> 3.1) erubis (~> 2.7.0) rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - activejob (4.2.7.1) - activesupport (= 4.2.7.1) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (4.2.8) + activesupport (= 4.2.8) globalid (>= 0.3.0) - activemodel (4.2.7.1) - activesupport (= 4.2.7.1) + activemodel (4.2.8) + activesupport (= 4.2.8) builder (~> 3.1) - activerecord (4.2.7.1) - activemodel (= 4.2.7.1) - activesupport (= 4.2.7.1) + activerecord (4.2.8) + activemodel (= 4.2.8) + activesupport (= 4.2.8) arel (~> 6.0) - activesupport (4.2.7.1) + activesupport (4.2.8) i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) @@ -208,7 +207,7 @@ GEM thor (>= 0.14, < 2.0) jquery-ui-rails (5.0.5) railties (>= 3.2.16) - json (1.8.3) + json (1.8.6) jwt (1.5.4) kaminari (0.17.0) actionpack (>= 3.0.0) @@ -295,16 +294,16 @@ GEM rack rack-test (0.6.3) rack (>= 1.0) - rails (4.2.7.1) - actionmailer (= 4.2.7.1) - actionpack (= 4.2.7.1) - actionview (= 4.2.7.1) - activejob (= 4.2.7.1) - activemodel (= 4.2.7.1) - activerecord (= 4.2.7.1) - activesupport (= 4.2.7.1) + rails (4.2.8) + actionmailer (= 4.2.8) + actionpack (= 4.2.8) + actionview (= 4.2.8) + activejob (= 4.2.8) + activemodel (= 4.2.8) + activerecord (= 4.2.8) + activesupport (= 4.2.8) bundler (>= 1.3.0, < 2.0) - railties (= 4.2.7.1) + railties (= 4.2.8) sprockets-rails rails-deprecated_sanitizer (1.0.3) activesupport (>= 4.2.0.alpha) @@ -314,9 +313,9 @@ GEM rails-deprecated_sanitizer (>= 1.0.1) rails-html-sanitizer (1.0.3) loofah (~> 2.0) - railties (4.2.7.1) - actionpack (= 4.2.7.1) - activesupport (= 4.2.7.1) + railties (4.2.8) + actionpack (= 4.2.8) + activesupport (= 4.2.8) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rainbow (2.2.1) @@ -503,7 +502,7 @@ DEPENDENCIES pg_search poltergeist (~> 1.13.0) quiet_assets - rails (= 4.2.7.1) + rails (= 4.2.8) redcarpet (~> 3.4.0) responders (~> 2.3.0) rinku (~> 2.0.2) From ed44d8cc5f76fc00c3f10ae13b55fcf25d80b3b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Tue, 14 Mar 2017 12:03:14 +0100 Subject: [PATCH 20/74] removes wrong search attribute --- app/views/shared/_tags.html.erb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/views/shared/_tags.html.erb b/app/views/shared/_tags.html.erb index 3cdb3c40e..ec2b7a1b1 100644 --- a/app/views/shared/_tags.html.erb +++ b/app/views/shared/_tags.html.erb @@ -5,8 +5,7 @@ <% taggable.tag_list_with_limit(limit).each do |tag| %>
  • <%= link_to sanitize(tag.name), - taggables_path(taggable.class.name.underscore, tag.name), - search: tag.name %>
  • + taggables_path(taggable.class.name.underscore, tag.name) %> <% end %> <% if taggable.tags_count_out_of_limit(limit) > 0 %> From 2d3e3586d1531418ab2aceed988b43f65176c05b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Tue, 14 Mar 2017 13:30:31 +0100 Subject: [PATCH 21/74] updates capistrano scm config --- Capfile | 4 ++++ config/deploy.rb | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Capfile b/Capfile index 1a33b63f0..ea11eb9b6 100644 --- a/Capfile +++ b/Capfile @@ -12,6 +12,10 @@ require 'capistrano/delayed_job' require 'whenever/capistrano' require 'rvm1/capistrano3' +#SCM: Git +require "capistrano/scm/git" +install_plugin Capistrano::SCM::Git + # Load custom tasks from `lib/capistrano/tasks` if you have any defined Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r } Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r } diff --git a/config/deploy.rb b/config/deploy.rb index 52fa7a255..5b842cef6 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -15,7 +15,6 @@ set :full_app_name, deploysecret(:full_app_name) set :server_name, deploysecret(:server_name) set :repo_url, 'https://github.com/consul/consul.git' -set :scm, :git set :revision, `git rev-parse --short #{fetch(:branch)}`.strip set :log_level, :info From 45def094fe45a078b6db4e29880f1d107a49beb0 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Tue, 14 Mar 2017 18:42:21 +0100 Subject: [PATCH 22/74] removes accesskey on top links and login items links --- app/views/devise/menu/_login_items.html.erb | 12 ++++++------ app/views/shared/_top_links.html.erb | 3 +-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/views/devise/menu/_login_items.html.erb b/app/views/devise/menu/_login_items.html.erb index 0ab28e2ee..b7db4a22c 100644 --- a/app/views/devise/menu/_login_items.html.erb +++ b/app/views/devise/menu/_login_items.html.erb @@ -1,6 +1,6 @@ <% if user_signed_in? %>
  • - <%= link_to notifications_path, class: "notifications", accesskey: "n" do %> + <%= link_to notifications_path, class: "notifications" do %> <%= t("layouts.header.notifications") %> <% if current_user.notifications_count > 0 %> @@ -12,19 +12,19 @@ <% end %>
  • - <%= link_to(t("layouts.header.my_activity_link"), user_path(current_user), accesskey: "a") %> + <%= link_to t("layouts.header.my_activity_link"), user_path(current_user) %>
  • - <%= link_to(t("layouts.header.my_account_link"), account_path, accesskey: "m") %> + <%= link_to t("layouts.header.my_account_link"), account_path %>
  • - <%= link_to(t("devise_views.menu.login_items.logout"), destroy_user_session_path, method: :delete) %> + <%= link_to t("devise_views.menu.login_items.logout"), destroy_user_session_path, method: :delete %>
  • <% else %>
  • - <%= link_to(t("devise_views.menu.login_items.login"), new_user_session_path) %> + <%= link_to t("devise_views.menu.login_items.login"), new_user_session_path %>
  • - <%= link_to(t("devise_views.menu.login_items.signup"), new_user_registration_path, class: "button") %> + <%= link_to t("devise_views.menu.login_items.signup"), new_user_registration_path, class: "button" %>
  • <% end %> diff --git a/app/views/shared/_top_links.html.erb b/app/views/shared/_top_links.html.erb index b6b738aca..40cda54de 100644 --- a/app/views/shared/_top_links.html.erb +++ b/app/views/shared/_top_links.html.erb @@ -2,8 +2,7 @@
  • <%= link_to t("layouts.header.more_information"), page_path('more_information'), - class: ("selected" if current_page?("/more_information")), - accesskey: "i" %> + class: ("selected" if current_page?("/more_information")) %>
  • <%= link_to t("layouts.header.external_link_transparency"), From 02cb83c6835aaf3cd4303884edb528d3fc4b28e1 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Tue, 14 Mar 2017 18:43:02 +0100 Subject: [PATCH 23/74] changes accesskey letters to numbers --- app/views/layouts/_header.html.erb | 2 +- app/views/pages/accessibility.html.erb | 28 +++++++----------------- app/views/shared/_subnavigation.html.erb | 11 +++++----- 3 files changed, 14 insertions(+), 27 deletions(-) diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 223f173b2..9a33662c6 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -21,7 +21,7 @@
    - <%= link_to root_path, class: "hide-for-small-only", accesskey: "/" do %> + <%= link_to root_path, class: "hide-for-small-only", accesskey: "0" do %> <%= image_tag('logo_header.png', class: 'hide-for-small-only float-left', size: '80x80', alt: t("layouts.header.logo")) %> <%= setting['org_name'] %> <% end %> diff --git a/app/views/pages/accessibility.html.erb b/app/views/pages/accessibility.html.erb index a2c2eff30..197885370 100644 --- a/app/views/pages/accessibility.html.erb +++ b/app/views/pages/accessibility.html.erb @@ -27,37 +27,25 @@ - / + 0 Inicio - D + 1 Debates - P + 2 Propuestas - S + 3 + Votaciones + + + 4 Presupuestos participativos - - I - Más información - - - N - Notificaciones - - - A - Mi actividad - - - M - Mi cuenta -
    diff --git a/app/views/shared/_subnavigation.html.erb b/app/views/shared/_subnavigation.html.erb index ed5694f27..f7bc3c810 100644 --- a/app/views/shared/_subnavigation.html.erb +++ b/app/views/shared/_subnavigation.html.erb @@ -5,27 +5,26 @@ <%= layout_menu_link_to t("layouts.header.debates"), debates_path, controller_name == 'debates', - accesskey: "d" %> + accesskey: "1" %>
  • <% end %>
  • <%= layout_menu_link_to t("layouts.header.proposals"), proposals_path, controller_name == 'proposals', - accesskey: "p" %> + accesskey: "2" %>
  • <%= layout_menu_link_to t("layouts.header.proposal_ballot"), proposal_ballots_path, controller_name == 'proposal_ballots', - accesskey: "v" %> + accesskey: "3" %>
  • <% if feature?(:spending_proposals) %>
  • <%= layout_menu_link_to t("layouts.header.spending_proposals"), spending_proposals_path, - controller_name == 'spending_proposals', - accesskey: "s" %> + controller_name == 'spending_proposals' %>
  • <% end %> <% if feature?(:budgets) %> @@ -33,7 +32,7 @@ <%= layout_menu_link_to t("layouts.header.budgets"), budgets_path, controller_name == "budgets" || controller_name == "investments", - accesskey: "b" %> + accesskey: "4" %> <% end %> From 7541956f5b68e6671289944480b54e14d540cf8d Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Tue, 14 Mar 2017 18:45:35 +0100 Subject: [PATCH 24/74] adds captions to accessibility page tables --- app/views/pages/accessibility.html.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/views/pages/accessibility.html.erb b/app/views/pages/accessibility.html.erb index 197885370..de5e64277 100644 --- a/app/views/pages/accessibility.html.erb +++ b/app/views/pages/accessibility.html.erb @@ -19,6 +19,7 @@
    + @@ -54,6 +55,7 @@
    Atajos de teclado para el menú de navegación
    Tecla
    + From e9bc450745aabbda07b1b2adb99890ec761d4348 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Tue, 14 Mar 2017 19:11:00 +0100 Subject: [PATCH 25/74] adds scope attribute on accessibility page tables --- app/views/pages/accessibility.html.erb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/pages/accessibility.html.erb b/app/views/pages/accessibility.html.erb index de5e64277..a0f54760d 100644 --- a/app/views/pages/accessibility.html.erb +++ b/app/views/pages/accessibility.html.erb @@ -22,8 +22,8 @@ - - + + @@ -58,8 +58,8 @@ - - + + @@ -94,8 +94,8 @@
    Combinación de teclas dependiendo del sistema operativo y navegador
    Navegador
    Atajos de teclado para el menú de navegación
    TeclaPáginaTeclaPágina
    Combinación de teclas dependiendo del sistema operativo y navegador
    NavegadorCombinación de teclasNavegadorCombinación de teclas
    - - + + From ea63c1ccf061922356adae7bad47479a1dc3946b Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Tue, 14 Mar 2017 19:19:38 +0100 Subject: [PATCH 26/74] adds accesskey to outdated spending proprosals menu --- app/views/shared/_subnavigation.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/shared/_subnavigation.html.erb b/app/views/shared/_subnavigation.html.erb index f7bc3c810..32dc73aa7 100644 --- a/app/views/shared/_subnavigation.html.erb +++ b/app/views/shared/_subnavigation.html.erb @@ -24,7 +24,8 @@
  • <%= layout_menu_link_to t("layouts.header.spending_proposals"), spending_proposals_path, - controller_name == 'spending_proposals' %> + controller_name == 'spending_proposals', + accesskey: "s" %>
  • <% end %> <% if feature?(:budgets) %> From 170cb89a5c1ca90af42aa2ffabf3f8bfa62fa979 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Wed, 15 Mar 2017 14:50:50 +0100 Subject: [PATCH 27/74] allows admins to see budgets in reviewing and selecting phase --- .../management/budgets_controller.rb | 9 +++ .../management/budget_investments_spec.rb | 55 +++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/app/controllers/management/budgets_controller.rb b/app/controllers/management/budgets_controller.rb index c5cfdee76..dd7259c99 100644 --- a/app/controllers/management/budgets_controller.rb +++ b/app/controllers/management/budgets_controller.rb @@ -7,6 +7,11 @@ class Management::BudgetsController < Management::BaseController def create_investments @budgets = Budget.accepting.order(created_at: :desc).page(params[:page]) + + if current_manager_administrator? + @budgets += Budget.reviewing.order(created_at: :desc) + + Budget.selecting.order(created_at: :desc) + end end def support_investments @@ -23,4 +28,8 @@ class Management::BudgetsController < Management::BaseController check_verified_user t("management.budget_investments.alert.unverified_user") end + def current_manager_administrator? + session[:manager]["login"].match("admin") + end + end diff --git a/spec/features/management/budget_investments_spec.rb b/spec/features/management/budget_investments_spec.rb index 5b3961306..c4d7a8797 100644 --- a/spec/features/management/budget_investments_spec.rb +++ b/spec/features/management/budget_investments_spec.rb @@ -137,6 +137,61 @@ feature 'Budget Investments' do end end + scenario "Listing - managers can see budgets in accepting phase" do + accepting_budget = create(:budget, phase: "accepting") + reviewing_budget = create(:budget, phase: "reviewing") + selecting_budget = create(:budget, phase: "selecting") + valuating_budget = create(:budget, phase: "valuating") + balloting_budget = create(:budget, phase: "balloting") + reviewing_ballots_budget = create(:budget, phase: "reviewing_ballots") + finished = create(:budget, phase: "finished") + + user = create(:user, :level_two) + login_managed_user(user) + + click_link "Create budget investment" + + expect(page).to have_content(accepting_budget.name) + + expect(page).to_not have_content(reviewing_budget.name) + expect(page).to_not have_content(selecting_budget.name) + expect(page).to_not have_content(valuating_budget.name) + expect(page).to_not have_content(balloting_budget.name) + expect(page).to_not have_content(reviewing_ballots_budget.name) + expect(page).to_not have_content(finished.name) + end + + scenario "Listing - admins can see budgets in accepting, reviewing and selecting phases" do + accepting_budget = create(:budget, phase: "accepting") + reviewing_budget = create(:budget, phase: "reviewing") + selecting_budget = create(:budget, phase: "selecting") + valuating_budget = create(:budget, phase: "valuating") + balloting_budget = create(:budget, phase: "balloting") + reviewing_ballots_budget = create(:budget, phase: "reviewing_ballots") + finished = create(:budget, phase: "finished") + + visit root_path + click_link "Sign out" + + admin = create(:administrator) + login_as(admin.user) + + user = create(:user, :level_two) + login_managed_user(user) + visit management_sign_in_path + + click_link "Create budget investment" + + expect(page).to have_content(accepting_budget.name) + expect(page).to have_content(reviewing_budget.name) + expect(page).to have_content(selecting_budget.name) + + expect(page).to_not have_content(valuating_budget.name) + expect(page).to_not have_content(balloting_budget.name) + expect(page).to_not have_content(reviewing_ballots_budget.name) + expect(page).to_not have_content(finished.name) + end + context "Supporting" do scenario 'Supporting budget investments on behalf of someone in index view', :js do From 85c5e584fb19f3d66312bc72c9e71a15b4267459 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Wed, 15 Mar 2017 18:49:17 +0100 Subject: [PATCH 28/74] adds comprehensive specs for permissions to vote an investment --- spec/models/budget/investment_spec.rb | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/spec/models/budget/investment_spec.rb b/spec/models/budget/investment_spec.rb index abbc8ad26..3725b91f3 100644 --- a/spec/models/budget/investment_spec.rb +++ b/spec/models/budget/investment_spec.rb @@ -285,6 +285,45 @@ describe Budget::Investment do expect(salamanca_investment.valid_heading?(user)).to eq(false) end + + it "allows votes in a group with a single heading" do + all_city_investment = create(:budget_investment, heading: heading) + expect(all_city_investment.valid_heading?(user)).to eq(true) + end + + it "allows votes in a group with a single heading after voting in that heading" do + all_city_investment1 = create(:budget_investment, heading: heading) + all_city_investment2 = create(:budget_investment, heading: heading) + + create(:vote, votable: all_city_investment1, voter: user) + + expect(all_city_investment2.valid_heading?(user)).to eq(true) + end + + it "allows votes in a group with a single heading after voting in another group" do + districts = create(:budget_group, budget: budget) + carabanchel = create(:budget_heading, group: districts) + + all_city_investment = create(:budget_investment, heading: heading) + carabanchel_investment = create(:budget_investment, heading: carabanchel) + + create(:vote, votable: carabanchel_investment, voter: user) + + expect(all_city_investment.valid_heading?(user)).to eq(true) + end + + it "allows votes in a group with multiple headings after voting in group with a single heading" do + districts = create(:budget_group, budget: budget) + carabanchel = create(:budget_heading, group: districts) + salamanca = create(:budget_heading, group: districts) + + all_city_investment = create(:budget_investment, heading: heading) + carabanchel_investment = create(:budget_investment, heading: carabanchel) + + create(:vote, votable: all_city_investment, voter: user) + + expect(carabanchel_investment.valid_heading?(user)).to eq(true) + end end end From b8b7cda4e6ed399c8b3997172c437bd77c653bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Thu, 16 Mar 2017 14:30:31 +0100 Subject: [PATCH 29/74] keeps Budget::Investment's group in sync with heading --- app/models/budget/investment.rb | 2 +- spec/models/budget/investment_spec.rb | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/app/models/budget/investment.rb b/app/models/budget/investment.rb index 100433707..230e25d82 100644 --- a/app/models/budget/investment.rb +++ b/app/models/budget/investment.rb @@ -259,7 +259,7 @@ class Budget private def set_denormalized_ids - self.group_id ||= self.heading.try(:group_id) + self.group_id = self.heading.try(:group_id) if self.heading_id_changed? self.budget_id ||= self.heading.try(:group).try(:budget_id) end end diff --git a/spec/models/budget/investment_spec.rb b/spec/models/budget/investment_spec.rb index abbc8ad26..e36a1c062 100644 --- a/spec/models/budget/investment_spec.rb +++ b/spec/models/budget/investment_spec.rb @@ -35,6 +35,25 @@ describe Budget::Investment do expect(investment.description).to eq("alert('danger');") end + it "set correct group and budget ids" do + budget = create(:budget) + group_1 = create(:budget_group, budget: budget) + group_2 = create(:budget_group, budget: budget) + + heading_1 = create(:budget_heading, group: group_1) + heading_2 = create(:budget_heading, group: group_2) + + investment = create(:budget_investment, heading: heading_1) + + expect(investment.budget_id).to eq budget.id + expect(investment.group_id).to eq group_1.id + + investment.update(heading: heading_2) + + expect(investment.budget_id).to eq budget.id + expect(investment.group_id).to eq group_2.id + end + describe "#unfeasibility_explanation" do it "should be valid if valuation not finished" do investment.unfeasibility_explanation = "" From 8f13c0e2ec7e49f43f40dba5c526602d49b867fa Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Thu, 16 Mar 2017 17:04:36 +0100 Subject: [PATCH 30/74] adds setting to add per page code on and --- app/views/layouts/application.html.erb | 4 +++- config/locales/fr.yml | 3 ++- config/locales/pt-BR.yml | 3 ++- config/locales/settings.en.yml | 3 ++- config/locales/settings.es.yml | 3 ++- db/dev_seeds.rb | 3 ++- db/seeds.rb | 7 +++++-- 7 files changed, 18 insertions(+), 8 deletions(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 7a1dae4d9..ef4455320 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -20,9 +20,11 @@ type: "image/png" %> <%= content_for :social_media_meta_tags %> - <%= setting['per_page_code'].try(:html_safe) %> + <%= setting['per_page_code_head'].try(:html_safe) %> + <%= setting['per_page_code_body'].try(:html_safe) %> +

    <%= setting['org_name'] %>

    diff --git a/config/locales/fr.yml b/config/locales/fr.yml index cc0b1c590..25ed4b86e 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1354,7 +1354,8 @@ fr: official_level_3_name: Niveau 3 personne officielle official_level_4_name: Niveau 4 personne officielle official_level_5_name: Niveau 5 personne officielle - per_page_code: Code à inclure dans chaque page + per_page_code_head: "Code à inclure dans chaque page ()" + per_page_code_body: "Code à inclure dans chaque page ()" proposal_code_prefix: Préfixe pour les codes de propositions votes_for_proposal_success: Nombre de votes nécessaires pour l'approbation d'une proposition diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index febe0ed5c..4718085a4 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -1370,7 +1370,8 @@ pt-BR: official_level_3_name: Nível 3 coordenador público official_level_4_name: Nível 4 coordenador público official_level_5_name: Nível 5 coordenador público - per_page_code: Código a ser incluído em cada página + per_page_code_head: "Código a ser incluído em cada página ()" + per_page_code_body: "Código a ser incluído em cada página ()" proposal_code_prefix: Prefixo para códigos de Proposta votes_for_proposal_success: Número de votos necessários para aprovar uma Proposta shared: diff --git a/config/locales/settings.en.yml b/config/locales/settings.en.yml index 811f10557..7e126bc35 100755 --- a/config/locales/settings.en.yml +++ b/config/locales/settings.en.yml @@ -13,7 +13,8 @@ en: votes_for_proposal_success: "Number of votes necessary for approval of a Proposal" months_to_archive_proposals: "Months to archive Proposals" email_domain_for_officials: "Email domain for public officials" - per_page_code: "Code to be included on every page" + per_page_code_head: "Code to be included on every page ()" + per_page_code_body: "Code to be included on every page ()" twitter_handle: "Twitter handle" twitter_hashtag: "Twitter hashtag" facebook_handle: "Facebook handle" diff --git a/config/locales/settings.es.yml b/config/locales/settings.es.yml index b4575432e..27224d90b 100644 --- a/config/locales/settings.es.yml +++ b/config/locales/settings.es.yml @@ -13,7 +13,8 @@ es: votes_for_proposal_success: "Número de votos necesarios para aprobar una Propuesta" months_to_archive_proposals: "Meses para archivar las Propuestas" email_domain_for_officials: "Dominio de email para cargos públicos" - per_page_code: "Código a incluir en cada página" + per_page_code_head: "Código a incluir en cada página ()" + per_page_code_body: "Código a incluir en cada página ()" twitter_handle: "Usuario de Twitter" twitter_hashtag: "Hashtag para Twitter" facebook_handle: "Identificador de Facebook" diff --git a/db/dev_seeds.rb b/db/dev_seeds.rb index a59a3c9b9..7ad046c42 100644 --- a/db/dev_seeds.rb +++ b/db/dev_seeds.rb @@ -32,7 +32,8 @@ Setting.create(key: 'feature.twitter_login', value: "true") Setting.create(key: 'feature.facebook_login', value: "true") Setting.create(key: 'feature.google_login', value: "true") Setting.create(key: 'feature.signature_sheets', value: "true") -Setting.create(key: 'per_page_code', value: "") +Setting.create(key: 'per_page_code_head', value: "") +Setting.create(key: 'per_page_code_body', value: "") Setting.create(key: 'comments_body_max_length', value: '1000') Setting.create(key: 'mailer_from_name', value: 'Consul') Setting.create(key: 'mailer_from_address', value: 'noreply@consul.dev') diff --git a/db/seeds.rb b/db/seeds.rb index 41261d9d7..5ff079f2f 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -38,8 +38,11 @@ Setting["months_to_archive_proposals"] = 12 # Emails under the domain's subdomains will also be included Setting["email_domain_for_officials"] = '' -# Code to be included at the top (header) of every page (useful for tracking) -Setting['per_page_code'] = '' +# Code to be included at the top (inside ) of every page (useful for tracking) +Setting['per_page_code_head'] = '' + +# Code to be included at the top (inside ) of every page +Setting['per_page_code_body'] = '' # Social settings Setting["twitter_handle"] = nil From dadfdba1b1fd34b74e54da63c0aafa611518ba83 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Mon, 20 Mar 2017 11:59:22 +0100 Subject: [PATCH 31/74] adds date of birth form when manager creates new user --- app/controllers/management/users_controller.rb | 2 +- app/views/management/users/new.html.erb | 10 ++++++++-- config/locales/management.en.yml | 1 + config/locales/management.es.yml | 1 + spec/features/management/users_spec.rb | 2 ++ 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/controllers/management/users_controller.rb b/app/controllers/management/users_controller.rb index 53004a838..8d3d148fa 100644 --- a/app/controllers/management/users_controller.rb +++ b/app/controllers/management/users_controller.rb @@ -32,7 +32,7 @@ class Management::UsersController < Management::BaseController private def user_params - params.require(:user).permit(:document_type, :document_number, :username, :email) + params.require(:user).permit(:document_type, :document_number, :username, :email, :date_of_birth) end def destroy_session diff --git a/app/views/management/users/new.html.erb b/app/views/management/users/new.html.erb index 6602e4978..d52597590 100644 --- a/app/views/management/users/new.html.erb +++ b/app/views/management/users/new.html.erb @@ -4,7 +4,7 @@ message: t("management.document_verifications.in_census_has_following_permissions"), permissions: [:debates, :create_proposals, :support_proposals, :vote_proposals] %> -
    +
    NavegadorAcción a realizar NavegadorAcción a realizar
    - - + + + + <% @budgets.each do |budget| %> From 841364efc09e09de6bd48e1b566d6ddca179b07c Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Wed, 22 Mar 2017 17:14:36 +0100 Subject: [PATCH 39/74] adds th scope --- app/views/budgets/index.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/budgets/index.html.erb b/app/views/budgets/index.html.erb index 79bba8d2c..f3e386d27 100644 --- a/app/views/budgets/index.html.erb +++ b/app/views/budgets/index.html.erb @@ -11,8 +11,8 @@
    <%= Budget.human_attribute_name(:name) %><%= Budget.human_attribute_name(:phase) %>
    <%= Budget.human_attribute_name(:name) %><%= Budget.human_attribute_name(:phase) %>
    - - + + From 53290b3d0d7f0b8266b4cee25a5308e8997df613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Thu, 23 Mar 2017 12:48:00 +0100 Subject: [PATCH 40/74] renames budget phases --- config/locales/activerecord.es.yml | 8 ++++---- config/locales/budgets.en.yml | 10 +++++----- config/locales/budgets.es.yml | 14 +++++++------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/config/locales/activerecord.es.yml b/config/locales/activerecord.es.yml index c71a34178..7d47a8e30 100644 --- a/config/locales/activerecord.es.yml +++ b/config/locales/activerecord.es.yml @@ -43,13 +43,13 @@ es: attributes: budget: name: "Nombre" - description_accepting: "Descripción durante la fase de aceptación" - description_reviewing: "Descripción durante la fase de revisión" - description_selecting: "Descripción durante la fase de selección" + description_accepting: "Descripción durante la fase de presentación de proyectos" + description_reviewing: "Descripción durante la fase de revisión interna" + description_selecting: "Descripción durante la fase de apoyos" description_valuating: "Descripción durante la fase de evaluación" description_balloting: "Descripción durante la fase de votación" description_reviewing_ballots: "Descripción durante la fase de revisión de votos" - description_finished: "Descripción cuando el presupuesto ha finalizado" + description_finished: "Descripción cuando el presupuesto ha finalizado / Resultados" phase: "Fase" currency_symbol: "Divisa" budget/investment: diff --git a/config/locales/budgets.en.yml b/config/locales/budgets.en.yml index 5e4861a16..7b3251ad4 100644 --- a/config/locales/budgets.en.yml +++ b/config/locales/budgets.en.yml @@ -25,11 +25,11 @@ en: unfeasible_title: Unfeasible investments unfeasible: See unfeasible investments phase: - accepting: Accepting proposals - reviewing: Reviewing proposals - selecting: Selecting proposals - valuating: Valuating proposals - balloting: Balloting proposals + accepting: Accepting projects + reviewing: Reviewing projects + selecting: Selecting projects + valuating: Valuating projects + balloting: Balloting projects reviewing_ballots: Reviewing Ballots finished: Finished budget index: diff --git a/config/locales/budgets.es.yml b/config/locales/budgets.es.yml index 08a33bde8..44b748698 100644 --- a/config/locales/budgets.es.yml +++ b/config/locales/budgets.es.yml @@ -25,13 +25,13 @@ es: unfeasible_title: Propuestas inviables unfeasible: Ver propuestas inviables phase: - accepting: Aceptando propuestas - reviewing: Revisando propuestas - selecting: Selección de propuestas - valuating: Evaluación de propuestas - balloting: Votación de propuestas - reviewing_ballots: Contando resultados - finished: Presupuesto terminado + accepting: Presentación de proyectos + reviewing: Revisión interna de proyectos + selecting: Fase de apoyos + valuating: Evaluación de proyectos + balloting: Votación final + reviewing_ballots: Votación finalizada + finished: Resultados index: title: Presupuestos participativos investments: From d2129bf9262423b73f0e7b88afe589083339fb4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Thu, 23 Mar 2017 13:06:09 +0100 Subject: [PATCH 41/74] fixes spec --- spec/features/admin/budgets_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/features/admin/budgets_spec.rb b/spec/features/admin/budgets_spec.rb index 3b34878af..c93aebea1 100644 --- a/spec/features/admin/budgets_spec.rb +++ b/spec/features/admin/budgets_spec.rb @@ -84,7 +84,7 @@ feature 'Admin budgets' do fill_in 'budget_name', with: 'M30 - Summer campaign' fill_in 'budget_description_accepting', with: 'Budgeting for summer 2017 maintenance and improvements of the road M-30' - select 'Accepting proposals', from: 'budget[phase]' + select 'Accepting projects', from: 'budget[phase]' click_button 'Create Participatory budget' From 4da66e3f5113e440eef94b8dedb6424e1b6462b3 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Fri, 24 Mar 2017 13:49:56 +0100 Subject: [PATCH 42/74] Show should display supports --- app/models/budget/investment.rb | 2 +- spec/features/budgets/investments_spec.rb | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/models/budget/investment.rb b/app/models/budget/investment.rb index 230e25d82..99e0eb25a 100644 --- a/app/models/budget/investment.rb +++ b/app/models/budget/investment.rb @@ -225,7 +225,7 @@ class Budget def should_show_aside? (budget.selecting? && !unfeasible?) || (budget.balloting? && feasible?) || - (budget.valuating? && feasible?) + (budget.valuating? && !unfeasible?) end def should_show_votes? diff --git a/spec/features/budgets/investments_spec.rb b/spec/features/budgets/investments_spec.rb index 1d812bd7e..5446e0a0a 100644 --- a/spec/features/budgets/investments_spec.rb +++ b/spec/features/budgets/investments_spec.rb @@ -405,7 +405,7 @@ feature 'Budget Investments' do budget.update(phase: "valuating") end - scenario "Sidebar in show should display supports text and supports" do + scenario "Sidebar in show should display support text and count" do investment = create(:budget_investment, :selected, budget: budget) create(:vote, votable: investment) @@ -417,8 +417,8 @@ feature 'Budget Investments' do end end - scenario "Index should display supports" do - investment = create(:budget_investment, :selected, budget: budget, heading: heading) + scenario "Index should display support count" do + investment = create(:budget_investment, budget: budget, heading: heading) create(:vote, votable: investment) visit budget_investments_path(budget, heading_id: heading.id) @@ -428,6 +428,18 @@ feature 'Budget Investments' do end end + scenario "Show should display support text and count" do + investment = create(:budget_investment, budget: budget, heading: heading) + create(:vote, votable: investment) + + visit budget_investment_path(budget, investment) + + within("#budget_investment_#{investment.id}") do + expect(page).to have_content "Supports" + expect(page).to have_content "1 support" + end + end + end context "Balloting Phase" do From 386f935cc6256c77ee89194eb7dc58ccd667c9af Mon Sep 17 00:00:00 2001 From: rgarcia Date: Fri, 24 Mar 2017 15:24:37 +0100 Subject: [PATCH 43/74] displays link to valuation section --- app/views/shared/_admin_login_items.html.erb | 3 ++- spec/features/valuation/budget_investments_spec.rb | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/views/shared/_admin_login_items.html.erb b/app/views/shared/_admin_login_items.html.erb index 013320f38..1d7c7f188 100644 --- a/app/views/shared/_admin_login_items.html.erb +++ b/app/views/shared/_admin_login_items.html.erb @@ -11,7 +11,8 @@ <% end %> - <% if feature?(:spending_proposals) && (current_user.administrator? || current_user.valuator?) %> + <% if (feature?(:spending_proposals) || feature?(:budgets)) && + (current_user.administrator? || current_user.valuator?) %>
  • <%= link_to t("layouts.header.valuation"), valuation_root_path %>
  • diff --git a/spec/features/valuation/budget_investments_spec.rb b/spec/features/valuation/budget_investments_spec.rb index bac7d1fe2..f6e930cc6 100644 --- a/spec/features/valuation/budget_investments_spec.rb +++ b/spec/features/valuation/budget_investments_spec.rb @@ -13,6 +13,12 @@ feature 'Valuation budget investments' do expect{ visit valuation_budget_budget_investments_path(create(:budget)) }.to raise_exception(FeatureFlags::FeatureDisabled) end + scenario 'Display link to valuation section' do + Setting['feature.budgets'] = true + visit root_path + expect(page).to have_link "Valuation", href: valuation_root_path + end + scenario 'Index shows budget investments assigned to current valuator' do investment1 = create(:budget_investment, budget: @budget) investment2 = create(:budget_investment, budget: @budget) From 8c19802dc6828f55e5a3cfb17ab8f320a6454c01 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Fri, 24 Mar 2017 15:24:57 +0100 Subject: [PATCH 44/74] updates dev seeds for valuators --- db/dev_seeds.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/dev_seeds.rb b/db/dev_seeds.rb index 7ad046c42..eb1651a0c 100644 --- a/db/dev_seeds.rb +++ b/db/dev_seeds.rb @@ -391,7 +391,7 @@ end puts "Creating Valuation Assignments" -(1..17).to_a.sample.times do +(1..50).to_a.sample.times do Budget::Investment.reorder("RANDOM()").first.valuators << valuator.valuator end From 7523c4f870234a5e60b56494bc68a250fad48818 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Fri, 24 Mar 2017 16:21:56 +0100 Subject: [PATCH 45/74] adds missing close div tag --- app/views/devise/confirmations/new.html.erb | 1 + app/views/devise/passwords/new.html.erb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb index fe2cf0dc5..51f6cf1eb 100644 --- a/app/views/devise/confirmations/new.html.erb +++ b/app/views/devise/confirmations/new.html.erb @@ -19,6 +19,7 @@ <%= f.submit(t("devise_views.confirmations.new.submit"), class: "button expanded") %> + <% end %> <%= render "devise/shared/links" %> diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb index 72dd70fb9..b06c9ff25 100644 --- a/app/views/devise/passwords/new.html.erb +++ b/app/views/devise/passwords/new.html.erb @@ -11,6 +11,7 @@ <%= f.submit t("devise_views.passwords.new.send_submit"), class: "button expanded" %> + <% end %> <%= render "devise/shared/links" %> From 865a9e78a4693e977e24bc3e39a155a302f01835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Fri, 24 Mar 2017 21:32:51 +0100 Subject: [PATCH 46/74] updates runtime dependencies --- Gemfile | 16 ++++----- Gemfile.lock | 98 ++++++++++++++++++++++++++++------------------------ 2 files changed, 61 insertions(+), 53 deletions(-) diff --git a/Gemfile b/Gemfile index 262a44ba4..06d66c0ba 100644 --- a/Gemfile +++ b/Gemfile @@ -3,18 +3,18 @@ source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.2.8' # Use PostgreSQL -gem 'pg', '~> 0.19.0' +gem 'pg', '~> 0.20.0' # Use SCSS for stylesheets gem 'sass-rails', '~> 5.0', '>= 5.0.4' # Use Uglifier as compressor for JavaScript assets -gem 'uglifier', '~> 3.1.6' +gem 'uglifier', '~> 3.1.9' # Use CoffeeScript for .coffee assets and views gem 'coffee-rails', '~> 4.2.1' # See https://github.com/rails/execjs#readme for more supported runtimes # gem 'therubyracer', platforms: :ruby # Use jquery as the JavaScript library -gem 'jquery-rails', '~> 4.2.2' +gem 'jquery-rails', '~> 4.3.1' gem 'jquery-ui-rails' # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks gem 'turbolinks' @@ -28,10 +28,10 @@ gem 'devise_security_extension' # gem 'bcrypt', '~> 3.1.7' gem 'omniauth' gem 'omniauth-twitter' -gem 'omniauth-facebook', '~> 3.0.0' +gem 'omniauth-facebook', '~> 4.0.0' gem 'omniauth-google-oauth2', '~> 0.4.0' -gem 'kaminari' +gem 'kaminari', '~> 1.0.1' gem 'ancestry', '~> 2.2.2' gem 'acts-as-taggable-on' gem 'responders', '~> 2.3.0' @@ -48,16 +48,16 @@ gem 'paranoia', '~> 2.2.1' gem 'rinku', '~> 2.0.2', require: 'rails_rinku' gem 'savon' gem 'dalli' -gem 'rollbar', '~> 2.14.0' +gem 'rollbar', '~> 2.14.1' gem 'delayed_job_active_record', '~> 4.1.0' gem 'daemons' gem 'devise-async' -gem 'newrelic_rpm', '~> 3.18.1.330' +gem 'newrelic_rpm', '~> 4.0.0.332' gem 'whenever', require: false gem 'pg_search' gem 'sitemap_generator', '~> 5.3.1' -gem 'ahoy_matey', '~> 1.5.3' +gem 'ahoy_matey', '~> 1.5.5' gem 'groupdate', '~> 3.2.0' # group temporary data gem 'tolk', '~> 2.0.0' # Web interface for translations diff --git a/Gemfile.lock b/Gemfile.lock index 738087adf..2690d8afa 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,12 +35,12 @@ GEM minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - acts-as-taggable-on (3.5.0) - activerecord (>= 3.2, < 5) + acts-as-taggable-on (4.0.0) + activerecord (>= 4.0) acts_as_votable (0.10.0) addressable (2.5.0) public_suffix (~> 2.0, >= 2.0.2) - ahoy_matey (1.5.4) + ahoy_matey (1.5.5) addressable browser (~> 2.0) geocoder @@ -110,8 +110,8 @@ GEM coffee-script (2.4.1) coffee-script-source execjs - coffee-script-source (1.10.0) - concurrent-ruby (1.0.4) + coffee-script-source (1.12.2) + concurrent-ruby (1.0.5) coveralls (0.8.19) json (>= 1.8, < 3) simplecov (~> 0.12.0) @@ -159,7 +159,7 @@ GEM railties (>= 3.0.0) faker (1.7.3) i18n (~> 0.5) - faraday (0.9.2) + faraday (0.11.0) multipart-post (>= 1.2, < 3) foundation-rails (6.2.4.0) railties (>= 3.1.0) @@ -181,7 +181,7 @@ GEM activesupport (>= 3) gyoku (1.3.1) builder (>= 2.1.2) - hashie (3.4.6) + hashie (3.5.5) highline (1.7.8) htmlentities (4.3.4) httpi (2.4.1) @@ -201,17 +201,26 @@ GEM railties (>= 3.1, < 6.0) invisible_captcha (0.9.2) rails (>= 3.2.0) - jquery-rails (4.2.2) + jquery-rails (4.3.1) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - jquery-ui-rails (5.0.5) + jquery-ui-rails (6.0.1) railties (>= 3.2.16) - json (1.8.6) - jwt (1.5.4) - kaminari (0.17.0) - actionpack (>= 3.0.0) - activesupport (>= 3.0.0) + json (2.0.3) + jwt (1.5.6) + kaminari (1.0.1) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.0.1) + kaminari-activerecord (= 1.0.1) + kaminari-core (= 1.0.1) + kaminari-actionview (1.0.1) + actionview + kaminari-core (= 1.0.1) + kaminari-activerecord (1.0.1) + activerecord + kaminari-core (= 1.0.1) + kaminari-core (1.0.1) kgio (2.11.0) knapsack (1.13.1) rake @@ -234,26 +243,26 @@ GEM mini_portile2 (2.1.0) minitest (5.10.1) multi_json (1.12.1) - multi_xml (0.5.5) + multi_xml (0.6.0) multipart-post (2.0.0) net-scp (1.2.1) net-ssh (>= 2.6.5) net-ssh (4.1.0) - newrelic_rpm (3.18.1.330) - nokogiri (1.7.0.1) + newrelic_rpm (4.0.0.332) + nokogiri (1.7.1) mini_portile2 (~> 2.1.0) nori (2.6.0) - oauth (0.5.0) - oauth2 (1.0.0) - faraday (>= 0.8, < 0.10) + oauth (0.5.1) + oauth2 (1.3.1) + faraday (>= 0.8, < 0.12) jwt (~> 1.0) multi_json (~> 1.3) multi_xml (~> 0.5) - rack (~> 1.2) - omniauth (1.3.1) - hashie (>= 1.2, < 4) - rack (>= 1.0, < 3) - omniauth-facebook (3.0.0) + rack (>= 1.2, < 3) + omniauth (1.6.1) + hashie (>= 3.4.6, < 3.6.0) + rack (>= 1.6.2, < 3) + omniauth-facebook (4.0.0) omniauth-oauth2 (~> 1.2) omniauth-google-oauth2 (0.4.1) jwt (~> 1.5.2) @@ -266,19 +275,19 @@ GEM omniauth-oauth2 (1.4.0) oauth2 (~> 1.0) omniauth (~> 1.2) - omniauth-twitter (1.2.1) - json (~> 1.3) + omniauth-twitter (1.4.0) omniauth-oauth (~> 1.1) + rack orm_adapter (0.5.0) paranoia (2.2.1) activerecord (>= 4.0, < 5.1) parser (2.4.0.0) ast (~> 2.2) - pg (0.19.0) - pg_search (1.0.6) - activerecord (>= 3.1) - activesupport (>= 3.1) - arel + pg (0.20.0) + pg_search (2.0.1) + activerecord (>= 4.2) + activesupport (>= 4.2) + arel (>= 6) poltergeist (1.13.0) capybara (~> 2.1) cliver (~> 0.3.1) @@ -327,7 +336,7 @@ GEM responders (2.3.0) railties (>= 4.2.0, < 5.1) rinku (2.0.2) - rollbar (2.14.0) + rollbar (2.14.1) multi_json rspec-core (3.5.4) rspec-support (~> 3.5.0) @@ -359,7 +368,7 @@ GEM safe_yaml (1.0.4) safely_block (0.2.0) errbase - sass (3.4.22) + sass (3.4.23) sass-rails (5.0.6) railties (>= 4.0.0, < 6) sass (~> 3.1) @@ -381,9 +390,8 @@ GEM simplecov-html (0.10.0) sitemap_generator (5.3.1) builder (~> 3.0) - social-share-button (0.3.1) + social-share-button (0.10.0) coffee-rails - sass-rails spring (1.7.2) spring-commands-rspec (1.0.4) spring (>= 0.9.1) @@ -408,7 +416,7 @@ GEM thor (0.19.4) thread (0.2.2) thread_safe (0.3.6) - tilt (2.0.5) + tilt (2.0.7) timecop (0.8.1) tins (1.13.2) tolk (2.0.0) @@ -423,7 +431,7 @@ GEM tilt (>= 1.4, < 3) tzinfo (1.2.2) thread_safe (~> 0.1) - uglifier (3.1.6) + uglifier (3.1.9) execjs (>= 0.3.0, < 3) unicode-display_width (1.1.3) unicorn (5.2.0) @@ -455,7 +463,7 @@ PLATFORMS DEPENDENCIES acts-as-taggable-on acts_as_votable - ahoy_matey (~> 1.5.3) + ahoy_matey (~> 1.5.5) ancestry (~> 2.2.2) browser bullet (~> 5.5.1) @@ -486,19 +494,19 @@ DEPENDENCIES i18n-tasks (~> 0.9.12) initialjs-rails (= 0.2.0.4) invisible_captcha (~> 0.9.2) - jquery-rails (~> 4.2.2) + jquery-rails (~> 4.3.1) jquery-ui-rails - kaminari + kaminari (~> 1.0.1) knapsack launchy letter_opener_web (~> 1.3.1) - newrelic_rpm (~> 3.18.1.330) + newrelic_rpm (~> 4.0.0.332) omniauth - omniauth-facebook (~> 3.0.0) + omniauth-facebook (~> 4.0.0) omniauth-google-oauth2 (~> 0.4.0) omniauth-twitter paranoia (~> 2.2.1) - pg (~> 0.19.0) + pg (~> 0.20.0) pg_search poltergeist (~> 1.13.0) quiet_assets @@ -506,7 +514,7 @@ DEPENDENCIES redcarpet (~> 3.4.0) responders (~> 2.3.0) rinku (~> 2.0.2) - rollbar (~> 2.14.0) + rollbar (~> 2.14.1) rspec-rails (~> 3.5) rubocop (~> 0.47.1) rvm1-capistrano3 From 18bce501ce42e3f07bfdd1c602f7b6658534a7fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Fri, 24 Mar 2017 21:40:30 +0100 Subject: [PATCH 47/74] updates development dependencies --- Gemfile | 6 +++--- Gemfile.lock | 21 ++++++++++----------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Gemfile b/Gemfile index 06d66c0ba..831b62813 100644 --- a/Gemfile +++ b/Gemfile @@ -72,14 +72,14 @@ group :development, :test do gem 'spring' gem 'spring-commands-rspec' gem 'rspec-rails', '~> 3.5' - gem 'capybara', '~> 2.12.1' + gem 'capybara', '~> 2.13.0' gem 'factory_girl_rails', '~> 4.8.0' gem 'fuubar' gem 'launchy' gem 'quiet_assets' gem 'letter_opener_web', '~> 1.3.1' gem 'i18n-tasks', '~> 0.9.12' - gem 'capistrano', '~> 3.7.2', require: false + gem 'capistrano', '~> 3.8.0', require: false gem 'capistrano-bundler', '~> 1.2', require: false gem "capistrano-rails", '~> 1.2.3', require: false gem 'rvm1-capistrano3', require: false @@ -92,7 +92,7 @@ end group :test do gem 'database_cleaner' - gem 'poltergeist', '~> 1.13.0' + gem 'poltergeist', '~> 1.14.0' gem 'coveralls', '~> 0.8.19', require: false gem 'email_spec' end diff --git a/Gemfile.lock b/Gemfile.lock index 2690d8afa..c9d097a15 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -72,23 +72,21 @@ GEM uniform_notifier (~> 1.10.0) byebug (9.0.6) cancancan (1.16.0) - capistrano (3.7.2) + capistrano (3.8.0) airbrussh (>= 1.0.0) - capistrano-harrow i18n rake (>= 10.0.0) sshkit (>= 1.9.0) capistrano-bundler (1.2.0) capistrano (~> 3.1) sshkit (~> 1.2) - capistrano-harrow (0.5.3) capistrano-rails (1.2.3) capistrano (~> 3.1) capistrano-bundler (~> 1.1) capistrano3-delayed-job (1.7.3) capistrano (~> 3.0, >= 3.0.0) daemons (~> 1.2.4) - capybara (2.12.1) + capybara (2.13.0) addressable mime-types (>= 1.16) nokogiri (>= 1.3.3) @@ -222,7 +220,7 @@ GEM kaminari-core (= 1.0.1) kaminari-core (1.0.1) kgio (2.11.0) - knapsack (1.13.1) + knapsack (1.13.2) rake timecop (>= 0.1.0) launchy (2.4.3) @@ -288,7 +286,7 @@ GEM activerecord (>= 4.2) activesupport (>= 4.2) arel (>= 6) - poltergeist (1.13.0) + poltergeist (1.14.0) capybara (~> 2.1) cliver (~> 0.3.1) websocket-driver (>= 0.2.0) @@ -392,7 +390,8 @@ GEM builder (~> 3.0) social-share-button (0.10.0) coffee-rails - spring (1.7.2) + spring (2.0.1) + activesupport (>= 4.2) spring-commands-rspec (1.0.4) spring (>= 0.9.1) sprockets (3.7.1) @@ -469,11 +468,11 @@ DEPENDENCIES bullet (~> 5.5.1) byebug cancancan (~> 1.16.0) - capistrano (~> 3.7.2) + capistrano (~> 3.8.0) capistrano-bundler (~> 1.2) capistrano-rails (~> 1.2.3) capistrano3-delayed-job (~> 1.7.3) - capybara (~> 2.12.1) + capybara (~> 2.13.0) ckeditor (~> 4.2.2) coffee-rails (~> 4.2.1) coveralls (~> 0.8.19) @@ -508,7 +507,7 @@ DEPENDENCIES paranoia (~> 2.2.1) pg (~> 0.20.0) pg_search - poltergeist (~> 1.13.0) + poltergeist (~> 1.14.0) quiet_assets rails (= 4.2.8) redcarpet (~> 3.4.0) @@ -528,7 +527,7 @@ DEPENDENCIES tolk (~> 2.0.0) turbolinks turnout (~> 2.4.0) - uglifier (~> 3.1.6) + uglifier (~> 3.1.9) unicorn (~> 5.2.0) web-console (= 3.3.0) whenever From 3f15565f9e376ac5d6c670f1371f26d0ea95d6f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Fri, 24 Mar 2017 22:02:34 +0100 Subject: [PATCH 48/74] uses new jquery-ui widgets path in require --- app/assets/javascripts/application.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index fba539eeb..78c5c7444 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -12,8 +12,8 @@ // //= require jquery //= require jquery_ujs -//= require jquery-ui/datepicker -//= require jquery-ui/datepicker-es +//= require jquery-ui/widgets/datepicker +//= require jquery-ui/i18n/datepicker-es //= require foundation //= require turbolinks //= require ckeditor/loader From 4191d66ed4dd0c793066da506267b39445a525e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Sat, 25 Mar 2017 12:11:05 +0100 Subject: [PATCH 49/74] fixes datepicker in advanced search --- app/views/shared/_advanced_search.html.erb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/views/shared/_advanced_search.html.erb b/app/views/shared/_advanced_search.html.erb index 56157c4a7..558adc806 100644 --- a/app/views/shared/_advanced_search.html.erb +++ b/app/views/shared/_advanced_search.html.erb @@ -36,7 +36,6 @@ <%= text_field_tag 'advanced_search[date_min]', params[:advanced_search].try(:[], :date_min), - type: "date", class: 'js-calendar' %>
    @@ -45,7 +44,6 @@ <%= text_field_tag 'advanced_search[date_max]', params[:advanced_search].try(:[], :date_max), - type: "date", class: 'js-calendar' %>
    From 652aff4e19e79a751c491d7b0841d4da0403cd4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Mon, 27 Mar 2017 12:18:45 +0200 Subject: [PATCH 50/74] adds validation for custom dates in advanced search avoids error 500 on invalid dates --- .../concerns/commentable_actions.rb | 6 ++--- spec/features/debates_spec.rb | 22 +++++++++++++++++++ spec/features/proposals_spec.rb | 22 +++++++++++++++++++ 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/app/controllers/concerns/commentable_actions.rb b/app/controllers/concerns/commentable_actions.rb index ef5e60dcb..ee69ac809 100644 --- a/app/controllers/concerns/commentable_actions.rb +++ b/app/controllers/concerns/commentable_actions.rb @@ -129,16 +129,16 @@ module CommentableActions when '4' 1.year.ago else - Date.parse(params[:advanced_search][:date_min]) rescue nil + Date.parse(params[:advanced_search][:date_min]) rescue 100.years.ago end end def search_finish_date - params[:advanced_search][:date_max].try(:to_date) || Date.today + (params[:advanced_search][:date_max].to_date rescue Date.today) || Date.today end def search_date_range - search_start_date.beginning_of_day..search_finish_date.end_of_day + [100.years.ago, search_start_date].max.beginning_of_day..[search_finish_date, Date.today].min.end_of_day end def set_search_order diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index f16f416bf..bc01c94e2 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -640,6 +640,28 @@ feature 'Debates' do end end + scenario "Search by custom invalid date range", :js do + debate1 = create(:debate, created_at: 2.years.ago) + debate2 = create(:debate, created_at: 3.days.ago) + debate3 = create(:debate, created_at: 9.days.ago) + + visit debates_path + + click_link "Advanced search" + select "Customized", from: "js-advanced-search-date-min" + fill_in "advanced_search_date_min", with: "9" + fill_in "advanced_search_date_max", with: "444444444" + click_button "Filter" + + within("#debates") do + expect(page).to have_css('.debate', count: 3) + + expect(page).to have_content(debate1.title) + expect(page).to have_content(debate2.title) + expect(page).to have_content(debate3.title) + end + end + scenario "Search by multiple filters", :js do ana = create :user, official_level: 1 john = create :user, official_level: 1 diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb index 18864dc9b..dbc5956cd 100644 --- a/spec/features/proposals_spec.rb +++ b/spec/features/proposals_spec.rb @@ -980,6 +980,28 @@ feature 'Proposals' do end end + scenario "Search by custom invalid date range", :js do + proposal1 = create(:proposal, created_at: 2.days.ago) + proposal2 = create(:proposal, created_at: 3.days.ago) + proposal3 = create(:proposal, created_at: 9.days.ago) + + visit proposals_path + + click_link "Advanced search" + select "Customized", from: "js-advanced-search-date-min" + fill_in "advanced_search_date_min", with: 4000.years.ago + fill_in "advanced_search_date_max", with: "wrong date" + click_button "Filter" + + expect(page).to have_content("There are 3 citizen proposals") + + within("#proposals") do + expect(page).to have_content(proposal1.title) + expect(page).to have_content(proposal2.title) + expect(page).to have_content(proposal3.title) + end + end + scenario "Search by multiple filters", :js do ana = create :user, official_level: 1 john = create :user, official_level: 1 From 3c2ab9fb056720adf056abb824db154d3130996b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Mon, 27 Mar 2017 13:14:26 +0200 Subject: [PATCH 51/74] adds validation for price when investment is feasible --- app/models/budget/investment.rb | 5 +++++ spec/models/budget/investment_spec.rb | 25 ++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/app/models/budget/investment.rb b/app/models/budget/investment.rb index 99e0eb25a..4bfd038c3 100644 --- a/app/models/budget/investment.rb +++ b/app/models/budget/investment.rb @@ -25,6 +25,7 @@ class Budget validates :description, presence: true validates :heading_id, presence: true validates_presence_of :unfeasibility_explanation, if: :unfeasibility_explanation_required? + validates_presence_of :price, if: :price_required? validates :title, length: { in: 4..Budget::Investment.title_max_length } validates :description, length: { maximum: Budget::Investment.description_max_length } @@ -136,6 +137,10 @@ class Budget unfeasible? && valuation_finished? end + def price_required? + feasible? && valuation_finished? + end + def unfeasible_email_pending? unfeasible_email_sent_at.blank? && unfeasible? && valuation_finished? end diff --git a/spec/models/budget/investment_spec.rb b/spec/models/budget/investment_spec.rb index 3ab97c574..fa51f3cab 100644 --- a/spec/models/budget/investment_spec.rb +++ b/spec/models/budget/investment_spec.rb @@ -54,7 +54,7 @@ describe Budget::Investment do expect(investment.group_id).to eq group_2.id end - describe "#unfeasibility_explanation" do + describe "#unfeasibility_explanation blank" do it "should be valid if valuation not finished" do investment.unfeasibility_explanation = "" investment.valuation_finished = false @@ -76,6 +76,29 @@ describe Budget::Investment do end end + describe "#price blank" do + it "should be valid if valuation not finished" do + investment.price = "" + investment.valuation_finished = false + expect(investment).to be_valid + end + + it "should be valid if valuation finished and unfeasible" do + investment.price = "" + investment.unfeasibility_explanation = "reason" + investment.feasibility = "unfeasible" + investment.valuation_finished = true + expect(investment).to be_valid + end + + it "should not be valid if valuation finished and feasible" do + investment.price = "" + investment.feasibility = "feasible" + investment.valuation_finished = true + expect(investment).to_not be_valid + end + end + describe "#code" do let(:investment) { create(:budget_investment) } From b4e81d60fc092c8698794d621373e2cc6c175769 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Mon, 27 Mar 2017 19:01:39 +0200 Subject: [PATCH 52/74] fixes html validation on whatsapp share --- app/views/budgets/investments/_investment_show.html.erb | 2 +- app/views/debates/show.html.erb | 2 +- app/views/proposals/show.html.erb | 2 +- app/views/spending_proposals/show.html.erb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/budgets/investments/_investment_show.html.erb b/app/views/budgets/investments/_investment_show.html.erb index ebac39186..8b351571f 100644 --- a/app/views/budgets/investments/_investment_show.html.erb +++ b/app/views/budgets/investments/_investment_show.html.erb @@ -103,7 +103,7 @@
    <%= Budget.human_attribute_name(:name) %><%= Budget.human_attribute_name(:phase) %><%= Budget.human_attribute_name(:name) %><%= Budget.human_attribute_name(:phase) %>