Commit Graph

210 Commits

Author SHA1 Message Date
Juan Salvador Pérez García
e8e01b184f Fixed issue accumulating supports 2018-09-17 19:49:33 +02:00
Juan Salvador Pérez García
a658536142 Fixed issue when filling holes in grouped supports query 2018-09-17 19:37:29 +02:00
Juan Salvador Pérez García
0bd381aa5e Enhancements and bugfixing
FIxed issue in last commit: supports controller were not correctly
filling the holes without data.

Fixed duplication in supports and successful supports controller using a
concer.

Successfull supports controller will fill the holes without data in the
same way that supports controller does.
2018-09-14 11:30:59 +02:00
Juan Salvador Pérez García
3590657777 Enhancements on supports controller
Supports controller now fill the holes in the results: When there are no
supports collected for one interval it takes the accumulated value from the
previous one.

Data starts in the publication date.
2018-09-14 10:49:29 +02:00
Marko Lovic
96b798865a Refactor Translatable#translation_params to improve readability
Code by Javier Martín
2018-09-10 17:34:28 +02:00
Marko Lovic
3c4f221e04 Change Translatable interface 2018-09-10 17:32:49 +02:00
Marko Lovic
4603a30f95 Change Translatable impl to keep track of enabled locales 2018-09-10 17:18:01 +02:00
Marko Lovic
3aa53449c8 Fix Translatable when field values are changed to blank
If we ignore all params that are blank, there is no way to
"remove" an attribute (i.e. change its value to blank)

On the other hand, we don't want to create new translations
where all fields are empty, so the new code keeps only the
blank fields which belong to existing translations.
2018-09-10 17:16:42 +02:00
Juan Salvador Pérez García
6cc1ddb9af Fixes #231
Implements a poster feature for the proposals dashboard
2018-07-31 12:50:25 +02:00
Juan Salvador Pérez García
50f73abb0c Fixes #voodoorai2000 comments
Fixes some comments from #voodoorai2000 for the PR to consul
2018-07-27 16:30:03 +02:00
Angel Perez
1990092fdf Allow moderators to hide inappropriate investments 2018-07-20 18:42:33 -04:00
Angel Perez
7bb1da1804 Adapt backend to enable flagging/unflagging investments 2018-07-20 18:42:33 -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
Raimond Garcia
3e4d095e6f Merge pull request #2719 from javierv/2718-fix_flaky_milestone_spec
Fix flaky spec: Budget Investments Show milestones
2018-07-12 16:07:48 +02:00
Javier Martín
f2ef27d3ae Always set Globalize.locale after I18n.locale.
The test "Budget Investments Show milestones" was failing in certain
cases where `Globalize.locale` had been changed in a previous test.

Since having different values in `Globalize.locale` and `I18n.locale`
has proven to be an issue on the test enviroment, this commit also
changes application code in order to avoid similar situations on
production.

See issue #2718.
2018-07-03 00:52:20 +02:00
iagirre
21b1d00205 Add backend for the moderators
Add new routes for the proposal notifications edition and
abilities to let moderators edit it (mark as ignored, hide, etc.).

The notifications are not flaggable because they doesn't work like that,
but in a similar way. The moderator/administrator is in charge of hidding
them through the UI, so the normal users don't flag it as inappropriate.

New controller Moderation::ProposalNotification to manage the moderators
work.
2018-07-02 18:17:45 +02:00
iagirre
471c9730cc Refactorings
- Cleanup Translatable module (`translation_params` method too large)
- Move globalize_helpers partial to admin folder
- Use any class for method translation_params
- Helpers in `GlobalizeHelpers` make sure all are in use and see if they can be more legible
- Review js name clases and methods see if they can be more legible
- Refactor milestone views into partials with nice spacing between attributes
2018-05-09 16:58:47 +02:00
iagirre
b318c2be46 Add feature to delete a translation
To delete a translation, a link has been added. This
link works for the selected language. It hides all the
things related to a language (the tab and the text_area)
and empties the text area, so that the value is blank
in the param hash. A variable called `delete_translations[]`
is changed.

e.g. If admin wants to remove English language,
delete_translations[:en] will be 1; if not, it will be 0.

