Commit Graph

9656 Commits

Author SHA1 Message Date
Javi Martín
5faeefab2c Show the image button only if editing admin pages
That's the only place where we need to attach images so far.
2018-09-12 12:35:28 +02:00
Javi Martín
43e83889ff Simplify CKEditor authorization
We can use the `config.authorize_with` option, so we don't need to copy
the controller in order to load and authorize resource.

Besides, only administrators can upload images, so we don't need to
track the image's user id.
2018-09-12 12:35:28 +02:00
Javi Martín
7347874f4b Remove inaccurate comment
It was automatically added by `rails g ckeditor:install`.
2018-09-12 12:35:28 +02:00
Javi Martín
531750cf6f Restore commented lines
Not sure if they were supposed to be removed. For now I'll assume they
were commented accidentally.
2018-09-12 12:35:28 +02:00
Javi Martín
71ce7acc10 Restore deleted CKEditor config
Just so we can navigate throught git history faster:

* Introduced in 345e34d to avoid precompiling all CKEditor assets.
* Modified in 54c82a5 to avoid compiling assets during tests.
* Overwritten by `rails g ckeditor:install` in c0d6c0b.
2018-09-12 12:35:28 +02:00
Javi Martín
27155dd7d7 Fix typo 2018-09-12 12:35:28 +02:00
Javi Martín
9705360d98 Enable only a few headings in CKEditor
Allowing every format is way more than what we initially intended.

I've only added h2 and h3 because h1 is set somewhere else in the page
(like the title), and h4, h5 and h6 are usually not necessary.
2018-09-12 12:35:28 +02:00
Javi Martín
b6855b7140 Restore allowedContent line
We're not sure why it was removed, and we're using server-side
sanitizers to remove dangerous HTML.
2018-09-12 12:35:28 +02:00
Javi Martín
471061f475 Allow only admins to attach CKEditor images
Right now allowing regular users to attach images would make us
vulnerable to CSRF attacks.
2018-09-12 12:35:28 +02:00
Javi Martín
116bdebc96 Don't add CKEditor attachments to version control 2018-09-12 12:35:28 +02:00
Raúl Fuentes
bf0472fd58 Fix test
now the <a> tag is permited, also the list of allowed tags is in
the configuration of ckeditor4
2018-09-12 12:35:28 +02:00
Raúl Fuentes
d574657b77 Fixes for the review made by @javierm
this commit will be merged with the others when the chages
are accepted
2018-09-12 12:35:28 +02:00
Raúl Fuentes
88f0f14eab Modify the configuration of ckeditor 4
add links, headers and images
2018-09-12 12:35:28 +02:00
Raúl Fuentes
8e68f4bbd0 Update abilities for ckeditor4 images
Add the image controller to use the obsolete load_and_authorize_resource
and authorize_resource methods in the gem
2018-09-12 12:35:28 +02:00
Raúl Fuentes
424535c1ae Add models needed to include images on ckeditor4 2018-09-12 12:35:28 +02:00
Raimond Garcia
dd1691ba8f Merge pull request #2886 from javierm/backport-change-translatable-implementation
[Backport] Change Translatable implementation to accommodate new requirements
2018-09-10 20:10:31 +02:00
Marko Lovic
96b798865a Refactor Translatable#translation_params to improve readability
Code by Javier Martín
2018-09-10 17:34:28 +02:00
Marko Lovic
9fdc8a8a35 Avoid checking DB records in feature spec 2018-09-10 17:34:02 +02:00
Marko Lovic
54d0068134 Remove unused code
This method has never been used as far as I've
been able to tell from the git history.
2018-09-10 17:33:50 +02:00
Marko Lovic
3c4f221e04 Change Translatable interface 2018-09-10 17:32:49 +02:00
Marko Lovic
4603a30f95 Change Translatable impl to keep track of enabled locales 2018-09-10 17:18:01 +02:00
Marko Lovic
cb716e07d7 Extract translation helper from translatable form views
So that individual form partials don't depend on the implementation
of how translations are deleted.
2018-09-10 17:17:47 +02:00
Marko Lovic
3aa53449c8 Fix Translatable when field values are changed to blank
If we ignore all params that are blank, there is no way to
"remove" an attribute (i.e. change its value to blank)

