Merge branch 'master' into legislation-module-stable

This commit is contained in:
Amaia Castro
2017-03-25 13:34:49 +01:00
23 changed files with 107 additions and 32 deletions

View File

@@ -12,6 +12,10 @@ require 'capistrano/delayed_job'
require 'whenever/capistrano'
require 'rvm1/capistrano3'
#SCM: Git
require "capistrano/scm/git"
install_plugin Capistrano::SCM::Git
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }

View File

@@ -1,15 +1,19 @@
![Logo of Consul]
(https://raw.githubusercontent.com/consul/consul/master/public/consul_logo.png)
![Logo of Consul](https://raw.githubusercontent.com/consul/consul/master/public/consul_logo.png)
# Consul
Citizen Participation and Open Government Application
[![Join the chat at https://gitter.im/consul/consul](https://badges.gitter.im/consul/consul.svg)](https://gitter.im/consul/consul?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/consul/consul.svg?branch=master)](https://travis-ci.org/consul/consul)
[![Code Climate](https://codeclimate.com/github/consul/consul/badges/gpa.svg)](https://codeclimate.com/github/consul/consul)
[![Dependency Status](https://gemnasium.com/consul/consul.svg)](https://gemnasium.com/consul/consul)
[![Coverage Status](https://coveralls.io/repos/github/consul/consul/badge.svg?branch=master)](https://coveralls.io/github/consul/consul?branch=master)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](http://www.gnu.org/licenses/agpl-3.0)
[![Accessibility conformance](https://img.shields.io/badge/accessibility-WAI:AA-green.svg)](https://www.w3.org/WAI/eval/Overview)
[![A11y issues checked with Rocket Validator](https://rocketvalidator.com/badges/checked_with_rocket_validator.svg?url=https://rocketvalidator.com)](https://rocketvalidator.com/opensource)
[![Join the chat at https://gitter.im/consul/consul](https://badges.gitter.im/consul/consul.svg)](https://gitter.im/consul/consul?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
This is the opensource code repository of the eParticipation website originally developed for the Madrid City government eParticipation website

View File

@@ -1,15 +1,20 @@
![Logotipo de Consul]
(https://raw.githubusercontent.com/consul/consul/master/public/consul_logo.png)
![Logotipo de Consul](https://raw.githubusercontent.com/consul/consul/master/public/consul_logo.png)
# Consul
Aplicación de Participación Ciudadana y Gobierno Abierto
[![Join the chat at https://gitter.im/consul/consul](https://badges.gitter.im/consul/consul.svg)](https://gitter.im/consul/consul?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/consul/consul.svg?branch=master)](https://travis-ci.org/consul/consul)
[![Code Climate](https://codeclimate.com/github/consul/consul/badges/gpa.svg)](https://codeclimate.com/github/consul/consul)
[![Dependency Status](https://gemnasium.com/consul/consul.svg)](https://gemnasium.com/consul/consul)
[![Coverage Status](https://coveralls.io/repos/github/consul/consul/badge.svg?branch=master)](https://coveralls.io/github/consul/consul?branch=master)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](http://www.gnu.org/licenses/agpl-3.0)
[![Accessibility conformance](https://img.shields.io/badge/accessibility-WAI:AA-green.svg)](https://www.w3.org/WAI/eval/Overview)
[![A11y issues checked with Rocket Validator](https://rocketvalidator.com/badges/checked_with_rocket_validator.svg?url=https://rocketvalidator.com)](https://rocketvalidator.com/opensource)
[![Join the chat at https://gitter.im/consul/consul](https://badges.gitter.im/consul/consul.svg)](https://gitter.im/consul/consul?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Este es el repositorio de código abierto de la Aplicación de Participación Ciudadana Consul, creada originariamente por el Ayuntamiento de Madrid.

View File

@@ -32,7 +32,7 @@ class Management::UsersController < Management::BaseController
private
def user_params
params.require(:user).permit(:document_type, :document_number, :username, :email)
params.require(:user).permit(:document_type, :document_number, :username, :email, :date_of_birth)
end
def destroy_session

View File

@@ -2,6 +2,7 @@ module EmbedVideosHelper
def embedded_video_code
link = @proposal.video_url
title = t('proposals.show.embed_video_title', proposal: @proposal.title)
if link.match(/vimeo.*/)
server = "Vimeo"
elsif link.match(/youtu*.*/)
@@ -21,7 +22,7 @@ module EmbedVideosHelper
end
if match and match[2]
'<iframe src="' + src + match[2] + '" frameborder="0" allowfullscreen></iframe>'
'<iframe src="' + src + match[2] + '" style="border:0;" allowfullscreen title="' + title + '"></iframe>'
else
''
end

View File

@@ -10,8 +10,10 @@
<div class="small-12 medium-9 column">
<table>
<thead>
<th><%= Budget.human_attribute_name(:name) %></th>
<th><%= Budget.human_attribute_name(:phase) %></th>
<tr>
<th scope="col"><%= Budget.human_attribute_name(:name) %></th>
<th scope="col"><%= Budget.human_attribute_name(:phase) %></th>
</tr>
</thead>
<tbody>
<% @budgets.each do |budget| %>

View File

@@ -19,6 +19,7 @@
<%= f.submit(t("devise_views.confirmations.new.submit"), class: "button expanded") %>
</div>
</div>
</div>
<% end %>
<%= render "devise/shared/links" %>

View File

@@ -11,6 +11,7 @@
<%= f.submit t("devise_views.passwords.new.send_submit"), class: "button expanded" %>
</div>
</div>
</div>
<% end %>
<%= render "devise/shared/links" %>

View File

@@ -4,7 +4,7 @@
message: t("management.document_verifications.in_census_has_following_permissions"),
permissions: [:debates, :create_proposals, :support_proposals, :vote_proposals] %>
<div class="row">
<div class="row verification account">
<div class="small-12 medium-6 column">
<%= form_for @user, url: management_users_path do |f| %>
<%= f.hidden_field :document_type %>
@@ -15,7 +15,13 @@
<%= f.text_field :email,
label: t('management.email_label'),
placeholder: t('management.email_label') %>
<div class="date-of-birth">
<%= f.label t("management.date_of_birth") %>
<%= f.date_select :date_of_birth,
prompt: true,
start_year: 1900, end_year: 16.years.ago.year,
label: false %>
</div>
<%= f.submit t("management.users.create_user_submit"), class: "button success" %>
<% end %>
</div>

View File

@@ -11,7 +11,8 @@
</li>
<% end %>
<% if feature?(:spending_proposals) && (current_user.administrator? || current_user.valuator?) %>
<% if (feature?(:spending_proposals) || feature?(:budgets)) &&
(current_user.administrator? || current_user.valuator?) %>
<li>
<%= link_to t("layouts.header.valuation"), valuation_root_path %>
</li>

View File

@@ -15,7 +15,6 @@ set :full_app_name, deploysecret(:full_app_name)
set :server_name, deploysecret(:server_name)
set :repo_url, 'https://github.com/consul/consul.git'
set :scm, :git
set :revision, `git rev-parse --short #{fetch(:branch)}`.strip
set :log_level, :info

View File

@@ -58,13 +58,13 @@ es:
attributes:
budget:
name: "Nombre"
description_accepting: "Descripción durante la fase de aceptación"
description_reviewing: "Descripción durante la fase de revisión"
description_selecting: "Descripción durante la fase de selección"
description_accepting: "Descripción durante la fase de presentación de proyectos"
description_reviewing: "Descripción durante la fase de revisión interna"
description_selecting: "Descripción durante la fase de apoyos"
description_valuating: "Descripción durante la fase de evaluación"
description_balloting: "Descripción durante la fase de votación"
description_reviewing_ballots: "Descripción durante la fase de revisión de votos"
description_finished: "Descripción cuando el presupuesto ha finalizado"
description_finished: "Descripción cuando el presupuesto ha finalizado / Resultados"
phase: "Fase"
currency_symbol: "Divisa"
budget/investment:

View File

@@ -25,11 +25,11 @@ en:
unfeasible_title: Unfeasible investments
unfeasible: See unfeasible investments
phase:
accepting: Accepting proposals
reviewing: Reviewing proposals
selecting: Selecting proposals
valuating: Valuating proposals
balloting: Balloting proposals
accepting: Accepting projects
reviewing: Reviewing projects
selecting: Selecting projects
valuating: Valuating projects
balloting: Balloting projects
reviewing_ballots: Reviewing Ballots
finished: Finished budget
index:

View File

@@ -25,13 +25,13 @@ es:
unfeasible_title: Propuestas inviables
unfeasible: Ver propuestas inviables
phase:
accepting: Aceptando propuestas
reviewing: Revisando propuestas
selecting: Selección de propuestas
valuating: Evaluación de propuestas
balloting: Votación de propuestas
reviewing_ballots: Contando resultados
finished: Presupuesto terminado
accepting: Presentación de proyectos
reviewing: Revisión interna de proyectos
selecting: Fase de apoyos
valuating: Evaluación de proyectos
balloting: Votación final
reviewing_ballots: Votación finalizada
finished: Resultados
index:
title: Presupuestos participativos
investments:

View File

@@ -391,6 +391,7 @@ en:
share: Share
send_notification: Send notification
no_notifications: "This proposal has any notifications."
embed_video_title: "Video on %{proposal}"
update:
form:
submit_button: Save changes

View File

@@ -391,6 +391,7 @@ es:
send_notification: Enviar notificación
share: Compartir
no_notifications: "Esta propuesta no tiene notificaciones."
embed_video_title: "Vídeo en %{proposal}"
update:
form:
submit_button: Guardar cambios

View File

@@ -32,6 +32,7 @@ en:
under_age: "You don't have the required age to verify your account."
verify: Verify
email_label: Email
date_of_birth: Date of birth
email_verifications:
already_verified: This user account is already verified.
choose_options: 'Please choose one of the following options:'

View File

@@ -32,6 +32,7 @@ es:
under_age: No tienes edad suficiente para verificar tu cuenta.
verify: Verificar usuario
email_label: Email
date_of_birth: Fecha de nacimiento
email_verifications:
already_verified: Esta cuenta de usuario ya está verificada.
choose_options: 'Elige una de las opciones siguientes:'

View File

@@ -392,7 +392,7 @@ end
puts "Creating Valuation Assignments"
(1..17).to_a.sample.times do
(1..50).to_a.sample.times do
Budget::Investment.reorder("RANDOM()").first.valuators << valuator.valuator
end

View File

@@ -84,7 +84,7 @@ feature 'Admin budgets' do
fill_in 'budget_name', with: 'M30 - Summer campaign'
fill_in 'budget_description_accepting', with: 'Budgeting for summer 2017 maintenance and improvements of the road M-30'
select 'Accepting proposals', from: 'budget[phase]'
select 'Accepting projects', from: 'budget[phase]'
click_button 'Create Participatory budget'

View File

@@ -18,6 +18,7 @@ feature 'Users' do
fill_in 'user_username', with: 'pepe'
fill_in 'user_email', with: 'pepe@gmail.com'
select_date '31-December-1980', from: 'user_date_of_birth'
click_button 'Create user'
@@ -28,6 +29,7 @@ feature 'Users' do
expect(user).to be_level_three_verified
expect(user).to be_residence_verified
expect(user).to_not be_confirmed
expect(user.date_of_birth).to have_content (Date.new(1980,12,31))
sent_token = /.*confirmation_token=(.*)".*/.match(ActionMailer::Base.deliveries.last.body.to_s)[1]
visit user_confirmation_path(confirmation_token: sent_token)

View File

@@ -13,6 +13,12 @@ feature 'Valuation budget investments' do
expect{ visit valuation_budget_budget_investments_path(create(:budget)) }.to raise_exception(FeatureFlags::FeatureDisabled)
end
scenario 'Display link to valuation section' do
Setting['feature.budgets'] = true
visit root_path
expect(page).to have_link "Valuation", href: valuation_root_path
end
scenario 'Index shows budget investments assigned to current valuator' do
investment1 = create(:budget_investment, budget: @budget)
investment2 = create(:budget_investment, budget: @budget)

View File

@@ -304,6 +304,45 @@ describe Budget::Investment do
expect(salamanca_investment.valid_heading?(user)).to eq(false)
end
it "allows votes in a group with a single heading" do
all_city_investment = create(:budget_investment, heading: heading)
expect(all_city_investment.valid_heading?(user)).to eq(true)
end
it "allows votes in a group with a single heading after voting in that heading" do
all_city_investment1 = create(:budget_investment, heading: heading)
all_city_investment2 = create(:budget_investment, heading: heading)
create(:vote, votable: all_city_investment1, voter: user)
expect(all_city_investment2.valid_heading?(user)).to eq(true)
end
it "allows votes in a group with a single heading after voting in another group" do
districts = create(:budget_group, budget: budget)
carabanchel = create(:budget_heading, group: districts)
all_city_investment = create(:budget_investment, heading: heading)
carabanchel_investment = create(:budget_investment, heading: carabanchel)
create(:vote, votable: carabanchel_investment, voter: user)
expect(all_city_investment.valid_heading?(user)).to eq(true)
end
it "allows votes in a group with multiple headings after voting in group with a single heading" do
districts = create(:budget_group, budget: budget)
carabanchel = create(:budget_heading, group: districts)
salamanca = create(:budget_heading, group: districts)
all_city_investment = create(:budget_investment, heading: heading)
carabanchel_investment = create(:budget_investment, heading: carabanchel)
create(:vote, votable: all_city_investment, voter: user)
expect(carabanchel_investment.valid_heading?(user)).to eq(true)
end
end
end