When the milestone is updated, there is a before_action
callback that cleans the selected languages for deletion
(looking the delete_translations[] variable).
Because of the deleted translations are blank in param hash,
them won't be saved in DB.
2018-05-09 16:07:12 +02:00
rgarcia
f7486b9238 Add Globalize to Milestones 2018-05-09 16:05:44 +02:00
Senén Rodero Rodríguez
92c774cdeb Merge with master 2017-09-28 13:36:20 +02:00
Senén Rodero Rodríguez
93e5c9656c Remove unnedded code 2017-09-26 13:57:13 +02:00
Senén Rodero Rodríguez
c22637c349 Move method 'recover_documents_from_cache' from documentable controllers to document. 2017-09-26 13:57:13 +02:00
Senén Rodero Rodríguez
6f71da07ee Duplicate documentable code and rename for imageable 2017-09-26 13:55:03 +02:00
Alberto
c3b3a837a9 Merge branch 'master' into user-recomendations 2017-09-05 11:31:05 +02:00
Senén Rodero Rodríguez
5581445fff Use different path to store ajax uploaded cached attachments 2017-08-31 12:37:41 +02:00
Senén Rodero Rodríguez
6d66077a94 Make documentable capable to work with local or remote storage system. 2017-08-30 17:07:52 +02:00
Senén Rodero Rodríguez
5e6d1d799f Use absolute urls on document cached_attachment 2017-08-30 15:50:32 +02:00
Senén Rodero Rodríguez
cc89907bff Add nested documents to proposal form. 2017-08-25 18:34:52 +02:00
Senén Rodero Rodríguez
723173ae39 Show validation errors on nested documents. 2017-08-25 18:34:52 +02:00
Senén Rodero Rodríguez
f226d2ac94 Fix edit and update actions 2017-08-25 18:34:52 +02:00
Senén Rodero Rodríguez
e9c5f77368 Accept nested attributes for documents on proposals. Adapt documentable js file to allow many input files at the same page. 2017-08-25 18:34:51 +02:00
taitus
5f1bdb2f94 Rename recommendeds to recommendations 2017-08-01 16:31:45 +02:00
taitus
dc5584086a Styles for filters. Refactor commentable action. 2017-08-01 16:31:45 +02:00
taitus
fe3bb7a389 Add recommended tab on proposals and debates index. 2017-08-01 16:31:44 +02:00
Bertocq
69f4e1c683 Fix all rubocop Metrics/LineLength issues (140+) 2017-07-10 13:22:49 +02:00
Eduardo Martinez Echevarria
8dd52110db Use category scope instead of condition on kind on Tag 2017-06-23 17:34:55 +02:00
Raimond Garcia
05afaacf3d Merge pull request #1635 from entantoencuanto/issue#1354-suggest_on_investments_creation
Issue#1354 suggest on investments creation
2017-06-12 13:09:09 +02:00
Eduardo Martinez Echevarria
fd1c61ae61 Add resource_relation to Polymorphic concern
This allows suggest action to send search to
a relation instead of directly the model. Doing
so, the suggested items can be previously filtered.
2017-06-11 13:19:12 +02:00
Bertocq
e14a5b2eaf Avoid using Date.today, better to use Date.current that takes timezone into account 2017-06-11 10:41:06 +02:00
rgarcia
87dd15b7bf includes search concern in commendable actions 2017-05-04 20:42:21 +02:00
rgarcia
37d8693049 extracts advanced search to controller concern 2017-05-04 04:23:53 +02:00
Juanjo Bazán
652aff4e19 adds validation for custom dates in advanced search
avoids error 500 on invalid dates
2017-03-27 12:18:45 +02:00
kikito
84418bd671 Fixes issue in has_orders concern 2016-12-25 22:58:21 +01:00
kikito
03ef20bfde Merges orders_helper functionality inside has_orders concern
Both these objects where using/setting a variable called valid_orders.
As a results, some specs where becoming flacky
(features/budgets/investments_spec.rb, balloting phase). By putting
them together, there is no `valid_orders` variable any more (everything
is @valid_orders) and the flackyness is gone.
2016-12-24 14:42:46 +01:00
kikito
2a2179d0f3 Merge branch 'master' into budget 2016-11-28 11:41:49 +01:00
rgarcia
bb3c4c6399 adds consistency to ruby code style
Keep a blank line before and after private
Keep a blank line before and after protected
Remove extra empty line at class body end
Remove extra blank line
Add final newline
Use 2 (not 3) spaces for indentation
Use 2 (not 4) spaces for indentation
Remove space before comma
Add space after comma
Remove trailing whitespaces
Remove unnecessary spacing
Use snake_case for variable names
Do not use then for multi-line if
Remove unused block argument - i
Use the new Ruby 1.9 hash syntax
Remove unused assignment to variable
Indent when as deep as case
Align attributes
Align end with def
2016-11-15 11:18:43 +01:00
Juanjo Bazán
11dbc05a80 removes archived proposals from index/search pages 2016-09-13 12:56:10 +02:00
rgarcia
3c55d66591 fixes conflicts with budget 2016-07-27 11:41:46 +02:00
Juanjo Bazán
dc7ee45766 uses before_action instead of before_filter
before_filter is deprecated
2016-07-18 14:50:28 +02:00
kikito
9f3b99f0a6 Allows blocks in has_orders concern 2016-06-03 18:30:47 +02:00