Merge branch 'master' into glitch-soc/merge-upstream

Conflicts:
- app/models/status.rb
- db/schema.rb

Both conflicts are caused by us having extra database columns.
This commit is contained in:
Thibaut Girka
2019-03-05 19:23:16 +01:00
64 changed files with 1251 additions and 33 deletions

View File

@@ -110,9 +110,19 @@ module StreamEntriesHelper
I18n.t('statuses.content_warning', warning: status.spoiler_text)
end
def poll_summary(status)
return unless status.poll
status.poll.options.map { |o| "[ ] #{o}" }.join("\n")
end
def status_description(status)
components = [[media_summary(status), status_text_summary(status)].reject(&:blank?).join(' · ')]
components << status.text if status.spoiler_text.blank?
if status.spoiler_text.blank?
components << status.text
components << poll_summary(status)
end
components.reject(&:blank?).join("\n\n")
end