Commit Graph

1508 Commits

Author SHA1 Message Date
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
017c242085 Merge pull request #2462 from consul/admin-newsletter-emails
Admin newsletter emails
2018-02-20 16:17:37 +01:00
Bertocq
9925e2b02f Extract inline query to User scope & refactor 2018-02-19 11:09:19 +01:00
Bertocq
62d75af892 Fix line lenght offenses at multiple controllers 2018-02-19 11:09:19 +01:00
Bertocq
4fb9f6829c Extract inline query to an OfficerAssignment scope 2018-02-19 11:09:19 +01:00
Bertocq
118deb9fc4 Fix line lenght offenses at multiple controllers 2018-02-19 11:09:19 +01:00
María Checa
24bca36639 Merge branch 'master' into admin-newsletter-emails 2018-02-14 16:07:13 +01:00
María Checa
49adcfde02 Added newsletter controller and routes 2018-02-13 11:39:12 +01:00
Bertocq
2341a2f70b Add by_budget scope to Investment and use it 2018-02-10 16:36:14 +01:00
Raúl Fuentes
ebebbdf078 Added bigger pool for random seeds, now with a 9 * 10e-07 % of chance of appearing, also added test to cover edge cases (case in fact, the coincidence of the seeds it's correct)
Conflicts:
	app/controllers/budgets/investments_controller.rb
2018-02-08 16:33:15 +01:00
Bertocq
f44d64207c Release v0.13 2018-02-05 21:10:09 +01:00
BertoCQ
e1d6d4a8f8 Merge pull request #2416 from wairbut-m2c/show_error_message_when_relating_content_to_itself
Show error message when relating content to itself
2018-02-05 12:45:56 +01:00
Bertocq
6e9191dc7c Budget Investment controller has no update method 2018-02-03 01:19:25 +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
Vicente Mendoza
74124fb784 Control when the investment is trying to relate to itself. 2018-02-02 10:52:28 +01:00
Bertocq
bca150bcd5 Prevent non-authors from viewing valuation comments 2018-01-31 18:38:44 +01:00
Bertocq
c0dcd03bab Prevent valuation comments from appearing in public pages 2018-01-31 18:14:11 +01:00
Bertocq
b926740a32 Show valuation comments at admin investment show page 2018-01-31 16:35:45 +01:00
Angel Perez
47c9b343ee Admins can search investments by title or ID (#2401) 2018-01-31 09:52:55 -04:00
Raimond Garcia
45d07fa16f Merge pull request #2407 from wairbut-m2c/aperez-investment-filters-aggregation
Investments can be applied several filters at once
2018-01-31 14:39:02 +01:00
BertoCQ
05a6406189 Merge branch 'master' into remove_investments_internal_comments 2018-01-31 13:47:15 +01:00
Angel Perez
a5159672d4 Investments are now aggregated when using more than 1 advanced filter 2018-01-31 07:21:51 -04:00
Bertocq
149c81371b Allow valuation internal comments to be created
How:

Using a local variable at partials to set a hidden true/false value for
`valuation` parameter on the comment creation form.

Allowing that new param at the comment controller and using it when
building a new Comment.
2018-01-31 02:03:02 +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
093b191f16 Small rubocop autocorrections 2018-01-30 03:07:52 +01:00
BertoCQ
dab1562132 Merge pull request #2369 from consul/fix_finished_budgets_list
Correctly show finished budgets at budget index
2018-01-30 02:25:06 +01:00
Bertocq
d280c254c8 Remove usage of Investment's internal_comments attr 2018-01-29 21:15:28 +01:00
Raimond Garcia
626b9972d1 Merge pull request #2378 from wairbut-m2c/aperez-investments-search
Add search & sorting options to Admin::BudgetInvestments
2018-01-29 20:06:43 +01:00
Alberto García
1207b5ce51 Merge pull request #2279 from wairbut-m2c/aperez-missing-i18n-keys
I18n maintenance
2018-01-29 14:02: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
6d3359dbbc Fix bad line break 2018-01-26 12:01:22 +01:00
Bertocq
5e583d2015 Increase notifiable access security on add notification method 2018-01-26 11:24:13 +01:00
Bertocq
f4ad0b2979 Improve add_notification logic to add notificable author 2018-01-26 00:33:07 +01:00
Bertocq
070c94494e Fix linelenght over 100 on multiple files 2018-01-26 00:27:03 +01:00
Angel Perez
e04dc5b8f2 Add sorting options for Admin::BudgetInvestments (#2336) 2018-01-25 08:18:04 -04:00
Angel Perez
680ca46ef1 Add search form for Admin::BudgetInvestments (#2336) 2018-01-25 08:16:32 -04:00
Bertocq
c01c08a3f4 Use current_budget directly instead of instance variable 2018-01-25 00:48:52 +01:00
Bertocq
791f081a91 Rename @budget to @current budget at budget index
Clear instance variable names help understand what's going around when
you're deep 2 or 3 partials. In this case @budget is only used to carry
around the current_budget so @current_budget is more descriptive.

Using `current_budget` directly around would be an alternative, but
maybe not as maintainable in case we want to change which budget is
being shown (for example the drafting one if you're admin).
2018-01-25 00:48:52 +01:00
Bertocq
e62ca48a94 Show only finished budgets at budget's index
We only need finished budget's at budget's index "Finished budgets"
section. So we add the `finished` scope to @budgets variable, and rename
it so its clear what it contains.

Also avoid showing the "Finished budgets" section if there is none
2018-01-25 00:48:52 +01:00
María Checa
1c2949b60d Merge pull request #2344 from wairbut-m2c/aperez-investments-filters
Improvements for Admin::Budget::Investment filters
2018-01-23 20:09:54 +01:00
Bertocq
e59ed81528 Return 404 accesing community without communitable
Why:

Somehow we're seeing communities without proposals at production. We
must find why and fix it, but first we need to throw a 404 at the user
instead of a 500 internal server error

How:

First catching the scenario of non-existent communitable at the
controller and raising a 404 error. Secondly preventing the author_id
access over a possibly nil object, this is a smell but it can't be
easily fixed right now... we need to correctly implement a relation
between Community and communitable and avoid the multiple occurences of
`community.from_proposal?` in the codebase that makes it impossible to
extend to a fourth communitable model.
2018-01-23 00:22:53 +01:00
Angel Perez
1027896617 Reenable 'winners' tab under Admin::Budget::Investment 2018-01-22 14:04:57 -04:00
Angel Perez
ff40d32028 Add new filters to Admin::Budget::Investment navbar 2018-01-22 14:02:29 -04:00
Angel Perez
e92a67a206 Simplify filters navbar on Admin::Budget::Investment 2018-01-22 14:02:29 -04:00
Angel Perez
e5c73d8f02 Add advanced filters for Admin::Budget::Investment 2018-01-22 14:02:29 -04:00
María Checa
1f461b09f0 Merge pull request #2353 from consul/2339-admin_budgets_phases
Allow admins to edit Budget phases
2018-01-22 18:07:34 +01:00
decabeza
0eaba9fc9e changes order for finished budgets on budgets homepage list 2018-01-22 14:46:54 +01:00
Angel Perez
8499549eeb Add missing I18n key for Admin::Poll::Questions::Answers::Images 2018-01-19 15:34:44 -04:00
María Checa
1abb7f0310 Added admin budget phases controller and routes 2018-01-19 17:55:24 +01:00
rgarcia
d3d05f9cee Add guide to create a proposal or investment
During a Participatory Budget, some users are getting confused and
creating a proposal instead of a budget investment. This intermediate
page should help them create investments

Adding a feature flag just in case other forks don’t need this feature
and setting seeds and dev_seeds for appropriate initial setup
2018-01-18 21:09:21 +01:00