Merge branch 'master' into issue#1575-tag-administration

This commit is contained in:
Raimond Garcia
2017-06-29 19:09:54 +02:00
committed by GitHub
192 changed files with 1260 additions and 738 deletions

View File

@@ -1,5 +1,3 @@
PR_TITLE_GOES_HERE
Where
=====
* **Related Issue:** LINK_OR_#_REF
@@ -7,24 +5,24 @@ Where
What
====
> Whats the objective of this changes ?
- Whats the objective of this changes ?
How
===
> How you implemented/achieved the objective ?
- How you implemented/achieved the objective ?
Screenshots
===========
> If changes affect UI just show them drag&dropping images here
- If changes affect UI just show them drag&dropping images here
Test
====
> Is manual test needed or you just increased/fixed coverage?
- Is manual test needed or you just increased/fixed coverage?
Deployment
==========
> Any details to remember when this feature is deployed?
- Any details to remember when this feature is deployed?
Warnings
========
> Some caveats or important things to notice?
- Some caveats or important things to notice?

View File

@@ -22,6 +22,9 @@ Metrics/LineLength:
Layout/IndentationConsistency:
EnforcedStyle: rails
Style/EmptyMethod:
Enabled: false
Style/StringLiterals:
Enabled: false
@@ -31,6 +34,9 @@ Style/FrozenStringLiteralComment:
Style/PercentLiteralDelimiters:
Enabled: false
Style/SymbolArray:
Enabled: false
Layout/EmptyLinesAroundClassBody:
Enabled: false

View File

@@ -86,14 +86,6 @@ Performance/RedundantMatch:
- 'app/controllers/valuation/spending_proposals_controller.rb'
- 'app/helpers/embed_videos_helper.rb'
# Offense count: 2
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: strict, flexible
Rails/Date:
Exclude:
- 'app/controllers/concerns/commentable_actions.rb'
- 'app/models/direct_message.rb'
# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: Whitelist.
@@ -138,35 +130,6 @@ Rails/OutputSafety:
- 'app/helpers/users_helper.rb'
- 'app/helpers/valuation_helper.rb'
# Offense count: 6
# Cop supports --auto-correct.
Rails/PluralizationGrammar:
Exclude:
- 'spec/features/admin/banners_spec.rb'
- 'spec/features/debates_spec.rb'
- 'spec/features/proposals_spec.rb'
- 'spec/models/residence_spec.rb'
# Offense count: 11
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: strict, flexible
Rails/TimeZone:
Exclude:
- 'lib/score_calculator.rb'
- 'spec/controllers/admin/api/stats_controller_spec.rb'
- 'spec/models/ahoy/data_source_spec.rb'
# Offense count: 7
# Cop supports --auto-correct.
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/Validation:
Exclude:
- 'app/models/comment.rb'
- 'app/models/spending_proposal.rb'
- 'app/models/verification/residence.rb'
- 'app/models/verification/sms.rb'
# Offense count: 9
Style/AccessorMethodName:
Exclude:
@@ -202,29 +165,6 @@ Layout/AlignParameters:
- 'spec/models/user_spec.rb'
- 'spec/rails_helper.rb'
# Offense count: 2
# Cop supports --auto-correct.
Layout/BlockEndNewline:
Exclude:
- 'app/models/banner.rb'
- 'spec/features/users_auth_spec.rb'
# Offense count: 19
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: braces, no_braces, context_dependent
Style/BracesAroundHashParameters:
Exclude:
- 'app/controllers/valuation/spending_proposals_controller.rb'
- 'app/models/concerns/searchable.rb'
- 'app/models/verification/residence.rb'
- 'lib/manager_authenticator.rb'
- 'spec/controllers/management/users_controller_spec.rb'
- 'spec/features/admin/spending_proposals_spec.rb'
- 'spec/lib/manager_authenticator_spec.rb'
- 'spec/models/residence_spec.rb'
- 'spec/models/user_spec.rb'
# Offense count: 57
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: nested, compact
@@ -276,32 +216,6 @@ Style/EmptyCaseCondition:
Exclude:
- 'app/models/concerns/verification.rb'
# Offense count: 9
# Cop supports --auto-correct.
Layout/EmptyLines:
Exclude:
- 'app/models/concerns/search_cache.rb'
- 'app/models/notification.rb'
- 'spec/features/admin/spending_proposals_spec.rb'
- 'spec/features/admin/verifications_spec.rb'
- 'spec/features/debates_spec.rb'
- 'spec/features/registration_form_spec.rb'
- 'spec/features/users_auth_spec.rb'
- 'spec/features/verification/verified_user_spec.rb'
- 'spec/support/verifiable.rb'
# Offense count: 1
# Cop supports --auto-correct.
Layout/EmptyLinesAroundAccessModifier:
Exclude:
- 'app/controllers/users_controller.rb'
# Offense count: 29
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
Layout/ExtraSpacing:
Enabled: false
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
@@ -315,15 +229,6 @@ Layout/FirstParameterIndentation:
Style/GuardClause:
Enabled: false
# Offense count: 10
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
Style/HashSyntax:
Exclude:
- 'lib/sms_api.rb'
- 'spec/factories.rb'
# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: MaxLineLength.
@@ -607,111 +512,6 @@ Style/RescueModifier:
- 'app/controllers/concerns/commentable_actions.rb'
- 'app/controllers/verification/sms_controller.rb'
# Offense count: 2
# Cop supports --auto-correct.
Layout/SpaceAfterColon:
Exclude:
- 'spec/models/user_spec.rb'
# Offense count: 14
# Cop supports --auto-correct.
Layout/SpaceAfterComma:
Exclude:
- 'app/models/ahoy/data_source.rb'
- 'app/models/banner.rb'
- 'app/models/concerns/search_cache.rb'
- 'app/models/concerns/taggable.rb'
- 'app/models/spending_proposal.rb'
- 'app/models/user.rb'
- 'spec/features/valuation/spending_proposals_spec.rb'
- 'spec/lib/census_api_spec.rb'
- 'spec/models/abilities/moderator_spec.rb'
- 'spec/models/verification/management/email_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
Layout/SpaceAfterNot:
Exclude:
- 'app/models/flag.rb'
# Offense count: 20
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: space, no_space
Layout/SpaceAroundEqualsInParameterDefault:
Exclude:
- 'app/helpers/cache_keys_helper.rb'
- 'app/helpers/proposals_helper.rb'
- 'app/helpers/spending_proposals_helper.rb'
- 'app/helpers/stats_helper.rb'
- 'app/helpers/tracks_helper.rb'
- 'app/helpers/valuation_helper.rb'
- 'app/mailers/devise_mailer.rb'
- 'app/models/comment.rb'
- 'app/models/tag_cloud.rb'
- 'app/models/verification/residence.rb'
- 'lib/acts_as_paranoid_aliases.rb'
- 'lib/capistrano/template.rb'
- 'lib/census_api.rb'
- 'lib/manager_authenticator.rb'
- 'spec/support/common_actions.rb'
# Offense count: 66
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment.
Layout/SpaceAroundOperators:
Enabled: false
# Offense count: 6
# Cop supports --auto-correct.
Layout/SpaceBeforeComma:
Exclude:
- 'app/models/proposal.rb'
- 'spec/controllers/management/sessions_controller_spec.rb'
- 'spec/controllers/management/users_controller_spec.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment.
Layout/SpaceBeforeFirstArg:
Exclude:
- 'spec/factories.rb'
# Offense count: 9
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: require_no_space, require_space
Layout/SpaceInLambdaLiteral:
Exclude:
- 'app/models/concerns/filterable.rb'
- 'app/models/spending_proposal.rb'
- 'app/models/user.rb'
- 'app/models/verified_user.rb'
# Offense count: 8
# Cop supports --auto-correct.
Layout/SpaceInsideParens:
Exclude:
- 'app/models/user.rb'
- 'lib/manager_authenticator.rb'
- 'spec/features/proposals_spec.rb'
- 'spec/models/abilities/moderator_spec.rb'
# Offense count: 2
# Cop supports --auto-correct.
Layout/SpaceInsidePercentLiteralDelimiters:
Exclude:
- 'app/models/activity.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiteralsInInterpolation:
Exclude:
- 'app/controllers/stats_controller.rb'
- 'app/models/proposal.rb'
# Offense count: 9
# Cop supports --auto-correct.
# Configuration parameters: IgnoredMethods.
@@ -724,12 +524,6 @@ Style/SymbolProc:
- 'lib/manager_authenticator.rb'
- 'spec/factories.rb'
# Offense count: 2
# Cop supports --auto-correct.
Layout/TrailingWhitespace:
Exclude:
- 'app/controllers/admin/api/stats_controller.rb'
# Offense count: 31
# Cop supports --auto-correct.
Style/UnneededInterpolation:
@@ -759,6 +553,8 @@ Style/WordArray:
# Offense count: 1
# Cop supports --auto-correct.
Style/ZeroLengthPredicate:
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: braces, no_braces, context_dependent
Style/BracesAroundHashParameters:
Exclude:
- 'app/models/concerns/verification.rb'
- 'app/models/concerns/searchable.rb'

38
CHANGELOG.md Normal file
View File

@@ -0,0 +1,38 @@
### 0.9 - 2017-06-15
* New features
* Budgets
* Basic polls
* Collaborative legistlation
* Custom pages
* GraphQL API
* Improved admin section
* Enhancements
* Improved admin section
* Rails 4.2.8
* Ruby 2.3.2
* Bug fixes
* CKEditor locale compilation fixed
* Fixed bugs in mobile layouts
* Deprecations
* SpendingProposals are deprecated now in favor of Budgets
### 0.8 - 2016-07-21
* New features
* Support for customization schema, vía specific custom files, assets and folders
* Enhancements
* Rails 2.4.7
* Ruby 2.3.1
* Bug fixes
* Fixed bug causing errors on user deletion
### 0.7 - 2016-04-25
* New features
* Debates
* Proposals
* Basic Spending Proposals
* Enhancements
* Rails 2.4.6
* Ruby 2.2.3

View File

