Commit Graph

504 Commits

Author SHA1 Message Date
Juan Salvador Pérez García
762c4faef6 Fixes #141
Adds ideal progress to progress graph
2018-07-17 17:59:11 +02:00
Juan Salvador Pérez García
6e75f5b494 Fixes #140
Adds a new setting that allows defining what is considered a successful
proposal.
2018-07-17 17:59:11 +02:00
Juan Salvador Pérez García
c8b2f13cfd Fixed bug in rake task 2018-07-17 17:58:22 +02:00
Juan Salvador Pérez García
3c3f60dfcc Implements #173
Public view for suggested actions as well as resources has been
completelly redesigned.

Private side for this feature has been adapted as well in order to meet
the requirements.
2018-07-17 17:58:22 +02:00
Juan Salvador Pérez García
1db5a00eae Prepare capistrano/db migrations to support more setups (#2)
The following parameters have been added to deploy-secrets.yml:

* **use_rvm**: yes/no
* **ruby_version**: Ruby version for rvm. Defaults to 2.3.2
* **repository**: Git repository. Defaults to the oficial repository
* **branch**: Branch to deploy. Defaults to master
* **rails_env**: Defaults to the stage.

Fixed migrations that required admin rights. Now first check if the postgress extensions are available. If so finish without doing nothin.

Added support for passenger.
2018-07-17 17:46:54 +02:00
Angel Perez
1884841ffc Add Rake task to enable recommendations settings 2018-07-15 21:28:59 -04:00
Angel Perez
e194240a0a Add rake task to enable recommendations for existing users 2018-07-15 21:28:59 -04:00
iagirre
0d9da5398b Fix banners in user pages
Banners were not been shown in certain pages; now
they are.

Spec to check if the banner is been shown correctly
added. Before it was in admins specs, now it has it's
own spec out of admins folder.
2018-07-12 10:17:25 -04:00
iagirre
82cb8d4c52 Changes suggested in PR:
* Delete all things related to banner images and styles (in code)
* Add a new test to check that the banner is showing correctly
* Update the specs accordingly to match the changes

Update dev_seed to set a random background_color and a font_color for banners (and remove everything about image and style)
Add a rake task to migrate the banner style to backgroun_color and font_color (so that the banners have the same colors than before)
2018-07-12 10:17:24 -04:00
iagirre
3690cae458 Apply banner style to the new banners
Banner sections can be saved (one banner can appear in several sections)
If the hex color is changed in the textfield, the color of the color picker changes.
2018-07-12 10:16:47 -04:00
Pierre Mesure
1ebcf04186 Adding images and seeds for the homepage 2018-06-15 14:26:29 +02:00
rgarcia
1f16f9df6b Add feed settings to release rake 2018-05-30 13:19:19 +02:00
rgarcia
25133043b2 Add rake task to initialize feeds in homepage 2018-05-29 19:58:37 +02:00
Bertocq
fcdc24a78c Avoid db:dev_seed log print when run from its test
The db:dev_seed rake logs info as it progresses as information for the
developer. But that's not needed when ran from its tests file, and it
bloats the travis/rspec output with unnecessary information.

Now the task will always log info unless the rake task receives an
optional argument.
2018-04-14 20:28:43 +02:00
Bertocq
35c156ba7a Create setting to enable/disable attached documents
Add setting to both seed and dev_seeds as well as a rake task to make it
easier to set.
2018-04-10 12:46:09 +02:00
Bertocq
633cc1283b Fix Date & DateTime parsings to use default timezone
Date.new(...) does not take into account the current timezone, while other
parts of the application do. By default always parsing any date with the
default timezone and converting the resulting Time to Date would prevent
this kind of issues

DateTime.parse(...).in_time_zone gives an unexpected result, as the
DateTime.parse(...) will create a DateTime with +0000 time zone and the
`in_time_zone` will modify the DateTime to adjust to the default zone.

Maybe its better explained with an example, using 'Lima' as timezone:

DateTime.parse("2015-01-01")
> Thu, 01 Jan 2015 00:00:00 +0000

DateTime.parse("2015-01-01").in_time_zone
> Wed, 31 Dec 2014 19:00:00 -05 -05:00

And that's not the desired date but the previous day!
2018-04-04 14:21:39 +02:00
Bertocq
2ecbfc76e0 Add Segment for users without supports on Budget
Created not_supported_on_current_budget at UserSegment along with model
spec scenario and translation strings.
2018-03-15 16:48:54 +01:00
Bertocq
04316a4460 Remove internal_comments usage in migration script
Internal comments on migration script from SpendingProposal to
Investments are no longer in use, so removal is best option.
2018-03-09 12:27:04 +01:00
Bertocq
6d55a0712d Remove no longer usable investments rake task 2018-03-09 11:44:51 +01:00
Bertocq
6b41b6487b Add UserSegments#user_segment_emails helper method
Why:

Both Newsletters and Email Downloads need the same logic: To extract the
emails from all the users in the segment that have newsletter flag
active, removing all empty email values.

How:

1- UserSegments#user_segment_emails holds that repeated logic and is used
on both Newsletter & EmailDownload.

2- Rename Newsletter#list_of_recipients to list_of_recipient_emails as
it is more descriptive. There is no need to pass entire Users around,
only the emails are needed at Mailer#newsletter method.

3- Cleanup Newsletter#list_of_recipient_emails model spec scenario
2018-03-01 20:59:20 +01:00
María Checa
678ea0bef2 Added unfeasible investments with valuation not finished to UserSegments#feasible_and_undecided_investment_authors 2018-02-28 16:54:28 +01:00
Bertocq
61f015e2c2 Add administrators UserSegment
We need a user segment to have only administrators as recipients of both
newsletters and notifications
2018-02-21 23:34:20 +01:00
Bertocq
fb2c92228a Refactor UserSegment class
Simple refactor to avoid creating unnecessary variables and make it easier
to read.
2018-02-21 11:47:30 +01:00
Bertocq
bdbb32e824 Move newsletter User scope outside UserSegments
Why:

UserSegments are not only used for Newsletters or Email downloads, but
also for internal Global Notifications. We don't want to have that scope
hardcoded inside UserSegments as users that have opted-out from the
newsletter should still be recipients of global notifications.

How:

Removing the scope from the UserSegments `all_users` method that acts as
base for all the other segments. Including that `newsletter` scope only
on the places that is relevant:
* When listing recipients for a newsletter
* When downloading a listing emails that can be newsletter recipients

Also updated relevant tests
2018-02-21 11:45:38 +01:00
María Checa
6c36e17ce2 Added SEGMENTS variable to UserSegments class 2018-02-20 22:33:01 +01:00
María Checa
cb15a2e25b Added EmailsDownload controller and routes
Removed original method to return emails file from Newsletters controller and NewsletterZip class, included `rubyzip` gem that's no longer necessary.
2018-02-20 22:33:01 +01:00
María Checa
07f2419f8f Added newsletter model and UserSegments class 2018-02-13 11:39:10 +01:00
BertoCQ
38b66e8c6c Merge pull request #2295 from wairbut-m2c/aperez-mappable-objects
Improvements for Mappable objects
2018-02-02 19:26:47 +01:00
BertoCQ
05a6406189 Merge branch 'master' into remove_investments_internal_comments 2018-01-31 13:47:15 +01:00
Bertocq
dff966d9b3 Show valuation comment thread @ Valuation show/edit
Why:

Budget Investment's valuators should be able to see internal valuation
comments thread at both show and edit views.

How:

At Valuation::BudgetInvestmentsController:
* Include CommentableActions to gain access to the entire feature, with
required resource_model & resource_name methods.
* Add the only possible order (oldest to newest)
* Load comments on both show & edit actions, passing `valuations` flag
to the CommentTree in order to only list those.

At CommentTree:
* Use `valuations` flag as instance variable to decide wich
comment threat to load: valuations (if relation exists) or comments.
2018-01-31 01:53:33 +01:00
Bertocq
09aa5a17cf Add rake task to migrate investment's internal comments to thread 2018-01-31 01:11:15 +01:00
Angel Perez
665a5b57ab Empty instances of MapLocation won't result in a new DB record (#2220) 2018-01-26 09:26:48 -04:00
Bertocq
9e4559e374 Revert random district code on census api mock response 2018-01-23 18:38:07 +01:00
Bertocq
c30c47cbb5 Improve default city map with 4 districts, and more real fake geozones 2018-01-23 15:59:24 +01:00
Bertocq
7db0d832d9 Fix typo at budgets:phases:generate_missing rake task 2018-01-17 13:02:14 +01:00
Bertocq
02d596c872 Add a rake task to generate missing Budget::Phase's and migrate descricptions 2018-01-16 15:20:52 +01:00
Raimond Garcia
50884f7f24 Merge branch 'master' into aperez-capistrano-maintenance-task 2018-01-09 16:17:21 +01:00
rgarcia
2b9b78e38e Add rake task to reset the cached votes counter 2017-12-26 12:40:26 +01:00
Bertocq
b02e2729e7 Rubocop style autocorrections 2017-12-16 17:59:16 +01:00
rgarcia
a6a71c996a adds rake task to initialise all polls' timestamps 2017-12-13 19:39:54 +01:00
Angel Perez
c643656067 Add Capistrano task to automate maintenance mode 2017-11-17 13:11:17 -04:00
María Checa
20fd8c0515 Officing tests improvements 2017-10-17 20:41:48 +02:00
Bertocq
c2d154b1ac Comply with Style/PredicateName rule for ? method names 2017-09-20 16:12:28 +02:00
taitus
9b6b57a24c Remove all white spaces 2017-09-06 14:12:32 +02:00
taitus
56eb30cc87 Add associate community rake task. 2017-09-05 12:55:12 +02:00
Bertocq
7d406cae76 Rubocop autocorrections 2017-07-25 13:01:03 +02:00
María Checa
d576fd5951 Merge branch 'master' into 1725-census_local_copy_user_verification 2017-07-14 15:50:26 +02:00
María Checa
13409c2e35 Performance minor changes in CensusCaller and LocalCensus 2017-07-14 15:35:50 +02:00
Bertocq
69f4e1c683 Fix all rubocop Metrics/LineLength issues (140+) 2017-07-10 13:22:49 +02:00
María Checa
089c690b49 Created new entry point CensusCaller
Here's a better alternative than the first one. Added a new abstraction level from which are performed both types of census calls, while the logic of those is managed in their own library.
2017-07-10 12:22:30 +02:00