Bertocq
4916f9a3c3
Avoid listing non-published Budgets to the public
...
Why:
Non-admins shouldn't be aware of non-published Budgets
How:
Using the budget_published? helper method
2018-01-08 23:02:18 +01:00
Bertocq
76e05d58b1
Return 404 status for non-published Budget access
...
Why:
Non-admin users shouldn't be able to access, or know of the existence
of a non-published Budget.
How:
Raising an ActionController::RoutingError (404 error) to simulate the
same behaviour as accesing a non-existing Budget.
We could have used CanCanCan abilities for this but then an user could
be aware of existing but not published Budgets by trying different urls
2018-01-08 22:59:20 +01:00
Bertocq
03f4fce2dd
Add budget_published? helper method to BudgetHelper
...
We need to check if the budget is in drafting phase to avoid showing
it to the users, unless the current user is an administrator.
2018-01-08 22:56:47 +01:00
Bertocq
f9803ce9ca
Add drafting phase to budget model & translations
2018-01-08 22:56:11 +01:00
Raimond Garcia
05031dffa1
Merge pull request #2202 from wairbut-m2c/aperez-social-metatags
...
Use 'image_url' properties to improve SEO for proposals & investments
2018-01-08 18:33:07 +01:00
Raimond Garcia
bce0729a61
Merge pull request #1899 from xarlybovi/legislation-process-html-fixes
...
Legislation process minor html fixes
2018-01-08 16:00:26 +01:00
Bertocq
18236e8827
Fix random order seed value cleanup to allow negative values and always be numeric
2018-01-06 18:21:24 +01:00
Bertocq
327817ff36
Update version on install controller (late)
2018-01-03 21:07:19 +01:00
Bertocq
d3719f0b42
Merge branch 'fix/documentable_multiple_docs'
2018-01-03 18:03:20 +01:00
Bertocq
b990384b0a
Fix multiple attachment upload by setting the id, style and updated at date on hash
2018-01-03 17:38:44 +01:00
Bertocq
ce9d5ec022
Cleanup bad indentation on direct upload model
2018-01-03 17:38:44 +01:00
Bertocq
d7d1a85fbb
Refactor documents and document view partials
2018-01-02 13:32:42 +01:00
Bertocq
46dc559301
Filter out nil related contents while listing them
2017-12-31 20:30:45 +01:00
rgarcia
96066aee44
Validates map presence only on create
...
As we are using an attr_accessor to make sure a user accepts that the
proposal “has no map”, the validation was being run in every save.
Making other things break, for example the updating of the counter
cache `cached_votes_up`, when someone voted for the proposal, as the
attr_accessor `skip_map` was not present
2017-12-26 12:39:29 +01:00
decabeza
f95d5d4639
improves generic error message
2017-12-22 12:32:34 +01:00
BertoCQ
d534b02b3c
Merge pull request #2206 from consul/related-contents-score
...
Related contents score
2017-12-20 15:13:12 +01:00
Bertocq
01d5656884
Fix valid related content url helper method
2017-12-20 14:51:39 +01:00
María Checa
1e23281c28
Fixed related content tests
2017-12-20 13:43:56 +01:00
rgarcia
7889efd6ee
Fix map location update
...
When editing the map of a proposal or investment(the mappable) the
updated_at attribute of the mappable was not been updated and so the
map still displayed the old location after updating it
2017-12-20 12:43:49 +01:00
Bertocq
cf06d5b047
Refactor related content score methods to make them easier to follow
2017-12-20 10:24:00 +01:00
Bertocq
3eecabe9a8
Prevent authors or users that already scored from scoring related content
2017-12-20 03:06:41 +01:00
Bertocq
c67851df53
Fix relatedcontent creation and scoring on related content controller
2017-12-20 03:06:06 +01:00
Bertocq
e6a5071160
Fix typo on RelatedContentScore attribute score to value
2017-12-20 02:36:14 +01:00
Bertocq
a72cc58b49
Fix Related Content Score presence validations and unique composed key
2017-12-20 02:36:14 +01:00
Bertocq
e19153a26e
Fix typo on RelatedContentsScore call to RelatedContentScore
2017-12-20 02:36:14 +01:00
Bertocq
585eb36871
Hide related content when scoring goes under threshold
2017-12-20 02:36:13 +01:00
Bertocq
d544d56722
Add correct user to RelatedContentScore on creation
2017-12-20 02:36:13 +01:00
Bertocq
2e0dd9caea
Relationable find_related_content should not be used to find, refactored to have a single purpose
2017-12-20 02:36:13 +01:00
Bertocq
2688f2a919
Add author user to related content
2017-12-20 02:36:13 +01:00
Bertocq
4d2d7c1a0a
Add act as paranoid to related content, with not_hidden scope using hidden_at
2017-12-20 02:36:13 +01:00
Bertocq
f21f5ec05e
Refactor Related Content Controller score methods
2017-12-20 02:36:13 +01:00
Bertocq
065b0ed3c8
Create Related Content Scores
2017-12-20 02:36:10 +01:00
María Checa
c9dbf3a90e
Removed RelatedContent from flags helper
2017-12-19 21:24:39 +01:00
rgarcia
20dec19e89
toogles map visibility
2017-12-19 20:33:43 +01:00
rgarcia
19a084c0c7
adds map validations
2017-12-19 20:32:55 +01:00
María Checa
a8ca3ec5f7
Added related content one positive score by default on create
2017-12-19 20:15:29 +01:00
María Checa
b99a2eac6f
Fixed tests
2017-12-19 19:10:43 +01:00
decabeza
44b34eb2ac
shows add related content link if user is logged
2017-12-19 18:51:46 +01:00
decabeza
f03d922124
fixes styles for mobile size
2017-12-19 18:51:28 +01:00
decabeza
bf073d8535
adds styles to related content score
2017-12-19 17:52:43 +01:00
María Checa
fcb6c7a19d
Added related contents score views
2017-12-19 13:20:30 +01:00
María Checa
7d8b5838b9
Added new related contents score method
2017-12-19 13:14:12 +01:00
María Checa
3836b73482
Added related contents to debates
2017-12-18 23:56:32 +01:00
María Checa
8d7509917c
Prevent relationable models from being cached
2017-12-18 22:25:22 +01:00
María Checa
4b181ead28
Added related content report views
2017-12-18 21:29:38 +01:00
decabeza
dfe077a30e
renames times_reported to flags_count on relationable.rb
2017-12-18 20:13:29 +01:00
María Checa
4cbdede41d
Adapted flags helper to related content
2017-12-18 18:22:01 +01:00
María Checa
d944a88c63
Added flag/unflag related content routes
2017-12-18 18:21:51 +01:00
María Checa
97f74ac531
Renamed related content times_reported column to flags_count
2017-12-18 18:21:46 +01:00
Angel Perez
c46639dbb0
Add 'image_url' SEO properties to Proposal & Budget::Investment 'show' views
2017-12-18 09:55:44 -04:00