diff --git a/app/assets/javascripts/discourse/app/controllers/composer.js b/app/assets/javascripts/discourse/app/controllers/composer.js index 9dabffdaa5e..125204ecc7b 100644 --- a/app/assets/javascripts/discourse/app/controllers/composer.js +++ b/app/assets/javascripts/discourse/app/controllers/composer.js @@ -31,6 +31,10 @@ import { isTesting } from "discourse-common/config/environment"; import { inject as service } from "@ember/service"; import { shortDate } from "discourse/lib/formatter"; import showModal from "discourse/lib/show-modal"; +import { categoryBadgeHTML } from "discourse/helpers/category-link"; +import renderTags from "discourse/lib/render-tags"; +import { htmlSafe } from "@ember/template"; +import { iconHTML } from "discourse-common/lib/icon-library"; async function loadDraft(store, opts = {}) { let { draft, draftKey, draftSequence } = opts; @@ -929,12 +933,45 @@ export default Controller.extend({ // --> pop the window up if (!force && composer.replyingToTopic) { const currentTopic = this.topicModel; + const originalTopic = this.model.topic; if (!currentTopic) { this.save(true); return; } + const topicLabelContent = function (topicOption) { + const topicClosed = topicOption.closed + ? `${iconHTML("lock")}` + : ""; + const topicPinned = topicOption.pinned + ? `${iconHTML("thumbtack")}` + : ""; + const topicBookmarked = topicOption.bookmarked + ? `${iconHTML("bookmark")}` + : ""; + const topicPM = + topicOption.archetype === "private_message" + ? `${iconHTML("envelope")}` + : ""; + + return `
+
+ + ${topicPM}${topicBookmarked}${topicClosed}${topicPinned} + + + ${topicOption.fancyTitle} + +
+
+ ${categoryBadgeHTML(topicOption.category, { + link: false, + })}${htmlSafe(renderTags(topicOption))} +
+
`; + }; + if ( currentTopic.id !== composer.get("topic.id") && (this.isStaffUser || !currentTopic.closed) @@ -943,21 +980,13 @@ export default Controller.extend({ title: I18n.t("composer.posting_not_on_topic"), buttons: [ { - label: - I18n.t("composer.reply_original") + - "
" + - this.get("model.topic.fancyTitle") + - "
", - class: "btn-primary btn-reply-on-original", + label: topicLabelContent(originalTopic), + class: "btn-primary btn-reply-where btn-reply-on-original", action: () => this.save(true), }, { - label: - I18n.t("composer.reply_here") + - "
" + - currentTopic.get("fancyTitle") + - "
", - class: "btn-reply-here", + label: topicLabelContent(currentTopic), + class: "btn-reply-where btn-reply-here", action: () => { composer.setProperties({ topic: currentTopic, post: null }); this.save(true); @@ -965,7 +994,7 @@ export default Controller.extend({ }, { label: I18n.t("composer.cancel"), - class: "btn-flat btn-text btn-reply-where-cancel", + class: "btn-flat btn-text btn-reply-where__cancel", }, ], class: "reply-where-modal", diff --git a/app/assets/stylesheets/common/base/modal.scss b/app/assets/stylesheets/common/base/modal.scss index be7821e32ca..ee9d31b3fcd 100644 --- a/app/assets/stylesheets/common/base/modal.scss +++ b/app/assets/stylesheets/common/base/modal.scss @@ -279,6 +279,12 @@ } .reply-where-modal { + .dialog-content { + width: 100%; + min-width: unset; + max-width: 30em; + } + .dialog-footer { display: block; } @@ -291,19 +297,69 @@ overflow: hidden; width: 100%; - &:first-of-type { - margin-top: 0.25em; + &.dialog-close { + display: none; + } + + &.btn-reply-on-original { + --text-color: var(--secondary); + } + + &.btn-reply-where__cancel { + padding-left: 0; + margin: 0; } - &.btn-reply-on-original, &.btn-reply-here { - font-size: var(--font-up-1); - line-height: var(--line-height-medium); - font-weight: bold; + --text-color: var(--primary); + .discourse-no-touch & { + &:hover { + --text-color: var(--secondary); + } + } + } + + &.btn-reply-where { + min-height: 3em; // for situations when there are no categories/tags } .topic-title { - font-weight: normal; + .d-icon { + color: var(--text-color); + margin: 0; + } + } + + .fancy-title { + display: inline-block; + width: 100%; + + @include ellipsis; + } + + .topic-title__top-line { + display: flex; + align-items: baseline; + color: var(--text-color); + font-size: var(--font-up-1); + } + + .topic-statuses { + display: flex; + font-size: 0.95em; + } + + .topic-title__bottom-line { + margin-top: 0.15em; + display: flex; + align-items: baseline; + .discourse-tags { + font-size: var(--font-down-1); + } + .category-name, + .discourse-tag { + color: var(--text-color); + } } } } diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index dba2d4935a2..05a1f026b27 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -2375,8 +2375,6 @@ en: save_edit: "Save Edit" overwrite_edit: "Overwrite Edit" - reply_original: "Reply on Original Topic" - reply_here: "Reply Here" reply: "Reply" cancel: "Cancel" create_topic: "Create Topic"