-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentable #1809
Documentable #1809
Conversation
…eate documents controller, documents helper, routes, translations and specs
…how alert on documents tab when maximum reached. Hide upload button when maximum reached.
… recipient model.
…th the same width. Changed position buttons in responsive. Pass scss-lint.
… buttons. Passed scss-lint.
… has document creations permissions.
… text into documents.yml for esp and eng.
…er image from cache. Add progress bar.
…le js file to allow many input files at the same page.
…e collision. Remove cached_attachments after document save.
…block via js to show progrss bar. Added some margin.
Hi @bertocq, @decabeza, @MariaCheca and @voodoorai2000 we have first version of documentable. Hope you like the way we solved it! Maybe we have to think what to do with orphan uploaded files. When a user start to create a new proposal or budget investment and uploads some files but then user not finishes creation process, uploaded files remain on server but they are not related with a document neither with documentable record. A manual rake task or scheduled task can achieve this by checking file date creation and removing it only if file was created more than 24 hours ago for example. Waiting four your feedback and suggestions. 😃 |
Excellent 😌 |
Where
What
Allow to attach documents easily to any application model. Configure documentable module for citizen proposals and budget investments.
How
Te only reason to keep single document upload form is because users cannot edit budget investments projects and therefore they cannot add more documents after creation. With this single document form, authors and administrators can upload documents anytime.
Upload restrictions (Configurable concern arguments)
This configurable options allows developers to configure documentable module in different ways to on each documentable model. For example, we want to allow up to 5 documents on proposals but maybe we want to allow only 3 documents on budget investments. Upload restrictions are:
Restrictions
Only proposal or budget investment author or any administrator can upload or destroy documents.
Users can upload up to X MB document size on each documentable object.
Users can upload up to X documents on each documentable object.
Users can upload only allowed documents types (pdf, jpg, png, doc) to each documentable object.
We have configured following restrictions on Proposal and Budget::Investment models.
Storage
Attachment uploader has a dynamic path to decide where to store files:
When documents are created correctly cached_attachments are deleted and stored in default paperclip path ":rails_root/public/system/:class/:attachment/:id_partition/:style/:filename".
Storage configuration
Documents upload is working with local filestorage as well with aws s3 services.
To enable remote storage is needed to install remote service gem like aws-sdk and configure paperclip defaults to enable remote service access.
Filename
keeping original file name on file uploads.
Screenshots (Updated 27/07/2017)
New Proposal
Max 3 PDF files .
Max 3 megabyte.
Edit Proposal upload single file
Max 1 PDF files.
Max 3 megabyte.
Upload button on documentable page (proposal page ot budget investment page)
User warning: Max number of documents reached
Direct form upload
Direct form upload validations errors
Deploy
Run migrations.
Warnings
None.
Tests
Increased model, abilities and feature specs with reusable shared examples.