Commit Graph

28 Commits

Author SHA1 Message Date
Javi Martín
23d132c3d3 Remove obsolete controller concern
It isn't used since commit 18f0697e.
2019-11-10 00:34:40 +01:00
Javi Martín
a727dcc031 Apply Style/SymbolProc rubocop rule
This style is much more concise.
2019-10-26 20:10:32 +02:00
Javi Martín
d0d681a44b Add and apply EmptyLineAfterGuardClause rule
We were inconsistent on this one. I consider it particularly useful when
a method starts with a `return` statement.

In other cases, we probably shouldn't have a guard rule in the middle of
a method in any case, but that's a different refactoring.
2019-10-24 17:56:03 +02:00
Javi Martín
7ca55c44e0 Apply Rails/SaveBang rubocop rule
Having exceptions is better than having silent bugs.

There are a few methods I've kept the same way they were.

The `RelatedContentScore#score_with_opposite` method is a bit peculiar:
it creates scores for both itself and the opposite related content,
which means the opposite related content will try to create the same
scores as well.

We've already got a test to check `Budget::Ballot#add_investment` when
creating a line fails ("Edge case voting a non-elegible investment").

Finally, the method `User#send_oauth_confirmation_instructions` doesn't
update the record when the email address isn't already present, leading
to the test "Try to register with the email of an already existing user,
when an unconfirmed email was provided by oauth" fo fail if we raise an
exception for an invalid user. That's because updating a user's email
doesn't update the database automatically, but instead a confirmation
email is sent.

There are also a few false positives for classes which don't have bang
methods (like the GraphQL classes) or destroying attachments.

For these reasons, I'm adding the rule with a "Refactor" severity,
meaning it's a rule we can break if necessary.
2019-10-23 14:39:31 +02:00
taitus
ca0979bd45 Allow redirect to remote census configuration tab
Currently after each update of any Settings is redirected to the first
tab by default.
As this new tab remote_census_configuation has a lot of fields to fill
in it is a bit uncomfortable to have to go back to the tab after each
update.

- Add hidden field :tag to set current tag value
- After update add tag value to request.referer
- To avoid errors when partial call has not param :tag, add the "define?"
  method on hidden_field value.
2019-07-29 13:10:09 +02:00
taitus
637675a1f5 Add content to the Remote Census Configuration tab
- Render remote census configuration content on settings index.
 - Update type method from Setting
   On Admin::SettingsController#index we are using 'all_settings' to
   group all settings by 'type' method.
   'type' method return the first part of key when split by '.'
   To allow use by example: all_settings["remote_census.general"]
   and recover only settings related with this key we have added new
   'elsif' on 'type' method.
2019-07-29 13:10:09 +02:00
Julian Herrero
220bfb065a Add images and documents settings to admin panel 2019-06-04 11:47:22 +02:00
decabeza
18f0697ef7 Fix proposal dashboard settings 2019-04-24 14:00:48 +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
c82b2a975a Add new settings tab for participation processes
- Rename setting keys
- New tab por participation processes
- Hide these settings from features tab
2019-03-19 19:45:32 +01:00
Julian Herrero
dbac4bc222 Change admin settings tab for maps
- Rename map settings keys
- Add fields for latitude, longitude and zoom
- Add a callout message on how to enable map feature
2019-03-19 18:14:57 +01:00
Julian Herrero
c0d2776e8d Refactor Admin settings tabs
- Rename partial views for tabs.
- Extract tables settings to reuse across the tabs.
2019-03-19 18:14:55 +01:00
Julian Herrero
d24376f6ad Use double quotes in controllers/ 2019-03-13 22:19:49 +01:00
decabeza
8066b96fe3 Remove legacy banner images and banner styles settings 2019-02-25 14:59:38 +01: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
a872c5b5df Fixes #200
Adds settings to complete the polls card and feature view.
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
rgarcia
85c08da7a6 Add homepage admin section 2018-05-28 18:17:26 +02:00
Senén Rodero Rodríguez
5815389cb8 Rename map settings keys 2017-09-27 14:49:07 +02:00
Senén Rodero Rodríguez
6c1d1c2cde Add map settings to backend. Install leaflet assets to render maps. 2017-09-27 14:46:02 +02:00
Bertocq
22822aa173 Fix Style/RedundantParentheses rubocop issues 2017-09-25 22:44:58 +02:00
Bertocq
c9bc028524 Remove all unnecesary extra spacing and Layout/ExtraSpacing list from rubocop file 2017-06-28 14:12:51 +02: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
MaiteHdezRivas
3b2bfc46cf Admin option to add banners and show banners 2016-05-19 13:18:30 +02:00
Juanjo Bazán
7931ae914b adds specific treatment for feature flags in admin 2016-01-25 14:52:57 +01:00
Juanjo Bazán
5c630ac41d adds settings area to admin 2015-08-17 18:38:57 +02:00