Skip to content
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

Feature/imageable concern #1915

Merged

Conversation

Senen
Copy link
Member

@Senen Senen commented Sep 25, 2017

Where

What

Create imageable model concern to allow model to have one image as descriptive image. This image will be displayed in the index and show views as a representative image for the record.

How

First of all we need to create a centralized controller to manage file uploads through AJAX. This controller has a "create" action to allow attachment upload a single file with validations and a "destroy" action to allow to delete uploaded files if needed.

Images and documents uploading will use this endpoint to upload and delete files.

We have used rails built in "nested form fiels" with cocoon special links in combination with custom links to allow to really destroy cached_files.

Also i checked admin usage of documentable and catch some errors. Now is working on admin poll questions and is a little easier to add shared specs to admin feature specs.

This controller extraction and the usage of cocoon helpers lead us to refactor documentable module.

Screenshots

Nested image
imageabledemo-1

Nested validation errors
captura de pantalla 2017-09-23 a las 23 52 08

Single upload

imageabledemo-single-upload

Single uploads validation errors
captura de pantalla 2017-09-23 a las 23 53 14

Admin poll questions fix
documentable-at-backend

Tests

Shared specs adaptation to run on admin feature specs.

Deploy

As usual

Warnings

None.

@voodoorai2000
Copy link
Member

This is great!
Thank you so much @Senen 🙌

taitus and others added 26 commits September 26, 2017 13:53
…w. Refactor some css into partecipation.scss for pass scss-lint.
@voodoorai2000 voodoorai2000 merged commit 45f3454 into consuldemocracy:master Sep 26, 2017
@voodoorai2000 voodoorai2000 deleted the feature/imageable_concern branch September 26, 2017 14:17
@Senen Senen mentioned this pull request Sep 27, 2017
@decabeza decabeza mentioned this pull request Sep 28, 2017
javierm pushed a commit to javierm/consul that referenced this pull request May 29, 2019
…e-poll

Allow delete polls with associated questions and answers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants