-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEV: Add gjs implementation of solved topic status (#327)
- Loading branch information
Showing
3 changed files
with
78 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
assets/javascripts/discourse/connectors/after-topic-status/solved-status.gjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import Component from "@glimmer/component"; | ||
import { service } from "@ember/service"; | ||
import { and } from "truth-helpers"; | ||
import icon from "discourse/helpers/d-icon"; | ||
import { i18n } from "discourse-i18n"; | ||
|
||
export default class SolvedStatus extends Component { | ||
@service siteSettings; | ||
|
||
<template> | ||
{{~#if @outletArgs.topic.has_accepted_answer~}} | ||
<span | ||
title={{i18n "topic_statuses.solved.help"}} | ||
class="topic-status" | ||
>{{icon "far-square-check"}}</span> | ||
{{~else if | ||
(and | ||
@outletArgs.topic.can_have_answer | ||
this.siteSettings.solved_enabled | ||
this.siteSettings.empty_box_on_unsolved | ||
) | ||
~}} | ||
<span | ||
title={{i18n "solved.has_no_accepted_answer"}} | ||
class="topic-status" | ||
>{{icon "far-square"}}</span> | ||
{{~/if~}} | ||
</template> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters