Lint files

Both needed some prettier tlc
This commit is contained in:
Sam Saffron 2019-08-16 13:06:51 +10:00
parent 82e07cb0f4
commit 096f932ef2
2 changed files with 23 additions and 8 deletions

View File

@ -37,8 +37,18 @@ export default Ember.Controller.extend({
];
},
@computed("alwaysPollResult", "votePollResult", "closedPollResult", "staffPollResult")
pollResults(alwaysPollResult, votePollResult, closedPollResult, staffPollResult) {
@computed(
"alwaysPollResult",
"votePollResult",
"closedPollResult",
"staffPollResult"
)
pollResults(
alwaysPollResult,
votePollResult,
closedPollResult,
staffPollResult
) {
return [
{
name: I18n.t("poll.ui_builder.poll_result.always"),

View File

@ -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")));
}
@ -494,8 +499,7 @@ createWidget("discourse-poll-buttons", {
if (
this.currentUser &&
(this.currentUser.get("id") === post.get("user_id") ||
isStaff) &&
(this.currentUser.get("id") === post.get("user_id") || isStaff) &&
!topicArchived
) {
if (closed) {
@ -545,8 +549,7 @@ export default createWidget("discourse-poll", {
const showResults =
(post.get("topic.archived") && !staffOnly) ||
(this.isClosed() && !staffOnly) ||
(poll.results !== "on_close" &&
this.hasVoted() && !staffOnly);
(poll.results !== "on_close" && this.hasVoted() && !staffOnly);
return { loading: false, showResults };
},
@ -554,7 +557,9 @@ export default createWidget("discourse-poll", {
html(attrs, state) {
const staffOnly = attrs.poll.results === "staff_only";
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, {
canCastVotes: this.canCastVotes(),