Merge branch '589-poll-options' into 'develop'

Polls: Construct an html field during normalization.

Closes #589

See merge request pleroma/pleroma-fe!1146
This commit is contained in:
Shpuld Shpludson 2020-06-18 13:33:00 +00:00
commit 6343ee929c
4 changed files with 20 additions and 13 deletions

View file

@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Add better visual indication for drag-and-drop for files - Add better visual indication for drag-and-drop for files
### Fixed ### Fixed
- Custom Emoji will display in poll options now.
- Status ellipsis menu closes properly when selecting certain options - Status ellipsis menu closes properly when selecting certain options
- Cropped images look correct in Chrome - Cropped images look correct in Chrome
- Newlines in the muted words settings work again - Newlines in the muted words settings work again

View file

@ -17,7 +17,7 @@
<span class="result-percentage"> <span class="result-percentage">
{{ percentageForOption(option.votes_count) }}% {{ percentageForOption(option.votes_count) }}%
</span> </span>
<span>{{ option.title }}</span> <span v-html="option.title_html"></span>
</div> </div>
<div <div
class="result-fill" class="result-fill"

View file

@ -164,23 +164,23 @@ $status-margin: 0.75em;
word-break: break-all; word-break: break-all;
} }
img, video {
max-width: 100%;
max-height: 400px;
vertical-align: middle;
object-fit: contain;
&.emoji {
width: 32px;
height: 32px;
}
}
.status-content { .status-content {
font-family: var(--postFont, sans-serif); font-family: var(--postFont, sans-serif);
line-height: 1.4em; line-height: 1.4em;
white-space: pre-wrap; white-space: pre-wrap;
img, video {
max-width: 100%;
max-height: 400px;
vertical-align: middle;
object-fit: contain;
&.emoji {
width: 32px;
height: 32px;
}
}
blockquote { blockquote {
margin: 0.2em 0 0.2em 2em; margin: 0.2em 0 0.2em 2em;
font-style: italic; font-style: italic;

View file

@ -258,6 +258,12 @@ export const parseStatus = (data) => {
output.summary_html = addEmojis(escape(data.spoiler_text), data.emojis) output.summary_html = addEmojis(escape(data.spoiler_text), data.emojis)
output.external_url = data.url output.external_url = data.url
output.poll = data.poll output.poll = data.poll
if (output.poll) {
output.poll.options = (output.poll.options || []).map(field => ({
...field,
title_html: addEmojis(field.title, data.emojis)
}))
}
output.pinned = data.pinned output.pinned = data.pinned
output.muted = data.muted output.muted = data.muted
} else { } else {