Fix various issues in polls (#10165)
* Fix ActivityPub poll results being serialized even with hide_totals * Fix poll refresh button having a different font size * Display poll in OpenGraph description * Fix NoMethodError when serializing votes Regression from #10158 * Fix polls on public pages being broken for non-logged-in users * Do not show time remaining if poll has no expiration date
This commit is contained in:
parent
0a39c81dd8
commit
a198add83b
6 changed files with 37 additions and 13 deletions
|
@ -104,9 +104,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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue