mirror of
https://github.com/hanzoai/forum.git
synced 2026-09-30 21:51:19 +00:00
Enables our new eslint rules which enforce consistent i18n imports. For more info, see https://github.com/discourse/lint-configs/commit/0d58b40cd7d170a9f70bcef5c173f95eeb498298
41 lines
1.2 KiB
Plaintext
41 lines
1.2 KiB
Plaintext
import Component from "@glimmer/component";
|
|
import { action } from "@ember/object";
|
|
import { service } from "@ember/service";
|
|
import { htmlSafe } from "@ember/template";
|
|
import DButton from "discourse/components/d-button";
|
|
import routeAction from "discourse/helpers/route-action";
|
|
import { i18n } from "discourse-i18n";
|
|
import PollOptionRankedChoiceDropdown from "./poll-option-ranked-choice-dropdown";
|
|
|
|
export default class PollOptionsComponent extends Component {
|
|
@service currentUser;
|
|
|
|
@action
|
|
sendRank(option, rank = 0) {
|
|
this.args.sendRank(option, rank);
|
|
}
|
|
|
|
<template>
|
|
<div
|
|
tabindex="0"
|
|
class="ranked-choice-poll-option"
|
|
data-poll-option-id={{@option.id}}
|
|
data-poll-option-rank={{@option.rank}}
|
|
>
|
|
{{#if this.currentUser}}
|
|
<PollOptionRankedChoiceDropdown
|
|
@rank={{@option.rank}}
|
|
@option={{@option}}
|
|
@rankedChoiceDropdownContent={{@rankedChoiceDropdownContent}}
|
|
@sendRank={{this.sendRank}}
|
|
/>
|
|
{{else}}
|
|
<DButton class="btn-default" onclick={{routeAction "showLogin"}}>{{i18n
|
|
"poll.options.ranked_choice.login"
|
|
}}</DButton>
|
|
{{/if}}
|
|
<span class="option-text">{{htmlSafe @option.html}}</span>
|
|
</div>
|
|
</template>
|
|
}
|