On the other hand, we don't want to create new translations
where all fields are empty, so the new code keeps only the
blank fields which belong to existing translations.
2018-09-10 17:16:42 +02:00
Raimond Garcia
4f2ed27f8c Merge pull request #2865 from consul/backport_1585-make_banners_translatable
[Backport] Make banners translatable
2018-09-10 16:41:33 +02:00
Raimond Garcia
9182e3a4e7 Merge pull request #2818 from wairbut-m2c/rollback-chromedriver-version
Rollback chromedriver version in Docker image
2018-09-07 20:59:03 +02:00
Raimond Garcia
059b445601 Merge pull request #2880 from aitbw/style/rubocop-offenses
Fix Rubocop warnings for Admin controllers
2018-09-07 20:30:08 +02:00
Angel Perez
9029acd440 Fix Rubocop warnings for Admin controllers [ci skip] 2018-09-07 13:59:07 -04:00
Raimond Garcia
778b10d181 Merge pull request #2835 from wairbut-m2c/backport/fix-proposals-menu
Fix navigation menu under Legislation::Proposal show view
2018-09-07 18:44:31 +02:00
Raimond Garcia
94d361a57a Merge pull request #2837 from PierreMesure/update-coffee-rails-to-4-2-2
Upgrade gem coffee-rails to version 4.2.2
2018-09-07 18:42:19 +02:00
Raimond Garcia
367eea19e3 Merge pull request #2844 from PierreMesure/patch-1
Fix a misleading comment
2018-09-07 18:38:06 +02:00
Raimond Garcia
c941d0fe67 Merge pull request #2838 from PierreMesure/refactor-factories-in-several-files
Split factories
2018-09-07 18:37:10 +02:00
Raimond Garcia
7a0cf19379 Merge pull request #2879 from consul/dependabot/bundler/rubyzip-1.2.2
[Security] Bump rubyzip from 1.2.1 to 1.2.2
2018-09-07 18:35:06 +02:00
Raimond Garcia
4ac08e570c Merge pull request #2878 from consul/dependabot/bundler/nokogiri-1.8.4
[Security] Bump nokogiri from 1.8.2 to 1.8.4
2018-09-07 18:34:57 +02:00
Raimond Garcia
af121e326d Merge pull request #2877 from consul/dependabot/bundler/ffi-1.9.25
[Security] Bump ffi from 1.9.23 to 1.9.25
2018-09-07 18:34:40 +02:00
dependabot[bot]
51ab5a335a [Security] Bump rubyzip from 1.2.1 to 1.2.2
Bumps [rubyzip](https://github.com/rubyzip/rubyzip) from 1.2.1 to 1.2.2. **This update includes security fixes.**
- [Release notes](https://github.com/rubyzip/rubyzip/releases)
- [Changelog](https://github.com/rubyzip/rubyzip/blob/master/Changelog.md)
- [Commits](https://github.com/rubyzip/rubyzip/compare/v1.2.1...v1.2.2)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-07 14:45:50 +00:00
dependabot[bot]
0282a944fb [Security] Bump nokogiri from 1.8.2 to 1.8.4
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.8.2 to 1.8.4. **This update includes security fixes.**
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.8.2...v1.8.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-07 14:45:30 +00:00
dependabot[bot]
d9c7adfa6c [Security] Bump ffi from 1.9.23 to 1.9.25
Bumps [ffi](https://github.com/ffi/ffi) from 1.9.23 to 1.9.25. **This update includes security fixes.**
- [Release notes](https://github.com/ffi/ffi/releases)
- [Changelog](https://github.com/ffi/ffi/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ffi/ffi/compare/1.9.23...1.9.25)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-09-07 14:45:07 +00:00
Raimond Garcia
7014686b15 Merge pull request #2813 from javierv/2812-fix_admin_menu_not_showing
Fix admin menu not showing for high IDs
2018-09-07 15:52:02 +02:00
Raimond Garcia
09482aad09 Merge pull request #2785 from ziyan-junaideen/feature/1-nav-content-blocks
Configurable Top Right and Main Navigation Menus
2018-09-05 19:50:59 +02:00
Raimond Garcia
de141a5f88 Merge pull request #2834 from juan-fdz-hawa/2820_translate-accesibility-page
Translate static pages
2018-09-05 15:11:03 +02:00
Alberto
21f36e6be5 Merge branch 'master' into feature/1-nav-content-blocks 2018-09-05 12:41:07 +02:00
Marko Lovic
0fa4b60f39 Make Banners translatable 2018-08-30 16:29:29 +02:00
Marko Lovic
bfd9032e9d Extract translation partial to be shared within admin
Refactor: behaviour should be 100% the same
2018-08-27 18:24:24 +02:00
Pierre
88d857f50c Fix a misleading comment 2018-08-13 11:27:49 +02:00
Pierre Mesure
cba6cc029e Split factories 2018-08-08 07:20:47 +02:00
Pierre Mesure
c9a26c7f89 Bumped coffee-rails to v4.2.2 2018-08-06 18:23:17 +02:00
Angel Perez
3dd525f9b9 Remove Madrid-specific DB attribute from Legislation::Proposal seeds 2018-08-06 10:14:49 -04:00
Angel Perez
43b040162d fix(frontend): Only one menu element has 'active' CSS selector 2018-08-06 10:13:41 -04:00
Angel Perez
f568f9baab Add Legislation::Proposal seeds 2018-08-06 09:39:17 -04:00
Juan Fernandez
653d36c9e6 Translate static pages 2018-08-04 15:28:41 -04:00