diff --git a/assets/javascripts/discourse/components/solved-unaccept-answer-button.gjs b/assets/javascripts/discourse/components/solved-unaccept-answer-button.gjs index 2c0b862..ef3b3ff 100644 --- a/assets/javascripts/discourse/components/solved-unaccept-answer-button.gjs +++ b/assets/javascripts/discourse/components/solved-unaccept-answer-button.gjs @@ -1,4 +1,5 @@ import Component from "@glimmer/component"; +import { htmlSafe } from "@ember/template"; import { action } from "@ember/object"; import { service } from "@ember/service"; import DButton from "discourse/components/d-button"; @@ -6,6 +7,7 @@ import icon from "discourse/helpers/d-icon"; import { ajax } from "discourse/lib/ajax"; import { popupAjaxError } from "discourse/lib/ajax-error"; import { i18n } from "discourse-i18n"; +import DTooltip from "float-kit/components/d-tooltip"; export function unacceptAnswer(post, appEvents) { // TODO (glimmer-post-menu): Remove this exported function and move the code into the button action after the widget code is removed @@ -41,23 +43,52 @@ function unacceptPost(post) { export default class SolvedUnacceptAnswerButton extends Component { @service appEvents; + @service siteSettings; @action unacceptAnswer() { unacceptAnswer(this.args.post, this.appEvents); } + get solvedBy() { + const username = this.args.post.topic.accepted_answer.accepter_username + if (this.siteSettings.show_who_marked_solved && this.args.post.topic.accepted_answer.accepter_username) { + return i18n("solved.marked_solved_by", { + username, + username_lower: username, + }) + } + } +