mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 09:10:25 +08:00
Lint files
Both needed some prettier tlc
This commit is contained in:
parent
82e07cb0f4
commit
096f932ef2
2 changed files with 23 additions and 8 deletions
|
@ -37,8 +37,18 @@ export default Ember.Controller.extend({
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed("alwaysPollResult", "votePollResult", "closedPollResult", "staffPollResult")
|
@computed(
|
||||||
pollResults(alwaysPollResult, votePollResult, closedPollResult, staffPollResult) {
|
"alwaysPollResult",
|
||||||
|
"votePollResult",
|
||||||
|
"closedPollResult",
|
||||||
|
"staffPollResult"
|
||||||
|
)
|
||||||
|
pollResults(
|
||||||
|
alwaysPollResult,
|
||||||
|
votePollResult,
|
||||||
|
closedPollResult,
|
||||||
|
staffPollResult
|
||||||
|
) {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
name: I18n.t("poll.ui_builder.poll_result.always"),
|
name: I18n.t("poll.ui_builder.poll_result.always"),
|
||||||
|
|
|
@ -402,7 +402,12 @@ createWidget("discourse-poll-info", {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!attrs.isClosed && !attrs.showResults && poll.public && (poll.results !== "staff_only")) {
|
if (
|
||||||
|
!attrs.isClosed &&
|
||||||
|
!attrs.showResults &&
|
||||||
|
poll.public &&
|
||||||
|
poll.results !== "staff_only"
|
||||||
|
) {
|
||||||
contents.push(infoTextHtml(I18n.t("poll.public.title")));
|
contents.push(infoTextHtml(I18n.t("poll.public.title")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -494,8 +499,7 @@ createWidget("discourse-poll-buttons", {
|
||||||
|
|
||||||
if (
|
if (
|
||||||
this.currentUser &&
|
this.currentUser &&
|
||||||
(this.currentUser.get("id") === post.get("user_id") ||
|
(this.currentUser.get("id") === post.get("user_id") || isStaff) &&
|
||||||
isStaff) &&
|
|
||||||
!topicArchived
|
!topicArchived
|
||||||
) {
|
) {
|
||||||
if (closed) {
|
if (closed) {
|
||||||
|
@ -545,8 +549,7 @@ export default createWidget("discourse-poll", {
|
||||||
const showResults =
|
const showResults =
|
||||||
(post.get("topic.archived") && !staffOnly) ||
|
(post.get("topic.archived") && !staffOnly) ||
|
||||||
(this.isClosed() && !staffOnly) ||
|
(this.isClosed() && !staffOnly) ||
|
||||||
(poll.results !== "on_close" &&
|
(poll.results !== "on_close" && this.hasVoted() && !staffOnly);
|
||||||
this.hasVoted() && !staffOnly);
|
|
||||||
|
|
||||||
return { loading: false, showResults };
|
return { loading: false, showResults };
|
||||||
},
|
},
|
||||||
|
@ -554,7 +557,9 @@ export default createWidget("discourse-poll", {
|
||||||
html(attrs, state) {
|
html(attrs, state) {
|
||||||
const staffOnly = attrs.poll.results === "staff_only";
|
const staffOnly = attrs.poll.results === "staff_only";
|
||||||
const showResults =
|
const showResults =
|
||||||
state.showResults || (attrs.post.get("topic.archived") && !staffOnly) || (this.isClosed() && !staffOnly);
|
state.showResults ||
|
||||||
|
(attrs.post.get("topic.archived") && !staffOnly) ||
|
||||||
|
(this.isClosed() && !staffOnly);
|
||||||
|
|
||||||
const newAttrs = jQuery.extend({}, attrs, {
|
const newAttrs = jQuery.extend({}, attrs, {
|
||||||
canCastVotes: this.canCastVotes(),
|
canCastVotes: this.canCastVotes(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue