Merge branch 'fixes-roundup5' into shigusegubu-themes3
This commit is contained in:
commit
f051de13e7
6 changed files with 56 additions and 50 deletions
0
changelog.d/roundup5.skip
Normal file
0
changelog.d/roundup5.skip
Normal file
|
|
@ -69,15 +69,6 @@ export default {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
min-height: 1.2em;
|
min-height: 1.2em;
|
||||||
|
|
||||||
&.-radio {
|
|
||||||
.checkbox-indicator {
|
|
||||||
&,
|
|
||||||
&::before {
|
|
||||||
border-radius: 9999px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&-indicator,
|
&-indicator,
|
||||||
& .label {
|
& .label {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
|
@ -117,6 +108,19 @@ export default {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.-radio {
|
||||||
|
.checkbox-indicator {
|
||||||
|
&,
|
||||||
|
&::before {
|
||||||
|
border-radius: 9999px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: "•";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.disabled {
|
.disabled {
|
||||||
.checkbox-indicator::before {
|
.checkbox-indicator::before {
|
||||||
background-color: var(--background);
|
background-color: var(--background);
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import Timeago from 'components/timeago/timeago.vue'
|
||||||
import genRandomSeed from '../../services/random_seed/random_seed.service.js'
|
import genRandomSeed from '../../services/random_seed/random_seed.service.js'
|
||||||
import RichContent from 'components/rich_content/rich_content.jsx'
|
import RichContent from 'components/rich_content/rich_content.jsx'
|
||||||
import Checkbox from 'components/checkbox/checkbox.vue'
|
import Checkbox from 'components/checkbox/checkbox.vue'
|
||||||
import { forEach, map } from 'lodash'
|
|
||||||
import { usePollsStore } from 'src/stores/polls'
|
import { usePollsStore } from 'src/stores/polls'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -46,6 +45,13 @@ export default {
|
||||||
expired () {
|
expired () {
|
||||||
return (this.poll && this.poll.expired) || false
|
return (this.poll && this.poll.expired) || false
|
||||||
},
|
},
|
||||||
|
expirationLabel () {
|
||||||
|
if (this.$store.getters.mergedConfig.useAbsoluteTimeFormat) {
|
||||||
|
return this.expired ? 'polls.expired_at' : 'polls.expires_at'
|
||||||
|
} else {
|
||||||
|
return this.expired ? 'polls.expired' : 'polls.expires_in'
|
||||||
|
}
|
||||||
|
},
|
||||||
loggedIn () {
|
loggedIn () {
|
||||||
return this.$store.state.users.currentUser
|
return this.$store.state.users.currentUser
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -47,18 +47,12 @@
|
||||||
width: 3.5em;
|
width: 3.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.loading * {
|
&.loading * {
|
||||||
cursor: progress;
|
cursor: progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
.poll-vote-button {
|
.poll-vote-button {
|
||||||
padding: 0 0.5em;
|
padding: 0 1em;
|
||||||
margin-right: 0.5em;
|
margin-right: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,6 @@
|
||||||
:model-value="choices[index]"
|
:model-value="choices[index]"
|
||||||
@update:model-value="value => activateOption(index, value)"
|
@update:model-value="value => activateOption(index, value)"
|
||||||
>
|
>
|
||||||
{{ choices[index] }}
|
|
||||||
<RichContent
|
<RichContent
|
||||||
:id="`option-vote-${randomSeed}-${index}`"
|
:id="`option-vote-${randomSeed}-${index}`"
|
||||||
:html="option.title_html"
|
:html="option.title_html"
|
||||||
|
|
@ -56,6 +55,38 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer faint">
|
<div class="footer faint">
|
||||||
|
<p>
|
||||||
|
<span
|
||||||
|
v-if="poll.pleroma?.non_anonymous"
|
||||||
|
:title="$t('polls.non_anonymous_title')"
|
||||||
|
>
|
||||||
|
{{ $t('polls.non_anonymous') }}
|
||||||
|
·
|
||||||
|
</span>
|
||||||
|
<span class="total">
|
||||||
|
<template v-if="typeof poll.voters_count === 'number'">
|
||||||
|
{{ $t("polls.people_voted_count", { count: poll.voters_count }, poll.voters_count) }}
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
{{ $t("polls.votes_count", { count: poll.votes_count }, poll.votes_count) }}
|
||||||
|
</template>
|
||||||
|
<span v-if="expiresAt !== null">
|
||||||
|
·
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<span v-if="expiresAt !== null">
|
||||||
|
<i18n-t
|
||||||
|
scope="global"
|
||||||
|
:keypath="expirationLabel"
|
||||||
|
>
|
||||||
|
<Timeago
|
||||||
|
:time="expiresAt"
|
||||||
|
:auto-update="60"
|
||||||
|
:now-threshold="0"
|
||||||
|
/>
|
||||||
|
</i18n-t>
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
<button
|
<button
|
||||||
v-if="!showResults"
|
v-if="!showResults"
|
||||||
class="btn button-default poll-vote-button"
|
class="btn button-default poll-vote-button"
|
||||||
|
|
@ -65,40 +96,10 @@
|
||||||
>
|
>
|
||||||
{{ $t('polls.vote') }}
|
{{ $t('polls.vote') }}
|
||||||
</button>
|
</button>
|
||||||
<span
|
|
||||||
v-if="poll.pleroma?.non_anonymous"
|
|
||||||
:title="$t('polls.non_anonymous_title')"
|
|
||||||
>
|
|
||||||
{{ $t('polls.non_anonymous') }}
|
|
||||||
·
|
|
||||||
</span>
|
|
||||||
<div class="total">
|
|
||||||
<template v-if="typeof poll.voters_count === 'number'">
|
|
||||||
{{ $t("polls.people_voted_count", { count: poll.voters_count }, poll.voters_count) }}
|
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
{{ $t("polls.votes_count", { count: poll.votes_count }, poll.votes_count) }}
|
|
||||||
</template>
|
|
||||||
<span v-if="expiresAt !== null">
|
|
||||||
·
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<span v-if="expiresAt !== null">
|
|
||||||
<i18n-t
|
|
||||||
scope="global"
|
|
||||||
:keypath="expired ? 'polls.expired' : 'polls.expires_in'"
|
|
||||||
>
|
|
||||||
<Timeago
|
|
||||||
:time="expiresAt"
|
|
||||||
:auto-update="60"
|
|
||||||
:now-threshold="0"
|
|
||||||
/>
|
|
||||||
</i18n-t>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script src="./poll.js"></script>
|
<script src="./poll.js"></script>
|
||||||
|
|
||||||
<style src="./poll.scss" lang="scss"/>
|
<style src="./poll.scss" lang="scss" />
|
||||||
|
|
|
||||||
|
|
@ -231,8 +231,9 @@
|
||||||
"single_choice": "Single choice",
|
"single_choice": "Single choice",
|
||||||
"multiple_choices": "Multiple choices",
|
"multiple_choices": "Multiple choices",
|
||||||
"expiry": "Poll age",
|
"expiry": "Poll age",
|
||||||
"expires_in": "Poll ends in {0}",
|
"expires_at": "Poll ends {0}",
|
||||||
"expired": "Poll ended {0} ago",
|
"expired": "Poll ended {0} ago",
|
||||||
|
"expired_at": "Poll ended {0}",
|
||||||
"not_enough_options": "Too few unique options in poll",
|
"not_enough_options": "Too few unique options in poll",
|
||||||
"non_anonymous": "Public poll",
|
"non_anonymous": "Public poll",
|
||||||
"non_anonymous_title": "Other instances may display the options you voted for"
|
"non_anonymous_title": "Other instances may display the options you voted for"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue