Javi Martín
7212657c02
Remove Paperclip and use just Active Storage
2022-02-23 18:43:48 +01:00
Javi Martín
091abfc944
Use Active Storage to render attachments
...
This way we fix a bug we mentioned in commit 930bb753c which caused
links to documents to be broken when editing their title because the
title was used to generate the URL of the document.
Note we're still using Paperclip to render cached attachments because
this is the only case where we store files with just Paperclip and not
Active Storage.
With Active Storage, we render attachments just like any other resource,
using `polymorphic_path`. Paperclip included the `url` method in the
model; since the model doesn't have access to the request parameters
(like the host), this was inconvenient because it wasn't possible to
generate absolute URLs with Paperclip.
In order to simplify the code and make it similar to the way we used
Paperclip, we're adding a `variant` method accepting the name of a
variant and returning the variant.
2022-02-23 18:21:38 +01:00
Javi Martín
c9113041c0
Move nested documents partial to a component
2021-07-13 16:58:13 +02:00
Javi Martín
629df5ab9b
Simplify getting imageable/documentable in forms
...
The imageable/documentable object is always the object the form builder
is based on; since we're already passing the form builder, we don't have
to pass the object as well.
The only exception are the poll answers. In this case, we're passing a
new answer as the object. That's OK; the same hack that we're using to
send the data to the answer URL without displaying existing attachments
causes the form to keep working the same way.
2021-07-13 16:58:13 +02:00
Javi Martín
810814486c
Move document fields partial to a component
2021-07-13 16:58:13 +02:00
decabeza
72a24128a6
Improve upload image and documents buttons
2021-03-24 15:48:24 +01:00
Javi Martín
6b1864fbcd
Sanitize translations instead of using _html
...
Using the `_html` suffix in an i18n key is the same as using `html_safe`
on it, which means that translation could potentially be used for XSS
attacks.
2019-10-09 19:46:47 +02:00
Javi Martín
c62da726b8
Apply SpaceAroundErbTag ERB Lint rule
2019-09-10 20:02:15 +02:00
Javi Martín
71d9ddd849
Apply rule to end files with a newline character
2019-09-10 20:02:15 +02:00
decabeza
0995480b73
Remove question and external_url fields from proposals
2019-04-30 11:35:47 +02:00
Julian Herrero
f6489bc604
Use double quotes in app/views
2019-03-19 12:33:07 +01:00
rgarcia
dacc2d529d
Fix destroy document specs
...
We were linking to the document url itself, which does not have a route
associated and so the specs fails
With this commit we are using the correct path to the destroy action of
the DocumentsController.
We are also using the referrer instead of a params[:from] attribute, as
it avoids having to pass an extra parameter, making the code prettier
and it works the same way
2019-01-24 21:39:43 +01:00
decabeza
4cda7d1d9f
Shows documents title only if there is any document
2018-12-26 12:03:46 +01:00
decabeza
61c7b9a02b
Changes width of additional documents container
2018-12-04 17:30:54 +01:00
Raimond Garcia
1692abc54a
Merge pull request #2374 from wairbut-m2c/upload_documents_feature
...
Upload documents feature
2018-04-05 19:39:12 +02:00
decabeza
acebb07ddd
Adds link to image and docs on admin budget investment info
2018-03-14 15:14:47 +01:00
decabeza
5c0a10699a
Refactors documents partials and reorganices css
2018-02-28 15:22:33 +01:00
Bertocq
97ec551178
Correctly check if user can destroy a document
2018-01-24 17:07:05 +01:00
Vicente Mendoza
410caced3e
test added for changes at documentable's view
2018-01-24 12:48:06 +01:00
Bertocq
d7d1a85fbb
Refactor documents and document view partials
2018-01-02 13:32:42 +01:00
Manuel Ortega
3531060476
Added partial in order to show documents collection. Added DocumentsHelper method in order to show documents link with humanized file type and file size
2017-10-21 16:53:41 +02:00
Manuel Ortega
2fef9c14d0
Moving humanized_content_type from DocumentablesHelper to Document model. Removing humanized_file_size in favor of direct use of number_to_human_size form ActionViewHelper. Added additional documentens to all concerned views
2017-10-18 22:21:01 +02:00
Manuel Ortega
97fb986626
Added documentable feature to legislation processes
2017-10-18 19:50:34 +02:00
decabeza
fd78eb30cc
shows hr tag on forms only when expanded
2017-09-28 15:20:47 +02:00
Senén Rodero Rodríguez
6c1d828a62
Remove unneded code
2017-09-27 11:38:38 +02:00
Senén Rodero Rodríguez
2993ef8707
Remove documents single uploads
2017-09-27 11:04:56 +02:00
Senén Rodero Rodríguez
77f63a4c44
Add _destroy parameter to nested documents
2017-09-26 13:57:13 +02:00
Senén Rodero Rodríguez
f8d78ec4ab
Remove new_nested action from images controller. Use cocoon gem to manage new nested fields creation on images.
2017-09-26 13:57:13 +02:00
Senén Rodero Rodríguez
88a7a29d27
Remove new_nested action from documents controller. Use cocoon gem to manage new nested fields creation on documents.
2017-09-26 13:57:13 +02:00
Alessandro Cuoghi
3745e76c07
Solve conflicts. Refactor documentable and imageable styles.
2017-09-26 13:57:13 +02:00
Senén Rodero Rodríguez
966ff4dc03
User new direct uploads controllers action on imageable.
2017-09-26 13:56:06 +02:00
Senén Rodero Rodríguez
824dd26d5a
User new direct uploads controllers action on documentable. Skipped spec.
2017-09-26 13:55:51 +02:00
Senén Rodero Rodríguez
826385f659
Extract ajax upload and destroy_upload actions from images and documents controllers and place them at new controllers to manage direct uploads
2017-09-26 13:55:28 +02:00
Senén Rodero Rodríguez
c6dabedb4a
Add missing image model spec. Add shared specs to check image validations at any imageable model
2017-09-26 13:55:03 +02:00
Senén Rodero Rodríguez
60e91c7a24
Remove sleep from documentable shared feature specs. Use matchers able to wait new content to appear.
2017-09-26 13:55:03 +02:00
Senén Rodero Rodríguez
6f71da07ee
Duplicate documentable code and rename for imageable
2017-09-26 13:55:03 +02:00
decabeza
b43e464292
renames js class
2017-09-20 19:27:11 +02:00
Alessandro Cuoghi
b0e4c5d66c
Hide progress bar for remove white space on init form. Added display block via js to show progrss bar. Added some margin.
2017-08-25 18:50:02 +02:00
Senén Rodero Rodríguez
2fdbbf15e5
Fix back link
2017-08-25 18:41:34 +02:00
Senén Rodero Rodríguez
796e6f9ce1
Code adaptation to work with nested documents and plain documents.
2017-08-25 18:34:55 +02:00
Senén Rodero Rodríguez
b2a6189cf5
Views and helpers refactor
2017-08-25 18:34:54 +02:00
Senén Rodero Rodríguez
d67ad6d6d0
Fix overlapping error on Travis with make_visible option on attach_field spec helper
2017-08-25 18:34:54 +02:00
Senén Rodero Rodríguez
2e1d98c408
Fix use of an old route
2017-08-25 18:34:54 +02:00
Alessandro Cuoghi
a32849c79b
Changed style button. Add margin top progress bar.
2017-08-25 18:34:53 +02:00
Senén Rodero Rodríguez
0fbffdc73e
Fix abilities definition and related specs
2017-08-25 18:34:53 +02:00
Senén Rodero Rodríguez
0db49fda4e
Fix translations error and refactor nested documentable shared example spec.
2017-08-25 18:34:52 +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
0b23467f3e
Fix partial variable name
2017-08-25 18:34:52 +02:00
Senén Rodero Rodríguez
4cfe841af9
Create separate reusable partial for nested document fields.
2017-08-25 18:34:52 +02:00