diff --git a/app/views/verification/sms/new.html.erb b/app/views/verification/sms/new.html.erb
index 2e304ddda..e3f9fa891 100644
--- a/app/views/verification/sms/new.html.erb
+++ b/app/views/verification/sms/new.html.erb
@@ -1,4 +1,5 @@
+ <%track_event(category: "verification", action: "success_census" )%>
diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml
index 4ecf9cbda..1d028df46 100755
--- a/config/locales/admin.en.yml
+++ b/config/locales/admin.en.yml
@@ -198,6 +198,7 @@ en:
user_level_two: Level two users
users: Total users
verified_users: Verified users
+ verified_users_who_didnt_vote_proposals: Verified users who didn't votes proposals
visits: Visits
votes: Total votes
visits_title: Visits
diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml
index bc882fab2..766cb5b51 100644
--- a/config/locales/admin.es.yml
+++ b/config/locales/admin.es.yml
@@ -198,6 +198,7 @@ es:
user_level_two: Usuarios de nivel dos
users: Usuarios
verified_users: Usuarios verificados
+ verified_users_who_didnt_vote_proposals: Usuarios verificados que no han votado propuestas
visits: Visitas
votes: Votos
visits_title: Visitas
diff --git a/db/dev_seeds.rb b/db/dev_seeds.rb
index 14af135da..74d4a4381 100644
--- a/db/dev_seeds.rb
+++ b/db/dev_seeds.rb
@@ -23,7 +23,7 @@ Setting.create(key: 'feature.spending_proposals', value: "true")
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: 'per_page_code', value: "")
Setting.create(key: 'comments_body_max_length', value: '1000')
puts "Creating Geozones"
diff --git a/spec/features/tracks_spec.rb b/spec/features/tracks_spec.rb
new file mode 100644
index 000000000..059d2f679
--- /dev/null
+++ b/spec/features/tracks_spec.rb
@@ -0,0 +1,134 @@
+require 'rails_helper'
+
+feature 'Tracking' do
+
+ context 'Custom variable' do
+
+ scenario 'Usertype anonymous' do
+ visit proposals_path
+
+ expect(page.html).to include "anonymous"
+ end
+
+ scenario 'Usertype level_1_user' do
+ create(:geozone)
+ user = create(:user)
+ login_as(user)
+
+ visit proposals_path
+
+ expect(page.html).to include "level_1_user"
+ end
+
+ scenario 'Usertype level_2_user' do
+ create(:geozone)
+ user = create(:user)
+ login_as(user)
+
+ visit account_path
+ click_link 'Verify my account'
+
+ verify_residence
+
+ fill_in 'sms_phone', with: "611111111"
+ click_button 'Send'
+
+ user = user.reload
+ fill_in 'sms_confirmation_code', with: user.sms_confirmation_code
+ click_button 'Send'
+
+ expect(page.html).to include "level_2_user"
+ end
+ end
+
+ context 'Tracking events' do
+ scenario 'Verification: start census' do
+ user = create(:user)
+ login_as(user)
+
+ visit account_path
+ click_link 'Verify my account'
+
+ expect(page.html).to include "data-track-event-category=verification"
+ expect(page.html).to include "data-track-event-action=start_census"
+ end
+
+ scenario 'Verification: success census' do
+ create(:geozone)
+ user = create(:user)
+ login_as(user)
+
+ visit account_path
+ click_link 'Verify my account'
+
+ verify_residence
+
+ fill_in 'sms_phone', with: "611111111"
+ click_button 'Send'
+
+ expect(page.html).to include "data-track-event-category=verification"
+ expect(page.html).to include "data-track-event-action=start_sms"
+ end
+
+ scenario 'Verification: start sms' do
+ create(:geozone)
+ user = create(:user)
+ login_as(user)
+
+ visit account_path
+ click_link 'Verify my account'
+
+ verify_residence
+
+ fill_in 'sms_phone', with: "611111111"
+ click_button 'Send'
+
+ expect(page.html).to include "data-track-event-category=verification"
+ expect(page.html).to include "data-track-event-action=start_sms"
+ end
+
+ scenario 'Verification: success sms' do
+ create(:geozone)
+ user = create(:user)
+ login_as(user)
+
+ visit account_path
+ click_link 'Verify my account'
+
+ verify_residence
+
+ fill_in 'sms_phone', with: "611111111"
+ click_button 'Send'
+
+ user = user.reload
+ fill_in 'sms_confirmation_code', with: user.sms_confirmation_code
+ click_button 'Send'
+
+ expect(page.html).to include "data-track-event-category=verification"
+ expect(page.html).to include "data-track-event-action=success_sms"
+ end
+
+ scenario 'Verification: letter' do
+ create(:geozone)
+ user = create(:user)
+ login_as(user)
+
+ visit account_path
+ click_link 'Verify my account'
+
+ verify_residence
+
+ fill_in 'sms_phone', with: "611111111"
+ click_button 'Send'
+
+ user = user.reload
+ fill_in 'sms_confirmation_code', with: user.sms_confirmation_code
+ click_button 'Send'
+
+ click_link "Send me a letter with the code"
+
+ expect(page.html).to include "data-track-event-category=verification"
+ expect(page.html).to include "data-track-event-action=start_letter"
+ end
+ end
+end
From 68f9a76cea41d201f739ce23d6b4ba7ae395ce88 Mon Sep 17 00:00:00 2001
From: MaiteHdezRivas
Date: Sun, 20 Mar 2016 13:55:04 +0100
Subject: [PATCH 0002/1685] Mark debates as featured
---
app/controllers/debates_controller.rb | 10 +++++
app/helpers/debates_helper.rb | 6 +++
app/models/abilities/administrator.rb | 4 ++
app/models/debate.rb | 7 +++-
app/views/admin/_menu.html.erb | 2 +-
app/views/debates/_actions.html.erb | 11 ++++++
app/views/debates/_featured_debates.html.erb | 13 +++++++
.../debates/_featured_debates_static.html.erb | 17 --------
app/views/debates/index.html.erb | 4 +-
config/locales/admin.en.yml | 3 ++
config/locales/admin.es.yml | 3 ++
config/routes.rb | 2 +
...160315084335_add_featured_at_to_debates.rb | 5 +++
db/schema.rb | 3 +-
spec/features/debates_spec.rb | 39 +++++++++++++++++++
15 files changed, 107 insertions(+), 22 deletions(-)
create mode 100644 app/helpers/debates_helper.rb
create mode 100644 app/views/debates/_featured_debates.html.erb
delete mode 100644 app/views/debates/_featured_debates_static.html.erb
create mode 100644 db/migrate/20160315084335_add_featured_at_to_debates.rb
diff --git a/app/controllers/debates_controller.rb b/app/controllers/debates_controller.rb
index b5a0ae25a..4a22d2e3e 100644
--- a/app/controllers/debates_controller.rb
+++ b/app/controllers/debates_controller.rb
@@ -28,6 +28,16 @@ class DebatesController < ApplicationController
set_debate_votes(@debate)
end
+ def remove_feature
+ @debate.update_attribute(:featured_at, nil)
+ redirect_to request.query_parameters.merge(action: :index)
+ end
+
+ def feature
+ @debate.update_attribute(:featured_at, Time.now)
+ redirect_to request.query_parameters.merge(action: :index)
+ end
+
private
def debate_params
diff --git a/app/helpers/debates_helper.rb b/app/helpers/debates_helper.rb
new file mode 100644
index 000000000..d12db7f78
--- /dev/null
+++ b/app/helpers/debates_helper.rb
@@ -0,0 +1,6 @@
+module DebatesHelper
+
+ def has_featured
+ Debate.all.featured.count > 0
+ end
+end
\ No newline at end of file
diff --git a/app/models/abilities/administrator.rb b/app/models/abilities/administrator.rb
index 78cb60806..fa15bacb3 100644
--- a/app/models/abilities/administrator.rb
+++ b/app/models/abilities/administrator.rb
@@ -30,6 +30,10 @@ module Abilities
can :confirm_hide, User
cannot :confirm_hide, User, hidden_at: nil
+ can :feature, Debate
+
+ can :remove_feature, Debate
+
can :comment_as_administrator, [Debate, Comment, Proposal]
can [:search, :create, :index, :destroy], ::Moderator
diff --git a/app/models/debate.rb b/app/models/debate.rb
index ceec9946b..249ae0c44 100644
--- a/app/models/debate.rb
+++ b/app/models/debate.rb
@@ -36,7 +36,8 @@ class Debate < ActiveRecord::Base
scope :sort_by_random, -> { reorder("RANDOM()") }
scope :sort_by_relevance, -> { all }
scope :sort_by_flags, -> { order(flags_count: :desc, updated_at: :desc) }
- scope :last_week, -> { where("created_at >= ?", 7.days.ago)}
+ scope :last_week, -> { where("created_at >= ?", 7.days.ago)}
+ scope :featured, -> { where("featured_at is not null")}
# Ahoy setup
visitable # Ahoy will automatically assign visit_id on create
@@ -132,4 +133,8 @@ class Debate < ActiveRecord::Base
self.tags.each{ |t| t.increment_custom_counter_for('Debate') }
end
+ def featured?
+ ! self.featured_at.nil?
+ end
+
end
diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb
index f435c5511..313c34042 100644
--- a/app/views/admin/_menu.html.erb
+++ b/app/views/admin/_menu.html.erb
@@ -25,7 +25,7 @@
<%= t("admin.menu.hidden_debates") %>
<% end %>
- <% end %>
+ <% end %>
>
<%= link_to admin_comments_path do %>
diff --git a/app/views/debates/_actions.html.erb b/app/views/debates/_actions.html.erb
index db9821ad0..b88d4830c 100644
--- a/app/views/debates/_actions.html.erb
+++ b/app/views/debates/_actions.html.erb
@@ -8,3 +8,14 @@
<%= link_to t("admin.actions.hide_author").capitalize, hide_moderation_user_path(debate.author_id),
method: :put, data: { confirm: t('admin.actions.confirm') } %>
<% end %>
+
+<% if can? :feature, debate %>
+ |
+ <% if debate.featured? %>
+ <%= link_to t("admin.actions.remove_feature").capitalize, remove_feature_debate_path(debate),
+ method: :put, data: { confirm: t('admin.actions.confirm') } %>
+ <% else %>
+ <%= link_to t("admin.actions.feature").capitalize, feature_debate_path(debate),
+ method: :put, data: { confirm: t('admin.actions.confirm') } %>
+ <% end %>
+<% end %>
diff --git a/app/views/debates/_featured_debates.html.erb b/app/views/debates/_featured_debates.html.erb
new file mode 100644
index 000000000..8b0450e16
--- /dev/null
+++ b/app/views/debates/_featured_debates.html.erb
@@ -0,0 +1,13 @@
+
+
+
+
<%= t("debates.index.featured_debates") %>
+
+
+ <% @debates.featured.each do |debate| %>
+
+
<%= link_to debate.title, debate %>
+ <%= link_to debate.author.name, user_path(debate.author)%>
+
+ <% end %>
+
diff --git a/app/views/debates/_featured_debates_static.html.erb b/app/views/debates/_featured_debates_static.html.erb
deleted file mode 100644
index 8f7d0b68d..000000000
--- a/app/views/debates/_featured_debates_static.html.erb
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
<%= t("debates.index.featured_debates") %>
-
-
-
-
<%= link_to "#Túpreguntas: Manuela Carmena, Alcaldesa de Madrid.", "https://decide.madrid.es/debates/4320" %>
- <%= link_to "Manuela Carmena ", "https://decide.madrid.es/users/21452"%>
-
-
-
-
<%= link_to "¿Y si pudieras entrevistar a Manuela Carmena o a los otros concejales?", "https://decide.madrid.es/debates/4299" %>
- <%= link_to "ParticipaciónYTransparenciaAytoMadrid", "https://decide.madrid.es/users/52055"%>
-
-
-
diff --git a/app/views/debates/index.html.erb b/app/views/debates/index.html.erb
index 6488b5844..7ee9d12d4 100644
--- a/app/views/debates/index.html.erb
+++ b/app/views/debates/index.html.erb
@@ -25,8 +25,8 @@
<% end %>
- <% unless @tag_filter || @search_terms %>
- <%= render "featured_debates_static" %>
+ <% unless @tag_filter || @search_terms || !has_featured %>
+ <%= render "featured_debates", debate: @debates.featured %>
<% end %>
<%= render "shared/advanced_search", search_path: debates_path(page: 1) %>
diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml
index 4ecf9cbda..4c09952ef 100755
--- a/config/locales/admin.en.yml
+++ b/config/locales/admin.en.yml
@@ -7,6 +7,8 @@ en:
hide: Hide
hide_author: Hide author
restore: Restore
+ feature: Feature
+ remove_feature: Remove feature
activity:
show:
action: Action
@@ -50,6 +52,7 @@ en:
debate_topics: Debate topics
hidden_comments: Hidden comments
hidden_debates: Hidden debates
+ featured_debates: Featured debates
hidden_proposals: Hidden proposals
hidden_users: Hidden users
incomplete_verifications: Incomplete verifications
diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml
index bc882fab2..922191d49 100644
--- a/config/locales/admin.es.yml
+++ b/config/locales/admin.es.yml
@@ -7,6 +7,8 @@ es:
hide: Ocultar
hide_author: Bloquear al autor
restore: Volver a mostrar
+ feature: Destacar
+ remove_feature: Quitar destacado
activity:
show:
action: Acción
@@ -50,6 +52,7 @@ es:
debate_topics: Temas de debate
hidden_comments: Comentarios ocultos
hidden_debates: Debates ocultos
+ featured_debates: Debates destacados
hidden_proposals: Propuestas ocultas
hidden_users: Usuarios bloqueados
incomplete_verifications: Verificaciones incompletas
diff --git a/config/routes.rb b/config/routes.rb
index 680f657ab..2406e40fb 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -36,6 +36,8 @@ Rails.application.routes.draw do
post :vote
put :flag
put :unflag
+ put :remove_feature
+ put :feature
end
collection do
get :map
diff --git a/db/migrate/20160315084335_add_featured_at_to_debates.rb b/db/migrate/20160315084335_add_featured_at_to_debates.rb
new file mode 100644
index 000000000..81093aed3
--- /dev/null
+++ b/db/migrate/20160315084335_add_featured_at_to_debates.rb
@@ -0,0 +1,5 @@
+class AddFeaturedAtToDebates < ActiveRecord::Migration
+ def change
+ add_column :debates, :featured_at, :datetime
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 8d3a3caa9..79034e405 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20160308184050) do
+ActiveRecord::Schema.define(version: 20160315084335) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -120,6 +120,7 @@ ActiveRecord::Schema.define(version: 20160308184050) do
t.integer "confidence_score", default: 0
t.integer "geozone_id"
t.tsvector "tsv"
+ t.datetime "featured_at"
end
add_index "debates", ["author_id", "hidden_at"], name: "index_debates_on_author_id_and_hidden_at", using: :btree
diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb
index d9ab8c8eb..b7cc3ea3a 100644
--- a/spec/features/debates_spec.rb
+++ b/spec/features/debates_spec.rb
@@ -1008,4 +1008,43 @@ feature 'Debates' do
end
end
end
+
+ scenario 'Mark debate as featured' do
+ admin = create(:administrator)
+ login_as(admin.user)
+
+ debate1 = create(:debate)
+ debate2 = create(:debate, featured_at: Time.now)
+
+ visit debate_path(debate1)
+ expect(page).to have_content("Feature")
+
+ visit debate_path(debate2)
+ expect(page).to have_content("Remove feature")
+
+ end
+
+
+ scenario 'Show featured debates' do
+ admin = create(:administrator)
+ login_as(admin.user)
+
+ debate1 = create(:debate, featured_at: Time.now)
+ debate2 = create(:debate)
+
+ visit debates_path
+ expect(page).to have_content("Featured")
+ end
+
+
+ scenario 'Dont show featured debates' do
+ admin = create(:administrator)
+ login_as(admin.user)
+
+ debate1 = create(:debate)
+ debate2 = create(:debate)
+
+ visit debates_path
+ expect(page).to_not have_content("Featured")
+ end
end
From 968f08a18b4dba60eba28ecd978fc86179e88da2 Mon Sep 17 00:00:00 2001
From: Bertocq
Date: Mon, 4 Apr 2016 22:10:56 +0200
Subject: [PATCH 0003/1685] Improve README with info to use and verify the
default admin user
---
README.md | 14 ++++++++++++++
README_ES.md | 14 ++++++++++++++
2 files changed, 28 insertions(+)
diff --git a/README.md b/README.md
index 251a0f8e3..4d28ffcd8 100644
--- a/README.md
+++ b/README.md
@@ -56,6 +56,20 @@ Run the tests with:
bin/rspec
```
+You can use the default admin user from the seeds file:
+
+ **user:** admin@madrid.es
+ **pass:** 12345678
+
+But for some actions like voting, you will need to verify him, opening a console with `rails console` and then:
+```
+a = User.first
+a.verified_at = Date.today
+a.level_two_verified_at = Date.today
+a.residence_verified_at = Date.today
+a.save
+```
+
## Licence
Code published under AFFERO GPL v3 (see [LICENSE-AGPLv3.txt](LICENSE-AGPLv3.txt))
diff --git a/README_ES.md b/README_ES.md
index c3fd3cdff..c6e1867ec 100644
--- a/README_ES.md
+++ b/README_ES.md
@@ -55,6 +55,20 @@ Para ejecutar los tests:
bin/rspec
```
+Puedes usar el usuario administrador por defecto del fichero seeds:
+
+ **user:** admin@madrid.es
+ **pass:** 12345678
+
+Pero para ciertas acciones, como apoyar, necesitarás verificarle, abre una consola con `rails console` y escribe:
+```
+a = User.first
+a.verified_at = Date.today
+a.level_two_verified_at = Date.today
+a.residence_verified_at = Date.today
+a.save
+```
+
### OAuth
Para probar los servicios de autenticación mediante proveedores externos OAuth — en este momento Twitter, Facebook y Google —, necesitas crear una "aplicación" en cada una de las plataformas soportadas y configurar la *key* y el *secret* proporcionados en tu *secrets.yml*
From 37b7d75675a997b58b4f4cd6ca3a41b6c5a0a441 Mon Sep 17 00:00:00 2001
From: Bertocq
Date: Mon, 4 Apr 2016 22:12:01 +0200
Subject: [PATCH 0004/1685] Add OAuth paragraph, translated from spanish
version
---
README.md | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/README.md b/README.md
index 4d28ffcd8..4732e530c 100644
--- a/README.md
+++ b/README.md
@@ -70,6 +70,12 @@ a.residence_verified_at = Date.today
a.save
```
+### OAuth
+
+To test authentication services with external OAuth suppliers - right now Twitter, Facebook and Google - you'll need to create an "application" in each of the supported platforms and set the *key* and *secret* provided in your *secrets.yml*
+
+In the case of Google, verify that the APIs *Contacts API* and *Google+ API* are enabled for the application.
+
## Licence
Code published under AFFERO GPL v3 (see [LICENSE-AGPLv3.txt](LICENSE-AGPLv3.txt))
From 7bcb6695fa41a8b89c7ffe43341631c3f8049630 Mon Sep 17 00:00:00 2001
From: Bertocq
Date: Tue, 5 Apr 2016 13:58:29 +0200
Subject: [PATCH 0005/1685] Simplify the user verification code for console
---
README.md | 6 +-----
README_ES.md | 6 +-----
2 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/README.md b/README.md
index 4732e530c..a56c5bab0 100644
--- a/README.md
+++ b/README.md
@@ -63,11 +63,7 @@ You can use the default admin user from the seeds file:
But for some actions like voting, you will need to verify him, opening a console with `rails console` and then:
```
-a = User.first
-a.verified_at = Date.today
-a.level_two_verified_at = Date.today
-a.residence_verified_at = Date.today
-a.save
+User.first.update_attributes(verified_at: Date.today, residence_verified_at: Date.today, level_two_verified_at: Date.today)
```
### OAuth
diff --git a/README_ES.md b/README_ES.md
index c6e1867ec..fd5b79324 100644
--- a/README_ES.md
+++ b/README_ES.md
@@ -62,11 +62,7 @@ Puedes usar el usuario administrador por defecto del fichero seeds:
Pero para ciertas acciones, como apoyar, necesitarás verificarle, abre una consola con `rails console` y escribe:
```
-a = User.first
-a.verified_at = Date.today
-a.level_two_verified_at = Date.today
-a.residence_verified_at = Date.today
-a.save
+User.first.update_attributes(verified_at: Date.today, residence_verified_at: Date.today, level_two_verified_at: Date.today)
```
### OAuth
From e9bc6ff75f1eba7808953f20e4dfadc655aace38 Mon Sep 17 00:00:00 2001
From: Alberto Garcia Cabeza
Date: Tue, 5 Apr 2016 14:14:04 +0200
Subject: [PATCH 0006/1685] Improves layout for featured debates
---
app/views/admin/_menu.html.erb | 2 +-
app/views/debates/_featured_debates.html.erb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb
index 313c34042..f435c5511 100644
--- a/app/views/admin/_menu.html.erb
+++ b/app/views/admin/_menu.html.erb
@@ -25,7 +25,7 @@
<%= t("admin.menu.hidden_debates") %>
<% end %>
- <% end %>
+ <% end %>
>
<%= link_to admin_comments_path do %>
diff --git a/app/views/debates/_featured_debates.html.erb b/app/views/debates/_featured_debates.html.erb
index 8b0450e16..e678e2da8 100644
--- a/app/views/debates/_featured_debates.html.erb
+++ b/app/views/debates/_featured_debates.html.erb
@@ -5,7 +5,7 @@
<% @debates.featured.each do |debate| %>
-
+
<%= link_to debate.title, debate %>
<%= link_to debate.author.name, user_path(debate.author)%>
From 48c3cc580c2e7ca04820502e16cb5be7762de3c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Mon, 4 Apr 2016 20:05:01 +0200
Subject: [PATCH 0007/1685] adds namespaced helper for spending_proposal route
---
app/helpers/spending_proposals_helper.rb | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/app/helpers/spending_proposals_helper.rb b/app/helpers/spending_proposals_helper.rb
index 43ef7311a..ba68ad42a 100644
--- a/app/helpers/spending_proposals_helper.rb
+++ b/app/helpers/spending_proposals_helper.rb
@@ -3,4 +3,14 @@ module SpendingProposalsHelper
def spending_proposal_tags_select_options
ActsAsTaggableOn::Tag.spending_proposal_tags.pluck(:name)
end
+
+ def namespaced_spending_proposal_path(spending_proposal, options={})
+ @namespace_spending_proposal_path ||= namespace
+ case @namespace_spending_proposal_path
+ when "management"
+ management_spending_proposal_path(spending_proposal, options)
+ else
+ spending_proposal_path(spending_proposal, options)
+ end
+ end
end
\ No newline at end of file
From 3c37575f8845692acf3748899661ac6813b66f8f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Mon, 4 Apr 2016 20:05:32 +0200
Subject: [PATCH 0008/1685] adds management spending proposals index to routes
---
config/routes.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/routes.rb b/config/routes.rb
index 0d704be04..e27d035f2 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -252,7 +252,7 @@ Rails.application.routes.draw do
end
end
- resources :spending_proposals, only: [:new, :create, :show]
+ resources :spending_proposals, only: [:index, :new, :create, :show]
end
if Rails.env.development?
From b4c6e2f1606745932e954ee9e6859d79a769fac0 Mon Sep 17 00:00:00 2001
From: Alberto Garcia Cabeza
Date: Wed, 6 Apr 2016 11:09:24 +0200
Subject: [PATCH 0009/1685] Removes unused keys
---
config/locales/admin.en.yml | 1 -
config/locales/admin.es.yml | 1 -
2 files changed, 2 deletions(-)
diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml
index 16d0a72a3..024c0140d 100755
--- a/config/locales/admin.en.yml
+++ b/config/locales/admin.en.yml
@@ -52,7 +52,6 @@ en:
debate_topics: Debate topics
hidden_comments: Hidden comments
hidden_debates: Hidden debates
- featured_debates: Featured debates
hidden_proposals: Hidden proposals
hidden_users: Hidden users
incomplete_verifications: Incomplete verifications
diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml
index ca1255560..0493cedeb 100644
--- a/config/locales/admin.es.yml
+++ b/config/locales/admin.es.yml
@@ -52,7 +52,6 @@ es:
debate_topics: Temas de debate
hidden_comments: Comentarios ocultos
hidden_debates: Debates ocultos
- featured_debates: Debates destacados
hidden_proposals: Propuestas ocultas
hidden_users: Usuarios bloqueados
incomplete_verifications: Verificaciones incompletas
From cb052317941e5236cad5db5109b1f4b975442391 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Wed, 6 Apr 2016 12:05:43 +0200
Subject: [PATCH 0010/1685] adds index/show/voting to management for sps
---
.../spending_proposals_controller.rb | 26 +++-
.../shared/_spending_proposal_search.html.erb | 10 ++
.../_spending_proposal.html.erb | 1 +
.../spending_proposals/_votes.html.erb | 2 +
.../spending_proposals/index.html.erb | 22 ++++
.../management/spending_proposals/vote.js.erb | 1 +
.../_spending_proposal.html.erb | 6 +-
app/views/spending_proposals/show.html.erb | 2 +-
config/locales/admin.en.yml | 3 +
config/locales/admin.es.yml | 3 +
config/routes.rb | 6 +-
.../management/spending_proposals_spec.rb | 124 ++++++++++++++++++
12 files changed, 200 insertions(+), 6 deletions(-)
create mode 100644 app/views/admin/shared/_spending_proposal_search.html.erb
create mode 100644 app/views/management/spending_proposals/_spending_proposal.html.erb
create mode 100644 app/views/management/spending_proposals/_votes.html.erb
create mode 100644 app/views/management/spending_proposals/index.html.erb
create mode 100644 app/views/management/spending_proposals/vote.js.erb
diff --git a/app/controllers/management/spending_proposals_controller.rb b/app/controllers/management/spending_proposals_controller.rb
index e6170722a..ee2c3c695 100644
--- a/app/controllers/management/spending_proposals_controller.rb
+++ b/app/controllers/management/spending_proposals_controller.rb
@@ -1,6 +1,12 @@
class Management::SpendingProposalsController < Management::BaseController
before_action :check_verified_user
+ before_action :set_spending_proposal, only: [:vote, :show]
+
+ def index
+ @spending_proposals = apply_filters_and_search(SpendingProposal).page(params[:page]).for_render
+ set_spending_proposal_votes(@spending_proposals)
+ end
def new
@spending_proposal = SpendingProposal.new
@@ -18,12 +24,20 @@ class Management::SpendingProposalsController < Management::BaseController
end
def show
- @spending_proposal = SpendingProposal.find(params[:id])
+ set_spending_proposal_votes(@spending_proposal)
+ end
+
+ def vote
+ @spending_proposal.register_vote(current_user, 'yes')
set_spending_proposal_votes(@spending_proposal)
end
private
+ def set_spending_proposal
+ @spending_proposal = SpendingProposal.find(params[:id])
+ end
+
def spending_proposal_params
params.require(:spending_proposal).permit(:title, :description, :external_url, :geozone_id, :terms_of_service, :captcha, :captcha_key)
end
@@ -43,4 +57,14 @@ class Management::SpendingProposalsController < Management::BaseController
@spending_proposal_votes = current_user ? current_user.spending_proposal_votes(spending_proposals) : {}
end
+ def apply_filters_and_search(target)
+ target = params[:unfeasible].present? ? target.unfeasible : target.not_unfeasible
+ if params[:geozone].present?
+ target = target.by_geozone(params[:geozone])
+ set_geozone_name
+ end
+ target = target.search(params[:search]) if params[:search].present?
+ target
+ end
+
end
diff --git a/app/views/admin/shared/_spending_proposal_search.html.erb b/app/views/admin/shared/_spending_proposal_search.html.erb
new file mode 100644
index 000000000..d017d2716
--- /dev/null
+++ b/app/views/admin/shared/_spending_proposal_search.html.erb
@@ -0,0 +1,10 @@
+<%= form_for(SpendingProposal.new, url: url, as: :spending_proposal, method: :get) do |f| %>
+
+
+ <%= text_field_tag :search, "", placeholder: t("admin.shared.spending_proposal_search.placeholder") %>
+
+
+ <%= f.submit t("admin.shared.spending_proposal_search.button"), class: "button success" %>
+
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/management/spending_proposals/_spending_proposal.html.erb b/app/views/management/spending_proposals/_spending_proposal.html.erb
new file mode 100644
index 000000000..59b8bc675
--- /dev/null
+++ b/app/views/management/spending_proposals/_spending_proposal.html.erb
@@ -0,0 +1 @@
+<%= render partial: 'spending_proposals/spending_proposal', locals: {spending_proposal: spending_proposal} %>
\ No newline at end of file
diff --git a/app/views/management/spending_proposals/_votes.html.erb b/app/views/management/spending_proposals/_votes.html.erb
new file mode 100644
index 000000000..6549aa204
--- /dev/null
+++ b/app/views/management/spending_proposals/_votes.html.erb
@@ -0,0 +1,2 @@
+<%= render 'spending_proposals/votes',
+ { spending_proposal: spending_proposal, vote_url: vote_management_spending_proposal_path(spending_proposal, value: 'yes') } %>
\ No newline at end of file
diff --git a/app/views/management/spending_proposals/index.html.erb b/app/views/management/spending_proposals/index.html.erb
new file mode 100644
index 000000000..63f4c6ea2
--- /dev/null
+++ b/app/views/management/spending_proposals/index.html.erb
@@ -0,0 +1,22 @@
+
+ <%= render 'admin/shared/spending_proposal_search', url: management_spending_proposals_path %>
+
+
+
+
+
+ <%= content_tag(:h2, t("spending_proposals.index.unfeasible")) if params[:unfeasible].present? %>
+ <%= content_tag(:h2, t("spending_proposals.index.by_geozone", geozone: @geozone_name)) if @geozone_name.present? %>
+ <% if params[:search].present? %>
+
+ <%= page_entries_info @spending_proposals %>
+ <%= t("spending_proposals.index.search_results", count: @spending_proposals.size, search_term: params[:search]) %>
+
+ <% end %>
+
+
+ <%= render @spending_proposals %>
+ <%= paginate @spending_proposals %>
+
+
+
\ No newline at end of file
diff --git a/app/views/management/spending_proposals/vote.js.erb b/app/views/management/spending_proposals/vote.js.erb
new file mode 100644
index 000000000..2c789f995
--- /dev/null
+++ b/app/views/management/spending_proposals/vote.js.erb
@@ -0,0 +1 @@
+<%= render template: 'spending_proposals/vote' %>
\ No newline at end of file
diff --git a/app/views/spending_proposals/_spending_proposal.html.erb b/app/views/spending_proposals/_spending_proposal.html.erb
index 7dff660fc..af59def70 100644
--- a/app/views/spending_proposals/_spending_proposal.html.erb
+++ b/app/views/spending_proposals/_spending_proposal.html.erb
@@ -8,7 +8,7 @@
<% cache [locale_and_user_status(spending_proposal), 'index', spending_proposal, spending_proposal.author] do %>
<%= t("spending_proposals.spending_proposal.spending_proposal") %>
- <%= link_to spending_proposal.title, spending_proposal_path(spending_proposal) %>
+ <%= link_to spending_proposal.title, namespaced_spending_proposal_path(spending_proposal) %>
<%= l spending_proposal.created_at.to_date %>
@@ -42,7 +42,7 @@
<%= geozone_name(spending_proposal) %>
-
<%= link_to spending_proposal.description, spending_proposal_path(spending_proposal) %>
+
<%= link_to spending_proposal.description, namespaced_spending_proposal_path(spending_proposal) %>
<% end %>
@@ -50,7 +50,7 @@
- <%= render 'spending_proposals/votes',
+ <%= render 'votes',
{ spending_proposal: spending_proposal, vote_url: vote_spending_proposal_path(spending_proposal, value: 'yes') } %>
diff --git a/app/views/spending_proposals/show.html.erb b/app/views/spending_proposals/show.html.erb
index ba80fc223..99aab4e17 100644
--- a/app/views/spending_proposals/show.html.erb
+++ b/app/views/spending_proposals/show.html.erb
@@ -36,7 +36,7 @@
<%= t("votes.supports") %>
- <%= render 'spending_proposals/votes',
+ <%= render 'votes',
{ spending_proposal: @spending_proposal, vote_url: vote_spending_proposal_path(@spending_proposal, value: 'yes') } %>
diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml
index 47cbad031..33d3c8434 100755
--- a/config/locales/admin.en.yml
+++ b/config/locales/admin.en.yml
@@ -145,6 +145,9 @@ en:
proposal_search:
button: Search
placeholder: Search proposals by title, code, description or question
+ spending_proposal_search:
+ button: Search
+ placeholder: Search spending proposals by title or description
user_search:
button: Search
placeholder: Search user by name or email'
diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml
index c8a710d72..ec0fa5483 100644
--- a/config/locales/admin.es.yml
+++ b/config/locales/admin.es.yml
@@ -145,6 +145,9 @@ es:
proposal_search:
button: Buscar
placeholder: Buscar propuestas por título, código, descripción o pregunta
+ spending_proposal_search:
+ button: Buscar
+ placeholder: Buscar propuestas por título o descripción
user_search:
button: Buscar
placeholder: Buscar usuario por nombre o email
diff --git a/config/routes.rb b/config/routes.rb
index e27d035f2..f5e22b91a 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -252,7 +252,11 @@ Rails.application.routes.draw do
end
end
- resources :spending_proposals, only: [:index, :new, :create, :show]
+ resources :spending_proposals, only: [:index, :new, :create, :show] do
+ member do
+ post :vote
+ end
+ end
end
if Rails.env.development?
diff --git a/spec/features/management/spending_proposals_spec.rb b/spec/features/management/spending_proposals_spec.rb
index 52ea36801..9ee161fd8 100644
--- a/spec/features/management/spending_proposals_spec.rb
+++ b/spec/features/management/spending_proposals_spec.rb
@@ -51,4 +51,128 @@ feature 'Spending Proposals' do
end
end
+ context "Searching" do
+ scenario "by title" do
+ spending_proposal1 = create(:spending_proposal, title: "Show me what you got")
+ spending_proposal2 = create(:spending_proposal, title: "Get Schwifty")
+
+ user = create(:user, :level_two)
+ login_managed_user(user)
+
+ click_link "Support spending proposals"
+
+ fill_in "search", with: "what you got"
+ click_button "Search"
+
+ expect(current_path).to eq(management_spending_proposals_path)
+
+ within("#investment-projects") do
+ expect(page).to have_css('.investment-project', count: 1)
+ expect(page).to have_content(spending_proposal1.title)
+ expect(page).to_not have_content(spending_proposal2.title)
+ expect(page).to have_css("a[href='#{management_spending_proposal_path(spending_proposal1)}']", text: spending_proposal1.title)
+ expect(page).to have_css("a[href='#{management_spending_proposal_path(spending_proposal1)}']", text: spending_proposal1.description)
+ end
+ end
+
+ scenario "by district" do
+ spending_proposal1 = create(:spending_proposal, title: "Hey ho", geozone_id: create(:geozone, name: "District 9").id)
+ spending_proposal2 = create(:spending_proposal, title: "Let's go", geozone_id: create(:geozone, name: "Area 52").id)
+
+ user = create(:user, :level_two)
+ login_managed_user(user)
+
+ click_link "Support spending proposals"
+
+ fill_in "search", with: "Area 52"
+ click_button "Search"
+
+ expect(current_path).to eq(management_spending_proposals_path)
+
+ within("#investment-projects") do
+ expect(page).to have_css('.investment-project', count: 1)
+ expect(page).to_not have_content(spending_proposal1.title)
+ expect(page).to have_content(spending_proposal2.title)
+ expect(page).to have_css("a[href='#{management_spending_proposal_path(spending_proposal2)}']", text: spending_proposal2.title)
+ expect(page).to have_css("a[href='#{management_spending_proposal_path(spending_proposal2)}']", text: spending_proposal2.description)
+ end
+ end
+ end
+
+ scenario "Listing" do
+ spending_proposal1 = create(:spending_proposal, title: "Show me what you got")
+ spending_proposal2 = create(:spending_proposal, title: "Get Schwifty")
+
+ user = create(:user, :level_two)
+ login_managed_user(user)
+
+ click_link "Support spending proposals"
+
+ expect(current_path).to eq(management_spending_proposals_path)
+
+ within(".account-info") do
+ expect(page).to have_content "Identified as"
+ expect(page).to have_content "#{user.username}"
+ expect(page).to have_content "#{user.email}"
+ expect(page).to have_content "#{user.document_number}"
+ end
+
+ within("#investment-projects") do
+ expect(page).to have_css('.investment-project', count: 2)
+ expect(page).to have_css("a[href='#{management_spending_proposal_path(spending_proposal1)}']", text: spending_proposal1.title)
+ expect(page).to have_css("a[href='#{management_spending_proposal_path(spending_proposal1)}']", text: spending_proposal1.description)
+ expect(page).to have_css("a[href='#{management_spending_proposal_path(spending_proposal2)}']", text: spending_proposal2.title)
+ expect(page).to have_css("a[href='#{management_spending_proposal_path(spending_proposal2)}']", text: spending_proposal2.description)
+ end
+ end
+
+ context "Voting" do
+
+ scenario 'Voting spending proposals on behalf of someone in index view', :js do
+ spending_proposal = create(:spending_proposal)
+
+ user = create(:user, :level_two)
+ login_managed_user(user)
+
+ click_link "Support spending proposals"
+
+ within("#investment-projects") do
+ find('.in-favor a').click
+
+ expect(page).to have_content "1 support"
+ expect(page).to have_content "You have already supported this. Share it!"
+ end
+ expect(current_path).to eq(management_spending_proposals_path)
+ end
+
+ scenario 'Voting spending proposals on behalf of someone in show view', :js do
+ spending_proposal = create(:spending_proposal)
+
+ user = create(:user, :level_two)
+ login_managed_user(user)
+
+ click_link "Support spending proposals"
+
+ within("#investment-projects") do
+ click_link spending_proposal.title
+ end
+
+ find('.in-favor a').click
+ expect(page).to have_content "1 support"
+ expect(page).to have_content "You have already supported this. Share it!"
+ expect(current_path).to eq(management_spending_proposal_path(spending_proposal))
+ end
+
+ scenario "Should not allow unverified users to vote proposals" do
+ spending_proposal = create(:spending_proposal)
+
+ user = create(:user)
+ login_managed_user(user)
+
+ click_link "Support spending proposals"
+
+ expect(page).to have_content "User is not verified"
+ end
+ end
+
end
\ No newline at end of file
From 1e8204e6767136347bf561e492da12f93d17284d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Wed, 6 Apr 2016 12:06:07 +0200
Subject: [PATCH 0011/1685] adds support for spending proposals to mgmt menu
---
app/views/management/_menu.html.erb | 7 +++++++
config/locales/management.en.yml | 1 +
config/locales/management.es.yml | 1 +
3 files changed, 9 insertions(+)
diff --git a/app/views/management/_menu.html.erb b/app/views/management/_menu.html.erb
index 1810ab568..520cd9f8c 100644
--- a/app/views/management/_menu.html.erb
+++ b/app/views/management/_menu.html.erb
@@ -34,6 +34,13 @@
<% end %>
+ >
+ <%= link_to management_spending_proposals_path do %>
+
+ <%= t("management.menu.support_spending_proposals") %>
+ <% end %>
+
+
>
<%= link_to print_management_proposals_path do %>
diff --git a/config/locales/management.en.yml b/config/locales/management.en.yml
index 7d8a9f12e..1e8e99196 100644
--- a/config/locales/management.en.yml
+++ b/config/locales/management.en.yml
@@ -41,6 +41,7 @@ en:
print_proposals: Print proposals
support_proposals: Support proposals
create_spending_proposal: Create spending proposal
+ support_spending_proposals: Support spending proposals
title: Management
users: Users
permissions:
diff --git a/config/locales/management.es.yml b/config/locales/management.es.yml
index 5c1fe68d9..991bd7741 100644
--- a/config/locales/management.es.yml
+++ b/config/locales/management.es.yml
@@ -41,6 +41,7 @@ es:
print_proposals: Imprimir propuestas
support_proposals: Apoyar propuestas
create_spending_proposal: Crear propuesta de gasto
+ support_spending_proposals: Apoyar propuestas de gasto
title: Gestión
users: Usuarios
permissions:
From c71d09d3df370ff07ba8d53d55af2057ebea8118 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baza=CC=81n?=
Date: Wed, 6 Apr 2016 12:18:25 +0200
Subject: [PATCH 0012/1685] adds verified and level 2 users to dev_seeds
---
db/dev_seeds.rb | 6 ++++++
db/schema.rb | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/db/dev_seeds.rb b/db/dev_seeds.rb
index ac4695d0f..ffbc8237d 100644
--- a/db/dev_seeds.rb
+++ b/db/dev_seeds.rb
@@ -46,6 +46,12 @@ moderator.create_moderator
valuator = create_user('valuator@madrid.es', 'valuator')
valuator.create_valuator
+level_2 = create_user('leveltwo@madrid.es', 'level 2')
+level_2.update(residence_verified_at: Time.now, confirmed_phone: Faker::PhoneNumber.phone_number, document_number: "2222222222", document_type: "1" )
+
+verified = create_user('verified@madrid.es', 'verified')
+verified.update(residence_verified_at: Time.now, confirmed_phone: Faker::PhoneNumber.phone_number, document_type: "1", verified_at: Time.now, document_number: "3333333333")
+
(1..10).each do |i|
org_name = Faker::Company.name
org_user = create_user("org#{i}@madrid.es", org_name)
diff --git a/db/schema.rb b/db/schema.rb
index 55021dfa0..a031c51f5 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -312,7 +312,7 @@ ActiveRecord::Schema.define(version: 20160329160106) do
t.integer "price_first_year", limit: 8
t.string "time_scope"
t.datetime "unfeasible_email_sent_at"
- t.integer "cached_votes_up"
+ t.integer "cached_votes_up", default: 0
t.tsvector "tsv"
end
From 9c6813b23c08b0a05d92024bcc5fe98dc4a5b445 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Wed, 6 Apr 2016 12:40:19 +0200
Subject: [PATCH 0013/1685] changes i18n for spending proposals in management
---
config/locales/management.es.yml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/config/locales/management.es.yml b/config/locales/management.es.yml
index 991bd7741..f1de3cf88 100644
--- a/config/locales/management.es.yml
+++ b/config/locales/management.es.yml
@@ -40,8 +40,8 @@ es:
create_proposal: Crear propuesta
print_proposals: Imprimir propuestas
support_proposals: Apoyar propuestas
- create_spending_proposal: Crear propuesta de gasto
- support_spending_proposals: Apoyar propuestas de gasto
+ create_spending_proposal: Crear propuesta de inversión
+ support_spending_proposals: Apoyar propuestas de inversión
title: Gestión
users: Usuarios
permissions:
@@ -63,7 +63,7 @@ es:
spending_proposals:
alert:
unverified_user: Este usuario no está verificado
- create: Crear propuesta de gasto
+ create: Crear propuesta de inversión
sessions:
signed_out: Has cerrado la sesión correctamente.
signed_out_managed_user: Se ha cerrado correctamente la sesión del usuario.
From 5d22ea2daf7cb0338bef5dc665b5b1275e586e6e Mon Sep 17 00:00:00 2001
From: Alberto Garcia Cabeza
Date: Wed, 6 Apr 2016 13:07:26 +0200
Subject: [PATCH 0014/1685] Improves layout for management spending proposals
---
app/assets/stylesheets/admin.scss | 6 ++++++
app/views/admin/shared/_spending_proposal_search.html.erb | 4 ++--
app/views/management/_account_info.html.erb | 2 +-
app/views/management/spending_proposals/index.html.erb | 5 ++++-
4 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss
index e01655f6d..6143c79d3 100644
--- a/app/assets/stylesheets/admin.scss
+++ b/app/assets/stylesheets/admin.scss
@@ -349,3 +349,9 @@ body.admin {
margin-bottom: 0;
}
+body.admin {
+
+ .investment-projects-list.medium-9 {
+ width: 100%;
+ }
+}
diff --git a/app/views/admin/shared/_spending_proposal_search.html.erb b/app/views/admin/shared/_spending_proposal_search.html.erb
index d017d2716..c3e276ebe 100644
--- a/app/views/admin/shared/_spending_proposal_search.html.erb
+++ b/app/views/admin/shared/_spending_proposal_search.html.erb
@@ -3,8 +3,8 @@
<%= text_field_tag :search, "", placeholder: t("admin.shared.spending_proposal_search.placeholder") %>
-
<% end %>
\ No newline at end of file
diff --git a/app/views/management/_account_info.html.erb b/app/views/management/_account_info.html.erb
index d27f1524d..20a6bc24d 100644
--- a/app/views/management/_account_info.html.erb
+++ b/app/views/management/_account_info.html.erb
@@ -1,5 +1,5 @@
<% if managed_user.document_number.present? %>
-
+
<%= link_to(t("management.account_info.change_user"), logout_management_users_path, method: :delete, class: 'float-right change-user') %>
diff --git a/app/views/management/spending_proposals/index.html.erb b/app/views/management/spending_proposals/index.html.erb
index 63f4c6ea2..e02d6920f 100644
--- a/app/views/management/spending_proposals/index.html.erb
+++ b/app/views/management/spending_proposals/index.html.erb
@@ -1,9 +1,12 @@
- <%= render 'admin/shared/spending_proposal_search', url: management_spending_proposals_path %>
+
+ <%= render 'admin/shared/spending_proposal_search', url: management_spending_proposals_path %>
+
+
<%= content_tag(:h2, t("spending_proposals.index.unfeasible")) if params[:unfeasible].present? %>
<%= content_tag(:h2, t("spending_proposals.index.by_geozone", geozone: @geozone_name)) if @geozone_name.present? %>
From 4faf6f18191bb26adce743f96c7d8842770beedf Mon Sep 17 00:00:00 2001
From: Alberto Garcia Cabeza
Date: Wed, 6 Apr 2016 13:10:55 +0200
Subject: [PATCH 0015/1685] Improves styles for admin menu icons
---
app/assets/stylesheets/admin.scss | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss
index 6143c79d3..cfec260e1 100644
--- a/app/assets/stylesheets/admin.scss
+++ b/app/assets/stylesheets/admin.scss
@@ -116,7 +116,7 @@ body.admin {
[class^="icon-"] {
display: inline-block;
font-size: rem-calc(24);
- padding-right: rem-calc(24);
+ padding-right: rem-calc(12);
padding-top: rem-calc(4);
padding-left: 12px\9 !important;
padding-right: 12px\9 !important;
From fc5f5eec8bd77b53b257866da0956d3dc8194575 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Wed, 6 Apr 2016 18:45:58 +0200
Subject: [PATCH 0016/1685] changes default order in management sps to votes
---
app/controllers/management/spending_proposals_controller.rb | 2 +-
config/routes.rb | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/app/controllers/management/spending_proposals_controller.rb b/app/controllers/management/spending_proposals_controller.rb
index ee2c3c695..fccdcad2b 100644
--- a/app/controllers/management/spending_proposals_controller.rb
+++ b/app/controllers/management/spending_proposals_controller.rb
@@ -4,7 +4,7 @@ class Management::SpendingProposalsController < Management::BaseController
before_action :set_spending_proposal, only: [:vote, :show]
def index
- @spending_proposals = apply_filters_and_search(SpendingProposal).page(params[:page]).for_render
+ @spending_proposals = apply_filters_and_search(SpendingProposal).order(cached_votes_up: :desc).page(params[:page]).for_render
set_spending_proposal_votes(@spending_proposals)
end
diff --git a/config/routes.rb b/config/routes.rb
index f5e22b91a..7bc31139e 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -253,9 +253,8 @@ Rails.application.routes.draw do
end
resources :spending_proposals, only: [:index, :new, :create, :show] do
- member do
- post :vote
- end
+ post :vote, on: :member
+ get :print, on: :collection
end
end
From 785170213b95c4e8cbff757b62b42efb1a8befba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Wed, 6 Apr 2016 19:04:03 +0200
Subject: [PATCH 0017/1685] adds print page to management/spending_proposals
includes search and filtering by geozone
---
.../spending_proposals_controller.rb | 16 ++++++-
app/views/management/_menu.html.erb | 7 +++
app/views/management/proposals/print.html.erb | 4 +-
.../spending_proposals/index.html.erb | 6 +--
.../spending_proposals/print.html.erb | 34 ++++++++++++++
config/locales/management.en.yml | 15 +++++-
config/locales/management.es.yml | 17 +++++--
.../management/spending_proposals_spec.rb | 46 +++++++++++++++++++
8 files changed, 134 insertions(+), 11 deletions(-)
create mode 100644 app/views/management/spending_proposals/print.html.erb
diff --git a/app/controllers/management/spending_proposals_controller.rb b/app/controllers/management/spending_proposals_controller.rb
index fccdcad2b..18d013c57 100644
--- a/app/controllers/management/spending_proposals_controller.rb
+++ b/app/controllers/management/spending_proposals_controller.rb
@@ -1,6 +1,6 @@
class Management::SpendingProposalsController < Management::BaseController
- before_action :check_verified_user
+ before_action :check_verified_user, except: :print
before_action :set_spending_proposal, only: [:vote, :show]
def index
@@ -32,6 +32,12 @@ class Management::SpendingProposalsController < Management::BaseController
set_spending_proposal_votes(@spending_proposal)
end
+ def print
+ params[:geozone] ||= 'all'
+ @spending_proposals = apply_filters_and_search(SpendingProposal).order(cached_votes_up: :desc).for_render.limit(15)
+ set_spending_proposal_votes(@spending_proposals)
+ end
+
private
def set_spending_proposal
@@ -57,6 +63,14 @@ class Management::SpendingProposalsController < Management::BaseController
@spending_proposal_votes = current_user ? current_user.spending_proposal_votes(spending_proposals) : {}
end
+ def set_geozone_name
+ if params[:geozone] == 'all'
+ @geozone_name = t('geozones.none')
+ else
+ @geozone_name = Geozone.find(params[:geozone]).name
+ end
+ end
+
def apply_filters_and_search(target)
target = params[:unfeasible].present? ? target.unfeasible : target.not_unfeasible
if params[:geozone].present?
diff --git a/app/views/management/_menu.html.erb b/app/views/management/_menu.html.erb
index 520cd9f8c..0106865d2 100644
--- a/app/views/management/_menu.html.erb
+++ b/app/views/management/_menu.html.erb
@@ -47,5 +47,12 @@
<%= t("management.menu.print_proposals") %>
<% end %>
+
+ >
+ <%= link_to print_management_spending_proposals_path do %>
+
+ <%= t("management.menu.print_spending_proposals") %>
+ <% end %>
+
diff --git a/app/views/management/proposals/print.html.erb b/app/views/management/proposals/print.html.erb
index 7399376f1..71220c74b 100644
--- a/app/views/management/proposals/print.html.erb
+++ b/app/views/management/proposals/print.html.erb
@@ -20,8 +20,8 @@
<%= render @proposals %>
-
<%= t("management.print.info") %>
- <%= t("management.print.note") %>
+
<%= t("management.print.proposals_info") %>
+ <%= t("management.print.proposals_note") %>
diff --git a/app/views/management/spending_proposals/index.html.erb b/app/views/management/spending_proposals/index.html.erb
index e02d6920f..49e4151d2 100644
--- a/app/views/management/spending_proposals/index.html.erb
+++ b/app/views/management/spending_proposals/index.html.erb
@@ -8,12 +8,12 @@
- <%= content_tag(:h2, t("spending_proposals.index.unfeasible")) if params[:unfeasible].present? %>
- <%= content_tag(:h2, t("spending_proposals.index.by_geozone", geozone: @geozone_name)) if @geozone_name.present? %>
+ <%= content_tag(:h2, t("management.spending_proposals.filters.unfeasible")) if params[:unfeasible].present? %>
+ <%= content_tag(:h2, t("management.spending_proposals.filters.by_geozone", geozone: @geozone_name)) if @geozone_name.present? %>
<% if params[:search].present? %>
<%= page_entries_info @spending_proposals %>
- <%= t("spending_proposals.index.search_results", count: @spending_proposals.size, search_term: params[:search]) %>
+ <%= t("management.spending_proposals.search_results", count: @spending_proposals.size, search_term: params[:search]) %>
<% end %>
diff --git a/app/views/management/spending_proposals/print.html.erb b/app/views/management/spending_proposals/print.html.erb
new file mode 100644
index 000000000..46a012149
--- /dev/null
+++ b/app/views/management/spending_proposals/print.html.erb
@@ -0,0 +1,34 @@
+
+
+
+
+
+ <%= form_tag print_management_spending_proposals_path, method: :get, enforce_utf8: false do %>
+
+ <%= select_tag :geozone,
+ options_for_select(geozone_select_options.unshift([t("geozones.none"), "all"]), params[:geozone]),
+ { label: false,
+ class: "js-submit-on-change" } %>
+
+ <% end %>
+
+
+ <%= t('management.spending_proposals.print.print_button') %>
+
+
+
+
+ <%= content_tag(:h2, t("management.spending_proposals.filters.unfeasible"), class: "inline-block") if params[:unfeasible].present? %>
+ <%= content_tag(:h2, t("management.spending_proposals.filters.by_geozone", geozone: @geozone_name), class: "inline-block") if @geozone_name.present? %>
+ <%= content_tag(:h2, t("management.spending_proposals.search_results", count: @spending_proposals.size, search_term: params[:search]), class: "inline-block") if params[:search].present? %>
+
+
+ <%= render @spending_proposals %>
+
+
+
<%= t("management.print.spending_proposals_info") %>
+ <%= t("management.print.spending_proposals_note") %>
+
+
+
+
diff --git a/config/locales/management.en.yml b/config/locales/management.en.yml
index 1e8e99196..3f9a447b0 100644
--- a/config/locales/management.en.yml
+++ b/config/locales/management.en.yml
@@ -41,6 +41,7 @@ en:
print_proposals: Print proposals
support_proposals: Support proposals
create_spending_proposal: Create spending proposal
+ print_spending_proposals: Print spending proposals
support_spending_proposals: Support spending proposals
title: Management
users: Users
@@ -50,9 +51,11 @@ en:
support_proposals: Support proposals
vote_proposals: Vote proposals
print:
- info: Create yor proposal on http://decide.madrid.es
- note: The proposals more supported will be voted. If are accepted by a majority, the city Council shall be carried out.
+ proposals_info: Create yor proposal on http://decide.madrid.es
+ proposals_note: The proposals more supported will be voted. If are accepted by a majority, the city Council shall be carried out.
proposals_title: 'Proposals:'
+ spending_proposals_info: Participate at http://decide.madrid.es
+ spending_proposals_note: Participatory budget will be assigned to the most votes spending proposals.
print_info: Print this info
proposals:
alert:
@@ -64,6 +67,14 @@ en:
alert:
unverified_user: User is not verified
create: Create spending proposal
+ filters:
+ unfeasible: Unfeasible investment projects
+ by_geozone: "Investment projects with scope: %{geozone}"
+ print:
+ print_button: Print
+ search_results:
+ one: " containing the term '%{search_term}'"
+ other: " containing the term '%{search_term}'"
sessions:
signed_out: Signed out successfully.
signed_out_managed_user: User session signed out successfully.
diff --git a/config/locales/management.es.yml b/config/locales/management.es.yml
index f1de3cf88..540bad027 100644
--- a/config/locales/management.es.yml
+++ b/config/locales/management.es.yml
@@ -41,7 +41,8 @@ es:
print_proposals: Imprimir propuestas
support_proposals: Apoyar propuestas
create_spending_proposal: Crear propuesta de inversión
- support_spending_proposals: Apoyar propuestas de inversión
+ print_spending_proposals: Imprimir propts. de inversión
+ support_spending_proposals: Apoyar propts. de inversión
title: Gestión
users: Usuarios
permissions:
@@ -50,9 +51,11 @@ es:
support_proposals: Apoyar propuestas
vote_proposals: Participar en las votaciones finales
print:
- info: Haz tu propuesta en http://decide.madrid.es
- note: Las propuestas más apoyadas serán llevadas a votación. Y si las acepta una mayoría, el Ayuntamiento las llevará a cabo.
+ proposals_info: Haz tu propuesta en http://decide.madrid.es
+ proposals_note: Las propuestas más apoyadas serán llevadas a votación. Y si las acepta una mayoría, el Ayuntamiento las llevará a cabo.
proposals_title: 'Propuestas:'
+ spending_proposals_info: Participa en http://decide.madrid.es
+ spending_proposals_note: Los presupuestos participativos se invertirán en las propuestas de inversión más apoyadas.
print_info: Imprimir esta información
proposals:
alert:
@@ -64,6 +67,14 @@ es:
alert:
unverified_user: Este usuario no está verificado
create: Crear propuesta de inversión
+ filters:
+ unfeasible: Propuestas de inversión no viables
+ by_geozone: "Propuestas de inversión con ámbito: %{geozone}"
+ print:
+ print_button: Imprimir
+ search_results:
+ one: " que contiene '%{search_term}'"
+ other: " que contienen '%{search_term}'"
sessions:
signed_out: Has cerrado la sesión correctamente.
signed_out_managed_user: Se ha cerrado correctamente la sesión del usuario.
diff --git a/spec/features/management/spending_proposals_spec.rb b/spec/features/management/spending_proposals_spec.rb
index 9ee161fd8..760d2a07a 100644
--- a/spec/features/management/spending_proposals_spec.rb
+++ b/spec/features/management/spending_proposals_spec.rb
@@ -175,4 +175,50 @@ feature 'Spending Proposals' do
end
end
+ context "Printing" do
+
+ scenario 'Printing spending proposals' do
+ 16.times { create(:spending_proposal, geozone_id: nil) }
+
+ click_link "Print spending proposals"
+
+ expect(page).to have_css('.investment-project', count: 15)
+ expect(page).to have_css("a[href='javascript:window.print();']", text: 'Print')
+ end
+
+ scenario "Filtering spending proposals by geozone to be printed", :js do
+ district_9 = create(:geozone, name: "District Nine")
+ create(:spending_proposal, title: 'Change district 9', geozone: district_9, cached_votes_up: 10)
+ create(:spending_proposal, title: 'Destroy district 9', geozone: district_9, cached_votes_up: 100)
+ create(:spending_proposal, title: 'Nuke district 9', geozone: district_9, cached_votes_up: 1)
+ create(:spending_proposal, title: 'Add new districts to the city', geozone_id: nil)
+
+ user = create(:user, :level_two)
+ login_managed_user(user)
+
+ click_link "Print spending proposals"
+
+ expect(page).to have_content "Investment projects with scope: All city"
+
+ within '#investment-projects' do
+ expect(page).to have_content('Add new districts to the city')
+ expect(page).to_not have_content('Change district 9')
+ expect(page).to_not have_content('Destroy district 9')
+ expect(page).to_not have_content('Nuke district 9')
+ end
+
+ select 'District Nine', from: 'geozone'
+
+ expect(page).to have_content "Investment projects with scope: District Nine"
+ expect(current_url).to include("geozone=#{district_9.id}")
+
+ within '#investment-projects' do
+ expect(page).to_not have_content('Add new districts to the city')
+ expect('Destroy district 9').to appear_before('Change district 9')
+ expect('Change district 9').to appear_before('Nuke district 9')
+ end
+ end
+
+ end
+
end
\ No newline at end of file
From 1d931e7943bccf42dc93facaac1590600c2f6f2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Wed, 6 Apr 2016 19:05:00 +0200
Subject: [PATCH 0018/1685] removes unnecessary :js
---
spec/features/management/proposals_spec.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/spec/features/management/proposals_spec.rb b/spec/features/management/proposals_spec.rb
index f83c37a0c..e5279bac4 100644
--- a/spec/features/management/proposals_spec.rb
+++ b/spec/features/management/proposals_spec.rb
@@ -185,7 +185,7 @@ feature 'Proposals' do
context "Printing" do
- scenario 'Printing proposals', :js do
+ scenario 'Printing proposals' do
6.times { create(:proposal) }
click_link "Print proposals"
From 3c8416e8637fecc0e8a652a0bb48b6889aa6cc79 Mon Sep 17 00:00:00 2001
From: kikito
Date: Wed, 6 Apr 2016 19:18:10 +0200
Subject: [PATCH 0019/1685] Adds responsible_name to spending_proposals
---
...60406163649_add_responsible_name_to_spending_proposals.rb | 5 +++++
db/schema.rb | 3 ++-
2 files changed, 7 insertions(+), 1 deletion(-)
create mode 100644 db/migrate/20160406163649_add_responsible_name_to_spending_proposals.rb
diff --git a/db/migrate/20160406163649_add_responsible_name_to_spending_proposals.rb b/db/migrate/20160406163649_add_responsible_name_to_spending_proposals.rb
new file mode 100644
index 000000000..5749400bb
--- /dev/null
+++ b/db/migrate/20160406163649_add_responsible_name_to_spending_proposals.rb
@@ -0,0 +1,5 @@
+class AddResponsibleNameToSpendingProposals < ActiveRecord::Migration
+ def change
+ add_column :spending_proposals, :responsible_name, :string, limit: 60
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index a031c51f5..4183e0246 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20160329160106) do
+ActiveRecord::Schema.define(version: 20160406163649) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -314,6 +314,7 @@ ActiveRecord::Schema.define(version: 20160329160106) do
t.datetime "unfeasible_email_sent_at"
t.integer "cached_votes_up", default: 0
t.tsvector "tsv"
+ t.string "responsible_name", limit: 60
end
add_index "spending_proposals", ["author_id"], name: "index_spending_proposals_on_author_id", using: :btree
From 32a60515c6901d3f2164185c5b4dcc8511f0fd5d Mon Sep 17 00:00:00 2001
From: kikito
Date: Wed, 6 Apr 2016 19:23:05 +0200
Subject: [PATCH 0020/1685] updates the sp responsible_name when
creating/editing a sp
---
app/models/spending_proposal.rb | 6 ++++++
spec/models/spending_proposal_spec.rb | 8 ++++++++
2 files changed, 14 insertions(+)
diff --git a/app/models/spending_proposal.rb b/app/models/spending_proposal.rb
index f11dc71c3..2ee2eb6e8 100644
--- a/app/models/spending_proposal.rb
+++ b/app/models/spending_proposal.rb
@@ -36,6 +36,8 @@ class SpendingProposal < ActiveRecord::Base
scope :for_render, -> { includes(:geozone) }
+ before_validation :update_responsible_name
+
def description
super.try :html_safe
end
@@ -120,4 +122,8 @@ class SpendingProposal < ActiveRecord::Base
end
end
+ def update_responsible_name
+ self.responsible_name = author.try(:username)
+ end
+
end
diff --git a/spec/models/spending_proposal_spec.rb b/spec/models/spending_proposal_spec.rb
index df5b5bdd6..d841abf06 100644
--- a/spec/models/spending_proposal_spec.rb
+++ b/spec/models/spending_proposal_spec.rb
@@ -261,4 +261,12 @@ describe SpendingProposal do
end
end
+ describe "responsible_name" do
+ it "gets updated with the user name" do
+ u = create(:user, username: "manolo")
+ sp = create(:spending_proposal, author: u)
+ expect(sp.responsible_name).to eq("manolo")
+ end
+ end
+
end
From 58fb6e68ea79a65ff6defd6374e04483454c877f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Wed, 6 Apr 2016 19:25:27 +0200
Subject: [PATCH 0021/1685] cleans up routes: use blocks only when necessary
---
config/routes.rb | 67 +++++++++++++++---------------------------------
1 file changed, 20 insertions(+), 47 deletions(-)
diff --git a/config/routes.rb b/config/routes.rb
index 7bc31139e..92bdf8601 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -67,9 +67,7 @@ Rails.application.routes.draw do
scope '/participatory_budget' do
resources :spending_proposals, only: [:index, :new, :create, :show, :destroy], path: 'investment_projects' do
- member do
- post :vote
- end
+ post :vote, on: :member
end
end
@@ -78,19 +76,17 @@ Rails.application.routes.draw do
resources :legislations, only: [:show]
resources :annotations do
- collection do
- get :search
- end
+ get :search, on: :collection
end
resources :users, only: [:show]
resource :account, controller: "account", only: [:show, :update, :delete] do
- collection { get :erase }
+ get :erase, on: :collection
end
resources :notifications, only: [:index, :show] do
- collection { put :mark_all_as_read }
+ put :mark_all_as_read, on: :collection
end
resource :verification, controller: "verification", only: [:show]
@@ -106,7 +102,7 @@ Rails.application.routes.draw do
namespace :admin do
root to: "dashboard#index"
resources :organizations, only: :index do
- collection { get :search }
+ get :search, on: :collection
member do
put :verify
put :reject
@@ -150,20 +146,20 @@ Rails.application.routes.draw do
resources :tags, only: [:index, :create, :update, :destroy]
resources :officials, only: [:index, :edit, :update, :destroy] do
- collection { get :search}
+ get :search, on: :collection
end
resources :settings, only: [:index, :update]
resources :moderators, only: [:index, :create, :destroy] do
- collection { get :search }
+ get :search, on: :collection
end
resources :valuators, only: [:index, :create] do
- collection { get :search }
+ get :search, on: :collection
end
resources :verifications, controller: :verifications, only: :index do
- collection { get :search}
+ get :search, on: :collection
end
resource :activity, controller: :activity, only: :show
@@ -185,30 +181,18 @@ Rails.application.routes.draw do
end
resources :debates, only: :index do
- member do
- put :hide
- end
- collection do
- put :moderate
- end
+ put :hide, on: :member
+ put :moderate, on: :collection
end
resources :proposals, only: :index do
- member do
- put :hide
- end
- collection do
- put :moderate
- end
+ put :hide, on: :member
+ put :moderate, on: :collection
end
resources :comments, only: :index do
- member do
- put :hide
- end
- collection do
- put :moderate
- end
+ put :hide, on: :member
+ put :moderate, on: :collection
end
end
@@ -216,9 +200,7 @@ Rails.application.routes.draw do
root to: "spending_proposals#index"
resources :spending_proposals, only: [:index, :show, :edit] do
- member do
- patch :valuate
- end
+ patch :valuate, on: :member
end
end
@@ -226,30 +208,21 @@ Rails.application.routes.draw do
root to: "dashboard#index"
resources :document_verifications, only: [:index, :new, :create] do
- collection do
- post :check
- end
+ post :check, on: :collection
end
resources :email_verifications, only: [:new, :create]
resources :users, only: [:new, :create] do
- collection do
- delete :logout
- end
+ delete :logout, on: :collection
end
get 'sign_in', to: 'sessions#create'
resource :session, only: [:create, :destroy]
resources :proposals, only: [:index, :new, :create, :show] do
- member do
- post :vote
- end
-
- collection do
- get :print
- end
+ post :vote, on: :member
+ get :print, on: :collection
end
resources :spending_proposals, only: [:index, :new, :create, :show] do
From 95b0e75427d424a998d383c16ed3f17659e29371 Mon Sep 17 00:00:00 2001
From: kikito
Date: Wed, 6 Apr 2016 19:27:18 +0200
Subject: [PATCH 0022/1685] Rename method
---
app/models/spending_proposal.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/models/spending_proposal.rb b/app/models/spending_proposal.rb
index 2ee2eb6e8..f4657e9d4 100644
--- a/app/models/spending_proposal.rb
+++ b/app/models/spending_proposal.rb
@@ -36,7 +36,7 @@ class SpendingProposal < ActiveRecord::Base
scope :for_render, -> { includes(:geozone) }
- before_validation :update_responsible_name
+ before_validation :set_responsible_name
def description
super.try :html_safe
@@ -122,7 +122,7 @@ class SpendingProposal < ActiveRecord::Base
end
end
- def update_responsible_name
+ def set_responsible_name
self.responsible_name = author.try(:username)
end
From 9a74b79eabaf6fc32781ebffc66fcc9602235e63 Mon Sep 17 00:00:00 2001
From: kikito
Date: Wed, 6 Apr 2016 19:27:39 +0200
Subject: [PATCH 0023/1685] Fixes typo in rake task. Adds comment.
---
lib/tasks/spending_proposals.rake | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/lib/tasks/spending_proposals.rake b/lib/tasks/spending_proposals.rake
index 42cde5424..365338d96 100644
--- a/lib/tasks/spending_proposals.rake
+++ b/lib/tasks/spending_proposals.rake
@@ -1,20 +1,21 @@
namespace :spending_proposals do
desc "Sends an email to the authors of unfeasible spending proposals"
task send_unfeasible_emails: :environment do
- SpendingProposal.find_each do |spending_propsal|
- if spending_propsal.unfeasible_email_pending?
- spending_propsal.send_unfeasible_email
- puts "email sent for proposal #{spending_propsal.title}"
+ SpendingProposal.find_each do |spending_proposal|
+ if spending_proposal.unfeasible_email_pending?
+ spending_proposal.send_unfeasible_email
+ puts "email sent for proposal #{spending_proposal.title}"
else
- puts "this proposal is feasible: #{spending_propsal.title}"
+ puts "this proposal is feasible: #{spending_proposal.title}"
end
end
end
- desc "Updates all spending proposals to recalculate their tsv column"
+ desc "Updates all spending proposals to recalculate their tsv and responsible_name columns"
task touch: :environment do
- SpendingProposal.find_in_batches do |spending_propsal|
- spending_propsal.each(&:save)
+ SpendingProposal.find_in_batches do |spending_proposal|
+ spending_proposal.each(&:save)
end
end
-end
\ No newline at end of file
+
+end
From d03864adb20a259fc75109feae0c9110df626522 Mon Sep 17 00:00:00 2001
From: kikito
Date: Wed, 6 Apr 2016 18:08:00 +0200
Subject: [PATCH 0024/1685] replaces the select in the valuators index with a
list of links + pending count
---
.../spending_proposals_controller.rb | 21 +++++++++++++++++++
.../spending_proposals/index.html.erb | 16 +++++++-------
.../valuation/spending_proposals_spec.rb | 6 +++---
3 files changed, 31 insertions(+), 12 deletions(-)
diff --git a/app/controllers/valuation/spending_proposals_controller.rb b/app/controllers/valuation/spending_proposals_controller.rb
index c5f822b40..77a80b413 100644
--- a/app/controllers/valuation/spending_proposals_controller.rb
+++ b/app/controllers/valuation/spending_proposals_controller.rb
@@ -9,6 +9,7 @@ class Valuation::SpendingProposalsController < Valuation::BaseController
load_and_authorize_resource
def index
+ @geozone_filters = geozone_filters
if current_user.valuator?
@spending_proposals = SpendingProposal.scoped_filter(params_for_current_valuator, @current_filter).order(created_at: :desc).page(params[:page])
else
@@ -31,6 +32,26 @@ class Valuation::SpendingProposalsController < Valuation::BaseController
private
+ def geozone_filters
+
+ spending_proposals = SpendingProposal.by_valuator(current_user.valuator.try(:id)).valuation_open.all.to_a
+
+ [ { name: t('valuation.spending_proposals.index.geozone_filter_all'),
+ id: nil,
+ pending_count: spending_proposals.size
+ },
+ { name: t('geozones.none'),
+ id: 'all',
+ pending_count: spending_proposals.count{|x| x.geozone_id.nil?}
+ }
+ ] + Geozone.all.order(name: :asc).collect do |g|
+ { name: g.name,
+ id: g.id,
+ pending_count: spending_proposals.count{|x| x.geozone_id == g.id}
+ }
+ end
+ end
+
def valuation_params
params[:spending_proposal][:feasible] = nil if params[:spending_proposal][:feasible] == 'nil'
diff --git a/app/views/valuation/spending_proposals/index.html.erb b/app/views/valuation/spending_proposals/index.html.erb
index e6c05d6c7..9f5b13fab 100644
--- a/app/views/valuation/spending_proposals/index.html.erb
+++ b/app/views/valuation/spending_proposals/index.html.erb
@@ -1,14 +1,12 @@
<%= t("valuation.spending_proposals.index.title") %>
- <%= form_tag valuation_spending_proposals_path, method: :get, enforce_utf8: false do %>
-
- <%= select_tag :geozone_id,
- options_for_select(geozone_select_options.unshift([t("geozones.none"), "all"]), params[:geozone_id]),
- { prompt: t("valuation.spending_proposals.index.geozone_filter_all"),
- label: false,
- class: "js-submit-on-change" } %>
-
+ <% @geozone_filters.each do |filter| %>
+
+ <%= link_to valuation_spending_proposals_path(geozone_id: filter[:id]) do %>
+ <%= filter[:name] %>(<%= filter[:pending_count] %>)
+ <% end %>
+
<% end %>
@@ -38,4 +36,4 @@
<% end %>
-<%= paginate @spending_proposals %>
\ No newline at end of file
+<%= paginate @spending_proposals %>
diff --git a/spec/features/valuation/spending_proposals_spec.rb b/spec/features/valuation/spending_proposals_spec.rb
index 8af416dc2..6cb1acf1a 100644
--- a/spec/features/valuation/spending_proposals_spec.rb
+++ b/spec/features/valuation/spending_proposals_spec.rb
@@ -76,17 +76,17 @@ feature 'Valuation spending proposals' do
expect(page).to have_link("Realocate visitors")
expect(page).to have_link("Destroy the city")
- select "District 9", from: "geozone_id"
+ click_link "District 9", exact: false
expect(page).to have_link("Realocate visitors")
expect(page).to_not have_link("Destroy the city")
- select "All city", from: "geozone_id"
+ click_link "All city", exact: false
expect(page).to have_link("Destroy the city")
expect(page).to_not have_link("Realocate visitors")
- select "All zones", from: "geozone_id"
+ click_link "All zones", exact: false
expect(page).to have_link("Realocate visitors")
expect(page).to have_link("Destroy the city")
end
From a887b78787488c7913967d8b6504c4d7cb489ad0 Mon Sep 17 00:00:00 2001
From: Alberto Garcia Cabeza
Date: Wed, 6 Apr 2016 23:48:40 +0200
Subject: [PATCH 0025/1685] Improves styles for valuation geozones select menu
---
app/assets/stylesheets/admin.scss | 13 +++++++++++++
.../valuation/spending_proposals/index.html.erb | 15 +++++++++------
2 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss
index cfec260e1..1ccd7c880 100644
--- a/app/assets/stylesheets/admin.scss
+++ b/app/assets/stylesheets/admin.scss
@@ -355,3 +355,16 @@ body.admin {
width: 100%;
}
}
+
+.admin-content .select-geozone {
+
+ a {
+ display: block;
+
+ &.active {
+ color: $brand;
+ font-weight: bold;
+ text-decoration: underline;
+ }
+ }
+}
diff --git a/app/views/valuation/spending_proposals/index.html.erb b/app/views/valuation/spending_proposals/index.html.erb
index 9f5b13fab..8536ec424 100644
--- a/app/views/valuation/spending_proposals/index.html.erb
+++ b/app/views/valuation/spending_proposals/index.html.erb
@@ -1,12 +1,15 @@
<%= t("valuation.spending_proposals.index.title") %>
-
- <% @geozone_filters.each do |filter| %>
-
- <%= link_to valuation_spending_proposals_path(geozone_id: filter[:id]) do %>
- <%= filter[:name] %>(<%= filter[:pending_count] %>)
+
+ <% @geozone_filters.each_slice(8) do |slice| %>
+
+ <% slice.each do |filter| %>
+ <%= link_to valuation_spending_proposals_path(geozone_id: filter[:id]),
+ class: "#{'active' if params[:geozone_id].to_s == filter[:id].to_s}" do %>
+ <%= filter[:name] %> (<%= filter[:pending_count] %>)
+ <% end %>
<% end %>
-
+
<% end %>
From 3e8150ceae8b6924d51d3301a3356d41f5bff4b8 Mon Sep 17 00:00:00 2001
From: kikito
Date: Thu, 7 Apr 2016 12:16:11 +0200
Subject: [PATCH 0026/1685] hides the not-pending sps in valuation
---
app/controllers/valuation/spending_proposals_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/valuation/spending_proposals_controller.rb b/app/controllers/valuation/spending_proposals_controller.rb
index 77a80b413..83d76e0a0 100644
--- a/app/controllers/valuation/spending_proposals_controller.rb
+++ b/app/controllers/valuation/spending_proposals_controller.rb
@@ -49,7 +49,7 @@ class Valuation::SpendingProposalsController < Valuation::BaseController
id: g.id,
pending_count: spending_proposals.count{|x| x.geozone_id == g.id}
}
- end
+ end.select{ |x| x[:pending_count] > 0 }
end
def valuation_params
From 6f5a23bb4fd02147ed55a304cc823cabd37ede21 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Fri, 8 Apr 2016 11:01:36 +0200
Subject: [PATCH 0027/1685] makes manager a HashWithIndifferentAccess
---
lib/manager_authenticator.rb | 2 +-
spec/support/common_actions.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/manager_authenticator.rb b/lib/manager_authenticator.rb
index 3f0d58357..2d8e6f1f9 100644
--- a/lib/manager_authenticator.rb
+++ b/lib/manager_authenticator.rb
@@ -1,7 +1,7 @@
class ManagerAuthenticator
def initialize(data={})
- @manager = {login: data[:login], user_key: data[:clave_usuario], date: data[:fecha_conexion]}
+ @manager = {login: data[:login], user_key: data[:clave_usuario], date: data[:fecha_conexion]}.with_indifferent_access
end
def auth
diff --git a/spec/support/common_actions.rb b/spec/support/common_actions.rb
index 5a211e5c5..f3d4a8697 100644
--- a/spec/support/common_actions.rb
+++ b/spec/support/common_actions.rb
@@ -27,7 +27,7 @@ module CommonActions
def login_as_manager
login, user_key, date = "JJB042", "31415926", Time.now.strftime("%Y%m%d%H%M%S")
- allow_any_instance_of(ManagerAuthenticator).to receive(:auth).and_return({login: login, user_key: user_key, date: date})
+ allow_any_instance_of(ManagerAuthenticator).to receive(:auth).and_return({login: login, user_key: user_key, date: date}.with_indifferent_access)
visit management_sign_in_path(login: login, clave_usuario: user_key, fecha_conexion: date)
end
From ce477273da280fc78426d2e3e582c483f988412f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Fri, 8 Apr 2016 11:03:30 +0200
Subject: [PATCH 0028/1685] adds managers option to delete a level 2 account
---
.../management/users_controller.rb | 6 +++++
.../document_verifications/new.html.erb | 11 ++++++++
config/locales/management.en.yml | 6 +++++
config/locales/management.es.yml | 6 +++++
config/routes.rb | 5 +++-
spec/features/management/users_spec.rb | 27 ++++++++++++++++++-
6 files changed, 59 insertions(+), 2 deletions(-)
diff --git a/app/controllers/management/users_controller.rb b/app/controllers/management/users_controller.rb
index 53c432fd1..8ee04cfdf 100644
--- a/app/controllers/management/users_controller.rb
+++ b/app/controllers/management/users_controller.rb
@@ -18,6 +18,12 @@ class Management::UsersController < Management::BaseController
end
end
+ def erase
+ managed_user.erase(t("management.users.erased_by_manager", manager: current_manager['login'])) if current_manager.present?
+ destroy_session
+ redirect_to management_document_verifications_path, notice: t("management.users.erased_notice")
+ end
+
def logout
destroy_session
redirect_to management_root_url, notice: t("management.sessions.signed_out_managed_user")
diff --git a/app/views/management/document_verifications/new.html.erb b/app/views/management/document_verifications/new.html.erb
index 068d84f41..100c2592e 100644
--- a/app/views/management/document_verifications/new.html.erb
+++ b/app/views/management/document_verifications/new.html.erb
@@ -13,3 +13,14 @@
<%= f.hidden_field :document_number %>
<%= f.submit t("management.document_verifications.verify"), class: "button success" %>
<% end %>
+
+
+<%= link_to t("management.document_verifications.erase_account_link"), "#", class: "delete js-toggle-link", data: { "toggle-selector" => "#erase-account-form" } %>
+
+
diff --git a/config/locales/management.en.yml b/config/locales/management.en.yml
index 3f9a447b0..fb9929924 100644
--- a/config/locales/management.en.yml
+++ b/config/locales/management.en.yml
@@ -24,6 +24,10 @@ en:
title: User management
under_age: You must be over 16 to verify your account.
verify: Verify
+ erase_account_link: Delete user
+ erase_account_confirm: Are you sure you want to erase the account? This action can not be undone
+ erase_warning: This action can not be undone. Please make sure you want to erase this account.
+ erase_submit: Delete account
email_label: Email
email_verifications:
already_verified: This user account is already verified.
@@ -84,3 +88,5 @@ en:
create_user_info: 'We will create an account with the following data:'
create_user_submit: Create user
create_user_success_html: We have sent an email to the email address %{email} in order to verify that it belongs to this user. It contains a link they have to click. Then they will have to set their access password before being able to log in to the website
+ erased_notice: User account deleted.
+ erased_by_manager: "Deleted by manager: %{manager}"
diff --git a/config/locales/management.es.yml b/config/locales/management.es.yml
index 540bad027..262108652 100644
--- a/config/locales/management.es.yml
+++ b/config/locales/management.es.yml
@@ -24,6 +24,10 @@ es:
title: Gestión de usuarios
under_age: Debes ser mayor de 16 años para verificar tu cuenta.
verify: Verificar usuario
+ erase_account_link: Borrar cuenta
+ erase_account_confirm: ¿Seguro que quieres borrar a este usuario? Esta acción no se puede deshacer
+ erase_warning: Esta acción no se puede deshacer. Por favor asegurese de que quiere eliminar esta cuenta.
+ erase_submit: Borrar cuenta
email_label: Email
email_verifications:
already_verified: Esta cuenta de usuario ya está verificada.
@@ -84,3 +88,5 @@ es:
create_user_info: 'Procedemos a crear un usuario con la siguiente información:'
create_user_submit: Crear usuario
create_user_success_html: Hemos enviado un correo electrónico a %{email} para verificar que es suya. El correo enviado contiene un link que el usuario deberá pulsar. Entonces podrá seleccionar una clave de acceso, y entrar en la web de participación.
+ erased_notice: Cuenta de usuario borrada.
+ erased_by_manager: "Borrada por el manager: %{manager}"
diff --git a/config/routes.rb b/config/routes.rb
index 92bdf8601..b38823a65 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -214,7 +214,10 @@ Rails.application.routes.draw do
resources :email_verifications, only: [:new, :create]
resources :users, only: [:new, :create] do
- delete :logout, on: :collection
+ collection do
+ delete :logout
+ delete :erase
+ end
end
get 'sign_in', to: 'sessions#create'
diff --git a/spec/features/management/users_spec.rb b/spec/features/management/users_spec.rb
index 31e4bbeeb..83ac9248a 100644
--- a/spec/features/management/users_spec.rb
+++ b/spec/features/management/users_spec.rb
@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'users' do
- scenario 'Creating a level 3 user from scratch' do
+ scenario 'Create a level 3 user from scratch' do
login_as_manager
@@ -42,4 +42,29 @@ feature 'users' do
expect(page).to have_content "Your account has been confirmed."
end
+ scenario 'Delete a level 2 user account from document verification page', :js do
+ level_2_user = create(:user, :level_two, document_number: 13579)
+ login_as_manager
+
+ visit management_document_verifications_path
+ fill_in 'document_verification_document_number', with: '13579'
+ click_button 'Check'
+
+ expect(page).to_not have_content "This user account is already verified."
+ expect(page).to have_content "This user can participate in the website with the following permissions"
+
+ click_link "Delete user"
+ click_link "Delete account"
+
+ expect(page).to have_content "User account deleted."
+
+ expect(level_2_user.reload.erase_reason).to eq "Deleted by manager: JJB042"
+
+ visit management_document_verifications_path
+ fill_in 'document_verification_document_number', with: '13579'
+ click_button 'Check'
+
+ expect(page).to have_content "no user account associated to it"
+ end
+
end
\ No newline at end of file
From e4e87bf548e306fcfd1aa7a57cedf8d3655ea5fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baza=CC=81n?=
Date: Fri, 8 Apr 2016 11:38:58 +0200
Subject: [PATCH 0029/1685] moves user deletion link to a partial
---
.../management/document_verifications/new.html.erb | 11 +----------
.../management/users/_erase_user_account.html.erb | 9 +++++++++
config/locales/management.en.yml | 8 ++++----
config/locales/management.es.yml | 8 ++++----
4 files changed, 18 insertions(+), 18 deletions(-)
create mode 100644 app/views/management/users/_erase_user_account.html.erb
diff --git a/app/views/management/document_verifications/new.html.erb b/app/views/management/document_verifications/new.html.erb
index 100c2592e..1c1b5778d 100644
--- a/app/views/management/document_verifications/new.html.erb
+++ b/app/views/management/document_verifications/new.html.erb
@@ -14,13 +14,4 @@
<%= f.submit t("management.document_verifications.verify"), class: "button success" %>
<% end %>
-
-<%= link_to t("management.document_verifications.erase_account_link"), "#", class: "delete js-toggle-link", data: { "toggle-selector" => "#erase-account-form" } %>
-
-
+<%= render 'management/users/erase_user_account' %>
\ No newline at end of file
diff --git a/app/views/management/users/_erase_user_account.html.erb b/app/views/management/users/_erase_user_account.html.erb
new file mode 100644
index 000000000..af2e3b75b
--- /dev/null
+++ b/app/views/management/users/_erase_user_account.html.erb
@@ -0,0 +1,9 @@
+<%= link_to t("management.users.erase_account_link"), "#", class: "delete js-toggle-link", data: { "toggle-selector" => "#erase-account-form" } %>
+
+
\ No newline at end of file
diff --git a/config/locales/management.en.yml b/config/locales/management.en.yml
index fb9929924..252d77938 100644
--- a/config/locales/management.en.yml
+++ b/config/locales/management.en.yml
@@ -24,10 +24,6 @@ en:
title: User management
under_age: You must be over 16 to verify your account.
verify: Verify
- erase_account_link: Delete user
- erase_account_confirm: Are you sure you want to erase the account? This action can not be undone
- erase_warning: This action can not be undone. Please make sure you want to erase this account.
- erase_submit: Delete account
email_label: Email
email_verifications:
already_verified: This user account is already verified.
@@ -90,3 +86,7 @@ en:
create_user_success_html: We have sent an email to the email address %{email} in order to verify that it belongs to this user. It contains a link they have to click. Then they will have to set their access password before being able to log in to the website
erased_notice: User account deleted.
erased_by_manager: "Deleted by manager: %{manager}"
+ erase_account_link: Delete user
+ erase_account_confirm: Are you sure you want to erase the account? This action can not be undone
+ erase_warning: This action can not be undone. Please make sure you want to erase this account.
+ erase_submit: Delete account
diff --git a/config/locales/management.es.yml b/config/locales/management.es.yml
index 262108652..4b3b9ae59 100644
--- a/config/locales/management.es.yml
+++ b/config/locales/management.es.yml
@@ -24,10 +24,6 @@ es:
title: Gestión de usuarios
under_age: Debes ser mayor de 16 años para verificar tu cuenta.
verify: Verificar usuario
- erase_account_link: Borrar cuenta
- erase_account_confirm: ¿Seguro que quieres borrar a este usuario? Esta acción no se puede deshacer
- erase_warning: Esta acción no se puede deshacer. Por favor asegurese de que quiere eliminar esta cuenta.
- erase_submit: Borrar cuenta
email_label: Email
email_verifications:
already_verified: Esta cuenta de usuario ya está verificada.
@@ -90,3 +86,7 @@ es:
create_user_success_html: Hemos enviado un correo electrónico a %{email} para verificar que es suya. El correo enviado contiene un link que el usuario deberá pulsar. Entonces podrá seleccionar una clave de acceso, y entrar en la web de participación.
erased_notice: Cuenta de usuario borrada.
erased_by_manager: "Borrada por el manager: %{manager}"
+ erase_account_link: Borrar cuenta
+ erase_account_confirm: ¿Seguro que quieres borrar a este usuario? Esta acción no se puede deshacer
+ erase_warning: Esta acción no se puede deshacer. Por favor asegurese de que quiere eliminar esta cuenta.
+ erase_submit: Borrar cuenta
From 83e58f0cc9f72e165d8e9ce44597dea667048ced Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Fri, 8 Apr 2016 11:43:26 +0200
Subject: [PATCH 0030/1685] adds account section to management for now it only
has the option to delete account
---
.../management/account_controller.rb | 19 +++++++++++
app/views/management/_menu.html.erb | 7 ++++
app/views/management/account/show.html.erb | 3 ++
config/locales/management.en.yml | 6 ++++
config/locales/management.es.yml | 6 ++++
config/routes.rb | 2 ++
spec/features/management/account_spec.rb | 32 +++++++++++++++++++
spec/features/management/users_spec.rb | 9 +++---
8 files changed, 80 insertions(+), 4 deletions(-)
create mode 100644 app/controllers/management/account_controller.rb
create mode 100644 app/views/management/account/show.html.erb
create mode 100644 spec/features/management/account_spec.rb
diff --git a/app/controllers/management/account_controller.rb b/app/controllers/management/account_controller.rb
new file mode 100644
index 000000000..b3b79a8e9
--- /dev/null
+++ b/app/controllers/management/account_controller.rb
@@ -0,0 +1,19 @@
+class Management::AccountController < Management::BaseController
+
+ before_action :check_verified_user
+
+ def show
+ end
+
+ private
+ def check_verified_user
+ unless current_user.level_two_or_three_verified?
+ redirect_to management_document_verifications_path, alert: t("management.account.alert.unverified_user")
+ end
+ end
+
+ def current_user
+ managed_user
+ end
+
+end
diff --git a/app/views/management/_menu.html.erb b/app/views/management/_menu.html.erb
index 0106865d2..00e3b0516 100644
--- a/app/views/management/_menu.html.erb
+++ b/app/views/management/_menu.html.erb
@@ -13,6 +13,13 @@
<% end %>
+ >
+ <%= link_to management_account_path do %>
+
+ <%= t("management.menu.edit_user_accounts") %>
+ <% end %>
+
+
>
<%= link_to new_management_proposal_path do %>
diff --git a/app/views/management/account/show.html.erb b/app/views/management/account/show.html.erb
new file mode 100644
index 000000000..09287ee3e
--- /dev/null
+++ b/app/views/management/account/show.html.erb
@@ -0,0 +1,3 @@
+<%= t("management.account.show.title") %>
+
+<%= render 'management/users/erase_user_account' %>
diff --git a/config/locales/management.en.yml b/config/locales/management.en.yml
index 252d77938..2c13d4d19 100644
--- a/config/locales/management.en.yml
+++ b/config/locales/management.en.yml
@@ -1,6 +1,11 @@
---
en:
management:
+ account:
+ alert:
+ unverified_user: No verified user logged in yet
+ show:
+ title: User account
account_info:
change_user: Change user
document_number_label: 'Document number:'
@@ -45,6 +50,7 @@ en:
support_spending_proposals: Support spending proposals
title: Management
users: Users
+ edit_user_accounts: Edit user account
permissions:
create_proposals: Create proposals
debates: Engage in debates
diff --git a/config/locales/management.es.yml b/config/locales/management.es.yml
index 4b3b9ae59..04a7ba352 100644
--- a/config/locales/management.es.yml
+++ b/config/locales/management.es.yml
@@ -1,6 +1,11 @@
---
es:
management:
+ account:
+ alert:
+ unverified_user: Solo se pueden editar cuentas de usuarios verificados
+ show:
+ title: Cuenta de usuario
account_info:
change_user: Cambiar usuario
document_number_label: 'Número de documento:'
@@ -45,6 +50,7 @@ es:
support_spending_proposals: Apoyar propts. de inversión
title: Gestión
users: Usuarios
+ edit_user_accounts: Editar cuenta de usuario
permissions:
create_proposals: Crear nuevas propuestas
debates: Participar en debates
diff --git a/config/routes.rb b/config/routes.rb
index b38823a65..dd4281788 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -220,6 +220,8 @@ Rails.application.routes.draw do
end
end
+ resource :account, controller: "account", only: [:show]
+
get 'sign_in', to: 'sessions#create'
resource :session, only: [:create, :destroy]
diff --git a/spec/features/management/account_spec.rb b/spec/features/management/account_spec.rb
new file mode 100644
index 000000000..3b9951d41
--- /dev/null
+++ b/spec/features/management/account_spec.rb
@@ -0,0 +1,32 @@
+require 'rails_helper'
+
+feature 'Account' do
+
+ background do
+ login_as_manager
+ end
+
+ scenario "Should not allow unverified users to create spending proposals" do
+ user = create(:user)
+ login_managed_user(user)
+
+ click_link "Edit user account"
+
+ expect(page).to have_content "No verified user logged in yet"
+ end
+
+ scenario 'Delete a user account', :js do
+ user = create(:user, :level_two)
+ login_managed_user(user)
+
+ visit management_account_path
+
+ click_link "Delete user"
+ click_link "Delete account"
+
+ expect(page).to have_content "User account deleted."
+
+ expect(user.reload.erase_reason).to eq "Deleted by manager: JJB042"
+ end
+
+end
\ No newline at end of file
diff --git a/spec/features/management/users_spec.rb b/spec/features/management/users_spec.rb
index 83ac9248a..021edaaad 100644
--- a/spec/features/management/users_spec.rb
+++ b/spec/features/management/users_spec.rb
@@ -1,11 +1,13 @@
require 'rails_helper'
-feature 'users' do
+feature 'Users' do
+
+ background do
+ login_as_manager
+ end
scenario 'Create a level 3 user from scratch' do
- login_as_manager
-
visit management_document_verifications_path
fill_in 'document_verification_document_number', with: '1234'
click_button 'Check'
@@ -44,7 +46,6 @@ feature 'users' do
scenario 'Delete a level 2 user account from document verification page', :js do
level_2_user = create(:user, :level_two, document_number: 13579)
- login_as_manager
visit management_document_verifications_path
fill_in 'document_verification_document_number', with: '13579'
From 473cca418dfae958ec1ee55bf5a6f7228aba290b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Fri, 8 Apr 2016 11:47:56 +0200
Subject: [PATCH 0031/1685] updates management's dashboard index
---
app/views/management/dashboard/index.html.erb | 10 +---------
config/locales/management.en.yml | 1 +
config/locales/management.es.yml | 1 +
3 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/app/views/management/dashboard/index.html.erb b/app/views/management/dashboard/index.html.erb
index 4145592d8..e32a46d0e 100644
--- a/app/views/management/dashboard/index.html.erb
+++ b/app/views/management/dashboard/index.html.erb
@@ -1,14 +1,6 @@
<%= t("management.dashboard.index.title") %>
-
Desde aquí puedes gestionar usuarios a través de las siguientes acciones:
-
-
Usuarios
-
-
Crear propuesta
-
-
Apoyar propuesta
-
-
Imprimir propuestas
+
<%= t("management.dashboard.index.info") %>
diff --git a/config/locales/management.en.yml b/config/locales/management.en.yml
index 2c13d4d19..74a58ac26 100644
--- a/config/locales/management.en.yml
+++ b/config/locales/management.en.yml
@@ -17,6 +17,7 @@ en:
dashboard:
index:
title: Management
+ info: Here you can manage users through all actions listed in the left menu.
document_number: Document number
document_type_label: Document type
document_verifications:
diff --git a/config/locales/management.es.yml b/config/locales/management.es.yml
index 04a7ba352..c4545e675 100644
--- a/config/locales/management.es.yml
+++ b/config/locales/management.es.yml
@@ -17,6 +17,7 @@ es:
dashboard:
index:
title: Gestión
+ info: Desde aquí puedes gestionar usuarios a través de las acciones listadas en el menú de la izquierda.
document_number: Número de documento
document_type_label: Tipo de documento
document_verifications:
From 991b189610b2087c6bf5b6c2605cbecba8dac58a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Fri, 8 Apr 2016 12:16:09 +0200
Subject: [PATCH 0032/1685] refactors triplicated code
---
app/controllers/management/account_controller.rb | 12 +++---------
app/controllers/management/base_controller.rb | 10 ++++++++++
app/controllers/management/proposals_controller.rb | 12 +++---------
.../management/spending_proposals_controller.rb | 12 +++---------
4 files changed, 19 insertions(+), 27 deletions(-)
diff --git a/app/controllers/management/account_controller.rb b/app/controllers/management/account_controller.rb
index b3b79a8e9..85b9feea4 100644
--- a/app/controllers/management/account_controller.rb
+++ b/app/controllers/management/account_controller.rb
@@ -1,19 +1,13 @@
class Management::AccountController < Management::BaseController
- before_action :check_verified_user
+ before_action :only_verified_users
def show
end
private
- def check_verified_user
- unless current_user.level_two_or_three_verified?
- redirect_to management_document_verifications_path, alert: t("management.account.alert.unverified_user")
- end
- end
-
- def current_user
- managed_user
+ def only_verified_users
+ check_verified_user t("management.account.alert.unverified_user")
end
end
diff --git a/app/controllers/management/base_controller.rb b/app/controllers/management/base_controller.rb
index bced745b4..f01bbebbc 100644
--- a/app/controllers/management/base_controller.rb
+++ b/app/controllers/management/base_controller.rb
@@ -20,6 +20,16 @@ class Management::BaseController < ActionController::Base
@managed_user ||= Verification::Management::ManagedUser.find(session[:document_type], session[:document_number])
end
+ def current_user
+ managed_user
+ end
+
+ def check_verified_user(alert_msg)
+ unless current_user.level_two_or_three_verified?
+ redirect_to management_document_verifications_path, alert: alert_msg
+ end
+ end
+
def set_locale
if params[:locale] && I18n.available_locales.include?(params[:locale].to_sym)
session[:locale] = params[:locale]
diff --git a/app/controllers/management/proposals_controller.rb b/app/controllers/management/proposals_controller.rb
index 6e01a8c77..3f4284a06 100644
--- a/app/controllers/management/proposals_controller.rb
+++ b/app/controllers/management/proposals_controller.rb
@@ -2,7 +2,7 @@ class Management::ProposalsController < Management::BaseController
include HasOrders
include CommentableActions
- before_action :check_verified_user, except: :print
+ before_action :only_verified_users, except: :print
before_action :set_proposal, only: [:vote, :show]
before_action :parse_search_terms, only: :index
before_action :load_categories, only: [:new, :edit]
@@ -40,14 +40,8 @@ class Management::ProposalsController < Management::BaseController
Proposal
end
- def check_verified_user
- unless current_user.level_two_or_three_verified?
- redirect_to management_document_verifications_path, alert: t("management.proposals.alert.unverified_user")
- end
- end
-
- def current_user
- managed_user
+ def only_verified_users
+ check_verified_user t("management.proposals.alert.unverified_user")
end
### Duplicated in application_controller. Move to a concern.
diff --git a/app/controllers/management/spending_proposals_controller.rb b/app/controllers/management/spending_proposals_controller.rb
index 18d013c57..49378ca63 100644
--- a/app/controllers/management/spending_proposals_controller.rb
+++ b/app/controllers/management/spending_proposals_controller.rb
@@ -1,6 +1,6 @@
class Management::SpendingProposalsController < Management::BaseController
- before_action :check_verified_user, except: :print
+ before_action :only_verified_users, except: :print
before_action :set_spending_proposal, only: [:vote, :show]
def index
@@ -48,14 +48,8 @@ class Management::SpendingProposalsController < Management::BaseController
params.require(:spending_proposal).permit(:title, :description, :external_url, :geozone_id, :terms_of_service, :captcha, :captcha_key)
end
- def check_verified_user
- unless current_user.level_two_or_three_verified?
- redirect_to management_document_verifications_path, alert: t("management.spending_proposals.alert.unverified_user")
- end
- end
-
- def current_user
- managed_user
+ def only_verified_users
+ check_verified_user t("management.spending_proposals.alert.unverified_user")
end
# This should not be necessary. Maybe we could create a specific show view for managers.
From 61b2c087b6cd558eeaa2bd916a48e5bd1f62474f Mon Sep 17 00:00:00 2001
From: kikito
Date: Fri, 8 Apr 2016 17:45:20 +0200
Subject: [PATCH 0033/1685] changes the responsible_name from username to
document_number
---
app/models/spending_proposal.rb | 2 +-
spec/models/spending_proposal_spec.rb | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/models/spending_proposal.rb b/app/models/spending_proposal.rb
index f4657e9d4..c49b745e1 100644
--- a/app/models/spending_proposal.rb
+++ b/app/models/spending_proposal.rb
@@ -123,7 +123,7 @@ class SpendingProposal < ActiveRecord::Base
end
def set_responsible_name
- self.responsible_name = author.try(:username)
+ self.responsible_name = author.try(:document_number)
end
end
diff --git a/spec/models/spending_proposal_spec.rb b/spec/models/spending_proposal_spec.rb
index d841abf06..3d32e383b 100644
--- a/spec/models/spending_proposal_spec.rb
+++ b/spec/models/spending_proposal_spec.rb
@@ -262,10 +262,10 @@ describe SpendingProposal do
end
describe "responsible_name" do
- it "gets updated with the user name" do
- u = create(:user, username: "manolo")
+ it "gets updated with the document_number" do
+ u = create(:user, document_number: "123456")
sp = create(:spending_proposal, author: u)
- expect(sp.responsible_name).to eq("manolo")
+ expect(sp.responsible_name).to eq("123456")
end
end
From 5fec3b9858bf97ec729b94077aca7c90dfcbbb81 Mon Sep 17 00:00:00 2001
From: kikito
Date: Mon, 11 Apr 2016 12:21:11 +0200
Subject: [PATCH 0034/1685] persists responsible name, even if the user is
erased
---
app/models/spending_proposal.rb | 2 +-
spec/models/spending_proposal_spec.rb | 14 +++++++++++---
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/app/models/spending_proposal.rb b/app/models/spending_proposal.rb
index c49b745e1..69d4d839f 100644
--- a/app/models/spending_proposal.rb
+++ b/app/models/spending_proposal.rb
@@ -123,7 +123,7 @@ class SpendingProposal < ActiveRecord::Base
end
def set_responsible_name
- self.responsible_name = author.try(:document_number)
+ self.responsible_name = author.try(:document_number) if author.try(:document_number).present?
end
end
diff --git a/spec/models/spending_proposal_spec.rb b/spec/models/spending_proposal_spec.rb
index 3d32e383b..ba18287e6 100644
--- a/spec/models/spending_proposal_spec.rb
+++ b/spec/models/spending_proposal_spec.rb
@@ -262,10 +262,18 @@ describe SpendingProposal do
end
describe "responsible_name" do
+ let(:user) { create(:user, document_number: "123456") }
+ let!(:spending_proposal) { create(:spending_proposal, author: user) }
+
it "gets updated with the document_number" do
- u = create(:user, document_number: "123456")
- sp = create(:spending_proposal, author: u)
- expect(sp.responsible_name).to eq("123456")
+ expect(spending_proposal.responsible_name).to eq("123456")
+ end
+
+ it "does not get updated if the user is erased" do
+ user.erase
+ expect(user.document_number).to be_blank
+ spending_proposal.touch
+ expect(spending_proposal.responsible_name).to eq("123456")
end
end
From 3087b2dac9fadda4085c23b5def49cfe10020924 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Mon, 11 Apr 2016 16:12:03 +0200
Subject: [PATCH 0035/1685] changes default order in valuation/sps to votes up
---
.../valuation/spending_proposals_controller.rb | 3 +--
db/schema.rb | 10 +++++-----
.../features/valuation/spending_proposals_spec.rb | 15 +++++++++++++++
3 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/app/controllers/valuation/spending_proposals_controller.rb b/app/controllers/valuation/spending_proposals_controller.rb
index 83d76e0a0..d3bc585b1 100644
--- a/app/controllers/valuation/spending_proposals_controller.rb
+++ b/app/controllers/valuation/spending_proposals_controller.rb
@@ -11,7 +11,7 @@ class Valuation::SpendingProposalsController < Valuation::BaseController
def index
@geozone_filters = geozone_filters
if current_user.valuator?
- @spending_proposals = SpendingProposal.scoped_filter(params_for_current_valuator, @current_filter).order(created_at: :desc).page(params[:page])
+ @spending_proposals = SpendingProposal.scoped_filter(params_for_current_valuator, @current_filter).order(cached_votes_up: :desc).page(params[:page])
else
@spending_proposals = SpendingProposal.none.page(params[:page])
end
@@ -33,7 +33,6 @@ class Valuation::SpendingProposalsController < Valuation::BaseController
private
def geozone_filters
-
spending_proposals = SpendingProposal.by_valuator(current_user.valuator.try(:id)).valuation_open.all.to_a
[ { name: t('valuation.spending_proposals.index.geozone_filter_all'),
diff --git a/db/schema.rb b/db/schema.rb
index 4183e0246..e86f4db3b 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -296,8 +296,8 @@ ActiveRecord::Schema.define(version: 20160406163649) do
t.text "description"
t.integer "author_id"
t.string "external_url"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.integer "geozone_id"
t.integer "price", limit: 8
t.boolean "feasible"
@@ -305,14 +305,14 @@ ActiveRecord::Schema.define(version: 20160406163649) do
t.text "price_explanation"
t.text "feasible_explanation"
t.text "internal_comments"
- t.boolean "valuation_finished", default: false
+ t.boolean "valuation_finished", default: false
t.text "explanations_log"
t.integer "administrator_id"
- t.integer "valuation_assignments_count", default: 0
+ t.integer "valuation_assignments_count", default: 0
t.integer "price_first_year", limit: 8
t.string "time_scope"
t.datetime "unfeasible_email_sent_at"
- t.integer "cached_votes_up", default: 0
+ t.integer "cached_votes_up", default: 0
t.tsvector "tsv"
t.string "responsible_name", limit: 60
end
diff --git a/spec/features/valuation/spending_proposals_spec.rb b/spec/features/valuation/spending_proposals_spec.rb
index 6cb1acf1a..98037607c 100644
--- a/spec/features/valuation/spending_proposals_spec.rb
+++ b/spec/features/valuation/spending_proposals_spec.rb
@@ -37,6 +37,21 @@ feature 'Valuation spending proposals' do
expect(page).to_not have_content(spending_proposal2.title)
end
+ scenario 'Index orders spending proposals by votes' do
+ spending_proposal10 = create(:spending_proposal, cached_votes_up: 10)
+ spending_proposal100 = create(:spending_proposal, cached_votes_up: 100)
+ spending_proposal1 = create(:spending_proposal, cached_votes_up: 1)
+
+ spending_proposal1.valuators << @valuator
+ spending_proposal10.valuators << @valuator
+ spending_proposal100.valuators << @valuator
+
+ visit valuation_spending_proposals_path
+
+ expect(spending_proposal100.title).to appear_before(spending_proposal10.title)
+ expect(spending_proposal10.title).to appear_before(spending_proposal1.title)
+ end
+
scenario 'Index shows assignments info' do
spending_proposal1 = create(:spending_proposal)
spending_proposal2 = create(:spending_proposal)
From 3b754fd998741b230a9ac5e686178dcf86aaf219 Mon Sep 17 00:00:00 2001
From: kikito
Date: Mon, 11 Apr 2016 18:28:28 +0200
Subject: [PATCH 0036/1685] Adds two new fields to user
---
db/migrate/20160411161531_add_genre_and_dob_to_users.rb | 6 ++++++
db/schema.rb | 4 +++-
2 files changed, 9 insertions(+), 1 deletion(-)
create mode 100644 db/migrate/20160411161531_add_genre_and_dob_to_users.rb
diff --git a/db/migrate/20160411161531_add_genre_and_dob_to_users.rb b/db/migrate/20160411161531_add_genre_and_dob_to_users.rb
new file mode 100644
index 000000000..aa8100fa3
--- /dev/null
+++ b/db/migrate/20160411161531_add_genre_and_dob_to_users.rb
@@ -0,0 +1,6 @@
+class AddGenreAndDobToUsers < ActiveRecord::Migration
+ def change
+ add_column :users, :genre, :string, index: true, limit: 10
+ add_column :users, :date_of_birth, :datetime, index: true
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index e86f4db3b..cd05a0d2f 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20160406163649) do
+ActiveRecord::Schema.define(version: 20160411161531) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -422,6 +422,8 @@ ActiveRecord::Schema.define(version: 20160406163649) do
t.string "oauth_email"
t.integer "geozone_id"
t.string "redeemable_code"
+ t.string "genre", limit: 10
+ t.datetime "date_of_birth"
end
add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree
From 9cc831bbc10873e8fc2e9384a5694f79d2b80082 Mon Sep 17 00:00:00 2001
From: kikito
Date: Mon, 11 Apr 2016 18:41:33 +0200
Subject: [PATCH 0037/1685] adds genre to the census api response
---
lib/census_api.rb | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/census_api.rb b/lib/census_api.rb
index 737f7f873..9bcde62be 100644
--- a/lib/census_api.rb
+++ b/lib/census_api.rb
@@ -49,6 +49,10 @@ class CensusApi
data[:datos_vivienda][:item][:codigo_distrito]
end
+ def genre # "Varón" or "Mujer"
+ data[:datos_habitante][:item][:descripcion_sexo]
+ end
+
private
def data
@@ -86,7 +90,7 @@ class CensusApi
end
def stubbed_response_body
- {:get_habita_datos_response=>{:get_habita_datos_return=>{:hay_errores=>false, :datos_habitante=>{:item=>{:fecha_nacimiento_string=>"31-12-1980", :identificador_documento=>"12345678Z", }}, :datos_vivienda=>{:item=>{:codigo_postal=>"28013", :codigo_distrito=>"01"}}}}}
+ {get_habita_datos_response: {get_habita_datos_return: {hay_errores: false, datos_habitante: { item: {fecha_nacimiento_string: "31-12-1980", identificador_documento: "12345678Z", description_sexo: "Varón" }}, datos_vivienda: {item: {codigo_postal: "28013", codigo_distrito: "01"}}}}}
end
def is_dni?(document_type)
From 622909703217b15b20f359319fcf6acf1d8ded91 Mon Sep 17 00:00:00 2001
From: kikito
Date: Tue, 12 Apr 2016 13:38:01 +0200
Subject: [PATCH 0038/1685] Fixes typo
---
lib/census_api.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/census_api.rb b/lib/census_api.rb
index 9bcde62be..c53e703fb 100644
--- a/lib/census_api.rb
+++ b/lib/census_api.rb
@@ -90,7 +90,7 @@ class CensusApi
end
def stubbed_response_body
- {get_habita_datos_response: {get_habita_datos_return: {hay_errores: false, datos_habitante: { item: {fecha_nacimiento_string: "31-12-1980", identificador_documento: "12345678Z", description_sexo: "Varón" }}, datos_vivienda: {item: {codigo_postal: "28013", codigo_distrito: "01"}}}}}
+ {get_habita_datos_response: {get_habita_datos_return: {hay_errores: false, datos_habitante: { item: {fecha_nacimiento_string: "31-12-1980", identificador_documento: "12345678Z", descripcion_sexo: "Varón" }}, datos_vivienda: {item: {codigo_postal: "28013", codigo_distrito: "01"}}}}}
end
def is_dni?(document_type)
From 2c51115d6d7a31742a468a8908e612d7efde04c9 Mon Sep 17 00:00:00 2001
From: kikito
Date: Tue, 12 Apr 2016 13:38:39 +0200
Subject: [PATCH 0039/1685] Residence Verification now fills up the date of
birth and genre
---
app/models/verification/residence.rb | 11 +++++++++++
spec/models/residence_spec.rb | 6 +++++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/app/models/verification/residence.rb b/app/models/verification/residence.rb
index 0c1ed5f9a..1f5ce4bfd 100644
--- a/app/models/verification/residence.rb
+++ b/app/models/verification/residence.rb
@@ -31,6 +31,8 @@ class Verification::Residence
user.update(document_number: document_number,
document_type: document_type,
geozone: self.geozone,
+ date_of_birth: date_of_birth.to_datetime,
+ genre: genre,
residence_verified_at: Time.now)
end
@@ -75,6 +77,15 @@ class Verification::Residence
@census_api_response.district_code
end
+ def genre
+ case @census_api_response.genre
+ when "Varón"
+ "male"
+ when "Mujer"
+ "female"
+ end
+ end
+
private
def call_census_api
diff --git a/spec/models/residence_spec.rb b/spec/models/residence_spec.rb
index fbc33d39c..faa81b5c3 100644
--- a/spec/models/residence_spec.rb
+++ b/spec/models/residence_spec.rb
@@ -85,7 +85,7 @@ describe Verification::Residence do
describe "save" do
- it "should store document number, document type, and geozone" do
+ it "should store document number, document type, geozone, date of birth and genre" do
user = create(:user)
residence.user = user
residence.save
@@ -93,6 +93,10 @@ describe Verification::Residence do
user.reload
expect(user.document_number).to eq('12345678Z')
expect(user.document_type).to eq("1")
+ expect(user.date_of_birth.year).to eq(1980)
+ expect(user.date_of_birth.month).to eq(12)
+ expect(user.date_of_birth.day).to eq(31)
+ expect(user.genre).to eq('male')
expect(user.geozone).to eq(geozone)
end
From 0ae97eada8b1401fd2e6b33e9f5c85cd369bcfc0 Mon Sep 17 00:00:00 2001
From: kikito
Date: Tue, 12 Apr 2016 17:06:50 +0200
Subject: [PATCH 0040/1685] adds rake task to assign demographic info to users
---
lib/tasks/users.rake | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/lib/tasks/users.rake b/lib/tasks/users.rake
index 0ce4cdfee..50f96e592 100644
--- a/lib/tasks/users.rake
+++ b/lib/tasks/users.rake
@@ -40,5 +40,23 @@ namespace :users do
end
end
+ desc "Associates demographic information to users"
+ task assign_demographic: :environment do
+ User.residence_verified.where(genre: nil).find_each do |u|
+ begin
+ response = CensusApi.new.call(u.document_type, u.document_number)
+ if response.valid?
+ u.genre = response.genre == 'Varón' ? 'male' : 'female'
+ u.date_of_birth = response.date_of_birth.to_datetime
+ u.save
+ print "."
+ else
+ print "X"
+ end
+ rescue
+ puts "Could not assign genre/dob for user: #{u.id}"
+ end
+ end
+ end
end
From bcc687d9479426ad4068fb544baf53c5b2bd5b3b Mon Sep 17 00:00:00 2001
From: rgarcia
Date: Tue, 12 Apr 2016 17:17:02 +0200
Subject: [PATCH 0041/1685] adds filtering of spending proposals by valuator
---
.../admin/spending_proposals/index.html.erb | 9 ++++
config/locales/admin.en.yml | 1 +
config/locales/admin.es.yml | 1 +
.../features/admin/spending_proposals_spec.rb | 46 +++++++++++++++++++
4 files changed, 57 insertions(+)
diff --git a/app/views/admin/spending_proposals/index.html.erb b/app/views/admin/spending_proposals/index.html.erb
index f50dea628..a4a1a68c6 100644
--- a/app/views/admin/spending_proposals/index.html.erb
+++ b/app/views/admin/spending_proposals/index.html.erb
@@ -9,6 +9,15 @@
label: false,
class: "js-submit-on-change" } %>
+
+
+ <%= select_tag :valuator_id,
+ options_for_select(valuator_select_options, params[:valuator_id]),
+ { prompt: t("admin.spending_proposals.index.valuator_filter_all"),
+ label: false,
+ class: "js-submit-on-change" } %>
+
+
<%= select_tag :geozone_id,
options_for_select(geozone_select_options.unshift([t("geozones.none"), "all"]), params[:geozone_id]),
diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml
index 33d3c8434..3c4c2f24e 100755
--- a/config/locales/admin.en.yml
+++ b/config/locales/admin.en.yml
@@ -155,6 +155,7 @@ en:
index:
geozone_filter_all: All zones
administrator_filter_all: All administrators
+ valuator_filter_all: All valuators
tags_filter_all: All tags
filters:
valuation_open: Open
diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml
index ec0fa5483..5d7017336 100644
--- a/config/locales/admin.es.yml
+++ b/config/locales/admin.es.yml
@@ -155,6 +155,7 @@ es:
index:
geozone_filter_all: Todos los ámbitos de actuación
administrator_filter_all: Todos los administradores
+ valuator_filter_all: Todos los evaluadores
tags_filter_all: Todas las etiquetas
filters:
valuation_open: Abiertas
diff --git a/spec/features/admin/spending_proposals_spec.rb b/spec/features/admin/spending_proposals_spec.rb
index fcfec8638..a14ff0316 100644
--- a/spec/features/admin/spending_proposals_spec.rb
+++ b/spec/features/admin/spending_proposals_spec.rb
@@ -143,6 +143,52 @@ feature 'Admin spending proposals' do
end
+ scenario "Filtering by valuator", :js do
+ user = create(:user, username: 'Valuator 1')
+ valuator = create(:valuator, user: user)
+
+ spending_proposal = create(:spending_proposal, title: "Realocate visitors")
+ spending_proposal.valuators << valuator
+
+ create(:spending_proposal, title: "Destroy the city")
+
+ visit admin_spending_proposals_path
+ expect(page).to have_link("Realocate visitors")
+ expect(page).to have_link("Destroy the city")
+
+ select "Valuator 1", from: "valuator_id"
+
+ expect(page).to have_content('There is 1 spending proposal')
+ expect(page).to_not have_link("Destroy the city")
+ expect(page).to have_link("Realocate visitors")
+
+ select "All valuators", from: "valuator_id"
+
+ expect(page).to have_content('There are 2 spending proposals')
+ expect(page).to have_link("Destroy the city")
+ expect(page).to have_link("Realocate visitors")
+
+ select "Valuator 1", from: "valuator_id"
+ expect(page).to have_content('There is 1 spending proposal')
+ click_link("Realocate visitors")
+ click_link("Back")
+
+ expect(page).to have_content('There is 1 spending proposal')
+ expect(page).to_not have_link("Destroy the city")
+ expect(page).to have_link("Realocate visitors")
+
+ click_link("Realocate visitors")
+ click_on("Edit classification")
+ expect(page).to have_button("Update")
+ click_on("Back")
+ expect(page).to_not have_button("Update")
+ click_on("Back")
+
+ expect(page).to have_content('There is 1 spending proposal')
+ expect(page).to_not have_link("Destroy the city")
+ expect(page).to have_link("Realocate visitors")
+ end
+
scenario "Current filter is properly highlighted" do
filters_links = {'valuation_open' => 'Open',
'without_admin' => 'Without assigned admin',
From eb78f01fb209a14a9c77c2858dcefb1f962ef814 Mon Sep 17 00:00:00 2001
From: rgarcia
Date: Tue, 12 Apr 2016 17:21:50 +0200
Subject: [PATCH 0042/1685] improves valuator select layout
---
app/views/admin/spending_proposals/index.html.erb | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/views/admin/spending_proposals/index.html.erb b/app/views/admin/spending_proposals/index.html.erb
index a4a1a68c6..1ad804c51 100644
--- a/app/views/admin/spending_proposals/index.html.erb
+++ b/app/views/admin/spending_proposals/index.html.erb
@@ -2,7 +2,7 @@
<%= form_tag admin_spending_proposals_path, method: :get, enforce_utf8: false do %>
-
+
<%= select_tag :administrator_id,
options_for_select(admin_select_options, params[:administrator_id]),
{ prompt: t("admin.spending_proposals.index.administrator_filter_all"),
@@ -10,7 +10,7 @@
class: "js-submit-on-change" } %>
-
+
<%= select_tag :valuator_id,
options_for_select(valuator_select_options, params[:valuator_id]),
{ prompt: t("admin.spending_proposals.index.valuator_filter_all"),
@@ -18,14 +18,14 @@
class: "js-submit-on-change" } %>
-
+
<%= select_tag :geozone_id,
options_for_select(geozone_select_options.unshift([t("geozones.none"), "all"]), params[:geozone_id]),
{ prompt: t("admin.spending_proposals.index.geozone_filter_all"),
label: false,
class: "js-submit-on-change" } %>
-
+
<%= select_tag :tag_name,
options_for_select(spending_proposal_tags_select_options, params[:tag_name]),
{ prompt: t("admin.spending_proposals.index.tags_filter_all"),
From 4f724ef3bfcc299082113d19755fb09657df0f3e Mon Sep 17 00:00:00 2001
From: kikito
Date: Tue, 12 Apr 2016 18:18:25 +0200
Subject: [PATCH 0043/1685] Modifies census_api to parse genre and dob
---
lib/census_api.rb | 12 ++++++++++--
spec/lib/census_api_spec.rb | 4 ++--
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/lib/census_api.rb b/lib/census_api.rb
index c53e703fb..2b8c7d7a2 100644
--- a/lib/census_api.rb
+++ b/lib/census_api.rb
@@ -38,7 +38,10 @@ class CensusApi
end
def date_of_birth
- data[:datos_habitante][:item][:fecha_nacimiento_string]
+ str = data[:datos_habitante][:item][:fecha_nacimiento_string]
+ day, month, year = str.match(/(\d\d?)\D(\d\d?)\D(\d\d\d?\d?)/)[1..3]
+ return nil unless day.present? && month.present? && year.present?
+ Date.new(year.to_i, month.to_i, day.to_i)
end
def postal_code
@@ -50,7 +53,12 @@ class CensusApi
end
def genre # "Varón" or "Mujer"
- data[:datos_habitante][:item][:descripcion_sexo]
+ case data[:datos_habitante][:item][:descripcion_sexo]
+ when "Varón"
+ "male"
+ when "Mujer"
+ "female"
+ end
end
private
diff --git a/spec/lib/census_api_spec.rb b/spec/lib/census_api_spec.rb
index a49133d23..fb14f39c5 100644
--- a/spec/lib/census_api_spec.rb
+++ b/spec/lib/census_api_spec.rb
@@ -29,7 +29,7 @@ describe CensusApi do
describe '#call' do
let(:invalid_body) { {get_habita_datos_response: {get_habita_datos_return: {datos_habitante: {}}}} }
- let(:valid_body){ {get_habita_datos_response: {get_habita_datos_return: {datos_habitante: {item: {fecha_nacimiento_string: "1/1/1980"}}}}} }
+ let(:valid_body){ {get_habita_datos_response: {get_habita_datos_return: {datos_habitante: {item: {fecha_nacimiento_string: "1-1-1980"}}}}} }
it "returns the response for the first valid variant" do
allow(api).to receive(:get_response_body).with(1, "00123456").and_return(invalid_body)
@@ -39,7 +39,7 @@ describe CensusApi do
response = api.call(1, "123456")
expect(response).to be_valid
- expect(response.date_of_birth).to eq('1/1/1980')
+ expect(response.date_of_birth).to eq(Date.new(1980,1,1))
end
it "returns the last failed response" do
From 7987a3410b6a1c3249cfc4af2657b3a7a875bb5e Mon Sep 17 00:00:00 2001
From: kikito
Date: Tue, 12 Apr 2016 18:19:05 +0200
Subject: [PATCH 0044/1685] Updates residence to handle CensusAPI's new
response
---
app/models/verification/residence.rb | 9 ++-------
lib/active_model/dates.rb | 6 +-----
2 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/app/models/verification/residence.rb b/app/models/verification/residence.rb
index 1f5ce4bfd..661659a01 100644
--- a/app/models/verification/residence.rb
+++ b/app/models/verification/residence.rb
@@ -78,12 +78,7 @@ class Verification::Residence
end
def genre
- case @census_api_response.genre
- when "Varón"
- "male"
- when "Mujer"
- "female"
- end
+ @census_api_response.genre
end
private
@@ -95,7 +90,7 @@ class Verification::Residence
def residency_valid?
@census_api_response.valid? &&
@census_api_response.postal_code == postal_code &&
- @census_api_response.date_of_birth == date_to_string(date_of_birth)
+ @census_api_response.date_of_birth == date_of_birth
end
def clean_document_number
diff --git a/lib/active_model/dates.rb b/lib/active_model/dates.rb
index a519e3840..5dd8e971c 100644
--- a/lib/active_model/dates.rb
+++ b/lib/active_model/dates.rb
@@ -13,13 +13,9 @@ module ActiveModel::Dates
attrs.except("#{field}(1i)", "#{field}(2i)", "#{field}(3i)")
end
- def date_to_string(date)
- date.strftime("%d-%m-%Y")
- end
-
def string_to_date(value)
day, month, year = value.split("-")
Date.new(year.to_i, month.to_i, day.to_i)
end
-end
\ No newline at end of file
+end
From 708b77721c06cc667580b1b6841f830bd86fa997 Mon Sep 17 00:00:00 2001
From: kikito
Date: Tue, 12 Apr 2016 18:22:38 +0200
Subject: [PATCH 0045/1685] aligns rake task with Census API response
---
lib/tasks/users.rake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/tasks/users.rake b/lib/tasks/users.rake
index 50f96e592..18dad53bc 100644
--- a/lib/tasks/users.rake
+++ b/lib/tasks/users.rake
@@ -46,7 +46,7 @@ namespace :users do
begin
response = CensusApi.new.call(u.document_type, u.document_number)
if response.valid?
- u.genre = response.genre == 'Varón' ? 'male' : 'female'
+ u.genre = response.genre
u.date_of_birth = response.date_of_birth.to_datetime
u.save
print "."
From 3880ef9e24f9e136f4e6e430d098dcfea1873d7d Mon Sep 17 00:00:00 2001
From: kikito
Date: Tue, 12 Apr 2016 18:35:23 +0200
Subject: [PATCH 0046/1685] aligns document verification with census API
---
app/models/verification/management/document.rb | 4 ++--
lib/active_model/dates.rb | 5 -----
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/app/models/verification/management/document.rb b/app/models/verification/management/document.rb
index ee9e5462d..481073397 100644
--- a/app/models/verification/management/document.rb
+++ b/app/models/verification/management/document.rb
@@ -32,7 +32,7 @@ class Verification::Management::Document
end
def under_sixteen?(response)
- 16.years.ago < string_to_date(response.date_of_birth)
+ 16.years.ago < response.date_of_birth
end
def verified?
@@ -43,4 +43,4 @@ class Verification::Management::Document
user.update(verified_at: Time.now) if user?
end
-end
\ No newline at end of file
+end
diff --git a/lib/active_model/dates.rb b/lib/active_model/dates.rb
index 5dd8e971c..f9605ddbd 100644
--- a/lib/active_model/dates.rb
+++ b/lib/active_model/dates.rb
@@ -13,9 +13,4 @@ module ActiveModel::Dates
attrs.except("#{field}(1i)", "#{field}(2i)", "#{field}(3i)")
end
- def string_to_date(value)
- day, month, year = value.split("-")
- Date.new(year.to_i, month.to_i, day.to_i)
- end
-
end
From 20c403e37b59dfc94857ef62ddd905ac34204c64 Mon Sep 17 00:00:00 2001
From: rgarcia
Date: Tue, 12 Apr 2016 18:39:14 +0200
Subject: [PATCH 0047/1685] uses valuator description in select
---
app/helpers/valuation_helper.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/helpers/valuation_helper.rb b/app/helpers/valuation_helper.rb
index 9e3a054c1..1d74e94fa 100644
--- a/app/helpers/valuation_helper.rb
+++ b/app/helpers/valuation_helper.rb
@@ -2,9 +2,9 @@ module ValuationHelper
def valuator_select_options(valuator=nil)
if valuator.present?
- Valuator.where.not(id: valuator.id).order('users.username asc').includes(:user).collect { |v| [ v.name, v.id ] }.prepend([valuator.name, valuator.id])
+ Valuator.where.not(id: valuator.id).order('users.username asc').includes(:user).collect { |v| [ v.description_or_email, v.id ] }.prepend([valuator.description_or_email, valuator.id])
else
- Valuator.all.order('users.username asc').includes(:user).collect { |v| [ v.name, v.id ] }
+ Valuator.all.order('users.username asc').includes(:user).collect { |v| [ v.description_or_email, v.id ] }
end
end
From efc81158991c9164cba7c41dd4f4c185e3190e7c Mon Sep 17 00:00:00 2001
From: rgarcia
Date: Tue, 12 Apr 2016 18:49:48 +0200
Subject: [PATCH 0048/1685] fixes specs
---
spec/features/admin/spending_proposals_spec.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/spec/features/admin/spending_proposals_spec.rb b/spec/features/admin/spending_proposals_spec.rb
index a14ff0316..16a140de6 100644
--- a/spec/features/admin/spending_proposals_spec.rb
+++ b/spec/features/admin/spending_proposals_spec.rb
@@ -144,8 +144,8 @@ feature 'Admin spending proposals' do
end
scenario "Filtering by valuator", :js do
- user = create(:user, username: 'Valuator 1')
- valuator = create(:valuator, user: user)
+ user = create(:user)
+ valuator = create(:valuator, user: user, description: 'Valuator 1')
spending_proposal = create(:spending_proposal, title: "Realocate visitors")
spending_proposal.valuators << valuator
From 5f60376c1dc7788a83a659f2d02ea1bbc3dc943c Mon Sep 17 00:00:00 2001
From: rgarcia
Date: Tue, 12 Apr 2016 19:12:28 +0200
Subject: [PATCH 0049/1685] changes order in valuator select
---
app/helpers/valuation_helper.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/helpers/valuation_helper.rb b/app/helpers/valuation_helper.rb
index 1d74e94fa..0983ea567 100644
--- a/app/helpers/valuation_helper.rb
+++ b/app/helpers/valuation_helper.rb
@@ -2,9 +2,9 @@ module ValuationHelper
def valuator_select_options(valuator=nil)
if valuator.present?
- Valuator.where.not(id: valuator.id).order('users.username asc').includes(:user).collect { |v| [ v.description_or_email, v.id ] }.prepend([valuator.description_or_email, valuator.id])
+ Valuator.where.not(id: valuator.id).order("description ASC").order("users.email ASC").includes(:user).collect { |v| [ v.description_or_email, v.id ] }.prepend([valuator.description_or_email, valuator.id])
else
- Valuator.all.order('users.username asc').includes(:user).collect { |v| [ v.description_or_email, v.id ] }
+ Valuator.all.order("description ASC").order("users.email ASC").includes(:user).collect { |v| [ v.description_or_email, v.id ] }
end
end
From 3a5928e83f6fa23dbb30432dba32be76c695476b Mon Sep 17 00:00:00 2001
From: kikito
Date: Wed, 13 Apr 2016 12:06:43 +0200
Subject: [PATCH 0050/1685] aligns document verification with Madrid
---
app/models/verification/management/document.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/verification/management/document.rb b/app/models/verification/management/document.rb
index 481073397..fcbc19ca4 100644
--- a/app/models/verification/management/document.rb
+++ b/app/models/verification/management/document.rb
@@ -32,7 +32,7 @@ class Verification::Management::Document
end
def under_sixteen?(response)
- 16.years.ago < response.date_of_birth
+ 16.years.ago.beginning_of_day < response.date_of_birth.beginning_of_day
end
def verified?
From d7f9862290aa47b267432dba07aae850dd2d2126 Mon Sep 17 00:00:00 2001
From: kikito
Date: Wed, 13 Apr 2016 12:06:50 +0200
Subject: [PATCH 0051/1685] fixes failing specs
---
.../verification/management/document_spec.rb | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/spec/models/verification/management/document_spec.rb b/spec/models/verification/management/document_spec.rb
index b4140f7ed..35fd89855 100644
--- a/spec/models/verification/management/document_spec.rb
+++ b/spec/models/verification/management/document_spec.rb
@@ -3,35 +3,35 @@ require 'rails_helper'
describe Verification::Management::Document do
describe "#valid_age?" do
it "returns false when the user is younger than sixteen years old" do
- census_response = double(date_of_birth: "31-12-#{16.years.ago.year}")
+ census_response = double(date_of_birth: Date.new(16.years.ago.year, 12, 31))
expect(Verification::Management::Document.new.valid_age?(census_response)).to be false
end
it "returns true when the user is sixteen years old" do
- census_response = double(date_of_birth: 16.years.ago.strftime("%d-%m-%Y"))
+ census_response = double(date_of_birth: Date.new(16.years.ago.year, 16.years.ago.month, 16.years.ago.day))
expect(Verification::Management::Document.new.valid_age?(census_response)).to be true
end
it "returns true when the user is older than sixteen years old" do
- census_response = double(date_of_birth: "31-12-#{33.years.ago.year}")
+ census_response = double(date_of_birth: Date.new(33.years.ago.year, 12, 31))
expect(Verification::Management::Document.new.valid_age?(census_response)).to be true
end
end
describe "#under_sixteen?" do
it "returns true when the user is younger than sixteen years old" do
- census_response = double(date_of_birth: "31-12-#{16.years.ago.year}")
+ census_response = double(date_of_birth: Date.new(16.years.ago.year, 12, 31))
expect(Verification::Management::Document.new.under_sixteen?(census_response)).to be true
end
it "returns false when the user is sixteen years old" do
- census_response = double(date_of_birth: 16.years.ago.strftime("%d-%m-%Y"))
+ census_response = double(date_of_birth: Date.new(16.years.ago.year, 16.years.ago.month, 16.years.ago.day))
expect(Verification::Management::Document.new.under_sixteen?(census_response)).to be false
end
it "returns false when the user is older than sixteen years old" do
- census_response = double(date_of_birth: "31-12-#{33.years.ago.year}")
+ census_response = double(date_of_birth: Date.new(33.years.ago.year, 12, 31))
expect(Verification::Management::Document.new.under_sixteen?(census_response)).to be false
end
end
-end
\ No newline at end of file
+end
From b0b810d4843d752c5954ecce3e8fb9dc1ba7b1df Mon Sep 17 00:00:00 2001
From: kikito
Date: Wed, 13 Apr 2016 13:32:24 +0200
Subject: [PATCH 0052/1685] Adds a spec so that admins can edit Spending
Proposal regular fields
---
spec/features/admin/spending_proposals_spec.rb | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/spec/features/admin/spending_proposals_spec.rb b/spec/features/admin/spending_proposals_spec.rb
index 16a140de6..144ff9b31 100644
--- a/spec/features/admin/spending_proposals_spec.rb
+++ b/spec/features/admin/spending_proposals_spec.rb
@@ -330,6 +330,24 @@ feature 'Admin spending proposals' do
context "Edit" do
+ scenario "Change title, description or geozone" do
+ spending_proposal = create(:spending_proposal)
+ create(:geozone, name: "Barbate")
+
+ visit admin_spending_proposal_path(spending_proposal)
+ click_link 'Edit'
+
+ fill_in 'spending_proposal_title', with: 'Potatoes'
+ fill_in 'spending_proposal_description', with: 'Carrots'
+ select 'Barbate', from: 'spending_proposal[geozone_id]'
+
+ click_button 'Update'
+
+ expect(page).to have_content 'Potatoes'
+ expect(page).to have_content 'Carrots'
+ expect(page).to have_content 'Barbate'
+ end
+
scenario "Add administrator" do
spending_proposal = create(:spending_proposal)
administrator = create(:administrator, user: create(:user, username: 'Marta', email: 'marta@admins.org'))
From d794c1b79d706a35600a80b21091a4072253adc0 Mon Sep 17 00:00:00 2001
From: kikito
Date: Wed, 13 Apr 2016 13:54:57 +0200
Subject: [PATCH 0053/1685] Adds fields to admin/spendingproposals/edit view &
controller
---
.../admin/spending_proposals_controller.rb | 2 +-
.../admin/spending_proposals/edit.html.erb | 74 +++++++++++++------
2 files changed, 52 insertions(+), 24 deletions(-)
diff --git a/app/controllers/admin/spending_proposals_controller.rb b/app/controllers/admin/spending_proposals_controller.rb
index 61f9aa78d..9b2b86875 100644
--- a/app/controllers/admin/spending_proposals_controller.rb
+++ b/app/controllers/admin/spending_proposals_controller.rb
@@ -33,7 +33,7 @@ class Admin::SpendingProposalsController < Admin::BaseController
private
def spending_proposal_params
- params.require(:spending_proposal).permit(:administrator_id, :tag_list, valuator_ids: [])
+ params.require(:spending_proposal).permit(:title, :description, :external_url, :geozone_id, :association_name, :administrator_id, :tag_list, valuator_ids: [])
end
end
diff --git a/app/views/admin/spending_proposals/edit.html.erb b/app/views/admin/spending_proposals/edit.html.erb
index 59180eb16..1fd86da59 100644
--- a/app/views/admin/spending_proposals/edit.html.erb
+++ b/app/views/admin/spending_proposals/edit.html.erb
@@ -2,43 +2,71 @@
<%= t("admin.spending_proposals.show.back") %>
<% end %>
-<%= render 'written_by_author' %>
-
-
-
<%= form_for @spending_proposal,
url: admin_spending_proposal_path(@spending_proposal) do |f| %>
<% SpendingProposal.filter_params(params).each do |filter_name, filter_value| %>
- <%= hidden_field_tag filter_name, filter_value %>
+ <%= hidden_field_tag filter_name, filter_value %>
<% end %>
- <%= f.select(:administrator_id,
- @admins.collect{ |a| [a.name_and_email, a.id ] },
- { include_blank: t("admin.spending_proposals.edit.undefined") },
- class: "small-12 medium-6") %>
+
+
+ <%= f.text_field :title, maxlength: SpendingProposal.title_max_length %>
+
- <%= f.label :tag_list, t("admin.spending_proposals.edit.tags") %>
-
- <%= f.text_field :tag_list, value: @spending_proposal.tag_list.to_s,
- label: false,
- placeholder: t("admin.spending_proposals.edit.tags_placeholder"),
- class: 'js-tag-list' %>
- <%= f.label :valuator_ids, t("admin.spending_proposals.edit.assigned_valuators") %>
+
<%= t("admin.spending_proposals.edit.classification") %>
- <%= f.collection_check_boxes :valuator_ids, @valuators, :id, :email do |b| %>
- <%= b.label(title: valuator_label(b.object)) { b.check_box + truncate(b.object.description_or_email, length: 60) } %>
- <% end %>
+
+
+
+ <%= f.select(:administrator_id,
+ @admins.collect{ |a| [a.name_and_email, a.id ] },
+ { include_blank: t("admin.spending_proposals.edit.undefined") }) %>
+
+
+
+
+ <%= f.label :tag_list, t("admin.spending_proposals.edit.tags") %>
+
+ <%= f.text_field :tag_list, value: @spending_proposal.tag_list.to_s,
+ label: false,
+ placeholder: t("admin.spending_proposals.edit.tags_placeholder"),
+ class: 'js-tag-list' %>
+
+
+
+ <%= f.label :valuator_ids, t("admin.spending_proposals.edit.assigned_valuators") %>
+
+ <%= f.collection_check_boxes :valuator_ids, @valuators, :id, :email do |b| %>
+ <%= b.label(title: valuator_label(b.object)) { b.check_box + truncate(b.object.description_or_email, length: 60) } %>
+ <% end %>
+
+
<%= f.submit(class: "button", value: t("admin.spending_proposals.edit.submit_button")) %>
-
<% end %>
From c2b205da892672ae8dcd2cf9198d4742c2b4e85c Mon Sep 17 00:00:00 2001
From: kikito
Date: Wed, 13 Apr 2016 13:55:29 +0200
Subject: [PATCH 0054/1685] Makes redirect in spending proposal go back to the
full page after editing
---
app/controllers/admin/spending_proposals_controller.rb | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/app/controllers/admin/spending_proposals_controller.rb b/app/controllers/admin/spending_proposals_controller.rb
index 9b2b86875..e7d1cc45c 100644
--- a/app/controllers/admin/spending_proposals_controller.rb
+++ b/app/controllers/admin/spending_proposals_controller.rb
@@ -21,10 +21,8 @@ class Admin::SpendingProposalsController < Admin::BaseController
def update
if @spending_proposal.update(spending_proposal_params)
- path = admin_spending_proposal_path( @spending_proposal,
- { anchor: 'classification' }.merge(SpendingProposal.filter_params(params)))
-
- redirect_to path, notice: t("flash.actions.update.spending_proposal")
+ redirect_to admin_spending_proposal_path(@spending_proposal, SpendingProposal.filter_params(params)),
+ notice: t("flash.actions.update.spending_proposal")
else
render :edit
end
From 64ec5290b9895e5f7b54bdb5c1750cc20ee729ae Mon Sep 17 00:00:00 2001
From: kikito
Date: Wed, 13 Apr 2016 13:55:59 +0200
Subject: [PATCH 0055/1685] Adds a new edit link to spending proposals/show and
moves the others down
---
.../admin/spending_proposals/show.html.erb | 21 ++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/app/views/admin/spending_proposals/show.html.erb b/app/views/admin/spending_proposals/show.html.erb
index bbcf4b4fc..c54816071 100644
--- a/app/views/admin/spending_proposals/show.html.erb
+++ b/app/views/admin/spending_proposals/show.html.erb
@@ -4,13 +4,13 @@
<%= render 'written_by_author' %>
-<%= t("admin.spending_proposals.show.classification") %>
+<%= link_to t("admin.spending_proposals.show.edit"),
+ edit_admin_spending_proposal_path(@spending_proposal,
+ SpendingProposal.filter_params(params)) %>
-
- <%= link_to t("admin.spending_proposals.show.edit_classification"),
- edit_admin_spending_proposal_path(@spending_proposal,
- {anchor: 'form'}.merge(SpendingProposal.filter_params(params))) %>
-
+
+
+<%= t("admin.spending_proposals.show.classification") %>
<%= t("admin.spending_proposals.show.assigned_admin") %>:
<%= @spending_proposal.administrator.try(:name_and_email) || t("admin.spending_proposals.show.undefined") %>
@@ -31,12 +31,19 @@
<% end %>
+
+ <%= link_to t("admin.spending_proposals.show.edit_classification"),
+ edit_admin_spending_proposal_path(@spending_proposal,
+ {anchor: 'classification'}.merge(SpendingProposal.filter_params(params))) %>
+
+
<%= t("admin.spending_proposals.show.dossier") %>
+<%= render 'valuation/spending_proposals/written_by_valuators' %>
+
<%= link_to t("admin.spending_proposals.show.edit_dossier"), edit_valuation_spending_proposal_path(@spending_proposal) %>
-<%= render 'valuation/spending_proposals/written_by_valuators' %>
From 2e0eaa80ca564275328f5a742c72857681e4d389 Mon Sep 17 00:00:00 2001
From: kikito
Date: Wed, 13 Apr 2016 13:56:15 +0200
Subject: [PATCH 0056/1685] i18n
---
config/locales/activerecord.en.yml | 7 ++++++-
config/locales/activerecord.es.yml | 5 +++++
config/locales/admin.en.yml | 3 ++-
config/locales/admin.es.yml | 1 +
4 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/config/locales/activerecord.en.yml b/config/locales/activerecord.en.yml
index f1de3c756..91c035dfb 100644
--- a/config/locales/activerecord.en.yml
+++ b/config/locales/activerecord.en.yml
@@ -68,7 +68,12 @@ en:
name: "Name of organisation"
responsible_name: "Person responsible for the group"
spending_proposal:
- administrator_id: "Administrator"
+ administrator_id: "Administrador"
+ association_name: "Association name"
+ description: "Description"
+ external_url: "Link to additional documentation"
+ geozone_id: "Scope of operation"
+ title: "Title"
errors:
models:
debate:
diff --git a/config/locales/activerecord.es.yml b/config/locales/activerecord.es.yml
index 79893cecd..a7644f02e 100644
--- a/config/locales/activerecord.es.yml
+++ b/config/locales/activerecord.es.yml
@@ -69,6 +69,11 @@ es:
responsible_name: "Persona responsable del colectivo"
spending_proposal:
administrator_id: "Administrador"
+ association_name: "Nombre de la asociación"
+ description: "Descripción"
+ external_url: "Enlace a documentación adicional"
+ geozone_id: "Ámbito de actuación"
+ title: "Título"
errors:
models:
debate:
diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml
index 3c4c2f24e..96023f69c 100755
--- a/config/locales/admin.en.yml
+++ b/config/locales/admin.en.yml
@@ -173,6 +173,7 @@ en:
back: Back
classification: Clasification
heading: "Investment project %{id}"
+ edit: Edit
edit_classification: Edit classification
association_name: Association
by: By
@@ -237,4 +238,4 @@ en:
index:
phone_not_given: Phone not given
sms_code_not_confirmed: Has not confirmed the sms code
- title: Incomplete verifications
\ No newline at end of file
+ title: Incomplete verifications
diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml
index 5d7017336..345a3716c 100644
--- a/config/locales/admin.es.yml
+++ b/config/locales/admin.es.yml
@@ -173,6 +173,7 @@ es:
back: Volver
classification: Clasificación
heading: Propuesta de inversión %{id}
+ edit: Editar
edit_classification: Editar clasificación
association_name: Asociación
by: Autor
From 89d269e4f52fcd3621bcc67213713c5d74b138da Mon Sep 17 00:00:00 2001
From: kikito
Date: Wed, 13 Apr 2016 14:13:30 +0200
Subject: [PATCH 0057/1685] fixes flacky test: "$ is undefined"
---
spec/support/phantomjs_ext/disable_js_fx.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/spec/support/phantomjs_ext/disable_js_fx.js b/spec/support/phantomjs_ext/disable_js_fx.js
index 2b97f0a0f..eae828ac8 100644
--- a/spec/support/phantomjs_ext/disable_js_fx.js
+++ b/spec/support/phantomjs_ext/disable_js_fx.js
@@ -1,3 +1,5 @@
document.addEventListener("DOMContentLoaded", function() {
- $.fx.off = true;
+ if (typeof $ !== 'undefined') {
+ $.fx.off = true;
+ }
});
From ba67396539e04075f8f2e0e311a47f0a5f8cbb23 Mon Sep 17 00:00:00 2001
From: kikito
Date: Wed, 13 Apr 2016 14:25:14 +0200
Subject: [PATCH 0058/1685] Adds migration for renaming genre to gender
---
db/migrate/20160413122359_rename_genre_to_gender.rb | 5 +++++
db/schema.rb | 4 ++--
2 files changed, 7 insertions(+), 2 deletions(-)
create mode 100644 db/migrate/20160413122359_rename_genre_to_gender.rb
diff --git a/db/migrate/20160413122359_rename_genre_to_gender.rb b/db/migrate/20160413122359_rename_genre_to_gender.rb
new file mode 100644
index 000000000..f0bccfc28
--- /dev/null
+++ b/db/migrate/20160413122359_rename_genre_to_gender.rb
@@ -0,0 +1,5 @@
+class RenameGenreToGender < ActiveRecord::Migration
+ def change
+ rename_column :users, :genre, :gender
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index cd05a0d2f..6bee6d425 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20160411161531) do
+ActiveRecord::Schema.define(version: 20160413122359) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -422,7 +422,7 @@ ActiveRecord::Schema.define(version: 20160411161531) do
t.string "oauth_email"
t.integer "geozone_id"
t.string "redeemable_code"
- t.string "genre", limit: 10
+ t.string "gender", limit: 10
t.datetime "date_of_birth"
end
From 1b1f2bc2c977350c170c9946d94d32139424a1a9 Mon Sep 17 00:00:00 2001
From: kikito
Date: Wed, 13 Apr 2016 14:27:27 +0200
Subject: [PATCH 0059/1685] renames genre to gender in code
---
app/models/verification/residence.rb | 6 +++---
lib/census_api.rb | 2 +-
lib/tasks/users.rake | 6 +++---
spec/models/residence_spec.rb | 4 ++--
4 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/app/models/verification/residence.rb b/app/models/verification/residence.rb
index 661659a01..5756af2b3 100644
--- a/app/models/verification/residence.rb
+++ b/app/models/verification/residence.rb
@@ -32,7 +32,7 @@ class Verification::Residence
document_type: document_type,
geozone: self.geozone,
date_of_birth: date_of_birth.to_datetime,
- genre: genre,
+ gender: gender,
residence_verified_at: Time.now)
end
@@ -77,8 +77,8 @@ class Verification::Residence
@census_api_response.district_code
end
- def genre
- @census_api_response.genre
+ def gender
+ @census_api_response.gender
end
private
diff --git a/lib/census_api.rb b/lib/census_api.rb
index 2b8c7d7a2..ee8107ea1 100644
--- a/lib/census_api.rb
+++ b/lib/census_api.rb
@@ -52,7 +52,7 @@ class CensusApi
data[:datos_vivienda][:item][:codigo_distrito]
end
- def genre # "Varón" or "Mujer"
+ def gender # "Varón" or "Mujer"
case data[:datos_habitante][:item][:descripcion_sexo]
when "Varón"
"male"
diff --git a/lib/tasks/users.rake b/lib/tasks/users.rake
index 18dad53bc..c56df2dd0 100644
--- a/lib/tasks/users.rake
+++ b/lib/tasks/users.rake
@@ -42,11 +42,11 @@ namespace :users do
desc "Associates demographic information to users"
task assign_demographic: :environment do
- User.residence_verified.where(genre: nil).find_each do |u|
+ User.residence_verified.where(gender: nil).find_each do |u|
begin
response = CensusApi.new.call(u.document_type, u.document_number)
if response.valid?
- u.genre = response.genre
+ u.gender = response.gender
u.date_of_birth = response.date_of_birth.to_datetime
u.save
print "."
@@ -54,7 +54,7 @@ namespace :users do
print "X"
end
rescue
- puts "Could not assign genre/dob for user: #{u.id}"
+ puts "Could not assign gender/dob for user: #{u.id}"
end
end
end
diff --git a/spec/models/residence_spec.rb b/spec/models/residence_spec.rb
index faa81b5c3..ce151eaee 100644
--- a/spec/models/residence_spec.rb
+++ b/spec/models/residence_spec.rb
@@ -85,7 +85,7 @@ describe Verification::Residence do
describe "save" do
- it "should store document number, document type, geozone, date of birth and genre" do
+ it "should store document number, document type, geozone, date of birth and gender" do
user = create(:user)
residence.user = user
residence.save
@@ -96,7 +96,7 @@ describe Verification::Residence do
expect(user.date_of_birth.year).to eq(1980)
expect(user.date_of_birth.month).to eq(12)
expect(user.date_of_birth.day).to eq(31)
- expect(user.genre).to eq('male')
+ expect(user.gender).to eq('male')
expect(user.geozone).to eq(geozone)
end
From edb56b24cec2a9ed9c48f187c41cad6ae46b7ba1 Mon Sep 17 00:00:00 2001
From: kikito
Date: Wed, 13 Apr 2016 14:30:58 +0200
Subject: [PATCH 0060/1685] removes lying comment
---
lib/census_api.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/census_api.rb b/lib/census_api.rb
index ee8107ea1..678a748c6 100644
--- a/lib/census_api.rb
+++ b/lib/census_api.rb
@@ -52,7 +52,7 @@ class CensusApi
data[:datos_vivienda][:item][:codigo_distrito]
end
- def gender # "Varón" or "Mujer"
+ def gender
case data[:datos_habitante][:item][:descripcion_sexo]
when "Varón"
"male"
From 005bd2696595e6b357d692b420c1841bf214a6f3 Mon Sep 17 00:00:00 2001
From: kikito
Date: Wed, 13 Apr 2016 18:52:53 +0200
Subject: [PATCH 0061/1685] does not require phones to be Spanish any more
---
app/models/verification/sms.rb | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/app/models/verification/sms.rb b/app/models/verification/sms.rb
index ba484c4f3..19e0bf041 100644
--- a/app/models/verification/sms.rb
+++ b/app/models/verification/sms.rb
@@ -5,13 +5,8 @@ class Verification::Sms
validates_presence_of :phone
validates :phone, length: { is: 9 }
- validate :spanish_phone
validate :uniqness_phone
- def spanish_phone
- errors.add(:phone, :invalid) unless phone.start_with?('6', '7')
- end
-
def uniqness_phone
errors.add(:phone, :taken) if User.where(confirmed_phone: phone).any?
end
@@ -40,4 +35,4 @@ class Verification::Sms
def generate_confirmation_code
rand.to_s[2..5]
end
-end
\ No newline at end of file
+end
From 92ecd7c983e664f35462b73a457925e60eb6b9c2 Mon Sep 17 00:00:00 2001
From: kikito
Date: Wed, 13 Apr 2016 19:27:04 +0200
Subject: [PATCH 0062/1685] replaces length 9 validation by format validation:
only numbers, spaces and plus sign allowed
---
app/models/verification/sms.rb | 2 +-
spec/models/sms_spec.rb | 11 +++++++++--
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/app/models/verification/sms.rb b/app/models/verification/sms.rb
index 19e0bf041..1a013f1d8 100644
--- a/app/models/verification/sms.rb
+++ b/app/models/verification/sms.rb
@@ -4,7 +4,7 @@ class Verification::Sms
attr_accessor :user, :phone, :confirmation_code
validates_presence_of :phone
- validates :phone, length: { is: 9 }
+ validates :phone, format: { with: /\A[\d \+]+\z/ }
validate :uniqness_phone
def uniqness_phone
diff --git a/spec/models/sms_spec.rb b/spec/models/sms_spec.rb
index f52ff3c6e..83723cb3c 100644
--- a/spec/models/sms_spec.rb
+++ b/spec/models/sms_spec.rb
@@ -7,9 +7,16 @@ describe Verification::Sms do
end
it "should validate uniqness of phone" do
- user = create(:user, confirmed_phone: "699999999")
+ create(:user, confirmed_phone: "699999999")
sms = Verification::Sms.new(phone: "699999999")
expect(sms).to_not be_valid
end
-end
\ No newline at end of file
+ it "only allows spaces, numbers and the + sign" do
+ expect(build(:verification_sms, phone: "0034 666666666")).to be_valid
+ expect(build(:verification_sms, phone: "+34 666666666")).to be_valid
+ expect(build(:verification_sms, phone: "hello there")).to_not be_valid
+ expect(build(:verification_sms, phone: "555; DROP TABLE USERS")).to_not be_valid
+ end
+
+end
From fa2fe873ff47da8d6a312d04bce8de144727ea2c Mon Sep 17 00:00:00 2001
From: Alberto Garcia Cabeza
Date: Thu, 14 Apr 2016 00:14:35 +0200
Subject: [PATCH 0063/1685] Fixes styles for progress meter proposals supports
---
app/assets/stylesheets/participation.scss | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss
index 10cd6e65d..1773ef8da 100644
--- a/app/assets/stylesheets/participation.scss
+++ b/app/assets/stylesheets/participation.scss
@@ -164,10 +164,12 @@
.progress {
background-color: rgba(255,255,255,.8);
- height: rem-calc(12);
+ height: $line-height/2;
.meter {
background: $votes-like;
+ display: block;
+ height: $line-height/2;
}
}
From 455cd15c40ed6a05c4413d9a5e5dcead6a6d05c7 Mon Sep 17 00:00:00 2001
From: Ana
Date: Thu, 14 Apr 2016 13:43:17 +0200
Subject: [PATCH 0064/1685] Version PhantomJS updated
---
README.md | 4 ++--
README_ES.md | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 251a0f8e3..9582baa02 100644
--- a/README.md
+++ b/README.md
@@ -48,7 +48,7 @@ bin/rails s
```
-Prerequisites for testing: install PhantomJS >= 2.0
+Prerequisites for testing: install PhantomJS >= 1.9.8
Run the tests with:
@@ -62,4 +62,4 @@ Code published under AFFERO GPL v3 (see [LICENSE-AGPLv3.txt](LICENSE-AGPLv3.txt)
## Contributions
-See [CONTRIBUTING_EN.md](CONTRIBUTING_EN.md)
\ No newline at end of file
+See [CONTRIBUTING_EN.md](CONTRIBUTING_EN.md)
diff --git a/README_ES.md b/README_ES.md
index c3fd3cdff..654272d60 100644
--- a/README_ES.md
+++ b/README_ES.md
@@ -47,7 +47,7 @@ Para ejecutar la aplicación en local:
bin/rails s
```
-Prerequisitos para los tests: tener instalado PhantomJS >= 2.0
+Prerequisitos para los tests: tener instalado PhantomJS >= 1.9.8
Para ejecutar los tests:
From e55a4c9f2371ba087bfad67748bcb1441b339be2 Mon Sep 17 00:00:00 2001
From: Alberto Garcia Cabeza
Date: Thu, 14 Apr 2016 16:38:39 +0200
Subject: [PATCH 0065/1685] Renters videos on proposals show
---
app/views/proposals/show.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/proposals/show.html.erb b/app/views/proposals/show.html.erb
index 1a5de351b..6550ece24 100644
--- a/app/views/proposals/show.html.erb
+++ b/app/views/proposals/show.html.erb
@@ -51,7 +51,7 @@
<%= @proposal.summary %>
<% if @proposal.video_url.present? %>
-
+
From c5a1b3d1ee8548b05f18515fac0b0716766561e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baza=CC=81n?=
Date: Fri, 15 Apr 2016 11:02:15 +0200
Subject: [PATCH 0066/1685] adds info to readme about the seed verified user
---
README.md | 8 ++++----
README_ES.md | 9 +++++----
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index a5bb81ff8..2cdaddb19 100644
--- a/README.md
+++ b/README.md
@@ -61,10 +61,10 @@ You can use the default admin user from the seeds file:
**user:** admin@madrid.es
**pass:** 12345678
-But for some actions like voting, you will need to verify him, opening a console with `rails console` and then:
-```
-User.first.update_attributes(verified_at: Date.today, residence_verified_at: Date.today, level_two_verified_at: Date.today)
-```
+But for some actions like voting, you will need a verified user, the seeds file also includes one:
+
+ **user:** verified@madrid.es
+ **pass:** 12345678
### OAuth
diff --git a/README_ES.md b/README_ES.md
index 96772ba77..e0392bc51 100644
--- a/README_ES.md
+++ b/README_ES.md
@@ -60,10 +60,11 @@ Puedes usar el usuario administrador por defecto del fichero seeds:
**user:** admin@madrid.es
**pass:** 12345678
-Pero para ciertas acciones, como apoyar, necesitarás verificarle, abre una consola con `rails console` y escribe:
-```
-User.first.update_attributes(verified_at: Date.today, residence_verified_at: Date.today, level_two_verified_at: Date.today)
-```
+Pero para ciertas acciones, como apoyar, necesitarás un usuario verificado, el fichero seeds proporciona uno:
+
+ **user:** verified@madrid.es
+ **pass:** 12345678
+
### OAuth
From 7d32f2a4b0a33b7f9485b7b85be1dd927d3d0733 Mon Sep 17 00:00:00 2001
From: Alberto Garcia Cabeza
Date: Fri, 15 Apr 2016 13:09:54 +0200
Subject: [PATCH 0067/1685] Adds label and placeholder for international
numbers verification
---
app/views/verification/sms/new.html.erb | 5 +++--
config/locales/verification.en.yml | 2 ++
config/locales/verification.es.yml | 2 ++
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/app/views/verification/sms/new.html.erb b/app/views/verification/sms/new.html.erb
index 6019c89cd..4af6a4dfb 100644
--- a/app/views/verification/sms/new.html.erb
+++ b/app/views/verification/sms/new.html.erb
@@ -28,9 +28,10 @@
<%= render "shared/errors", resource: @sms %>
- <%= f.label t("verification.sms.new.phone") %>
+ <%= f.label :phone, t("verification.sms.new.phone"), class: "inline-block" %>
+
<%= t("verification.sms.new.phone_format_html") %>
<%= t("verification.sms.new.phone_note") %>
- <%= f.text_field :phone, label: false %>
+ <%= f.text_field :phone, label: false, placeholder: t("verification.sms.new.phone_placeholder") %>
<%= f.submit t("verification.sms.new.submit_button"), class: "button success" %>
diff --git a/config/locales/verification.en.yml b/config/locales/verification.en.yml
index 24c9ae928..8b7617f1a 100755
--- a/config/locales/verification.en.yml
+++ b/config/locales/verification.en.yml
@@ -83,7 +83,9 @@ en:
title: Security code confirmation
new:
phone: Enter your mobile phone number to receive the code
+ phone_format_html: "(Example: 612345678 or +34612345678)"
phone_note: We only user your phone for send to you a code, we never contact to you.
+ phone_placeholder: "Example: 612345678 or +34612345678"
submit_button: Send
title: Send confirmation code
update:
diff --git a/config/locales/verification.es.yml b/config/locales/verification.es.yml
index be676ab0f..7c27584a7 100644
--- a/config/locales/verification.es.yml
+++ b/config/locales/verification.es.yml
@@ -83,7 +83,9 @@ es:
title: SMS de confirmación
new:
phone: Introduce tu teléfono móvil para recibir el código
+ phone_format_html: "(Ejemplo: 612345678 ó +34612345678)"
phone_note: Sólo usaremos tu teléfono para enviarte un código, nunca te contactaremos.
+ phone_placeholder: "Ejemplo: 612345678 ó +34612345678"
submit_button: Enviar
title: SMS de confirmación
update:
From 3adcd9c304c3754646f3141002f47f024cc8af84 Mon Sep 17 00:00:00 2001
From: kikito
Date: Fri, 15 Apr 2016 17:16:13 +0200
Subject: [PATCH 0068/1685] Adds physical votes to sps table
---
...0160415150524_add_physical_votes_to_spending_proposals.rb | 5 +++++
db/schema.rb | 3 ++-
2 files changed, 7 insertions(+), 1 deletion(-)
create mode 100644 db/migrate/20160415150524_add_physical_votes_to_spending_proposals.rb
diff --git a/db/migrate/20160415150524_add_physical_votes_to_spending_proposals.rb b/db/migrate/20160415150524_add_physical_votes_to_spending_proposals.rb
new file mode 100644
index 000000000..a90b1d1a7
--- /dev/null
+++ b/db/migrate/20160415150524_add_physical_votes_to_spending_proposals.rb
@@ -0,0 +1,5 @@
+class AddPhysicalVotesToSpendingProposals < ActiveRecord::Migration
+ def change
+ add_column :spending_proposals, :physical_votes, :integer, default: 0
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 6bee6d425..35d28fc78 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20160413122359) do
+ActiveRecord::Schema.define(version: 20160415150524) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -315,6 +315,7 @@ ActiveRecord::Schema.define(version: 20160413122359) do
t.integer "cached_votes_up", default: 0
t.tsvector "tsv"
t.string "responsible_name", limit: 60
+ t.integer "physical_votes", default: 0
end
add_index "spending_proposals", ["author_id"], name: "index_spending_proposals_on_author_id", using: :btree
From d9ec2e2cf341a46ec2b0271499e4b2752dd871a1 Mon Sep 17 00:00:00 2001
From: kikito
Date: Fri, 15 Apr 2016 17:16:35 +0200
Subject: [PATCH 0069/1685] Calculates SP.total_votes using physical_votes
---
app/models/spending_proposal.rb | 2 +-
spec/models/spending_proposal_spec.rb | 11 +++++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/app/models/spending_proposal.rb b/app/models/spending_proposal.rb
index 69d4d839f..66c6cb2ad 100644
--- a/app/models/spending_proposal.rb
+++ b/app/models/spending_proposal.rb
@@ -100,7 +100,7 @@ class SpendingProposal < ActiveRecord::Base
end
def total_votes
- cached_votes_up
+ cached_votes_up + physical_votes
end
def code
diff --git a/spec/models/spending_proposal_spec.rb b/spec/models/spending_proposal_spec.rb
index ba18287e6..e3b7629d7 100644
--- a/spec/models/spending_proposal_spec.rb
+++ b/spec/models/spending_proposal_spec.rb
@@ -277,4 +277,15 @@ describe SpendingProposal do
end
end
+ describe "total votes" do
+ it "takes into account physical votes in addition to web votes" do
+ sp = create(:spending_proposal)
+ sp.register_vote(create(:user, :level_two), true)
+ expect(sp.total_votes).to eq(1)
+ sp.physical_votes = 10
+ expect(sp.total_votes).to eq(11)
+ end
+ end
+
+
end
From 5a785ca7ce53c60397516512eb7a73b6b7d922be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Fri, 15 Apr 2016 17:57:02 +0200
Subject: [PATCH 0070/1685] adds voting on sps as admin feature flag
---
config/locales/settings.en.yml | 4 +++-
config/locales/settings.es.yml | 4 +++-
db/seeds.rb | 7 +++++--
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/config/locales/settings.en.yml b/config/locales/settings.en.yml
index 756debb24..32874e32b 100755
--- a/config/locales/settings.en.yml
+++ b/config/locales/settings.en.yml
@@ -15,4 +15,6 @@ en:
per_page_code: "Code to be included on every page"
feature:
debates: Debates
- spending_proposals: Spending proposals
+ spending_proposals: Investment projects
+ spending_proposal_features:
+ voting_allowed: Voting on investment projects
diff --git a/config/locales/settings.es.yml b/config/locales/settings.es.yml
index 36d4edf63..aa5dea14e 100644
--- a/config/locales/settings.es.yml
+++ b/config/locales/settings.es.yml
@@ -15,4 +15,6 @@ es:
per_page_code: "Código a incluir en cada página"
feature:
debates: Debates
- spending_proposals: Propuestas de gasto
+ spending_proposals: Propuestas de inversión
+ spending_proposal_features:
+ voting_allowed: Votaciones sobre propuestas de inversión.
\ No newline at end of file
diff --git a/db/seeds.rb b/db/seeds.rb
index 143a4af48..067349837 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -22,6 +22,9 @@ Setting["max_votes_for_debate_edit"] = 1000
# Max votes where a proposal is still editable
Setting["max_votes_for_proposal_edit"] = 1000
+# Max length for comments
+Setting['comments_body_max_length'] = 1000
+
# Prefix for the Proposal codes
Setting["proposal_code_prefix"] = 'MAD'
@@ -59,5 +62,5 @@ Setting['feature.facebook_login'] = true
Setting['feature.google_login'] = true
Setting['feature.public_stats'] = true
-# Max length for comments
-Setting['comments_body_max_length'] = 1000
+# Spending proposals feature flags
+Setting['feature.spending_proposal_features.voting_allowed'] = true
From e6a9cb4fcc79d4e3f12fed36819e8648305635bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Fri, 15 Apr 2016 23:01:00 +0200
Subject: [PATCH 0071/1685] disable voting on sps if setting disabled refactors
hover messages on sps votes
---
app/assets/javascripts/votes.js.coffee | 2 +
app/assets/stylesheets/participation.scss | 9 ++--
app/models/spending_proposal.rb | 10 ++++-
app/models/user.rb | 5 +++
app/views/spending_proposals/_votes.html.erb | 31 ++++++--------
config/locales/en.yml | 6 +++
config/locales/es.yml | 6 +++
spec/features/votes_spec.rb | 20 +++++++++
spec/models/spending_proposal_spec.rb | 43 ++++++++++++++++++++
spec/support/common_actions.rb | 5 +++
10 files changed, 111 insertions(+), 26 deletions(-)
diff --git a/app/assets/javascripts/votes.js.coffee b/app/assets/javascripts/votes.js.coffee
index 43469909d..e4223c644 100644
--- a/app/assets/javascripts/votes.js.coffee
+++ b/app/assets/javascripts/votes.js.coffee
@@ -5,11 +5,13 @@ App.Votes =
$("div.anonymous-votes", votes).show();
$("div.organizations-votes", votes).show();
$("div.not-logged", votes).show();
+ $("div.no-supports-allowed", votes).show();
$("div.logged", votes).hide();
, ->
$("div.anonymous-votes", votes).hide();
$("div.organizations-votes", votes).hide();
$("div.not-logged", votes).hide();
+ $("div.no-supports-allowed", votes).hide();
$("div.logged", votes).show();
initialize: ->
diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss
index 1773ef8da..0873e7c7c 100644
--- a/app/assets/stylesheets/participation.scss
+++ b/app/assets/stylesheets/participation.scss
@@ -240,7 +240,7 @@
}
}
- .anonymous-votes, .organizations-votes {
+ .anonymous-votes, .organizations-votes, .no-supports-allowed {
background: $warning-bg;
color: $warning-color;
height: 100%;
@@ -847,16 +847,13 @@
color: $budget;
}
- .not-logged,
- .organizations-votes,
- .anonymous-votes {
+ .no-supports-allowed {
background: rgba(69,67,114,.96);
color: white;
padding: rem-calc(12);
}
- .anonymous-votes p, .anonymous-votes a,
- .organizations-votes p {
+ .no-supports-allowed p, .no-supports-allowed a {
color: white;
}
}
diff --git a/app/models/spending_proposal.rb b/app/models/spending_proposal.rb
index 66c6cb2ad..7a3dda7c6 100644
--- a/app/models/spending_proposal.rb
+++ b/app/models/spending_proposal.rb
@@ -112,8 +112,16 @@ class SpendingProposal < ActiveRecord::Base
update(unfeasible_email_sent_at: Time.now)
end
+ def reason_for_not_being_votable_by(user)
+ return :not_logged_in unless user
+ return :not_verified unless user.can?(:vote, SpendingProposal)
+ return :unfeasible if unfeasible?
+ return :organization if user.organization?
+ return :not_voting_allowed if Setting["feature.spending_proposal_features.voting_allowed"].blank?
+ end
+
def votable_by?(user)
- user && user.level_two_or_three_verified?
+ reason_for_not_being_votable_by(user).blank?
end
def register_vote(user, vote_value)
diff --git a/app/models/user.rb b/app/models/user.rb
index bc4b0f120..f7980c796 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -222,6 +222,11 @@ class User < ActiveRecord::Base
self.update(registering_with_oauth: true, email: nil)
end
+ def ability
+ @ability ||= Ability.new(self)
+ end
+ delegate :can?, :cannot?, to: :ability
+
private
def clean_document_number
self.document_number = self.document_number.gsub(/[^a-z0-9]+/i, "").upcase unless self.document_number.blank?
diff --git a/app/views/spending_proposals/_votes.html.erb b/app/views/spending_proposals/_votes.html.erb
index ed8e61b2d..8dbc2aa3f 100644
--- a/app/views/spending_proposals/_votes.html.erb
+++ b/app/views/spending_proposals/_votes.html.erb
@@ -18,25 +18,18 @@
<% end %>
- <% if user_signed_in? && current_user.organization? %>
-
-
- <%= t("votes.organizations") %>
-
-
- <% elsif user_signed_in? && !spending_proposal.votable_by?(current_user)%>
-
-
- <%= t("votes.verified_only",
- verify_account: link_to(t("votes.verify_account"), verification_path )).html_safe %>
-
-
- <% elsif !user_signed_in? %>
-
- <%= t("votes.unauthenticated",
- signin: link_to(t("votes.signin"), new_user_session_path),
- signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
-
+ <% reason = spending_proposal.reason_for_not_being_votable_by(current_user) %>
+
+ <% if reason.present? && !voted_for?(@spending_proposal_votes, spending_proposal) %>
+
+
+ <%= t("votes.spending_proposals.#{reason}",
+ verify_account: link_to(t("votes.verify_account"), verification_path),
+ signin: link_to(t("votes.signin"), new_user_session_path),
+ signup: link_to(t("votes.signup"), new_user_registration_path)
+ ).html_safe %>
+
+
<% end %>
<% if voted_for?(@spending_proposal_votes, spending_proposal) && setting['twitter_handle'] %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 639aa3fb9..8609c079c 100755
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -500,6 +500,12 @@ en:
unauthenticated: You must %{signin} or %{signup} to continue.
verified_only: Only verified users can vote on proposals; %{verify_account}.
verify_account: verify your account
+ spending_proposals:
+ not_logged_in: You must %{signin} or %{signup} to continue.
+ not_verified: Only verified users can vote on proposals; %{verify_account}.
+ organization: Organisations are not permitted to vote
+ unfeasible: Unfeasible investment projects can not be supported
+ not_voting_allowed: Voting phase is closed
welcome:
debates:
alt: Icon debates
diff --git a/config/locales/es.yml b/config/locales/es.yml
index c39ef965a..a15528d5a 100755
--- a/config/locales/es.yml
+++ b/config/locales/es.yml
@@ -500,6 +500,12 @@ es:
unauthenticated: Necesitas %{signin} o %{signup} para continuar.
verified_only: Las propuestas sólo pueden ser votadas por usuarios verificados, %{verify_account}.
verify_account: verifica tu cuenta
+ spending_proposals:
+ not_logged_in: Necesitas %{signin} o %{signup} para continuar.
+ not_verified: Las propuestas de inversión sólo pueden ser apoyadas por usuarios verificados, %{verify_account}.
+ organization: Las organizaciones no pueden votar.
+ unfeasible: No se pueden votar propuestas inviables.
+ not_voting_allowed: El periodo de votación está cerrado.
welcome:
debates:
alt: Icono debates
diff --git a/spec/features/votes_spec.rb b/spec/features/votes_spec.rb
index 632162c3c..2ae64effe 100644
--- a/spec/features/votes_spec.rb
+++ b/spec/features/votes_spec.rb
@@ -435,4 +435,24 @@ feature 'Votes' do
end
end
end
+
+ scenario 'Disable voting on spending proposals', :js do
+ login_as(@manuela)
+ Setting["feature.spending_proposal_features.voting_allowed"] = nil
+ spending_proposal = create(:spending_proposal)
+
+ visit spending_proposals_path
+
+ within("#spending_proposal_#{spending_proposal.id}") do
+ find("div.supports").hover
+ expect_message_voting_not_allowed
+ end
+
+ visit spending_proposal_path(spending_proposal)
+
+ within("#spending_proposal_#{spending_proposal.id}") do
+ find("div.supports").hover
+ expect_message_voting_not_allowed
+ end
+ end
end
diff --git a/spec/models/spending_proposal_spec.rb b/spec/models/spending_proposal_spec.rb
index e3b7629d7..5bff7cadd 100644
--- a/spec/models/spending_proposal_spec.rb
+++ b/spec/models/spending_proposal_spec.rb
@@ -261,6 +261,49 @@ describe SpendingProposal do
end
end
+ describe 'Supports' do
+ let(:user) { create(:user, :level_two) }
+ let(:luser) { create(:user) }
+ let(:district) { create(:geozone) }
+ let(:city_sp) { create(:spending_proposal) }
+ let(:district_sp) { create(:spending_proposal, geozone: district) }
+
+ describe '#reason_for_not_being_votable_by' do
+ it "rejects not logged in users" do
+ expect(city_sp.reason_for_not_being_votable_by(nil)).to eq(:not_logged_in)
+ expect(district_sp.reason_for_not_being_votable_by(nil)).to eq(:not_logged_in)
+ end
+
+ it "rejects not verified users" do
+ expect(city_sp.reason_for_not_being_votable_by(luser)).to eq(:not_verified)
+ expect(district_sp.reason_for_not_being_votable_by(luser)).to eq(:not_verified)
+ end
+
+ it "rejects unfeasible spending proposals" do
+ unfeasible = create(:spending_proposal, feasible: false, valuation_finished: true)
+ expect(unfeasible.reason_for_not_being_votable_by(user)).to eq(:unfeasible)
+ end
+
+ it "rejects organizations" do
+ create(:organization, user: user)
+ expect(city_sp.reason_for_not_being_votable_by(user)).to eq(:organization)
+ expect(district_sp.reason_for_not_being_votable_by(user)).to eq(:organization)
+ end
+
+ it "rejects votes when voting is not allowed (via admin setting)" do
+ Setting["feature.spending_proposal_features.voting_allowed"] = nil
+ expect(city_sp.reason_for_not_being_votable_by(user)).to eq(:not_voting_allowed)
+ expect(district_sp.reason_for_not_being_votable_by(user)).to eq(:not_voting_allowed)
+ end
+
+ it "accepts valid votes when voting is allowed" do
+ Setting["feature.spending_proposal_features.voting_allowed"] = true
+ expect(city_sp.reason_for_not_being_votable_by(user)).to be_nil
+ expect(district_sp.reason_for_not_being_votable_by(user)).to be_nil
+ end
+ end
+ end
+
describe "responsible_name" do
let(:user) { create(:user, document_number: "123456") }
let!(:spending_proposal) { create(:spending_proposal, author: user) }
diff --git a/spec/support/common_actions.rb b/spec/support/common_actions.rb
index f3d4a8697..762119130 100644
--- a/spec/support/common_actions.rb
+++ b/spec/support/common_actions.rb
@@ -174,6 +174,11 @@ module CommonActions
expect(page).to have_selector('.in-favor a', visible: false)
end
+ def expect_message_voting_not_allowed
+ expect(page).to have_content 'Voting phase is closed'
+ expect(page).to have_selector('.in-favor a', visible: false)
+ end
+
def create_featured_proposals
[create(:proposal, :with_confidence_score, cached_votes_up: 100),
create(:proposal, :with_confidence_score, cached_votes_up: 90),
From 3a6d9d639a8914aa188c3f3ce07059fdc8553df5 Mon Sep 17 00:00:00 2001
From: Amaia Castro
Date: Sat, 16 Apr 2016 11:13:01 +0200
Subject: [PATCH 0072/1685] Fix typo in README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 2cdaddb19..e6181f38c 100644
--- a/README.md
+++ b/README.md
@@ -72,7 +72,7 @@ To test authentication services with external OAuth suppliers - right now Twitte
In the case of Google, verify that the APIs *Contacts API* and *Google+ API* are enabled for the application.
-## Licence
+## License
Code published under AFFERO GPL v3 (see [LICENSE-AGPLv3.txt](LICENSE-AGPLv3.txt))
From fc0ea93cefede4c001208edc8259bc4659352e91 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Sun, 17 Apr 2016 10:55:42 +0200
Subject: [PATCH 0073/1685] adds setting to dev_seeds
---
db/dev_seeds.rb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/db/dev_seeds.rb b/db/dev_seeds.rb
index ffbc8237d..e4365d244 100644
--- a/db/dev_seeds.rb
+++ b/db/dev_seeds.rb
@@ -13,6 +13,7 @@ Setting.create(key: 'max_votes_for_debate_edit', value: '1000')
Setting.create(key: 'max_votes_for_proposal_edit', value: '1000')
Setting.create(key: 'proposal_code_prefix', value: 'MAD')
Setting.create(key: 'votes_for_proposal_success', value: '100')
+Setting.create(key: 'comments_body_max_length', value: '1000')
Setting.create(key: 'blog_url', value: '/blog')
Setting.create(key: 'url', value: 'http://localhost:3000')
@@ -20,11 +21,11 @@ Setting.create(key: 'org_name', value: 'Consul')
Setting.create(key: 'place_name', value: 'City')
Setting.create(key: 'feature.debates', value: "true")
Setting.create(key: 'feature.spending_proposals', value: "true")
+Setting.create(key: 'feature.spending_proposal_features.voting_allowed', value: "true")
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: 'comments_body_max_length', value: '1000')
puts "Creating Geozones"
('A'..'Z').each{ |i| Geozone.create(name: "District #{i}") }
From 11bcdf02110801159e15fc2a883df03a6f94a3ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Mon, 18 Apr 2016 12:04:18 +0200
Subject: [PATCH 0074/1685] changes reasons order, :not_voting_allowed first
---
app/models/spending_proposal.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/spending_proposal.rb b/app/models/spending_proposal.rb
index 7a3dda7c6..d8ae2acf0 100644
--- a/app/models/spending_proposal.rb
+++ b/app/models/spending_proposal.rb
@@ -113,11 +113,11 @@ class SpendingProposal < ActiveRecord::Base
end
def reason_for_not_being_votable_by(user)
+ return :not_voting_allowed if Setting["feature.spending_proposal_features.voting_allowed"].blank?
return :not_logged_in unless user
return :not_verified unless user.can?(:vote, SpendingProposal)
return :unfeasible if unfeasible?
return :organization if user.organization?
- return :not_voting_allowed if Setting["feature.spending_proposal_features.voting_allowed"].blank?
end
def votable_by?(user)
From c9393390200f6aa7b8d7d3ec001301c4a81ae65a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Mon, 18 Apr 2016 12:04:50 +0200
Subject: [PATCH 0075/1685] shows voting button for sps only if voting allowed
---
app/assets/stylesheets/participation.scss | 6 ++++++
app/views/spending_proposals/_votes.html.erb | 16 +++++++++-------
spec/support/common_actions.rb | 2 +-
3 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss
index 0873e7c7c..270005f88 100644
--- a/app/assets/stylesheets/participation.scss
+++ b/app/assets/stylesheets/participation.scss
@@ -870,6 +870,12 @@
}
}
+.investment-project .supports .total-supports.no-button,
+.investment-project-show .supports .total-supports.no-button {
+ display: block;
+ margin-top: $line-height*1.5;
+}
+
// 05. Featured
// - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/app/views/spending_proposals/_votes.html.erb b/app/views/spending_proposals/_votes.html.erb
index 8dbc2aa3f..85220d6c9 100644
--- a/app/views/spending_proposals/_votes.html.erb
+++ b/app/views/spending_proposals/_votes.html.erb
@@ -1,15 +1,19 @@
-
+ <% reason = spending_proposal.reason_for_not_being_votable_by(current_user) %>
+ <% voting_allowed = true unless reason.presence == :not_voting_allowed %>
+ <% user_voted_for = voted_for?(@spending_proposal_votes, spending_proposal) %>
+
+
<%= t("spending_proposals.spending_proposal.supports", count: spending_proposal.total_votes) %>
- <% if voted_for?(@spending_proposal_votes, spending_proposal) %>
+ <% if user_voted_for %>
<%= t("spending_proposals.spending_proposal.already_supported") %>
- <% else %>
+ <% elsif voting_allowed %>
<%= link_to vote_url,
class: "button button-support small expanded",
title: t('spending_proposals.spending_proposal.support_title'), method: "post", remote: true do %>
@@ -18,9 +22,7 @@
<% end %>
- <% reason = spending_proposal.reason_for_not_being_votable_by(current_user) %>
-
- <% if reason.present? && !voted_for?(@spending_proposal_votes, spending_proposal) %>
+ <% if reason.present? && !user_voted_for %>
<%= t("votes.spending_proposals.#{reason}",
@@ -32,7 +34,7 @@
<% end %>
- <% if voted_for?(@spending_proposal_votes, spending_proposal) && setting['twitter_handle'] %>
+ <% if user_voted_for && setting['twitter_handle'] %>
<%= social_share_button_tag("#{spending_proposal.title} #{setting['twitter_hashtag']}", url: spending_proposal_url(spending_proposal), via: setting['twitter_handle']) %>
diff --git a/spec/support/common_actions.rb b/spec/support/common_actions.rb
index 762119130..340d7c8a7 100644
--- a/spec/support/common_actions.rb
+++ b/spec/support/common_actions.rb
@@ -176,7 +176,7 @@ module CommonActions
def expect_message_voting_not_allowed
expect(page).to have_content 'Voting phase is closed'
- expect(page).to have_selector('.in-favor a', visible: false)
+ expect(page).to_not have_selector('.in-favor a')
end
def create_featured_proposals
From f2e0059c96ad40faf59865b7916b7259b02a6479 Mon Sep 17 00:00:00 2001
From: rgarcia
Date: Mon, 18 Apr 2016 19:58:01 +0200
Subject: [PATCH 0076/1685] activates newsletter by default
---
db/migrate/20160418172919_activate_newsletter_by_default.rb | 5 +++++
db/schema.rb | 4 ++--
2 files changed, 7 insertions(+), 2 deletions(-)
create mode 100644 db/migrate/20160418172919_activate_newsletter_by_default.rb
diff --git a/db/migrate/20160418172919_activate_newsletter_by_default.rb b/db/migrate/20160418172919_activate_newsletter_by_default.rb
new file mode 100644
index 000000000..cdee85f1b
--- /dev/null
+++ b/db/migrate/20160418172919_activate_newsletter_by_default.rb
@@ -0,0 +1,5 @@
+class ActivateNewsletterByDefault < ActiveRecord::Migration
+ def change
+ change_column :users, :newsletter, :boolean, default: true
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 35d28fc78..223a14d47 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20160415150524) do
+ActiveRecord::Schema.define(version: 20160418172919) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -416,7 +416,7 @@ ActiveRecord::Schema.define(version: 20160415150524) do
t.string "erase_reason"
t.datetime "erased_at"
t.boolean "public_activity", default: true
- t.boolean "newsletter", default: false
+ t.boolean "newsletter", default: true
t.integer "notifications_count", default: 0
t.boolean "registering_with_oauth", default: false
t.string "locale"
From 08db8a6b1741cf2145b778e81eec063393ef7d4e Mon Sep 17 00:00:00 2001
From: rgarcia
Date: Mon, 18 Apr 2016 20:08:05 +0200
Subject: [PATCH 0077/1685] fixes specs
---
spec/models/user_spec.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index c63959a64..4d1b269ec 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -79,8 +79,8 @@ describe User do
end
describe 'subscription_to_website_newsletter' do
- it 'should be false by default' do
- expect(subject.newsletter).to eq(false)
+ it 'should be true by default' do
+ expect(subject.newsletter).to eq(true)
end
end
end
From 42502cecb73906ee04de22ede3f6ec7aecffe834 Mon Sep 17 00:00:00 2001
From: Alberto Garcia Cabeza
Date: Tue, 19 Apr 2016 00:08:12 +0200
Subject: [PATCH 0078/1685] Fixes youtu.be embedded videos
---
app/helpers/embed_videos_helper.rb | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/app/helpers/embed_videos_helper.rb b/app/helpers/embed_videos_helper.rb
index b53aeef21..b48799bf5 100644
--- a/app/helpers/embed_videos_helper.rb
+++ b/app/helpers/embed_videos_helper.rb
@@ -1,30 +1,30 @@
module EmbedVideosHelper
def embedded_video_code
- link = @proposal.video_url
+ link = @proposal.video_url
if link.match(/vimeo.*/)
server = "Vimeo"
elsif link.match(/youtu*.*/)
server = "YouTube"
- end
-
+ end
+
if server == "Vimeo"
regExp = /vimeo.*(staffpicks\/|channels\/|videos\/|video\/|\/)([^#\&\?]*).*/
src = "https://player.vimeo.com/video/"
elsif server == "YouTube"
- regExp = /youtu.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/
- src = "https://www.youtube.com/embed/"
+ regExp = /youtu.*(be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/
+ src = "https://www.youtube.com/embed/"
end
-
- if regExp
+
+ if regExp
match = link.match(regExp)
end
if match and match[2]
''
- else
+ else
''
end
- end
+ end
end
\ No newline at end of file
From 84a743878612d44afe8fcfe998764cfce7fff537 Mon Sep 17 00:00:00 2001
From: Alberto Garcia Cabeza
Date: Tue, 19 Apr 2016 00:08:50 +0200
Subject: [PATCH 0079/1685] Improves styles for long proposals show texts
---
app/assets/stylesheets/participation.scss | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss
index 270005f88..d897a2a28 100644
--- a/app/assets/stylesheets/participation.scss
+++ b/app/assets/stylesheets/participation.scss
@@ -339,6 +339,10 @@
.debate-show, .proposal-show, .investment-project-show {
+ p {
+ word-wrap: break-word;
+ }
+
.social-share-full .social-share-button {
display:inline;
}
From 038a520987b56a86a6502b8f0e2e8b992e45933b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Tue, 19 Apr 2016 13:05:08 +0200
Subject: [PATCH 0080/1685] updates dependencies and specs
---
Gemfile | 2 +-
Gemfile.lock | 30 +++++++++----------
.../admin/spending_proposals/show.html.erb | 2 +-
spec/features/admin/tags_spec.rb | 4 +--
4 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/Gemfile b/Gemfile
index e925fb642..628f8c10d 100644
--- a/Gemfile
+++ b/Gemfile
@@ -74,7 +74,7 @@ group :development, :test do
gem 'quiet_assets'
gem 'letter_opener_web', '~> 1.3.0'
gem 'i18n-tasks'
- gem 'capistrano', '3.4.0', require: false
+ gem 'capistrano', '3.4.1', require: false
gem "capistrano-bundler", '1.1.4', require: false
gem "capistrano-rails", '1.1.6', require: false
gem "capistrano-rvm", require: false
diff --git a/Gemfile.lock b/Gemfile.lock
index 755561fb2..6d41a3669 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -76,9 +76,9 @@ GEM
bullet (5.0.0)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.9.0)
- byebug (8.2.2)
+ byebug (8.2.4)
cancancan (1.13.1)
- capistrano (3.4.0)
+ capistrano (3.4.1)
i18n
rake (>= 10.0.0)
sshkit (~> 1.3)
@@ -91,9 +91,9 @@ GEM
capistrano-rvm (0.1.2)
capistrano (~> 3.0)
sshkit (~> 1.2)
- capistrano3-delayed-job (1.6.0)
+ capistrano3-delayed-job (1.7.0)
capistrano (>= 3.0.0)
- capybara (2.6.2)
+ capybara (2.7.0)
addressable
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
@@ -125,7 +125,7 @@ GEM
tins (~> 1.6.0)
daemons (1.2.3)
dalli (2.7.6)
- database_cleaner (1.5.1)
+ database_cleaner (1.5.2)
debug_inspector (0.0.2)
delayed_job (4.1.1)
activesupport (>= 3.0, < 5.0)
@@ -154,16 +154,16 @@ GEM
errbase (0.0.3)
erubis (2.7.0)
execjs (2.6.0)
- factory_girl (4.5.0)
+ factory_girl (4.7.0)
activesupport (>= 3.0.0)
- factory_girl_rails (4.6.0)
- factory_girl (~> 4.5.0)
+ factory_girl_rails (4.7.0)
+ factory_girl (~> 4.7.0)
railties (>= 3.0.0)
faker (1.6.3)
i18n (~> 0.5)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
- foundation-rails (6.2.0.1)
+ foundation-rails (6.2.1.0)
railties (>= 3.1.0)
sass (>= 3.3.0, < 3.5)
sprockets-es6 (>= 0.9.0)
@@ -233,7 +233,7 @@ GEM
multipart-post (2.0.0)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
- net-ssh (3.0.2)
+ net-ssh (3.1.1)
newrelic_rpm (3.15.1.316)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
@@ -343,7 +343,7 @@ GEM
rspec-support (3.4.1)
ruby-progressbar (1.7.5)
safe_yaml (1.0.4)
- sass (3.4.21)
+ sass (3.4.22)
sass-rails (5.0.4)
railties (>= 4.0.0, < 5.0)
sass (~> 3.1)
@@ -365,10 +365,10 @@ GEM
json (~> 1.8)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
- spring (1.6.4)
+ spring (1.7.1)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
- sprockets (3.5.2)
+ sprockets (3.6.0)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-es6 (0.9.0)
@@ -379,7 +379,7 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
- sshkit (1.8.1)
+ sshkit (1.9.0)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
term-ansicolor (1.3.2)
@@ -438,7 +438,7 @@ DEPENDENCIES
bullet
byebug
cancancan
- capistrano (= 3.4.0)
+ capistrano (= 3.4.1)
capistrano-bundler (= 1.1.4)
capistrano-rails (= 1.1.6)
capistrano-rvm
diff --git a/app/views/admin/spending_proposals/show.html.erb b/app/views/admin/spending_proposals/show.html.erb
index c54816071..64313e030 100644
--- a/app/views/admin/spending_proposals/show.html.erb
+++ b/app/views/admin/spending_proposals/show.html.erb
@@ -1,4 +1,4 @@
-<%= link_to admin_spending_proposals_path(SpendingProposal.filter_params(params)) do %>
+<%= link_to admin_spending_proposals_path(SpendingProposal.filter_params(params)), data: {no_turbolink: true} do %>
<%= t("admin.spending_proposals.show.back") %>
<% end %>
diff --git a/spec/features/admin/tags_spec.rb b/spec/features/admin/tags_spec.rb
index 74579c1b8..b944cdd9e 100644
--- a/spec/features/admin/tags_spec.rb
+++ b/spec/features/admin/tags_spec.rb
@@ -33,7 +33,7 @@ feature 'Admin tags' do
scenario 'Update' do
visit admin_tags_path
featured_checkbox = find("#tag_featured_#{@tag1.id}")
- expect(featured_checkbox.checked?).to be_nil
+ expect(featured_checkbox.checked?).to be_blank
within("#edit_tag_#{@tag1.id}") do
check "tag_featured_#{@tag1.id}"
@@ -42,7 +42,7 @@ feature 'Admin tags' do
visit admin_tags_path
featured_checkbox = find("#tag_featured_#{@tag1.id}")
- expect(featured_checkbox.checked?).to eq('checked')
+ expect(featured_checkbox.checked?).to eq(true)
end
scenario 'Delete' do
From 87d2d74f6630d1540284ecbfe514235f5d5fdac3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Tue, 19 Apr 2016 13:27:16 +0200
Subject: [PATCH 0081/1685] updates devise & ahoy
---
Gemfile | 4 +--
Gemfile.lock | 35 +++++++++++++---------
app/views/debates/show.html.erb | 2 +-
app/views/proposals/show.html.erb | 2 +-
app/views/spending_proposals/show.html.erb | 2 +-
5 files changed, 26 insertions(+), 19 deletions(-)
diff --git a/Gemfile b/Gemfile
index 628f8c10d..ab00df68e 100644
--- a/Gemfile
+++ b/Gemfile
@@ -19,7 +19,7 @@ gem 'jquery-ui-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
-gem 'devise', '~> 3.5.6'
+gem 'devise', '~> 3.5.7'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
gem 'omniauth'
@@ -52,7 +52,7 @@ gem 'newrelic_rpm', '~> 3.14'
gem 'whenever', require: false
gem 'pg_search'
-gem 'ahoy_matey', '~> 1.2.1'
+gem 'ahoy_matey', '~> 1.4.0'
gem 'groupdate' # group temporary data
gem 'tolk' # Web interface for translations
diff --git a/Gemfile.lock b/Gemfile.lock
index 6d41a3669..12cb537d3 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -49,14 +49,15 @@ GEM
activerecord (>= 3.2, < 5)
acts_as_votable (0.10.0)
addressable (2.4.0)
- ahoy_matey (1.2.1)
+ ahoy_matey (1.4.0)
addressable
- browser (>= 0.4.0)
- errbase
+ browser (~> 2.0)
geocoder
- rails
+ rack-attack
+ railties
referer-parser (>= 0.3.0)
request_store
+ safely_block
user_agent_parser
uuidtools
akami (1.3.1)
@@ -70,8 +71,8 @@ GEM
babel-transpiler (0.7.0)
babel-source (>= 4.0, < 6)
execjs (~> 2.0)
- bcrypt (3.1.10)
- browser (1.1.0)
+ bcrypt (3.1.11)
+ browser (2.0.3)
builder (3.2.2)
bullet (5.0.0)
activesupport (>= 3.0.0)
@@ -132,7 +133,7 @@ GEM
delayed_job_active_record (4.1.0)
activerecord (>= 3.0, < 5)
delayed_job (>= 3.0, < 5)
- devise (3.5.6)
+ devise (3.5.7)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 3.2.6, < 5)
@@ -176,7 +177,7 @@ GEM
fuubar (2.0.0)
rspec (~> 3.0)
ruby-progressbar (~> 1.4)
- geocoder (1.3.1)
+ geocoder (1.3.4)
globalid (0.3.6)
activesupport (>= 4.1.0)
groupdate (2.5.2)
@@ -223,9 +224,11 @@ GEM
railties (>= 3.2)
loofah (2.0.3)
nokogiri (>= 1.5.9)
- mail (2.6.3)
- mime-types (>= 1.16, < 3)
- mime-types (2.99.1)
+ mail (2.6.4)
+ mime-types (>= 1.16, < 4)
+ mime-types (3.0)
+ mime-types-data (~> 3.2015)
+ mime-types-data (3.2016.0221)
mini_portile2 (2.0.0)
minitest (5.8.4)
multi_json (1.11.2)
@@ -284,6 +287,8 @@ GEM
rack (1.6.4)
rack-accept (0.4.5)
rack (>= 0.4)
+ rack-attack (4.4.1)
+ rack
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.6)
@@ -314,7 +319,7 @@ GEM
rake (11.1.2)
redcarpet (3.3.4)
referer-parser (0.3.0)
- request_store (1.3.0)
+ request_store (1.3.1)
responders (2.1.2)
railties (>= 4.2.0, < 5.1)
rinku (1.7.3)
@@ -343,6 +348,8 @@ GEM
rspec-support (3.4.1)
ruby-progressbar (1.7.5)
safe_yaml (1.0.4)
+ safely_block (0.1.0)
+ errbase
sass (3.4.22)
sass-rails (5.0.4)
railties (>= 4.0.0, < 5.0)
@@ -432,7 +439,7 @@ PLATFORMS
DEPENDENCIES
acts-as-taggable-on
acts_as_votable
- ahoy_matey (~> 1.2.1)
+ ahoy_matey (~> 1.4.0)
ancestry
browser
bullet
@@ -451,7 +458,7 @@ DEPENDENCIES
dalli
database_cleaner
delayed_job_active_record (~> 4.1.0)
- devise (~> 3.5.6)
+ devise (~> 3.5.7)
devise-async
email_spec
factory_girl_rails
diff --git a/app/views/debates/show.html.erb b/app/views/debates/show.html.erb
index b0aa58ce4..cfce656a2 100644
--- a/app/views/debates/show.html.erb
+++ b/app/views/debates/show.html.erb
@@ -56,7 +56,7 @@
<%= t("debates.show.share") %>
<%= social_share_button_tag("#{@debate.title} #{setting['twitter_hashtag']}") %>
- <% if browser.mobile? %>
+ <% if browser.device.mobile? %>
diff --git a/app/views/proposals/show.html.erb b/app/views/proposals/show.html.erb
index 6550ece24..0a5b35c0c 100644
--- a/app/views/proposals/show.html.erb
+++ b/app/views/proposals/show.html.erb
@@ -96,7 +96,7 @@
<%= t("proposals.show.share") %>
<%= social_share_button_tag("#{@proposal.title} #{setting['twitter_hashtag']}") %>
- <% if browser.mobile? %>
+ <% if browser.device.mobile? %>
diff --git a/app/views/spending_proposals/show.html.erb b/app/views/spending_proposals/show.html.erb
index 99aab4e17..0da045860 100644
--- a/app/views/spending_proposals/show.html.erb
+++ b/app/views/spending_proposals/show.html.erb
@@ -44,7 +44,7 @@
<%= t("spending_proposals.show.share") %>
<%= social_share_button_tag("#{@spending_proposal.title} #{setting['twitter_hashtag']}") %>
- <% if browser.mobile? %>
+ <% if browser.device.mobile? %>
From f776f863bb912877b33951647723c620ff32df7a Mon Sep 17 00:00:00 2001
From: kikito
Date: Fri, 15 Apr 2016 16:29:01 +0200
Subject: [PATCH 0082/1685] Adds missing step to oauth spec
---
spec/features/users_auth_spec.rb | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/spec/features/users_auth_spec.rb b/spec/features/users_auth_spec.rb
index a1c9374be..f9b92bb12 100644
--- a/spec/features/users_auth_spec.rb
+++ b/spec/features/users_auth_spec.rb
@@ -169,6 +169,12 @@ feature 'Users' do
expect(current_path).to eq(finish_signup_path)
+ expect(page).to have_field('user_username', with: 'manuela')
+
+ click_button 'Register'
+
+ expect(current_path).to eq(do_finish_signup_path)
+
fill_in 'user_username', with: 'manuela2'
click_button 'Register'
From 3cd12bd6eade68d67687f654bb61683c75e8a45c Mon Sep 17 00:00:00 2001
From: kikito
Date: Fri, 15 Apr 2016 16:29:57 +0200
Subject: [PATCH 0083/1685] Simplifies use of registering_with_oauth in User
Now we just ignore all validations when saving a user for oauth
---
app/models/user.rb | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/app/models/user.rb b/app/models/user.rb
index f7980c796..113781ef1 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -182,11 +182,11 @@ class User < ActiveRecord::Base
end
def username_required?
- !organization? && !erased? && !registering_with_oauth
+ !organization? && !erased?
end
def email_required?
- !erased? && !registering_with_oauth
+ !erased?
end
def has_official_email?
@@ -215,11 +215,15 @@ class User < ActiveRecord::Base
end
def save_requiring_finish_signup
- self.update(registering_with_oauth: true)
- end
-
- def save_requiring_finish_signup_without_email
- self.update(registering_with_oauth: true, email: nil)
+ begin
+ self.registering_with_oauth= true
+ self.save(validate: false)
+ # Devise puts unique constraints for the email the db, so we must detect & handle that
+ rescue ActiveRecord::RecordNotUnique
+ self.email = nil
+ self.save(validate: false)
+ end
+ true
end
def ability
From f86912c77c7bd8f51ba9e1bf3ad0531f0ccc1c58 Mon Sep 17 00:00:00 2001
From: kikito
Date: Fri, 15 Apr 2016 16:32:42 +0200
Subject: [PATCH 0084/1685] Adapts to new User api
---
app/controllers/users/omniauth_callbacks_controller.rb | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb
index 0bdd2a801..81eaa08cb 100644
--- a/app/controllers/users/omniauth_callbacks_controller.rb
+++ b/app/controllers/users/omniauth_callbacks_controller.rb
@@ -41,9 +41,7 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
end
def save_user(user)
- @user.save ||
- @user.save_requiring_finish_signup ||
- @user.save_requiring_finish_signup_without_email
+ @user.save || @user.save_requiring_finish_signup
end
end
From 3504a27ca3c6e2ba98f0aa635b1b1c08a7da230e Mon Sep 17 00:00:00 2001
From: kikito
Date: Mon, 18 Apr 2016 13:03:05 +0200
Subject: [PATCH 0085/1685] limits username uniqueness when registering with
oauth
---
app/models/user.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/user.rb b/app/models/user.rb
index 113781ef1..e8b885e0d 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -26,7 +26,7 @@ class User < ActiveRecord::Base
belongs_to :geozone
validates :username, presence: true, if: :username_required?
- validates :username, uniqueness: true, if: :username_required?
+ validates :username, uniqueness: { scope: :registering_with_oauth }, if: :username_required?
validates :document_number, uniqueness: { scope: :document_type }, allow_nil: true
validate :validate_username_length
From 3637c95fe2b121aedf743b05a91e2b5ce87811e3 Mon Sep 17 00:00:00 2001
From: kikito
Date: Mon, 18 Apr 2016 16:07:53 +0200
Subject: [PATCH 0086/1685] adds note to finish_signup
---
app/views/users/registrations/finish_signup.html.erb | 4 ++++
config/locales/en.yml | 1 +
config/locales/es.yml | 1 +
3 files changed, 6 insertions(+)
diff --git a/app/views/users/registrations/finish_signup.html.erb b/app/views/users/registrations/finish_signup.html.erb
index fa7bb621e..79f160a51 100644
--- a/app/views/users/registrations/finish_signup.html.erb
+++ b/app/views/users/registrations/finish_signup.html.erb
@@ -3,6 +3,10 @@
<%= form_for current_user, as: :user, url: do_finish_signup_path, html: { role: 'form'} do |f| %>
<%= render 'shared/errors', resource: current_user %>
+
+ <%= t("omniauth.finish_signup.username_warning") %>
+
+
<% if current_user.errors.include? :username %>
<%= f.text_field :username, placeholder: t("devise_views.users.registrations.new.username_label") %>
<% else %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 8609c079c..b5899e63a 100755
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -542,6 +542,7 @@ en:
omniauth:
finish_signup:
title: "Additional details"
+ username_warning: "Due to a change in the way we interact with social networks, it is possible that your username now appears as 'already in use'. If that is your case, please choose a different username."
twitter:
sign_in: "Sign in with Twitter"
sign_up: "Sign up with Twitter"
diff --git a/config/locales/es.yml b/config/locales/es.yml
index a15528d5a..468bb2dd7 100755
--- a/config/locales/es.yml
+++ b/config/locales/es.yml
@@ -542,6 +542,7 @@ es:
omniauth:
finish_signup:
title: "Detalles adicionales de tu cuenta"
+ username_warning: "Debido a que hemos cambiado la forma en la que nos conectamos con redes sociales y es que tu nombre de usuario aparezca como 'ya en uso', incluso si antes podías acceder con él. Si es tu caso, por favor elije un nombre de usuario distinto."
twitter:
sign_in: "Entra con Twitter"
sign_up: "Regístrate con Twitter"
From d752a334f86f7e1a1ee43180c335c935ddd8ffb6 Mon Sep 17 00:00:00 2001
From: kikito
Date: Mon, 18 Apr 2016 16:48:35 +0200
Subject: [PATCH 0087/1685] adds index for username
---
db/migrate/20160418144013_add_index_to_username.rb | 5 +++++
db/schema.rb | 1 +
2 files changed, 6 insertions(+)
create mode 100644 db/migrate/20160418144013_add_index_to_username.rb
diff --git a/db/migrate/20160418144013_add_index_to_username.rb b/db/migrate/20160418144013_add_index_to_username.rb
new file mode 100644
index 000000000..191f24ac6
--- /dev/null
+++ b/db/migrate/20160418144013_add_index_to_username.rb
@@ -0,0 +1,5 @@
+class AddIndexToUsername < ActiveRecord::Migration
+ def change
+ add_index :users, :username
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 223a14d47..49f0011f2 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -432,6 +432,7 @@ ActiveRecord::Schema.define(version: 20160418172919) do
add_index "users", ["geozone_id"], name: "index_users_on_geozone_id", using: :btree
add_index "users", ["hidden_at"], name: "index_users_on_hidden_at", using: :btree
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
+ add_index "users", ["username"], name: "index_users_on_username", using: :btree
create_table "valuation_assignments", force: :cascade do |t|
t.integer "valuator_id"
From 581253219b6d1869e4dae308711a6ca0a1dbd8e5 Mon Sep 17 00:00:00 2001
From: kikito
Date: Mon, 18 Apr 2016 18:13:12 +0200
Subject: [PATCH 0088/1685] adds rake task to mark some users with duplicated
usernames so they change them
---
lib/tasks/users.rake | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/lib/tasks/users.rake b/lib/tasks/users.rake
index c56df2dd0..f0ef16b76 100644
--- a/lib/tasks/users.rake
+++ b/lib/tasks/users.rake
@@ -59,4 +59,16 @@ namespace :users do
end
end
+ desc "Makes duplicate username users change their username"
+ task social_network_reset: :environment do
+ duplicated_usernames = User.all.select(:username).group(:username).having('count(username) > 1').pluck(:username)
+
+ duplicated_usernames.each do |username|
+ print "."
+ user_ids = User.where(username: username).order(created_at: :asc).pluck(:id)
+ user_ids_to_review = Identity.where(user_id: user_ids).pluck(:user_id)
+ user_ids_to_review.shift if user_ids.size == user_ids_to_review.size
+ user_ids_to_review.each { |id| User.find(id).update(registering_with_oauth: true) }
+ end
+ end
end
From e6c42860a75271b56bd34433bc6f3bcd807f5af1 Mon Sep 17 00:00:00 2001
From: kikito
Date: Mon, 18 Apr 2016 18:43:28 +0200
Subject: [PATCH 0089/1685] destroy the identities associated with an user when
the user deletes his account
---
app/models/user.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/models/user.rb b/app/models/user.rb
index e8b885e0d..924219ffd 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -154,6 +154,7 @@ class User < ActiveRecord::Base
confirmed_phone: nil,
unconfirmed_phone: nil
)
+ self.identities.destroy_all
end
def erased?
From 8569e4f22e3d6e488f9c3753df0a5ae3359dcc20 Mon Sep 17 00:00:00 2001
From: kikito
Date: Mon, 18 Apr 2016 18:52:21 +0200
Subject: [PATCH 0090/1685] adds rake task to destroy identities from erased
users
---
lib/tasks/users.rake | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/tasks/users.rake b/lib/tasks/users.rake
index f0ef16b76..efbeeaa94 100644
--- a/lib/tasks/users.rake
+++ b/lib/tasks/users.rake
@@ -71,4 +71,9 @@ namespace :users do
user_ids_to_review.each { |id| User.find(id).update(registering_with_oauth: true) }
end
end
+
+ desc "Removes identities associated to erased users"
+ task remove_erased_identities: :environment do
+ Identity.joins(:user).where('users.erased_at IS NOT NULL').destroy_all
+ end
end
From d577a2b82eb79d13ba3b15eb815c7376ebe3786d Mon Sep 17 00:00:00 2001
From: kikito
Date: Tue, 19 Apr 2016 12:07:20 +0200
Subject: [PATCH 0091/1685] add spec for user identity erasure
---
spec/models/user_spec.rb | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 4d1b269ec..b49e3cc6b 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -333,6 +333,7 @@ describe User do
email_verification_token: "token3",
confirmed_phone:"5678",
unconfirmed_phone:"5678")
+
user.erase('a test')
user.reload
@@ -353,6 +354,14 @@ describe User do
expect(user.confirmation_token).to be_nil
expect(user.reset_password_token).to be_nil
expect(user.email_verification_token).to be_nil
+
+ end
+
+ it "destroys associated identities" do
+ user = create(:user)
+ identity = create(:identity, user: user)
+ user.erase('an identity test')
+ expect(Identity.exists?(identity.id)).to_not be
end
end
From aa351256d072c42f8f33fd315cfa21eea1413a74 Mon Sep 17 00:00:00 2001
From: kikito
Date: Tue, 19 Apr 2016 15:35:02 +0200
Subject: [PATCH 0092/1685] spanish typo
spanish typo
style
---
app/models/user.rb | 2 +-
config/locales/es.yml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/models/user.rb b/app/models/user.rb
index 924219ffd..ea889ac57 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -217,7 +217,7 @@ class User < ActiveRecord::Base
def save_requiring_finish_signup
begin
- self.registering_with_oauth= true
+ self.registering_with_oauth = true
self.save(validate: false)
# Devise puts unique constraints for the email the db, so we must detect & handle that
rescue ActiveRecord::RecordNotUnique
diff --git a/config/locales/es.yml b/config/locales/es.yml
index 468bb2dd7..f1241bb15 100755
--- a/config/locales/es.yml
+++ b/config/locales/es.yml
@@ -542,7 +542,7 @@ es:
omniauth:
finish_signup:
title: "Detalles adicionales de tu cuenta"
- username_warning: "Debido a que hemos cambiado la forma en la que nos conectamos con redes sociales y es que tu nombre de usuario aparezca como 'ya en uso', incluso si antes podías acceder con él. Si es tu caso, por favor elije un nombre de usuario distinto."
+ username_warning: "Debido a que hemos cambiado la forma en la que nos conectamos con redes sociales y es posible que tu nombre de usuario aparezca como 'ya en uso', incluso si antes podías acceder con él. Si es tu caso, por favor elige un nombre de usuario distinto."
twitter:
sign_in: "Entra con Twitter"
sign_up: "Regístrate con Twitter"
From 0648c7f38d6173aa68e7c214b2f2d43a7a145051 Mon Sep 17 00:00:00 2001
From: rgarcia
Date: Tue, 19 Apr 2016 20:26:14 +0200
Subject: [PATCH 0093/1685] removes duplicate graphs
---
app/views/admin/stats/show.html.erb | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/app/views/admin/stats/show.html.erb b/app/views/admin/stats/show.html.erb
index 1966cd586..e043016be 100644
--- a/app/views/admin/stats/show.html.erb
+++ b/app/views/admin/stats/show.html.erb
@@ -83,7 +83,7 @@
<%= t "admin.stats.show.summary.spending_proposals" %>
<%= number_with_delimiter(@spending_proposals) %>
-
+
@@ -103,12 +103,6 @@
<%= spending_proposals_chart_tag id: "spending_proposals" %>
-
- <% @event_types.each do |event, count| %>
-
<%= event.titleize %> (<%= count %>)
- <%= events_chart_tag event %>
- <% end %>
-
From 4a013a65bc66f76bc8017002115d6870b35b73eb Mon Sep 17 00:00:00 2001
From: Alberto Garcia Cabeza
Date: Tue, 19 Apr 2016 23:45:03 +0200
Subject: [PATCH 0094/1685] Fixes subnavigation layout
---
app/views/layouts/_header.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb
index d791fe7b9..921532119 100644
--- a/app/views/layouts/_header.html.erb
+++ b/app/views/layouts/_header.html.erb
@@ -44,7 +44,7 @@
-
+
<%= render "shared/subnavigation" %>
From 6a26bfd92895ba56e84aaaccecdf4c9f8580ff8f Mon Sep 17 00:00:00 2001
From: Alberto Garcia Cabeza
Date: Wed, 20 Apr 2016 15:57:07 +0200
Subject: [PATCH 0095/1685] Updates icons font
---
app/assets/fonts/icons.eot | Bin 9904 -> 10612 bytes
app/assets/fonts/icons.svg | 5 +++++
app/assets/fonts/icons.ttf | Bin 9748 -> 10456 bytes
app/assets/fonts/icons.woff | Bin 7800 -> 8188 bytes
app/assets/stylesheets/icons.scss | 9 +++++++++
5 files changed,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$eQOm}lzyKH)Ht0NmI#s{dsZ4Be(D
zekjO-%pZi?Roy~68{sl$0f$8TR2LXFDc3>oV)Tk(3~?0bPW>A&NcpAOQ|*p4z0a-}
z;iYJ%84_CHhKINn?P!A!egx1#|6nllZgJfTIzC8Sorx8mVH1@q%X|2x|J@o!7&0RK
jRPwQKSdQ>#X_@w(3`|!}0#Sj7f*zrh$AZm{f5-j+B5h+7
diff --git a/app/assets/fonts/icons.svg b/app/assets/fonts/icons.svg
index 51044c3e2..a7f352c4f 100644
--- a/app/assets/fonts/icons.svg
+++ b/app/assets/fonts/icons.svg
@@ -49,4 +49,9 @@
+
+
+
+
+
diff --git a/app/assets/fonts/icons.ttf b/app/assets/fonts/icons.ttf
index b0b1565817b71faba9fe7231ca4b2baec218a300..16401c79b17b15d4338fa8bd4340e1819b376a14 100644
GIT binary patch
delta 1168
zcmYjQU1$_n6#mZc&JVjAGE1@v#YHEX&5xMfP4;gJHg+pDA)we2m0APtsGF>ioov?>
z*F1FRsjVO_?BqeHSYHCAFDgOuP@#dol~NHA1clnZM=0ov4;#;&S=1TsJ@b9v`Ocj)
zbMN}mC!e=K0D9mch|gwbP8@4&-QEVq?=zd2{q)ET&O&BmK9fEEbm4b^zF>Un
ze9fvK{^#H~Kp?@~oh9p1eRr2DVSJr+b!qv^;%}#3{sDyYY=2p;SQnJ*$97nI#-muR
zR$5jl6Oh>4&qT6XTWyB7q#;p^@$&M@dF$b`KYsy&e=%OHSBoTFY|}Jl-9z+v
zUT4n67B)C?6W&O8HGp3kiBFY42tROC`Sy#Q#2Pm(u1{cfpLlV`GSaRc*w>T71k%W0
zKPEBdUJG1RQWNRS{>dpf5!`ei2Ir%_*EC%_q%CM`z-BUZWp7J`&PAT{55O68LNysVcT
z4|&rzZM(Hn>6UX#FEP>5-EwEgA?(5-$IB2?xdW=X9f#kIcLnAGpr?qzKn}AwjT*mP
zykC(I(D3Lq<%abL>09g$YvkQ!XtF1J3GEieH?#k6?+s_
zix#6SeQWX@4x1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!jeySlH
Date: Wed, 20 Apr 2016 16:40:58 +0200
Subject: [PATCH 0096/1685] Best practices code changes
---
app/controllers/debates_controller.rb | 9 +++++++--
app/helpers/debates_helper.rb | 2 +-
app/models/abilities/administrator.rb | 5 ++---
app/models/debate.rb | 2 +-
app/views/debates/_actions.html.erb | 8 ++++----
app/views/debates/_featured_debates.html.erb | 2 +-
app/views/debates/index.html.erb | 4 ++--
config/locales/admin.en.yml | 4 ++--
config/locales/admin.es.yml | 4 ++--
config/routes.rb | 4 ++--
10 files changed, 24 insertions(+), 20 deletions(-)
diff --git a/app/controllers/debates_controller.rb b/app/controllers/debates_controller.rb
index 4a22d2e3e..cd213bd94 100644
--- a/app/controllers/debates_controller.rb
+++ b/app/controllers/debates_controller.rb
@@ -18,6 +18,11 @@ class DebatesController < ApplicationController
helper_method :resource_model, :resource_name
respond_to :html, :js
+ def index
+ super
+ @featured_debates = @debates.featured
+ end
+
def show
super
redirect_to debate_path(@debate), status: :moved_permanently if request.path != debate_path(@debate)
@@ -28,12 +33,12 @@ class DebatesController < ApplicationController
set_debate_votes(@debate)
end
- def remove_feature
+ def unmark_featured
@debate.update_attribute(:featured_at, nil)
redirect_to request.query_parameters.merge(action: :index)
end
- def feature
+ def mark_featured
@debate.update_attribute(:featured_at, Time.now)
redirect_to request.query_parameters.merge(action: :index)
end
diff --git a/app/helpers/debates_helper.rb b/app/helpers/debates_helper.rb
index d12db7f78..3c1aa02a7 100644
--- a/app/helpers/debates_helper.rb
+++ b/app/helpers/debates_helper.rb
@@ -1,6 +1,6 @@
module DebatesHelper
- def has_featured
+ def has_featured?
Debate.all.featured.count > 0
end
end
\ No newline at end of file
diff --git a/app/models/abilities/administrator.rb b/app/models/abilities/administrator.rb
index 9727e8e35..55759959e 100644
--- a/app/models/abilities/administrator.rb
+++ b/app/models/abilities/administrator.rb
@@ -30,9 +30,8 @@ module Abilities
can :confirm_hide, User
cannot :confirm_hide, User, hidden_at: nil
- can :feature, Debate
-
- can :remove_feature, Debate
+ can :mark_featured, Debate
+ can :unmark_featured, Debate
can :comment_as_administrator, [Debate, Comment, Proposal]
diff --git a/app/models/debate.rb b/app/models/debate.rb
index 249ae0c44..cdae527f7 100644
--- a/app/models/debate.rb
+++ b/app/models/debate.rb
@@ -134,7 +134,7 @@ class Debate < ActiveRecord::Base
end
def featured?
- ! self.featured_at.nil?
+ self.featured_at.present?
end
end
diff --git a/app/views/debates/_actions.html.erb b/app/views/debates/_actions.html.erb
index b88d4830c..1b61e045b 100644
--- a/app/views/debates/_actions.html.erb
+++ b/app/views/debates/_actions.html.erb
@@ -9,13 +9,13 @@
method: :put, data: { confirm: t('admin.actions.confirm') } %>
<% end %>
-<% if can? :feature, debate %>
- |
+<% if can? :mark_featured, debate %>
+ |
<% if debate.featured? %>
- <%= link_to t("admin.actions.remove_feature").capitalize, remove_feature_debate_path(debate),
+ <%= link_to t("admin.actions.unmark_featured").capitalize, unmark_featured_debate_path(debate),
method: :put, data: { confirm: t('admin.actions.confirm') } %>
<% else %>
- <%= link_to t("admin.actions.feature").capitalize, feature_debate_path(debate),
+ <%= link_to t("admin.actions.mark_featured").capitalize, mark_featured_debate_path(debate),
method: :put, data: { confirm: t('admin.actions.confirm') } %>
<% end %>
<% end %>
diff --git a/app/views/debates/_featured_debates.html.erb b/app/views/debates/_featured_debates.html.erb
index e678e2da8..577a6da77 100644
--- a/app/views/debates/_featured_debates.html.erb
+++ b/app/views/debates/_featured_debates.html.erb
@@ -4,7 +4,7 @@
<%= t("debates.index.featured_debates") %>
- <% @debates.featured.each do |debate| %>
+ <% @featured_debates.each do |debate| %>
<%= link_to debate.title, debate %>
<%= link_to debate.author.name, user_path(debate.author)%>
diff --git a/app/views/debates/index.html.erb b/app/views/debates/index.html.erb
index 7ee9d12d4..ab0a137c7 100644
--- a/app/views/debates/index.html.erb
+++ b/app/views/debates/index.html.erb
@@ -25,8 +25,8 @@
<% end %>
- <% unless @tag_filter || @search_terms || !has_featured %>
- <%= render "featured_debates", debate: @debates.featured %>
+ <% unless @tag_filter || @search_terms || !has_featured? %>
+ <%= render "featured_debates" %>
<% end %>
<%= render "shared/advanced_search", search_path: debates_path(page: 1) %>
diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml
index 024c0140d..60b615562 100755
--- a/config/locales/admin.en.yml
+++ b/config/locales/admin.en.yml
@@ -7,8 +7,8 @@ en:
hide: Hide
hide_author: Hide author
restore: Restore
- feature: Feature
- remove_feature: Remove feature
+ mark_featured: Featured
+ unmark_featured: Unmark featured
activity:
show:
action: Action
diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml
index 0493cedeb..c2a3669d5 100644
--- a/config/locales/admin.es.yml
+++ b/config/locales/admin.es.yml
@@ -7,8 +7,8 @@ es:
hide: Ocultar
hide_author: Bloquear al autor
restore: Volver a mostrar
- feature: Destacar
- remove_feature: Quitar destacado
+ mark_featured: Destacar
+ unmark_featured: Quitar destacado
activity:
show:
action: Acción
diff --git a/config/routes.rb b/config/routes.rb
index 79aa167e5..b9cdbdd3a 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -36,8 +36,8 @@ Rails.application.routes.draw do
post :vote
put :flag
put :unflag
- put :remove_feature
- put :feature
+ put :mark_featured
+ put :unmark_featured
end
collection do
get :map
From e3878ff4377f8b033948154ad0f06822c6be7255 Mon Sep 17 00:00:00 2001
From: Alberto Garcia Cabeza
Date: Wed, 20 Apr 2016 17:27:58 +0200
Subject: [PATCH 0097/1685] Fixes icon animation on reply comments
---
app/assets/javascripts/comments.js.coffee | 8 ++++----
app/assets/stylesheets/layout.scss | 10 +++++++++-
app/assets/stylesheets/participation.scss | 24 +++++++++++++++++++++--
app/views/comments/_comment.html.erb | 4 ++--
4 files changed, 37 insertions(+), 9 deletions(-)
diff --git a/app/assets/javascripts/comments.js.coffee b/app/assets/javascripts/comments.js.coffee
index dd8006b9b..876a89b20 100644
--- a/app/assets/javascripts/comments.js.coffee
+++ b/app/assets/javascripts/comments.js.coffee
@@ -30,11 +30,11 @@ App.Comments =
$("#js-comment-form-#{id}").toggle()
toggle_arrow: (id) ->
- arrow = "i##{id}_arrow"
- if $(arrow).hasClass("icon-angle-right")
- $(arrow).removeClass("icon-angle-right").addClass("icon-angle-down")
+ arrow = "span##{id}_arrow"
+ if $(arrow).hasClass("icon-arrow-right")
+ $(arrow).removeClass("icon-arrow-right").addClass("icon-arrow-down")
else
- $(arrow).removeClass("icon-angle-down").addClass("icon-angle-right")
+ $(arrow).removeClass("icon-arrow-down").addClass("icon-arrow-right")
initialize: ->
$('body .js-add-comment-link').each ->
diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss
index 75f8cf741..24a433285 100644
--- a/app/assets/stylesheets/layout.scss
+++ b/app/assets/stylesheets/layout.scss
@@ -161,7 +161,7 @@ a {
margin-top: rem-calc(-24);
}
-.padding {
+.padding {
padding-bottom: $line-height;
padding-top: $line-height;
}
@@ -533,6 +533,7 @@ footer {
.footer {
background: $footer-bg;
border-top: 6px solid $brand;
+ margin-top: $line-height*2;
padding-top: $line-height;
}
@@ -1586,6 +1587,13 @@ table {
margin: rem-calc(6) 0;
padding: rem-calc(6);
+ [class^="icon-arrow"] {
+ font-size: rem-calc(18);
+ left: -20px;
+ position: absolute;
+ top: 0;
+ }
+
.divider {
color: $text-light;
}
diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss
index d897a2a28..8ede20c2b 100644
--- a/app/assets/stylesheets/participation.scss
+++ b/app/assets/stylesheets/participation.scss
@@ -541,16 +541,27 @@
color: $border;
}
+.investment-project-show p {
+ word-break: break-word;
+}
+
// 04. List participation
// - - - - - - - - - - - - - - - - - - - - - - - - -
-.debates-list, .proposals-list {
+.debates-list, .proposals-list, .investment-projects-list {
@media (min-width: $small-breakpoint) {
margin-bottom: rem-calc(48);
}
}
+.investment-projects-list {
+
+ @media (min-width: $small-breakpoint) {
+ min-height: $line-height*15;
+ }
+}
+
.debate, .proposal, .investment-project {
margin-bottom: 0;
margin-top: 0;
@@ -820,7 +831,7 @@
border-left: 1px solid $border;
margin: 0 rem-calc(-12);
min-height: rem-calc(180);
- padding-top: $line-height*2;
+ padding-top: $line-height*1.5;
&:after {
content: none;
@@ -860,6 +871,15 @@
.no-supports-allowed p, .no-supports-allowed a {
color: white;
}
+
+ .share-supported {
+
+ .social-share-button-twitter,
+ .social-share-button-facebook,
+ .social-share-button-google_plus {
+ color: $budget;
+ }
+ }
}
}
diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb
index 2561c9e4d..4c0830234 100644
--- a/app/views/comments/_comment.html.erb
+++ b/app/views/comments/_comment.html.erb
@@ -73,8 +73,8 @@
<% if comment.children.size > 0 %>
- <%= link_to "", class: "js-toggle-children", data: {'id': "#{dom_id(comment)}"} do %>
- <%= t("comments.comment.responses", count: comment.children.size) %>
+ <%= link_to "", class: "js-toggle-children relative", data: {'id': "#{dom_id(comment)}"} do %>
+ <%= t("comments.comment.responses", count: comment.children.size) %>
<% end %>
<% else %>
<%= t("comments.comment.responses", count: 0) %>
From f771a61a50b1c92e387bfd0c6eaeddee1a8b6bc0 Mon Sep 17 00:00:00 2001
From: MaiteHdezRivas
Date: Thu, 21 Apr 2016 11:13:58 +0200
Subject: [PATCH 0098/1685] Refactoring method on debates controller
---
.../concerns/commentable_actions.rb | 6 ++++
app/controllers/debate_links_controller.rb | 31 -------------------
app/controllers/debates_controller.rb | 9 +++---
3 files changed, 10 insertions(+), 36 deletions(-)
delete mode 100644 app/controllers/debate_links_controller.rb
diff --git a/app/controllers/concerns/commentable_actions.rb b/app/controllers/concerns/commentable_actions.rb
index 01066c8ad..a948948a2 100644
--- a/app/controllers/concerns/commentable_actions.rb
+++ b/app/controllers/concerns/commentable_actions.rb
@@ -9,6 +9,7 @@ module CommentableActions
@resources = @resources.tagged_with(@tag_filter) if @tag_filter
@resources = @resources.page(params[:page]).for_render.send("sort_by_#{@current_order}")
index_customization if index_customization.present?
+ featured_debates if featured_debates.present?
@tag_cloud = tag_cloud
set_resource_votes(@resources)
@@ -152,4 +153,9 @@ module CommentableActions
def index_customization
nil
end
+
+ def featured_debates
+ nil
+ end
+
end
diff --git a/app/controllers/debate_links_controller.rb b/app/controllers/debate_links_controller.rb
deleted file mode 100644
index f6f7c3af8..000000000
--- a/app/controllers/debate_links_controller.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-class DebateLinksController < ApplicationController
- include FeatureFlags
- include CommentableActions
-
- before_action :authenticate_user!, except: [:show]
-
- load_and_authorize_resource class: "Debate"
-
- feature_flag :debates
-
- respond_to :html, :js
-
- private
-
- def create_params
- params.require(:debate).permit(:title, :external_link, :tag_list, :terms_of_service, :captcha, :captcha_key).merge(link_required: true)
- end
-
- def debate_params
- params.require(:debate).permit(:title, :external_link, :tag_list, :terms_of_service, :captcha, :captcha_key).merge(link_required: true)
- end
-
- def after_create_path
- debate_path(@resource)
- end
-
- def resource_model
- Debate
- end
-
-end
diff --git a/app/controllers/debates_controller.rb b/app/controllers/debates_controller.rb
index cd213bd94..c743d58a7 100644
--- a/app/controllers/debates_controller.rb
+++ b/app/controllers/debates_controller.rb
@@ -18,11 +18,6 @@ class DebatesController < ApplicationController
helper_method :resource_model, :resource_name
respond_to :html, :js
- def index
- super
- @featured_debates = @debates.featured
- end
-
def show
super
redirect_to debate_path(@debate), status: :moved_permanently if request.path != debate_path(@debate)
@@ -43,6 +38,10 @@ class DebatesController < ApplicationController
redirect_to request.query_parameters.merge(action: :index)
end
+ def featured_debates
+ @featured_debates = @debates.featured
+ end
+
private
def debate_params
From c86f3516db59028e008864e5006646d4c79b630c Mon Sep 17 00:00:00 2001
From: MaiteHdezRivas
Date: Thu, 21 Apr 2016 11:30:45 +0200
Subject: [PATCH 0099/1685] correct text in the test
---
spec/features/debates_spec.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb
index b7cc3ea3a..9db200f11 100644
--- a/spec/features/debates_spec.rb
+++ b/spec/features/debates_spec.rb
@@ -1017,10 +1017,10 @@ feature 'Debates' do
debate2 = create(:debate, featured_at: Time.now)
visit debate_path(debate1)
- expect(page).to have_content("Feature")
+ expect(page).to have_content("Featured")
visit debate_path(debate2)
- expect(page).to have_content("Remove feature")
+ expect(page).to have_content("Unmark featured")
end
From 54c1c581f9088b9046027aa88d8014c91d85c8be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?=
Date: Thu, 21 Apr 2016 12:00:48 +0200
Subject: [PATCH 0100/1685] uses index_customization in debates_controller
---
app/controllers/concerns/commentable_actions.rb | 5 -----
app/controllers/debates_controller.rb | 8 ++++----
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/app/controllers/concerns/commentable_actions.rb b/app/controllers/concerns/commentable_actions.rb
index a948948a2..332d031a5 100644
--- a/app/controllers/concerns/commentable_actions.rb
+++ b/app/controllers/concerns/commentable_actions.rb
@@ -9,7 +9,6 @@ module CommentableActions
@resources = @resources.tagged_with(@tag_filter) if @tag_filter
@resources = @resources.page(params[:page]).for_render.send("sort_by_#{@current_order}")
index_customization if index_customization.present?
- featured_debates if featured_debates.present?
@tag_cloud = tag_cloud
set_resource_votes(@resources)
@@ -154,8 +153,4 @@ module CommentableActions
nil
end
- def featured_debates
- nil
- end
-
end
diff --git a/app/controllers/debates_controller.rb b/app/controllers/debates_controller.rb
index c743d58a7..b747cd903 100644
--- a/app/controllers/debates_controller.rb
+++ b/app/controllers/debates_controller.rb
@@ -18,6 +18,10 @@ class DebatesController < ApplicationController
helper_method :resource_model, :resource_name
respond_to :html, :js
+ def index_customization
+ @featured_debates = @debates.featured
+ end
+
def show
super
redirect_to debate_path(@debate), status: :moved_permanently if request.path != debate_path(@debate)
@@ -38,10 +42,6 @@ class DebatesController < ApplicationController
redirect_to request.query_parameters.merge(action: :index)
end
- def featured_debates
- @featured_debates = @debates.featured
- end
-
private
def debate_params
From a636ddeb83539b56c3988e63e2bad76cfc515769 Mon Sep 17 00:00:00 2001
From: Alberto Garcia Cabeza
Date: Thu, 21 Apr 2016 14:03:42 +0200
Subject: [PATCH 0101/1685] Removes test page
---
app/views/layouts/_test.html.erb | 38 --------------------------------
1 file changed, 38 deletions(-)
delete mode 100644 app/views/layouts/_test.html.erb
diff --git a/app/views/layouts/_test.html.erb b/app/views/layouts/_test.html.erb
deleted file mode 100644
index 60f6b811b..000000000
--- a/app/views/layouts/_test.html.erb
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
- <%= link_to Setting['org_name'], root_path, class: "logo show-for-small-only" %>
-
-
-
- <%= t("application.menu")%>
-
-
-
-
-
\ No newline at end of file
From 08a17f3b0ef2dd68123aefd017cc72f43fc9caa2 Mon Sep 17 00:00:00 2001
From: Alberto Garcia Cabeza
Date: Thu, 21 Apr 2016 14:05:30 +0200
Subject: [PATCH 0102/1685] Makes generic logos and avatars, and removes unused
images
---
app/assets/images/admin_avatar.png | Bin 1867 -> 0 bytes
app/assets/images/auth_logo.png | Bin 7677 -> 0 bytes
app/assets/images/avatar_admin.png | Bin 0 -> 1489 bytes
...ctive_avatar.png => avatar_collective.png} | Bin
app/assets/images/avatar_moderator.png | Bin 0 -> 1462 bytes
app/assets/images/header_logo_madrid.png | Bin 3066 -> 0 bytes
app/assets/images/header_print_proposals.jpg | Bin 56331 -> 22051 bytes
app/assets/images/logo_email.png | Bin 0 -> 2208 bytes
.../images/logo_email_gobierno_abierto.png | Bin 3231 -> 0 bytes
app/assets/images/logo_header.png | Bin 0 -> 1618 bytes
app/assets/images/logo_madrid_white.png | Bin 4068 -> 0 bytes
app/assets/images/moderator_avatar.png | Bin 1926 -> 0 bytes
app/views/comments/_comment.html.erb | 6 +++---
app/views/layouts/_admin_header.html.erb | 2 +-
app/views/layouts/_header.html.erb | 2 +-
app/views/layouts/devise.html.erb | 2 +-
app/views/layouts/mailer.html.erb | 2 +-
app/views/layouts/management.html.erb | 2 +-
18 files changed, 8 insertions(+), 8 deletions(-)
delete mode 100644 app/assets/images/admin_avatar.png
delete mode 100644 app/assets/images/auth_logo.png
create mode 100644 app/assets/images/avatar_admin.png
rename app/assets/images/{collective_avatar.png => avatar_collective.png} (100%)
create mode 100644 app/assets/images/avatar_moderator.png
delete mode 100644 app/assets/images/header_logo_madrid.png
create mode 100644 app/assets/images/logo_email.png
delete mode 100644 app/assets/images/logo_email_gobierno_abierto.png
create mode 100644 app/assets/images/logo_header.png
delete mode 100644 app/assets/images/logo_madrid_white.png
delete mode 100644 app/assets/images/moderator_avatar.png
diff --git a/app/assets/images/admin_avatar.png b/app/assets/images/admin_avatar.png
deleted file mode 100644
index 28ea4a143f89d279bc28ed689dc229bebf9951f4..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 1867
zcmaJ?X;2eq7~Y`La0#M9RMaIw%a!aVAtyu(IWR&HV-RqPx+EKjB-xlOB;bKs6%?_G
z2UFm?
zFZa>z004L?rbt!93OZl13-RrxbX5||C|s6;&%kuJ4Y8nrSc|2jpu&h`pehv6=FV?M
zqX1w~uwI>lrzqov8qCN*oEV1PXeQVI5EX4VBbqD}2h-6Ey-7rUdZLaB>a`+jGDit3
z%@Q^0gm>eE2f)@_5U?vBG*$^A1v)IB2SQxEaD`hX5zS62thWRjbURmFiQr+6bJ+m%z{`fI)R{Db4@s6r<<&_0S{8tst+(}hI^N+XA
zr6+xO$*kPD9hk8$dv(LKD~<~jiKn!*Tlr#>~=Xf>OA$wSB72d)3yIa21i
zvU#ePt);LNY;+4CEx+-yXFE^p`+I!YrG;T5I@Xu7CqPXLpE*8saY{SF64sLzgkE@=
zQ#Qo&^nz1eaxk={=oD$qJVyL=t)p~P;JCw%v#~2(hkA%AcKsUp))?OPj#Uy_8$H@q
zkWK|QHCh_HJBQxgI)}sEcIQ6oe{JCnWNcHjU**)Hsv~htd){2myuXcu@pp8AQ9#vN
zq3Gf?xMf*U_w$@Ff;rs=?#;5{0r~c4_sgfZUCr|;dsj%24?ZesHTeJOy*pX8uA;Tm
zA0g2=958op9sl|1M=g>58Q0X7N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TcO}3jOjzj8LpAX&itnXHeznVh25_$B{
z@Aq>!xze1d)4}9I`F}Z#`RC;3UDQsJrhp_(#GU#bE
diff --git a/app/assets/images/avatar_admin.png b/app/assets/images/avatar_admin.png
new file mode 100644
index 0000000000000000000000000000000000000000..4f4d23c069329db927be888ed613e94a27febdfa
GIT binary patch
literal 1489
zcmaJ>drT8|9KV8W1O&RsbIag36fx4?wWYK@TKcX7BGXdAT8&
zxacMmb%+Ln2|5jGvVjCe!jQVj#+aL%WDFtfVT1uuc@1|(!2QAeCHH%L^Z9(gpYJ1g
zI4yNkfZv;b000D}=ru;>1U;Xx7qicWKdxtv2wIy#ZzHp5C*~jkB~E4$V2TyXA&dlu
z?<;T?
zG$01Mn#i^2_dAGf`%_Kk{rP4I4#|^2sS9NsSP2>fUDiD|3U$e#1-~eB_n2V_T!7H|
zGU$b<3_}{ICLIJQq_~7D#m}m|>
z8#QWli?NuO49cZxI|{>2r<3axa7jlF%#%nYFv5rVd=7))Q2T5&=Hl3>m?aMyf-*ZS
zcG^PPK#xZ(i`+}gAV%qn6s&fGVcD^bS}YV(GT4RLVICKOtyWK73uuZq5-(+}h^9>Y
z>;!BiC~~jE%=9BWW{J$y?$v=jKt>I!AQb^!B2WbTtDuh~AP$5BtJVdCI2(-$D48%$SBGzby
ziDH!wLBwikk&Ca8{UTTSzg(CR1AE&0pLQ>qm>Ke1mxq^mERR27V`kpL40lU-y9ofi
z70_>oSzyJ
zJ?^}bJ}}a}ab3~{pke!2SNIo$u?@*_*G~AH4#e$LQq)&hW^#*E37JLz08eX+OFlb@!I8t8d9woq0Yn^o%wfBhHp6C^<4x
zHtn6YaXPg9xD+|}8&+N;4;(F06th`tk`VV$FYs*?J_FR=&n%g_GWn2dZoaT8s8iIQ
z=5_vHQfA3<3rl(>s&yJId}P&p^Y!GVLq1_hwJEYlmC9xrSh0n^vz`Au>o(>`7SBAL
z40?|n{j*oe+Xdp*p??2_hU%!cicQI<3Yy06Y|-BWK5s%kJwaY?jGpkVjW~SdwXWVS
dI2vH@21e`exRSa9zw`WLQ?#j?%c|W6{{>deE3W_m
literal 0
HcmV?d00001
diff --git a/app/assets/images/collective_avatar.png b/app/assets/images/avatar_collective.png
similarity index 100%
rename from app/assets/images/collective_avatar.png
rename to app/assets/images/avatar_collective.png
diff --git a/app/assets/images/avatar_moderator.png b/app/assets/images/avatar_moderator.png
new file mode 100644
index 0000000000000000000000000000000000000000..c56a5de60681d80a1146bdf0251370ac477513c8
GIT binary patch
literal 1462
zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1SJ1Ryj={WBuiW)N`mv#O3D+9QW+dm@{>{(
zJaZG%Q-e|yQz{EjrrIztFl%InM3hAM`dB6B=jtVb)aX^@765fKFxc2v6eK2Rr0UTq__OB&@Hb09I0xZL0)vRD^GUf^&XRs)DJWnQpRynYn_wrJkXw
zxw(nCj)IYap{c%svA(f^u92~oiGh`gkpdJb0c|TvNwW%aaf8|g1^l#~=$>Fbx5
zm+O@q>*W`v>l<2HTIw4Z=^Gj80#)c1SLT%@R_NvxE5l51Ni9w;$}A|!%+FH*nV6WA
zUs__T1av9H3%LcpzHo!{ilG4o3^M(S!~%UoJp=vRT#&!Os*6j4QW4I;s=7F&vLIDI
zD784hv?v)EA8E=k&A_n3ZxKi#&^1;r`N^fZsd*)yF1AWQ5xtbm6e}YGVBi_J8M?W-
zI2szdnp!%!8oL@A8oN1L7`Yldn!xmW<`tJD<|U`X^kyRT8sODyG1DQNg6CTHe>1T{ec40Ug6QD#|cid#{Bt^zoOtTM5;nr&V*?8pS5q?!CpQBF3uh&$-V`jphw632saGH97=2LmB1Jb$2$+UI
zOnBl2a^T57H4m8Pi-3tco7>!(fq_ZI)5S5Q;#N|M#{H8H-Up62BpYNg=IRDKPCR=}
zjB!$dpt_-+f>YRGr_Pt{#kxm+SnmJ#iM0k#_Cda0imkxg~5cCb~(w$ND)%V<^
z;_q>FY@71!*dxVu{Wx^zZ@I#z-STxyoK*Jz{T3}F6eWwCmCG$BKqC_P^sY|?%moq({62I5-20eWcE@MJ-b}=4{Hn&h8(B%H6N3
z50zTWJ~@24ecqlwu6AJ)tG-u4NnjX*}9wdp+J+LT{Er
zapN@xU1rh5=ko&9JAPP3`rTu@`EZRkr_Wr0?6~@0jAyoA*~l
z;%fBH9QE27a;5Mc>xGjJZu4eKiCb%IKX3VU%BhngFH#gZ4P_;g*yHOLZ({9bmpgFt
zgTUfttmXUu-K+j-sZ!Ob=(dgZ$E%ctT~h=e+^Kme$;`?ypVfH%epV%}*}5FuQrqq{
zs2q{b--)v!J+0}UTN?_ueDvmEV3A;O5j|}GS0%9sRFZnS`njxgN@xNAg{lsk
literal 0
HcmV?d00001
diff --git a/app/assets/images/header_logo_madrid.png b/app/assets/images/header_logo_madrid.png
deleted file mode 100644
index 50e388cad6dcf5cab1455da1647df3e0035aa3b5..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 3066
zcmaJ@c{r47A0A80NVd@!ozrOySx(Gu8|#c2nKHr=O4OKnnMt!?ETcLlQ$i^WDQk<;
zDN>e>$~III<(%Y5B74bNX*j5FbgJ|H@%6pe^}f&Z{I1`9|F-+Oo;S(UW8*5dHEJLb
zXcf(k;w@i2mtU}o{F|!%wnV<@3#tCXU-%)y7)AsDBC+_v0D{J4gaY0GgCz=o0N8^-
zN~Rnif1y9!oyg>KQH*6DR4i8@M}t82PO$<8GYk+Sf`L#D&jC4gyAFxqupE$nmUIkV
z-~zBYZgCO7FL53|%(yV7Eeq-7h_H_($_coDkb#Kh?%_oeV;zv6d5QARF5k7qWp08c>Wb=jm
zNH$-9aB=zEHH0ah!Q}9kjb@)wbUKm7ixe_=On^plK+1Vg91e>}vcXu}Vr{6_I4f%`
zmTGBBC6g&s5}u5)p{k}LN4xohL2Q1
zATXOoA^F61kM9ue(cKC!$gk*mSfoq2#nydN$jC9(ve!c*yw2Squ+_b|;g3x%<}Hh2
zos_qQbUQ~fm^<(AdUaS~qG@Vi7VgkGK!LoXWi!}Oq6)DzM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