Commit Graph

74 Commits

Author SHA1 Message Date
Senén Rodero Rodríguez
7df0e9a961 Allow to remove poll answers 2022-10-18 11:04:40 +02:00
Javi Martín
7e663f8bcf Fix spacing issues after removing lines
Rubocop was complaining about a Layout/ExtraSpacing in a couple of
places.

These issues weren't detected by Pronto because they didn't affect lines
changed in the pull request. These lines were fine until we removed the
lines next to them in commits 4b42a68b6 and 00f0c4410.
2022-06-13 17:39:53 +02:00
Javi Martín
4b42a68b6a Use the vote action to vote featured proposals
The action and the views were almost identical, with the supports
progress and the HTML classes of the success message element being the
only exceptions; we can use CSS for the styles instead.
2022-02-21 18:47:13 +01:00
Javi Martín
c34fc7f0b8 Remove unneeded lines restricting permissions
In the past, users had permission to edit their own legislation
proposals. However, that changed in commit ebfa3fb01, where we replaced
the `can` method with `cannot`.

An easier way to remove this permission is to simply remove the whole
statement, since by default users don't have permissions to do anything.

We're also adding a test checking users can't edit their own legislation
proposals, since it was missing.
2021-12-30 18:25:45 +01:00
decabeza
a851048d56 Allow users to remove their support on investments
Note we don't cast negative votes when users remove their support. That
way we provide compatibility for institutions who have implemented real
negative votes (in case there are / will be any), and we also keep the
database meaningful: it's not that users downvoted something; they
simply removed their upvote.

Co-Authored-By: Javi Martín <javim@elretirao.net>
Co-Authored-By: Julian Nicolas Herrero <microweb10@gmail.com>
2021-06-14 14:46:54 +02:00
Javi Martín
758cdaf8d7 Extract controllers to support investments
Since we're going to add an action to remove supports, having a separate
controller makes things easier.

Note there was a strange piece of code which assumed users were not
verified if they couldn't vote investments. Now the code is also
strange, since it assumes users are not verified if they can't create
votes. We might need to revisit these conditions if our logic changes in
the future.
2021-06-14 14:42:03 +02:00
Julian Herrero
0698c0ff4f Allow users to delete their own comments 2021-04-13 20:04:04 +02:00
Javi Martín
d7ad1a769f Make sure users can only delete their own follows
Since we're defining abilities with cancancan and using
`load_and_authorize_resource`, we're also modifying the `create` action
for consistency.
2021-04-13 13:52:18 +02:00
Javi Martín
de4be15a8d Add empty SDG index 2020-12-23 13:18:10 +01:00
taitus
9fe24aec9d Add sdg manager section to admin
Allow a user to become an sdg manager
2020-12-16 13:16:45 +01:00
taitus
fb5965fe63 Add cancancan to SDG content
Only allow access to the SDG content section to administrators and sdg managers
2020-12-16 11:43:17 +01:00
Javi Martín
af7c37634d Remove poll votation types
Unfortunately this feature wasn't properly reviewed and tested, and it
had many bugs, some of them critical and hard to fix, like validations
being skipped in concurrent requests.

So we're removing it before releasing version 1.1. We might add it back
in the future if we manage to solve the critical issues.

This commit reverts commit 836f9ba7.
2019-10-30 18:48:55 +01:00
Javi Martín
57ef380379 Add and apply Layout/ExtraSpacing rubocop rule 2019-10-24 18:11:58 +02:00
Javi Martín
db97f9d08c Add and apply rubocop rules for empty lines
We were very inconsistent regarding these rules.

Personally I prefer no empty lines around blocks, clases, etc... as
recommended by the Ruby style guide [1], and they're the default values
in rubocop, so those are the settings I'm applying.

The exception is the `private` access modifier, since we were leaving
empty lines around it most of the time. That's the default rubocop rule
as well. Personally I don't have a strong preference about this one.


