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

Export consultation results to CSV #32

Closed
1 task done
sauloperez opened this issue Oct 1, 2020 · 4 comments
Closed
1 task done

Export consultation results to CSV #32

sauloperez opened this issue Oct 1, 2020 · 4 comments

Comments

@sauloperez
Copy link
Contributor

sauloperez commented Oct 1, 2020

Description

- As an: admin
- On page: /admin/consultations/<consultation_slug>/results
- I want to be able to do:

  • Enable exporting the contents of the results table into a CSV file

Acceptance Criteria & Tests

The extra columns we added to the consultation's results table in openpoke/decidim-module-action_delegator#29 doesn't give the sum of votes of an answer but most importantly, it can't fit the needs of all kinds of cooperatives when it comes to calculating voting results.

Therefore, we want to let them do their own math from a spreadsheet. The way to do so is with an "Export to file" or "Download" button within the card-title, next to the votes vs participants label.

The CSV should have exactly these columns and ordering 👇

Screenshot from 2020-09-30 17-10-38

@sauloperez
Copy link
Contributor Author

sauloperez commented Oct 2, 2020

decidim/decidim#6070 seems to be a great example to follow

@sauloperez sauloperez self-assigned this Oct 5, 2020
@sauloperez
Copy link
Contributor Author

Waiting for review at openpoke/decidim-module-action_delegator#42.

@sauloperez
Copy link
Contributor Author

sauloperez commented Oct 23, 2020

This is working but line breaks don't play well with CSV. Every line break is taken as a new column so if your question title includes them, you end up with more columns than expected, with the question title split into multiple ones.

@sauloperez sauloperez removed their assignment Jan 25, 2021
@sauloperez
Copy link
Contributor Author

Line breaks no longer break the CSV because the line breaks turn into

HTML tags and so they look like

Screenshot from 2021-05-26 12-24-11

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

No branches or pull requests

1 participant