]> cat aescling's git repositories - mastodon.git/commit
Add polls (#10111)
authorEugen Rochko <eugen@zeonfederated.com>
Sun, 3 Mar 2019 21:18:23 +0000 (22:18 +0100)
committerGitHub <noreply@github.com>
Sun, 3 Mar 2019 21:18:23 +0000 (22:18 +0100)
commit230a012f0090c496fc5cdb011bcc8ed732fd0f5c
treeca589b040b2d5c440e75e53d528f908cafe65d3a
parent99dc212ae5d7b2527d835744bf903293398ce946
Add polls (#10111)

* Add polls

Fix #1629

* Add tests

* Fixes

* Change API for creating polls

* Use name instead of content for votes

* Remove poll validation for remote polls

* Add polls to public pages

* When updating the poll, update options just in case they were changed

* Fix public pages showing both poll and other media
47 files changed:
app/controllers/api/v1/polls/votes_controller.rb [new file with mode: 0644]
app/controllers/api/v1/polls_controller.rb [new file with mode: 0644]
app/controllers/api/v1/statuses_controller.rb
app/javascript/mastodon/actions/importer/index.js
app/javascript/mastodon/actions/importer/normalizer.js
app/javascript/mastodon/actions/polls.js [new file with mode: 0644]
app/javascript/mastodon/components/poll.js [new file with mode: 0644]
app/javascript/mastodon/components/status.js
app/javascript/mastodon/containers/media_container.js
app/javascript/mastodon/containers/poll_container.js [new file with mode: 0644]
app/javascript/mastodon/features/status/components/detailed_status.js
app/javascript/mastodon/reducers/index.js
app/javascript/mastodon/reducers/polls.js [new file with mode: 0644]
app/javascript/styles/application.scss
app/javascript/styles/mastodon/components.scss
app/javascript/styles/mastodon/polls.scss [new file with mode: 0644]
app/lib/activitypub/activity.rb
app/lib/activitypub/activity/create.rb
app/models/concerns/account_associations.rb
app/models/poll.rb [new file with mode: 0644]
app/models/poll_vote.rb [new file with mode: 0644]
app/models/status.rb
app/policies/poll_policy.rb [new file with mode: 0644]
app/serializers/activitypub/note_serializer.rb
app/serializers/activitypub/vote_serializer.rb [new file with mode: 0644]
app/serializers/rest/poll_serializer.rb [new file with mode: 0644]
app/serializers/rest/status_serializer.rb
app/services/activitypub/fetch_remote_poll_service.rb [new file with mode: 0644]
app/services/post_status_service.rb
app/services/vote_service.rb [new file with mode: 0644]
app/validators/poll_validator.rb [new file with mode: 0644]
app/validators/vote_validator.rb [new file with mode: 0644]
app/views/stream_entries/_detailed_status.html.haml
app/views/stream_entries/_simple_status.html.haml
config/locales/en.yml
config/routes.rb
db/migrate/20190225031541_create_polls.rb [new file with mode: 0644]
db/migrate/20190225031625_create_poll_votes.rb [new file with mode: 0644]
db/migrate/20190226003449_add_poll_id_to_statuses.rb [new file with mode: 0644]
db/schema.rb
spec/controllers/api/v1/filters_controller_spec.rb [moved from spec/controllers/api/v1/filter_controller_spec.rb with 100% similarity]
spec/controllers/api/v1/polls/votes_controller_spec.rb [new file with mode: 0644]
spec/controllers/api/v1/polls_controller_spec.rb [new file with mode: 0644]
spec/fabricators/poll_fabricator.rb [new file with mode: 0644]
spec/fabricators/poll_vote_fabricator.rb [new file with mode: 0644]
spec/models/poll_spec.rb [new file with mode: 0644]
spec/models/poll_vote_spec.rb [new file with mode: 0644]