[1] https://rubystyle.guide/#empty-lines-around-bodies
2019-10-24 17:11:47 +02:00
denialtorres
bb627a7117 Edit Budget Investment only in accepting phase (#3716)
This way users who made a typo can fix it before the investment is reviewed.
2019-10-18 13:59:14 +02:00
Javi Martín
aeb1655961 Use budget phase traits
We were already using them in many places, but not everywhere.
2019-09-24 21:34:06 +02:00
Javi Martín
f9ed186909 Add rubocop spacing rules
We were following these rules in most places; we just didn't define them
anywhere.
2019-09-10 21:04:56 +02:00
Senén Rodero Rodríguez
5fa1bd8a6f Allow administrator users the ability to manage all LocalCensusRecords
Also check that other kind of users are not able to manage
LocalCensusRecords.
2019-07-29 13:07:24 +02:00
lalo
c6e4b2480f Add public changes to create and vote Poll:Questions with votation type 2019-06-12 19:44:14 +02:00
voodoorai2000
d0b8fef6b3 Delete spending proposals 2019-05-31 18:22:59 +02:00
decabeza
91be3cf775 Fix more hound warnings 2019-03-27 15:22:14 +01:00
decabeza
eda6ea7f12 Merge branch 'master' into dashboard 2019-03-26 16:45:48 +01:00
Julian Herrero
31ac8b7f55 Change single quotes to double quotes 2019-02-15 11:40:39 +01:00
decabeza
bc1679550b Remove incoming polls filter 2019-02-08 14:28:19 +01:00
Juan Salvador Pérez García
f875ded0be Bugfixing and enhancements
* Fixed common ability: Retired draft proposal can't be published.
* Fixed proposal dashboard view: progress graph is not available for
draft proposals.
2018-09-13 18:22:59 +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
8876b285ce Fixes #229
Adds email feature for proposals dashboard
2018-07-25 13:28:44 +02:00
Juan Salvador Pérez García
e5f9cf6710 Fixed #239
Proposals dashboard refactored to dashboard.
Added missing specs for the dashboard.
2018-07-24 15:52:43 +02:00
Juan Salvador Pérez García
f439fc7371 Fixes #218
Added check in poll card that allows setting the value of
results_enabled flag.

Access to stats/results now is controlled with abilities.

Polls related to proposals will be accessible to the proposal author
like they were administrators.
2018-07-17 17:59:12 +02:00
Juan Salvador Pérez García
2be107f4da Specs
Added specs and fixed some issues found after executing them
2018-07-17 17:57:30 +02:00
Juan Salvador Pérez García
28e17abe72 Syntax for specs adjusted for consistency reasons
is_expected.to has been replaced by should
is_expected.not_to has been replaced by should_not
2018-07-17 17:53:18 +02:00
Juan Salvador Pérez García
83f78b1940 Fixes #135
Adds a table with proposed actions in the dashboard. The user can mark
an action as executed.
2018-07-17 17:51:13 +02:00
Juan Salvador Pérez García
1464bddfa8 Fixes #134
Adds an administration interface for the proposal dashboard actions.
2018-07-17 17:48:46 +02:00
Angel Perez
31c16406c0 Move disable recommendations permissions to Abilities::Common model 2018-07-15 21:28:58 -04:00
Angel Perez
88a5e8b1d2 Spec: Admins/users can destroy only their authored documentables/imageables (#2375) 2018-01-26 09:10:58 -04:00
Bertocq
16eae689f9 Enable RSpec/RepeatedExample cop & fix all issues
Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExample
2018-01-07 18:46:32 +01:00
Bertocq
1441de5107 Enable RSpec/HookArgument cop and fix issues
To be consistent about before/after arguments, as `:each` or `:example`
 are same and default scopes, best not to send an argument in those
 scenarios.

Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/HookArgument
2018-01-07 02:07:19 +01:00
Bertocq
2253155a51 Enables RSpec/EmptyLineAfterSubject & fixes all issues
Read more about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterSubject
2018-01-07 00:50:50 +01:00
Bertocq
fa017b664f Enables RSpec/EmptyLineAfterFinalLet cop & fixes all issues
Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterFinalLet
2018-01-07 00:49:37 +01:00
Bertocq
6ec6f64675 Enable RSpec/DescribeClass rubocop rspec cop & fix issues
Manually fixes all issues & "stashed" false positives at .rubocop_todo.yml

Read about the cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribeClass
2018-01-07 00:20:55 +01:00
Senén Rodero Rodríguez
2993ef8707 Remove documents single uploads 2017-09-27 11:04:56 +02:00
Senén Rodero Rodríguez
eef8ad1b73 Remove images single uploads 2017-09-27 10:41:48 +02:00
Senén Rodero Rodríguez
ce29185b76 Fix documentable on admin poll questions. Adapt nested documentable shared specs to admin fetaure specs and include at admin poll questions specs. 2017-09-26 13:57:13 +02:00
Senén Rodero Rodríguez
88a7a29d27 Remove new_nested action from documents controller. Use cocoon gem to manage new nested fields creation on documents. 2017-09-26 13:57:13 +02:00
Senén Rodero Rodríguez
d1d2a31876 Remove permissions of obsolete actions. Add missing image managment abilities to common and administrator specs. 2017-09-26 13:55:03 +02:00
Senén Rodero Rodríguez
4469aa9b32 Allow to remove budget investment image from edit image page to authors and administrators. 2017-09-26 13:53:42 +02:00
Senén Rodero Rodríguez
acc79cbe31 Add edit_image and update_image action to budget/investments controller. 2017-09-26 13:53:42 +02:00
Senén Rodero Rodríguez
0fbffdc73e Fix abilities definition and related specs 2017-08-25 18:34:53 +02:00
Senén Rodero Rodríguez
c92827e89e Add abilities to documentable authors and admins to create and destroy documents. 2017-08-25 17:27:37 +02:00
Bertocq
c9bc028524 Remove all unnecesary extra spacing and Layout/ExtraSpacing list from rubocop file 2017-06-28 14:12:51 +02:00