discourse-topic-voting/assets/javascripts/discourse/connectors/topic-above-post-stream/topic-title-voting.gjs
David Taylor d9af83fd7b
DEV: Reimplement widget UI as glimmer components (#243)
This aims to be a 1:1 port of functionality and HTML structure. In future, this plugin may benefit from a refactor to use float-kit.

Also unskips the system spec and makes improvements to prevent flakiness.
2025-06-10 16:47:12 +01:00

23 lines
746 B
Text

import Component from "@ember/component";
import { classNames, tagName } from "@ember-decorators/component";
import routeAction from "discourse/helpers/route-action";
import VoteBox from "../../components/vote-box";
@tagName("div")
@classNames("topic-above-post-stream-outlet", "topic-title-voting")
export default class TopicTitleVoting extends Component {
<template>
{{#if this.model.can_vote}}
{{#if this.model.postStream.loaded}}
{{#if this.model.postStream.firstPostPresent}}
<div class="voting title-voting">
<VoteBox
@topic={{this.model}}
@showLogin={{routeAction "showLogin"}}
/>
</div>
{{/if}}
{{/if}}
{{/if}}
</template>
}