Commit Graph

58 Commits

Author SHA1 Message Date
Javi Martín
021fef07b6 Make action names to block and hide more clear
The `hide` action was calling the `block` method while the `soft_block`
action was calling the `hide` method.

Combined with the fact that we also have a `block` permission which is
used in `ModerateActions` the logic was hard to follow.
2021-12-30 15:50:03 +01:00
Carlos Iniesta
49edd6a9b1 Add soft block button in moderation user view 2021-12-30 15:50:03 +01:00
Javi Martín
4c8dfb6695 Use just one action to hide users
Other than removing a redundant action, we're fixing two bugs when
blocking an author using the links in the public views:

* We were always redirecting to the debates index, even if we blocked
  the author of a proposal or an investment
* We weren't showing any kind of success message
2021-12-30 15:50:02 +01:00
Javi Martín
155da08cf0 Use a generic name for the search parameter
This way we can use it for any model.
2020-12-04 19:57:05 +01:00
Javi Martín
667797161b Extract method to redirect keeping query params 2019-11-12 19:27:58 +01: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
cyrillefr
44b2a07878 Moderate legislation proposals (#3602)
Moderate legislation proposals

- added a controller for moderation/legislation
- updated view to appropriate link + added route
- added a spec
- Feature test
- test for faded
- javascripts for visual effects
2019-10-05 04:02:39 +02:00
Javi Martín
9fe8c47528 Apply Rails/SafeNavigation rubocop rule 2019-09-10 21:43:39 +02:00
Javi Martín
b5b07bccd3 Apply PercentLiteralDelimiters rubocop rule 2019-09-10 20:02:15 +02:00
Julian Herrero
d24376f6ad Use double quotes in controllers/ 2019-03-13 22:19:49 +01:00
Angel Perez
1990092fdf Allow moderators to hide inappropriate investments 2018-07-20 18:42:33 -04: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
Angel Perez
ab9d612128 'Proposals' feature can be enabled/disabled
Fixes #1886
2017-11-17 13:10:55 -04: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
Josep Jaume Rey Peroy
2d45828cad Feature-flag debates 2016-01-18 13:05:00 +01:00
Juanjo Bazán
2c36ceb10c adds abilities for SpendingProposals 2016-01-11 12:15:42 +01:00
Juanjo Bazán
0dcc176098 removes before_filter
(deprecated in favor of before_action)
2015-12-19 10:21:53 +01:00
kikito
cf31e89204 Fixes issues in moderation spex related with comment sort 2015-11-02 15:54:15 +01:00
rgarcia
3edc23abe5 refactors moderator actions 2015-10-11 13:57:19 +02:00
Juanjo Bazán
6082f77ec2 logs activity: user blocking
from users moderation screen but also from proposals/debates/comments bulk moderation screens
2015-09-22 17:08:02 +02:00
Juanjo Bazán
064ff631b2 logs activity: hiding comments 2015-09-22 16:42:24 +02:00
Juanjo Bazán
7ca3f574d8 logs activity: hiding debates 2015-09-22 16:35:38 +02:00
Juanjo Bazán
5aa5fc5b7f logs activity when bulk-hiding proposals 2015-09-22 16:30:44 +02:00
Juanjo Bazán
7741023e6a adds activity page to administration 2015-09-22 16:30:43 +02:00
kikito
343025872b changes comment moderation to be similar to proposals moderation 2015-09-22 14:20:37 +02:00
kikito
757205a93e Unifies bulk & debates moderation forms in a single one 2015-09-21 15:41:01 +02:00
Juanjo Bazán
563cecb2e7 changes default order in moderation/proposals 2015-09-15 22:49:01 +02:00
kikito
9d253b0477 Implements Proposals moderation controller 2015-09-13 22:08:30 +02:00
kikito
356f1c29ce Allows moderators to hide proposals from index 2015-09-13 14:39:38 +02:00
kikito
b9ebe8c2c4 Implements basic bulk debates functionality 2015-09-08 19:44:50 +02:00
kikito
f46b17e19b Introduces User#block method 2015-09-08 19:08:47 +02:00
Juanjo Bazán
af6cb16e9b adds banned users section to moderation zone 2015-09-07 17:56:53 +02:00
Juanjo Bazán
4ef2ed753d makes 'pending' filter the default in /moderation 2015-09-04 22:39:07 +02:00
kikito
08c31c5985 calls all the sorting scopes the same way 2015-09-04 14:17:59 +02:00
rgarcia
10127f546e upgrade before_filter to new syntax 2015-09-03 01:40:24 +02:00
rgarcia
4897d5df4e makes spaces consistent 2015-09-03 01:29:46 +02:00
kikito
ebacc8c9c7 Uses has_filters in all controllers with filters & renames @filter to @current_filter 2015-09-02 13:21:46 +02:00
kikito
cd982768f2 Renames the "archive" action to "ignore_flag" (+)
* archived_at -> ignored_flag_at
* archived? -> ignored_flag?
* archive -> ignore_flag
* pending -> pending_flag_review
* archived (scope) -> with_ignored_flag
* I18n changes
2015-08-27 11:43:58 +02:00
kikito
909dfb4ce3 Several renamings
InappropiateFlag -> Flag
x.flag_as_inappropiate -> x.flag
x.undo_flag_as_inappropiate -> x.unflag
X.flagged_as_inappropiate -> x.flagged
flag-as-inappropiate-actions views & css -> flag-actions views & css
2015-08-27 10:48:49 +02:00
kikito
6110284356 removes all references to "review" (replaced by "archive") 2015-08-26 13:48:57 +02:00
Alberto Garcia Cabeza
8037a82fef Adds styles to moderation admin 2015-08-25 15:19:54 +02:00
kikito
5eeaa7d189 implements /moderation/debates 2015-08-22 23:20:55 +02:00
kikito
169809496e Adds filters & refactors to comment moderation 2015-08-22 20:28:48 +02:00
kikito
00b51bbc23 Adds first version of comment moderation
Missing:
* Ensure removing a flag updates the flagged_at attribute correctly
* Showing the debate when the comment is not a “root”
* Filter (pending / reviewed / all)
* Order
* Same for debates
2015-08-21 22:01:47 +02:00
Juanjo Bazán
b340d7741a adds hiding users by moderators 2015-08-20 13:16:37 +02:00
kikito
9e1581656a merges master and fixes conflicts 2015-08-17 17:38:34 +02:00
rgarcia
f31ed2940d adds moderation to comments and debates [#136] 2015-08-17 13:39:31 +02:00
kikito
3096a73892 Moves organization verification to Admin from Moderation 2015-08-17 13:22:38 +02:00
kikito
ae21209920 Moves the layout to admin::BaseController and moderation::BaseController 2015-08-17 13:20:52 +02:00
kikito
8ca546a431 merges master and fixes conflicts 2015-08-17 02:40:11 +02:00