@@ -1,15 +1,16 @@
# How to Contribute to this Project
## Team members
## Core team members
* Raimond Garcia [github](https://github.com/voodoorai2000) | [twitter](https://twitter.com/voodoorai2000)
* Raimond García [github](https://github.com/voodoorai2000) | [twitter](https://twitter.com/voodoorai2000)
* Juanjo Bazán [github](https://github.com/xuanxu) | [twitter](https://twitter.com/xuanxu)
* Enrique García Cota [github](https://github.com/kikito) | [twitter](https://twitter.com/otikik)
* Alberto Garcia Cabeza [github](https://github.com/decabeza) | [twitter](https://twitter.com/decabeza)
* Alberto García Cabeza [github](https://github.com/decabeza) | [twitter](https://twitter.com/decabeza)
* Alberto Calderón [github](https://github.com/bertocq) | [twitter](https://twitter.com/bertocq)
## Code of conduct
The team members and the project's community adopts an inclusive Code of Conduct that you can read in the [CODE_OF_CONDUCT_EN.md](CODE_OF_CONDUCT_EN.md) file.
The core team members and the project's community adopts an inclusive Code of Conduct that you can read in the [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) file.
## Report an issue
@@ -36,6 +37,8 @@ If you want to contribute code to solve an issue:
* Follow these [best practices](https://github.com/styleguide/ruby)
* Open a *pull request* to the main repository describing what issue you are addressing.
**Working on your first Pull Request?** You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)
## Cleaning up
In the rush of time sometimes things get messy, you can help us cleaning things up:

View File

@@ -2,10 +2,11 @@
## Miembros del equipo
* Raimond Garcia [github](https://github.com/voodoorai2000) | [twitter](https://twitter.com/voodoorai2000)
* Raimond García [github](https://github.com/voodoorai2000) | [twitter](https://twitter.com/voodoorai2000)
* Juanjo Bazán [github](https://github.com/xuanxu) | [twitter](https://twitter.com/xuanxu)
* Enrique García Cota [github](https://github.com/kikito) | [twitter](https://twitter.com/otikik)
* Alberto Garcia Cabeza [github](https://github.com/decabeza) | [twitter](https://twitter.com/decabeza)
* Alberto García Cabeza [github](https://github.com/decabeza) | [twitter](https://twitter.com/decabeza)
* Alberto Calderón [github](https://github.com/bertocq) | [twitter](https://twitter.com/bertocq)
## Código de conducta
@@ -34,7 +35,10 @@ Cuando quieras resolver una incidencia mediante código:
* Añade el código necesario para resolver la incidencia en tantos commits como sea preciso
* Asegúrate de que los tests pasan (y escribe más tests para probar la nueva funcionalidad si fuera preciso)
* Sigue estas [buenas prácticas](https://github.com/styleguide/ruby)
* Envía una *pull request* al repositorio principal indicando la incidencia que se está arreglando
* Envía una *pull request* al repositorio principal indicando la incidencia que se está arreglando.
**¿Es tu primer Pull Request?** Puedes aprender en este curso gratuito (en inglés) sobre [cómo contribuir a un proyecto OpenSource en GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)
## Limpiar

View File

@@ -1,7 +1,7 @@
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.8'
gem 'rails', '4.2.9'
# Use PostgreSQL
gem 'pg', '~> 0.20.0'
# Use SCSS for stylesheets

View File

@@ -2,36 +2,36 @@ GEM
remote: https://rubygems.org/
remote: https://rails-assets.org/
specs:
actionmailer (4.2.8)
actionpack (= 4.2.8)
actionview (= 4.2.8)
activejob (= 4.2.8)
actionmailer (4.2.9)
actionpack (= 4.2.9)
actionview (= 4.2.9)
activejob (= 4.2.9)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.8)
actionview (= 4.2.8)
activesupport (= 4.2.8)
actionpack (4.2.9)
actionview (= 4.2.9)
activesupport (= 4.2.9)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.8)
activesupport (= 4.2.8)
actionview (4.2.9)
activesupport (= 4.2.9)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (4.2.8)
activesupport (= 4.2.8)
activejob (4.2.9)
activesupport (= 4.2.9)
globalid (>= 0.3.0)
activemodel (4.2.8)
activesupport (= 4.2.8)
activemodel (4.2.9)
activesupport (= 4.2.9)
builder (~> 3.1)
activerecord (4.2.8)
activemodel (= 4.2.8)
activesupport (= 4.2.8)
activerecord (4.2.9)
activemodel (= 4.2.9)
activesupport (= 4.2.9)
arel (~> 6.0)
activesupport (4.2.8)
activesupport (4.2.9)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
@@ -174,8 +174,8 @@ GEM
rspec-core (~> 3.0)
ruby-progressbar (~> 1.4)
geocoder (1.4.3)
globalid (0.3.7)
activesupport (>= 4.1.0)
globalid (0.4.0)
activesupport (>= 4.2.0)
graphiql-rails (1.4.1)
rails
graphql (1.6.3)
@@ -188,7 +188,7 @@ GEM
htmlentities (4.3.4)
httpi (2.4.1)
rack
i18n (0.8.1)
i18n (0.8.4)
i18n-tasks (0.9.15)
activesupport (>= 4.0.2)
ast (>= 2.1.0)
@@ -248,8 +248,8 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mimemagic (0.3.2)
mini_portile2 (2.1.0)
minitest (5.10.1)
mini_portile2 (2.2.0)
minitest (5.10.2)
mixlib-cli (1.7.0)
mixlib-config (2.2.4)
multi_json (1.12.1)
@@ -259,8 +259,8 @@ GEM
net-ssh (>= 2.6.5)
net-ssh (4.1.0)
newrelic_rpm (4.1.0.333)
nokogiri (1.7.2)
mini_portile2 (~> 2.1.0)
nokogiri (1.8.0)
mini_portile2 (~> 2.2.0)
nori (2.6.0)
oauth (0.5.1)
oauth2 (1.3.1)
@@ -313,23 +313,23 @@ GEM
public_suffix (2.0.5)
quiet_assets (1.1.0)
railties (>= 3.1, < 5.0)
rack (1.6.5)
rack (1.6.8)
rack-accept (0.4.5)
rack (>= 0.4)
rack-attack (5.0.1)
rack
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.8)
actionmailer (= 4.2.8)
actionpack (= 4.2.8)
actionview (= 4.2.8)
activejob (= 4.2.8)
activemodel (= 4.2.8)
activerecord (= 4.2.8)
activesupport (= 4.2.8)
rails (4.2.9)
actionmailer (= 4.2.9)
actionpack (= 4.2.9)
actionview (= 4.2.9)
activejob (= 4.2.9)
activemodel (= 4.2.9)
activerecord (= 4.2.9)
activesupport (= 4.2.9)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.8)
railties (= 4.2.9)
sprockets-rails
rails-assets-markdown-it (8.2.1)
rails-deprecated_sanitizer (1.0.3)
@@ -340,9 +340,9 @@ GEM
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
railties (4.2.8)
actionpack (= 4.2.8)
activesupport (= 4.2.8)
railties (4.2.9)
actionpack (= 4.2.9)
activesupport (= 4.2.9)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (2.2.2)
@@ -541,7 +541,7 @@ DEPENDENCIES
pg_search
poltergeist (~> 1.15.0)
quiet_assets
rails (= 4.2.8)
rails (= 4.2.9)
rails-assets-markdown-it!
redcarpet (~> 3.4.0)
responders (~> 2.4.0)

View File

@@ -15,6 +15,7 @@ Citizen Participation and Open Government Application
[![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)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/consul/consul/issues?q=is%3Aissue+is%3Aopen+label%3APRs-welcome)
This is the opensource code repository of the eParticipation website originally developed for the Madrid City government eParticipation website
@@ -51,7 +52,7 @@ Run the app locally:
bin/rails s
```
Prerequisites for testing: install PhantomJS >= 1.9.8
Prerequisites for testing: install PhantomJS >= 2.1.1
Run the tests with:
@@ -65,6 +66,8 @@ If you add SCSS code you can check it with:
scss-lint
```
To maintain accesibility level, if you add new colors use a [Color contrast checker](http://webaim.org/resources/contrastchecker/) (WCAG AA is mandatory, WCAG AAA is recommended)
If you work on Coffeescript code you can check it with [coffeelint](http://www.coffeelint.org/) (install with `npm install -g coffeelint`) :
```
@@ -100,4 +103,4 @@ Code published under AFFERO GPL v3 (see [LICENSE-AGPLv3.txt](LICENSE-AGPLv3.txt)
## Contributions
See [CONTRIBUTING_EN.md](CONTRIBUTING_EN.md)
See [CONTRIBUTING.md](CONTRIBUTING.md)

View File

@@ -15,6 +15,7 @@ Aplicación de Participación Ciudadana y Gobierno Abierto
[![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)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/consul/consul/issues?q=is%3Aissue+is%3Aopen+label%3APRs-welcome)
Este es el repositorio de código abierto de la Aplicación de Participación Ciudadana Consul, creada originariamente por el Ayuntamiento de Madrid.
@@ -51,7 +52,7 @@ Para ejecutar la aplicación en local:
bin/rails s
```
Prerequisitos para los tests: tener instalado PhantomJS >= 1.9.8
Prerequisitos para los tests: tener instalado PhantomJS >= 2.1.1
Para ejecutar los tests:
@@ -65,6 +66,8 @@ Si añades código SCSS puedes revisarlo con:
scss-lint
```
Para mantener el nivel de accesibilidad, si añades colores nuevos utiliza un [Comprobador de contraste de color](http://webaim.org/resources/contrastchecker/) (WCAG AA es obligatorio, WCAG AAA es recomendable)
Si trabajas en código coffeescript puedes revisarlo con [coffeelint](http://www.coffeelint.org/) (instalalo con `npm install -g coffeelint`) :
```

View File

@@ -102,27 +102,47 @@
.annotator-hl {
cursor: pointer;
background: rgba(255, 255, 10, 0.2);
background: rgba(255, 249, 218, 0.75);
&.weight-1 {
background: hsla(50, 100, 93, 0.5);
.weight-1 {
background: hsla(50, 100, 93, 0.75);
}
}
.annotator-hl.weight-1 {
background: #fff9da;
&.weight-2 {
background: hsla(63, 78, 86, 0.5);
.weight-2 {
background: hsla(63, 78, 86, 0.75);
}
}
.annotator-hl.weight-2 {
background: #fff5bc;
&.weight-3 {
background: hsla(52, 100, 85, 0.5);
.weight-3 {
background: hsla(52, 100, 85, 0.75);
}
}
.annotator-hl.weight-3 {
background: #fff1a2;
&.weight-4 {
background: hsla(51, 91, 75, 0.5);
.weight-4 {
background: hsla(51, 91, 75, 0.75);
}
}
.annotator-hl.weight-4 {
background: #ffef8c;
}
&.weight-5 {
background: hsla(46, 83, 60, 0.5);
.annotator-hl.weight-5 {
background: #ffe95f;
.weight-5 {
background: hsla(46, 83, 60, 0.5);
}
}
}
.current-annotation {

View File

@@ -806,7 +806,7 @@ form {
}
}
[type]:not([type=submit]):not([type=file]):not([type=checkbox]):not([type=radio]) {
[type]:not([type=submit]):not([type=file]):not([type=checkbox]):not([type=radio]):not(.close-button) {
background: #f8f8f8;
height: $line-height * 2;
margin-bottom: rem-calc(16);
@@ -825,23 +825,6 @@ form {
margin: $line-height / 2 0 $line-height / 2 $line-height / 4;
}
.note,
.note-marked {
display: block;
font-size: rem-calc(13);
margin-bottom: $line-height / 2;
}
.note-marked {
background: #ff0;
display: inline-block;
em {
background: #fff;
display: block;
}
}
.ckeditor {
min-height: $line-height * 13;
}
@@ -893,7 +876,7 @@ form {
.callout {
font-size: $small-font-size;
a {
a:not(.button) {
font-weight: bold;
text-decoration: underline;
}
@@ -945,6 +928,14 @@ form {
}
}
.callout {
&.highlight,
&.light {
border: 0;
}
}
// 08. User account
// ----------------

View File

@@ -494,6 +494,109 @@
}
}
.tab-milestones ul {
margin-top: rem-calc(40);
position: relative;
li {
margin: 0 auto;
position: relative;
width: 0;
}
li::before {
background: $budget;
border-radius: rem-calc(20);
content: '';
height: rem-calc(20);
position: absolute;
top: 5px;
transform: translateX(-50%);
width: rem-calc(20);
z-index: 2;
}
li::after {
background: $light-gray;
bottom: 100%;
content: '';
height: 100%;
position: absolute;
top: 25px;
width: 1px;
z-index: 1;
}
}
.tab-milestones ul .milestone-content {
padding: $line-height / 6 $line-height / 2;
position: relative;
h3 {
margin-bottom: 0;
}
.milestone-date {
color: $text-medium;
font-size: $small-font-size;
}
}
.tab-milestones .timeline ul li:nth-child(odd),
.tab-milestones .timeline ul li:nth-child(even) {
.milestone-content {
@include breakpoint(medium) {
width: rem-calc(300);
}
@include breakpoint(large) {
width: rem-calc(450);
}
}
}
.tab-milestones .timeline ul li:nth-child(odd) {
.milestone-content {
text-align: right;
@include breakpoint(medium) {
margin-left: rem-calc(-315);
}
@include breakpoint(large) {
margin-left: rem-calc(-465);
}
}
}
.tab-milestones .timeline ul li:nth-child(even) {
.milestone-content {
left: 15px;
}
}
.tab-milestones {
@include breakpoint(small only) {
.timeline ul li {
width: 100%;
&:nth-child(odd),
&:nth-child(even) {
.milestone-content {
left: 15px;
text-align: left;
}
}
}
}
}
// 04. List participation
// ----------------------

View File

@@ -12,7 +12,7 @@ class Admin::BudgetHeadingsController < Admin::BaseController
private
def budget_heading_params
params.require(:budget_heading).permit(:name, :price, :geozone_id)
params.require(:budget_heading).permit(:name, :price, :population)
end
end

View File

@@ -0,0 +1,55 @@
class Admin::BudgetInvestmentMilestonesController < Admin::BaseController
before_action :load_budget_investment, only: [:index, :new, :create, :edit, :update, :destroy]
before_action :load_budget_investment_milestone, only: [:edit, :update, :destroy]
def index
end
def new
@milestone = Budget::Investment::Milestone.new
end
def create
@milestone = Budget::Investment::Milestone.new(milestone_params)
@milestone.investment = @investment
if @milestone.save
redirect_to admin_budget_budget_investment_path(@investment.budget, @investment), notice: t('admin.milestones.create.notice')
else
render :new
end
end
def edit
end
def update
if @milestone.update(milestone_params)
redirect_to admin_budget_budget_investment_path(@investment.budget, @investment), notice: t('admin.milestones.update.notice')
else
render :edit
end
end
def destroy
@milestone.destroy
redirect_to admin_budget_budget_investment_path(@investment.budget, @investment), notice: t('admin.milestones.delete.notice')
end
private
def milestone_params
params.require(:budget_investment_milestone)
.permit(:title, :description, :budget_investment_id)
end
def load_budget_investment
@investment = Budget::Investment.find params[:budget_investment_id]
end
def load_budget_investment_milestone
@milestone = Budget::Investment::Milestone.find params[:id]
end
end

View File

@@ -14,10 +14,15 @@ class Admin::BudgetsController < Admin::BaseController
@budget = Budget.includes(groups: :headings).find(params[:id])
end
def new
end
def new; end
def edit
def edit; end
def calculate_winners
return unless @budget.balloting_process?
@budget.headings.each { |heading| Budget::Result.new(@budget, heading).calculate_winners }
redirect_to admin_budget_budget_investments_path(budget_id: @budget.id, filter: 'winners'),
notice: I18n.t("admin.budgets.winners.calculated")
end
def update

View File

@@ -60,13 +60,14 @@ class Admin::Poll::PollsController < Admin::BaseController
end
def search_questions
@questions = ::Poll::Question.where("poll_id IS ? OR poll_id != ?", nil, @poll.id).search({search: @search}).order(title: :asc)
@questions = ::Poll::Question.where("poll_id IS ? OR poll_id != ?", nil, @poll.id).search(search: @search).order(title: :asc)
respond_to do |format|
format.js
end
end
private
def load_geozones
@geozones = Geozone.all.order(:name)
end

View File

@@ -26,6 +26,7 @@ class Legislation::AnswersController < Legislation::BaseController
end
private
def answer_params
params.require(:legislation_answer).permit(
:legislation_question_option_id,

View File

@@ -28,6 +28,7 @@ class Officing::FinalRecountsController < Officing::BaseController
end
private
def load_poll
@poll = Poll.expired.find(params[:poll_id])
end

View File

@@ -27,6 +27,7 @@ class Officing::RecountsController < Officing::BaseController
end
private
def load_poll
@poll = Poll.find(params[:poll_id])
end

View File

@@ -14,10 +14,10 @@ class SandboxController < ApplicationController
def show
if params[:template].index('.') # CVE-2014-0130
render :action => "index"
render action: "index"
elsif lookup_context.exists?("sandbox/#{params[:template]}")
if params[:template] == "index"
render :action => "index"
render action: "index"
else
render "sandbox/#{params[:template]}"
end
@@ -25,7 +25,7 @@ class SandboxController < ApplicationController
elsif lookup_context.exists?("sandbox/#{params[:template]}/index")
render "sandbox/#{params[:template]}/index"
else
render :action => "index"
render action: "index"
end
end

View File

@@ -23,6 +23,6 @@ class StatsController < ApplicationController
private
def daily_cache(key, &block)
Rails.cache.fetch("public_stats/#{Time.current.strftime("%Y-%m-%d")}/#{key}", &block)
Rails.cache.fetch("public_stats/#{Time.current.strftime('%Y-%m-%d')}/#{key}", &block)
end
end

View File

@@ -30,7 +30,7 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
identity = Identity.first_or_create_from_oauth(auth)
@user = current_user || identity.user || User.first_or_initialize_for_oauth(auth)
if save_user(@user)
if save_user
identity.update(user: @user)
sign_in_and_redirect @user, event: :authentication
set_flash_message(:notice, :success, kind: "#{provider}".capitalize) if is_navigational_format?
@@ -40,7 +40,7 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
end
end
def save_user(user)
def save_user
@user.save || @user.save_requiring_finish_signup
end

View File

@@ -10,6 +10,7 @@ class UsersController < ApplicationController
end
private
def set_activity_counts
@activity_counts = HashWithIndifferentAccess.new(
proposals: Proposal.where(author_id: @user.id).count,

View File

@@ -58,7 +58,7 @@ class Valuation::SpendingProposalsController < Valuation::BaseController
end
def params_for_current_valuator
params.merge({valuator_id: current_user.valuator.id})
params.merge(valuator_id: current_user.valuator.id)
end
def restrict_access_to_assigned_items

View File

@@ -44,7 +44,7 @@ module Abilities
can [:read, :update, :valuate, :destroy, :summary], SpendingProposal
can [:index, :read, :new, :create, :update, :destroy], Budget
can [:index, :read, :new, :create, :update, :destroy, :calculate_winners], Budget
can [:read, :create, :update, :destroy], Budget::Group
can [:read, :create, :update, :destroy], Budget::Heading
can [:hide, :update, :toggle_selection], Budget::Investment

View File

@@ -12,8 +12,7 @@ class Banner < ActiveRecord::Base
validates :post_started_at, presence: true
validates :post_ended_at, presence: true
scope :with_active, -> {where("post_started_at <= ?", Time.current).
where("post_ended_at >= ?", Time.current) }
scope :with_active, -> { where("post_started_at <= ?", Time.current).where("post_ended_at >= ?", Time.current) }
scope :with_inactive, -> { where("post_started_at > ? or post_ended_at < ?", Time.current, Time.current) }

View File

@@ -67,8 +67,12 @@ class Budget < ActiveRecord::Base
phase == "finished"
end
def balloting_process?
balloting? || reviewing_ballots?
end
def balloting_or_later?
balloting? || reviewing_ballots? || finished?
balloting_process? || finished?
end
def on_hold?

View File

@@ -20,13 +20,14 @@ class Budget
has_many :valuator_assignments, dependent: :destroy
has_many :valuators, through: :valuator_assignments
has_many :comments, as: :commentable
has_many :milestones
validates :title, presence: true
validates :author, presence: true
validates :description, presence: true
validates :heading_id, presence: true
validates_presence_of :unfeasibility_explanation, if: :unfeasibility_explanation_required?
validates_presence_of :price, if: :price_required?
validates :unfeasibility_explanation, presence: { if: :unfeasibility_explanation_required? }
validates :price, presence: { if: :price_required? }
validates :title, length: { in: 4..Budget::Investment.title_max_length }
validates :description, length: { maximum: Budget::Investment.description_max_length }

View File

@@ -0,0 +1,14 @@
class Budget
class Investment
class Milestone < ActiveRecord::Base
belongs_to :investment
validates :title, presence: true
validates :investment, presence: true
def self.title_max_length
80
end
end
end
end

View File

@@ -12,11 +12,10 @@ class Budget
reset_winners
investments.each do |investment|
@current_investment = investment
if inside_budget?
set_winner
end
set_winner if inside_budget?
end
end
handle_asynchronously :calculate_winners
def investments
heading.investments.selected.sort_by_ballots

View File

@@ -13,7 +13,7 @@ class Comment < ActiveRecord::Base
validates :body, presence: true
validates :user, presence: true
validates_inclusion_of :commentable_type, in: ["Debate", "Proposal", "Budget::Investment", "Poll::Question", "Legislation::Question", "Legislation::Annotation"]
validates :commentable_type, inclusion: { in: ["Debate", "Proposal", "Budget::Investment", "Poll::Question", "Legislation::Question", "Legislation::Annotation"] }
validate :validate_body_length

View File

@@ -31,5 +31,4 @@ module SearchCache
ActionController::Base.helpers.sanitize(value, tags: [])
end
end

View File

@@ -47,7 +47,7 @@ module Verification
end
def failed_residence_verification?
!residence_verified? && failed_census_calls.size > 0
!residence_verified? && !failed_census_calls.empty?
end
def no_phone_available?

View File

@@ -9,7 +9,7 @@ class Legislation::Question < ActiveRecord::Base
has_many :answers, class_name: 'Legislation::Answer', foreign_key: 'legislation_question_id', dependent: :destroy, inverse_of: :question
has_many :comments, as: :commentable, dependent: :destroy
accepts_nested_attributes_for :question_options, :reject_if => proc { |attributes| attributes[:value].blank? }, allow_destroy: true
accepts_nested_attributes_for :question_options, reject_if: proc { |attributes| attributes[:value].blank? }, allow_destroy: true
validates :process, presence: true
validates :title, presence: true

View File

@@ -7,7 +7,6 @@ class Notification < ActiveRecord::Base
scope :not_emailed, -> { where(emailed_at: nil) }
scope :for_render, -> { includes(:notifiable) }
def timestamp
notifiable.created_at
end

View File

@@ -6,9 +6,9 @@ class Officing::Residence
before_validation :call_census_api
validates_presence_of :document_number
validates_presence_of :document_type
validates_presence_of :year_of_birth
validates :document_number, presence: true
validates :document_type, presence: true
validates :year_of_birth, presence: true
validate :allowed_age
validate :residence_in_madrid
@@ -43,14 +43,13 @@ class Officing::Residence
end
def store_failed_census_call
FailedCensusCall.create({
FailedCensusCall.create(
user: user,
document_number: document_number,
document_type: document_type,
year_of_birth: year_of_birth,
poll_officer: officer
})
)
end
def user_exists?

View File

@@ -128,7 +128,7 @@ class Proposal < ActiveRecord::Base
end
def code
"#{Setting["proposal_code_prefix"]}-#{created_at.strftime('%Y-%m')}-#{id}"
"#{Setting['proposal_code_prefix']}-#{created_at.strftime('%Y-%m')}-#{id}"
end
def after_commented

View File

@@ -15,7 +15,7 @@ class SpendingProposal < ActiveRecord::Base
validates :title, presence: true
validates :author, presence: true
validates :description, presence: true
validates_presence_of :feasible_explanation, if: :feasible_explanation_required?
validates :feasible_explanation, presence: { if: :feasible_explanation_required? }
validates :title, length: { in: 4..SpendingProposal.title_max_length }
validates :description, length: { maximum: SpendingProposal.description_max_length }

View File

@@ -7,10 +7,10 @@ class Verification::Residence
before_validation :call_census_api
validates_presence_of :document_number
validates_presence_of :document_type
validates_presence_of :date_of_birth
validates_presence_of :postal_code
validates :document_number, presence: true
validates :document_type, presence: true
validates :date_of_birth, presence: true
validates :postal_code, presence: true
validates :terms_of_service, acceptance: { allow_nil: false }
validates :postal_code, length: { is: 5 }
@@ -47,13 +47,13 @@ class Verification::Residence
end
def store_failed_attempt
FailedCensusCall.create({
FailedCensusCall.create(
user: user,
document_number: document_number,
document_type: document_type,
date_of_birth: date_of_birth,
postal_code: postal_code
})
)
end
def geozone

View File

@@ -3,7 +3,7 @@ class Verification::Sms
attr_accessor :user, :phone, :confirmation_code
validates_presence_of :phone
validates :phone, presence: true
validates :phone, format: { with: /\A[\d \+]+\z/ }
validate :uniqness_phone

View File

@@ -0,0 +1,7 @@
<%= form_for [:admin, @investment.budget, @investment, @milestone] do |f| %>
<%= f.text_field :title, maxlength: Budget::Investment::Milestone.title_max_length %>
<%= f.text_area :description, rows: 5 %>
<%= f.submit nil, class: "button success" %>
<% end %>

View File

@@ -0,0 +1,5 @@
<%= back_link_to admin_budget_budget_investment_path(@investment.budget, @investment) %>
<h2><%= t("admin.milestones.edit.title") %></h2>
<%= render '/admin/budget_investment_milestones/form' %>

View File

@@ -0,0 +1,10 @@
<div class="milestone-new row">
<div class="small-12 column">
<%= back_link_to admin_budget_budget_investment_path(@investment.budget, @investment) %>
<h1><%= t("admin.milestones.new.creating") %></h1>
<%= render "form" %>
</div>
</div>

View File

@@ -0,0 +1,36 @@
<% if @investment.milestones.any? %>
<table>
<thead>
<tr>
<th><%= t("admin.milestones.index.table_id") %></th>
<th><%= t("admin.milestones.index.table_title") %></th>
<th><%= t("admin.milestones.index.table_description") %></th>
<th><%= t("admin.milestones.index.table_actions") %></th>
</tr>
</thead>
<tbody>
<% @investment.milestones.each do |milestone| %>
<tr id="<%= dom_id(milestone) %>" class="milestone">
<td>
<%= milestone.id %>
</td>
<td>
<%= link_to milestone.title, edit_admin_budget_budget_investment_budget_investment_milestone_path(@investment.budget, @investment, milestone) %>
</td>
<td class="small">
<%= milestone.description %>
</td>
<td>
<%= link_to t("admin.milestones.index.delete"), admin_budget_budget_investment_budget_investment_milestone_path(@investment.budget, @investment, milestone),
method: :delete,
class: 'button hollow alert expanded' %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<p>
<%= t('admin.milestones.index.no_milestones') %>
</p>
<% end %>

View File

@@ -47,3 +47,12 @@
<%= link_to t("admin.budget_investments.show.edit_dossier"), edit_valuation_budget_budget_investment_path(@budget, @investment) %>
</p>
<hr>
<h2><%= t("admin.budget_investments.show.milestone") %></h2>
<%= render 'admin/budget_investments/milestones' %>
<p>
<%= link_to t("admin.budget_investments.show.new_milestone"), new_admin_budget_budget_investment_budget_investment_milestone_path(@budget, @investment) %>
</p>

View File

@@ -16,5 +16,15 @@
<%= f.select :currency_symbol, budget_currency_symbol_select_options %>
</div>
</div>
<div class="margin-top">
<%= f.submit nil, class: "button success" %>
<% if @budget.balloting_process? %>
<div class="float-right">
<%= link_to t("admin.budgets.winners.calculate"),
calculate_winners_admin_budget_path(@budget),
method: :put,
class: "button hollow" %>
</div>
<% end %>
</div>
<% end %>

View File

@@ -1,7 +1,7 @@
<table>
<thead>
<tr>
<th colspan="2" class="with-button">
<th colspan="3" class="with-button">
<%= group.name %>
<%= link_to t("admin.budgets.form.add_heading"), "#", class: "button float-right js-toggle-link", data: { "toggle-selector" => "#group-#{group.id}-new-heading-form" } %>
</th>
@@ -21,6 +21,7 @@
<tr>
<th><%= t("admin.budgets.form.table_heading") %></th>
<th><%= t("admin.budgets.form.table_amount") %></th>
<th><%= t("admin.budgets.form.table_population") %></th>
</tr>
</thead>
<tbody>
@@ -45,6 +46,15 @@
placeholder: t("admin.budgets.form.amount") %>
</div>
</div>
<div class="row">
<div class="small-12 medium-6 column">
<label><%= t("admin.budgets.form.population") %></label>
<%= f.text_field :population,
label: false,
maxlength: 8,
placeholder: t("admin.budgets.form.population") %>
</div>
</div>
<%= f.submit t("admin.budgets.form.save_heading"), class: "button success" %>
<% end %>
@@ -60,6 +70,9 @@
<td>
<%= heading.price %>
</td>
<td>
<%= heading.population %>
</td>
</tr>
<% end %>
<!-- /. headings list -->

View File

@@ -17,8 +17,8 @@
<%= f.text_field :title, maxlength: Poll::Question.title_max_length %>
<%= f.label :valid_answers %>
<p class="note"><%= t("admin.questions.new.valid_answers_note") %></p>
<%= f.text_field :valid_answers, label: false %>
<p class="help-text" id="valid-answers-help-text"><%= t("admin.questions.new.valid_answers_note") %></p>
<%= f.text_field :valid_answers, label: false, aria: {describedby: "valid-answers-help-text"} %>
<div class="ckeditor">
<%= f.cktext_area :description,

View File

@@ -15,8 +15,8 @@
</div>
<%= f.label :document_numbers %>
<p class="note"><%= t("admin.signature_sheets.new.document_numbers_note") %></p>
<%= f.text_area :document_numbers, rows: "6", label: false %>
<p class="help-text" id="document-numbers-help-text"><%= t("admin.signature_sheets.new.document_numbers_note") %></p>
<%= f.text_area :document_numbers, rows: "6", label: false, aria: {describedby: "document-numbers-help-text"} %>
<%= f.submit(class: "button", value: t("admin.signature_sheets.new.submit")) %>
<% end %>

View File

@@ -0,0 +1,22 @@
<div class="row">
<div class="small-12 column">
<ul class="tabs" data-tabs id="investments-tabs">
<li class="tabs-title is-active">
<%= link_to "#tab-comments" do %>
<h3>
<%= t("budgets.investments.show.comments_tab") %>
<span class="js-comments-count">(<%= @investment.comments_count %>)</span>
</h3>
<% end %>
</li>
<li class="tabs-title">
<%= link_to "#tab-milestones" do %>
<h3>
<%= t("budgets.investments.show.milestones_tab") %>
(<%= @investment.milestones.count %>)
</h3>
<% end %>
</li>
</ul>
</div>
</div>

View File

@@ -31,7 +31,7 @@
<div class="small-12 column">
<%= f.label :tag_list, t("budgets.investments.form.tags_label") %>
<p class="note"><%= t("budgets.investments.form.tags_instructions") %></p>
<p class="help-text" id="tags-list-help-text"><%= t("budgets.investments.form.tags_instructions") %></p>
<div id="category_tags" class="tags">
<%= f.label :category_tag_list, t("budgets.investments.form.tag_category_label") %>
@@ -44,6 +44,7 @@
<%= f.text_field :tag_list, value: @investment.tag_list.to_s,
label: false,
placeholder: t("budgets.investments.form.tags_placeholder"),
aria: {describedby: "tags-list-help-text"},
class: 'js-tag-list' %>
</div>

View File

@@ -0,0 +1,26 @@
<div class="tabs-panel tab-milestones" id="tab-milestones">
<div class="row">
<div class="small-12 column">
<% if @investment.milestones.blank? %>
<div class="callout primary text-center">
<%= t('budgets.investments.show.no_milestones') %>
</div>
<% end %>
<section class="timeline">
<ul class="no-bullet">
<% @investment.milestones.each do |milestone| %>
<li>
<div class="milestone-content">
<h3><%= milestone.title %></h3>
<span class="milestone-date">
<strong><%= t("budgets.investments.show.milestone_publish_date", publish_date: milestone.created_at.strftime("%d/%m/%Y")) %></strong>
</span>
<p><%= milestone.description %></p>
</div>
</li>
<% end %>
</ul>
</section>
</div>
</div>
</div>

View File

@@ -10,4 +10,13 @@
ballot: @ballot
} %>
<%= render partial: '/comments/comment_tree', locals: { comment_tree: @comment_tree, comment_flags: @comment_flags } %>
<div class="tabs-content" data-tabs-content="investments-tabs" role="tablist">
<%= render "budgets/investments/filter_subnav" %>
<%= render "budgets/investments/milestones" %>
<div class="tabs-panel is-active" id="tab-comments">
<%= render partial: '/comments/comment_tree', locals: { comment_tree: @comment_tree,
comment_flags: @comment_flags,
display_comments_count: false } %>
</div>
</div>

View File

@@ -1,14 +1,15 @@
<% commentable = comment_tree.commentable %>
<% current_order = comment_tree.order %>
<% cache [locale_and_user_status, current_order, commentable_cache_key(commentable), comment_tree.comments, comment_tree.comment_authors, commentable.comments_count, comment_flags] do %>
<% cache [locale_and_user_status, comment_tree.order, commentable_cache_key(commentable), comment_tree.comments, comment_tree.comment_authors, commentable.comments_count, comment_flags] do %>
<section class="expanded comments">
<div class="row">
<div id="comments" class="small-12 column">
<% if display_comments_count %>
<h2>
<%= comment_tree_title_text(commentable) %>
<span class="js-comments-count">(<%= commentable.comments_count %>)</span>
</h2>
<% end %>
<%= render 'shared/wide_order_selector', i18n_namespace: "comments" %>

View File

@@ -17,11 +17,12 @@
<div class="small-12 column">
<%= f.label :tag_list, t("debates.form.tags_label") %>
<p class="note"><%= t("debates.form.tags_instructions") %></p>
<p class="help-text" id="tag-list-help-text"><%= t("debates.form.tags_instructions") %></p>
<%= f.text_field :tag_list, value: @debate.tag_list.to_s,
label: false,
placeholder: t("debates.form.tags_placeholder") %>
placeholder: t("debates.form.tags_placeholder"),
aria: {describedby: "tag-list-help-text"} %>
</div>
<div class="small-12 column">
<% if @debate.new_record? %>

View File

@@ -16,9 +16,7 @@
<div class="comment-actions">
<a class="cancel-comment" href="#" data-cancel-annotation><%= t('legislation.annotations.comments.cancel') %></a>
<%= f.submit class: 'button publish-comment' do %>
<strong><%= t('legislation.annotations.comments.publish_comment') %></strong>
<% end %>
<%= f.submit value: t('legislation.annotations.comments.publish_comment'), class: 'button publish-comment' %>
</div>
<%= f.hidden_field :quote %>

View File

@@ -40,7 +40,9 @@
</aside>
</div>
<%= render partial: '/comments/comment_tree', locals: { comment_tree: @comment_tree, comment_flags: @comment_flags } %>
<%= render partial: '/comments/comment_tree', locals: { comment_tree: @comment_tree,
comment_flags: @comment_flags,
display_comments_count: true } %>
</div>
</div>
</div>

View File

@@ -42,6 +42,7 @@
</aside>
</div>
<%= render partial: '/comments/comment_tree', locals: { comment_tree: @comment_tree, comment_flags: @comment_flags } %>
<%= render partial: '/comments/comment_tree', locals: { comment_tree: @comment_tree,
comment_flags: @comment_flags,
display_comments_count: true } %>
</section>

View File

@@ -3,8 +3,10 @@
<%= form_tag management_user_invites_path do %>
<label><%= t('management.user_invites.new.label') %></label>
<p class="note"><%= t('management.user_invites.new.info') %></p>
<%= text_area_tag "emails", nil, rows: 5, placeholder: t('management.user_invites.new.info') %>
<p class="help-text" id="emails-help-text"><%= t('management.user_invites.new.info') %></p>
<%= text_area_tag "emails", nil, rows: 5,
placeholder: t('management.user_invites.new.info'),
aria: {describedby: "emails-help-text"} %>
<div class="small-12 medium-6">
<input type="submit" name="" value="<%= t('management.user_invites.new.submit') %>", class="button hollow expanded">
</div>

View File

@@ -9,8 +9,10 @@
<%= f.fields_for :organization do |fo| %>
<%= fo.text_field :name, autofocus: true, maxlength: Organization.name_max_length, placeholder: t("devise_views.organizations.registrations.new.organization_name_label") %>
<%= fo.label :responsible_name %>
<p class="note"><%= t("devise_views.organizations.registrations.new.responsible_name_note") %></p>
<%= fo.text_field :responsible_name, placeholder: t("devise_views.organizations.registrations.new.responsible_name_label"), maxlength: Organization.responsible_name_max_length, label: false %>
<p class="help-text" id="responsible-name-help-text"><%= t("devise_views.organizations.registrations.new.responsible_name_note") %></p>
<%= fo.text_field :responsible_name, placeholder: t("devise_views.organizations.registrations.new.responsible_name_label"),
maxlength: Organization.responsible_name_max_length, label: false,
aria: {describedby: "responsible-name-help-text"} %>
<% end %>
<%= f.email_field :email, placeholder: t("devise_views.organizations.registrations.new.email_label") %>

View File

@@ -12,17 +12,21 @@
<div class="small-12 column">
<%= f.label :question, t("proposals.form.proposal_question") %>
<span class="note-marked">
<p class="help-text" id="question-help-text">
<%= t("proposals.form.proposal_question_example_html") %>
</span>
<%= f.text_field :question, maxlength: Proposal.question_max_length, placeholder: t("proposals.form.proposal_question"), label: false %>
</p>
<%= f.text_field :question, maxlength: Proposal.question_max_length,
placeholder: t("proposals.form.proposal_question"),
label: false,
aria: {describedby: "question-help-text"} %>
</div>
<div class="small-12 column">
<%= f.label :summary, t("proposals.form.proposal_summary") %>
<p class="note"><%= t("proposals.form.proposal_summary_note") %></p>
<p class="help-text" id="summary-help-text"><%= t("proposals.form.proposal_summary_note") %></p>
<%= f.text_area :summary, rows: 4, maxlength: 200, label: false,
placeholder: t('proposals.form.proposal_summary') %>
placeholder: t('proposals.form.proposal_summary'),
aria: {describedby: "summary-help-text"} %>
</div>
<div class="ckeditor small-12 column">
@@ -33,8 +37,9 @@
<div class="small-12 column">
<%= f.label :video_url, t("proposals.form.proposal_video_url") %>
<p class="note"><%= t("proposals.form.proposal_video_url_note") %></p>
<%= f.text_field :video_url, placeholder: t("proposals.form.proposal_video_url"), label: false %>
<p class="help-text" id="video-url-help-text"><%= t("proposals.form.proposal_video_url_note") %></p>
<%= f.text_field :video_url, placeholder: t("proposals.form.proposal_video_url"), label: false,
aria: {describedby: "video-url-help-text"} %>
</div>
<div class="small-12 column">
@@ -49,7 +54,7 @@
<div class="small-12 column">
<%= f.label :tag_list, t("proposals.form.tags_label") %>
<p class="note"><%= t("proposals.form.tags_instructions") %></p>
<p class="help-text" id="tag-list-help-text"><%= t("proposals.form.tags_instructions") %></p>
<div id="category_tags" class="tags">
<%= f.label :category_tag_list, t("proposals.form.tag_category_label") %>
@@ -62,14 +67,16 @@
<%= f.text_field :tag_list, value: @proposal.tag_list.to_s,
label: false,
placeholder: t("proposals.form.tags_placeholder"),
class: 'js-tag-list' %>
class: 'js-tag-list',
aria: {describedby: "tag-list-help-text"} %>
</div>
<% if current_user.unverified? %>
<div class="small-12 column">
<%= f.label :responsible_name, t("proposals.form.proposal_responsible_name") %>
<p class="note"><%= t("proposals.form.proposal_responsible_name_note") %></p>
<%= f.text_field :responsible_name, placeholder: t("proposals.form.proposal_responsible_name"), label: false %>
<p class="help-text" id="responsible-name-help-text"><%= t("proposals.form.proposal_responsible_name_note") %></p>
<%= f.text_field :responsible_name, placeholder: t("proposals.form.proposal_responsible_name"), label: false,
aria: {describedby: "responsible-name-help-text"} %>
</div>
<% end %>

View File

@@ -12,35 +12,39 @@
<% cache [locale_and_user_status(@proposal), @proposal, @proposal.author, Flag.flagged?(current_user, @proposal), @proposal_votes] do %>
<div class="proposal-show">
<div id="<%= dom_id(@proposal) %>" class="row">
<div class="small-12 medium-9 column">
<div class="small-12 medium-8 column">
<h1><%= t("proposals.proposal.created") %></h1>
<h2><%= @proposal.title %></h2>
<p>
<%= t("proposals.show.code") %>
<strong><%= @proposal.code %></strong>
<span class="lead"><%= t("proposals.proposal.share.guide") %></span><br>
<%= t("proposals.proposal.share.edit") %>
</p>
<p><%= t("proposals.proposal.share.guide").html_safe %></p>
<%= render partial: 'shared/social_share', locals: {
title: @proposal.title,
url: proposal_url(@proposal)
} %>
<br/>
<% if @proposal_improvement_path.present? %>
<p><%= t('proposals.proposal.improve_info', improve_info_link: link_to(t('proposals.proposal.improve_info_link'), @proposal_improvement_path)).html_safe %></p>
<div class="callout highlight margin-top text-center">
<p class="lead"><strong><%= t("proposals.proposal.improve_info") %></strong></p>
<%= link_to t("proposals.proposal.improve_info_link"), @proposal_improvement_path, class: "button" %>
</div>
<% end %>
<div class="small margin-bottom">
<%= link_to t("proposals.proposal.share.view_proposal"), proposal_path(@proposal) %>
</div>
</div>
<div class="small-12 medium-4 column">
<div class="callout light">
<p>
<%= link_to proposal_path(@proposal), class: 'proposal' do %>
<%= t("proposals.proposal.share.view_proposal") %>
<% end %>
<strong><%= @proposal.title %></strong><br>
<%= t("proposals.show.code") %> <%= @proposal.code %>
</p>
</div>
</div>
</div>
</div>

View File

@@ -1,10 +1,12 @@
<div class="small-12 column" >
<% if @search_terms && @resources.any? %>
<div class="alert-box radius warning">
<p class="note-marked">
<div class="callout warning">
<p>
<strong>
<%= t("shared.suggest.#{resource_name}.found",
count: @resources.count,
query: @search_terms)%>
</strong>
</p>
<ul>
@@ -14,11 +16,13 @@
</ul>
<% if @resources.count > @limit %>
<p class="note-marked">
<p>
<strong>
<%= t("shared.suggest.#{resource_name}.message",
count: @resources.count,
query: @search_terms,
limit: @limit) %>
</strong>
<%= link_to t("shared.suggest.#{resource_name}.see_all"),
polymorphic_url(resource_model, search: @search_terms)%>
</p>

View File

@@ -18,8 +18,10 @@
<div class="small-12 column">
<%= f.label :password, t("devise_views.users.registrations.edit.password_label") %>
<p class="note"><%= t("devise_views.users.registrations.edit.leave_blank") %></p>
<%= f.password_field :password, autocomplete: "off", label: false, placeholder: t("devise_views.users.registrations.edit.password_label") %>
<p class="help-text" id="password-help-text"><%= t("devise_views.users.registrations.edit.leave_blank") %></p>
<%= f.password_field :password, autocomplete: "off", label: false,
placeholder: t("devise_views.users.registrations.edit.password_label"),
aria: {describedby: "password-help-text"} %>
</div>
<div class="small-12 column">
@@ -29,8 +31,10 @@
<div class="small-12 column">
<%= f.label :current_password, t("devise_views.users.registrations.edit.current_password_label") %>
<p class="note"><%= t("devise_views.users.registrations.edit.need_current") %></p>
<%= f.password_field :current_password, label: false, autocomplete: "off", placeholder: t("devise_views.users.registrations.edit.current_password_label") %>
<p class="help-text" id="current-password-help-text"><%= t("devise_views.users.registrations.edit.need_current") %></p>
<%= f.password_field :current_password, label: false, autocomplete: "off",
placeholder: t("devise_views.users.registrations.edit.current_password_label"),
aria: {describedby: "current-password-help-text"} %>
</div>
<div class="small-12 column">

View File

@@ -18,8 +18,11 @@
<%= f.hidden_field :locale, value: I18n.locale %>
<%= f.label :username %>
<p class="note"><%= t("devise_views.users.registrations.new.username_note") %></p>
<%= f.text_field :username, autofocus: true, maxlength: User.username_max_length, placeholder: t("devise_views.users.registrations.new.username_label"), label: false %>
<p class="help-text" id="username-help-text"><%= t("devise_views.users.registrations.new.username_note") %></p>
<%= f.text_field :username, autofocus: true, maxlength: User.username_max_length,
placeholder: t("devise_views.users.registrations.new.username_label"),
label: false,
aria: {describedby: "username-help-text"} %>
<%= f.invisible_captcha :family_name %>

View File

@@ -76,9 +76,9 @@
<div class="small-12 medium-5 clear">
<%= f.label t("verification.residence.new.postal_code") %>
<p class="note"><%= t("verification.residence.new.postal_code_note") %></p>
<p class="help-text" id="postal-code-help-text"><%= t("verification.residence.new.postal_code_note") %></p>
<div class="medium-6">
<%= f.text_field :postal_code, label: false %>
<%= f.text_field :postal_code, label: false, aria: {describedby: "postal-code-help-text"} %>
</div>
</div>

View File

@@ -31,8 +31,10 @@
<div class="small-12 medium-6">
<%= f.label :phone, t("verification.sms.new.phone"), class: "inline-block" %>
<span class="inline-block"><%= t("verification.sms.new.phone_format_html") %></span>
<p class="note"><%= t("verification.sms.new.phone_note") %></p>
<%= f.text_field :phone, label: false, placeholder: t("verification.sms.new.phone_placeholder") %>
<p class="help-text" id="phone-text-help"><%= t("verification.sms.new.phone_note") %></p>
<%= f.text_field :phone, label: false,
placeholder: t("verification.sms.new.phone_placeholder"),
aria: {describedby: "phone-help-text"} %>
</div>
<%= f.submit t("verification.sms.new.submit_button"), class: "button success" %>

View File

@@ -10,6 +10,9 @@ en:
budget/investment:
one: "Investment"
other: "Investments"
budget/investment/milestone:
one: "milestone"
other: "milestones"
comment:
one: "Comment"
other: "Comments"
@@ -98,6 +101,9 @@ en:
title: "Title"
location: "Location"
organization_name: "If you are proposing in the name of a collective/organization, write its name"
budget/investment/milestone:
title: "Title"
description: "Description"
comment:
body: "Comment"
user: "User"

View File

@@ -10,6 +10,9 @@ es:
budget/investment:
one: "Proyecto de inversión"
other: "Proyectos de inversión"
budget/investment/milestone:
one: "hito"
other: "hitos"
comment:
one: "Comentario"
other: "Comentarios"
@@ -96,6 +99,9 @@ es:
comment:
body: "Comentario"
user: "Usuario"
budget/investment/milestone:
title: "Título"
description: "Descripción"
debate:
author: "Autor"
description: "Opinión"

View File

@@ -97,10 +97,15 @@ en:
heading: Heading name
add_heading: Add heading
amount: Amount
population: Population
save_heading: Save heading
no_heading: This group has no assigned heading.
table_heading: Heading
table_amount: Amount
table_population: Population
winners:
calculate: Calculate Winner Investments
calculated: Winners being calculated, it may take a minute.
budget_investments:
index:
heading_filter_all: All headings
@@ -151,6 +156,8 @@ en:
edit_dossier: Edit dossier
tags: Tags
undefined: Undefined
milestone: Milestone
new_milestone: Create new milestone
edit:
classification: Clasification
assigned_valuators: Valuators
@@ -160,6 +167,24 @@ en:
tags_placeholder: "Write the tags you want separated by commas (,)"
undefined: Undefined
search_unfeasible: Search unfeasible
milestones:
index:
table_id: "ID"
table_title: "Title"
table_description: "Description"
table_actions: "Actions"
delete: "Delete milestone"
no_milestones: "Don't have defined milestones"
new:
creating: Create milestone
edit:
title: Edit milestone
create:
notice: New milestone created successfully!
update:
notice: Milestone updated successfully
delete:
notice: Milestone successfully deleted
comments:
index:
filter: Filter

View File

@@ -97,10 +97,15 @@ es:
heading: Nombre de la partida
add_heading: Añadir partida
amount: Cantidad
population: Población
save_heading: Guardar partida
no_heading: Este grupo no tiene ninguna partida asignada.
table_heading: Partida
table_amount: Cantidad
table_population: Población
winners:
calculate: Calcular propuestas ganadoras
calculated: Calculando ganadoras, puede tardar un minuto.
budget_investments:
index:
heading_filter_all: Todas las partidas
@@ -151,6 +156,8 @@ es:
edit_dossier: Editar informe
tags: Etiquetas
undefined: Sin definir
milestone: Seguimiento
new_milestone: Crear nuevo hito
edit:
classification: Clasificación
assigned_valuators: Evaluadores
@@ -160,6 +167,24 @@ es:
tags_placeholder: "Escribe las etiquetas que desees separadas por comas (,)"
undefined: Sin definir
search_unfeasible: Buscar inviables
milestones:
index:
table_id: "ID"
table_title: "Título"
table_description: "Descripción"
table_actions: "Acciones"
delete: "Eliminar hito"
no_milestones: "No hay hitos definidos"
new:
creating: Crear hito
edit:
title: Editar hito
create:
notice: Nuevo hito creado con éxito!
update:
notice: Hito actualizado
delete:
notice: Hito borrado correctamente
comments:
index:
filter: Filtro

View File

@@ -97,10 +97,15 @@ fr:
heading: Nom de la rubrique
add_heading: Ajouter une rubrique
amount: Montant
population: Population
save_heading: Sauvegarder la rubrique
no_heading: Ce groupe n'a pas de rubrique assignée.
table_heading: Rubrique
table_amount: Montant
table_population: Population
winners:
calculate: Calculate Winner Investments
calculated: Winners being calculated, it may take a minute.
budget_investments:
index:
heading_filter_all: Toutes les rubriques

View File

@@ -98,10 +98,15 @@ nl:
heading: Heading name
add_heading: Add heading
amount: Amount
population: Population
save_heading: Save heading
no_heading: This group has no assigned heading.
table_heading: Heading
table_amount: Amount
table_population: Population
winners:
calculate: Calculate Winner Investments
calculated: Winners being calculated, it may take a minute.
budget_investments:
index:
heading_filter_all: All headings

View File

@@ -93,6 +93,10 @@ en:
supports: Supports
votes: Votes
price: Price
comments_tab: Comments
milestones_tab: Milestones
no_milestones: Don't have defined milestones
milestone_publish_date: "Published %{publish_date}"
wrong_price_format: Only integer numbers
investment:
add: Vote

View File

@@ -93,6 +93,10 @@ es:
supports: Apoyos
votes: Votos
price: Coste
comments_tab: Comentarios
milestones_tab: Seguimiento
no_milestones: No hay hitos definidos
milestone_publish_date: "Publicado el %{publish_date}"
wrong_price_format: Solo puede incluir caracteres numéricos
investment:
add: Votar

View File

@@ -298,7 +298,7 @@ en:
geozone: Scope of operation
proposal_external_url: Link to additional documentation
proposal_question: Proposal question
proposal_question_example_html: Must be summarised in one question with a Yes or No answer. <em>E.g. 'Do you agree with the pedestrianisation of Calle Mayor?'</em>
proposal_question_example_html: "Must be summarised in one question with a Yes or No answer. <br>E.g. 'Do you agree with the pedestrianisation of Calle Mayor?'"
proposal_responsible_name: Full name of the person submitting the proposal
proposal_responsible_name_note: "(individually or as representative of a collective; will not be displayed publically)"
proposal_summary: Proposal summary
@@ -357,12 +357,13 @@ en:
notice:
retired: Proposal retired
proposal:
created: "You've created a new proposal!"
created: "You've created a proposal!"
share:
guide: "Now you can share it through Twitter, Facebook, Google+, Telegram or Whatsapp (if you're using a mobile device) so people can start supporting.<br><br>Before it gets shared you'll be able to change the text as you like."
guide: "Now you can share it so people can start supporting."
edit: "Before it gets shared you'll be able to change the text as you like."
view_proposal: Not now, go to my proposal
improve_info: "You can also %{improve_info_link} about improving your campaign"
improve_info_link: see more information
improve_info: "Improve your campaign and get more supports"
improve_info_link: "See more information"
already_supported: You have already supported this proposal. Share it!
comments:
one: 1 comment

View File

@@ -298,7 +298,7 @@ es:
geozone: "Ámbito de actuación"
proposal_external_url: Enlace a documentación adicional
proposal_question: Pregunta de la propuesta
proposal_question_example_html: Debe ser resumida en una pregunta cuya respuesta sea Sí o No. <em>Ej. '¿Está usted de acuerdo en peatonalizar la calle Mayor?'</em>
proposal_question_example_html: "Debe ser resumida en una pregunta cuya respuesta sea Sí o No. <br>Ej. '¿Está usted de acuerdo en peatonalizar la calle Mayor?'"
proposal_responsible_name: Nombre y apellidos de la persona que hace esta propuesta
proposal_responsible_name_note: "(individualmente o como representante de un colectivo; no se mostrará públicamente)"
proposal_summary: Resumen de la propuesta
@@ -357,12 +357,13 @@ es:
notice:
retired: Propuesta retirada
proposal:
created: "¡Has creado una nueva propuesta!"
created: "¡Has creado una propuesta!"
share:
guide: "Ahora puedes compartirla en Twitter, Facebook, Google+, Telegram o Whatsapp (si utilizas un dispositivo móvil) para que la gente empieze a apoyarla.<br><br>Antes de que se publique el texto en las redes sociales podrás modificarlo a tu gusto"
view_proposal: "Ahora no, ver mi propuesta"
improve_info: "También puedes %{improve_info_link} de como mejorar tu campaña"
improve_info_link: ver más información
guide: "Compártela para que la gente empieze a apoyarla."
edit: "Antes de que se publique podrás modificar el texto a tu gusto."
view_proposal: "Ahora no, ir a mi propuesta"
improve_info: "Mejora tu campaña y consigue más apoyos"
improve_info_link: "Ver más información"
already_supported: "¡Ya has apoyado esta propuesta, compártela!"
comments:
one: 1 Comentario

View File

@@ -1249,8 +1249,8 @@ fr:
proposal_external_url: Lien vers de la documentation complémentaire
proposal_question: Question proposée
proposal_question_example_html: 'Doit être résumé par une question appelant
à une réponse par oui ou par non. <em>Exemple : ''Êtes-vous d''accord avec
la piétonnisation de Calle Mayor?''</em>'
à une réponse par oui ou par non. <br>Exemple : ''Êtes-vous d''accord avec
la piétonnisation de Calle Mayor?'
proposal_responsible_name: Nom complet de la personne qui soumet la proposition
proposal_responsible_name_note: "(individuellement ou comme représentant d'un
collectif; ne sera pas public)"

View File

@@ -300,7 +300,7 @@ nl:
geozone: Regio
proposal_external_url: Link naar meet informatie
proposal_question: Vraag
proposal_question_example_html: Moet samengevat worden in een vraag met een ja/nee antwoord. <Em>E.g. 'Ben je het eens met autovrije Geldersekade?'</em>
proposal_question_example_html: Moet samengevat worden in een vraag met een ja/nee antwoord. <br>E.g. 'Ben je het eens met autovrije Geldersekade?'
proposal_responsible_name: Volledige naam van persoon die het voorstel doet
proposal_responsible_name_note: "(individueel of als vertegenwoordiger van een collectief; niet publiek zichtbaar)"
proposal_summary: Samenvatting voorstel

View File

@@ -1267,8 +1267,8 @@ pt-BR:
proposal_external_url: Link para documentação adicional
proposal_question: Questão proposta
proposal_question_example_html: 'Precisa ser sumarizado em uma questão com resposta
Sim ou Não. <em>Ex.: ''Você concorda com a mudança da Calle Mayor como via
exclusiva de pedestres?''</em>'
Sim ou Não. <br>Ex.: ''Você concorda com a mudança da Calle Mayor como via
exclusiva de pedestres?'
proposal_responsible_name: Nome completo da pessoa que está submetendo a proposta
proposal_responsible_name_note: "(indivudualmente ou como representante de um
coletivo; não será mostrado publicamente)"

View File

@@ -193,16 +193,22 @@ Rails.application.routes.draw do
end
resources :budgets do
member do
put :calculate_winners
end
resources :budget_groups do
resources :budget_headings do
end
end
resources :budget_investments, only: [:index, :show, :edit, :update] do
resources :budget_investment_milestones
member { patch :toggle_selection }
end
end
resources :signature_sheets, only: [:index, :new, :create, :show]
resources :banners, only: [:index, :new, :create, :edit, :update, :destroy] do

View File

@@ -390,7 +390,8 @@ Budget::PHASES.each_with_index do |phase, i|
geozones = Geozone.reorder("RANDOM()").limit([2, 5, 6, 7].sample)
geozones.each do |geozone|
group.headings << group.headings.create!(name: geozone.name,
price: rand(1..100) * 100000)
price: rand(1..100) * 100000,
population: rand(1..50) * 10000)
end
end
end

View File

@@ -0,0 +1,11 @@
class CreateBudgetInvestmentMilestones < ActiveRecord::Migration
def change
create_table :budget_investment_milestones do |t|
t.integer :investment_id
t.string "title", limit: 80
t.text "description"
t.timestamps null: false
end
end
end

View File

@@ -0,0 +1,5 @@
class AddPopulationToBudgetHeadings < ActiveRecord::Migration
def change
add_column :budget_headings, :population, :integer, default: nil
end
end

View File

@@ -110,10 +110,19 @@ ActiveRecord::Schema.define(version: 20170623141655) do
t.integer "group_id"
t.string "name", limit: 50
t.integer "price", limit: 8
t.integer "population"
end
add_index "budget_headings", ["group_id"], name: "index_budget_headings_on_group_id", using: :btree
create_table "budget_investment_milestones", force: :cascade do |t|
t.integer "investment_id"
t.string "title", limit: 80
t.text "description"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "budget_investments", force: :cascade do |t|
t.integer "author_id"
t.integer "administrator_id"
@@ -923,7 +932,7 @@ ActiveRecord::Schema.define(version: 20170623141655) do
t.boolean "email_digest", default: true
t.boolean "email_on_direct_message", default: true
t.boolean "official_position_badge", default: false
t.datetime "password_changed_at", default: '2016-12-21 17:55:08', null: false
t.datetime "password_changed_at", default: '2017-06-22 11:21:30', null: false
t.boolean "created_from_signature", default: false
t.integer "failed_email_digests_count", default: 0
t.text "former_users_data_log", default: ""

View File

@@ -25,7 +25,7 @@ class ManagerAuthenticator
parsed_response = parser.parse((response[:get_applications_user_list_response][:get_applications_user_list_return]))
aplication_value = parsed_response["APLICACIONES"]["APLICACION"]
# aplication_value from UWEB can be an array of hashes or a hash
aplication_value.include?( {"CLAVE_APLICACION" => application_key}) || aplication_value["CLAVE_APLICACION"] == application_key
aplication_value.include?("CLAVE_APLICACION" => application_key) || aplication_value["CLAVE_APLICACION"] == application_key
rescue
false
end

View File

@@ -50,7 +50,7 @@ class MigrateSpendingProposalsToInvestments
votes = ActsAsVotable::Vote.where(votable_type: 'SpendingProposal', votable_id: sp.id)
votes.each {|v| investment.vote_by({voter: v.voter, vote: 'yes'}) }
votes.each {|v| investment.vote_by(voter: v.voter, vote: 'yes') }
# Spending proposals are not commentable in Consul so we can not test this
#

View File

@@ -1,6 +1,6 @@
module ScoreCalculator
EPOC = Time.new(2015, 6, 15)
EPOC = Time.new(2015, 6, 15).in_time_zone
COMMENT_WEIGHT = 1.0 / 5 # 1 positive vote / x comments
TIME_UNIT = 24.hours.to_f

View File

@@ -38,7 +38,20 @@ class SMSApi
end
def stubbed_response
{:respuesta_sms=>{:identificador_mensaje=>"1234567", :fecha_respuesta=>"Thu, 20 Aug 2015 16:28:05 +0200", :respuesta_pasarela=>{:codigo_pasarela=>"0000", :descripcion_pasarela=>"Operación ejecutada correctamente."}, :respuesta_servicio_externo=>{:codigo_respuesta=>"1000", :texto_respuesta=>"Success"}}}
{
respuesta_sms: {
identificador_mensaje: "1234567",
fecha_respuesta: "Thu, 20 Aug 2015 16:28:05 +0200",
respuesta_pasarela: {
codigo_pasarela: "0000",
descripcion_pasarela: "Operación ejecutada correctamente."
},
respuesta_servicio_externo: {
codigo_respuesta: "1000",
texto_respuesta: "Success"
}
}
}
end
end

View File

@@ -17,9 +17,9 @@ describe Admin::Api::StatsController do
context 'events present' do
before :each do
time_1 = DateTime.parse("2015-01-01")
time_2 = DateTime.parse("2015-01-02")
time_3 = DateTime.parse("2015-01-03")
time_1 = DateTime.parse("2015-01-01").in_time_zone
time_2 = DateTime.parse("2015-01-02").in_time_zone
time_3 = DateTime.parse("2015-01-03").in_time_zone
create :ahoy_event, name: 'foo', time: time_1
create :ahoy_event, name: 'foo', time: time_1
@@ -52,8 +52,8 @@ describe Admin::Api::StatsController do
context 'visits present' do
it 'should return visits formated for working with c3.js' do
time_1 = DateTime.parse("2015-01-01")
time_2 = DateTime.parse("2015-01-02")
time_1 = DateTime.parse("2015-01-01").in_time_zone
time_2 = DateTime.parse("2015-01-02").in_time_zone
create :visit, started_at: time_1
create :visit, started_at: time_1
@@ -71,8 +71,8 @@ describe Admin::Api::StatsController do
context 'visits and events present' do
it 'should return combined events and visits formated for working with c3.js' do
time_1 = DateTime.parse("2015-01-01")
time_2 = DateTime.parse("2015-01-02")
time_1 = DateTime.parse("2015-01-01").in_time_zone
time_2 = DateTime.parse("2015-01-02").in_time_zone
create :ahoy_event, name: 'foo', time: time_1
create :ahoy_event, name: 'foo', time: time_2
@@ -94,8 +94,8 @@ describe Admin::Api::StatsController do
context 'budget investments present' do
it 'should return budget investments formated for working with c3.js' do
time_1 = DateTime.parse("2017-04-01")
time_2 = DateTime.parse("2017-04-02")
time_1 = DateTime.parse("2017-04-01").in_time_zone
time_2 = DateTime.parse("2017-04-02").in_time_zone
budget_investment1 = create(:budget_investment, budget: @budget, created_at: time_1)
budget_investment2 = create(:budget_investment, budget: @budget, created_at: time_2)

View File

@@ -4,7 +4,7 @@ describe CommentsController do
describe 'POST create' do
before(:each) do
@process = create(:legislation_process, debate_start_date: Date.current - 3.day, debate_end_date: Date.current + 2.days)
@process = create(:legislation_process, debate_start_date: Date.current - 3.days, debate_end_date: Date.current + 2.days)
@question = create(:legislation_question, process: @process, title: "Question 1")
@user = create(:user, :level_two)
@unverified_user = create(:user)

View File

@@ -71,19 +71,19 @@ describe GraphqlController, type: :request do
let(:query_string) { "{ proposal(id: #{proposal.id}) { title } }" }
specify "when absent" do
get '/graphql', { query: query_string }
get '/graphql', query: query_string
expect(response).to have_http_status(:ok)
end
specify "when specified as the 'null' string" do
get '/graphql', { query: query_string, variables: 'null' }
get '/graphql', query: query_string, variables: 'null'
expect(response).to have_http_status(:ok)
end
specify "when specified as an empty string" do
get '/graphql', { query: query_string, variables: '' }
get '/graphql', query: query_string, variables: ''
expect(response).to have_http_status(:ok)
end

View File

@@ -4,7 +4,7 @@ describe Legislation::AnnotationsController do
describe 'POST create' do
before(:each) do
@process = create(:legislation_process, allegations_start_date: Date.current - 3.day, allegations_end_date: Date.current + 2.days)
@process = create(:legislation_process, allegations_start_date: Date.current - 3.days, allegations_end_date: Date.current + 2.days)
@draft_version = create(:legislation_draft_version, :published, process: @process, title: "Version 1")
@final_version = create(:legislation_draft_version, :published, :final_version, process: @process, title: "Final version")
@user = create(:user, :level_two)

View File

@@ -4,7 +4,7 @@ describe Legislation::AnswersController do
describe 'POST create' do
before(:each) do
@process = create(:legislation_process, debate_start_date: Date.current - 3.day, debate_end_date: Date.current + 2.days)
@process = create(:legislation_process, debate_start_date: Date.current - 3.days, debate_end_date: Date.current + 2.days)
@question = create(:legislation_question, process: @process, title: "Question 1")
@question_option = create(:legislation_question_option, question: @question, value: "Yes")
@user = create(:user, :level_two)

View File

@@ -10,7 +10,7 @@ describe Management::UsersController do
get :logout
expect(session[:manager]).to eq({user_key: "31415926" , date: "20151031135905", login: "JJB033"})
expect(session[:manager]).to eq(user_key: "31415926", date: "20151031135905", login: "JJB033")
expect(session[:document_type]).to be_nil
expect(session[:document_number]).to be_nil
expect(response).to be_redirect

View File

@@ -254,6 +254,7 @@ FactoryGirl.define do
association :group, factory: :budget_group
sequence(:name) { |n| "Heading #{n}" }
price 1000000
population 1234
end
factory :budget_investment, class: 'Budget::Investment' do
@@ -322,6 +323,12 @@ FactoryGirl.define do
reason "unfeasible"
end
factory :budget_investment_milestone, class: 'Budget::Investment::Milestone' do
association :investment, factory: :budget_investment
sequence(:title) { |n| "Budget investment milestone #{n} title" }
description 'Milestone description'
end
factory :vote do
association :votable, factory: :debate
association :voter, factory: :user
@@ -541,7 +548,7 @@ FactoryGirl.define do
sequence(:value) { |n| "Setting #{n} Value" }
end
factory :ahoy_event, :class => Ahoy::Event do
factory :ahoy_event, class: Ahoy::Event do
id { SecureRandom.uuid }
time DateTime.current
sequence(:name) {|n| "Event #{n} type"}
@@ -628,7 +635,7 @@ FactoryGirl.define do
end_date Date.current + 8.days
debate_start_date Date.current + 2.days
debate_end_date Date.current + 4.days
draft_publication_date Date.current + 5.day
draft_publication_date Date.current + 5.days
allegations_start_date Date.current + 5.days
allegations_end_date Date.current + 7.days
result_publication_date Date.current + 8.days
@@ -639,7 +646,7 @@ FactoryGirl.define do
end_date Date.current - 2.days
debate_start_date Date.current - 12.days
debate_end_date Date.current - 9.days
draft_publication_date Date.current - 8.day
draft_publication_date Date.current - 8.days
allegations_start_date Date.current - 8.days
allegations_end_date Date.current - 4.days
result_publication_date Date.current - 2.days
@@ -649,7 +656,7 @@ FactoryGirl.define do
start_date Date.current - 5.days
end_date Date.current + 5.days
debate_start_date Date.current - 5.days
debate_end_date Date.current + 1.days
debate_end_date Date.current + 1.day
draft_publication_date Date.current + 1.day
allegations_start_date Date.current + 2.days
allegations_end_date Date.current + 3.days

View File

@@ -29,7 +29,7 @@ feature 'Admin banners magement' do
target_url: "http://www.url.com",
style: "banner-style.banner-three",
image: "banner-img.banner-three",
post_started_at: (Time.current - 1.days),
post_started_at: (Time.current - 1.day),
post_ended_at: (Time.current + 10.days))
@banner4 = create(:banner, title: "Banner number four",

View File

@@ -0,0 +1,92 @@
require 'rails_helper'
feature 'Admin budget investment milestones' do
background do
admin = create(:administrator)
login_as(admin.user)
@investment = create(:budget_investment)
end
context "Index" do
scenario 'Displaying milestones' do
milestone = create(:budget_investment_milestone, investment: @investment)
visit admin_budget_budget_investment_path(@investment.budget, @investment)
expect(page).to have_content("Milestone")
expect(page).to have_content(milestone.title)
expect(page).to have_content(milestone.id)
end
scenario 'Displaying no_milestones text' do
visit admin_budget_budget_investment_path(@investment.budget, @investment)
expect(page).to have_content("Milestone")
expect(page).to have_content("Don't have defined milestones")
end
end
context "New" do
scenario "Add milestone" do
visit admin_budget_budget_investment_path(@investment.budget, @investment)
click_link 'Create new milestone'
fill_in 'budget_investment_milestone_title', with: 'New title milestone'
fill_in 'budget_investment_milestone_description', with: 'New description milestone'
click_button 'Create milestone'
expect(page).to have_content 'New title milestone'
expect(page).to have_content 'New description milestone'
end
scenario "Show validation errors on milestone form" do
visit admin_budget_budget_investment_path(@investment.budget, @investment)
click_link 'Create new milestone'
fill_in 'budget_investment_milestone_description', with: 'New description milestone'
click_button 'Create milestone'
within "#new_budget_investment_milestone" do
expect(page).to have_content "can't be blank"
expect(page).to have_content 'New description milestone'
end
end
end
context "Edit" do
scenario "Change title and description" do
milestone = create(:budget_investment_milestone, investment: @investment)
visit admin_budget_budget_investment_path(@investment.budget, @investment)
click_link milestone.title
fill_in 'budget_investment_milestone_title', with: 'Changed title'
fill_in 'budget_investment_milestone_description', with: 'Changed description'
click_button 'Update milestone'
expect(page).to have_content 'Changed title'
expect(page).to have_content 'Changed description'
end
end
context "Delete" do
scenario "Remove milestone" do
milestone = create(:budget_investment_milestone, investment: @investment, title: "Title will it remove")
visit admin_budget_budget_investment_path(@investment.budget, @investment)
click_link "Delete milestone"
expect(page).to_not have_content 'Title will it remove'
end
end
end

Some files were not shown because too many files have changed in this diff Show More