Commit Graph

76 Commits

Author SHA1 Message Date
Javi Martín
9f689c21a2 Rename filter method to filter_by
Ruby 2.6 introduces `Enumerable#filter` as an alias to
`Enumerable#select`, and so our Filterable.filter method will not work
with Ruby 2.6.

So we're renaming the method to `filter_by`, which is similar to
`find_by`. We could also change the `filter` method so if a block is
given it delegates to `Enumerable#filter`, the same way ActiveRecord
handles the `select` method, but IMHO this is easier to follow.
2020-10-29 11:29:45 +01:00
Javi Martín
b483d50d30 Remove unused tag filter
This filter was added in commit 4285ba4b, it was changed in commit
002d8688, and most of the code from the original commit has disappeared
without a trace (maybe due to a merge conflict?).

This filter could actually be useful if we started using it when users
click on a tag. Since we don't, I'm removing it. We might add it back if
we decide to actually use it.
2020-04-08 13:49:48 +02:00
Javi Martín
82b0a6a92d Remove new CSV report generation
The new CSV report was more configurable and could work on proposals,
processes and comments. However, it had several issues.

In the public area, by default it generated a blank file.

In the admin section, the report was hard to configure and it generated
a file with less quality than the old system.

So until we improve this system, we're bringing back the old investment
CSV exporter.

This commit reverts most of commit 9d1ca3bf.
2019-11-06 00:04:02 +01:00
Javi Martín
70a07c095f Add and apply Style/BlockDelimiters rubocop rule
We were already using it most of the time, but there were a few places
were we used brackets for multiline blocks.
2019-10-05 14:44:14 +02:00
Javi Martín
ad14636255 Use Tag instead of ActsAsTaggableOn::Tag
It's shorter, it's easier to extend its behaviour, and it's easier to
integrate with other parts of our application, like translations.
2019-10-05 03:38:44 +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
Javi Martín
7c252750c9 Remove duplicated call to index customization
The statement executed the method twice if the `present?` condition was
true. If the condition was false, it executed it once anyway.

It's probably a typo and originally we probably meant we wanted to
execute the method if the method existed.
2019-08-27 17:22:22 +02:00
taitus
c1f3a4ad3b Add remote translations to debates and proposals
Include RemotelyTranslatable concern on commentable actions to detect
remote translations on index and show controllers actions.
2019-06-27 09:21:19 +02:00
German Galia
9d1ca3bfd4 Report generation. Download csv 2019-06-12 10:17:31 +02:00
Julian Herrero
d24376f6ad Use double quotes in controllers/ 2019-03-13 22:19:49 +01: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
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
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
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
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
MaiteHdezRivas
3b2bfc46cf Admin option to add banners and show banners 2016-05-19 13:18:30 +02:00
kikito
dea1a28a69 purges simple_captcha 2016-04-27 16:07:47 +02:00
Juanjo Bazán
54c1c581f9 uses index_customization in debates_controller 2016-04-21 12:00:48 +02:00
MaiteHdezRivas
f771a61a50 Refactoring method on debates controller 2016-04-21 11:13:58 +02:00
Juanjo Bazán
63e8950d6c adds scopes for feasible values to spending props 2016-03-29 13:36:40 +02:00
rgarcia
f82a590e1e reverts debate links 2016-02-19 19:08:35 +01:00
palomahnhp
2ee90ac76e share links to debate 2016-02-08 10:32:57 +01:00
rgarcia
e4a49f802e removes duplication between debate and proposal suggestions 2016-02-03 19:57:37 +01:00
rgarcia
5b1b6de6cc sorts suggested proposals by default order(relevance) 2016-02-03 16:12:02 +01:00
Raimond Garcia
f1672180a8 Merge pull request #860 from MaiteHdezRivas/suggest_before_creating
Suggest before creating
2016-02-01 18:41:21 +01:00
Maite
8f1431ec3f corrections about coding style 2016-02-01 17:11:29 +01:00
rgarcia
48b5aba1c5 removes unused helper 2016-01-27 14:55:42 +01:00
rgarcia
5d4b6fae92 scopes tags by category or geozone 2016-01-27 14:15:12 +01:00
MaiteHdezRivas
5dd4633d6a Merge branch 'suggest_before_creating'
Conflicts:
	app/assets/javascripts/application.js
	app/controllers/debates_controller.rb
	app/controllers/proposals_controller.rb
	config/locales/es.yml
	config/routes.rb
	db/schema.rb
	spec/features/debates_spec.rb
	spec/features/proposals_spec.rb
2016-01-27 13:11:23 +01:00
rgarcia
e7e5c531a0 moves tag_cloud logic to a model 2016-01-27 13:02:18 +01:00
MaiteHdezRivas
7406904c51 adding suggest with coffescript 2016-01-27 12:32:44 +01:00