UX: Hide AI summary box if no summary or summarize button
This commit is contained in:
parent
6fb91b85ba
commit
0859989249
|
@ -4,6 +4,7 @@ import { hash } from "@ember/helper";
|
||||||
import { action } from "@ember/object";
|
import { action } from "@ember/object";
|
||||||
import { service } from "@ember/service";
|
import { service } from "@ember/service";
|
||||||
import { htmlSafe } from "@ember/template";
|
import { htmlSafe } from "@ember/template";
|
||||||
|
import { or } from "truth-helpers";
|
||||||
import DButton from "discourse/components/d-button";
|
import DButton from "discourse/components/d-button";
|
||||||
import PluginOutlet from "discourse/components/plugin-outlet";
|
import PluginOutlet from "discourse/components/plugin-outlet";
|
||||||
import PrivateMessageMap from "discourse/components/topic-map/private-message-map";
|
import PrivateMessageMap from "discourse/components/topic-map/private-message-map";
|
||||||
|
@ -96,26 +97,28 @@ export default class TopicMap extends Component {
|
||||||
</section>
|
</section>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
|
||||||
<section class="information toggle-summary">
|
{{#if (or @model.summarizable @model.has_summary)}}
|
||||||
{{#if @model.has_summary}}
|
<section class="information toggle-summary">
|
||||||
<p>{{htmlSafe this.topRepliesSummaryInfo}}</p>
|
|
||||||
{{/if}}
|
|
||||||
<PluginOutlet
|
|
||||||
@name="topic-map-expanded-after"
|
|
||||||
@defaultGlimmer={{true}}
|
|
||||||
@outletArgs={{hash topic=@model postStream=@postStream}}
|
|
||||||
>
|
|
||||||
{{#if @model.has_summary}}
|
{{#if @model.has_summary}}
|
||||||
<DButton
|
<p>{{htmlSafe this.topRepliesSummaryInfo}}</p>
|
||||||
@action={{if @postStream.summary @cancelFilter @showTopReplies}}
|
|
||||||
@translatedTitle={{this.topRepliesTitle}}
|
|
||||||
@translatedLabel={{this.topRepliesLabel}}
|
|
||||||
@icon={{this.topRepliesIcon}}
|
|
||||||
class="top-replies"
|
|
||||||
/>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</PluginOutlet>
|
<PluginOutlet
|
||||||
</section>
|
@name="topic-map-expanded-after"
|
||||||
|
@defaultGlimmer={{true}}
|
||||||
|
@outletArgs={{hash topic=@model postStream=@postStream}}
|
||||||
|
>
|
||||||
|
{{#if @model.has_summary}}
|
||||||
|
<DButton
|
||||||
|
@action={{if @postStream.summary @cancelFilter @showTopReplies}}
|
||||||
|
@translatedTitle={{this.topRepliesTitle}}
|
||||||
|
@translatedLabel={{this.topRepliesLabel}}
|
||||||
|
@icon={{this.topRepliesIcon}}
|
||||||
|
class="top-replies"
|
||||||
|
/>
|
||||||
|
{{/if}}
|
||||||
|
</PluginOutlet>
|
||||||
|
</section>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{#if @showPMMap}}
|
{{#if @showPMMap}}
|
||||||
<section class="information private-message-map">
|
<section class="information private-message-map">
|
||||||
|
|
Loading…
Reference in New Issue