1
0
mirror of https://github.com/h3poteto/whalebird-desktop synced 2025-02-03 02:37:55 +01:00

refs #874 Add radio button for poll in Toot

This commit is contained in:
AkiraFukushima 2019-07-14 17:41:53 +09:00
parent 6edf0a1f58
commit 61c0b1ccf4

View File

@ -60,6 +60,16 @@
</el-button>
</div>
<div class="content" v-show="isShowContent" v-html="status()" @click.capture.prevent="tootClick"></div>
<div class="poll" v-show="isShowContent" v-if="poll">
<ul class="poll-list">
<li v-for="(option, id) in poll.options" v-bind:key="id">
<el-radio v-model="pollRadio" :label="option.title">{{ option.title }}</el-radio>
</li>
</ul>
<el-button type="success">Vote</el-button>
{{ poll.votes_count }} votes,
until {{ parseDatetime(poll.expires_at, now) }}
</div>
</div>
<div class="attachments">
<el-button v-show="sensitive && !isShowAttachments" class="show-sensitive" type="info" @click="showAttachments = true">
@ -196,7 +206,8 @@ export default {
showContent: this.$store.state.App.ignoreCW,
showAttachments: this.$store.state.App.ignoreNFSW,
hideAllAttachments: this.$store.state.App.hideAllAttachments,
now: Date.now()
now: Date.now(),
pollRadio: null
}
},
props: {
@ -275,6 +286,9 @@ export default {
isShowContent: function() {
return !this.spoilered || this.showContent
},
poll: function() {
return this.originalMessage.poll
},
sensitive: function() {
return (this.hideAllAttachments || this.originalMessage.sensitive) && this.mediaAttachments.length > 0
},
@ -626,6 +640,17 @@ export default {
word-wrap: break-word;
}
.poll {
.poll-list {
list-style: none;
padding-left: 16px;
li {
margin: 4px 0;
}
}
}
.emojione {
width: 20px;
height: 20px;