A platform for community discussion. Free, open, simple.
DEV: [gjs-codemod] convert first batch of files to gjs
David Taylor1d0d7ddbb5ce
diff --git a/app/assets/javascripts/discourse/app/components/avatar-uploader.gjs b/app/assets/javascripts/discourse/app/components/avatar-uploader.gjsindex 3d3740b148f..db89f485f82 100644--- a/app/assets/javascripts/discourse/app/components/avatar-uploader.gjs+++ b/app/assets/javascripts/discourse/app/components/avatar-uploader.gjs@@ -1,8 +1,10 @@import Component from "@ember/component";import { action } from "@ember/object";import { getOwner } from "@ember/owner";+import didInsert from "@ember/render-modifiers/modifiers/did-insert";import { isBlank } from "@ember/utils";import { tagName } from "@ember-decorators/component";+import DButton from "discourse/components/d-button";import discourseComputed from "discourse/lib/decorators";import UppyUpload from "discourse/lib/uppy/uppy-upload";import { i18n } from "discourse-i18n";@@ -47,27 +49,31 @@ export default class AvatarUploader extends Component {chooseImage() {this.uppyUpload.openPicker();}-}-<input- {{did-insert this.uppyUpload.setup}}- class="hidden-upload-field"- disabled={{this.uploading}}- type="file"- accept="image/*"- aria-hidden="true"-/>-<DButton- @translatedLabel={{this.uploadLabel}}- @icon="far-image"- @disabled={{this.uploading}}- @action={{this.chooseImage}}- @title="user.change_avatar.upload_title"- class="btn-default avatar-uploader__button"- data-uploaded={{this.customAvatarUploaded}}- data-avatar-upload-id={{this.uploadedAvatarId}}-/>+ <template>+ <input+ {{didInsert this.uppyUpload.setup}}+ class="hidden-upload-field"+ disabled={{this.uploading}}+ type="file"+ accept="image/*"+ aria-hidden="true"+ />+ <DButton+ @translatedLabel={{this.uploadLabel}}+ @icon="far-image"+ @disabled={{this.uploading}}+ @action={{this.chooseImage}}+ @title="user.change_avatar.upload_title"+ class="btn-default avatar-uploader__button"+ data-uploaded={{this.customAvatarUploaded}}+ data-avatar-upload-id={{this.uploadedAvatarId}}+ />-{{#if this.imageIsNotASquare}}- <div class="warning">{{i18n "user.change_avatar.image_is_not_a_square"}}</div>-{{/if}}\ No newline at end of file+ {{#if this.imageIsNotASquare}}+ <div class="warning">{{i18n+ "user.change_avatar.image_is_not_a_square"+ }}</div>+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/basic-topic-list.gjs b/app/assets/javascripts/discourse/app/components/basic-topic-list.gjsindex 05939a03b85..673619091f3 100644--- a/app/assets/javascripts/discourse/app/components/basic-topic-list.gjs+++ b/app/assets/javascripts/discourse/app/components/basic-topic-list.gjs@@ -3,7 +3,11 @@ import { alias, not } from "@ember/object/computed";import { service } from "@ember/service";import { observes } from "@ember-decorators/object";import $ from "jquery";+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";+import TopicList from "discourse/components/topic-list";+import List from "discourse/components/topic-list/list";import discourseComputed, { bind } from "discourse/lib/decorators";+import { i18n } from "discourse-i18n";export default class BasicTopicList extends Component {@service site;@@ -114,44 +118,46 @@ export default class BasicTopicList extends Component {return false;}}-}-<ConditionalLoadingSpinner @condition={{this.loading}}>- {{#if this.topics}}- {{#if this.site.useGlimmerTopicList}}- <TopicList::List- @showPosters={{this.showPosters}}- @hideCategory={{this.hideCategory}}- @topics={{this.topics}}- @expandExcerpts={{this.expandExcerpts}}- @bulkSelectHelper={{this.bulkSelectHelper}}- @canBulkSelect={{this.canBulkSelect}}- @tagsForUser={{this.tagsForUser}}- @changeSort={{this.changeSort}}- @order={{this.order}}- @ascending={{this.ascending}}- @focusLastVisitedTopic={{this.focusLastVisitedTopic}}- />- {{else}}- <TopicList- @showPosters={{this.showPosters}}- @hideCategory={{this.hideCategory}}- @topics={{this.topics}}- @expandExcerpts={{this.expandExcerpts}}- @bulkSelectHelper={{this.bulkSelectHelper}}- @canBulkSelect={{this.canBulkSelect}}- @tagsForUser={{this.tagsForUser}}- @changeSort={{this.changeSort}}- @order={{this.order}}- @ascending={{this.ascending}}- @focusLastVisitedTopic={{this.focusLastVisitedTopic}}- />- {{/if}}- {{else}}- {{#unless this.loadingMore}}- <div class="alert alert-info">- {{i18n "choose_topic.none_found"}}- </div>- {{/unless}}- {{/if}}-</ConditionalLoadingSpinner>\ No newline at end of file+ <template>+ <ConditionalLoadingSpinner @condition={{this.loading}}>+ {{#if this.topics}}+ {{#if this.site.useGlimmerTopicList}}+ <List+ @showPosters={{this.showPosters}}+ @hideCategory={{this.hideCategory}}+ @topics={{this.topics}}+ @expandExcerpts={{this.expandExcerpts}}+ @bulkSelectHelper={{this.bulkSelectHelper}}+ @canBulkSelect={{this.canBulkSelect}}+ @tagsForUser={{this.tagsForUser}}+ @changeSort={{this.changeSort}}+ @order={{this.order}}+ @ascending={{this.ascending}}+ @focusLastVisitedTopic={{this.focusLastVisitedTopic}}+ />+ {{else}}+ <TopicList+ @showPosters={{this.showPosters}}+ @hideCategory={{this.hideCategory}}+ @topics={{this.topics}}+ @expandExcerpts={{this.expandExcerpts}}+ @bulkSelectHelper={{this.bulkSelectHelper}}+ @canBulkSelect={{this.canBulkSelect}}+ @tagsForUser={{this.tagsForUser}}+ @changeSort={{this.changeSort}}+ @order={{this.order}}+ @ascending={{this.ascending}}+ @focusLastVisitedTopic={{this.focusLastVisitedTopic}}+ />+ {{/if}}+ {{else}}+ {{#unless this.loadingMore}}+ <div class="alert alert-info">+ {{i18n "choose_topic.none_found"}}+ </div>+ {{/unless}}+ {{/if}}+ </ConditionalLoadingSpinner>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/bulk-actions/notification-level.gjs b/app/assets/javascripts/discourse/app/components/bulk-actions/notification-level.gjsindex 2f39b7390da..c4474685f13 100644--- a/app/assets/javascripts/discourse/app/components/bulk-actions/notification-level.gjs+++ b/app/assets/javascripts/discourse/app/components/bulk-actions/notification-level.gjs@@ -1,6 +1,9 @@import Component from "@glimmer/component";import { action } from "@ember/object";import { empty } from "@ember/object/computed";+import { htmlSafe } from "@ember/template";+import DButton from "discourse/components/d-button";+import RadioButton from "discourse/components/radio-button";import { topicLevels } from "discourse/lib/notification-levels";import { i18n } from "discourse-i18n";@@ -25,26 +28,28 @@ export default class NotificationLevel extends Component {notification_level_id: this.notificationLevelId,});}-}-<div class="bulk-notification-list">- {{#each this.notificationLevels as |level|}}- <div class="controls">- <label class="radio notification-level-radio checkbox-label">- <RadioButton- @value={{level.id}}- @name="notification_level"- @selection={{this.notificationLevelId}}- />- <strong>{{level.name}}</strong>- <div class="description">{{html-safe level.description}}</div>- </label>+ <template>+ <div class="bulk-notification-list">+ {{#each this.notificationLevels as |level|}}+ <div class="controls">+ <label class="radio notification-level-radio checkbox-label">+ <RadioButton+ @value={{level.id}}+ @name="notification_level"+ @selection={{this.notificationLevelId}}+ />+ <strong>{{level.name}}</strong>+ <div class="description">{{htmlSafe level.description}}</div>+ </label>+ </div>+ {{/each}}</div>- {{/each}}-</div>-<DButton- @disabled={{this.disabled}}- @action={{this.changeNotificationLevel}}- @label="topics.bulk.change_notification_level"-/>\ No newline at end of file+ <DButton+ @disabled={{this.disabled}}+ @action={{this.changeNotificationLevel}}+ @label="topics.bulk.change_notification_level"+ />+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/calendar-date-time-input.gjs b/app/assets/javascripts/discourse/app/components/calendar-date-time-input.gjsindex fc15ad7c414..39370af410c 100644--- a/app/assets/javascripts/discourse/app/components/calendar-date-time-input.gjs+++ b/app/assets/javascripts/discourse/app/components/calendar-date-time-input.gjs@@ -1,9 +1,14 @@/* global Pikaday:true */import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { Input } from "@ember/component";+import { on } from "@ember/modifier";import { action } from "@ember/object";+import didInsert from "@ember/render-modifiers/modifiers/did-insert";+import didUpdate from "@ember/render-modifiers/modifiers/did-update";import { isEmpty } from "@ember/utils";import { Promise } from "rsvp";+import icon from "discourse/helpers/d-icon";import loadScript from "discourse/lib/load-script";import { i18n } from "discourse-i18n";@@ -107,29 +112,31 @@ export default class CalendarDateTimeInput extends Component {});});}-}-<div- class="calendar-date-time-input"- {{did-insert this.setupInternalDateTime}}- {{did-insert this.setupPikaday}}- {{did-update this.changeMinDate @minDate}}- {{did-update this.changeDate @date}}- {{did-update this.changeTime @time}}->- <Input class="fake-input" />+ <template>+ <div+ class="calendar-date-time-input"+ {{didInsert this.setupInternalDateTime}}+ {{didInsert this.setupPikaday}}+ {{didUpdate this.changeMinDate @minDate}}+ {{didUpdate this.changeDate @date}}+ {{didUpdate this.changeTime @time}}+ >+ <Input class="fake-input" />- <div class="date-picker" id="picker-container-{{@datePickerId}}"></div>+ <div class="date-picker" id="picker-container-{{@datePickerId}}"></div>- <div class="time-pickers">- {{d-icon "far-clock"}}- <Input- maxlength={{5}}- placeholder="hh:mm"- @type="time"- @value={{this._time}}- class="time-picker"- {{on "input" (action this.onChangeTime)}}- />- </div>-</div>\ No newline at end of file+ <div class="time-pickers">+ {{icon "far-clock"}}+ <Input+ maxlength={{5}}+ placeholder="hh:mm"+ @type="time"+ @value={{this._time}}+ class="time-picker"+ {{on "input" (action this.onChangeTime)}}+ />+ </div>+ </div>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/categories-and-latest-topics.gjs b/app/assets/javascripts/discourse/app/components/categories-and-latest-topics.gjsindex 6352d855385..3a40b3e953a 100644--- a/app/assets/javascripts/discourse/app/components/categories-and-latest-topics.gjs+++ b/app/assets/javascripts/discourse/app/components/categories-and-latest-topics.gjs@@ -1,19 +1,24 @@import Component from "@ember/component";import { classNames } from "@ember-decorators/component";+import CategoriesOnly from "discourse/components/categories-only";+import CategoriesTopicList from "discourse/components/categories-topic-list";+import PluginOutlet from "discourse/components/plugin-outlet";@classNames("categories-and-latest")-export default class CategoriesAndLatestTopics extends Component {}+export default class CategoriesAndLatestTopics extends Component {+ <template>+ <div class="column categories">+ <CategoriesOnly @categories={{this.categories}} />+ </div>-<div class="column categories">- <CategoriesOnly @categories={{this.categories}} />-</div>+ <div class="column">+ <CategoriesTopicList+ @topics={{this.topics}}+ @filter="latest"+ class="latest-topic-list"+ />+ </div>-<div class="column">- <CategoriesTopicList- @topics={{this.topics}}- @filter="latest"- class="latest-topic-list"- />-</div>--<PluginOutlet @name="extra-categories-column" @connectorTagName="div" />\ No newline at end of file+ <PluginOutlet @name="extra-categories-column" @connectorTagName="div" />+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/categories-and-top-topics.gjs b/app/assets/javascripts/discourse/app/components/categories-and-top-topics.gjsindex 4ccb917f53c..e3e023dc226 100644--- a/app/assets/javascripts/discourse/app/components/categories-and-top-topics.gjs+++ b/app/assets/javascripts/discourse/app/components/categories-and-top-topics.gjs@@ -1,19 +1,24 @@import Component from "@ember/component";import { classNames } from "@ember-decorators/component";+import CategoriesOnly from "discourse/components/categories-only";+import CategoriesTopicList from "discourse/components/categories-topic-list";+import PluginOutlet from "discourse/components/plugin-outlet";@classNames("categories-and-top")-export default class CategoriesAndTopTopics extends Component {}+export default class CategoriesAndTopTopics extends Component {+ <template>+ <div class="column categories">+ <CategoriesOnly @categories={{this.categories}} />+ </div>-<div class="column categories">- <CategoriesOnly @categories={{this.categories}} />-</div>+ <div class="column">+ <CategoriesTopicList+ @topics={{this.topics}}+ @filter="top"+ class="top-topic-list"+ />+ </div>-<div class="column">- <CategoriesTopicList- @topics={{this.topics}}- @filter="top"- class="top-topic-list"- />-</div>--<PluginOutlet @name="extra-categories-column" @connectorTagName="div" />\ No newline at end of file+ <PluginOutlet @name="extra-categories-column" @connectorTagName="div" />+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/categories-boxes-topic.gjs b/app/assets/javascripts/discourse/app/components/categories-boxes-topic.gjsindex cbc75bf42c9..93b6709a7be 100644--- a/app/assets/javascripts/discourse/app/components/categories-boxes-topic.gjs+++ b/app/assets/javascripts/discourse/app/components/categories-boxes-topic.gjs@@ -1,5 +1,7 @@import Component from "@ember/component";+import { htmlSafe } from "@ember/template";import { attributeBindings, tagName } from "@ember-decorators/component";+import icon from "discourse/helpers/d-icon";import discourseComputed from "discourse/lib/decorators";@tagName("li")@@ -15,10 +17,12 @@ export default class CategoriesBoxesTopic extends Component {}return "far-file-lines";}-}-{{d-icon this.topicStatusIcon}}+ <template>+ {{icon this.topicStatusIcon}}-<a href={{this.topic.lastUnreadUrl}} class="title">- {{html-safe this.topic.fancyTitle}}-</a>\ No newline at end of file+ <a href={{this.topic.lastUnreadUrl}} class="title">+ {{htmlSafe this.topic.fancyTitle}}+ </a>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/categories-boxes-with-topics.gjs b/app/assets/javascripts/discourse/app/components/categories-boxes-with-topics.gjsindex 82e62f0e238..1869b24ca10 100644--- a/app/assets/javascripts/discourse/app/components/categories-boxes-with-topics.gjs+++ b/app/assets/javascripts/discourse/app/components/categories-boxes-with-topics.gjs@@ -1,6 +1,13 @@import Component from "@ember/component";+import { hash } from "@ember/helper";import { isEmpty } from "@ember/utils";import { classNameBindings, tagName } from "@ember-decorators/component";+import CategoriesBoxesTopic from "discourse/components/categories-boxes-topic";+import CategoryLogo from "discourse/components/category-logo";+import CategoryTitleBefore from "discourse/components/category-title-before";+import PluginOutlet from "discourse/components/plugin-outlet";+import categoryColorVariable from "discourse/helpers/category-color-variable";+import icon from "discourse/helpers/d-icon";import discourseComputed from "discourse/lib/decorators";@tagName("section")@@ -17,50 +24,52 @@ export default class CategoriesBoxesWithTopics extends Component {return !isEmpty(c.get("uploaded_logo.url"));});}-}-{{#each this.categories as |c|}}- <div- data-notification-level={{c.notificationLevelString}}- style={{category-color-variable c.color}}- class="category category-box category-box-{{c.slug}}- {{if c.isMuted 'muted'}}"- >- <div class="category-box-inner">- <div class="category-box-heading">- <a class="parent-box-link" href={{c.url}}>+ <template>+ {{#each this.categories as |c|}}+ <div+ data-notification-level={{c.notificationLevelString}}+ style={{categoryColorVariable c.color}}+ class="category category-box category-box-{{c.slug}}+ {{if c.isMuted 'muted'}}"+ >+ <div class="category-box-inner">+ <div class="category-box-heading">+ <a class="parent-box-link" href={{c.url}}>+ {{#unless c.isMuted}}+ {{#if c.uploaded_logo.url}}+ <CategoryLogo @category={{c}} />+ {{/if}}+ {{/unless}}++ <h3>+ <CategoryTitleBefore @category={{c}} />+ {{#if c.read_restricted}}+ {{icon this.lockIcon}}+ {{/if}}+ {{c.displayName}}+ </h3>+ </a>+ </div>+{{#unless c.isMuted}}- {{#if c.uploaded_logo.url}}- <CategoryLogo @category={{c}} />- {{/if}}+ <div class="featured-topics">+ {{#if c.topics}}+ <ul>+ {{#each c.topics as |topic|}}+ <CategoriesBoxesTopic @topic={{topic}} />+ {{/each}}+ </ul>+ {{/if}}+ </div>{{/unless}}- <h3>- <CategoryTitleBefore @category={{c}} />- {{#if c.read_restricted}}- {{d-icon this.lockIcon}}- {{/if}}- {{c.displayName}}- </h3>- </a>- </div>-- {{#unless c.isMuted}}- <div class="featured-topics">- {{#if c.topics}}- <ul>- {{#each c.topics as |topic|}}- <CategoriesBoxesTopic @topic={{topic}} />- {{/each}}- </ul>- {{/if}}+ <PluginOutlet+ @name="category-box-below-each-category"+ @outletArgs={{hash category=c}}+ /></div>- {{/unless}}-- <PluginOutlet- @name="category-box-below-each-category"- @outletArgs={{hash category=c}}- />- </div>- </div>-{{/each}}\ No newline at end of file+ </div>+ {{/each}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/categories-boxes.gjs b/app/assets/javascripts/discourse/app/components/categories-boxes.gjsindex 076e7445705..90a78cb5381 100644--- a/app/assets/javascripts/discourse/app/components/categories-boxes.gjs+++ b/app/assets/javascripts/discourse/app/components/categories-boxes.gjs@@ -1,6 +1,16 @@import Component from "@ember/component";+import { hash } from "@ember/helper";+import { htmlSafe } from "@ember/template";import { isEmpty } from "@ember/utils";import { classNameBindings, tagName } from "@ember-decorators/component";+import CategoryLogo from "discourse/components/category-logo";+import CategoryTitleBefore from "discourse/components/category-title-before";+import CategoryTitleLink from "discourse/components/category-title-link";+import PluginOutlet from "discourse/components/plugin-outlet";+import borderColor from "discourse/helpers/border-color";+import categoryColorVariable from "discourse/helpers/category-color-variable";+import categoryLink from "discourse/helpers/category-link";+import icon from "discourse/helpers/d-icon";import discourseComputed from "discourse/lib/decorators";@tagName("section")@@ -21,117 +31,129 @@ export default class CategoriesBoxes extends Component {hasSubcategories() {return this.categories.any((c) => !isEmpty(c.get("subcategories")));}-}-<PluginOutlet- @name="categories-boxes-wrapper"- @outletArgs={{hash categories=this.categories}}->- {{#each this.categories as |c|}}+ <template><PluginOutlet- @name="category-box-before-each-box"- @outletArgs={{hash category=c}}- />-- <div- style={{category-color-variable c.color}}- data-category-id={{c.id}}- data-notification-level={{c.notificationLevelString}}- data-url={{c.url}}- class="category category-box category-box-{{c.slug}}- {{if c.isMuted 'muted'}}"+ @name="categories-boxes-wrapper"+ @outletArgs={{hash categories=this.categories}}>- <div class="category-box-inner">- {{#unless c.isMuted}}- <div class="category-logo">- {{#if c.uploaded_logo.url}}- <CategoryLogo @category={{c}} />- {{/if}}- </div>- {{/unless}}+ {{#each this.categories as |c|}}+ <PluginOutlet+ @name="category-box-before-each-box"+ @outletArgs={{hash category=c}}+ />- <div class="category-details">- <div class="category-box-heading">- <a class="parent-box-link" href={{c.url}}>- <h3>- <CategoryTitleBefore @category={{c}} />- {{#if c.read_restricted}}- {{d-icon this.lockIcon}}+ <div+ style={{categoryColorVariable c.color}}+ data-category-id={{c.id}}+ data-notification-level={{c.notificationLevelString}}+ data-url={{c.url}}+ class="category category-box category-box-{{c.slug}}+ {{if c.isMuted 'muted'}}"+ >+ <div class="category-box-inner">+ {{#unless c.isMuted}}+ <div class="category-logo">+ {{#if c.uploaded_logo.url}}+ <CategoryLogo @category={{c}} />{{/if}}- {{c.displayName}}- </h3>- </a>- </div>+ </div>+ {{/unless}}- {{#unless c.isMuted}}- <div class="description">- {{html-safe c.description_excerpt}}- </div>+ <div class="category-details">+ <div class="category-box-heading">+ <a class="parent-box-link" href={{c.url}}>+ <h3>+ <CategoryTitleBefore @category={{c}} />+ {{#if c.read_restricted}}+ {{icon this.lockIcon}}+ {{/if}}+ {{c.displayName}}+ </h3>+ </a>+ </div>- {{#if c.isGrandParent}}- {{#each c.subcategories as |subcategory|}}- <div- data-category-id={{subcategory.id}}- data-notification-level={{subcategory.notificationLevelString}}- style={{border-color subcategory.color}}- class="subcategory with-subcategories- {{if subcategory.uploaded_logo.url 'has-logo' 'no-logo'}}"- >- <div class="subcategory-box-inner">- <CategoryTitleLink- @tagName="h4"- @category={{subcategory}}- />- {{#if subcategory.subcategories}}- <div class="subcategories">- {{#each subcategory.subcategories as |subsubcategory|}}- {{#unless subsubcategory.isMuted}}- <span class="subcategory">- <CategoryTitleBefore- @category={{subsubcategory}}- />- {{category-link subsubcategory hideParent="true"}}- </span>- {{/unless}}- {{/each}}+ {{#unless c.isMuted}}+ <div class="description">+ {{htmlSafe c.description_excerpt}}+ </div>++ {{#if c.isGrandParent}}+ {{#each c.subcategories as |subcategory|}}+ <div+ data-category-id={{subcategory.id}}+ data-notification-level={{subcategory.notificationLevelString}}+ style={{borderColor subcategory.color}}+ class="subcategory with-subcategories+ {{if+ subcategory.uploaded_logo.url+ 'has-logo'+ 'no-logo'+ }}"+ >+ <div class="subcategory-box-inner">+ <CategoryTitleLink+ @tagName="h4"+ @category={{subcategory}}+ />+ {{#if subcategory.subcategories}}+ <div class="subcategories">+ {{#each+ subcategory.subcategories+ as |subsubcategory|+ }}+ {{#unless subsubcategory.isMuted}}+ <span class="subcategory">+ <CategoryTitleBefore+ @category={{subsubcategory}}+ />+ {{categoryLink+ subsubcategory+ hideParent="true"+ }}+ </span>+ {{/unless}}+ {{/each}}+ </div>+ {{/if}}</div>- {{/if}}+ </div>+ {{/each}}+ {{else if c.subcategories}}+ <div class="subcategories">+ {{#each c.subcategories as |sc|}}+ <a class="subcategory" href={{sc.url}}>+ <span class="subcategory-image-placeholder">+ {{#if sc.uploaded_logo.url}}+ <CategoryLogo @category={{sc}} />+ {{/if}}+ </span>++ {{categoryLink sc hideParent="true"}}+ </a>+ {{/each}}</div>- </div>- {{/each}}- {{else if c.subcategories}}- <div class="subcategories">- {{#each c.subcategories as |sc|}}- <a class="subcategory" href={{sc.url}}>- <span class="subcategory-image-placeholder">- {{#if sc.uploaded_logo.url}}- <CategoryLogo @category={{sc}} />- {{/if}}- </span>+ {{/if}}+ {{/unless}}+ </div>- {{category-link sc hideParent="true"}}- </a>- {{/each}}- </div>- {{/if}}- {{/unless}}+ <PluginOutlet+ @name="category-box-below-each-category"+ @outletArgs={{hash category=c}}+ />+ </div></div><PluginOutlet- @name="category-box-below-each-category"+ @name="category-box-after-each-box"@outletArgs={{hash category=c}}/>- </div>- </div>+ {{/each}}+ </PluginOutlet><PluginOutlet- @name="category-box-after-each-box"- @outletArgs={{hash category=c}}+ @name="category-boxes-after-boxes"+ @outletArgs={{hash category=this.c}}/>- {{/each}}-</PluginOutlet>--<PluginOutlet- @name="category-boxes-after-boxes"- @outletArgs={{hash category=this.c}}-/>\ No newline at end of file+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/categories-only.gjs b/app/assets/javascripts/discourse/app/components/categories-only.gjsindex cd98eaac8a1..59d7b58f0cf 100644--- a/app/assets/javascripts/discourse/app/components/categories-only.gjs+++ b/app/assets/javascripts/discourse/app/components/categories-only.gjs@@ -1,7 +1,13 @@import Component from "@ember/component";+import { hash } from "@ember/helper";+import { on } from "@ember/modifier";import { action } from "@ember/object";import { tagName } from "@ember-decorators/component";+import ParentCategoryRow from "discourse/components/parent-category-row";+import PluginOutlet from "discourse/components/plugin-outlet";+import icon from "discourse/helpers/d-icon";import discourseComputed from "discourse/lib/decorators";+import { i18n } from "discourse-i18n";@tagName("")export default class CategoriesOnly extends Component {@@ -53,118 +59,122 @@ export default class CategoriesOnly extends Component {event?.preventDefault();this.toggleProperty("showMuted");}-}-<PluginOutlet- @name="categories-only-wrapper"- @outletArgs={{hash categories=this.categories}}->- {{#if this.categories}}- {{#if this.filteredCategories}}- {{#if this.site.mobileView}}- <div class="category-list {{if this.showTopics 'with-topics'}}">- <PluginOutlet- @name="mobile-categories"- @outletArgs={{hash categories=this.filteredCategories}}- >- {{#each this.filteredCategories as |c|}}- <ParentCategoryRow- @category={{c}}- @showTopics={{this.showTopics}}- />- {{/each}}- </PluginOutlet>- </div>- {{else}}- <table class="category-list {{if this.showTopics 'with-topics'}}">- <thead>- <tr>- <th class="category"><span- role="heading"- aria-level="2"- id="categories-only-category"- >{{i18n "categories.category"}}</span></th>- <th class="topics">{{i18n "categories.topics"}}</th>- {{#if this.showTopics}}- <th class="latest">{{i18n "categories.latest"}}</th>- {{/if}}- </tr>- </thead>- <tbody aria-labelledby="categories-only-category">- {{#each this.categories as |category|}}- <ParentCategoryRow- @category={{category}}- @showTopics={{this.showTopics}}- />- {{/each}}- </tbody>- </table>- {{/if}}- {{/if}}-- {{#if this.mutedCategories}}- <div class="muted-categories">- <a- href- class="muted-categories-link"- {{on "click" this.toggleShowMuted}}- >- <h3 class="muted-categories-heading">{{i18n "categories.muted"}}</h3>- {{#if this.mutedToggleIcon}}- {{d-icon this.mutedToggleIcon}}+ <template>+ <PluginOutlet+ @name="categories-only-wrapper"+ @outletArgs={{hash categories=this.categories}}+ >+ {{#if this.categories}}+ {{#if this.filteredCategories}}+ {{#if this.site.mobileView}}+ <div class="category-list {{if this.showTopics 'with-topics'}}">+ <PluginOutlet+ @name="mobile-categories"+ @outletArgs={{hash categories=this.filteredCategories}}+ >+ {{#each this.filteredCategories as |c|}}+ <ParentCategoryRow+ @category={{c}}+ @showTopics={{this.showTopics}}+ />+ {{/each}}+ </PluginOutlet>+ </div>+ {{else}}+ <table class="category-list {{if this.showTopics 'with-topics'}}">+ <thead>+ <tr>+ <th class="category"><span+ role="heading"+ aria-level="2"+ id="categories-only-category"+ >{{i18n "categories.category"}}</span></th>+ <th class="topics">{{i18n "categories.topics"}}</th>+ {{#if this.showTopics}}+ <th class="latest">{{i18n "categories.latest"}}</th>+ {{/if}}+ </tr>+ </thead>+ <tbody aria-labelledby="categories-only-category">+ {{#each this.categories as |category|}}+ <ParentCategoryRow+ @category={{category}}+ @showTopics={{this.showTopics}}+ />+ {{/each}}+ </tbody>+ </table>{{/if}}- </a>- {{#if this.site.mobileView}}- <div- class="category-list- {{if this.showTopics 'with-topics'}}- {{unless this.showMutedCategories 'hidden'}}"- >- {{#each this.mutedCategories as |c|}}- <ParentCategoryRow- @category={{c}}- @showTopics={{this.showTopics}}- @listType="muted"- />- {{/each}}+ {{/if}}++ {{#if this.mutedCategories}}+ <div class="muted-categories">+ <a+ href+ class="muted-categories-link"+ {{on "click" this.toggleShowMuted}}+ >+ <h3 class="muted-categories-heading">{{i18n+ "categories.muted"+ }}</h3>+ {{#if this.mutedToggleIcon}}+ {{icon this.mutedToggleIcon}}+ {{/if}}+ </a>+ {{#if this.site.mobileView}}+ <div+ class="category-list+ {{if this.showTopics 'with-topics'}}+ {{unless this.showMutedCategories 'hidden'}}"+ >+ {{#each this.mutedCategories as |c|}}+ <ParentCategoryRow+ @category={{c}}+ @showTopics={{this.showTopics}}+ @listType="muted"+ />+ {{/each}}+ </div>+ {{else}}+ <table+ class="category-list+ {{if this.showTopics 'with-topics'}}+ {{unless this.showMutedCategories 'hidden'}}"+ >+ <thead>+ <tr>+ <th class="category"><span+ role="heading"+ aria-level="2"+ id="categories-only-category-muted"+ >{{i18n "categories.category"}}</span></th>+ <th class="topics">{{i18n "categories.topics"}}</th>+ {{#if this.showTopics}}+ <th class="latest">{{i18n "categories.latest"}}</th>+ {{/if}}+ </tr>+ </thead>+ <tbody aria-labelledby="categories-only-category-muted">+ {{#each this.categories as |category|}}+ <ParentCategoryRow+ @category={{category}}+ @showTopics={{this.showTopics}}+ @listType="muted"+ />+ {{/each}}+ </tbody>+ </table>+ {{/if}}</div>- {{else}}- <table- class="category-list- {{if this.showTopics 'with-topics'}}- {{unless this.showMutedCategories 'hidden'}}"- >- <thead>- <tr>- <th class="category"><span- role="heading"- aria-level="2"- id="categories-only-category-muted"- >{{i18n "categories.category"}}</span></th>- <th class="topics">{{i18n "categories.topics"}}</th>- {{#if this.showTopics}}- <th class="latest">{{i18n "categories.latest"}}</th>- {{/if}}- </tr>- </thead>- <tbody aria-labelledby="categories-only-category-muted">- {{#each this.categories as |category|}}- <ParentCategoryRow- @category={{category}}- @showTopics={{this.showTopics}}- @listType="muted"- />- {{/each}}- </tbody>- </table>{{/if}}- </div>- {{/if}}- {{/if}}-</PluginOutlet>+ {{/if}}+ </PluginOutlet>-<PluginOutlet- @name="below-categories-only"- @connectorTagName="div"- @outletArgs={{hash categories=this.categories showTopics=this.showTopics}}-/>\ No newline at end of file+ <PluginOutlet+ @name="below-categories-only"+ @connectorTagName="div"+ @outletArgs={{hash categories=this.categories showTopics=this.showTopics}}+ />+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/categories-topic-list.gjs b/app/assets/javascripts/discourse/app/components/categories-topic-list.gjsindex 3ded2a33a12..3f8169b0dfc 100644--- a/app/assets/javascripts/discourse/app/components/categories-topic-list.gjs+++ b/app/assets/javascripts/discourse/app/components/categories-topic-list.gjs@@ -1,45 +1,53 @@import Component from "@ember/component";+import { concat } from "@ember/helper";+import { eq } from "truth-helpers";+import PluginOutlet from "discourse/components/plugin-outlet";+import LatestTopicListItem from "discourse/components/topic-list/latest-topic-list-item";+import getUrl from "discourse/helpers/get-url";+import { i18n } from "discourse-i18n";// Exists so plugins can use it-export default class CategoriesTopicList extends Component {}+export default class CategoriesTopicList extends Component {+ <template>+ <div role="heading" aria-level="2" class="table-heading">+ {{i18n (concat "filters." this.filter ".title")}}+ <PluginOutlet+ @name="categories-topics-table-heading"+ @connectorTagName="div"+ />+ </div>-<div role="heading" aria-level="2" class="table-heading">- {{i18n (concat "filters." this.filter ".title")}}- <PluginOutlet- @name="categories-topics-table-heading"- @connectorTagName="div"- />-</div>+ {{#if this.topics}}+ {{#each this.topics as |t|}}+ {{#if this.site.useGlimmerTopicList}}+ <LatestTopicListItem @topic={{t}} />+ {{else}}+ <LatestTopicListItem @topic={{t}} />+ {{/if}}+ {{/each}}-{{#if this.topics}}- {{#each this.topics as |t|}}- {{#if this.site.useGlimmerTopicList}}- <TopicList::LatestTopicListItem @topic={{t}} />+ <div class="more-topics">+ {{#if+ (eq+ this.siteSettings.desktop_category_page_style+ "categories_and_latest_topics_created_date"+ )+ }}+ <a+ href={{getUrl (concat "/" this.filter "?order=created")}}+ class="btn btn-default pull-right"+ >{{i18n "more"}}</a>+ {{else}}+ <a+ href={{getUrl (concat "/" this.filter)}}+ class="btn btn-default pull-right"+ >{{i18n "more"}}</a>+ {{/if}}+ </div>{{else}}- <LatestTopicListItem @topic={{t}} />+ <div class="no-topics">+ <h3>{{i18n (concat "topics.none." this.filter)}}</h3>+ </div>{{/if}}- {{/each}}-- <div class="more-topics">- {{#if- (eq- this.siteSettings.desktop_category_page_style- "categories_and_latest_topics_created_date"- )- }}- <a- href={{get-url (concat "/" this.filter "?order=created")}}- class="btn btn-default pull-right"- >{{i18n "more"}}</a>- {{else}}- <a- href={{get-url (concat "/" this.filter)}}- class="btn btn-default pull-right"- >{{i18n "more"}}</a>- {{/if}}- </div>-{{else}}- <div class="no-topics">- <h3>{{i18n (concat "topics.none." this.filter)}}</h3>- </div>-{{/if}}\ No newline at end of file+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/categories-with-featured-topics.gjs b/app/assets/javascripts/discourse/app/components/categories-with-featured-topics.gjsindex 66df6a9641d..85aae42d0a3 100644--- a/app/assets/javascripts/discourse/app/components/categories-with-featured-topics.gjs+++ b/app/assets/javascripts/discourse/app/components/categories-with-featured-topics.gjs@@ -1,5 +1,8 @@import Component from "@ember/component";+import CategoriesOnly from "discourse/components/categories-only";-export default class CategoriesWithFeaturedTopics extends Component {}--<CategoriesOnly @categories={{this.categories}} @showTopics="true" />\ No newline at end of file+export default class CategoriesWithFeaturedTopics extends Component {+ <template>+ <CategoriesOnly @categories={{this.categories}} @showTopics="true" />+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/category-name-fields.gjs b/app/assets/javascripts/discourse/app/components/category-name-fields.gjsindex df10704db27..906a01fad59 100644--- a/app/assets/javascripts/discourse/app/components/category-name-fields.gjs+++ b/app/assets/javascripts/discourse/app/components/category-name-fields.gjs@@ -1,30 +1,36 @@import Component from "@ember/component";+import { hash } from "@ember/helper";+import PluginOutlet from "discourse/components/plugin-outlet";+import TextField from "discourse/components/text-field";+import { i18n } from "discourse-i18n";-export default class CategoryNameFields extends Component {}--<PluginOutlet- @name="category-name-fields-details"- @outletArgs={{hash category=this.category}}->- <section class="field category-name-fields">- {{#unless this.category.isUncategorizedCategory}}- <section class="field-item">- <label>{{i18n "category.name"}}</label>- <TextField- @value={{this.category.name}}- @placeholderKey="category.name_placeholder"- @maxlength="50"- class="category-name"- />+export default class CategoryNameFields extends Component {+ <template>+ <PluginOutlet+ @name="category-name-fields-details"+ @outletArgs={{hash category=this.category}}+ >+ <section class="field category-name-fields">+ {{#unless this.category.isUncategorizedCategory}}+ <section class="field-item">+ <label>{{i18n "category.name"}}</label>+ <TextField+ @value={{this.category.name}}+ @placeholderKey="category.name_placeholder"+ @maxlength="50"+ class="category-name"+ />+ </section>+ {{/unless}}+ <section class="field-item">+ <label>{{i18n "category.slug"}}</label>+ <TextField+ @value={{this.category.slug}}+ @placeholderKey="category.slug_placeholder"+ @maxlength="255"+ />+ </section></section>- {{/unless}}- <section class="field-item">- <label>{{i18n "category.slug"}}</label>- <TextField- @value={{this.category.slug}}- @placeholderKey="category.slug_placeholder"- @maxlength="255"- />- </section>- </section>-</PluginOutlet>\ No newline at end of file+ </PluginOutlet>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/category-title-link.gjs b/app/assets/javascripts/discourse/app/components/category-title-link.gjsindex 2d9f5298619..6ad3b693d14 100644--- a/app/assets/javascripts/discourse/app/components/category-title-link.gjs+++ b/app/assets/javascripts/discourse/app/components/category-title-link.gjs@@ -1,21 +1,27 @@import Component from "@ember/component";import { tagName } from "@ember-decorators/component";+import CategoryLogo from "discourse/components/category-logo";+import CategoryTitleBefore from "discourse/components/category-title-before";+import icon from "discourse/helpers/d-icon";+import dirSpan from "discourse/helpers/dir-span";@tagName("h3")-export default class CategoryTitleLink extends Component {}+export default class CategoryTitleLink extends Component {+ <template>+ <a class="category-title-link" href={{this.category.url}}>+ <div class="category-text-title">+ <CategoryTitleBefore @category={{this.category}} />+ {{#if this.category.read_restricted}}+ {{icon this.lockIcon}}+ {{/if}}+ <span class="category-name">{{dirSpan this.category.displayName}}</span>+ </div>+ {{#if this.category.uploaded_logo.url}}+ <CategoryLogo @category={{this.category}} />+ {{/if}}+ </a>+ </template>+}// icon name defined on prototype so it can be easily overridden in theme componentsCategoryTitleLink.prototype.lockIcon = "lock";--<a class="category-title-link" href={{this.category.url}}>- <div class="category-text-title">- <CategoryTitleBefore @category={{this.category}} />- {{#if this.category.read_restricted}}- {{d-icon this.lockIcon}}- {{/if}}- <span class="category-name">{{dir-span this.category.displayName}}</span>- </div>- {{#if this.category.uploaded_logo.url}}- <CategoryLogo @category={{this.category}} />- {{/if}}-</a>\ No newline at end of filediff --git a/app/assets/javascripts/discourse/app/components/category-unread.gjs b/app/assets/javascripts/discourse/app/components/category-unread.gjsindex 019ba8e6518..9667e178ec0 100644--- a/app/assets/javascripts/discourse/app/components/category-unread.gjs+++ b/app/assets/javascripts/discourse/app/components/category-unread.gjs@@ -1,24 +1,30 @@import Component from "@ember/component";import { classNames, tagName } from "@ember-decorators/component";+import { i18n } from "discourse-i18n";@tagName("span")@classNames("category__badges")-export default class CategoryUnread extends Component {}--{{#if this.unreadTopicsCount}}- <a- href={{this.category.unreadUrl}}- title={{i18n "topic.unread_topics" count=this.unreadTopicsCount}}- class="badge new-posts badge-notification"- >{{i18n- "filters.unread.lower_title_with_count"- count=this.unreadTopicsCount- }}</a>-{{/if}}-{{#if this.newTopicsCount}}- <a- href={{this.category.newUrl}}- title={{i18n "topic.new_topics" count=this.newTopicsCount}}- class="badge new-posts badge-notification"- >{{i18n "filters.new.lower_title_with_count" count=this.newTopicsCount}}</a>-{{/if}}\ No newline at end of file+export default class CategoryUnread extends Component {+ <template>+ {{#if this.unreadTopicsCount}}+ <a+ href={{this.category.unreadUrl}}+ title={{i18n "topic.unread_topics" count=this.unreadTopicsCount}}+ class="badge new-posts badge-notification"+ >{{i18n+ "filters.unread.lower_title_with_count"+ count=this.unreadTopicsCount+ }}</a>+ {{/if}}+ {{#if this.newTopicsCount}}+ <a+ href={{this.category.newUrl}}+ title={{i18n "topic.new_topics" count=this.newTopicsCount}}+ class="badge new-posts badge-notification"+ >{{i18n+ "filters.new.lower_title_with_count"+ count=this.newTopicsCount+ }}</a>+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/char-counter.gjs b/app/assets/javascripts/discourse/app/components/char-counter.gjsindex 3ab7e455dd7..a8d72caa864 100644--- a/app/assets/javascripts/discourse/app/components/char-counter.gjs+++ b/app/assets/javascripts/discourse/app/components/char-counter.gjs@@ -1,12 +1,19 @@-<div- class={{concat-class "char-counter" (if (gt @value.length @max) "exceeded")}}- ...attributes->- {{yield}}- <small class="char-counter__ratio">- {{@value.length}}/{{@max}}- </small>- <span aria-live="polite" class="sr-only">- {{if (gt @value.length @max) (i18n "char_counter.exceeded")}}- </span>-</div>\ No newline at end of file+import { gt } from "truth-helpers";+import concatClass from "discourse/helpers/concat-class";+import { i18n } from "discourse-i18n";++const CharCounter = <template>+ <div+ class={{concatClass "char-counter" (if (gt @value.length @max) "exceeded")}}+ ...attributes+ >+ {{yield}}+ <small class="char-counter__ratio">+ {{@value.length}}/{{@max}}+ </small>+ <span aria-live="polite" class="sr-only">+ {{if (gt @value.length @max) (i18n "char_counter.exceeded")}}+ </span>+ </div>+</template>;+export default CharCounter;diff --git a/app/assets/javascripts/discourse/app/components/color-picker.gjs b/app/assets/javascripts/discourse/app/components/color-picker.gjsindex c23f9907c2b..7a37d7c8189 100644--- a/app/assets/javascripts/discourse/app/components/color-picker.gjs+++ b/app/assets/javascripts/discourse/app/components/color-picker.gjs@@ -1,6 +1,8 @@import Component from "@ember/component";import { action } from "@ember/object";import { attributeBindings, classNames } from "@ember-decorators/component";+import ColorPickerChoice from "discourse/components/color-picker-choice";+import icon from "discourse/helpers/d-icon";import { i18n } from "discourse-i18n";@classNames("colors-container")@@ -20,15 +22,17 @@ export default class ColorPicker extends Component {: "";return `#${color} ${isUsed}`;}-}-{{#each this.colors as |c|}}- <ColorPickerChoice- @color={{c}}- @usedColors={{this.usedColors}}- @selectColor={{action "selectColor"}}- @ariaLabel={{this.getColorLabel c}}- >- {{d-icon "check"}}- </ColorPickerChoice>-{{/each}}\ No newline at end of file+ <template>+ {{#each this.colors as |c|}}+ <ColorPickerChoice+ @color={{c}}+ @usedColors={{this.usedColors}}+ @selectColor={{action "selectColor"}}+ @ariaLabel={{this.getColorLabel c}}+ >+ {{icon "check"}}+ </ColorPickerChoice>+ {{/each}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/composer-fullscreen-prompt.gjs b/app/assets/javascripts/discourse/app/components/composer-fullscreen-prompt.gjsindex 79c9f74229a..2f49d94ce8b 100644--- a/app/assets/javascripts/discourse/app/components/composer-fullscreen-prompt.gjs+++ b/app/assets/javascripts/discourse/app/components/composer-fullscreen-prompt.gjs@@ -1,6 +1,13 @@-<div- class="composer-fullscreen-prompt"- {{on "animationend" @removeFullScreenExitPrompt}}->- {{html-safe (i18n "composer.exit_fullscreen_prompt")}}-</div>\ No newline at end of file+import { on } from "@ember/modifier";+import { htmlSafe } from "@ember/template";+import { i18n } from "discourse-i18n";++const ComposerFullscreenPrompt = <template>+ <div+ class="composer-fullscreen-prompt"+ {{on "animationend" @removeFullScreenExitPrompt}}+ >+ {{htmlSafe (i18n "composer.exit_fullscreen_prompt")}}+ </div>+</template>;+export default ComposerFullscreenPrompt;diff --git a/app/assets/javascripts/discourse/app/components/composer-messages.gjs b/app/assets/javascripts/discourse/app/components/composer-messages.gjsindex 025ecbe6520..68264fc98ff 100644--- a/app/assets/javascripts/discourse/app/components/composer-messages.gjs+++ b/app/assets/javascripts/discourse/app/components/composer-messages.gjs@@ -1,10 +1,13 @@import { tracked } from "@glimmer/tracking";import Component from "@ember/component";+import { fn } from "@ember/helper";import EmberObject, { action } from "@ember/object";import { not } from "@ember/object/computed";import { schedule } from "@ember/runloop";import { service } from "@ember/service";import { classNameBindings } from "@ember-decorators/component";+import ComposerMessage from "discourse/components/composer-message";+import ShareTopic from "discourse/components/modal/share-topic";import { ajax } from "discourse/lib/ajax";import { debounce } from "discourse/lib/decorators";import { INPUT_DELAY } from "discourse/lib/environment";@@ -338,19 +341,21 @@ export default class ComposerMessages extends Component {this.composer.set("targetRecipients", message.reply_username);this._removeMessage(message);}-}-{{#each this.messages as |message|}}- <ComposerMessage- @message={{message}}- @closeMessage={{this.closeMessage}}- @shareModal={{fn (mut this.showShareModal) true}}- @switchPM={{this.switchPM}}- />- {{#if this.showShareModal}}- <Modal::ShareTopic- @closeModal={{fn (mut this.showShareModal) false}}- @model={{this.shareModalData}}- />- {{/if}}-{{/each}}\ No newline at end of file+ <template>+ {{#each this.messages as |message|}}+ <ComposerMessage+ @message={{message}}+ @closeMessage={{this.closeMessage}}+ @shareModal={{fn (mut this.showShareModal) true}}+ @switchPM={{this.switchPM}}+ />+ {{#if this.showShareModal}}+ <ShareTopic+ @closeModal={{fn (mut this.showShareModal) false}}+ @model={{this.shareModalData}}+ />+ {{/if}}+ {{/each}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/composer-tip-close-button.gjs b/app/assets/javascripts/discourse/app/components/composer-tip-close-button.gjsindex 805a2879914..954bca3b34c 100644--- a/app/assets/javascripts/discourse/app/components/composer-tip-close-button.gjs+++ b/app/assets/javascripts/discourse/app/components/composer-tip-close-button.gjs@@ -1,7 +1,12 @@-<DButton- @action={{@action}}- @icon="xmark"- @label="composer.esc"- @ariaLabel="composer.esc_label"- class="btn-transparent close"-/>\ No newline at end of file+import DButton from "discourse/components/d-button";++const ComposerTipCloseButton = <template>+ <DButton+ @action={{@action}}+ @icon="xmark"+ @label="composer.esc"+ @ariaLabel="composer.esc_label"+ class="btn-transparent close"+ />+</template>;+export default ComposerTipCloseButton;diff --git a/app/assets/javascripts/discourse/app/components/composer-title.gjs b/app/assets/javascripts/discourse/app/components/composer-title.gjsindex 66ba14ec200..3187f332ad2 100644--- a/app/assets/javascripts/discourse/app/components/composer-title.gjs+++ b/app/assets/javascripts/discourse/app/components/composer-title.gjs@@ -1,4 +1,5 @@import Component from "@ember/component";+import { hash } from "@ember/helper";import EmberObject from "@ember/object";import { alias, or } from "@ember/object/computed";import { next, schedule } from "@ember/runloop";@@ -6,6 +7,9 @@ import { classNames } from "@ember-decorators/component";import { observes } from "@ember-decorators/object";import { load } from "pretty-text/oneboxer";import { lookupCache } from "pretty-text/oneboxer-cache";+import PluginOutlet from "discourse/components/plugin-outlet";+import PopupInputTip from "discourse/components/popup-input-tip";+import TextField from "discourse/components/text-field";import { ajax } from "discourse/lib/ajax";import discourseDebounce from "discourse/lib/debounce";import discourseComputed from "discourse/lib/decorators";@@ -234,22 +238,24 @@ export default class ComposerTitle extends Component {reply === (this.get("composer.category.topic_template") || ""));}-}-<TextField- @value={{this.composer.title}}- @id="reply-title"- @maxLength={{this.titleMaxLength}}- @placeholderKey={{this.composer.titlePlaceholder}}- @aria-label={{i18n this.composer.titlePlaceholder}}- @disabled={{this.disabled}}- @autocomplete="off"-/>--<PluginOutlet- @name="after-composer-title-input"- @connectorTagName="div"- @outletArgs={{hash composer=this.composer}}-/>--<PopupInputTip @validation={{this.validation}} />\ No newline at end of file+ <template>+ <TextField+ @value={{this.composer.title}}+ @id="reply-title"+ @maxLength={{this.titleMaxLength}}+ @placeholderKey={{this.composer.titlePlaceholder}}+ @aria-label={{i18n this.composer.titlePlaceholder}}+ @disabled={{this.disabled}}+ @autocomplete="off"+ />++ <PluginOutlet+ @name="after-composer-title-input"+ @connectorTagName="div"+ @outletArgs={{hash composer=this.composer}}+ />++ <PopupInputTip @validation={{this.validation}} />+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/composer-toggles.gjs b/app/assets/javascripts/discourse/app/components/composer-toggles.gjsindex 69e0b46c416..cc77288157f 100644--- a/app/assets/javascripts/discourse/app/components/composer-toggles.gjs+++ b/app/assets/javascripts/discourse/app/components/composer-toggles.gjs@@ -1,5 +1,7 @@import Component from "@ember/component";import { tagName } from "@ember-decorators/component";+import DButton from "discourse/components/d-button";+import PluginOutlet from "discourse/components/plugin-outlet";import discourseComputed from "discourse/lib/decorators";@tagName("")@@ -48,36 +50,38 @@ export default class ComposerToggles extends Component {}return !disableTextarea;}-}-<div class="composer-controls">- <span>- <PluginOutlet @name="before-composer-toggles" @connectorTagName="div" />- </span>+ <template>+ <div class="composer-controls">+ <span>+ <PluginOutlet @name="before-composer-toggles" @connectorTagName="div" />+ </span>- {{#if this.site.mobileView}}- <DButton- @icon="bars"- @action={{this.toggleToolbar}}- @title={{this.toggleToolbarTitle}}- @preventFocus={{true}}- class="btn-flat toggle-toolbar btn-mini-toggle"- />- {{/if}}+ {{#if this.site.mobileView}}+ <DButton+ @icon="bars"+ @action={{this.toggleToolbar}}+ @title={{this.toggleToolbarTitle}}+ @preventFocus={{true}}+ class="btn-flat toggle-toolbar btn-mini-toggle"+ />+ {{/if}}- {{#if this.showFullScreenButton}}- <DButton- @icon={{this.fullscreenIcon}}- @action={{this.toggleFullscreen}}- @title={{this.fullscreenTitle}}- class="btn-transparent toggle-fullscreen btn-mini-toggle"- />- {{/if}}+ {{#if this.showFullScreenButton}}+ <DButton+ @icon={{this.fullscreenIcon}}+ @action={{this.toggleFullscreen}}+ @title={{this.fullscreenTitle}}+ class="btn-transparent toggle-fullscreen btn-mini-toggle"+ />+ {{/if}}- <DButton- @icon={{this.toggleIcon}}- @action={{this.toggleComposer}}- @title={{this.toggleTitle}}- class="btn-transparent toggler toggle-minimize btn-mini-toggle"- />-</div>\ No newline at end of file+ <DButton+ @icon={{this.toggleIcon}}+ @action={{this.toggleComposer}}+ @title={{this.toggleTitle}}+ class="btn-transparent toggler toggle-minimize btn-mini-toggle"+ />+ </div>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/conditional-in-element.gjs b/app/assets/javascripts/discourse/app/components/conditional-in-element.gjsindex 699f907e802..9da6064e6bd 100644--- a/app/assets/javascripts/discourse/app/components/conditional-in-element.gjs+++ b/app/assets/javascripts/discourse/app/components/conditional-in-element.gjs@@ -1,9 +1,12 @@-{{#if @inline}}- {{yield}}-{{else if @element}}- {{#if @append}}- {{#in-element @element insertBefore=null}}{{yield}}{{/in-element}}- {{else}}- {{#in-element @element}}{{yield}}{{/in-element}}+const ConditionalInElement = <template>+ {{#if @inline}}+ {{yield}}+ {{else if @element}}+ {{#if @append}}+ {{#in-element @element insertBefore=null}}{{yield}}{{/in-element}}+ {{else}}+ {{#in-element @element}}{{yield}}{{/in-element}}+ {{/if}}{{/if}}-{{/if}}\ No newline at end of file+</template>;+export default ConditionalInElement;diff --git a/app/assets/javascripts/discourse/app/components/conditional-loading-section.gjs b/app/assets/javascripts/discourse/app/components/conditional-loading-section.gjsindex e5847d11095..f0ec3dc1041 100644--- a/app/assets/javascripts/discourse/app/components/conditional-loading-section.gjs+++ b/app/assets/javascripts/discourse/app/components/conditional-loading-section.gjs@@ -7,11 +7,13 @@ import { i18n } from "discourse-i18n";export default class ConditionalLoadingSection extends Component {isLoading = false;title = i18n("conditional_loading_section.loading");-}-{{#if this.isLoading}}- <span class="title">{{this.title}}</span>- <div class="spinner {{this.size}}"></div>-{{else}}- {{yield}}-{{/if}}\ No newline at end of file+ <template>+ {{#if this.isLoading}}+ <span class="title">{{this.title}}</span>+ <div class="spinner {{this.size}}"></div>+ {{else}}+ {{yield}}+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/copy-button.gjs b/app/assets/javascripts/discourse/app/components/copy-button.gjsindex 265c9bc814a..4d461a9bfe8 100644--- a/app/assets/javascripts/discourse/app/components/copy-button.gjs+++ b/app/assets/javascripts/discourse/app/components/copy-button.gjs@@ -1,6 +1,7 @@import Component from "@ember/component";import { action } from "@ember/object";import { tagName } from "@ember-decorators/component";+import DButton from "discourse/components/d-button";import discourseDebounce from "discourse/lib/debounce";import { bind } from "discourse/lib/decorators";@@ -46,12 +47,14 @@ export default class CopyButton extends Component {discourseDebounce(this._restoreButton, 3000);} catch {}}-}-<DButton- @icon={{this.copyIcon}}- @action={{this.copy}}- class="copy-button {{this.copyClass}}"- @ariaLabel={{this.ariaLabel}}- @translatedLabel={{this.copyTranslatedLabel}}-/>\ No newline at end of file+ <template>+ <DButton+ @icon={{this.copyIcon}}+ @action={{this.copy}}+ class="copy-button {{this.copyClass}}"+ @ariaLabel={{this.ariaLabel}}+ @translatedLabel={{this.copyTranslatedLabel}}+ />+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/create-invite-uploader.gjs b/app/assets/javascripts/discourse/app/components/create-invite-uploader.gjsindex a18e12983eb..1c00c899132 100644--- a/app/assets/javascripts/discourse/app/components/create-invite-uploader.gjs+++ b/app/assets/javascripts/discourse/app/components/create-invite-uploader.gjs@@ -1,4 +1,5 @@import Component from "@ember/component";+import { hash } from "@ember/helper";import { action } from "@ember/object";import { getOwner } from "@ember/owner";import { tagName } from "@ember-decorators/component";@@ -31,16 +32,18 @@ export default class CreateInviteUploader extends Component {startUpload() {this.uppyUpload.startUpload();}-}-{{yield- (hash- data=this.data- uploading=this.uploading- uploadProgress=this.uploadProgress- uploaded=this.uploaded- submitDisabled=this.submitDisabled- startUpload=this.startUpload- )- this.uppyUpload.setup-}}\ No newline at end of file+ <template>+ {{yield+ (hash+ data=this.data+ uploading=this.uploading+ uploadProgress=this.uploadProgress+ uploaded=this.uploaded+ submitDisabled=this.submitDisabled+ startUpload=this.startUpload+ )+ this.uppyUpload.setup+ }}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/create-topic-button.gjs b/app/assets/javascripts/discourse/app/components/create-topic-button.gjsindex 7ff581bca27..df36db80beb 100644--- a/app/assets/javascripts/discourse/app/components/create-topic-button.gjs+++ b/app/assets/javascripts/discourse/app/components/create-topic-button.gjs@@ -1,5 +1,10 @@import Component from "@ember/component";import { tagName } from "@ember-decorators/component";+import DButton from "discourse/components/d-button";+import TopicDraftsDropdown from "discourse/components/topic-drafts-dropdown";+import { i18n } from "discourse-i18n";+import DButtonTooltip from "float-kit/components/d-button-tooltip";+import DTooltip from "float-kit/components/d-tooltip";@tagName("")export default class CreateTopicButton extends Component {@@ -13,28 +18,33 @@ export default class CreateTopicButton extends Component {return "topic.create_disabled_category";}}-}-{{#if this.canCreateTopic}}- <DButtonTooltip>- <:button>- <DButton- @action={{this.action}}- @icon="far-pen-to-square"- @disabled={{this.disabled}}- @label={{this.label}}- id="create-topic"- class={{this.btnClass}}- />- </:button>- <:tooltip>- {{#if @disabled}}- <DTooltip @icon="circle-info" @content={{i18n this.disallowedReason}} />- {{/if}}- </:tooltip>- </DButtonTooltip>+ <template>+ {{#if this.canCreateTopic}}+ <DButtonTooltip>+ <:button>+ <DButton+ @action={{this.action}}+ @icon="far-pen-to-square"+ @disabled={{this.disabled}}+ @label={{this.label}}+ id="create-topic"+ class={{this.btnClass}}+ />+ </:button>+ <:tooltip>+ {{#if @disabled}}+ <DTooltip+ @icon="circle-info"+ @content={{i18n this.disallowedReason}}+ />+ {{/if}}+ </:tooltip>+ </DButtonTooltip>- {{#if @showDrafts}}- <TopicDraftsDropdown @disabled={{this.disabled}} />- {{/if}}-{{/if}}\ No newline at end of file+ {{#if @showDrafts}}+ <TopicDraftsDropdown @disabled={{this.disabled}} />+ {{/if}}+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/d-modal-cancel.gjs b/app/assets/javascripts/discourse/app/components/d-modal-cancel.gjsindex 4fbe23c88d1..17bb09a454f 100644--- a/app/assets/javascripts/discourse/app/components/d-modal-cancel.gjs+++ b/app/assets/javascripts/discourse/app/components/d-modal-cancel.gjs@@ -1,5 +1,11 @@-<DButton- @action={{@close}}- @translatedLabel={{i18n "cancel"}}- class="btn-flat d-modal-cancel"-/>\ No newline at end of file+import DButton from "discourse/components/d-button";+import { i18n } from "discourse-i18n";++const DModalCancel = <template>+ <DButton+ @action={{@close}}+ @translatedLabel={{i18n "cancel"}}+ class="btn-flat d-modal-cancel"+ />+</template>;+export default DModalCancel;diff --git a/app/assets/javascripts/discourse/app/components/d-navigation-item.gjs b/app/assets/javascripts/discourse/app/components/d-navigation-item.gjsindex f9e22564b5e..2fbbdea48b4 100644--- a/app/assets/javascripts/discourse/app/components/d-navigation-item.gjs+++ b/app/assets/javascripts/discourse/app/components/d-navigation-item.gjs@@ -1,4 +1,5 @@import Component from "@glimmer/component";+import { LinkTo } from "@ember/routing";import { service } from "@ember/service";import { makeArray } from "discourse/lib/helpers";@@ -31,21 +32,23 @@ export default class DNavigationItem extends Component {get models() {return makeArray(this.args.models || this.args.model);}-}-<li- aria-current={{this.ariaCurrent}}- title={{@title}}- class={{@class}}- ...attributes->- {{#if this.models}}- <LinkTo @route={{@route}} @models={{this.models}}>- {{yield}}- </LinkTo>- {{else}}- <LinkTo @route={{@route}}>- {{yield}}- </LinkTo>- {{/if}}-</li>\ No newline at end of file+ <template>+ <li+ aria-current={{this.ariaCurrent}}+ title={{@title}}+ class={{@class}}+ ...attributes+ >+ {{#if this.models}}+ <LinkTo @route={{@route}} @models={{this.models}}>+ {{yield}}+ </LinkTo>+ {{else}}+ <LinkTo @route={{@route}}>+ {{yield}}+ </LinkTo>+ {{/if}}+ </li>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/date-input.gjs b/app/assets/javascripts/discourse/app/components/date-input.gjsindex 06dc832556d..29e83f9d60a 100644--- a/app/assets/javascripts/discourse/app/components/date-input.gjs+++ b/app/assets/javascripts/discourse/app/components/date-input.gjs@@ -1,9 +1,10 @@/* global Pikaday:true */-import Component from "@ember/component";+import Component, { Input } from "@ember/component";+import { on } from "@ember/modifier";import { action, computed } from "@ember/object";import { schedule } from "@ember/runloop";import { classNames } from "@ember-decorators/component";-import { on } from "@ember-decorators/object";+import { on as onEvent } from "@ember-decorators/object";import { Promise } from "rsvp";import discourseComputed from "discourse/lib/decorators";import loadScript from "discourse/lib/load-script";@@ -144,7 +145,7 @@ export default class DateInput extends Component {}}- @on("willDestroyElement")+ @onEvent("willDestroyElement")_destroy() {if (this._picker) {this._picker.destroy();@@ -169,17 +170,19 @@ export default class DateInput extends Component {onChangeDate(event) {this._handleSelection(event.target.value);}-}-<Input- @type={{this.inputType}}- class="date-picker"- placeholder={{this.placeholder}}- @value={{readonly this.value}}- id={{this.inputId}}- {{on "input" (action "onChangeDate")}}-/>--{{#unless this.useGlobalPickerContainer}}- <div class="picker-container"></div>-{{/unless}}\ No newline at end of file+ <template>+ <Input+ @type={{this.inputType}}+ class="date-picker"+ placeholder={{this.placeholder}}+ @value={{readonly this.value}}+ id={{this.inputId}}+ {{on "input" this.onChangeDate}}+ />++ {{#unless this.useGlobalPickerContainer}}+ <div class="picker-container"></div>+ {{/unless}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/date-picker.gjs b/app/assets/javascripts/discourse/app/components/date-picker.gjsindex 4af71984ea6..5f527d18b13 100644--- a/app/assets/javascripts/discourse/app/components/date-picker.gjs+++ b/app/assets/javascripts/discourse/app/components/date-picker.gjs@@ -1,5 +1,5 @@/* global Pikaday:true */-import Component from "@ember/component";+import Component, { Input } from "@ember/component";import { computed } from "@ember/object";import { schedule } from "@ember/runloop";import { classNames } from "@ember-decorators/component";@@ -108,13 +108,15 @@ export default class DatePicker extends Component {_opts() {return null;}-}-<Input- @type={{this.inputType}}- class="date-picker"- placeholder={{this.placeholder}}- @value={{this.value}}- autocomplete="off"- ...attributes-/>\ No newline at end of file+ <template>+ <Input+ @type={{this.inputType}}+ class="date-picker"+ placeholder={{this.placeholder}}+ @value={{this.value}}+ autocomplete="off"+ ...attributes+ />+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/date-time-input-range.gjs b/app/assets/javascripts/discourse/app/components/date-time-input-range.gjsindex cab368469b8..8d9c4b4dc72 100644--- a/app/assets/javascripts/discourse/app/components/date-time-input-range.gjs+++ b/app/assets/javascripts/discourse/app/components/date-time-input-range.gjs@@ -1,6 +1,9 @@import Component from "@ember/component";+import { hash } from "@ember/helper";import { action } from "@ember/object";import { classNames } from "@ember-decorators/component";+import DateTimeInput from "discourse/components/date-time-input";+import { i18n } from "discourse-i18n";@classNames("d-date-time-input-range")export default class DateTimeInputRange extends Component {@@ -44,25 +47,27 @@ export default class DateTimeInputRange extends Component {this.onChange(newState);}}-}-<DateTimeInput- @date={{this.from}}- @onChange={{action "onChangeRanges" (hash prop="from")}}- @showTime={{this.showFromTime}}- @placeholder={{i18n "dates.from_placeholder"}}- @timezone={{@timezone}}- class="from"-/>+ <template>+ <DateTimeInput+ @date={{this.from}}+ @onChange={{action "onChangeRanges" (hash prop="from")}}+ @showTime={{this.showFromTime}}+ @placeholder={{i18n "dates.from_placeholder"}}+ @timezone={{@timezone}}+ class="from"+ />-<DateTimeInput- @date={{this.to}}- @relativeDate={{this.from}}- @onChange={{action "onChangeRanges" (hash prop="to")}}- @timeFirst={{this.toTimeFirst}}- @showTime={{this.showToTime}}- @clearable={{this.clearable}}- @placeholder={{i18n "dates.to_placeholder"}}- @timezone={{@timezone}}- class="to"-/>\ No newline at end of file+ <DateTimeInput+ @date={{this.to}}+ @relativeDate={{this.from}}+ @onChange={{action "onChangeRanges" (hash prop="to")}}+ @timeFirst={{this.toTimeFirst}}+ @showTime={{this.showToTime}}+ @clearable={{this.clearable}}+ @placeholder={{i18n "dates.to_placeholder"}}+ @timezone={{@timezone}}+ class="to"+ />+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/date-time-input.gjs b/app/assets/javascripts/discourse/app/components/date-time-input.gjsindex 41e6ff583b2..0d2c44d674e 100644--- a/app/assets/javascripts/discourse/app/components/date-time-input.gjs+++ b/app/assets/javascripts/discourse/app/components/date-time-input.gjs@@ -1,6 +1,9 @@import Component from "@ember/component";import { action, computed } from "@ember/object";import { classNames } from "@ember-decorators/component";+import DButton from "discourse/components/d-button";+import DateInput from "discourse/components/date-input";+import TimeInput from "discourse/components/time-input";@classNames("d-date-time-input")export default class DateTimeInput extends Component {@@ -73,40 +76,42 @@ export default class DateTimeInput extends Component {get resolvedTimezone() {return this.timezone || moment.tz.guess();}-}-{{#unless this.timeFirst}}- <DateInput- @date={{this.date}}- @placeholder={{this.placeholder}}- @relativeDate={{this.relativeDate}}- @onChange={{action "onChangeDate"}}- @useGlobalPickerContainer={{this.useGlobalPickerContainer}}- />-{{/unless}}+ <template>+ {{#unless this.timeFirst}}+ <DateInput+ @date={{this.date}}+ @placeholder={{this.placeholder}}+ @relativeDate={{this.relativeDate}}+ @onChange={{action "onChangeDate"}}+ @useGlobalPickerContainer={{this.useGlobalPickerContainer}}+ />+ {{/unless}}-{{#if this.showTime}}- <TimeInput- @date={{this.date}}- @relativeDate={{this.relativeDate}}- @onChange={{action "onChangeTime"}}- />-{{/if}}+ {{#if this.showTime}}+ <TimeInput+ @date={{this.date}}+ @relativeDate={{this.relativeDate}}+ @onChange={{action "onChangeTime"}}+ />+ {{/if}}-{{#if this.timeFirst}}- <DateInput- @date={{this.date}}- @placeholder={{this.placeholder}}- @relativeDate={{this.relativeDate}}- @onChange={{action "onChangeDate"}}- @useGlobalPickerContainer={{this.useGlobalPickerContainer}}- />-{{/if}}+ {{#if this.timeFirst}}+ <DateInput+ @date={{this.date}}+ @placeholder={{this.placeholder}}+ @relativeDate={{this.relativeDate}}+ @onChange={{action "onChangeDate"}}+ @useGlobalPickerContainer={{this.useGlobalPickerContainer}}+ />+ {{/if}}-{{#if this.clearable}}- <DButton- @icon="xmark"- @action={{this.onClear}}- class="btn-default clear-date-time"- />-{{/if}}\ No newline at end of file+ {{#if this.clearable}}+ <DButton+ @icon="xmark"+ @action={{this.onClear}}+ class="btn-default clear-date-time"+ />+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/dialog-messages/group-delete.gjs b/app/assets/javascripts/discourse/app/components/dialog-messages/group-delete.gjsindex 58532a2c52b..bd51670306c 100644--- a/app/assets/javascripts/discourse/app/components/dialog-messages/group-delete.gjs+++ b/app/assets/javascripts/discourse/app/components/dialog-messages/group-delete.gjs@@ -1,20 +1,26 @@-{{#if @model.user_count}}- <p>- {{d-icon "users"}}- {{i18n "admin.groups.delete_details" [email protected]_count}}- </p>-{{/if}}-{{#if @model.message_count}}+import icon from "discourse/helpers/d-icon";+import { i18n } from "discourse-i18n";++const GroupDelete = <template>+ {{#if @model.user_count}}+ <p>+ {{icon "users"}}+ {{i18n "admin.groups.delete_details" [email protected]_count}}+ </p>+ {{/if}}+ {{#if @model.message_count}}+ <p>+ {{icon "envelope"}}+ {{i18n+ "admin.groups.delete_with_messages_confirm"+ [email protected]_count+ }}+ </p>+ {{/if}}+<p>- {{d-icon "envelope"}}- {{i18n- "admin.groups.delete_with_messages_confirm"- [email protected]_count- }}+ {{icon "triangle-exclamation"}}+ {{i18n "admin.groups.delete_warning"}}</p>-{{/if}}--<p>- {{d-icon "triangle-exclamation"}}- {{i18n "admin.groups.delete_warning"}}-</p>\ No newline at end of file+</template>;+export default GroupDelete;diff --git a/app/assets/javascripts/discourse/app/components/dialog-messages/second-factor-confirm-phrase.gjs b/app/assets/javascripts/discourse/app/components/dialog-messages/second-factor-confirm-phrase.gjsindex a5fe44b831c..b9a69863788 100644--- a/app/assets/javascripts/discourse/app/components/dialog-messages/second-factor-confirm-phrase.gjs+++ b/app/assets/javascripts/discourse/app/components/dialog-messages/second-factor-confirm-phrase.gjs@@ -1,7 +1,10 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { on } from "@ember/modifier";import { action } from "@ember/object";import { service } from "@ember/service";+import { htmlSafe } from "@ember/template";+import TextField from "discourse/components/text-field";import { i18n } from "discourse-i18n";export default class SecondFactorConfirmPhrase extends Component {@@ -19,37 +22,39 @@ export default class SecondFactorConfirmPhrase extends Component {this.dialog.set("confirmButtonDisabled", true);}}-}-{{i18n "user.second_factor.delete_confirm_header"}}--<ul>- {{#each @model.totps as |totp|}}- <li>{{totp.name}}</li>- {{/each}}-- {{#each @model.security_keys as |sk|}}- <li>{{sk.name}}</li>- {{/each}}-- {{#if this.currentUser.second_factor_backup_enabled}}- <li>{{i18n "user.second_factor_backup.title"}}</li>- {{/if}}-</ul>--<p>- {{html-safe- (i18n- "user.second_factor.delete_confirm_instruction"- confirm=this.disabledString- )- }}-</p>--<TextField- @value={{this.confirmPhraseInput}}- {{on "input" this.onConfirmPhraseInput}}- @id="confirm-phrase"- @autocorrect="off"- @autocapitalize="off"-/>\ No newline at end of file+ <template>+ {{i18n "user.second_factor.delete_confirm_header"}}++ <ul>+ {{#each @model.totps as |totp|}}+ <li>{{totp.name}}</li>+ {{/each}}++ {{#each @model.security_keys as |sk|}}+ <li>{{sk.name}}</li>+ {{/each}}++ {{#if this.currentUser.second_factor_backup_enabled}}+ <li>{{i18n "user.second_factor_backup.title"}}</li>+ {{/if}}+ </ul>++ <p>+ {{htmlSafe+ (i18n+ "user.second_factor.delete_confirm_instruction"+ confirm=this.disabledString+ )+ }}+ </p>++ <TextField+ @value={{this.confirmPhraseInput}}+ {{on "input" this.onConfirmPhraseInput}}+ @id="confirm-phrase"+ @autocorrect="off"+ @autocapitalize="off"+ />+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/directory-item.gjs b/app/assets/javascripts/discourse/app/components/directory-item.gjsindex e782ec792e9..5684f1d2c7c 100644--- a/app/assets/javascripts/discourse/app/components/directory-item.gjs+++ b/app/assets/javascripts/discourse/app/components/directory-item.gjs@@ -5,7 +5,15 @@ import {classNames,tagName,} from "@ember-decorators/component";+import DirectoryItemUserFieldValue from "discourse/components/directory-item-user-field-value";+import UserInfo from "discourse/components/user-info";+import icon from "discourse/helpers/d-icon";+import directoryColumnIsUserField from "discourse/helpers/directory-column-is-user-field";+import directoryItemLabel from "discourse/helpers/directory-item-label";+import directoryItemValue from "discourse/helpers/directory-item-value";+import formatDuration from "discourse/helpers/format-duration";import { propertyEqual } from "discourse/lib/computed";+import { i18n } from "discourse-i18n";@tagName("div")@classNames("directory-table__row")@@ -16,43 +24,45 @@ export default class DirectoryItem extends Component {@propertyEqual("item.user.id", "currentUser.id") me;columns = null;-}--<div class="directory-table__cell" role="rowheader">- <UserInfo @user={{this.item.user}} />-</div>-{{#each this.columns as |column|}}- {{#if (directory-column-is-user-field column=column)}}- <div class="directory-table__cell--user-field" role="cell">- <span class="directory-table__label">- <span>{{column.name}}</span>- </span>- {{directory-item-user-field-value item=this.item column=column}}- </div>- {{else}}- <div class="directory-table__cell" role="cell">- <span class="directory-table__label">- <span>- {{#if column.icon}}- {{d-icon column.icon}}- {{/if}}- {{directory-item-label item=this.item column=column}}- </span>- </span>- {{directory-item-value item=this.item column=column}}+ <template>+ <div class="directory-table__cell" role="rowheader">+ <UserInfo @user={{this.item.user}} /></div>- {{/if}}-{{/each}}+ {{#each this.columns as |column|}}+ {{#if (directoryColumnIsUserField column=column)}}+ <div class="directory-table__cell--user-field" role="cell">+ <span class="directory-table__label">+ <span>{{column.name}}</span>+ </span>+ <DirectoryItemUserFieldValue @item={{this.item}} @column={{column}} />+ </div>+ {{else}}+ <div class="directory-table__cell" role="cell">+ <span class="directory-table__label">+ <span>+ {{#if column.icon}}+ {{icon column.icon}}+ {{/if}}+ {{directoryItemLabel item=this.item column=column}}+ </span>+ </span>+ {{directoryItemValue item=this.item column=column}}+ </div>+ {{/if}}-{{#if this.showTimeRead}}- <div class="directory-table__cell time-read" role="cell">- <span class="directory-table__label">- <span>{{i18n "directory.time_read"}}</span>- </span>- <span class="directory-table__value">- {{format-duration this.item.time_read}}- </span>- </div>-{{/if}}\ No newline at end of file+ {{/each}}++ {{#if this.showTimeRead}}+ <div class="directory-table__cell time-read" role="cell">+ <span class="directory-table__label">+ <span>{{i18n "directory.time_read"}}</span>+ </span>+ <span class="directory-table__value">+ {{formatDuration this.item.time_read}}+ </span>+ </div>+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/discourse-linked-text.gjs b/app/assets/javascripts/discourse/app/components/discourse-linked-text.gjsindex ac8b92cfdec..5852a39dc96 100644--- a/app/assets/javascripts/discourse/app/components/discourse-linked-text.gjs+++ b/app/assets/javascripts/discourse/app/components/discourse-linked-text.gjs@@ -1,4 +1,5 @@import Component from "@ember/component";+import { htmlSafe } from "@ember/template";import { tagName } from "@ember-decorators/component";import discourseComputed from "discourse/lib/decorators";import { i18n } from "discourse-i18n";@@ -19,6 +20,6 @@ export default class DiscourseLinkedText extends Component {return false;}-}-{{html-safe this.translatedText}}\ No newline at end of file+ <template>{{htmlSafe this.translatedText}}</template>+}diff --git a/app/assets/javascripts/discourse/app/components/discourse-tag-bound.gjs b/app/assets/javascripts/discourse/app/components/discourse-tag-bound.gjsindex 3527fb226b3..c385874c597 100644--- a/app/assets/javascripts/discourse/app/components/discourse-tag-bound.gjs+++ b/app/assets/javascripts/discourse/app/components/discourse-tag-bound.gjs@@ -20,6 +20,6 @@ export default class DiscourseTagBound extends Component {href(tagRecordId) {return getURL("/tag/" + tagRecordId);}-}-{{this.tagRecord.id}}\ No newline at end of file+ <template>{{this.tagRecord.id}}</template>+}diff --git a/app/assets/javascripts/discourse/app/components/discovery/filter-navigation.gjs b/app/assets/javascripts/discourse/app/components/discovery/filter-navigation.gjsindex 134193d0df4..d9980603b52 100644--- a/app/assets/javascripts/discourse/app/components/discovery/filter-navigation.gjs+++ b/app/assets/javascripts/discourse/app/components/discovery/filter-navigation.gjs@@ -1,7 +1,15 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { Input } from "@ember/component";+import { hash } from "@ember/helper";import { action } from "@ember/object";import { service } from "@ember/service";+import { and } from "truth-helpers";+import BulkSelectToggle from "discourse/components/bulk-select-toggle";+import DButton from "discourse/components/d-button";+import PluginOutlet from "discourse/components/plugin-outlet";+import bodyClass from "discourse/helpers/body-class";+import icon from "discourse/helpers/d-icon";import discourseDebounce from "discourse/lib/debounce";import { bind } from "discourse/lib/decorators";import { resettableTracked } from "discourse/lib/tracked-tools";@@ -42,54 +50,56 @@ export default class DiscoveryFilterNavigation extends Component {this.copyIcon = "link";this.copyClass = "btn-default";}-}--{{body-class "navigation-filter"}}-<section class="navigation-container">- <div class="topic-query-filter">- {{#if (and this.site.mobileView @canBulkSelect)}}- <div class="topic-query-filter__bulk-action-btn">- <BulkSelectToggle @bulkSelectHelper={{@bulkSelectHelper}} />- </div>- {{/if}}+ <template>+ {{bodyClass "navigation-filter"}}- <div class="topic-query-filter__input">- {{d-icon "filter" class="topic-query-filter__icon"}}- <Input- class="topic-query-filter__filter-term"- @value={{this.newQueryString}}- @enter={{action @updateTopicsListQueryParams this.newQueryString}}- @type="text"- id="queryStringInput"- autocomplete="off"- />- {{! EXPERIMENTAL OUTLET - don't use because it will be removed soon }}- <PluginOutlet- @name="below-filter-input"- @outletArgs={{hash- updateQueryString=this.updateQueryString- newQueryString=this.newQueryString- }}- />- </div>- {{#if this.newQueryString}}- <div class="topic-query-filter__controls">- <DButton- @icon="xmark"- @action={{this.clearInput}}- @disabled={{unless this.newQueryString "true"}}- />+ <section class="navigation-container">+ <div class="topic-query-filter">+ {{#if (and this.site.mobileView @canBulkSelect)}}+ <div class="topic-query-filter__bulk-action-btn">+ <BulkSelectToggle @bulkSelectHelper={{@bulkSelectHelper}} />+ </div>+ {{/if}}- {{#if this.discoveryFilter.q}}- <DButton- @icon={{this.copyIcon}}- @action={{this.copyQueryString}}- @disabled={{unless this.newQueryString "true"}}- class={{this.copyClass}}+ <div class="topic-query-filter__input">+ {{icon "filter" class="topic-query-filter__icon"}}+ <Input+ class="topic-query-filter__filter-term"+ @value={{this.newQueryString}}+ @enter={{action @updateTopicsListQueryParams this.newQueryString}}+ @type="text"+ id="queryStringInput"+ autocomplete="off"/>+ {{! EXPERIMENTAL OUTLET - don't use because it will be removed soon }}+ <PluginOutlet+ @name="below-filter-input"+ @outletArgs={{hash+ updateQueryString=this.updateQueryString+ newQueryString=this.newQueryString+ }}+ />+ </div>+ {{#if this.newQueryString}}+ <div class="topic-query-filter__controls">+ <DButton+ @icon="xmark"+ @action={{this.clearInput}}+ @disabled={{unless this.newQueryString "true"}}+ />++ {{#if this.discoveryFilter.q}}+ <DButton+ @icon={{this.copyIcon}}+ @action={{this.copyQueryString}}+ @disabled={{unless this.newQueryString "true"}}+ class={{this.copyClass}}+ />+ {{/if}}+ </div>{{/if}}</div>- {{/if}}- </div>-</section>\ No newline at end of file+ </section>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/discovery/layout.gjs b/app/assets/javascripts/discourse/app/components/discovery/layout.gjsindex d48ab8294c8..4863401a062 100644--- a/app/assets/javascripts/discourse/app/components/discovery/layout.gjs+++ b/app/assets/javascripts/discourse/app/components/discovery/layout.gjs@@ -1,82 +1,90 @@-<div class="container">- <DiscourseBanner />- {{#if @model.category}}- <CategoryReadOnlyBanner- @category={{@model.category}}- @readOnly={{@createTopicDisabled}}+import { hash } from "@ember/helper";+import CategoryReadOnlyBanner from "discourse/components/category-read-only-banner";+import DiscourseBanner from "discourse/components/discourse-banner";+import PluginOutlet from "discourse/components/plugin-outlet";++const Layout = <template>+ <div class="container">+ <DiscourseBanner />+ {{#if @model.category}}+ <CategoryReadOnlyBanner+ @category={{@model.category}}+ @readOnly={{@createTopicDisabled}}+ />+ {{/if}}+ </div>++ <span>+ <PluginOutlet+ @name="discovery-list-controls-above"+ @connectorTagName="div"+ @outletArgs={{hash [email protected] [email protected]}}/>- {{/if}}-</div>+ </span>-<span>- <PluginOutlet- @name="discovery-list-controls-above"- @connectorTagName="div"- @outletArgs={{hash [email protected] [email protected]}}- />-</span>+ <div class="list-controls">+ <PluginOutlet+ @name="discovery-navigation-bar-above"+ @connectorTagName="div"+ @outletArgs={{hash [email protected] [email protected]}}+ />+ <div class="container">+ {{yield to="navigation"}}+ </div>+ </div>-<div class="list-controls"><PluginOutlet- @name="discovery-navigation-bar-above"+ @name="discovery-above"@connectorTagName="div"@outletArgs={{hash [email protected] [email protected]}}/>- <div class="container">- {{yield to="navigation"}}- </div>-</div>-<PluginOutlet- @name="discovery-above"- @connectorTagName="div"- @outletArgs={{hash [email protected] [email protected]}}-/>--<div class="container list-container">- <div class="row">- <div class="full-width">- <div id="header-list-area">- {{yield to="header"}}- <PluginOutlet- @name="header-list-container-bottom"- @outletArgs={{hash [email protected] [email protected]}}- />+ <div class="container list-container">+ <div class="row">+ <div class="full-width">+ <div id="header-list-area">+ {{yield to="header"}}+ <PluginOutlet+ @name="header-list-container-bottom"+ @outletArgs={{hash [email protected] [email protected]}}+ />+ </div></div></div>- </div>- <div class="row">- <div class="full-width">- <PluginOutlet- @name="before-list-area"- @outletArgs={{hash [email protected] [email protected]}}- />- <div id="list-area">+ <div class="row">+ <div class="full-width"><PluginOutlet- @name="discovery-list-area"- @outletArgs={{hash- model=@model- }}- @defaultGlimmer={{true}}- >+ @name="before-list-area"+ @outletArgs={{hash [email protected] [email protected]}}+ />+ <div id="list-area"><PluginOutlet- @name="discovery-list-container-top"- @connectorTagName="span"- @outletArgs={{hash [email protected] [email protected]}}- />- {{yield to="list"}}- </PluginOutlet>+ @name="discovery-list-area"+ @outletArgs={{hash+ model=@model+ }}+ @defaultGlimmer={{true}}+ >+ <PluginOutlet+ @name="discovery-list-container-top"+ @connectorTagName="span"+ @outletArgs={{hash [email protected] [email protected]}}+ />+ {{yield to="list"}}+ </PluginOutlet>+ </div></div></div></div>-</div>-<span>- <PluginOutlet- @name="discovery-below"- @connectorTagName="div"- @outletArgs={{hash [email protected] [email protected]}}- />-</span>\ No newline at end of file+ <span>+ <PluginOutlet+ @name="discovery-below"+ @connectorTagName="div"+ @outletArgs={{hash [email protected] [email protected]}}+ />+ </span>+</template>;+export default Layout;diff --git a/app/assets/javascripts/discourse/app/components/discovery/navigation.gjs b/app/assets/javascripts/discourse/app/components/discovery/navigation.gjsindex 02c5939c49d..c6391df7e03 100644--- a/app/assets/javascripts/discourse/app/components/discovery/navigation.gjs+++ b/app/assets/javascripts/discourse/app/components/discovery/navigation.gjs@@ -1,7 +1,15 @@import Component from "@glimmer/component";+import { array, hash } from "@ember/helper";import { action } from "@ember/object";import { service } from "@ember/service";+import AddCategoryTagClasses from "discourse/components/add-category-tag-classes";+import CategoryLogo from "discourse/components/category-logo";+import DNavigation from "discourse/components/d-navigation";import ReorderCategories from "discourse/components/modal/reorder-categories";+import PluginOutlet from "discourse/components/plugin-outlet";+import bodyClass from "discourse/helpers/body-class";+import concatClass from "discourse/helpers/concat-class";+import dirSpan from "discourse/helpers/dir-span";import { calculateFilterMode } from "discourse/lib/filter-mode";import { TRACKED_QUERY_PARAM_VALUE } from "discourse/lib/topic-list-tracked-filter";import DiscourseURL from "discourse/lib/url";@@ -59,85 +67,87 @@ export default class DiscoveryNavigation extends Component {reorderCategories() {this.modal.show(ReorderCategories);}-}-<AddCategoryTagClasses- @category={{@category}}- @tags={{if @tag (array @tag.id)}}-/>--{{#if @category}}- <PluginOutlet- @name="above-category-heading"- @outletArgs={{hash category=@category tag=@tag}}- />-- <section class="category-heading">- {{#if @category.uploaded_logo.url}}- <CategoryLogo @category={{@category}} />- {{#if @category.description}}- <p>{{dir-span @category.description htmlSafe="true"}}</p>- {{/if}}- {{/if}}+ <template>+ <AddCategoryTagClasses+ @category={{@category}}+ @tags={{if @tag (array @tag.id)}}+ />- <span>+ {{#if @category}}<PluginOutlet- @name="category-heading"- @connectorTagName="div"+ @name="above-category-heading"@outletArgs={{hash category=@category tag=@tag}}/>- </span>- </section>-{{/if}}--{{body-class this.bodyClass}}--<section- class={{concat-class- "navigation-container"- (if @category "category-navigation")- }}->- <DNavigation- @category={{@category}}- @tag={{@tag}}- @additionalTags={{@additionalTags}}- @filterMode={{this.filterMode}}- @noSubcategories={{@noSubcategories}}- @canCreateTopic={{this.canCreateTopic}}- @canCreateTopicOnTag={{@canCreateTopicOnTag}}- @createTopic={{@createTopic}}- @createTopicDisabled={{@createTopicDisabled}}- @draftCount={{this.currentUser.draft_count}}- @editCategory={{this.editCategory}}- @showCategoryAdmin={{@showCategoryAdmin}}- @createCategory={{this.createCategory}}- @reorderCategories={{this.reorderCategories}}- @canBulkSelect={{@canBulkSelect}}- @bulkSelectHelper={{@bulkSelectHelper}}- @skipCategoriesNavItem={{this.skipCategoriesNavItem}}- @toggleInfo={{@toggleTagInfo}}- @tagNotification={{@tagNotification}}- @model={{@model}}- @showDismissRead={{@showDismissRead}}- @showResetNew={{@showResetNew}}- @dismissRead={{@dismissRead}}- @resetNew={{@resetNew}}- />-- {{#if @category}}- <PluginOutlet- @name="category-navigation"- @connectorTagName="div"- @outletArgs={{hash category=@category tag=@tag}}- />- {{/if}}- {{#if @tag}}- <PluginOutlet- @name="tag-navigation"- @connectorTagName="div"- @outletArgs={{hash category=@category tag=@tag}}- />- {{/if}}-</section>\ No newline at end of file+ <section class="category-heading">+ {{#if @category.uploaded_logo.url}}+ <CategoryLogo @category={{@category}} />+ {{#if @category.description}}+ <p>{{dirSpan @category.description htmlSafe="true"}}</p>+ {{/if}}+ {{/if}}++ <span>+ <PluginOutlet+ @name="category-heading"+ @connectorTagName="div"+ @outletArgs={{hash category=@category tag=@tag}}+ />+ </span>+ </section>+ {{/if}}++ {{bodyClass this.bodyClass}}++ <section+ class={{concatClass+ "navigation-container"+ (if @category "category-navigation")+ }}+ >+ <DNavigation+ @category={{@category}}+ @tag={{@tag}}+ @additionalTags={{@additionalTags}}+ @filterMode={{this.filterMode}}+ @noSubcategories={{@noSubcategories}}+ @canCreateTopic={{this.canCreateTopic}}+ @canCreateTopicOnTag={{@canCreateTopicOnTag}}+ @createTopic={{@createTopic}}+ @createTopicDisabled={{@createTopicDisabled}}+ @draftCount={{this.currentUser.draft_count}}+ @editCategory={{this.editCategory}}+ @showCategoryAdmin={{@showCategoryAdmin}}+ @createCategory={{this.createCategory}}+ @reorderCategories={{this.reorderCategories}}+ @canBulkSelect={{@canBulkSelect}}+ @bulkSelectHelper={{@bulkSelectHelper}}+ @skipCategoriesNavItem={{this.skipCategoriesNavItem}}+ @toggleInfo={{@toggleTagInfo}}+ @tagNotification={{@tagNotification}}+ @model={{@model}}+ @showDismissRead={{@showDismissRead}}+ @showResetNew={{@showResetNew}}+ @dismissRead={{@dismissRead}}+ @resetNew={{@resetNew}}+ />++ {{#if @category}}+ <PluginOutlet+ @name="category-navigation"+ @connectorTagName="div"+ @outletArgs={{hash category=@category tag=@tag}}+ />+ {{/if}}++ {{#if @tag}}+ <PluginOutlet+ @name="tag-navigation"+ @connectorTagName="div"+ @outletArgs={{hash category=@category tag=@tag}}+ />+ {{/if}}+ </section>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/edit-category-images.gjs b/app/assets/javascripts/discourse/app/components/edit-category-images.gjsindex 4c7e01d60fa..ec739d79a87 100644--- a/app/assets/javascripts/discourse/app/components/edit-category-images.gjs+++ b/app/assets/javascripts/discourse/app/components/edit-category-images.gjs@@ -1,6 +1,8 @@import EmberObject, { action } from "@ember/object";import { buildCategoryPanel } from "discourse/components/edit-category-panel";+import UppyImageUploader from "discourse/components/uppy-image-uploader";import discourseComputed from "discourse/lib/decorators";+import { i18n } from "discourse-i18n";export default class EditCategoryImages extends buildCategoryPanel("images") {@discourseComputed("category.uploaded_background.url")@@ -82,56 +84,58 @@ export default class EditCategoryImages extends buildCategoryPanel("images") {}));}-}-<section class="field category-logo">- <label>{{i18n "category.logo"}}</label>- <UppyImageUploader- @imageUrl={{this.logoImageUrl}}- @onUploadDone={{action "logoUploadDone"}}- @onUploadDeleted={{action "logoUploadDeleted"}}- @type="category_logo"- @id="category-logo-uploader"- class="no-repeat contain-image"- />- <div class="category-logo-description">- {{i18n "category.logo_description"}}- </div>-</section>--<section class="field category-logo">- <label>{{i18n "category.logo_dark"}}</label>- <UppyImageUploader- @imageUrl={{this.logoImageDarkUrl}}- @onUploadDone={{action "logoDarkUploadDone"}}- @onUploadDeleted={{action "logoDarkUploadDeleted"}}- @type="category_logo_dark"- @id="category-dark-logo-uploader"- class="no-repeat contain-image"- />- <div class="category-logo-description">- {{i18n "category.logo_description"}}- </div>-</section>--<section class="field category-background-image">- <label>{{i18n "category.background_image"}}</label>- <UppyImageUploader- @imageUrl={{this.backgroundImageUrl}}- @onUploadDone={{action "backgroundUploadDone"}}- @onUploadDeleted={{action "backgroundUploadDeleted"}}- @type="category_background"- @id="category-background-uploader"- />-</section>--<section class="field category-background-image">- <label>{{i18n "category.background_image_dark"}}</label>- <UppyImageUploader- @imageUrl={{this.backgroundDarkImageUrl}}- @onUploadDone={{action "backgroundDarkUploadDone"}}- @onUploadDeleted={{action "backgroundDarkUploadDeleted"}}- @type="category_background_dark"- @id="category-dark-background-uploader"- />-</section>\ No newline at end of file+ <template>+ <section class="field category-logo">+ <label>{{i18n "category.logo"}}</label>+ <UppyImageUploader+ @imageUrl={{this.logoImageUrl}}+ @onUploadDone={{action "logoUploadDone"}}+ @onUploadDeleted={{action "logoUploadDeleted"}}+ @type="category_logo"+ @id="category-logo-uploader"+ class="no-repeat contain-image"+ />+ <div class="category-logo-description">+ {{i18n "category.logo_description"}}+ </div>+ </section>++ <section class="field category-logo">+ <label>{{i18n "category.logo_dark"}}</label>+ <UppyImageUploader+ @imageUrl={{this.logoImageDarkUrl}}+ @onUploadDone={{action "logoDarkUploadDone"}}+ @onUploadDeleted={{action "logoDarkUploadDeleted"}}+ @type="category_logo_dark"+ @id="category-dark-logo-uploader"+ class="no-repeat contain-image"+ />+ <div class="category-logo-description">+ {{i18n "category.logo_description"}}+ </div>+ </section>++ <section class="field category-background-image">+ <label>{{i18n "category.background_image"}}</label>+ <UppyImageUploader+ @imageUrl={{this.backgroundImageUrl}}+ @onUploadDone={{action "backgroundUploadDone"}}+ @onUploadDeleted={{action "backgroundUploadDeleted"}}+ @type="category_background"+ @id="category-background-uploader"+ />+ </section>++ <section class="field category-background-image">+ <label>{{i18n "category.background_image_dark"}}</label>+ <UppyImageUploader+ @imageUrl={{this.backgroundDarkImageUrl}}+ @onUploadDone={{action "backgroundDarkUploadDone"}}+ @onUploadDeleted={{action "backgroundDarkUploadDeleted"}}+ @type="category_background_dark"+ @id="category-dark-background-uploader"+ />+ </section>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/edit-category-tab.gjs b/app/assets/javascripts/discourse/app/components/edit-category-tab.gjsindex 4a6a4f13bd6..a2dbaf2df49 100644--- a/app/assets/javascripts/discourse/app/components/edit-category-tab.gjs+++ b/app/assets/javascripts/discourse/app/components/edit-category-tab.gjs@@ -1,4 +1,5 @@import Component from "@ember/component";+import { on } from "@ember/modifier";import { action } from "@ember/object";import { empty } from "@ember/object/computed";import { scheduleOnce } from "@ember/runloop";@@ -58,10 +59,12 @@ export default class EditCategoryTab extends Component {DiscourseURL.routeTo(this.fullSlug);}}-}-<a- href- {{on "click" this.select}}- class={{if this.active "active"}}->{{this.title}}</a>\ No newline at end of file+ <template>+ <a+ href+ {{on "click" this.select}}+ class={{if this.active "active"}}+ >{{this.title}}</a>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/featured-topic.gjs b/app/assets/javascripts/discourse/app/components/featured-topic.gjsindex a74e10162ea..0c864a14e8a 100644--- a/app/assets/javascripts/discourse/app/components/featured-topic.gjs+++ b/app/assets/javascripts/discourse/app/components/featured-topic.gjs@@ -1,9 +1,13 @@import Component from "@ember/component";+import { htmlSafe } from "@ember/template";import {attributeBindings,classNameBindings,} from "@ember-decorators/component";import $ from "jquery";+import TopicPostBadges from "discourse/components/topic-post-badges";+import formatAge from "discourse/helpers/format-age";+import raw from "discourse/helpers/raw";@classNameBindings(":featured-topic")@attributeBindings("topic.id:data-topic-id")@@ -17,18 +21,20 @@ export default class FeaturedTopic extends Component {return false;}}-}-{{raw "topic-status" topic=this.topic}}-<a href={{this.topic.lastUnreadUrl}} class="title">{{html-safe- this.topic.fancyTitle- }}</a>-<TopicPostBadges- @unreadPosts={{this.topic.unread_posts}}- @unseen={{this.topic.unseen}}- @url={{this.topic.lastUnreadUrl}}-/>+ <template>+ {{raw "topic-status" topic=this.topic}}+ <a href={{this.topic.lastUnreadUrl}} class="title">{{htmlSafe+ this.topic.fancyTitle+ }}</a>+ <TopicPostBadges+ @unreadPosts={{this.topic.unread_posts}}+ @unseen={{this.topic.unseen}}+ @url={{this.topic.lastUnreadUrl}}+ />-<a href={{this.topic.lastPostUrl}} class="last-posted-at">{{format-age- this.topic.last_posted_at- }}</a>\ No newline at end of file+ <a href={{this.topic.lastPostUrl}} class="last-posted-at">{{formatAge+ this.topic.last_posted_at+ }}</a>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/flag-action-type.gjs b/app/assets/javascripts/discourse/app/components/flag-action-type.gjsindex a928fddd609..b6797170b03 100644--- a/app/assets/javascripts/discourse/app/components/flag-action-type.gjs+++ b/app/assets/javascripts/discourse/app/components/flag-action-type.gjs@@ -1,6 +1,10 @@-import Component from "@ember/component";+import Component, { Input, Textarea } from "@ember/component";+import { fn } from "@ember/helper";+import { on } from "@ember/modifier";import { and, equal } from "@ember/object/computed";+import { htmlSafe } from "@ember/template";import { tagName } from "@ember-decorators/component";+import concatClass from "discourse/helpers/concat-class";import discourseComputed from "discourse/lib/decorators";import { MAX_MESSAGE_LENGTH } from "discourse/models/post-action-type";import { i18n } from "discourse-i18n";@@ -65,88 +69,94 @@ export default class FlagActionType extends Component {});}}-}--<div class={{this.wrapperClassNames}}>- {{#if this.isNotifyUser}}- <h3>{{this.formattedName}}</h3>- <div class="controls">- <label class="radio checkbox-label">- <input- id="radio_{{this.flag.name_key}}"- {{on "click" (fn this.changePostActionType this.flag)}}- type="radio"- name="post_action_type_index"- />- <div class="flag-action-type-details">- <span class="description">{{html-safe this.flag.description}}</span>- {{#if this.showMessageInput}}- <Textarea- name="message"- class="flag-message"- placeholder={{this.customPlaceholder}}- aria-label={{i18n "flagging.notify_user_textarea_label"}}- @value={{this.message}}+ <template>+ <div class={{this.wrapperClassNames}}>+ {{#if this.isNotifyUser}}+ <h3>{{this.formattedName}}</h3>+ <div class="controls">+ <label class="radio checkbox-label">+ <input+ id="radio_{{this.flag.name_key}}"+ {{on "click" (fn this.changePostActionType this.flag)}}+ type="radio"+ name="post_action_type_index"/>- <div- class={{concat-class- "custom-message-length"- this.customMessageLengthClasses- }}- >- {{this.customMessageLength}}++ <div class="flag-action-type-details">+ <span class="description">{{htmlSafe+ this.flag.description+ }}</span>+ {{#if this.showMessageInput}}+ <Textarea+ name="message"+ class="flag-message"+ placeholder={{this.customPlaceholder}}+ aria-label={{i18n "flagging.notify_user_textarea_label"}}+ @value={{this.message}}+ />+ <div+ class={{concatClass+ "custom-message-length"+ this.customMessageLengthClasses+ }}+ >+ {{this.customMessageLength}}+ </div>+ {{/if}}</div>- {{/if}}+ </label></div>- </label>- </div>- {{#if this.staffFlagsAvailable}}- <hr />- <h3>{{i18n "flagging.notify_staff"}}</h3>- {{/if}}- {{else}}- <div class="controls {{this.flag.name_key}}">- <label class="radio checkbox-label">- <input- id="radio_{{this.flag.name_key}}"- {{on "click" (fn this.changePostActionType this.flag)}}- checked={{this.selected}}- type="radio"- name="post_action_type_index"- />- <div class="flag-action-type-details">- <strong>{{this.formattedName}}</strong>- <div class="description">{{html-safe this.description}}</div>- {{#if this.showMessageInput}}- <Textarea- name="message"- class="flag-message"- placeholder={{this.customPlaceholder}}- aria-label={{i18n "flagging.notify_moderators_textarea_label"}}- @value={{this.message}}+ {{#if this.staffFlagsAvailable}}+ <hr />+ <h3>{{i18n "flagging.notify_staff"}}</h3>+ {{/if}}+ {{else}}+ <div class="controls {{this.flag.name_key}}">+ <label class="radio checkbox-label">+ <input+ id="radio_{{this.flag.name_key}}"+ {{on "click" (fn this.changePostActionType this.flag)}}+ checked={{this.selected}}+ type="radio"+ name="post_action_type_index"/>- <div- class={{concat-class- "custom-message-length"- this.customMessageLengthClasses- }}- >- {{this.customMessageLength}}+ <div class="flag-action-type-details">+ <strong>{{this.formattedName}}</strong>+ <div class="description">{{htmlSafe this.description}}</div>+ {{#if this.showMessageInput}}+ <Textarea+ name="message"+ class="flag-message"+ placeholder={{this.customPlaceholder}}+ aria-label={{i18n+ "flagging.notify_moderators_textarea_label"+ }}+ @value={{this.message}}+ />+ <div+ class={{concatClass+ "custom-message-length"+ this.customMessageLengthClasses+ }}+ >+ {{this.customMessageLength}}+ </div>+ {{/if}}</div>+ </label>+ {{#if this.showConfirmation}}+ <label class="checkbox-label flag-confirmation">+ <Input+ name="confirmation"+ @type="checkbox"+ @checked={{this.isConfirmed}}+ />+ <span>{{i18n "flagging.confirmation_illegal"}}</span>+ </label>{{/if}}</div>- </label>- {{#if this.showConfirmation}}- <label class="checkbox-label flag-confirmation">- <Input- name="confirmation"- @type="checkbox"- @checked={{this.isConfirmed}}- />- <span>{{i18n "flagging.confirmation_illegal"}}</span>- </label>{{/if}}</div>- {{/if}}-</div>\ No newline at end of file+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/flag-selection.gjs b/app/assets/javascripts/discourse/app/components/flag-selection.gjsindex b588ead6c82..12d2d96d8e6 100644--- a/app/assets/javascripts/discourse/app/components/flag-selection.gjs+++ b/app/assets/javascripts/discourse/app/components/flag-selection.gjs@@ -1,6 +1,7 @@import Component from "@ember/component";import { next } from "@ember/runloop";import { observes } from "@ember-decorators/object";+import { i18n } from "discourse-i18n";// Mostly hacks because `flag.hbs` didn't use `radio-button`export default class FlagSelection extends Component {@@ -22,10 +23,12 @@ export default class FlagSelection extends Component {selectedChanged() {next(this, this._selectRadio);}-}-{{#each this.flags as |f|}}- {{yield f}}-{{else}}- {{i18n "flagging.cant"}}-{{/each}}\ No newline at end of file+ <template>+ {{#each this.flags as |f|}}+ {{yield f}}+ {{else}}+ {{i18n "flagging.cant"}}+ {{/each}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/flat-button.gjs b/app/assets/javascripts/discourse/app/components/flat-button.gjsindex 8a7f82058a4..43d69536050 100644--- a/app/assets/javascripts/discourse/app/components/flat-button.gjs+++ b/app/assets/javascripts/discourse/app/components/flat-button.gjs@@ -4,6 +4,7 @@ import {classNames,tagName,} from "@ember-decorators/component";+import icon from "discourse/helpers/d-icon";import discourseComputed from "discourse/lib/decorators";import { i18n } from "discourse-i18n";@@ -31,6 +32,6 @@ export default class FlatButton extends Component {this.action?.();return false;}-}-{{d-icon this.icon}}\ No newline at end of file+ <template>{{icon this.icon}}</template>+}diff --git a/app/assets/javascripts/discourse/app/components/footer-message.gjs b/app/assets/javascripts/discourse/app/components/footer-message.gjsindex 2c3bd00098a..64858a073a8 100644--- a/app/assets/javascripts/discourse/app/components/footer-message.gjs+++ b/app/assets/javascripts/discourse/app/components/footer-message.gjs@@ -1,15 +1,18 @@import Component from "@ember/component";+import { htmlSafe } from "@ember/template";import { classNames } from "@ember-decorators/component";@classNames("footer-message")-export default class FooterMessage extends Component {}--<h3>- {{this.message}}- {{yield}}-</h3>-{{#if this.education}}- <div class="education">- {{html-safe this.education}}- </div>-{{/if}}\ No newline at end of file+export default class FooterMessage extends Component {+ <template>+ <h3>+ {{this.message}}+ {{yield}}+ </h3>+ {{#if this.education}}+ <div class="education">+ {{htmlSafe this.education}}+ </div>+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/footer-nav.gjs b/app/assets/javascripts/discourse/app/components/footer-nav.gjsindex 86fb80d69ca..1fcd0d039aa 100644--- a/app/assets/javascripts/discourse/app/components/footer-nav.gjs+++ b/app/assets/javascripts/discourse/app/components/footer-nav.gjs@@ -1,12 +1,12 @@import Component from "@glimmer/component";import { action } from "@ember/object";import { service } from "@ember/service";+import { not } from "truth-helpers";import DButton from "discourse/components/d-button";import concatClass from "discourse/helpers/concat-class";import htmlClass from "discourse/helpers/html-class";import { postRNWebviewMessage } from "discourse/lib/utilities";import { SCROLLED_UP, UNSCROLLED } from "discourse/services/scroll-direction";-import not from "truth-helpers/helpers/not";export default class FooterNav extends Component {@service appEvents;diff --git a/app/assets/javascripts/discourse/app/components/form-template-field/checkbox.gjs b/app/assets/javascripts/discourse/app/components/form-template-field/checkbox.gjsindex 0bc10a808f1..bf36beac696 100644--- a/app/assets/javascripts/discourse/app/components/form-template-field/checkbox.gjs+++ b/app/assets/javascripts/discourse/app/components/form-template-field/checkbox.gjs@@ -1,21 +1,28 @@-<div class="control-group form-template-field" data-field-type="checkbox">- <label class="form-template-field__label">- <Input- name={{@id}}- class="form-template-field__checkbox"- @checked={{@value}}- @type="checkbox"- required={{if @validations.required "required" ""}}- />- {{@attributes.label}}- {{#if @validations.required}}- {{d-icon "asterisk" class="form-template-field__required-indicator"}}- {{/if}}- </label>+import { Input } from "@ember/component";+import { htmlSafe } from "@ember/template";+import icon from "discourse/helpers/d-icon";++const Checkbox = <template>+ <div class="control-group form-template-field" data-field-type="checkbox">+ <label class="form-template-field__label">+ <Input+ name={{@id}}+ class="form-template-field__checkbox"+ @checked={{@value}}+ @type="checkbox"+ required={{if @validations.required "required" ""}}+ />+ {{@attributes.label}}+ {{#if @validations.required}}+ {{icon "asterisk" class="form-template-field__required-indicator"}}+ {{/if}}+ </label>- {{#if @attributes.description}}- <span class="form-template-field__description">- {{html-safe @attributes.description}}- </span>- {{/if}}-</div>\ No newline at end of file+ {{#if @attributes.description}}+ <span class="form-template-field__description">+ {{htmlSafe @attributes.description}}+ </span>+ {{/if}}+ </div>+</template>;+export default Checkbox;diff --git a/app/assets/javascripts/discourse/app/components/form-template-field/dropdown.gjs b/app/assets/javascripts/discourse/app/components/form-template-field/dropdown.gjsindex a9f2e303177..e7e68a9aeba 100644--- a/app/assets/javascripts/discourse/app/components/form-template-field/dropdown.gjs+++ b/app/assets/javascripts/discourse/app/components/form-template-field/dropdown.gjs@@ -1,35 +1,45 @@-<div class="control-group form-template-field" data-field-type="dropdown">- {{#if @attributes.label}}- <label class="form-template-field__label">- {{@attributes.label}}- {{#if @validations.required}}- {{d-icon "asterisk" class="form-template-field__required-indicator"}}- {{/if}}- </label>- {{/if}}+import { htmlSafe } from "@ember/template";+import { eq } from "truth-helpers";+import icon from "discourse/helpers/d-icon";- {{#if @attributes.description}}- <span class="form-template-field__description">- {{html-safe @attributes.description}}- </span>- {{/if}}+const Dropdown = <template>+ <div class="control-group form-template-field" data-field-type="dropdown">+ {{#if @attributes.label}}+ <label class="form-template-field__label">+ {{@attributes.label}}+ {{#if @validations.required}}+ {{icon "asterisk" class="form-template-field__required-indicator"}}+ {{/if}}+ </label>+ {{/if}}- <select- name={{@id}}- class="form-template-field__dropdown"- required={{if @validations.required "required" ""}}- >- {{#if @attributes.none_label}}- <option- class="form-template-field__dropdown-placeholder"- value=""- disabled- selected- hidden- >{{@attributes.none_label}}</option>+ {{#if @attributes.description}}+ <span class="form-template-field__description">+ {{htmlSafe @attributes.description}}+ </span>{{/if}}- {{#each @choices as |choice|}}- <option value={{choice}} selected={{eq @value choice}}>{{choice}}</option>- {{/each}}- </select>-</div>\ No newline at end of file++ <select+ name={{@id}}+ class="form-template-field__dropdown"+ required={{if @validations.required "required" ""}}+ >+ {{#if @attributes.none_label}}+ <option+ class="form-template-field__dropdown-placeholder"+ value+ disabled+ selected+ hidden+ >{{@attributes.none_label}}</option>+ {{/if}}+ {{#each @choices as |choice|}}+ <option+ value={{choice}}+ selected={{eq @value choice}}+ >{{choice}}</option>+ {{/each}}+ </select>+ </div>+</template>;+export default Dropdown;diff --git a/app/assets/javascripts/discourse/app/components/form-template-field/input.gjs b/app/assets/javascripts/discourse/app/components/form-template-field/input.gjsindex 6120dd07465..2f5619037c0 100644--- a/app/assets/javascripts/discourse/app/components/form-template-field/input.gjs+++ b/app/assets/javascripts/discourse/app/components/form-template-field/input.gjs@@ -1,29 +1,36 @@-<div class="control-group form-template-field" data-field-type="input">- {{#if @attributes.label}}- <label class="form-template-field__label">- {{@attributes.label}}- {{#if @validations.required}}- {{d-icon "asterisk" class="form-template-field__required-indicator"}}- {{/if}}- </label>- {{/if}}+import { Input } from "@ember/component";+import { htmlSafe } from "@ember/template";+import icon from "discourse/helpers/d-icon";- {{#if @attributes.description}}- <span class="form-template-field__description">- {{html-safe @attributes.description}}- </span>- {{/if}}+const Input0 = <template>+ <div class="control-group form-template-field" data-field-type="input">+ {{#if @attributes.label}}+ <label class="form-template-field__label">+ {{@attributes.label}}+ {{#if @validations.required}}+ {{icon "asterisk" class="form-template-field__required-indicator"}}+ {{/if}}+ </label>+ {{/if}}- <Input- name={{@id}}- class="form-template-field__input"- @value={{@value}}- @type={{if @validations.type @validations.type "text"}}- placeholder={{@attributes.placeholder}}- required={{if @validations.required "required" ""}}- pattern={{@validations.pattern}}- minlength={{@validations.minimum}}- maxlength={{@validations.maximum}}- disabled={{@attributes.disabled}}- />-</div>\ No newline at end of file+ {{#if @attributes.description}}+ <span class="form-template-field__description">+ {{htmlSafe @attributes.description}}+ </span>+ {{/if}}++ <Input+ name={{@id}}+ class="form-template-field__input"+ @value={{@value}}+ @type={{if @validations.type @validations.type "text"}}+ placeholder={{@attributes.placeholder}}+ required={{if @validations.required "required" ""}}+ pattern={{@validations.pattern}}+ minlength={{@validations.minimum}}+ maxlength={{@validations.maximum}}+ disabled={{@attributes.disabled}}+ />+ </div>+</template>;+export default Input0;diff --git a/app/assets/javascripts/discourse/app/components/form-template-field/textarea.gjs b/app/assets/javascripts/discourse/app/components/form-template-field/textarea.gjsindex f007367a910..bae5583507f 100644--- a/app/assets/javascripts/discourse/app/components/form-template-field/textarea.gjs+++ b/app/assets/javascripts/discourse/app/components/form-template-field/textarea.gjs@@ -1,27 +1,34 @@-<div class="control-group form-template-field" data-field-type="textarea">- {{#if @attributes.label}}- <label class="form-template-field__label">- {{@attributes.label}}- {{#if @validations.required}}- {{d-icon "asterisk" class="form-template-field__required-indicator"}}- {{/if}}- </label>- {{/if}}+import { Textarea } from "@ember/component";+import { htmlSafe } from "@ember/template";+import icon from "discourse/helpers/d-icon";- {{#if @attributes.description}}- <span class="form-template-field__description">- {{html-safe @attributes.description}}- </span>- {{/if}}+const Textarea0 = <template>+ <div class="control-group form-template-field" data-field-type="textarea">+ {{#if @attributes.label}}+ <label class="form-template-field__label">+ {{@attributes.label}}+ {{#if @validations.required}}+ {{icon "asterisk" class="form-template-field__required-indicator"}}+ {{/if}}+ </label>+ {{/if}}- <Textarea- name={{@id}}- @value={{@value}}- class="form-template-field__textarea"- placeholder={{@attributes.placeholder}}- pattern={{@validations.pattern}}- minlength={{@validations.minimum}}- maxlength={{@validations.maximum}}- required={{if @validations.required "required" ""}}- />-</div>\ No newline at end of file+ {{#if @attributes.description}}+ <span class="form-template-field__description">+ {{htmlSafe @attributes.description}}+ </span>+ {{/if}}++ <Textarea+ name={{@id}}+ @value={{@value}}+ class="form-template-field__textarea"+ placeholder={{@attributes.placeholder}}+ pattern={{@validations.pattern}}+ minlength={{@validations.minimum}}+ maxlength={{@validations.maximum}}+ required={{if @validations.required "required" ""}}+ />+ </div>+</template>;+export default Textarea0;diff --git a/app/assets/javascripts/discourse/app/components/global-notice.gjs b/app/assets/javascripts/discourse/app/components/global-notice.gjsindex 63916673da2..679bd6d2bf2 100644--- a/app/assets/javascripts/discourse/app/components/global-notice.gjs+++ b/app/assets/javascripts/discourse/app/components/global-notice.gjs@@ -1,8 +1,10 @@import Component from "@ember/component";+import { fn } from "@ember/helper";import EmberObject, { action } from "@ember/object";import { service } from "@ember/service";import { htmlSafe } from "@ember/template";import { tagName } from "@ember-decorators/component";+import DButton from "discourse/components/d-button";import cookie, { removeCookie } from "discourse/lib/cookie";import { bind } from "discourse/lib/decorators";import { DeferredTrackedSet } from "discourse/lib/tracked-tools";@@ -221,31 +223,33 @@ export default class GlobalNotice extends Component {this.set("logNotice", logNotice);}-}-<div class="global-notice">- {{#if this.visible}}- {{#each this.notices as |notice|}}- <div class="row">- <div- id="global-notice-{{notice.id}}"- class="alert alert-{{notice.options.level}} {{notice.id}}"- >- {{#if notice.options.html}}- {{html-safe notice.options.html}}- {{/if}}-- <span class="text">{{html-safe notice.text}}</span>-- {{#if notice.options.dismissable}}- <DButton- @icon="xmark"- @action={{fn this.dismissNotice notice}}- class="btn-transparent close"- />- {{/if}}- </div>- </div>- {{/each}}- {{/if}}-</div>\ No newline at end of file+ <template>+ <div class="global-notice">+ {{#if this.visible}}+ {{#each this.notices as |notice|}}+ <div class="row">+ <div+ id="global-notice-{{notice.id}}"+ class="alert alert-{{notice.options.level}} {{notice.id}}"+ >+ {{#if notice.options.html}}+ {{htmlSafe notice.options.html}}+ {{/if}}++ <span class="text">{{htmlSafe notice.text}}</span>++ {{#if notice.options.dismissable}}+ <DButton+ @icon="xmark"+ @action={{fn this.dismissNotice notice}}+ class="btn-transparent close"+ />+ {{/if}}+ </div>+ </div>+ {{/each}}+ {{/if}}+ </div>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/google-icon.gjs b/app/assets/javascripts/discourse/app/components/google-icon.gjsindex d1b4785b20d..665eee1f247 100644--- a/app/assets/javascripts/discourse/app/components/google-icon.gjs+++ b/app/assets/javascripts/discourse/app/components/google-icon.gjs@@ -1,2 +1,5 @@-{{! prettier-ignore }}-<svg class="fa d-icon d-icon-custom-google-oauth2 svg-icon" viewBox="0 0 48 48"><defs><path id="google-icon-a" d="M44.5 20H24v8.5h11.8C34.7 33.9 30.1 37 24 37c-7.2 0-13-5.8-13-13s5.8-13 13-13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 11.8 2 2 11.8 2 24s9.8 22 22 22c11 0 21-8 21-22 0-1.3-.2-2.7-.5-4z"/></defs><clipPath id="google-icon-b"><use href="#google-icon-a" overflow="visible"/></clipPath><path clip-path="url(#google-icon-b)" fill="#FBBC05" d="M0 37V11l17 13z"/><path clip-path="url(#google-icon-b)" fill="#EA4335" d="M0 11l17 13 7-6.1L48 14V0H0z"/><path clip-path="url(#google-icon-b)" fill="#34A853" d="M0 37l30-23 7.9 1L48 0v48H0z"/><path clip-path="url(#google-icon-b)" fill="#4285F4" d="M48 48L17 24l-4-3 35-10z"/></svg>\ No newline at end of file+const GoogleIcon = <template>+ {{!-- prettier-ignore --}}+ <svg class="fa d-icon d-icon-custom-google-oauth2 svg-icon" viewBox="0 0 48 48"><defs><path id="google-icon-a" d="M44.5 20H24v8.5h11.8C34.7 33.9 30.1 37 24 37c-7.2 0-13-5.8-13-13s5.8-13 13-13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 11.8 2 2 11.8 2 24s9.8 22 22 22c11 0 21-8 21-22 0-1.3-.2-2.7-.5-4z" /></defs><clipPath id="google-icon-b"><use href="#google-icon-a" overflow="visible" /></clipPath><path clip-path="url(#google-icon-b)" fill="#FBBC05" d="M0 37V11l17 13z" /><path clip-path="url(#google-icon-b)" fill="#EA4335" d="M0 11l17 13 7-6.1L48 14V0H0z" /><path clip-path="url(#google-icon-b)" fill="#34A853" d="M0 37l30-23 7.9 1L48 0v48H0z" /><path clip-path="url(#google-icon-b)" fill="#4285F4" d="M48 48L17 24l-4-3 35-10z" /></svg>+</template>;+export default GoogleIcon;diff --git a/app/assets/javascripts/discourse/app/components/google-search.gjs b/app/assets/javascripts/discourse/app/components/google-search.gjsindex 84d5587f60f..ab479a6324d 100644--- a/app/assets/javascripts/discourse/app/components/google-search.gjs+++ b/app/assets/javascripts/discourse/app/components/google-search.gjs@@ -1,8 +1,11 @@import Component from "@ember/component";+import { hash } from "@ember/helper";import { alias } from "@ember/object/computed";import { classNameBindings, classNames } from "@ember-decorators/component";+import PluginOutlet from "discourse/components/plugin-outlet";import discourseComputed from "discourse/lib/decorators";import getURL from "discourse/lib/get-url";+import { i18n } from "discourse-i18n";@classNames("google-search-form")@classNameBindings("hidden:hidden")@@ -13,23 +16,25 @@ export default class GoogleSearch extends Component {siteUrl() {return `${location.protocol}//${location.host}${getURL("/")}`;}-}-<PluginOutlet- @name="google-search"- @outletArgs={{hash searchTerm=this.searchTerm siteUrl=this.siteUrl}}- @defaultGlimmer={{true}}->- <form action="//google.com/search" id="google-search" class="inline-form">- <input- type="text"- name="q"- aria-label={{i18n "search.search_google"}}- value={{@searchTerm}}- />- <input name="as_sitesearch" value={{@siteUrl}} type="hidden" />- <button class="btn btn-primary" type="submit">{{i18n- "search.search_google_button"- }}</button>- </form>-</PluginOutlet>\ No newline at end of file+ <template>+ <PluginOutlet+ @name="google-search"+ @outletArgs={{hash searchTerm=this.searchTerm siteUrl=this.siteUrl}}+ @defaultGlimmer={{true}}+ >+ <form action="//google.com/search" id="google-search" class="inline-form">+ <input+ type="text"+ name="q"+ aria-label={{i18n "search.search_google"}}+ value={{@searchTerm}}+ />+ <input name="as_sitesearch" value={{@siteUrl}} type="hidden" />+ <button class="btn btn-primary" type="submit">{{i18n+ "search.search_google_button"+ }}</button>+ </form>+ </PluginOutlet>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/group-card-contents.gjs b/app/assets/javascripts/discourse/app/components/group-card-contents.gjsindex 330f5eae9b6..187dd66acbe 100644--- a/app/assets/javascripts/discourse/app/components/group-card-contents.gjs+++ b/app/assets/javascripts/discourse/app/components/group-card-contents.gjs@@ -1,13 +1,21 @@+import { on } from "@ember/modifier";import { action } from "@ember/object";import { alias, gt } from "@ember/object/computed";import { service } from "@ember/service";+import { htmlSafe } from "@ember/template";import { classNameBindings, classNames } from "@ember-decorators/component";-import { on } from "@ember-decorators/object";+import { on as onEvent } from "@ember-decorators/object";+import AvatarFlair from "discourse/components/avatar-flair";import CardContentsBase from "discourse/components/card-contents-base";+import DButton from "discourse/components/d-button";+import GroupMembershipButton from "discourse/components/group-membership-button";+import boundAvatar from "discourse/helpers/bound-avatar";+import routeAction from "discourse/helpers/route-action";import { setting } from "discourse/lib/computed";import discourseComputed from "discourse/lib/decorators";import { wantsNewWindow } from "discourse/lib/intercept-click";import { groupPath } from "discourse/lib/url";+import { i18n } from "discourse-i18n";const maxMembersToDisplay = 10;@@ -53,12 +61,12 @@ export default class GroupCardContents extends CardContentsBase {return groupPath(group.name);}- @on("didInsertElement")+ @onEvent("didInsertElement")_inserted() {this.appEvents.on("dom:clean", this, this._close);}- @on("didDestroyElement")+ @onEvent("didDestroyElement")_destroyed() {this.appEvents.off("dom:clean", this, this._close);}@@ -123,107 +131,111 @@ export default class GroupCardContents extends CardContentsBase {hasGroups: true,});}-}--{{#if this.visible}}- <div class="card-content">- {{#if this.loading}}- <div class="card-row first-row">- <div class="group-card-avatar">- <div- class="card-avatar-placeholder animated-placeholder placeholder-animation"- ></div>- </div>- </div>- <div class="card-row second-row">- <div class="animated-placeholder placeholder-animation"></div>- </div>- {{else}}- <div class="card-row first-row">- <div class="group-card-avatar">- <a- {{on "click" this.handleShowGroup}}- href={{this.groupPath}}- class="card-huge-avatar"- >- <AvatarFlair- @flairName={{this.group.name}}- @flairUrl={{this.group.flair_url}}- @flairBgColor={{this.group.flair_bg_color}}- @flairColor={{this.group.flair_color}}- />- </a>- </div>- <div class="names">- <span>- <div class="names__primary {{this.group.name}}">- <a- {{on "click" this.handleShowGroup}}- href={{this.groupPath}}- class="group-page-link"- >{{this.group.name}}</a>+ <template>+ {{#if this.visible}}+ <div class="card-content">+ {{#if this.loading}}+ <div class="card-row first-row">+ <div class="group-card-avatar">+ <div+ class="card-avatar-placeholder animated-placeholder placeholder-animation"+ ></div></div>- {{#if this.group.full_name}}- <div class="names__secondary full-name">- {{this.group.full_name}}- </div>- {{else}}- <div class="names__secondary username">{{this.group.name}}</div>- {{/if}}- </span>- </div>- <ul class="usercard-controls group-details-button">- <li>- <GroupMembershipButton- @model={{this.group}}- @showLogin={{route-action "showLogin"}}- />- </li>- {{#if this.group.messageable}}- <li>- <DButton- @action={{action "messageGroup"}}- @icon="envelope"- @label="groups.message"- class="btn-primary group-message-button inline"- />- </li>- {{/if}}- </ul>- </div>-- {{#if this.group.bio_excerpt}}- <div class="card-row second-row">- <div class="bio">- {{html-safe this.group.bio_excerpt}}</div>- </div>- {{/if}}- {{#if this.group.members}}- <div class="card-row third-row">- <div class="members metadata">- {{#each this.highlightedMembers as |user|}}- <a- {{on "click" this.close}}- href={{user.path}}- class="card-tiny-avatar"- >{{bound-avatar user "tiny"}}</a>- {{/each}}- {{#if this.showMoreMembers}}+ <div class="card-row second-row">+ <div class="animated-placeholder placeholder-animation"></div>+ </div>+ {{else}}+ <div class="card-row first-row">+ <div class="group-card-avatar"><a{{on "click" this.handleShowGroup}}href={{this.groupPath}}- class="more-members-link"+ class="card-huge-avatar">- <span class="more-members-count">+{{this.moreMembersCount}}- {{i18n "more"}}</span>+ <AvatarFlair+ @flairName={{this.group.name}}+ @flairUrl={{this.group.flair_url}}+ @flairBgColor={{this.group.flair_bg_color}}+ @flairColor={{this.group.flair_color}}+ /></a>- {{/if}}+ </div>+ <div class="names">+ <span>+ <div class="names__primary {{this.group.name}}">+ <a+ {{on "click" this.handleShowGroup}}+ href={{this.groupPath}}+ class="group-page-link"+ >{{this.group.name}}</a>+ </div>+ {{#if this.group.full_name}}+ <div class="names__secondary full-name">+ {{this.group.full_name}}+ </div>+ {{else}}+ <div+ class="names__secondary username"+ >{{this.group.name}}</div>+ {{/if}}+ </span>+ </div>+ <ul class="usercard-controls group-details-button">+ <li>+ <GroupMembershipButton+ @model={{this.group}}+ @showLogin={{routeAction "showLogin"}}+ />+ </li>+ {{#if this.group.messageable}}+ <li>+ <DButton+ @action={{action "messageGroup"}}+ @icon="envelope"+ @label="groups.message"+ class="btn-primary group-message-button inline"+ />+ </li>+ {{/if}}+ </ul></div>- </div>- {{/if}}++ {{#if this.group.bio_excerpt}}+ <div class="card-row second-row">+ <div class="bio">+ {{htmlSafe this.group.bio_excerpt}}+ </div>+ </div>+ {{/if}}++ {{#if this.group.members}}+ <div class="card-row third-row">+ <div class="members metadata">+ {{#each this.highlightedMembers as |user|}}+ <a+ {{on "click" this.close}}+ href={{user.path}}+ class="card-tiny-avatar"+ >{{boundAvatar user "tiny"}}</a>+ {{/each}}+ {{#if this.showMoreMembers}}+ <a+ {{on "click" this.handleShowGroup}}+ href={{this.groupPath}}+ class="more-members-link"+ >+ <span class="more-members-count">+{{this.moreMembersCount}}+ {{i18n "more"}}</span>+ </a>+ {{/if}}+ </div>+ </div>+ {{/if}}+ {{/if}}+ </div>{{/if}}- </div>-{{/if}}\ No newline at end of file+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/group-manage-email-settings.gjs b/app/assets/javascripts/discourse/app/components/group-manage-email-settings.gjsindex b041b1c3f23..e17dac802dd 100644--- a/app/assets/javascripts/discourse/app/components/group-manage-email-settings.gjs+++ b/app/assets/javascripts/discourse/app/components/group-manage-email-settings.gjs@@ -1,9 +1,15 @@-import Component from "@ember/component";+import Component, { Input } from "@ember/component";+import { on } from "@ember/modifier";import { action } from "@ember/object";import { service } from "@ember/service";+import { htmlSafe } from "@ember/template";import { isEmpty } from "@ember/utils";import { tagName } from "@ember-decorators/component";-import { on } from "@ember-decorators/object";+import { on as onEvent } from "@ember-decorators/object";+import { not } from "truth-helpers";+import GroupImapEmailSettings from "discourse/components/group-imap-email-settings";+import GroupManageSaveButton from "discourse/components/group-manage-save-button";+import GroupSmtpEmailSettings from "discourse/components/group-smtp-email-settings";import discourseComputed from "discourse/lib/decorators";import { i18n } from "discourse-i18n";@@ -14,7 +20,7 @@ export default class GroupManageEmailSettings extends Component {imapSettingsValid = false;smtpSettingsValid = false;- @on("init")+ @onEvent("init")_determineSettingsValid() {this.set("imapSettingsValid",@@ -112,95 +118,97 @@ export default class GroupManageEmailSettings extends Component {this._determineSettingsValid();});}-}--<div class="group-manage-email-settings">- <h3>{{i18n "groups.manage.email.smtp_title"}}</h3>- <p>{{i18n "groups.manage.email.smtp_instructions"}}</p>-- <label for="enable_smtp">- <Input- @type="checkbox"- @checked={{this.group.smtp_enabled}}- id="enable_smtp"- tabindex="1"- {{on "input" this.smtpEnabledChange}}- />- {{i18n "groups.manage.email.enable_smtp"}}- </label>-- {{#if this.group.smtp_enabled}}- <GroupSmtpEmailSettings- @group={{this.group}}- @smtpSettingsValid={{this.smtpSettingsValid}}- @onChangeSmtpSettingsValid={{this.onChangeSmtpSettingsValid}}- />- {{/if}}-- {{#if this.siteSettings.enable_imap}}- <div class="group-manage-email-imap-wrapper">- <br />-- <h3>{{i18n "groups.manage.email.imap_title"}}</h3>- <p>- {{html-safe (i18n "groups.manage.email.imap_instructions")}}- </p>- <div class="alert alert-warning">{{i18n- "groups.manage.email.imap_alpha_warning"- }}</div>+ <template>+ <div class="group-manage-email-settings">+ <h3>{{i18n "groups.manage.email.smtp_title"}}</h3>+ <p>{{i18n "groups.manage.email.smtp_instructions"}}</p>- <label for="enable_imap">+ <label for="enable_smtp"><Input@type="checkbox"- disabled={{not this.enableImapSettings}}- @checked={{this.group.imap_enabled}}- id="enable_imap"- tabindex="8"- {{on "input" this.imapEnabledChange}}+ @checked={{this.group.smtp_enabled}}+ id="enable_smtp"+ tabindex="1"+ {{on "input" this.smtpEnabledChange}}/>- {{i18n "groups.manage.email.enable_imap"}}+ {{i18n "groups.manage.email.enable_smtp"}}</label>- {{#if this.group.imap_enabled}}- <GroupImapEmailSettings+ {{#if this.group.smtp_enabled}}+ <GroupSmtpEmailSettings@group={{this.group}}- @imapSettingsValid={{this.imapSettingsValid}}+ @smtpSettingsValid={{this.smtpSettingsValid}}+ @onChangeSmtpSettingsValid={{this.onChangeSmtpSettingsValid}}/>{{/if}}++ {{#if this.siteSettings.enable_imap}}+ <div class="group-manage-email-imap-wrapper">+ <br />++ <h3>{{i18n "groups.manage.email.imap_title"}}</h3>+ <p>+ {{htmlSafe (i18n "groups.manage.email.imap_instructions")}}+ </p>++ <div class="alert alert-warning">{{i18n+ "groups.manage.email.imap_alpha_warning"+ }}</div>++ <label for="enable_imap">+ <Input+ @type="checkbox"+ disabled={{not this.enableImapSettings}}+ @checked={{this.group.imap_enabled}}+ id="enable_imap"+ tabindex="8"+ {{on "input" this.imapEnabledChange}}+ />+ {{i18n "groups.manage.email.enable_imap"}}+ </label>++ {{#if this.group.imap_enabled}}+ <GroupImapEmailSettings+ @group={{this.group}}+ @imapSettingsValid={{this.imapSettingsValid}}+ />+ {{/if}}+ </div>+ {{/if}}++ <div class="group-manage-email-additional-settings-wrapper">+ <div class="control-group">+ <h3>{{i18n "groups.manage.email.imap_additional_settings"}}</h3>+ <label+ class="control-group-inline"+ for="allow_unknown_sender_topic_replies"+ >+ <Input+ @type="checkbox"+ name="allow_unknown_sender_topic_replies"+ id="allow_unknown_sender_topic_replies"+ @checked={{this.group.allow_unknown_sender_topic_replies}}+ tabindex="13"+ />+ <span>{{i18n+ "groups.manage.email.settings.allow_unknown_sender_topic_replies"+ }}</span>+ </label>+ <p>{{i18n+ "groups.manage.email.settings.allow_unknown_sender_topic_replies_hint"+ }}</p>+ </div>+ </div>++ <br />+ <GroupManageSaveButton+ @model={{this.group}}+ @disabled={{not this.emailSettingsValid}}+ @beforeSave={{this.beforeSave}}+ @afterSave={{this.afterSave}}+ @tabindex="15"+ /></div>- {{/if}}-- <div class="group-manage-email-additional-settings-wrapper">- <div class="control-group">- <h3>{{i18n "groups.manage.email.imap_additional_settings"}}</h3>- <label- class="control-group-inline"- for="allow_unknown_sender_topic_replies"- >- <Input- @type="checkbox"- name="allow_unknown_sender_topic_replies"- id="allow_unknown_sender_topic_replies"- @checked={{this.group.allow_unknown_sender_topic_replies}}- tabindex="13"- />- <span>{{i18n- "groups.manage.email.settings.allow_unknown_sender_topic_replies"- }}</span>- </label>- <p>{{i18n- "groups.manage.email.settings.allow_unknown_sender_topic_replies_hint"- }}</p>- </div>- </div>-- <br />- <GroupManageSaveButton- @model={{this.group}}- @disabled={{not this.emailSettingsValid}}- @beforeSave={{this.beforeSave}}- @afterSave={{this.afterSave}}- @tabindex="15"- />-</div>\ No newline at end of file+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/group-manage-logs-filter.gjs b/app/assets/javascripts/discourse/app/components/group-manage-logs-filter.gjsindex 209752dd2e8..8d024c08686 100644--- a/app/assets/javascripts/discourse/app/components/group-manage-logs-filter.gjs+++ b/app/assets/javascripts/discourse/app/components/group-manage-logs-filter.gjs@@ -1,5 +1,7 @@import Component from "@ember/component";+import { concat, fn } from "@ember/helper";import { tagName } from "@ember-decorators/component";+import DButton from "discourse/components/d-button";import discourseComputed from "discourse/lib/decorators";import { i18n } from "discourse-i18n";@@ -14,13 +16,15 @@ export default class GroupManageLogsFilter extends Component {filterText(value, type) {return type === "action" ? i18n(`group_histories.actions.${value}`) : value;}-}-{{#if this.value}}- <DButton- @action={{fn this.clearFilter this.type}}- @icon="circle-xmark"- @translatedLabel={{concat this.label ": " this.filterText}}- class="btn-default group-manage-logs-filter"- />-{{/if}}\ No newline at end of file+ <template>+ {{#if this.value}}+ <DButton+ @action={{fn this.clearFilter this.type}}+ @icon="circle-xmark"+ @translatedLabel={{concat this.label ": " this.filterText}}+ class="btn-default group-manage-logs-filter"+ />+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/group-manage-logs-row.gjs b/app/assets/javascripts/discourse/app/components/group-manage-logs-row.gjsindex 203d50cdf92..bd1d4b4f63a 100644--- a/app/assets/javascripts/discourse/app/components/group-manage-logs-row.gjs+++ b/app/assets/javascripts/discourse/app/components/group-manage-logs-row.gjs@@ -1,6 +1,11 @@import Component from "@ember/component";+import { fn, hash } from "@ember/helper";import { action } from "@ember/object";import { tagName } from "@ember-decorators/component";+import DButton from "discourse/components/d-button";+import avatar from "discourse/helpers/avatar";+import boundDate from "discourse/helpers/bound-date";+import { i18n } from "discourse-i18n";@tagName("")export default class GroupManageLogsRow extends Component {@@ -15,77 +20,82 @@ export default class GroupManageLogsRow extends Component {filter(params) {this.set(`filters.${params.key}`, params.value);}-}-<tr class="group-manage-logs-row">- <td>- <DButton- @action={{fn this.filter (hash value=this.log.action key="action")}}- @translatedLabel={{this.log.actionTitle}}- class="btn-default"- />- </td>+ <template>+ <tr class="group-manage-logs-row">+ <td>+ <DButton+ @action={{fn this.filter (hash value=this.log.action key="action")}}+ @translatedLabel={{this.log.actionTitle}}+ class="btn-default"+ />+ </td>- <td>- <span>{{avatar this.log.acting_user imageSize="tiny"}}</span>- <DButton- @action={{fn- this.filter- (hash value=this.log.acting_user.username key="acting_user")- }}- @translatedLabel={{this.log.acting_user.username}}- class="btn-default"- />- </td>+ <td>+ <span>{{avatar this.log.acting_user imageSize="tiny"}}</span>+ <DButton+ @action={{fn+ this.filter+ (hash value=this.log.acting_user.username key="acting_user")+ }}+ @translatedLabel={{this.log.acting_user.username}}+ class="btn-default"+ />+ </td>- <td>- {{#if this.log.target_user}}- <span>{{avatar this.log.target_user imageSize="tiny"}}</span>- <DButton- @action={{fn- this.filter- (hash value=this.log.target_user.username key="target_user")- }}- @translatedLabel={{this.log.target_user.username}}- class="btn-default"- />- {{/if}}- </td>+ <td>+ {{#if this.log.target_user}}+ <span>{{avatar this.log.target_user imageSize="tiny"}}</span>+ <DButton+ @action={{fn+ this.filter+ (hash value=this.log.target_user.username key="target_user")+ }}+ @translatedLabel={{this.log.target_user.username}}+ class="btn-default"+ />+ {{/if}}+ </td>- <td>- {{#if this.log.subject}}- <DButton- @action={{fn this.filter (hash value=this.log.subject key="subject")}}- @translatedLabel={{this.log.subject}}- class="btn-default"- />- {{/if}}- </td>+ <td>+ {{#if this.log.subject}}+ <DButton+ @action={{fn+ this.filter+ (hash value=this.log.subject key="subject")+ }}+ @translatedLabel={{this.log.subject}}+ class="btn-default"+ />+ {{/if}}+ </td>- <td>{{bound-date this.log.created_at}}</td>+ <td>{{boundDate this.log.created_at}}</td>- <td class="group-manage-logs-expand-details">- {{#if this.log.prev_value}}- <DButton- @action={{this.toggleDetails}}- @icon={{if this.expandDetails "angle-up" "angle-down"}}- />- {{/if}}- </td>-</tr>+ <td class="group-manage-logs-expand-details">+ {{#if this.log.prev_value}}+ <DButton+ @action={{this.toggleDetails}}+ @icon={{if this.expandDetails "angle-up" "angle-down"}}+ />+ {{/if}}+ </td>+ </tr>-{{#if this.expandDetails}}- <tr>- <td colspan="6">- <p>- <strong>{{i18n "groups.manage.logs.from"}}</strong>:- <code>{{this.log.prev_value}}</code>- </p>+ {{#if this.expandDetails}}+ <tr>+ <td colspan="6">+ <p>+ <strong>{{i18n "groups.manage.logs.from"}}</strong>:+ <code>{{this.log.prev_value}}</code>+ </p>- <p>- <strong>{{i18n "groups.manage.logs.to"}}</strong>:- <code>{{this.log.new_value}}</code>- </p>- </td>- </tr>-{{/if}}\ No newline at end of file+ <p>+ <strong>{{i18n "groups.manage.logs.to"}}</strong>:+ <code>{{this.log.new_value}}</code>+ </p>+ </td>+ </tr>+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/group-manage-save-button.gjs b/app/assets/javascripts/discourse/app/components/group-manage-save-button.gjsindex 09731e08690..5c866b3b092 100644--- a/app/assets/javascripts/discourse/app/components/group-manage-save-button.gjs+++ b/app/assets/javascripts/discourse/app/components/group-manage-save-button.gjs@@ -1,7 +1,9 @@import Component from "@ember/component";import { action } from "@ember/object";-import { or } from "@ember/object/computed";+import { or as computedOr } from "@ember/object/computed";import { service } from "@ember/service";+import { or } from "truth-helpers";+import DButton from "discourse/components/d-button";import GroupDefaultNotificationsModal from "discourse/components/modal/group-default-notifications";import { popupAutomaticMembershipAlert } from "discourse/controllers/groups-new";import { popupAjaxError } from "discourse/lib/ajax-error";@@ -15,7 +17,7 @@ export default class GroupManageSaveButton extends Component {disabled = false;updateExistingUsers = null;- @or("model.flair_icon", "model.flair_upload_id") hasFlair;+ @computedOr("model.flair_icon", "model.flair_upload_id") hasFlair;@discourseComputed("saving")savingText(saving) {@@ -100,23 +102,25 @@ export default class GroupManageSaveButton extends Component {});this.save();}-}-{{#if this.privateGroupNameNotice}}- <div class="row">- <div class="alert alert-warning alert-private-group-name">- {{this.privateGroupNameNotice}}+ <template>+ {{#if this.privateGroupNameNotice}}+ <div class="row">+ <div class="alert alert-warning alert-private-group-name">+ {{this.privateGroupNameNotice}}+ </div>+ </div>+ {{/if}}+ <div class="control-group buttons group-manage-save-button">+ <DButton+ @action={{this.save}}+ @disabled={{or this.disabled this.saving}}+ @translatedLabel={{this.savingText}}+ class="btn-primary group-manage-save"+ />+ {{#if this.saved}}+ <span>{{i18n "saved"}}</span>+ {{/if}}</div>- </div>-{{/if}}-<div class="control-group buttons group-manage-save-button">- <DButton- @action={{this.save}}- @disabled={{or this.disabled this.saving}}- @translatedLabel={{this.savingText}}- class="btn-primary group-manage-save"- />- {{#if this.saved}}- <span>{{i18n "saved"}}</span>- {{/if}}-</div>\ No newline at end of file+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/group-member.gjs b/app/assets/javascripts/discourse/app/components/group-member.gjsindex 9447e71293c..1cac092a002 100644--- a/app/assets/javascripts/discourse/app/components/group-member.gjs+++ b/app/assets/javascripts/discourse/app/components/group-member.gjs@@ -1,6 +1,9 @@import Component from "@ember/component";+import { on } from "@ember/modifier";import { action } from "@ember/object";import { classNames } from "@ember-decorators/component";+import avatar from "discourse/helpers/avatar";+import icon from "discourse/helpers/d-icon";@classNames("item")export default class GroupMember extends Component {@@ -9,14 +12,16 @@ export default class GroupMember extends Component {event?.preventDefault();this.removeAction(this.member);}-}-<a href={{this.member.adminPath}}>- {{avatar this.member imageSize="small"}}-</a>-<span>{{this.member.username}}</span>-{{#unless this.automatic}}- <a href {{on "click" this.remove}} class="remove">- {{d-icon "xmark"}}- </a>-{{/unless}}\ No newline at end of file+ <template>+ <a href={{this.member.adminPath}}>+ {{avatar this.member imageSize="small"}}+ </a>+ <span>{{this.member.username}}</span>+ {{#unless this.automatic}}+ <a href {{on "click" this.remove}} class="remove">+ {{icon "xmark"}}+ </a>+ {{/unless}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/group-membership-button.gjs b/app/assets/javascripts/discourse/app/components/group-membership-button.gjsindex c19ef963c31..1afb39e6b1e 100644--- a/app/assets/javascripts/discourse/app/components/group-membership-button.gjs+++ b/app/assets/javascripts/discourse/app/components/group-membership-button.gjs@@ -2,6 +2,7 @@ import Component from "@ember/component";import { action } from "@ember/object";import { service } from "@ember/service";import { classNames } from "@ember-decorators/component";+import DButton from "discourse/components/d-button";import { popupAjaxError } from "discourse/lib/ajax-error";import cookie from "discourse/lib/cookie";import discourseComputed from "discourse/lib/decorators";@@ -100,32 +101,34 @@ export default class GroupMembershipButton extends Component {this._showLoginModal();}}-}-{{#if this.canJoinGroup}}- <DButton- @action={{action "joinGroup"}}- @icon="user-plus"- @label="groups.join"- @disabled={{this.updatingMembership}}- class="btn-default group-index-join"- />-{{else if this.canLeaveGroup}}- <DButton- @action={{action "leaveGroup"}}- @icon="user-xmark"- @label="groups.leave"- @disabled={{this.updatingMembership}}- class="btn-danger group-index-leave"- />-{{else if this.canRequestMembership}}- <DButton- @action={{action "showRequestMembershipForm"}}- @disabled={{this.loading}}- @icon="user-plus"- @label="groups.request"- class="btn-default group-index-request"- />-{{else}}- {{yield}}-{{/if}}\ No newline at end of file+ <template>+ {{#if this.canJoinGroup}}+ <DButton+ @action={{action "joinGroup"}}+ @icon="user-plus"+ @label="groups.join"+ @disabled={{this.updatingMembership}}+ class="btn-default group-index-join"+ />+ {{else if this.canLeaveGroup}}+ <DButton+ @action={{action "leaveGroup"}}+ @icon="user-xmark"+ @label="groups.leave"+ @disabled={{this.updatingMembership}}+ class="btn-danger group-index-leave"+ />+ {{else if this.canRequestMembership}}+ <DButton+ @action={{action "showRequestMembershipForm"}}+ @disabled={{this.loading}}+ @icon="user-plus"+ @label="groups.request"+ class="btn-default group-index-request"+ />+ {{else}}+ {{yield}}+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/group-selector.gjs b/app/assets/javascripts/discourse/app/components/group-selector.gjsindex 0f18233b20f..2f076b382ea 100644--- a/app/assets/javascripts/discourse/app/components/group-selector.gjs+++ b/app/assets/javascripts/discourse/app/components/group-selector.gjs@@ -63,11 +63,13 @@ export default class GroupSelector extends Component {template: findRawTemplate("group-selector-autocomplete"),});}-}-<input- placeholder={{this.placeholder}}- class="group-selector"- type="text"- name="groups"-/>\ No newline at end of file+ <template>+ <input+ placeholder={{this.placeholder}}+ class="group-selector"+ type="text"+ name="groups"+ />+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/groups-form-profile-fields.gjs b/app/assets/javascripts/discourse/app/components/groups-form-profile-fields.gjsindex 676fc94b079..65398c92025 100644--- a/app/assets/javascripts/discourse/app/components/groups-form-profile-fields.gjs+++ b/app/assets/javascripts/discourse/app/components/groups-form-profile-fields.gjs@@ -1,8 +1,14 @@import Component from "@ember/component";+import { hash } from "@ember/helper";import EmberObject from "@ember/object";import { not } from "@ember/object/computed";import { isEmpty } from "@ember/utils";import { observes } from "@ember-decorators/object";+import DEditor from "discourse/components/d-editor";+import GroupFlairInputs from "discourse/components/group-flair-inputs";+import InputTip from "discourse/components/input-tip";+import PluginOutlet from "discourse/components/plugin-outlet";+import TextField from "discourse/components/text-field";import { popupAjaxError } from "discourse/lib/ajax-error";import discourseDebounce from "discourse/lib/debounce";import discourseComputed from "discourse/lib/decorators";@@ -111,56 +117,61 @@ export default class GroupsFormProfileFields extends Component {}this.set("basicNameValidation", EmberObject.create(options));}-}-{{#if this.canEdit}}- {{#if this.currentUser.can_create_group}}- <div class="control-group">- <label class="control-label" for="name">{{i18n "groups.name"}}</label>+ <template>+ {{#if this.canEdit}}+ {{#if this.currentUser.can_create_group}}+ <div class="control-group">+ <label class="control-label" for="name">{{i18n "groups.name"}}</label>++ <TextField+ @name="name"+ @value={{this.nameInput}}+ @placeholderKey="admin.groups.name_placeholder"+ class="input-xxlarge group-form-name"+ />++ <InputTip @validation={{this.nameValidation}} />+ </div>+ {{/if}}++ <div class="control-group">+ <label class="control-label" for="full_name">{{i18n+ "groups.manage.full_name"+ }}</label>++ <TextField+ @name="full_name"+ @value={{this.model.full_name}}+ class="input-xxlarge group-form-full-name"+ />+ </div>+ {{/if}}- <TextField- @name="name"- @value={{this.nameInput}}- @placeholderKey="admin.groups.name_placeholder"- class="input-xxlarge group-form-name"+ <div class="control-group">+ <label class="control-label" for="bio">{{i18n "groups.bio"}}</label>+ <DEditor+ @value={{this.model.bio_raw}}+ class="group-form-bio input-xxlarge"/>-- <InputTip @validation={{this.nameValidation}} /></div>- {{/if}}-- <div class="control-group">- <label class="control-label" for="full_name">{{i18n- "groups.manage.full_name"- }}</label>-- <TextField- @name="full_name"- @value={{this.model.full_name}}- class="input-xxlarge group-form-full-name"- />- </div>-{{/if}}--<div class="control-group">- <label class="control-label" for="bio">{{i18n "groups.bio"}}</label>- <DEditor @value={{this.model.bio_raw}} class="group-form-bio input-xxlarge" />-</div>--{{#if this.model.automatic}}- <div class="control-group">- <GroupFlairInputs @model={{this.model}} />- </div>-{{/if}}--{{#if this.canEdit}}- {{yield}}-- <span>- <PluginOutlet- @name="group-edit"- @connectorTagName="div"- @outletArgs={{hash group=this.model}}- />- </span>-{{/if}}\ No newline at end of file++ {{#if this.model.automatic}}+ <div class="control-group">+ <GroupFlairInputs @model={{this.model}} />+ </div>+ {{/if}}++ {{#if this.canEdit}}+ {{yield}}++ <span>+ <PluginOutlet+ @name="group-edit"+ @connectorTagName="div"+ @outletArgs={{hash group=this.model}}+ />+ </span>+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/horizontal-overflow-nav.gjs b/app/assets/javascripts/discourse/app/components/horizontal-overflow-nav.gjsindex c120a8364f0..f46be592988 100644--- a/app/assets/javascripts/discourse/app/components/horizontal-overflow-nav.gjs+++ b/app/assets/javascripts/discourse/app/components/horizontal-overflow-nav.gjs@@ -1,8 +1,13 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { on } from "@ember/modifier";import { action } from "@ember/object";+import didInsert from "@ember/render-modifiers/modifiers/did-insert";import { service } from "@ember/service";+import concatClass from "discourse/helpers/concat-class";+import icon from "discourse/helpers/d-icon";import { bind } from "discourse/lib/decorators";+import onResize from "discourse/modifiers/on-resize";export default class HorizontalOverflowNav extends Component {@service site;@@ -126,54 +131,56 @@ export default class HorizontalOverflowNav extends Component {siblingTarget.scrollLeft += scrollSpeed;}, 50);}-}-{{! template-lint-disable no-pointer-down-event-binding }}-{{! template-lint-disable no-invalid-interactive }}--<nav- class="horizontal-overflow-nav {{if this.hasScroll 'has-scroll'}}"- aria-label={{@ariaLabel}}->- {{#if this.hasScroll}}- <a- role="button"- {{on "mousedown" this.horizontalScroll}}- {{on "mouseup" this.stopScroll}}- {{on "mouseleave" this.stopScroll}}- data-direction="left"- class={{concat-class- "horizontal-overflow-nav__scroll-left"- (if this.hideLeftScroll "disabled")- }}- >- {{d-icon "chevron-left"}}- </a>- {{/if}}-- <ul- {{on-resize this.onResize}}- {{on "scroll" this.onScroll}}- {{did-insert this.scrollToActive}}- {{on "mousedown" this.scrollDrag}}- class="nav-pills action-list {{@className}}"- ...attributes- >- {{yield}}- </ul>-- {{#if this.hasScroll}}- <a- role="button"- {{on "mousedown" this.horizontalScroll}}- {{on "mouseup" this.stopScroll}}- {{on "mouseleave" this.stopScroll}}- class={{concat-class- "horizontal-overflow-nav__scroll-right"- (if this.hideRightScroll "disabled")- }}+ <template>+ {{! template-lint-disable no-pointer-down-event-binding }}+ {{! template-lint-disable no-invalid-interactive }}++ <nav+ class="horizontal-overflow-nav {{if this.hasScroll 'has-scroll'}}"+ aria-label={{@ariaLabel}}>- {{d-icon "chevron-right"}}- </a>- {{/if}}-</nav>\ No newline at end of file+ {{#if this.hasScroll}}+ <a+ role="button"+ {{on "mousedown" this.horizontalScroll}}+ {{on "mouseup" this.stopScroll}}+ {{on "mouseleave" this.stopScroll}}+ data-direction="left"+ class={{concatClass+ "horizontal-overflow-nav__scroll-left"+ (if this.hideLeftScroll "disabled")+ }}+ >+ {{icon "chevron-left"}}+ </a>+ {{/if}}++ <ul+ {{onResize this.onResize}}+ {{on "scroll" this.onScroll}}+ {{didInsert this.scrollToActive}}+ {{on "mousedown" this.scrollDrag}}+ class="nav-pills action-list {{@className}}"+ ...attributes+ >+ {{yield}}+ </ul>++ {{#if this.hasScroll}}+ <a+ role="button"+ {{on "mousedown" this.horizontalScroll}}+ {{on "mouseup" this.stopScroll}}+ {{on "mouseleave" this.stopScroll}}+ class={{concatClass+ "horizontal-overflow-nav__scroll-right"+ (if this.hideRightScroll "disabled")+ }}+ >+ {{icon "chevron-right"}}+ </a>+ {{/if}}+ </nav>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/ignored-user-list-item.gjs b/app/assets/javascripts/discourse/app/components/ignored-user-list-item.gjsindex 7d06f0dc65f..9fb8ae6ee14 100644--- a/app/assets/javascripts/discourse/app/components/ignored-user-list-item.gjs+++ b/app/assets/javascripts/discourse/app/components/ignored-user-list-item.gjs@@ -1,6 +1,8 @@import Component from "@ember/component";+import { fn } from "@ember/helper";import { action } from "@ember/object";import { tagName } from "@ember-decorators/component";+import DButton from "discourse/components/d-button";@tagName("div")export default class IgnoredUserListItem extends Component {@@ -10,13 +12,15 @@ export default class IgnoredUserListItem extends Component {removeIgnoredUser(item) {this.onRemoveIgnoredUser(item);}-}-<div class="ignored-user-list-item">- <span class="ignored-user-name">{{this.item}}</span>- <DButton- @action={{fn (action "removeIgnoredUser") this.item}}- @icon="xmark"- class="remove-ignored-user no-text btn-icon"- />-</div>\ No newline at end of file+ <template>+ <div class="ignored-user-list-item">+ <span class="ignored-user-name">{{this.item}}</span>+ <DButton+ @action={{fn this.removeIgnoredUser this.item}}+ @icon="xmark"+ class="remove-ignored-user no-text btn-icon"+ />+ </div>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/latest-topic-list-item.gjs b/app/assets/javascripts/discourse/app/components/latest-topic-list-item.gjsindex 4c61e082213..c10c710e428 100644--- a/app/assets/javascripts/discourse/app/components/latest-topic-list-item.gjs+++ b/app/assets/javascripts/discourse/app/components/latest-topic-list-item.gjs@@ -1,13 +1,26 @@import Component from "@ember/component";+import { hash } from "@ember/helper";import {attributeBindings,classNameBindings,} from "@ember-decorators/component";+import PluginOutlet from "discourse/components/plugin-outlet";import {navigateToTopic,showEntrance,} from "discourse/components/topic-list-item";+import TopicPostBadges from "discourse/components/topic-post-badges";+import UserAvatarFlair from "discourse/components/user-avatar-flair";+import UserLink from "discourse/components/user-link";+import avatar from "discourse/helpers/avatar";+import categoryLink from "discourse/helpers/category-link";+import discourseTags from "discourse/helpers/discourse-tags";+import formatDate from "discourse/helpers/format-date";+import raw from "discourse/helpers/raw";+import topicFeaturedLink from "discourse/helpers/topic-featured-link";+import topicLink from "discourse/helpers/topic-link";import discourseComputed from "discourse/lib/decorators";+import { i18n } from "discourse-i18n";@attributeBindings("topic.id:data-topic-id")@classNameBindings(":latest-topic-list-item", "unboundClassNames")@@ -49,61 +62,65 @@ export default class LatestTopicListItem extends Component {return classes.join(" ");}-}-<PluginOutlet- @name="above-latest-topic-list-item"- @connectorTagName="div"- @outletArgs={{hash topic=this.topic}}-/>-<div class="topic-poster">- <UserLink- @user={{this.topic.lastPosterUser}}- aria-label={{if- this.topic.lastPosterUser.username- (i18n "latest_poster_link" username=this.topic.lastPosterUser.username)- }}- >- {{avatar this.topic.lastPosterUser imageSize="large"}}- </UserLink>- <UserAvatarFlair @user={{this.topic.lastPosterUser}} />-</div>-<div class="main-link">- <div class="top-row">- {{raw "topic-status" topic=this.topic}}- {{topic-link this.topic}}- {{~#if this.topic.featured_link}}- {{topic-featured-link this.topic}}- {{/if}}{{! intentionally inline- to avoid whitespace}}<TopicPostBadges- @unreadPosts={{this.topic.unread_posts}}- @unseen={{this.topic.unseen}}- @url={{this.topic.lastUnreadUrl}}- />- </div>- <div class="bottom-row">- {{category-link this.topic.category}}{{discourse-tags- this.topic- mode="list"- }}{{! intentionally inline to avoid whitespace}}+ <template><PluginOutlet- @name="below-latest-topic-list-item-bottom-row"- @connectorTagName="span"+ @name="above-latest-topic-list-item"+ @connectorTagName="div"@outletArgs={{hash topic=this.topic}}/>- </div>-</div>-<div class="topic-stats">- <PluginOutlet- @name="above-latest-topic-list-item-post-count"- @connectorTagName="div"- @outletArgs={{hash topic=this.topic}}- />- {{raw "list/posts-count-column" topic=this.topic tagName="div"}}- <div class="topic-last-activity">- <a- href={{this.topic.lastPostUrl}}- title={{this.topic.bumpedAtTitle}}- >{{format-date this.topic.bumpedAt format="tiny" noTitle="true"}}</a>- </div>-</div>\ No newline at end of file+ <div class="topic-poster">+ <UserLink+ @user={{this.topic.lastPosterUser}}+ aria-label={{if+ this.topic.lastPosterUser.username+ (i18n+ "latest_poster_link" username=this.topic.lastPosterUser.username+ )+ }}+ >+ {{avatar this.topic.lastPosterUser imageSize="large"}}+ </UserLink>+ <UserAvatarFlair @user={{this.topic.lastPosterUser}} />+ </div>+ <div class="main-link">+ <div class="top-row">+ {{raw "topic-status" topic=this.topic}}+ {{topicLink this.topic}}+ {{~#if this.topic.featured_link}}+ {{topicFeaturedLink this.topic}}+ {{/if}}{{! intentionally inline+ to avoid whitespace}}<TopicPostBadges+ @unreadPosts={{this.topic.unread_posts}}+ @unseen={{this.topic.unseen}}+ @url={{this.topic.lastUnreadUrl}}+ />+ </div>+ <div class="bottom-row">+ {{categoryLink this.topic.category}}{{discourseTags+ this.topic+ mode="list"+ }}{{! intentionally inline to avoid whitespace}}+ <PluginOutlet+ @name="below-latest-topic-list-item-bottom-row"+ @connectorTagName="span"+ @outletArgs={{hash topic=this.topic}}+ />+ </div>+ </div>+ <div class="topic-stats">+ <PluginOutlet+ @name="above-latest-topic-list-item-post-count"+ @connectorTagName="div"+ @outletArgs={{hash topic=this.topic}}+ />+ {{raw "list/posts-count-column" topic=this.topic tagName="div"}}+ <div class="topic-last-activity">+ <a+ href={{this.topic.lastPostUrl}}+ title={{this.topic.bumpedAtTitle}}+ >{{formatDate this.topic.bumpedAt format="tiny" noTitle="true"}}</a>+ </div>+ </div>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/link-to-input.gjs b/app/assets/javascripts/discourse/app/components/link-to-input.gjsindex 2b99fbbd38d..90226b0a73f 100644--- a/app/assets/javascripts/discourse/app/components/link-to-input.gjs+++ b/app/assets/javascripts/discourse/app/components/link-to-input.gjs@@ -1,6 +1,8 @@import Component from "@ember/component";import { schedule } from "@ember/runloop";import $ from "jquery";+import icon from "discourse/helpers/d-icon";+import { i18n } from "discourse-i18n";export default class LinkToInput extends Component {showInput = false;@@ -14,17 +16,19 @@ export default class LinkToInput extends Component {return false;}-}-{{#if this.showInput}}- {{yield}}-{{else}}- <a href>- {{#if this.key}}- {{i18n this.key}}- {{/if}}- {{#if this.icon}}- {{d-icon this.icon}}+ <template>+ {{#if this.showInput}}+ {{yield}}+ {{else}}+ <a href>+ {{#if this.key}}+ {{i18n this.key}}+ {{/if}}+ {{#if this.icon}}+ {{icon this.icon}}+ {{/if}}+ </a>{{/if}}- </a>-{{/if}}\ No newline at end of file+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/local-login-form.gjs b/app/assets/javascripts/discourse/app/components/local-login-form.gjsindex cac1ee68351..8cc21aab317 100644--- a/app/assets/javascripts/discourse/app/components/local-login-form.gjs+++ b/app/assets/javascripts/discourse/app/components/local-login-form.gjs@@ -1,10 +1,22 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { Input } from "@ember/component";+import { fn } from "@ember/helper";+import { on } from "@ember/modifier";import { action } from "@ember/object";+import didInsert from "@ember/render-modifiers/modifiers/did-insert";import { service } from "@ember/service";import { htmlSafe } from "@ember/template";import { isEmpty } from "@ember/utils";import ForgotPassword from "discourse/components/modal/forgot-password";+import PasswordField from "discourse/components/password-field";+import SecondFactorForm from "discourse/components/second-factor-form";+import SecondFactorInput from "discourse/components/second-factor-input";+import SecurityKeyForm from "discourse/components/security-key-form";+import TogglePasswordMask from "discourse/components/toggle-password-mask";+import icon from "discourse/helpers/d-icon";+import valueEntered from "discourse/helpers/value-entered";+import withEventValue from "discourse/helpers/with-event-value";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import { escapeExpression } from "discourse/lib/utilities";@@ -139,108 +151,110 @@ export default class LocalLoginForm extends Component {});}-}-<form id="login-form" method="post">- <div id="credentials" class={{this.credentialsClass}}>- <div class="input-group" {{did-insert this.passkeyConditionalLogin}}>- <Input- {{on "focusin" this.scrollInputIntoView}}- @value={{@loginName}}- @type="email"- id="login-account-name"- class={{value-entered @loginName}}- autocomplete={{if @canUsePasskeys "username webauthn" "username"}}- autocorrect="off"- autocapitalize="off"- disabled={{@showSecondFactor}}- autofocus="autofocus"- tabindex="1"- {{on "input" @loginNameChanged}}- {{on "keydown" this.loginOnEnter}}- />- <label class="alt-placeholder" for="login-account-name">- {{i18n "login.email_placeholder"}}- </label>- {{#if @canLoginLocalWithEmail}}- <a- href- class={{if @loginName "" "no-login-filled"}}- tabindex="3"- id="email-login-link"- {{on "click" this.emailLogin}}- >- {{i18n "email_login.login_link"}}- </a>- {{/if}}- </div>- <div class="input-group">- <PasswordField- {{on "focusin" this.scrollInputIntoView}}- {{on "keydown" this.loginOnEnter}}- @value={{@loginPassword}}- @capsLockOn={{this.capsLockOn}}- type={{if this.maskPassword "password" "text"}}- disabled={{this.disableLoginFields}}- autocomplete="current-password"- maxlength="200"- tabindex="1"- id="login-account-password"- class={{value-entered @loginPassword}}- />- <label class="alt-placeholder" for="login-account-password">- {{i18n "login.password"}}- </label>- {{#if @loginPassword}}- <TogglePasswordMask- @maskPassword={{this.maskPassword}}- @togglePasswordMask={{this.togglePasswordMask}}- tabindex="3"- />- {{/if}}- <div class="login__password-links">- <a- href- id="forgot-password-link"- tabindex="2"- {{on "click" this.handleForgotPassword}}- >- {{i18n "forgot_password.action"}}- </a>+ <template>+ <form id="login-form" method="post">+ <div id="credentials" class={{this.credentialsClass}}>+ <div class="input-group" {{didInsert this.passkeyConditionalLogin}}>+ <Input+ {{on "focusin" this.scrollInputIntoView}}+ @value={{@loginName}}+ @type="email"+ id="login-account-name"+ class={{valueEntered @loginName}}+ autocomplete={{if @canUsePasskeys "username webauthn" "username"}}+ autocorrect="off"+ autocapitalize="off"+ disabled={{@showSecondFactor}}+ autofocus="autofocus"+ tabindex="1"+ {{on "input" @loginNameChanged}}+ {{on "keydown" this.loginOnEnter}}+ />+ <label class="alt-placeholder" for="login-account-name">+ {{i18n "login.email_placeholder"}}+ </label>+ {{#if @canLoginLocalWithEmail}}+ <a+ href+ class={{if @loginName "" "no-login-filled"}}+ tabindex="3"+ id="email-login-link"+ {{on "click" this.emailLogin}}+ >+ {{i18n "email_login.login_link"}}+ </a>+ {{/if}}+ </div>+ <div class="input-group">+ <PasswordField+ {{on "focusin" this.scrollInputIntoView}}+ {{on "keydown" this.loginOnEnter}}+ @value={{@loginPassword}}+ @capsLockOn={{this.capsLockOn}}+ type={{if this.maskPassword "password" "text"}}+ disabled={{this.disableLoginFields}}+ autocomplete="current-password"+ maxlength="200"+ tabindex="1"+ id="login-account-password"+ class={{valueEntered @loginPassword}}+ />+ <label class="alt-placeholder" for="login-account-password">+ {{i18n "login.password"}}+ </label>+ {{#if @loginPassword}}+ <TogglePasswordMask+ @maskPassword={{this.maskPassword}}+ @togglePasswordMask={{this.togglePasswordMask}}+ tabindex="3"+ />+ {{/if}}+ <div class="login__password-links">+ <a+ href+ id="forgot-password-link"+ tabindex="2"+ {{on "click" this.handleForgotPassword}}+ >+ {{i18n "forgot_password.action"}}+ </a>+ </div>+ <div class="caps-lock-warning {{unless this.capsLockOn 'hidden'}}">+ {{icon "triangle-exclamation"}}+ {{i18n "login.caps_lock_warning"}}</div>+ </div></div>- <div class="caps-lock-warning {{unless this.capsLockOn 'hidden'}}">- {{d-icon "triangle-exclamation"}}- {{i18n "login.caps_lock_warning"}}</div>- </div>- </div>- {{#if this.showSecondFactorForm}}- <SecondFactorForm- @secondFactorMethod={{@secondFactorMethod}}- @secondFactorToken={{@secondFactorToken}}- @backupEnabled={{@backupEnabled}}- @totpEnabled={{@totpEnabled}}- @isLogin={{true}}- >- {{#if @showSecurityKey}}- <SecurityKeyForm- @setShowSecurityKey={{fn (mut @showSecurityKey)}}- @setShowSecondFactor={{fn (mut @showSecondFactor)}}- @setSecondFactorMethod={{fn (mut @secondFactorMethod)}}+ {{#if this.showSecondFactorForm}}+ <SecondFactorForm+ @secondFactorMethod={{@secondFactorMethod}}+ @secondFactorToken={{@secondFactorToken}}@backupEnabled={{@backupEnabled}}@totpEnabled={{@totpEnabled}}- @otherMethodAllowed={{@otherMethodAllowed}}- @action={{this.authenticateSecurityKey}}- />- {{else}}- <SecondFactorInput- {{on "keydown" this.loginOnEnter}}- {{on "input" (with-event-value (fn (mut @secondFactorToken)))}}- {{on "focusin" this.scrollInputIntoView}}- @secondFactorMethod={{@secondFactorMethod}}- value={{@secondFactorToken}}- id="login-second-factor"- />+ @isLogin={{true}}+ >+ {{#if @showSecurityKey}}+ <SecurityKeyForm+ @setShowSecurityKey={{fn (mut @showSecurityKey)}}+ @setShowSecondFactor={{fn (mut @showSecondFactor)}}+ @setSecondFactorMethod={{fn (mut @secondFactorMethod)}}+ @backupEnabled={{@backupEnabled}}+ @totpEnabled={{@totpEnabled}}+ @otherMethodAllowed={{@otherMethodAllowed}}+ @action={{this.authenticateSecurityKey}}+ />+ {{else}}+ <SecondFactorInput+ {{on "keydown" this.loginOnEnter}}+ {{on "input" (withEventValue (fn (mut @secondFactorToken)))}}+ {{on "focusin" this.scrollInputIntoView}}+ @secondFactorMethod={{@secondFactorMethod}}+ value={{@secondFactorToken}}+ id="login-second-factor"+ />+ {{/if}}+ </SecondFactorForm>{{/if}}- </SecondFactorForm>- {{/if}}-</form>\ No newline at end of file+ </form>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/login-buttons.gjs b/app/assets/javascripts/discourse/app/components/login-buttons.gjsindex d0fc7397209..4bc8036d818 100644--- a/app/assets/javascripts/discourse/app/components/login-buttons.gjs+++ b/app/assets/javascripts/discourse/app/components/login-buttons.gjs@@ -1,5 +1,10 @@import Component from "@ember/component";+import { on } from "@ember/modifier";import { classNameBindings } from "@ember-decorators/component";+import GoogleIcon from "discourse/components/google-icon";+import PasskeyLoginButton from "discourse/components/passkey-login-button";+import PluginOutlet from "discourse/components/plugin-outlet";+import icon from "discourse/helpers/d-icon";import discourseComputed from "discourse/lib/decorators";import { isWebauthnSupported } from "discourse/lib/webauthn";import { findAll } from "discourse/models/login-method";@@ -36,28 +41,30 @@ export default class LoginButtons extends Component {isWebauthnSupported());}-}-{{#each this.buttons as |b|}}- <button- type="button"- class="btn btn-social {{b.name}}"- {{on "click" (action this.externalLogin b)}}- aria-label={{b.screenReaderTitle}}- >- {{#if b.isGoogle}}- <GoogleIcon />- {{else if b.icon}}- {{d-icon b.icon}}- {{else}}- {{d-icon "right-to-bracket"}}- {{/if}}- <span class="btn-social-title">{{b.title}}</span>- </button>-{{/each}}+ <template>+ {{#each this.buttons as |b|}}+ <button+ type="button"+ class="btn btn-social {{b.name}}"+ {{on "click" (action this.externalLogin b)}}+ aria-label={{b.screenReaderTitle}}+ >+ {{#if b.isGoogle}}+ <GoogleIcon />+ {{else if b.icon}}+ {{icon b.icon}}+ {{else}}+ {{icon "right-to-bracket"}}+ {{/if}}+ <span class="btn-social-title">{{b.title}}</span>+ </button>+ {{/each}}-{{#if this.showPasskeysButton}}- <PasskeyLoginButton @passkeyLogin={{this.passkeyLogin}} />-{{/if}}+ {{#if this.showPasskeysButton}}+ <PasskeyLoginButton @passkeyLogin={{this.passkeyLogin}} />+ {{/if}}-<PluginOutlet @name="after-login-buttons" />\ No newline at end of file+ <PluginOutlet @name="after-login-buttons" />+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/menu-panel.gjs b/app/assets/javascripts/discourse/app/components/menu-panel.gjsindex 2bd6d99bf21..5a7acec8001 100644--- a/app/assets/javascripts/discourse/app/components/menu-panel.gjs+++ b/app/assets/javascripts/discourse/app/components/menu-panel.gjs@@ -1,10 +1,15 @@-<div- class={{concat-class "menu-panel" @panelClass @animationClass}}- data-max-width="500"->- <div class="panel-body">- <div class="panel-body-contents">- {{yield}}+import concatClass from "discourse/helpers/concat-class";++const MenuPanel = <template>+ <div+ class={{concatClass "menu-panel" @panelClass @animationClass}}+ data-max-width="500"+ >+ <div class="panel-body">+ <div class="panel-body-contents">+ {{yield}}+ </div></div></div>-</div>\ No newline at end of file+</template>;+export default MenuPanel;diff --git a/app/assets/javascripts/discourse/app/components/mobile-category-topic.gjs b/app/assets/javascripts/discourse/app/components/mobile-category-topic.gjsindex 104be6560e5..d69b77318b9 100644--- a/app/assets/javascripts/discourse/app/components/mobile-category-topic.gjs+++ b/app/assets/javascripts/discourse/app/components/mobile-category-topic.gjs@@ -1,28 +1,35 @@import Component from "@ember/component";import { classNameBindings, tagName } from "@ember-decorators/component";import { showEntrance } from "discourse/components/topic-list-item";+import coldAgeClass from "discourse/helpers/cold-age-class";+import formatAge from "discourse/helpers/format-age";+import raw from "discourse/helpers/raw";+import rawDate from "discourse/helpers/raw-date";+import topicLink from "discourse/helpers/topic-link";@tagName("tr")@classNameBindings(":category-topic-link", "topic.archived", "topic.visited")export default class MobileCategoryTopic extends Component {click = showEntrance;-}-<td class="main-link">- <div class="topic-inset">- {{raw "topic-status" topic=this.topic}}- {{topic-link this.topic}}- {{#if this.topic.unseen}}- <span class="badge-notification new-topic"></span>- {{/if}}- <span- class={{cold-age-class this.topic.last_posted_at}}- title={{raw-date this.topic.last_posted_at}}- >{{format-age this.topic.last_posted_at}}</span>- </div>-</td>-<td class="num posts">{{raw- "list/post-count-or-badges"- topic=this.topic- postBadgesEnabled="true"- }}</td>\ No newline at end of file+ <template>+ <td class="main-link">+ <div class="topic-inset">+ {{raw "topic-status" topic=this.topic}}+ {{topicLink this.topic}}+ {{#if this.topic.unseen}}+ <span class="badge-notification new-topic"></span>+ {{/if}}+ <span+ class={{coldAgeClass this.topic.last_posted_at}}+ title={{rawDate this.topic.last_posted_at}}+ >{{formatAge this.topic.last_posted_at}}</span>+ </div>+ </td>+ <td class="num posts">{{raw+ "list/post-count-or-badges"+ topic=this.topic+ postBadgesEnabled="true"+ }}</td>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/mobile-nav.gjs b/app/assets/javascripts/discourse/app/components/mobile-nav.gjsindex 6fbcac93c88..87236c1929b 100644--- a/app/assets/javascripts/discourse/app/components/mobile-nav.gjs+++ b/app/assets/javascripts/discourse/app/components/mobile-nav.gjs@@ -1,10 +1,13 @@import Component from "@ember/component";+import { on } from "@ember/modifier";import { action } from "@ember/object";import { next } from "@ember/runloop";import { service } from "@ember/service";+import { htmlSafe } from "@ember/template";import { classNames, tagName } from "@ember-decorators/component";-import { on } from "@ember-decorators/object";+import { on as onEvent } from "@ember-decorators/object";import $ from "jquery";+import icon from "discourse/helpers/d-icon";@tagName("ul")@classNames("mobile-nav")@@ -13,7 +16,7 @@ export default class MobileNav extends Component {selectedHtml = null;- @on("init")+ @onEvent("init")_init() {if (this.site.desktopView) {let classes = this.desktopClass;@@ -75,20 +78,22 @@ export default class MobileNav extends Component {}});}-}-{{#if this.site.mobileView}}- {{#if this.selectedHtml}}- <li>- <a href {{on "click" this.toggleExpanded}} class="expander">- <span class="selection">{{html-safe this.selectedHtml}}</span>- {{d-icon "caret-down"}}- </a>- </li>- {{/if}}- <ul class="drop {{if this.expanded 'expanded'}}">- {{yield}}- </ul>-{{else}}- {{yield}}-{{/if}}\ No newline at end of file+ <template>+ {{#if this.site.mobileView}}+ {{#if this.selectedHtml}}+ <li>+ <a href {{on "click" this.toggleExpanded}} class="expander">+ <span class="selection">{{htmlSafe this.selectedHtml}}</span>+ {{icon "caret-down"}}+ </a>+ </li>+ {{/if}}+ <ul class="drop {{if this.expanded 'expanded'}}">+ {{yield}}+ </ul>+ {{else}}+ {{yield}}+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/activation-resent.gjs b/app/assets/javascripts/discourse/app/components/modal/activation-resent.gjsindex af6d6c09261..d1016bf6de4 100644--- a/app/assets/javascripts/discourse/app/components/modal/activation-resent.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/activation-resent.gjs@@ -1,9 +1,16 @@-<DModal @title={{i18n "log_in"}} @closeModal={{@closeModal}}>- <:body>- {{html-safe- (i18n- "login.sent_activation_email_again" [email protected]- )- }}- </:body>-</DModal>\ No newline at end of file+import { htmlSafe } from "@ember/template";+import DModal from "discourse/components/d-modal";+import { i18n } from "discourse-i18n";++const ActivationResent = <template>+ <DModal @title={{i18n "log_in"}} @closeModal={{@closeModal}}>+ <:body>+ {{htmlSafe+ (i18n+ "login.sent_activation_email_again" [email protected]+ )+ }}+ </:body>+ </DModal>+</template>;+export default ActivationResent;diff --git a/app/assets/javascripts/discourse/app/components/modal/add-pm-participants.gjs b/app/assets/javascripts/discourse/app/components/modal/add-pm-participants.gjsindex a148cb42283..95110a308a6 100644--- a/app/assets/javascripts/discourse/app/components/modal/add-pm-participants.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/add-pm-participants.gjs@@ -1,13 +1,20 @@-<DModal- @title={{i18n @model.title}}- @closeModal={{@closeModal}}- @bodyClass="invite modal-panel"- class="add-pm-participants"->- <:body>- <InvitePanel- @inviteModel={{@model.inviteModel}}- @closeModal={{@closeModal}}- />- </:body>-</DModal>\ No newline at end of file+import DModal from "discourse/components/d-modal";+import InvitePanel from "discourse/components/invite-panel";+import { i18n } from "discourse-i18n";++const AddPmParticipants = <template>+ <DModal+ @title={{i18n @model.title}}+ @closeModal={{@closeModal}}+ @bodyClass="invite modal-panel"+ class="add-pm-participants"+ >+ <:body>+ <InvitePanel+ @inviteModel={{@model.inviteModel}}+ @closeModal={{@closeModal}}+ />+ </:body>+ </DModal>+</template>;+export default AddPmParticipants;diff --git a/app/assets/javascripts/discourse/app/components/modal/associate-account-confirm.gjs b/app/assets/javascripts/discourse/app/components/modal/associate-account-confirm.gjsindex 113c3f9c97c..14e6dae396e 100644--- a/app/assets/javascripts/discourse/app/components/modal/associate-account-confirm.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/associate-account-confirm.gjs@@ -1,9 +1,13 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { concat } from "@ember/helper";import { action } from "@ember/object";import { service } from "@ember/service";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";+import { i18n } from "discourse-i18n";export default class AssociateAccountConfirm extends Component {@service router;@@ -32,51 +36,56 @@ export default class AssociateAccountConfirm extends Component {popupAjaxError(e);}}-}-<DModal- @title={{i18n- "user.associated_accounts.confirm_modal_title"- provider=(i18n (concat "login." @model.provider_name ".name"))- }}- @closeModal={{@closeModal}}- @flash={{this.flash}}- @flashType="error"->- <:body>- {{#if @model.existing_account_description}}- <p>- {{i18n- "user.associated_accounts.confirm_description.disconnect"- provider=(i18n (concat "login." @model.provider_name ".name"))- [email protected]_account_description- }}- </p>- {{/if}}+ <template>+ <DModal+ @title={{i18n+ "user.associated_accounts.confirm_modal_title"+ provider=(i18n (concat "login." @model.provider_name ".name"))+ }}+ @closeModal={{@closeModal}}+ @flash={{this.flash}}+ @flashType="error"+ >+ <:body>+ {{#if @model.existing_account_description}}+ <p>+ {{i18n+ "user.associated_accounts.confirm_description.disconnect"+ provider=(i18n (concat "login." @model.provider_name ".name"))+ [email protected]_account_description+ }}+ </p>+ {{/if}}- <p>- {{#if @model.account_description}}- {{i18n- "user.associated_accounts.confirm_description.account_specific"- provider=(i18n (concat "login." @model.provider_name ".name"))- [email protected]_description- }}- {{else}}- {{i18n- "user.associated_accounts.confirm_description.generic"- provider=(i18n (concat "login." @model.provider_name ".name"))- }}- {{/if}}- </p>- </:body>+ <p>+ {{#if @model.account_description}}+ {{i18n+ "user.associated_accounts.confirm_description.account_specific"+ provider=(i18n (concat "login." @model.provider_name ".name"))+ [email protected]_description+ }}+ {{else}}+ {{i18n+ "user.associated_accounts.confirm_description.generic"+ provider=(i18n (concat "login." @model.provider_name ".name"))+ }}+ {{/if}}+ </p>+ </:body>- <:footer>- <DButton- @label="user.associated_accounts.connect"- @action={{this.finishConnect}}- @icon="plug"- class="btn-primary"- />- <DButton @label="user.associated_accounts.cancel" @action={{@closeModal}} />- </:footer>-</DModal>\ No newline at end of file+ <:footer>+ <DButton+ @label="user.associated_accounts.connect"+ @action={{this.finishConnect}}+ @icon="plug"+ class="btn-primary"+ />+ <DButton+ @label="user.associated_accounts.cancel"+ @action={{@closeModal}}+ />+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/auth-token.gjs b/app/assets/javascripts/discourse/app/components/modal/auth-token.gjsindex a82484c6851..a1e8e65921c 100644--- a/app/assets/javascripts/discourse/app/components/modal/auth-token.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/auth-token.gjs@@ -1,9 +1,18 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { on } from "@ember/modifier";import { action } from "@ember/object";import { service } from "@ember/service";+import { htmlSafe } from "@ember/template";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";+import DModalCancel from "discourse/components/d-modal-cancel";+import icon from "discourse/helpers/d-icon";+import formatDate from "discourse/helpers/format-date";import { ajax } from "discourse/lib/ajax";import { userPath } from "discourse/lib/url";+import autoFocus from "discourse/modifiers/auto-focus";+import { i18n } from "discourse-i18n";export default class AuthTokenComponent extends Component {@service currentUser;@@ -31,56 +40,58 @@ export default class AuthTokenComponent extends Component {event?.preventDefault();this.expanded = !this.expanded;}-}-<DModal- @title={{i18n "user.auth_tokens.was_this_you"}}- @closeModal={{@closeModal}}->- <:body>- <div>- <p>{{i18n "user.auth_tokens.was_this_you_description"}}</p>- <p>{{html-safe (i18n "user.second_factor.extended_description")}}</p>- </div>- <div>- <h3>{{i18n "user.auth_tokens.details"}}</h3>- <ul>- <li>{{d-icon "far-clock"}} {{format-date @model.seen_at}}</li>- <li>{{d-icon "location-dot"}} {{@model.location}}</li>- <li>{{d-icon @model.icon}}- {{i18n- "user.auth_tokens.browser_and_device"- }}</li>- </ul>- </div>+ <template>+ <DModal+ @title={{i18n "user.auth_tokens.was_this_you"}}+ @closeModal={{@closeModal}}+ >+ <:body>+ <div>+ <p>{{i18n "user.auth_tokens.was_this_you_description"}}</p>+ <p>{{htmlSafe (i18n "user.second_factor.extended_description")}}</p>+ </div>+ <div>+ <h3>{{i18n "user.auth_tokens.details"}}</h3>+ <ul>+ <li>{{icon "far-clock"}} {{formatDate @model.seen_at}}</li>+ <li>{{icon "location-dot"}} {{@model.location}}</li>+ <li>{{icon @model.icon}}+ {{i18n+ "user.auth_tokens.browser_and_device"+ }}</li>+ </ul>+ </div>- {{#if this.latestPost}}- <div>- <h3>- {{i18n "user.auth_tokens.latest_post"}}- {{! when this.fetchActivity is called, the modal focus is reset }}- {{! allowing you to tab behind the modal, so we need to refocus }}- <a href {{on "click" this.toggleExpanded}} {{auto-focus}}>- {{d-icon (if this.expanded "caret-up" "caret-down")}}- </a>- </h3>- {{#if this.expanded}}- <blockquote>{{html-safe this.latestPost.cooked}}</blockquote>- {{else}}- <blockquote>{{html-safe this.latestPost.excerpt}}</blockquote>+ {{#if this.latestPost}}+ <div>+ <h3>+ {{i18n "user.auth_tokens.latest_post"}}+ {{! when this.fetchActivity is called, the modal focus is reset }}+ {{! allowing you to tab behind the modal, so we need to refocus }}+ <a href {{on "click" this.toggleExpanded}} {{autoFocus}}>+ {{icon (if this.expanded "caret-up" "caret-down")}}+ </a>+ </h3>+ {{#if this.expanded}}+ <blockquote>{{htmlSafe this.latestPost.cooked}}</blockquote>+ {{else}}+ <blockquote>{{htmlSafe this.latestPost.excerpt}}</blockquote>+ {{/if}}+ </div>{{/if}}- </div>- {{/if}}- </:body>- <:footer>- <DButton- class="btn-primary"- @action={{@closeModal}}- @icon="lock"- @label="user.auth_tokens.secure_account"- />- <DModalCancel @close={{@closeModal}} />- </:footer>-</DModal>\ No newline at end of file+ </:body>+ <:footer>+ <DButton+ class="btn-primary"+ @action={{@closeModal}}+ @icon="lock"+ @label="user.auth_tokens.secure_account"+ />+ <DModalCancel @close={{@closeModal}} />+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/avatar-selector.gjs b/app/assets/javascripts/discourse/app/components/modal/avatar-selector.gjsindex ddb3aa10233..5936205ec22 100644--- a/app/assets/javascripts/discourse/app/components/modal/avatar-selector.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/avatar-selector.gjs@@ -1,11 +1,21 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { fn } from "@ember/helper";+import { on } from "@ember/modifier";import { action } from "@ember/object";import { service } from "@ember/service";+import { htmlSafe } from "@ember/template";+import AvatarUploader from "discourse/components/avatar-uploader";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";+import DModalCancel from "discourse/components/d-modal-cancel";+import RadioButton from "discourse/components/radio-button";+import boundAvatarTemplate from "discourse/helpers/bound-avatar-template";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import { isTesting } from "discourse/lib/environment";import { allowsImages } from "discourse/lib/uploads";+import { i18n } from "discourse-i18n";export default class AvatarSelectorModal extends Component {@service currentUser;@@ -156,146 +166,154 @@ export default class AvatarSelectorModal extends Component {popupAjaxError(error);}}-}-<DModal- @bodyClass="avatar-selector"- @closeModal={{@closeModal}}- @title={{i18n "user.change_avatar.title"}}- class="avatar-selector-modal"->- <:body>- {{#if this.showSelectableAvatars}}- <div class="selectable-avatars">- {{#each this.selectableAvatars as |avatar|}}- <a- href- class="selectable-avatar"- {{on "click" (fn this.selectAvatar avatar)}}- >- {{bound-avatar-template avatar "huge"}}- </a>- {{/each}}- </div>- {{#if this.showCustomAvatarSelector}}- <h4>{{i18n "user.change_avatar.use_custom"}}</h4>- {{/if}}- {{/if}}- {{#if this.showCustomAvatarSelector}}- {{#if this.user.use_logo_small_as_avatar}}- <div class="avatar-choice">- <RadioButton- @id="logo-small"- @name="logo"- @value="logo"- @selection={{this.selected}}- @onChange={{this.onSelectedChanged}}- />- <label class="radio" for="logo-small">- {{bound-avatar-template- this.siteSettings.site_logo_small_url- "large"- }}- {{i18n "user.change_avatar.logo_small"}}- </label>- </div>- {{/if}}- <div class="avatar-choice">- <RadioButton- @id="system-avatar"- @name="avatar"- @value="system"- @selection={{this.selected}}- @onChange={{this.onSelectedChanged}}- />- <label class="radio" for="system-avatar">- {{bound-avatar-template this.user.system_avatar_template "large"}}- {{i18n "user.change_avatar.letter_based"}}- </label>- </div>- {{#if this.allowAvatarUpload}}- <div class="avatar-choice">- <RadioButton- @id="gravatar"- @name="avatar"- @value="gravatar"- @selection={{this.selected}}- @onChange={{this.onSelectedChanged}}- />- <label class="radio" for="gravatar">- {{bound-avatar-template this.user.gravatar_avatar_template "large"}}- <span>- {{html-safe- (i18n- "user.change_avatar.gravatar"- gravatarName=this.siteSettings.gravatar_name- gravatarBaseUrl=this.siteSettings.gravatar_base_url- gravatarLoginUrl=this.siteSettings.gravatar_login_url- )- }}- {{this.user.email}}- </span>- </label>+ <template>+ <DModal+ @bodyClass="avatar-selector"+ @closeModal={{@closeModal}}+ @title={{i18n "user.change_avatar.title"}}+ class="avatar-selector-modal"+ >+ <:body>+ {{#if this.showSelectableAvatars}}+ <div class="selectable-avatars">+ {{#each this.selectableAvatars as |avatar|}}+ <a+ href+ class="selectable-avatar"+ {{on "click" (fn this.selectAvatar avatar)}}+ >+ {{boundAvatarTemplate avatar "huge"}}+ </a>+ {{/each}}+ </div>+ {{#if this.showCustomAvatarSelector}}+ <h4>{{i18n "user.change_avatar.use_custom"}}</h4>+ {{/if}}+ {{/if}}+ {{#if this.showCustomAvatarSelector}}+ {{#if this.user.use_logo_small_as_avatar}}+ <div class="avatar-choice">+ <RadioButton+ @id="logo-small"+ @name="logo"+ @value="logo"+ @selection={{this.selected}}+ @onChange={{this.onSelectedChanged}}+ />+ <label class="radio" for="logo-small">+ {{boundAvatarTemplate+ this.siteSettings.site_logo_small_url+ "large"+ }}+ {{i18n "user.change_avatar.logo_small"}}+ </label>+ </div>+ {{/if}}+ <div class="avatar-choice">+ <RadioButton+ @id="system-avatar"+ @name="avatar"+ @value="system"+ @selection={{this.selected}}+ @onChange={{this.onSelectedChanged}}+ />+ <label class="radio" for="system-avatar">+ {{boundAvatarTemplate this.user.system_avatar_template "large"}}+ {{i18n "user.change_avatar.letter_based"}}+ </label>+ </div>+ {{#if this.allowAvatarUpload}}+ <div class="avatar-choice">+ <RadioButton+ @id="gravatar"+ @name="avatar"+ @value="gravatar"+ @selection={{this.selected}}+ @onChange={{this.onSelectedChanged}}+ />+ <label class="radio" for="gravatar">+ {{boundAvatarTemplate+ this.user.gravatar_avatar_template+ "large"+ }}+ <span>+ {{htmlSafe+ (i18n+ "user.change_avatar.gravatar"+ gravatarName=this.siteSettings.gravatar_name+ gravatarBaseUrl=this.siteSettings.gravatar_base_url+ gravatarLoginUrl=this.siteSettings.gravatar_login_url+ )+ }}+ {{this.user.email}}+ </span>+ </label>- <DButton- @action={{this.refreshGravatar}}- @translatedTitle={{i18n- "user.change_avatar.refresh_gravatar_title"- gravatarName=this.siteSettings.gravatar_name- }}- @disabled={{this.gravatarRefreshDisabled}}- @icon="arrows-rotate"- class="btn-default avatar-selector-refresh-gravatar"- />+ <DButton+ @action={{this.refreshGravatar}}+ @translatedTitle={{i18n+ "user.change_avatar.refresh_gravatar_title"+ gravatarName=this.siteSettings.gravatar_name+ }}+ @disabled={{this.gravatarRefreshDisabled}}+ @icon="arrows-rotate"+ class="btn-default avatar-selector-refresh-gravatar"+ />- {{#if this.gravatarFailed}}- <p class="error">- {{i18n- "user.change_avatar.gravatar_failed"- gravatarName=this.siteSettings.gravatar_name- }}- </p>+ {{#if this.gravatarFailed}}+ <p class="error">+ {{i18n+ "user.change_avatar.gravatar_failed"+ gravatarName=this.siteSettings.gravatar_name+ }}+ </p>+ {{/if}}+ </div>+ <div class="avatar-choice">+ <RadioButton+ @id="uploaded-avatar"+ @name="avatar"+ @value="custom"+ @selection={{this.selected}}+ @onChange={{this.onSelectedChanged}}+ />+ <label class="radio" for="uploaded-avatar">+ {{#if this.user.custom_avatar_template}}+ {{boundAvatarTemplate+ this.user.custom_avatar_template+ "large"+ }}+ {{i18n "user.change_avatar.uploaded_avatar"}}+ {{else}}+ {{i18n "user.change_avatar.uploaded_avatar_empty"}}+ {{/if}}+ </label>+ <AvatarUploader+ @user_id={{this.user.id}}+ @uploadedAvatarTemplate={{this.user.custom_avatar_template}}+ @uploadedAvatarId={{this.user.custom_avatar_upload_id}}+ @uploading={{this.uploading}}+ @id="avatar-uploader"+ @done={{this.uploadComplete}}+ class="avatar-uploader"+ />+ </div>{{/if}}- </div>- <div class="avatar-choice">- <RadioButton- @id="uploaded-avatar"- @name="avatar"- @value="custom"- @selection={{this.selected}}- @onChange={{this.onSelectedChanged}}- />- <label class="radio" for="uploaded-avatar">- {{#if this.user.custom_avatar_template}}- {{bound-avatar-template this.user.custom_avatar_template "large"}}- {{i18n "user.change_avatar.uploaded_avatar"}}- {{else}}- {{i18n "user.change_avatar.uploaded_avatar_empty"}}- {{/if}}- </label>- <AvatarUploader- @user_id={{this.user.id}}- @uploadedAvatarTemplate={{this.user.custom_avatar_template}}- @uploadedAvatarId={{this.user.custom_avatar_upload_id}}- @uploading={{this.uploading}}- @id="avatar-uploader"- @done={{this.uploadComplete}}- class="avatar-uploader"- />- </div>- {{/if}}- {{/if}}- </:body>+ {{/if}}+ </:body>- <:footer>- {{#if this.showCustomAvatarSelector}}- <DButton- @action={{this.saveAvatarSelection}}- @disabled={{this.submitDisabled}}- @label="save"- class="btn-primary"- />- <DModalCancel @close={{@closeModal}} />- {{/if}}- </:footer>-</DModal>\ No newline at end of file+ <:footer>+ {{#if this.showCustomAvatarSelector}}+ <DButton+ @action={{this.saveAvatarSelection}}+ @disabled={{this.submitDisabled}}+ @label="save"+ class="btn-primary"+ />+ <DModalCancel @close={{@closeModal}} />+ {{/if}}+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/change-timestamp.gjs b/app/assets/javascripts/discourse/app/components/modal/change-timestamp.gjsindex d8124f858ab..cc7546ed4dd 100644--- a/app/assets/javascripts/discourse/app/components/modal/change-timestamp.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/change-timestamp.gjs@@ -1,8 +1,13 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { Input } from "@ember/component";+import { fn } from "@ember/helper";import { action } from "@ember/object";import { next } from "@ember/runloop";import { isEmpty } from "@ember/utils";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";+import DatePickerPast from "discourse/components/date-picker-past";import DiscourseURL from "discourse/lib/url";import Topic from "discourse/models/topic";import { i18n } from "discourse-i18n";@@ -42,37 +47,39 @@ export default class ChangeTimestamp extends Component {this.saving = false;}}-}-<DModal- @bodyClass="change-timestamp"- @closeModal={{@closeModal}}- @flash={{this.flash}}- @title={{i18n "topic.change_timestamp.title"}}->- <:body>- <p>- {{i18n "topic.change_timestamp.instructions"}}- </p>- <p class="alert alert-error {{unless this.validTimestamp 'hidden'}}">- {{i18n "topic.change_timestamp.invalid_timestamp"}}- </p>- <form>- <DatePickerPast- @value={{readonly this.date}}- @containerId="date-container"- @onSelect={{fn (mut this.date)}}- />- <Input @type="time" @value={{this.time}} />- </form>- <div id="date-container"></div>- </:body>- <:footer>- <DButton- class="btn-primary"- @disabled={{this.buttonDisabled}}- @action={{this.changeTimestamp}}- @label={{if this.saving "saving" "topic.change_timestamp.action"}}- />- </:footer>-</DModal>\ No newline at end of file+ <template>+ <DModal+ @bodyClass="change-timestamp"+ @closeModal={{@closeModal}}+ @flash={{this.flash}}+ @title={{i18n "topic.change_timestamp.title"}}+ >+ <:body>+ <p>+ {{i18n "topic.change_timestamp.instructions"}}+ </p>+ <p class="alert alert-error {{unless this.validTimestamp 'hidden'}}">+ {{i18n "topic.change_timestamp.invalid_timestamp"}}+ </p>+ <form>+ <DatePickerPast+ @value={{readonly this.date}}+ @containerId="date-container"+ @onSelect={{fn (mut this.date)}}+ />+ <Input @type="time" @value={{this.time}} />+ </form>+ <div id="date-container"></div>+ </:body>+ <:footer>+ <DButton+ class="btn-primary"+ @disabled={{this.buttonDisabled}}+ @action={{this.changeTimestamp}}+ @label={{if this.saving "saving" "topic.change_timestamp.action"}}+ />+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/create-account.gjs b/app/assets/javascripts/discourse/app/components/modal/create-account.gjsindex 7edba7f31f0..055554e69c3 100644--- a/app/assets/javascripts/discourse/app/components/modal/create-account.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/create-account.gjs@@ -1,12 +1,33 @@import { tracked } from "@glimmer/tracking";import { A } from "@ember/array";-import Component from "@ember/component";+import Component, { Input } from "@ember/component";+import { hash } from "@ember/helper";+import { on } from "@ember/modifier";import EmberObject, { action } from "@ember/object";import { dependentKeyCompat } from "@ember/object/compat";import { service } from "@ember/service";+import { htmlSafe } from "@ember/template";import { isEmpty } from "@ember/utils";import { observes } from "@ember-decorators/object";import { Promise } from "rsvp";+import { and, not } from "truth-helpers";+import DModal from "discourse/components/d-modal";+import FullnameInput from "discourse/components/fullname-input";+import HoneypotInput from "discourse/components/honeypot-input";+import InputTip from "discourse/components/input-tip";+import LoginButtons from "discourse/components/login-buttons";+import PasswordField from "discourse/components/password-field";+import PluginOutlet from "discourse/components/plugin-outlet";+import SignupPageCta from "discourse/components/signup-page-cta";+import SignupProgressBar from "discourse/components/signup-progress-bar";+import TogglePasswordMask from "discourse/components/toggle-password-mask";+import UserField from "discourse/components/user-field";+import WelcomeHeader from "discourse/components/welcome-header";+import concatClass from "discourse/helpers/concat-class";+import icon from "discourse/helpers/d-icon";+import loadingSpinner from "discourse/helpers/loading-spinner";+import routeAction from "discourse/helpers/route-action";+import valueEntered from "discourse/helpers/value-entered";import { ajax } from "discourse/lib/ajax";import { setting } from "discourse/lib/computed";import cookie, { removeCookie } from "discourse/lib/cookie";@@ -537,306 +558,316 @@ export default class CreateAccount extends Component.extend(this.nameValidationHelper.forceValidationReason = false;this.performAccountCreation();}-}-{{! template-lint-disable no-duplicate-id }}-<DModal- class="create-account -large"- {{on "keydown" this.actionOnEnter}}- {{on "click" this.selectKitFocus}}- @closeModal={{@closeModal}}- @bodyClass={{this.modalBodyClasses}}- @flash={{this.flash}}- @flashType="error"- aria-labelledby="create-account-title"->- <:body>- <PluginOutlet- @name="create-account-before-modal-body"- @connectorTagName="div"- />-- <div- class={{concat-class- (if this.site.desktopView "login-left-side")- this.authOptions?.auth_provider- }}+ <template>+ {{! template-lint-disable no-duplicate-id }}+ <DModal+ class="create-account -large"+ {{on "keydown" this.actionOnEnter}}+ {{on "click" this.selectKitFocus}}+ @closeModal={{@closeModal}}+ @bodyClass={{this.modalBodyClasses}}+ @flash={{this.flash}}+ @flashType="error"+ aria-labelledby="create-account-title">- <SignupProgressBar @step="signup" />- <WelcomeHeader- id="create-account-title"- @header={{i18n "create_account.header_title"}}- >+ <:body><PluginOutlet- @name="create-account-header-bottom"- @outletArgs={{hash showLogin=(route-action "showLogin")}}+ @name="create-account-before-modal-body"+ @connectorTagName="div"/>- </WelcomeHeader>- {{#if this.showCreateForm}}- <form id="login-form">- {{#if this.associateHtml}}- <div class="input-group create-account-associate-link">- <span>{{html-safe this.associateHtml}}</span>- </div>- {{/if}}- <div class="input-group create-account-email">- <Input- {{on "focusout" this.checkEmailAvailability}}- {{on "focusin" this.scrollInputIntoView}}- @type="email"- @value={{this.accountEmail}}- disabled={{this.emailDisabled}}- autofocus="autofocus"- aria-describedby="account-email-validation account-email-validation-more-info"- aria-invalid={{this.emailValidation.failed}}- name="email"- id="new-account-email"- class={{value-entered this.accountEmail}}- />- <label class="alt-placeholder" for="new-account-email">- {{i18n "user.email.title"}}- </label>- {{#if this.showEmailValidation}}- <InputTip- @validation={{this.emailValidation}}- id="account-email-validation"- />- {{else}}- <span class="more-info" id="account-email-validation-more-info">- {{#if this.siteSettings.show_signup_form_email_instructions}}- {{i18n "user.email.instructions"}}- {{/if}}- </span>- {{/if}}- </div>- <div class="input-group create-account__username">- <input- {{on "focusin" this.scrollInputIntoView}}- {{on "input" this.setAccountUsername}}- type="text"- value={{this.accountUsername}}- disabled={{this.usernameDisabled}}- maxlength={{this.maxUsernameLength}}- aria-describedby="username-validation username-validation-more-info"- aria-invalid={{this.usernameValidation.failed}}- autocomplete="off"- name="username"- id="new-account-username"- class={{value-entered this.accountUsername}}- />- <label class="alt-placeholder" for="new-account-username">- {{i18n "user.username.title"}}- </label>-- {{#if this.showUsernameInstructions}}- <span class="more-info" id="username-validation-more-info">- {{i18n "user.username.instructions"}}- </span>-- {{else}}- <InputTip- @validation={{this.usernameValidation}}- id="username-validation"- />- {{/if}}- </div>-- {{#if (and this.showFullname this.fullnameRequired)}}- <FullnameInput- @nameValidation={{this.nameValidation}}- @nameTitle={{this.nameTitle}}- @accountName={{this.accountName}}- @nameDisabled={{this.nameDisabled}}- @onFocusIn={{this.scrollInputIntoView}}- class="input-group create-account__fullname required"+ <div+ class={{concatClass+ (if this.site.desktopView "login-left-side")+ this.authOptions?.auth_provider+ }}+ >+ <SignupProgressBar @step="signup" />+ <WelcomeHeader+ id="create-account-title"+ @header={{i18n "create_account.header_title"}}+ >+ <PluginOutlet+ @name="create-account-header-bottom"+ @outletArgs={{hash showLogin=(routeAction "showLogin")}}/>- {{/if}}+ </WelcomeHeader>+ {{#if this.showCreateForm}}+ <form id="login-form">+ {{#if this.associateHtml}}+ <div class="input-group create-account-associate-link">+ <span>{{htmlSafe this.associateHtml}}</span>+ </div>+ {{/if}}+ <div class="input-group create-account-email">+ <Input+ {{on "focusout" this.checkEmailAvailability}}+ {{on "focusin" this.scrollInputIntoView}}+ @type="email"+ @value={{this.accountEmail}}+ disabled={{this.emailDisabled}}+ autofocus="autofocus"+ aria-describedby="account-email-validation account-email-validation-more-info"+ aria-invalid={{this.emailValidation.failed}}+ name="email"+ id="new-account-email"+ class={{valueEntered this.accountEmail}}+ />+ <label class="alt-placeholder" for="new-account-email">+ {{i18n "user.email.title"}}+ </label>+ {{#if this.showEmailValidation}}+ <InputTip+ @validation={{this.emailValidation}}+ id="account-email-validation"+ />+ {{else}}+ <span+ class="more-info"+ id="account-email-validation-more-info"+ >+ {{#if+ this.siteSettings.show_signup_form_email_instructions+ }}+ {{i18n "user.email.instructions"}}+ {{/if}}+ </span>+ {{/if}}+ </div>- <PluginOutlet- @name="create-account-before-password"- @outletArgs={{hash- accountName=this.accountName- accountUsername=this.accountUsername- accountPassword=this.accountPassword- userFields=this.userFields- authOptions=this.authOptions- }}- />+ <div class="input-group create-account__username">+ <input+ {{on "focusin" this.scrollInputIntoView}}+ {{on "input" this.setAccountUsername}}+ type="text"+ value={{this.accountUsername}}+ disabled={{this.usernameDisabled}}+ maxlength={{this.maxUsernameLength}}+ aria-describedby="username-validation username-validation-more-info"+ aria-invalid={{this.usernameValidation.failed}}+ autocomplete="off"+ name="username"+ id="new-account-username"+ class={{valueEntered this.accountUsername}}+ />+ <label class="alt-placeholder" for="new-account-username">+ {{i18n "user.username.title"}}+ </label>++ {{#if this.showUsernameInstructions}}+ <span class="more-info" id="username-validation-more-info">+ {{i18n "user.username.instructions"}}+ </span>++ {{else}}+ <InputTip+ @validation={{this.usernameValidation}}+ id="username-validation"+ />+ {{/if}}+ </div>- <div class="input-group create-account__password">- {{#if this.passwordRequired}}- <PasswordField- {{on "focusin" this.scrollInputIntoView}}- @value={{this.accountPassword}}- @capsLockOn={{this.capsLockOn}}- type={{if this.maskPassword "password" "text"}}- autocomplete="current-password"- aria-describedby="password-validation password-validation-more-info"- aria-invalid={{this.passwordValidation.failed}}- id="new-account-password"- class={{value-entered this.accountPassword}}+ {{#if (and this.showFullname this.fullnameRequired)}}+ <FullnameInput+ @nameValidation={{this.nameValidation}}+ @nameTitle={{this.nameTitle}}+ @accountName={{this.accountName}}+ @nameDisabled={{this.nameDisabled}}+ @onFocusIn={{this.scrollInputIntoView}}+ class="input-group create-account__fullname required"+ />+ {{/if}}++ <PluginOutlet+ @name="create-account-before-password"+ @outletArgs={{hash+ accountName=this.accountName+ accountUsername=this.accountUsername+ accountPassword=this.accountPassword+ userFields=this.userFields+ authOptions=this.authOptions+ }}/>- <label class="alt-placeholder" for="new-account-password">- {{i18n "user.password.title"}}- </label>- <TogglePasswordMask- @maskPassword={{this.maskPassword}}- @togglePasswordMask={{this.togglePasswordMask}}- />- <div class="create-account__password-info">- <div class="create-account__password-tip-validation">- {{#if this.showPasswordValidation}}- <InputTip- @validation={{this.passwordValidation}}- id="password-validation"- />- {{else if- this.siteSettings.show_signup_form_password_instructions- }}- <span class="more-info" id="password-validation-more-info">- {{this.passwordValidationHelper.passwordInstructions}}- </span>- {{/if}}- <div- class={{concat-class- "caps-lock-warning"- (unless this.capsLockOn "hidden")- }}- >- {{d-icon "triangle-exclamation"}}- {{i18n "login.caps_lock_warning"}}++ <div class="input-group create-account__password">+ {{#if this.passwordRequired}}+ <PasswordField+ {{on "focusin" this.scrollInputIntoView}}+ @value={{this.accountPassword}}+ @capsLockOn={{this.capsLockOn}}+ type={{if this.maskPassword "password" "text"}}+ autocomplete="current-password"+ aria-describedby="password-validation password-validation-more-info"+ aria-invalid={{this.passwordValidation.failed}}+ id="new-account-password"+ class={{valueEntered this.accountPassword}}+ />+ <label class="alt-placeholder" for="new-account-password">+ {{i18n "user.password.title"}}+ </label>+ <TogglePasswordMask+ @maskPassword={{this.maskPassword}}+ @togglePasswordMask={{this.togglePasswordMask}}+ />+ <div class="create-account__password-info">+ <div class="create-account__password-tip-validation">+ {{#if this.showPasswordValidation}}+ <InputTip+ @validation={{this.passwordValidation}}+ id="password-validation"+ />+ {{else if+ this.siteSettings.show_signup_form_password_instructions+ }}+ <span+ class="more-info"+ id="password-validation-more-info"+ >+ {{this.passwordValidationHelper.passwordInstructions}}+ </span>+ {{/if}}+ <div+ class={{concatClass+ "caps-lock-warning"+ (unless this.capsLockOn "hidden")+ }}+ >+ {{icon "triangle-exclamation"}}+ {{i18n "login.caps_lock_warning"}}+ </div>+ </div></div>+ {{/if}}++ <div class="password-confirmation">+ <label for="new-account-password-confirmation">+ {{i18n "user.password_confirmation.title"}}+ </label>+ <HoneypotInput+ @id="new-account-confirmation"+ @autocomplete="new-password"+ @value={{this.accountHoneypot}}+ />+ <Input+ @value={{this.accountChallenge}}+ id="new-account-challenge"+ /></div></div>- {{/if}}- <div class="password-confirmation">- <label for="new-account-password-confirmation">- {{i18n "user.password_confirmation.title"}}- </label>- <HoneypotInput- @id="new-account-confirmation"- @autocomplete="new-password"- @value={{this.accountHoneypot}}- />- <Input- @value={{this.accountChallenge}}- id="new-account-challenge"+ {{#if this.requireInviteCode}}+ <div class="input-group create-account__invite-code">+ <Input+ {{on "focusin" this.scrollInputIntoView}}+ @value={{this.inviteCode}}+ id="inviteCode"+ class={{valueEntered this.inviteCode}}+ />+ <label class="alt-placeholder" for="invite-code">+ {{i18n "user.invite_code.title"}}+ </label>+ <span class="more-info">+ {{i18n "user.invite_code.instructions"}}+ </span>+ </div>+ {{/if}}++ <PluginOutlet+ @name="create-account-after-password"+ @outletArgs={{hash+ accountName=this.accountName+ accountUsername=this.accountUsername+ accountPassword=this.accountPassword+ userFields=this.userFields+ }}/>- </div>- </div>- {{#if this.requireInviteCode}}- <div class="input-group create-account__invite-code">- <Input- {{on "focusin" this.scrollInputIntoView}}- @value={{this.inviteCode}}- id="inviteCode"- class={{value-entered this.inviteCode}}+ {{#if (and this.showFullname (not this.fullnameRequired))}}+ <FullnameInput+ @nameValidation={{this.nameValidation}}+ @nameTitle={{this.nameTitle}}+ @accountName={{this.accountName}}+ @nameDisabled={{this.nameDisabled}}+ @onFocusIn={{this.scrollInputIntoView}}+ class="input-group create-account__fullname"+ />+ {{/if}}++ {{#if this.userFields}}+ <div class="user-fields">+ {{#each this.userFields as |f|}}+ <div class="input-group">+ <UserField+ {{on "focusin" this.scrollInputIntoView}}+ @field={{f.field}}+ @value={{f.value}}+ @validation={{f.validation}}+ class={{valueEntered f.value}}+ />+ </div>+ {{/each}}+ </div>+ {{/if}}++ <PluginOutlet+ @name="create-account-after-user-fields"+ @outletArgs={{hash+ accountName=this.accountName+ accountUsername=this.accountUsername+ accountPassword=this.accountPassword+ userFields=this.userFields+ }}/>- <label class="alt-placeholder" for="invite-code">- {{i18n "user.invite_code.title"}}- </label>- <span class="more-info">- {{i18n "user.invite_code.instructions"}}- </span>- </div>- {{/if}}-- <PluginOutlet- @name="create-account-after-password"- @outletArgs={{hash- accountName=this.accountName- accountUsername=this.accountUsername- accountPassword=this.accountPassword- userFields=this.userFields- }}- />+ </form>++ {{#if this.site.desktopView}}+ <div class="d-modal__footer">+ <SignupPageCta+ @formSubmitted={{this.formSubmitted}}+ @hasAuthOptions={{this.hasAuthOptions}}+ @createAccount={{this.createAccount}}+ @submitDisabled={{this.submitDisabled}}+ @disclaimerHtml={{this.disclaimerHtml}}+ />+ </div>- {{#if (and this.showFullname (not this.fullnameRequired))}}- <FullnameInput- @nameValidation={{this.nameValidation}}- @nameTitle={{this.nameTitle}}- @accountName={{this.accountName}}- @nameDisabled={{this.nameDisabled}}- @onFocusIn={{this.scrollInputIntoView}}- class="input-group create-account__fullname"- />+ <PluginOutlet+ @name="create-account-after-modal-footer"+ @connectorTagName="div"+ />+ {{/if}}{{/if}}- {{#if this.userFields}}- <div class="user-fields">- {{#each this.userFields as |f|}}- <div class="input-group">- <UserField- {{on "focusin" this.scrollInputIntoView}}- @field={{f.field}}- @value={{f.value}}- @validation={{f.validation}}- class={{value-entered f.value}}- />- </div>- {{/each}}- </div>+ {{#if this.skipConfirmation}}+ {{loadingSpinner size="large"}}{{/if}}-- <PluginOutlet- @name="create-account-after-user-fields"- @outletArgs={{hash- accountName=this.accountName- accountUsername=this.accountUsername- accountPassword=this.accountPassword- userFields=this.userFields- }}- />- </form>-- {{#if this.site.desktopView}}- <div class="d-modal__footer">- <SignupPageCta- @formSubmitted={{this.formSubmitted}}- @hasAuthOptions={{this.hasAuthOptions}}- @createAccount={{this.createAccount}}- @submitDisabled={{this.submitDisabled}}- @disclaimerHtml={{this.disclaimerHtml}}+ </div>++ {{#if this.hasAtLeastOneLoginButton}}+ {{#if this.site.mobileView}}+ <div class="login-or-separator"><span>+ {{i18n "login.or"}}</span></div>{{/if}}+ <div class="login-right-side">+ <LoginButtons+ @externalLogin={{this.externalLogin}}+ @context="create-account"/></div>-- <PluginOutlet- @name="create-account-after-modal-footer"- @connectorTagName="div"+ {{/if}}+ </:body>++ <:footer>+ {{#if (and this.showCreateForm this.site.mobileView)}}+ <SignupPageCta+ @formSubmitted={{this.formSubmitted}}+ @hasAuthOptions={{this.hasAuthOptions}}+ @createAccount={{this.createAccount}}+ @submitDisabled={{this.submitDisabled}}+ @disclaimerHtml={{this.disclaimerHtml}}/>{{/if}}- {{/if}}-- {{#if this.skipConfirmation}}- {{loading-spinner size="large"}}- {{/if}}- </div>-- {{#if this.hasAtLeastOneLoginButton}}- {{#if this.site.mobileView}}- <div class="login-or-separator"><span>- {{i18n "login.or"}}</span></div>{{/if}}- <div class="login-right-side">- <LoginButtons- @externalLogin={{this.externalLogin}}- @context="create-account"- />- </div>- {{/if}}- </:body>-- <:footer>- {{#if (and this.showCreateForm this.site.mobileView)}}- <SignupPageCta- @formSubmitted={{this.formSubmitted}}- @hasAuthOptions={{this.hasAuthOptions}}- @createAccount={{this.createAccount}}- @submitDisabled={{this.submitDisabled}}- @disclaimerHtml={{this.disclaimerHtml}}- />- {{/if}}- </:footer>-</DModal>\ No newline at end of file+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/create-invite-bulk.gjs b/app/assets/javascripts/discourse/app/components/modal/create-invite-bulk.gjsindex 3e4d8b54a68..e87abdbdc1a 100644--- a/app/assets/javascripts/discourse/app/components/modal/create-invite-bulk.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/create-invite-bulk.gjs@@ -1,41 +1,51 @@-<CreateInviteUploader @autoFindInput={{false}} as |uploader setElement|>- <DModal- @title={{i18n "user.invited.bulk_invite.text"}}- class="create-invite-bulk-modal -large"- @closeModal={{@closeModal}}- >- <:body>- {{#if uploader.uploaded}}- {{i18n "user.invited.bulk_invite.success"}}- {{else}}- {{html-safe (i18n "user.invited.bulk_invite.instructions")}}- <input- id="csv-file"- disabled={{uploader.uploading}}- type="file"- accept=".csv"- {{did-insert setElement}}- />- {{/if}}- </:body>- <:footer>- {{#unless uploader.uploaded}}- <DButton- @icon="link"- @translatedLabel={{if- uploader.uploading- (i18n- "user.invited.bulk_invite.progress"- progress=uploader.uploadProgress- )- (i18n "user.invited.bulk_invite.text")- }}- class="btn-primary"- @action={{uploader.startUpload}}- @disabled={{uploader.submitDisabled}}- />- {{/unless}}- <DButton @label="close" class="btn-primary" @action={{@closeModal}} />- </:footer>- </DModal>-</CreateInviteUploader>\ No newline at end of file+import didInsert from "@ember/render-modifiers/modifiers/did-insert";+import { htmlSafe } from "@ember/template";+import CreateInviteUploader from "discourse/components/create-invite-uploader";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";+import { i18n } from "discourse-i18n";++const CreateInviteBulk = <template>+ <CreateInviteUploader @autoFindInput={{false}} as |uploader setElement|>+ <DModal+ @title={{i18n "user.invited.bulk_invite.text"}}+ class="create-invite-bulk-modal -large"+ @closeModal={{@closeModal}}+ >+ <:body>+ {{#if uploader.uploaded}}+ {{i18n "user.invited.bulk_invite.success"}}+ {{else}}+ {{htmlSafe (i18n "user.invited.bulk_invite.instructions")}}+ <input+ id="csv-file"+ disabled={{uploader.uploading}}+ type="file"+ accept=".csv"+ {{didInsert setElement}}+ />+ {{/if}}+ </:body>+ <:footer>+ {{#unless uploader.uploaded}}+ <DButton+ @icon="link"+ @translatedLabel={{if+ uploader.uploading+ (i18n+ "user.invited.bulk_invite.progress"+ progress=uploader.uploadProgress+ )+ (i18n "user.invited.bulk_invite.text")+ }}+ class="btn-primary"+ @action={{uploader.startUpload}}+ @disabled={{uploader.submitDisabled}}+ />+ {{/unless}}+ <DButton @label="close" class="btn-primary" @action={{@closeModal}} />+ </:footer>+ </DModal>+ </CreateInviteUploader>+</template>;+export default CreateInviteBulk;diff --git a/app/assets/javascripts/discourse/app/components/modal/delete-themes-confirm.gjs b/app/assets/javascripts/discourse/app/components/modal/delete-themes-confirm.gjsindex 52be24d38b8..6fc61ddeccc 100644--- a/app/assets/javascripts/discourse/app/components/modal/delete-themes-confirm.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/delete-themes-confirm.gjs@@ -1,7 +1,12 @@import Component from "@glimmer/component";+import { concat } from "@ember/helper";import { action } from "@ember/object";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";+import DModalCancel from "discourse/components/d-modal-cancel";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";+import { i18n } from "discourse-i18n";export default class DeleteThemesConfirmComponent extends Component {@action@@ -18,23 +23,29 @@ export default class DeleteThemesConfirmComponent extends Component {}).catch(popupAjaxError);}-}-<DModal- @closeModal={{@closeModal}}- @title={{i18n "admin.customize.bulk_delete"}}->- <:body>- {{i18n (concat "admin.customize.bulk_" @model.type "_delete_confirm")}}- <ul>- {{#each @model.selectedThemesOrComponents as |theme|}}- <li>{{theme.name}}</li>- {{/each}}- </ul>+ <template>+ <DModal+ @closeModal={{@closeModal}}+ @title={{i18n "admin.customize.bulk_delete"}}+ >+ <:body>+ {{i18n (concat "admin.customize.bulk_" @model.type "_delete_confirm")}}+ <ul>+ {{#each @model.selectedThemesOrComponents as |theme|}}+ <li>{{theme.name}}</li>+ {{/each}}+ </ul>- </:body>- <:footer>- <DButton class="btn-primary" @action={{this.delete}} @label="yes_value" />- <DModalCancel @close={{@closeModal}} />- </:footer>-</DModal>\ No newline at end of file+ </:body>+ <:footer>+ <DButton+ class="btn-primary"+ @action={{this.delete}}+ @label="yes_value"+ />+ <DModalCancel @close={{@closeModal}} />+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/delete-topic-confirm.gjs b/app/assets/javascripts/discourse/app/components/modal/delete-topic-confirm.gjsindex 50a7ad2c463..596b4c2e06f 100644--- a/app/assets/javascripts/discourse/app/components/modal/delete-topic-confirm.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/delete-topic-confirm.gjs@@ -2,6 +2,8 @@ import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";import { action } from "@ember/object";import { service } from "@ember/service";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";import { i18n } from "discourse-i18n";// Modal that displays confirmation text when user deletes a topic@@ -24,37 +26,39 @@ export default class DeleteTopicConfirm extends Component {this.deletingTopic = false;}}-}-<DModal- @title={{i18n "topic.actions.delete"}}- @closeModal={{@closeModal}}- class="delete-topic-confirm-modal"- @flash={{this.flash}}->- <:body>- <p>- {{i18n- "post.controls.delete_topic_confirm_modal"- count=this.siteSettings.min_topic_views_for_delete_confirm- }}- </p>- </:body>- <:footer>- <DButton- @action={{this.deleteTopic}}- @disabled={{this.deletingTopic}}- @label={{if- this.deletingTopic- "deleting"- "post.controls.delete_topic_confirm_modal_yes"- }}- class="btn-danger"- />- <DButton- @action={{@closeModal}}- @label="post.controls.delete_topic_confirm_modal_no"- class="btn-primary"- />- </:footer>-</DModal>\ No newline at end of file+ <template>+ <DModal+ @title={{i18n "topic.actions.delete"}}+ @closeModal={{@closeModal}}+ class="delete-topic-confirm-modal"+ @flash={{this.flash}}+ >+ <:body>+ <p>+ {{i18n+ "post.controls.delete_topic_confirm_modal"+ count=this.siteSettings.min_topic_views_for_delete_confirm+ }}+ </p>+ </:body>+ <:footer>+ <DButton+ @action={{this.deleteTopic}}+ @disabled={{this.deletingTopic}}+ @label={{if+ this.deletingTopic+ "deleting"+ "post.controls.delete_topic_confirm_modal_yes"+ }}+ class="btn-danger"+ />+ <DButton+ @action={{@closeModal}}+ @label="post.controls.delete_topic_confirm_modal_no"+ class="btn-primary"+ />+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/delete-topic-disallowed.gjs b/app/assets/javascripts/discourse/app/components/modal/delete-topic-disallowed.gjsindex 7d469645167..b0747980b11 100644--- a/app/assets/javascripts/discourse/app/components/modal/delete-topic-disallowed.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/delete-topic-disallowed.gjs@@ -1,8 +1,16 @@-<DModal @closeModal={{@closeModal}}>- <:body>- <p>{{html-safe (i18n "post.controls.delete_topic_disallowed_modal")}}</p>- </:body>- <:footer>- <DButton @action={{@closeModal}} class="btn-primary" @label="close" />- </:footer>-</DModal>\ No newline at end of file+import { htmlSafe } from "@ember/template";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";+import { i18n } from "discourse-i18n";++const DeleteTopicDisallowed = <template>+ <DModal @closeModal={{@closeModal}}>+ <:body>+ <p>{{htmlSafe (i18n "post.controls.delete_topic_disallowed_modal")}}</p>+ </:body>+ <:footer>+ <DButton @action={{@closeModal}} class="btn-primary" @label="close" />+ </:footer>+ </DModal>+</template>;+export default DeleteTopicDisallowed;diff --git a/app/assets/javascripts/discourse/app/components/modal/dismiss-notification-confirmation.gjs b/app/assets/javascripts/discourse/app/components/modal/dismiss-notification-confirmation.gjsindex dbd113244ce..fdaf32f7e75 100644--- a/app/assets/javascripts/discourse/app/components/modal/dismiss-notification-confirmation.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/dismiss-notification-confirmation.gjs@@ -1,5 +1,7 @@import Component from "@glimmer/component";import { action } from "@ember/object";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";export default class DismissNotificationConfirmation extends Component {@action@@ -7,27 +9,29 @@ export default class DismissNotificationConfirmation extends Component {this.args.model?.dismissNotifications?.();this.args.closeModal();}-}-<DModal- @headerClass="hidden"- class="dismiss-notification-confirmation"- @closeModal={{@closeModal}}->- <:body>- {{@model.confirmationMessage}}- </:body>- <:footer>- <DButton- @icon="check"- class="btn-primary"- @action={{this.dismiss}}- @label="notifications.dismiss_confirmation.dismiss"- />- <DButton- @action={{@closeModal}}- @label="notifications.dismiss_confirmation.cancel"- class="btn-default"- />- </:footer>-</DModal>\ No newline at end of file+ <template>+ <DModal+ @headerClass="hidden"+ class="dismiss-notification-confirmation"+ @closeModal={{@closeModal}}+ >+ <:body>+ {{@model.confirmationMessage}}+ </:body>+ <:footer>+ <DButton+ @icon="check"+ class="btn-primary"+ @action={{this.dismiss}}+ @label="notifications.dismiss_confirmation.dismiss"+ />+ <DButton+ @action={{@closeModal}}+ @label="notifications.dismiss_confirmation.cancel"+ class="btn-default"+ />+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/download-calendar.gjs b/app/assets/javascripts/discourse/app/components/modal/download-calendar.gjsindex 28b04c1a515..8c97ee37a29 100644--- a/app/assets/javascripts/discourse/app/components/modal/download-calendar.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/download-calendar.gjs@@ -1,8 +1,14 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { Input } from "@ember/component";+import { fn } from "@ember/helper";import { action } from "@ember/object";import { service } from "@ember/service";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";+import RadioButton from "discourse/components/radio-button";import { downloadGoogle, downloadIcs } from "discourse/lib/download-calendar";+import { i18n } from "discourse-i18n";export default class DownloadCalendar extends Component {@service currentUser;@@ -47,61 +53,63 @@ export default class DownloadCalendar extends Component {selectCalendar(calendar) {this.selectedCalendar = calendar;}-}-<DModal- @title={{i18n "download_calendar.title"}}- class="download-calendar-modal"- @closeModal={{@closeModal}}->- <:body>- <div class="control-group">- <div class="ics">- <label class="radio" for="ics">- <RadioButton- id="ics"- @name="select-calendar"- @value="ics"- @selection={{this.selectedCalendar}}- @onChange={{fn this.selectCalendar "ics"}}- />- {{i18n "download_calendar.save_ics"}}- </label>- </div>- <div class="google">- <label class="radio" for="google">- <RadioButton- id="google"- @name="select-calendar"- @value="google"- @selection={{this.selectedCalendar}}- @onChange={{fn this.selectCalendar "google"}}- />- {{i18n "download_calendar.save_google"}}- </label>- </div>- </div>+ <template>+ <DModal+ @title={{i18n "download_calendar.title"}}+ class="download-calendar-modal"+ @closeModal={{@closeModal}}+ >+ <:body>+ <div class="control-group">+ <div class="ics">+ <label class="radio" for="ics">+ <RadioButton+ id="ics"+ @name="select-calendar"+ @value="ics"+ @selection={{this.selectedCalendar}}+ @onChange={{fn this.selectCalendar "ics"}}+ />+ {{i18n "download_calendar.save_ics"}}+ </label>+ </div>+ <div class="google">+ <label class="radio" for="google">+ <RadioButton+ id="google"+ @name="select-calendar"+ @value="google"+ @selection={{this.selectedCalendar}}+ @onChange={{fn this.selectCalendar "google"}}+ />+ {{i18n "download_calendar.save_google"}}+ </label>+ </div>+ </div>- {{#if this.currentUser}}- <div class="control-group remember">- <label class="checkbox-label">- <Input @type="checkbox" @checked={{this.remember}} />- <span>{{i18n "download_calendar.remember"}}</span>- </label>- <span>{{i18n "download_calendar.remember_explanation"}}</span>- </div>- {{/if}}- </:body>- <:footer>- <DButton- class="btn-primary"- @action={{this.downloadCalendar}}- @label="download_calendar.download"- />- <DButton- class="btn-flat d-modal-cancel"- @action={{@closeModal}}- @label="cancel"- />- </:footer>-</DModal>\ No newline at end of file+ {{#if this.currentUser}}+ <div class="control-group remember">+ <label class="checkbox-label">+ <Input @type="checkbox" @checked={{this.remember}} />+ <span>{{i18n "download_calendar.remember"}}</span>+ </label>+ <span>{{i18n "download_calendar.remember_explanation"}}</span>+ </div>+ {{/if}}+ </:body>+ <:footer>+ <DButton+ class="btn-primary"+ @action={{this.downloadCalendar}}+ @label="download_calendar.download"+ />+ <DButton+ class="btn-flat d-modal-cancel"+ @action={{@closeModal}}+ @label="cancel"+ />+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/edit-topic-timer.gjs b/app/assets/javascripts/discourse/app/components/modal/edit-topic-timer.gjsindex bfb0d810f8c..33636d8de62 100644--- a/app/assets/javascripts/discourse/app/components/modal/edit-topic-timer.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/edit-topic-timer.gjs@@ -4,6 +4,9 @@ import { action } from "@ember/object";import { next } from "@ember/runloop";import { service } from "@ember/service";import { TrackedObject } from "@ember-compat/tracked-built-ins";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";+import EditTopicTimerForm from "discourse/components/edit-topic-timer-form";import { popupAjaxError } from "discourse/lib/ajax-error";import TopicTimer from "discourse/models/topic-timer";import { i18n } from "discourse-i18n";@@ -226,41 +229,43 @@ export default class EditTopicTimer extends Component {// which will hide the remove timer button from the modalthis.topicTimer.execute_at = null;}-}-<DModal- @title={{i18n "topic.topic_status_update.title"}}- @flash={{this.flash}}- @closeModal={{@closeModal}}- autoFocus="false"- id="topic-timer-modal"- class="edit-topic-timer-modal"->- <:body>- {{#if this.topicTimer}}- <EditTopicTimerForm- @topic={{@model.topic}}- @topicTimer={{this.topicTimer}}- @timerTypes={{this.publicTimerTypes}}- @onChangeStatusType={{this.onChangeStatusType}}- @onChangeInput={{this.onChangeInput}}- />- {{/if}}- </:body>- <:footer>- <DButton- class="btn-primary"- @disabled={{this.saveDisabled}}- @label="topic.topic_status_update.save"- @action={{this.saveTimer}}- @isLoading={{this.loading}}- />- {{#if this.topicTimer.execute_at}}- <DButton- class="btn-danger"- @action={{this.removeTimer}}- @label="topic.topic_status_update.remove"- />- {{/if}}- </:footer>-</DModal>\ No newline at end of file+ <template>+ <DModal+ @title={{i18n "topic.topic_status_update.title"}}+ @flash={{this.flash}}+ @closeModal={{@closeModal}}+ autoFocus="false"+ id="topic-timer-modal"+ class="edit-topic-timer-modal"+ >+ <:body>+ {{#if this.topicTimer}}+ <EditTopicTimerForm+ @topic={{@model.topic}}+ @topicTimer={{this.topicTimer}}+ @timerTypes={{this.publicTimerTypes}}+ @onChangeStatusType={{this.onChangeStatusType}}+ @onChangeInput={{this.onChangeInput}}+ />+ {{/if}}+ </:body>+ <:footer>+ <DButton+ class="btn-primary"+ @disabled={{this.saveDisabled}}+ @label="topic.topic_status_update.save"+ @action={{this.saveTimer}}+ @isLoading={{this.loading}}+ />+ {{#if this.topicTimer.execute_at}}+ <DButton+ class="btn-danger"+ @action={{this.removeTimer}}+ @label="topic.topic_status_update.remove"+ />+ {{/if}}+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/edit-user-directory-columns.gjs b/app/assets/javascripts/discourse/app/components/modal/edit-user-directory-columns.gjsindex 2040c2cb898..77f41bdb5b0 100644--- a/app/assets/javascripts/discourse/app/components/modal/edit-user-directory-columns.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/edit-user-directory-columns.gjs@@ -1,9 +1,18 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { Input } from "@ember/component";+import { fn } from "@ember/helper";import { action } from "@ember/object";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";+import directoryColumnIsAutomatic from "discourse/helpers/directory-column-is-automatic";+import directoryColumnIsUserField from "discourse/helpers/directory-column-is-user-field";+import directoryTableHeaderTitle from "discourse/helpers/directory-table-header-title";+import loadingSpinner from "discourse/helpers/loading-spinner";import { reload } from "discourse/helpers/page-reloader";import { ajax } from "discourse/lib/ajax";import { extractError, popupAjaxError } from "discourse/lib/ajax-error";+import { i18n } from "discourse-i18n";const UP = "up";const DOWN = "down";@@ -103,70 +112,72 @@ export default class EditUserDirectoryColumns extends Component {a.position > b.position ? 1 : -1);}-}-<DModal- @closeModal={{@closeModal}}- @title={{i18n "directory.edit_columns.title"}}- class="edit-user-directory-columns-modal"- @flash={{this.flash}}->- <:body>- {{#if this.loading}}- {{loading-spinner size="large"}}- {{else}}- <div class="edit-directory-columns-container">- {{#each this.columns as |column|}}- <div class="edit-directory-column">- <div class="left-content">- <label class="column-name">- <Input @type="checkbox" @checked={{column.enabled}} />- {{#if (directory-column-is-automatic column=column)}}- {{directory-table-header-title- field=column.name- labelKey=this.labelKey- icon=column.icon- }}- {{else if (directory-column-is-user-field column=column)}}- {{directory-table-header-title- field=column.user_field.name- translated=true- }}- {{else}}- {{directory-table-header-title- field=(i18n column.name)- translated=true- }}- {{/if}}- </label>- </div>- <div class="right-content">- <DButton- @icon="arrow-up"- @action={{fn this.moveUp column}}- class="button-secondary move-column-up"- />- <DButton- @icon="arrow-down"- @action={{fn this.moveDown column}}- class="button-secondary"- />- </div>+ <template>+ <DModal+ @closeModal={{@closeModal}}+ @title={{i18n "directory.edit_columns.title"}}+ class="edit-user-directory-columns-modal"+ @flash={{this.flash}}+ >+ <:body>+ {{#if this.loading}}+ {{loadingSpinner size="large"}}+ {{else}}+ <div class="edit-directory-columns-container">+ {{#each this.columns as |column|}}+ <div class="edit-directory-column">+ <div class="left-content">+ <label class="column-name">+ <Input @type="checkbox" @checked={{column.enabled}} />+ {{#if (directoryColumnIsAutomatic column=column)}}+ {{directoryTableHeaderTitle+ field=column.name+ labelKey=this.labelKey+ icon=column.icon+ }}+ {{else if (directoryColumnIsUserField column=column)}}+ {{directoryTableHeaderTitle+ field=column.user_field.name+ translated=true+ }}+ {{else}}+ {{directoryTableHeaderTitle+ field=(i18n column.name)+ translated=true+ }}+ {{/if}}+ </label>+ </div>+ <div class="right-content">+ <DButton+ @icon="arrow-up"+ @action={{fn this.moveUp column}}+ class="button-secondary move-column-up"+ />+ <DButton+ @icon="arrow-down"+ @action={{fn this.moveDown column}}+ class="button-secondary"+ />+ </div>+ </div>+ {{/each}}</div>- {{/each}}- </div>- {{/if}}- </:body>- <:footer>- <DButton- @label="directory.edit_columns.save"- @action={{this.save}}- class="btn-primary"- />- <DButton- @label="directory.edit_columns.reset_to_default"- @action={{this.resetToDefault}}- class="btn-secondary reset-to-default"- />- </:footer>-</DModal>\ No newline at end of file+ {{/if}}+ </:body>+ <:footer>+ <DButton+ @label="directory.edit_columns.save"+ @action={{this.save}}+ class="btn-primary"+ />+ <DButton+ @label="directory.edit_columns.reset_to_default"+ @action={{this.resetToDefault}}+ class="btn-secondary reset-to-default"+ />+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/explain-reviewable.gjs b/app/assets/javascripts/discourse/app/components/modal/explain-reviewable.gjsindex 25965f6e28e..28344fef87e 100644--- a/app/assets/javascripts/discourse/app/components/modal/explain-reviewable.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/explain-reviewable.gjs@@ -2,6 +2,12 @@ import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";import { action } from "@ember/object";import { service } from "@ember/service";+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";+import ScoreValue from "discourse/components/score-value";+import float from "discourse/helpers/float";+import { i18n } from "discourse-i18n";export default class ExplainReviewable extends Component {@service store;@@ -26,70 +32,72 @@ export default class ExplainReviewable extends Component {this.loading = false;}}-}-<DModal- class="explain-reviewable"- @closeModal={{@closeModal}}- @title={{i18n "review.explain.title"}}->- <:body>- <ConditionalLoadingSpinner @condition={{this.loading}}>- <table>- <tbody>- <tr>- <th>{{i18n "review.explain.formula"}}</th>- <th>{{i18n "review.explain.subtotal"}}</th>- </tr>- {{#each this.reviewableExplanation.scores as |s|}}- <tr>- <td>- <ScoreValue @value="1.0" />- <ScoreValue @value={{s.type_bonus}} @label="type_bonus" />- <ScoreValue- @value={{s.take_action_bonus}}- @label="take_action_bonus"- />- <ScoreValue- @value={{s.trust_level_bonus}}- @label="trust_level_bonus"- />- <ScoreValue- @value={{s.user_accuracy_bonus}}- @label="user_accuracy_bonus"- />- </td>- <td class="sum">{{float s.score}}</td>- </tr>- {{/each}}- <tr class="total">- <td>{{i18n "review.explain.total"}}</td>- <td class="sum">- {{float this.reviewableExplanation.total_score}}- </td>- </tr>- </tbody>- </table>+ <template>+ <DModal+ class="explain-reviewable"+ @closeModal={{@closeModal}}+ @title={{i18n "review.explain.title"}}+ >+ <:body>+ <ConditionalLoadingSpinner @condition={{this.loading}}>+ <table>+ <tbody>+ <tr>+ <th>{{i18n "review.explain.formula"}}</th>+ <th>{{i18n "review.explain.subtotal"}}</th>+ </tr>+ {{#each this.reviewableExplanation.scores as |s|}}+ <tr>+ <td>+ <ScoreValue @value="1.0" />+ <ScoreValue @value={{s.type_bonus}} @label="type_bonus" />+ <ScoreValue+ @value={{s.take_action_bonus}}+ @label="take_action_bonus"+ />+ <ScoreValue+ @value={{s.trust_level_bonus}}+ @label="trust_level_bonus"+ />+ <ScoreValue+ @value={{s.user_accuracy_bonus}}+ @label="user_accuracy_bonus"+ />+ </td>+ <td class="sum">{{float s.score}}</td>+ </tr>+ {{/each}}+ <tr class="total">+ <td>{{i18n "review.explain.total"}}</td>+ <td class="sum">+ {{float this.reviewableExplanation.total_score}}+ </td>+ </tr>+ </tbody>+ </table>- <table class="thresholds">- <tbody>- <tr>- <td>{{i18n "review.explain.min_score_visibility"}}</td>- <td class="sum">- {{float this.reviewableExplanation.min_score_visibility}}- </td>- </tr>- <tr>- <td>{{i18n "review.explain.score_to_hide"}}</td>- <td class="sum">- {{float this.reviewableExplanation.hide_post_score}}- </td>- </tr>- </tbody>- </table>- </ConditionalLoadingSpinner>- </:body>- <:footer>- <DButton @action={{@closeModal}} @label="close" />- </:footer>-</DModal>\ No newline at end of file+ <table class="thresholds">+ <tbody>+ <tr>+ <td>{{i18n "review.explain.min_score_visibility"}}</td>+ <td class="sum">+ {{float this.reviewableExplanation.min_score_visibility}}+ </td>+ </tr>+ <tr>+ <td>{{i18n "review.explain.score_to_hide"}}</td>+ <td class="sum">+ {{float this.reviewableExplanation.hide_post_score}}+ </td>+ </tr>+ </tbody>+ </table>+ </ConditionalLoadingSpinner>+ </:body>+ <:footer>+ <DButton @action={{@closeModal}} @label="close" />+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/fast-edit.gjs b/app/assets/javascripts/discourse/app/components/modal/fast-edit.gjsindex ba9dd604802..e8c05353195 100644--- a/app/assets/javascripts/discourse/app/components/modal/fast-edit.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/fast-edit.gjs@@ -1,8 +1,16 @@-<DModal @title={{i18n "post.quote_edit"}} @closeModal={{@closeModal}}>- <FastEdit- @newValue={{@model.newValue}}- @initialValue={{@model.initialValue}}- @post={{@model.post}}- @close={{@closeModal}}- />-</DModal>\ No newline at end of file+import DModal from "discourse/components/d-modal";+import FastEdit from "discourse/components/fast-edit";+import { i18n } from "discourse-i18n";++const FastEditModal = <template>+ <DModal @title={{i18n "post.quote_edit"}} @closeModal={{@closeModal}}>+ <FastEdit+ @newValue={{@model.newValue}}+ @initialValue={{@model.initialValue}}+ @post={{@model.post}}+ @close={{@closeModal}}+ />+ </DModal>+</template>;++export default FastEditModal;diff --git a/app/assets/javascripts/discourse/app/components/modal/feature-topic-on-profile.gjs b/app/assets/javascripts/discourse/app/components/modal/feature-topic-on-profile.gjsindex 5081ddea128..5d80a49e2c8 100644--- a/app/assets/javascripts/discourse/app/components/modal/feature-topic-on-profile.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/feature-topic-on-profile.gjs@@ -1,8 +1,12 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";import { action } from "@ember/object";+import ChooseTopic from "discourse/components/choose-topic";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";+import { i18n } from "discourse-i18n";export default class FeatureTopicOnProfile extends Component {@tracked newFeaturedTopic = null;@@ -34,30 +38,32 @@ export default class FeatureTopicOnProfile extends Component {newTopicSelected(topic) {this.newFeaturedTopic = topic;}-}-<DModal- @closeModal={{@closeModal}}- class="feature-topic-on-profile choose-topic-modal"- id="choosing-topic"- @title={{i18n "user.feature_topic_on_profile.title"}}->- <:body>- <ChooseTopic- @topicChangedCallback={{this.newTopicSelected}}- @currentTopicId={{@model.user.featured_topic.id}}- @loadOnInit={{true}}- @additionalFilters="status:public"- @label="user.feature_topic_on_profile.search_label"- />- </:body>- <:footer>- <DButton- @action={{this.save}}- class="btn-primary save-featured-topic-on-profile"- @disabled={{this.noTopicSelected}}- @label="user.feature_topic_on_profile.save"- />- <DButton @action={{@closeModal}} @label="cancel" class="btn-flat" />- </:footer>-</DModal>\ No newline at end of file+ <template>+ <DModal+ @closeModal={{@closeModal}}+ class="feature-topic-on-profile choose-topic-modal"+ id="choosing-topic"+ @title={{i18n "user.feature_topic_on_profile.title"}}+ >+ <:body>+ <ChooseTopic+ @topicChangedCallback={{this.newTopicSelected}}+ @currentTopicId={{@model.user.featured_topic.id}}+ @loadOnInit={{true}}+ @additionalFilters="status:public"+ @label="user.feature_topic_on_profile.search_label"+ />+ </:body>+ <:footer>+ <DButton+ @action={{this.save}}+ class="btn-primary save-featured-topic-on-profile"+ @disabled={{this.noTopicSelected}}+ @label="user.feature_topic_on_profile.save"+ />+ <DButton @action={{@closeModal}} @label="cancel" class="btn-flat" />+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/feature-topic.gjs b/app/assets/javascripts/discourse/app/components/modal/feature-topic.gjsindex b68e279779d..357d15faa4e 100644--- a/app/assets/javascripts/discourse/app/components/modal/feature-topic.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/feature-topic.gjs@@ -2,7 +2,14 @@ import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";import EmberObject, { action } from "@ember/object";import { service } from "@ember/service";+import { htmlSafe } from "@ember/template";+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";+import FutureDateInput from "discourse/components/future-date-input";+import PopupInputTip from "discourse/components/popup-input-tip";import { categoryLinkHTML } from "discourse/helpers/category-link";+import icon from "discourse/helpers/d-icon";import { ajax } from "discourse/lib/ajax";import { i18n } from "discourse-i18n";@@ -177,237 +184,243 @@ export default class FeatureTopic extends Component {this.args.model.removeBanner();this.args.closeModal();}-}-<DModal- class="feature-topic"- @title={{i18n "topic.feature_topic.title"}}- @closeModal={{@closeModal}}->- <:body>- {{#if @model.topic.pinned_at}}- <div class="feature-section">- <div class="desc">- {{#if @model.topic.pinned_globally}}- <p>- <ConditionalLoadingSpinner- @size="small"- @condition={{this.loading}}- >- {{#if this.pinnedGloballyCount}}- {{html-safe- (i18n- "topic.feature_topic.already_pinned_globally"- count=this.pinnedGloballyCount- )- }}- {{else}}- {{html-safe (i18n "topic.feature_topic.not_pinned_globally")}}- {{/if}}- </ConditionalLoadingSpinner>- </p>- <p>{{i18n "topic.feature_topic.global_pin_note"}}</p>- {{else}}- <p>- <ConditionalLoadingSpinner- @size="small"- @condition={{this.loading}}- >- {{html-safe this.alreadyPinnedMessage}}- </ConditionalLoadingSpinner>- </p>- <p>{{i18n "topic.feature_topic.pin_note"}}</p>- {{/if}}- <p>{{html-safe this.unPinMessage}}</p>- <p><DButton- @action={{this.unpin}}- @icon="thumbtack"- @label="topic.feature.unpin"- class="btn-primary"- /></p>- </div>- </div>- {{else}}- <div class="feature-section">- <div class="desc">- <p>- <ConditionalLoadingSpinner- @size="small"- @condition={{this.loading}}- >- {{html-safe this.alreadyPinnedMessage}}- </ConditionalLoadingSpinner>- </p>- <p>- {{i18n "topic.feature_topic.pin_note"}}- </p>- {{#if this.site.isMobileDevice}}- <p>- {{html-safe this.pinMessage}}- </p>- <p class="with-validation">- <FutureDateInput- class="pin-until"- @clearable={{true}}- @input={{@model.topic.pinnedInCategoryUntil}}- @onChangeInput={{action- (mut @model.topic.pinnedInCategoryUntil)- }}- />- <PopupInputTip- @validation={{this.pinInCategoryValidation}}- @shownAt={{this.pinInCategoryTipShownAt}}- />- </p>- {{else}}- <p class="with-validation">- {{html-safe this.pinMessage}}- <span>- {{d-icon "far-clock"}}- <FutureDateInput- class="pin-until"- @clearable={{true}}- @input={{@model.topic.pinnedInCategoryUntil}}- @onChangeInput={{action- (mut @model.topic.pinnedInCategoryUntil)- }}- />- <PopupInputTip- @validation={{this.pinInCategoryValidation}}- @shownAt={{this.pinInCategoryTipShownAt}}- />- </span>- </p>- {{/if}}- <p>- <DButton- @action={{this.pin}}- @icon="thumbtack"- @label="topic.feature.pin"- class="btn-primary"- />- </p>- </div>- </div>- {{#if this.canPinGlobally}}- <hr />- <div class="feature-section">- <div class="desc">- <p>- <ConditionalLoadingSpinner- @size="small"- @condition={{this.loading}}- >- {{#if this.pinnedGloballyCount}}- {{html-safe- (i18n- "topic.feature_topic.already_pinned_globally"- count=this.pinnedGloballyCount- )- }}- {{else}}- {{html-safe (i18n "topic.feature_topic.not_pinned_globally")}}- {{/if}}- </ConditionalLoadingSpinner>- </p>- <p>- {{i18n "topic.feature_topic.global_pin_note"}}- </p>- {{#if this.site.isMobileDevice}}+ <template>+ <DModal+ class="feature-topic"+ @title={{i18n "topic.feature_topic.title"}}+ @closeModal={{@closeModal}}+ >+ <:body>+ {{#if @model.topic.pinned_at}}+ <div class="feature-section">+ <div class="desc">+ {{#if @model.topic.pinned_globally}}+ <p>+ <ConditionalLoadingSpinner+ @size="small"+ @condition={{this.loading}}+ >+ {{#if this.pinnedGloballyCount}}+ {{htmlSafe+ (i18n+ "topic.feature_topic.already_pinned_globally"+ count=this.pinnedGloballyCount+ )+ }}+ {{else}}+ {{htmlSafe+ (i18n "topic.feature_topic.not_pinned_globally")+ }}+ {{/if}}+ </ConditionalLoadingSpinner>+ </p>+ <p>{{i18n "topic.feature_topic.global_pin_note"}}</p>+ {{else}}+ <p>+ <ConditionalLoadingSpinner+ @size="small"+ @condition={{this.loading}}+ >+ {{htmlSafe this.alreadyPinnedMessage}}+ </ConditionalLoadingSpinner>+ </p>+ <p>{{i18n "topic.feature_topic.pin_note"}}</p>+ {{/if}}+ <p>{{htmlSafe this.unPinMessage}}</p>+ <p><DButton+ @action={{this.unpin}}+ @icon="thumbtack"+ @label="topic.feature.unpin"+ class="btn-primary"+ /></p>+ </div>+ </div>+ {{else}}+ <div class="feature-section">+ <div class="desc"><p>- {{i18n "topic.feature_topic.pin_globally"}}+ <ConditionalLoadingSpinner+ @size="small"+ @condition={{this.loading}}+ >+ {{htmlSafe this.alreadyPinnedMessage}}+ </ConditionalLoadingSpinner></p>- <p class="with-validation">- <FutureDateInput- class="pin-until"- @clearable={{true}}- @input={{@model.topic.pinnedGloballyUntil}}- @onChangeInput={{action- (mut @model.topic.pinnedGloballyUntil)- }}- />- <PopupInputTip- @validation={{this.pinGloballyValidation}}- @shownAt={{this.pinGloballyTipShownAt}}- />+ <p>+ {{i18n "topic.feature_topic.pin_note"}}</p>- {{else}}- <p class="with-validation">- {{i18n "topic.feature_topic.pin_globally"}}- <span>- {{d-icon "far-clock"}}+ {{#if this.site.isMobileDevice}}+ <p>+ {{htmlSafe this.pinMessage}}+ </p>+ <p class="with-validation"><FutureDateInputclass="pin-until"@clearable={{true}}- @input={{@model.topic.pinnedGloballyUntil}}+ @input={{@model.topic.pinnedInCategoryUntil}}@onChangeInput={{action- (mut @model.topic.pinnedGloballyUntil)+ (mut @model.topic.pinnedInCategoryUntil)}}/><PopupInputTip- @validation={{this.pinGloballyValidation}}- @shownAt={{this.pinGloballyTipShownAt}}+ @validation={{this.pinInCategoryValidation}}+ @shownAt={{this.pinInCategoryTipShownAt}}/>- </span>- </p>- {{/if}}- <p>- <DButton- @action={{this.pinGlobally}}- @icon="thumbtack"- @label="topic.feature.pin_globally"- class="btn-primary"- />- </p>- </div>- </div>- {{/if}}- {{/if}}- <hr />- {{#if this.currentUser.staff}}- <div class="feature-section">- <div class="desc">- <p>- <ConditionalLoadingSpinner- @size="small"- @condition={{this.loading}}- >- {{#if this.bannerCount}}- {{html-safe (i18n "topic.feature_topic.banner_exists")}}+ </p>{{else}}- {{html-safe (i18n "topic.feature_topic.no_banner_exists")}}+ <p class="with-validation">+ {{htmlSafe this.pinMessage}}+ <span>+ {{icon "far-clock"}}+ <FutureDateInput+ class="pin-until"+ @clearable={{true}}+ @input={{@model.topic.pinnedInCategoryUntil}}+ @onChangeInput={{action+ (mut @model.topic.pinnedInCategoryUntil)+ }}+ />+ <PopupInputTip+ @validation={{this.pinInCategoryValidation}}+ @shownAt={{this.pinInCategoryTipShownAt}}+ />+ </span>+ </p>{{/if}}- </ConditionalLoadingSpinner>- </p>- <p>- {{i18n "topic.feature_topic.banner_note"}}- </p>- <p>- {{#if @model.topic.isBanner}}- {{i18n "topic.feature_topic.remove_banner"}}- {{else}}- {{i18n "topic.feature_topic.make_banner"}}- {{/if}}- </p>- <p>- {{#if @model.topic.isBanner}}- <DButton- @action={{this.removeBanner}}- @icon="thumbtack"- @label="topic.feature.remove_banner"- class="btn-primary"- />- {{else}}- <DButton- @action={{this.makeBanner}}- @icon="thumbtack"- @label="topic.feature.make_banner"- class="btn-primary make-banner"- />- {{/if}}- </p>- </div>- </div>- {{/if}}- </:body>-</DModal>\ No newline at end of file+ <p>+ <DButton+ @action={{this.pin}}+ @icon="thumbtack"+ @label="topic.feature.pin"+ class="btn-primary"+ />+ </p>+ </div>+ </div>+ {{#if this.canPinGlobally}}+ <hr />+ <div class="feature-section">+ <div class="desc">+ <p>+ <ConditionalLoadingSpinner+ @size="small"+ @condition={{this.loading}}+ >+ {{#if this.pinnedGloballyCount}}+ {{htmlSafe+ (i18n+ "topic.feature_topic.already_pinned_globally"+ count=this.pinnedGloballyCount+ )+ }}+ {{else}}+ {{htmlSafe+ (i18n "topic.feature_topic.not_pinned_globally")+ }}+ {{/if}}+ </ConditionalLoadingSpinner>+ </p>+ <p>+ {{i18n "topic.feature_topic.global_pin_note"}}+ </p>+ {{#if this.site.isMobileDevice}}+ <p>+ {{i18n "topic.feature_topic.pin_globally"}}+ </p>+ <p class="with-validation">+ <FutureDateInput+ class="pin-until"+ @clearable={{true}}+ @input={{@model.topic.pinnedGloballyUntil}}+ @onChangeInput={{action+ (mut @model.topic.pinnedGloballyUntil)+ }}+ />+ <PopupInputTip+ @validation={{this.pinGloballyValidation}}+ @shownAt={{this.pinGloballyTipShownAt}}+ />+ </p>+ {{else}}+ <p class="with-validation">+ {{i18n "topic.feature_topic.pin_globally"}}+ <span>+ {{icon "far-clock"}}+ <FutureDateInput+ class="pin-until"+ @clearable={{true}}+ @input={{@model.topic.pinnedGloballyUntil}}+ @onChangeInput={{action+ (mut @model.topic.pinnedGloballyUntil)+ }}+ />+ <PopupInputTip+ @validation={{this.pinGloballyValidation}}+ @shownAt={{this.pinGloballyTipShownAt}}+ />+ </span>+ </p>+ {{/if}}+ <p>+ <DButton+ @action={{this.pinGlobally}}+ @icon="thumbtack"+ @label="topic.feature.pin_globally"+ class="btn-primary"+ />+ </p>+ </div>+ </div>+ {{/if}}+ {{/if}}+ <hr />+ {{#if this.currentUser.staff}}+ <div class="feature-section">+ <div class="desc">+ <p>+ <ConditionalLoadingSpinner+ @size="small"+ @condition={{this.loading}}+ >+ {{#if this.bannerCount}}+ {{htmlSafe (i18n "topic.feature_topic.banner_exists")}}+ {{else}}+ {{htmlSafe (i18n "topic.feature_topic.no_banner_exists")}}+ {{/if}}+ </ConditionalLoadingSpinner>+ </p>+ <p>+ {{i18n "topic.feature_topic.banner_note"}}+ </p>+ <p>+ {{#if @model.topic.isBanner}}+ {{i18n "topic.feature_topic.remove_banner"}}+ {{else}}+ {{i18n "topic.feature_topic.make_banner"}}+ {{/if}}+ </p>+ <p>+ {{#if @model.topic.isBanner}}+ <DButton+ @action={{this.removeBanner}}+ @icon="thumbtack"+ @label="topic.feature.remove_banner"+ class="btn-primary"+ />+ {{else}}+ <DButton+ @action={{this.makeBanner}}+ @icon="thumbtack"+ @label="topic.feature.make_banner"+ class="btn-primary make-banner"+ />+ {{/if}}+ </p>+ </div>+ </div>+ {{/if}}+ </:body>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/flag.gjs b/app/assets/javascripts/discourse/app/components/modal/flag.gjsindex eacabb8c5c4..f20fc0e1b3f 100644--- a/app/assets/javascripts/discourse/app/components/modal/flag.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/flag.gjs@@ -1,7 +1,17 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { hash } from "@ember/helper";+import { on } from "@ember/modifier";import { action } from "@ember/object";import { service } from "@ember/service";+import { htmlSafe } from "@ember/template";+import { not } from "truth-helpers";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";+import FlagActionType from "discourse/components/flag-action-type";+import FlagSelection from "discourse/components/flag-selection";+import PluginOutlet from "discourse/components/plugin-outlet";+import ReviewableBundledAction from "discourse/components/reviewable-bundled-action";import { reload } from "discourse/helpers/page-reloader";import { MAX_MESSAGE_LENGTH } from "discourse/models/post-action-type";import User from "discourse/models/user";@@ -211,92 +221,94 @@ export default class Flag extends Component {changePostActionType(actionType) {this.selected = actionType;}-}-<DModal- class="flag-modal"- @bodyClass="flag-modal-body"- @title={{i18n this.title}}- @submitOnEnter={{false}}- @closeModal={{@closeModal}}- {{on "keydown" this.onKeydown}}->- <:body>- <p>{{html-safe (i18n "flagging.review_process_description")}}</p>- <PluginOutlet- @name="after-flag-modal-review-process-description"- @connectorTagName="div"- @outletArgs={{hash [email protected]}}- />- <form>- <FlagSelection- @nameKey={{this.selected.name_key}}- @flags={{this.flagsAvailable}}- as |f|- >- <FlagActionType- @flag={{f}}- @message={{this.message}}- @isConfirmed={{this.isConfirmed}}- @isWarning={{this.isWarning}}- @selectedFlag={{this.selected}}- @username={{@model.flagModel.username}}- @staffFlagsAvailable={{this.staffFlagsAvailable}}- @changePostActionType={{this.changePostActionType}}+ <template>+ <DModal+ class="flag-modal"+ @bodyClass="flag-modal-body"+ @title={{i18n this.title}}+ @submitOnEnter={{false}}+ @closeModal={{@closeModal}}+ {{on "keydown" this.onKeydown}}+ >+ <:body>+ <p>{{htmlSafe (i18n "flagging.review_process_description")}}</p>+ <PluginOutlet+ @name="after-flag-modal-review-process-description"+ @connectorTagName="div"+ @outletArgs={{hash [email protected]}}+ />+ <form>+ <FlagSelection+ @nameKey={{this.selected.name_key}}+ @flags={{this.flagsAvailable}}+ as |f|+ >+ <FlagActionType+ @flag={{f}}+ @message={{this.message}}+ @isConfirmed={{this.isConfirmed}}+ @isWarning={{this.isWarning}}+ @selectedFlag={{this.selected}}+ @username={{@model.flagModel.username}}+ @staffFlagsAvailable={{this.staffFlagsAvailable}}+ @changePostActionType={{this.changePostActionType}}+ />+ </FlagSelection>+ </form>+ <PluginOutlet+ @name="flag-modal-bottom"+ @connectorTagName="div"+ @outletArgs={{hash [email protected]}}+ />+ </:body>+ <:footer>+ <DButton+ class="btn-primary flag-modal__create-flag"+ @action={{this.createFlag}}+ @disabled={{not this.submitEnabled}}+ @title="flagging.submit_tooltip"+ @icon={{if this.selected.is_custom_flag "envelope" "flag"}}+ @label={{this.submitLabel}}/>- </FlagSelection>- </form>- <PluginOutlet- @name="flag-modal-bottom"- @connectorTagName="div"- @outletArgs={{hash [email protected]}}- />- </:body>- <:footer>- <DButton- class="btn-primary flag-modal__create-flag"- @action={{this.createFlag}}- @disabled={{not this.submitEnabled}}- @title="flagging.submit_tooltip"- @icon={{if this.selected.is_custom_flag "envelope" "flag"}}- @label={{this.submitLabel}}- />-- {{#if this.canSendWarning}}- <DButton- class="btn-danger flag-modal__send-warning"- @action={{this.createFlagAsWarning}}- @disabled={{not this.submitEnabled}}- @icon="triangle-exclamation"- @label="flagging.official_warning"- />- {{/if}}-- {{#if this.canTakeAction}}- <ReviewableBundledAction- class="flag-modal__take-action"- @bundle={{this.flagActions}}- @performAction={{this.takeAction}}- @reviewableUpdating={{not this.submitEnabled}}- />-- <DButton- class="btn-danger flag-modal__flag-for-review"- @action={{this.flagForReview}}- @disabled={{not this.submitEnabled this.notifyModeratorsFlag}}- @icon="triangle-exclamation"- @label="flagging.flag_for_review"- />- {{/if}}-- {{#if this.showDeleteSpammer}}- <DButton- class="btn-danger delete-spammer flag-modal__delete-spammer"- @action={{this.deleteSpammer}}- @disabled={{not this.submitEnabled}}- @icon="triangle-exclamation"- @label="flagging.delete_spammer"- />- {{/if}}- </:footer>-</DModal>\ No newline at end of file++ {{#if this.canSendWarning}}+ <DButton+ class="btn-danger flag-modal__send-warning"+ @action={{this.createFlagAsWarning}}+ @disabled={{not this.submitEnabled}}+ @icon="triangle-exclamation"+ @label="flagging.official_warning"+ />+ {{/if}}++ {{#if this.canTakeAction}}+ <ReviewableBundledAction+ class="flag-modal__take-action"+ @bundle={{this.flagActions}}+ @performAction={{this.takeAction}}+ @reviewableUpdating={{not this.submitEnabled}}+ />++ <DButton+ class="btn-danger flag-modal__flag-for-review"+ @action={{this.flagForReview}}+ @disabled={{not this.submitEnabled this.notifyModeratorsFlag}}+ @icon="triangle-exclamation"+ @label="flagging.flag_for_review"+ />+ {{/if}}++ {{#if this.showDeleteSpammer}}+ <DButton+ class="btn-danger delete-spammer flag-modal__delete-spammer"+ @action={{this.deleteSpammer}}+ @disabled={{not this.submitEnabled}}+ @icon="triangle-exclamation"+ @label="flagging.delete_spammer"+ />+ {{/if}}+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/forgot-password.gjs b/app/assets/javascripts/discourse/app/components/modal/forgot-password.gjsindex 18c75c3dbe6..b83b528928b 100644--- a/app/assets/javascripts/discourse/app/components/modal/forgot-password.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/forgot-password.gjs@@ -1,9 +1,12 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { on } from "@ember/modifier";import { action } from "@ember/object";import { service } from "@ember/service";import { htmlSafe } from "@ember/template";import { isEmpty } from "@ember/utils";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";import { ajax } from "discourse/lib/ajax";import { extractError } from "discourse/lib/ajax-error";import cookie from "discourse/lib/cookie";@@ -88,72 +91,74 @@ export default class ForgotPassword extends Component {this.disabled = false;}}-}-<DModal- @title={{i18n "forgot_password.title"}}- @closeModal={{@closeModal}}- @flash={{this.flash}}- @flashType="error"- class="forgot-password-modal"->- <:body>- {{#if this.offerHelp}}- {{html-safe this.offerHelp}}- {{else if this.siteSettings.hide_email_address_taken}}- <label for="username-or-email">- {{i18n "forgot_password.invite_no_username"}}- </label>- <input- {{on "input" this.updateEmailOrUsername}}- value={{this.emailOrUsername}}- placeholder={{i18n "email"}}- type="text"- id="username-or-email"- autocorrect="off"- autocapitalize="off"- />- {{else}}- <p>{{i18n "forgot_password.invite"}}</p>- <label for="username-or-email">- {{i18n "forgot_password.email-username"}}- </label>- <input- {{on "input" this.updateEmailOrUsername}}- value={{this.emailOrUsername}}- placeholder={{i18n "login.email_placeholder"}}- type="text"- id="username-or-email"- autocorrect="off"- autocapitalize="off"- />- {{/if}}- </:body>-- <:footer>- {{#if this.offerHelp}}- <DButton- @action={{@closeModal}}- @label="forgot_password.button_ok"- type="submit"- class="btn-large btn-primary"- />- {{#unless this.helpSeen}}- <DButton- @action={{this.help}}- @label="forgot_password.button_help"- @icon="circle-question"- class="btn-large"- />- {{/unless}}- {{else}}- <DButton- @action={{this.resetPassword}}- @disabled={{this.submitDisabled}}- @label="forgot_password.reset"- type="submit"- class="btn-primary forgot-password-reset"- />- {{/if}}- </:footer>-</DModal>\ No newline at end of file+ <template>+ <DModal+ @title={{i18n "forgot_password.title"}}+ @closeModal={{@closeModal}}+ @flash={{this.flash}}+ @flashType="error"+ class="forgot-password-modal"+ >+ <:body>+ {{#if this.offerHelp}}+ {{htmlSafe this.offerHelp}}+ {{else if this.siteSettings.hide_email_address_taken}}+ <label for="username-or-email">+ {{i18n "forgot_password.invite_no_username"}}+ </label>+ <input+ {{on "input" this.updateEmailOrUsername}}+ value={{this.emailOrUsername}}+ placeholder={{i18n "email"}}+ type="text"+ id="username-or-email"+ autocorrect="off"+ autocapitalize="off"+ />+ {{else}}+ <p>{{i18n "forgot_password.invite"}}</p>+ <label for="username-or-email">+ {{i18n "forgot_password.email-username"}}+ </label>+ <input+ {{on "input" this.updateEmailOrUsername}}+ value={{this.emailOrUsername}}+ placeholder={{i18n "login.email_placeholder"}}+ type="text"+ id="username-or-email"+ autocorrect="off"+ autocapitalize="off"+ />+ {{/if}}+ </:body>++ <:footer>+ {{#if this.offerHelp}}+ <DButton+ @action={{@closeModal}}+ @label="forgot_password.button_ok"+ type="submit"+ class="btn-large btn-primary"+ />+ {{#unless this.helpSeen}}+ <DButton+ @action={{this.help}}+ @label="forgot_password.button_help"+ @icon="circle-question"+ class="btn-large"+ />+ {{/unless}}+ {{else}}+ <DButton+ @action={{this.resetPassword}}+ @disabled={{this.submitDisabled}}+ @label="forgot_password.reset"+ type="submit"+ class="btn-primary forgot-password-reset"+ />+ {{/if}}+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/form-template-form-preview.gjs b/app/assets/javascripts/discourse/app/components/modal/form-template-form-preview.gjsindex 9f2dd782b3f..47f10fc7d12 100644--- a/app/assets/javascripts/discourse/app/components/modal/form-template-form-preview.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/form-template-form-preview.gjs@@ -1,9 +1,16 @@-<DModal- @closeModal={{@closeModal}}- @title={{i18n "admin.form_templates.preview_modal.title"}}- class="form-template-form-preview-modal"->- <:body>- <FormTemplateField::Wrapper @content={{@content}} />- </:body>-</DModal>\ No newline at end of file+import DModal from "discourse/components/d-modal";+import Wrapper from "discourse/components/form-template-field/wrapper";+import { i18n } from "discourse-i18n";++const FormTemplateFormPreview = <template>+ <DModal+ @closeModal={{@closeModal}}+ @title={{i18n "admin.form_templates.preview_modal.title"}}+ class="form-template-form-preview-modal"+ >+ <:body>+ <Wrapper @content={{@content}} />+ </:body>+ </DModal>+</template>;+export default FormTemplateFormPreview;diff --git a/app/assets/javascripts/discourse/app/components/modal/fullscreen-code.gjs b/app/assets/javascripts/discourse/app/components/modal/fullscreen-code.gjsindex b6773572c01..081ab5a8151 100644--- a/app/assets/javascripts/discourse/app/components/modal/fullscreen-code.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/fullscreen-code.gjs@@ -1,8 +1,11 @@import Component from "@glimmer/component";import { action } from "@ember/object";+import didInsert from "@ember/render-modifiers/modifiers/did-insert";import { service } from "@ember/service";+import DModal from "discourse/components/d-modal";import CodeblockButtons from "discourse/lib/codeblock-buttons";import highlightSyntax from "discourse/lib/highlight-syntax";+import { i18n } from "discourse-i18n";export default class FullscreenCode extends Component {@service siteSettings;@@ -25,19 +28,21 @@ export default class FullscreenCode extends Component {});this.codeBlockButtons.attachToGeneric(modalElement);}-}-<DModal- @title={{i18n "copy_codeblock.view_code"}}- @closeModal={{this.closeModal}}- {{did-insert this.applyCodeblockButtons}}- class="fullscreen-code-modal -max"->- <:body>- <pre>- <code- class={{@model.codeClasses}}- >{{@model.code}}</code>- </pre>- </:body>-</DModal>\ No newline at end of file+ <template>+ <DModal+ @title={{i18n "copy_codeblock.view_code"}}+ @closeModal={{this.closeModal}}+ {{didInsert this.applyCodeblockButtons}}+ class="fullscreen-code-modal -max"+ >+ <:body>+ <pre>+ <code+ class={{@model.codeClasses}}+ >{{@model.code}}</code>+ </pre>+ </:body>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/fullscreen-table.gjs b/app/assets/javascripts/discourse/app/components/modal/fullscreen-table.gjsindex 04df9c20b60..b8cca90d6ee 100644--- a/app/assets/javascripts/discourse/app/components/modal/fullscreen-table.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/fullscreen-table.gjs@@ -1,9 +1,15 @@-<DModal- @title={{i18n "fullscreen_table.view_table"}}- @closeModal={{@closeModal}}- class="fullscreen-table-modal -max"->- <:body>- {{@model.tableHtml}}- </:body>-</DModal>\ No newline at end of file+import DModal from "discourse/components/d-modal";+import { i18n } from "discourse-i18n";++const FullscreenTable = <template>+ <DModal+ @title={{i18n "fullscreen_table.view_table"}}+ @closeModal={{@closeModal}}+ class="fullscreen-table-modal -max"+ >+ <:body>+ {{@model.tableHtml}}+ </:body>+ </DModal>+</template>;+export default FullscreenTable;diff --git a/app/assets/javascripts/discourse/app/components/modal/group-default-notifications.gjs b/app/assets/javascripts/discourse/app/components/modal/group-default-notifications.gjsindex ce98fc38107..aad5fcd57da 100644--- a/app/assets/javascripts/discourse/app/components/modal/group-default-notifications.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/group-default-notifications.gjs@@ -1,5 +1,8 @@import Component from "@glimmer/component";import { action } from "@ember/object";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";+import { i18n } from "discourse-i18n";export default class GroupDefaultNotifications extends Component {@action@@ -13,24 +16,29 @@ export default class GroupDefaultNotifications extends Component {this.args.model.setUpdateExistingUsers(false);this.args.closeModal();}-}-<DModal- @title={{i18n "groups.default_notifications.modal_title"}}- @closeModal={{@closeModal}}->- <:body>- {{i18n "groups.default_notifications.modal_description" [email protected]}}- </:body>- <:footer>- <DButton- @action={{this.updateExistingUsers}}- @label="groups.default_notifications.modal_yes"- class="btn-primary"- />- <DButton- @action={{this.cancel}}- @label="groups.default_notifications.modal_no"- />- </:footer>-</DModal>\ No newline at end of file+ <template>+ <DModal+ @title={{i18n "groups.default_notifications.modal_title"}}+ @closeModal={{@closeModal}}+ >+ <:body>+ {{i18n+ "groups.default_notifications.modal_description"+ }}+ </:body>+ <:footer>+ <DButton+ @action={{this.updateExistingUsers}}+ @label="groups.default_notifications.modal_yes"+ class="btn-primary"+ />+ <DButton+ @action={{this.cancel}}+ @label="groups.default_notifications.modal_no"+ />+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/history.gjs b/app/assets/javascripts/discourse/app/components/modal/history.gjsindex bce79226ae8..b12cb542097 100644--- a/app/assets/javascripts/discourse/app/components/modal/history.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/history.gjs@@ -1,8 +1,15 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { concat } from "@ember/helper";import { action } from "@ember/object";import { service } from "@ember/service";+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";+import DModal from "discourse/components/d-modal";+import Revision from "discourse/components/modal/history/revision";+import Revisions from "discourse/components/modal/history/revisions";+import TopicFooter from "discourse/components/modal/history/topic-footer";import { categoryBadgeHTML } from "discourse/helpers/category-link";+import dasherize from "discourse/helpers/dasherize";import { iconHTML } from "discourse/lib/icon-library";import { sanitizeAsync } from "discourse/lib/text";import Category from "discourse/models/category";@@ -356,67 +363,69 @@ export default class History extends Component {revertToVersion() {this.revert(this.args.model.post, this.postRevision.current_revision);}-}-<DModal- @title={{i18n this.modalTitleKey}}- @closeModal={{@closeModal}}- class="history-modal -max {{concat '--mode-' (dasherize this.viewMode)}}"->- <:body>- <ConditionalLoadingSpinner @condition={{this.initialLoad}}>- <Modal::History::Revision- @model={{this.postRevision}}- @previousCategory={{this.previousCategory}}- @currentCategory={{this.currentCategory}}- @displayInline={{this.displayInline}}- @displaySideBySide={{this.displaySideBySide}}- @displaySideBySideMarkdown={{this.displaySideBySideMarkdown}}- @viewMode={{this.viewMode}}- />- <Modal::History::Revisions- @model={{this.postRevision}}- @hiddenClasses={{this.hiddenClasses}}- @mobileView={{this.site.mobileView}}- @userChanges={{this.user_changes}}- @previousCategory={{this.previousCategory}}- @currentCategory={{this.currentCategory}}- @previousTagChanges={{this.previousTagChanges}}- @currentTagChanges={{this.currentTagChanges}}- @bodyDiffHTML={{this.bodyDiffHTML}}- @bodyDiff={{this.bodyDiff}}- @calculateBodyDiff={{this.calculateBodyDiff}}- @titleDiff={{this.titleDiff}}- @viewMode={{this.viewMode}}- />- </ConditionalLoadingSpinner>- </:body>- <:footer>- {{#if @model.editPost}}- <Modal::History::TopicFooter- @model={{this.postRevision}}- @loadFirstVersion={{this.loadFirstVersion}}- @loadPreviousVersion={{this.loadPreviousVersion}}- @loadNextVersion={{this.loadNextVersion}}- @loadLastVersion={{this.loadLastVersion}}- @displayEdit={{this.displayEdit}}- @editPost={{this.editPost}}- @editButtonLabel={{this.editButtonLabel}}- @revertToVersion={{this.revertToVersion}}- @hideVersion={{this.hideVersion}}- @showVersion={{this.showVersion}}- @permanentlyDeleteVersions={{this.permanentlyDeleteVersions}}- @loading={{this.loading}}- @canPermanentlyDelete={{this.siteSettings.can_permanently_delete}}- @loadFirstDisabled={{this.loadFirstDisabled}}- @loadPreviousDisabled={{this.loadPreviousDisabled}}- @displayRevisions={{this.displayRevisions}}- @revisionsText={{this.revisionsText}}- @loadNextDisabled={{this.loadNextDisabled}}- @loadLastDisabled={{this.loadLastDisabled}}- @revertToRevisionText={{this.revertToRevisionText}}- @isStaff={{this.currentUser.staff}}- />- {{/if}}- </:footer>-</DModal>\ No newline at end of file+ <template>+ <DModal+ @title={{i18n this.modalTitleKey}}+ @closeModal={{@closeModal}}+ class="history-modal -max {{concat '--mode-' (dasherize this.viewMode)}}"+ >+ <:body>+ <ConditionalLoadingSpinner @condition={{this.initialLoad}}>+ <Revision+ @model={{this.postRevision}}+ @previousCategory={{this.previousCategory}}+ @currentCategory={{this.currentCategory}}+ @displayInline={{this.displayInline}}+ @displaySideBySide={{this.displaySideBySide}}+ @displaySideBySideMarkdown={{this.displaySideBySideMarkdown}}+ @viewMode={{this.viewMode}}+ />+ <Revisions+ @model={{this.postRevision}}+ @hiddenClasses={{this.hiddenClasses}}+ @mobileView={{this.site.mobileView}}+ @userChanges={{this.user_changes}}+ @previousCategory={{this.previousCategory}}+ @currentCategory={{this.currentCategory}}+ @previousTagChanges={{this.previousTagChanges}}+ @currentTagChanges={{this.currentTagChanges}}+ @bodyDiffHTML={{this.bodyDiffHTML}}+ @bodyDiff={{this.bodyDiff}}+ @calculateBodyDiff={{this.calculateBodyDiff}}+ @titleDiff={{this.titleDiff}}+ @viewMode={{this.viewMode}}+ />+ </ConditionalLoadingSpinner>+ </:body>+ <:footer>+ {{#if @model.editPost}}+ <TopicFooter+ @model={{this.postRevision}}+ @loadFirstVersion={{this.loadFirstVersion}}+ @loadPreviousVersion={{this.loadPreviousVersion}}+ @loadNextVersion={{this.loadNextVersion}}+ @loadLastVersion={{this.loadLastVersion}}+ @displayEdit={{this.displayEdit}}+ @editPost={{this.editPost}}+ @editButtonLabel={{this.editButtonLabel}}+ @revertToVersion={{this.revertToVersion}}+ @hideVersion={{this.hideVersion}}+ @showVersion={{this.showVersion}}+ @permanentlyDeleteVersions={{this.permanentlyDeleteVersions}}+ @loading={{this.loading}}+ @canPermanentlyDelete={{this.siteSettings.can_permanently_delete}}+ @loadFirstDisabled={{this.loadFirstDisabled}}+ @loadPreviousDisabled={{this.loadPreviousDisabled}}+ @displayRevisions={{this.displayRevisions}}+ @revisionsText={{this.revisionsText}}+ @loadNextDisabled={{this.loadNextDisabled}}+ @loadLastDisabled={{this.loadLastDisabled}}+ @revertToRevisionText={{this.revertToRevisionText}}+ @isStaff={{this.currentUser.staff}}+ />+ {{/if}}+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/history/revision.gjs b/app/assets/javascripts/discourse/app/components/modal/history/revision.gjsindex 00a1abf57c8..557747da669 100644--- a/app/assets/javascripts/discourse/app/components/modal/history/revision.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/history/revision.gjs@@ -1,150 +1,167 @@import Component from "@glimmer/component";+import { hash } from "@ember/helper";+import { on } from "@ember/modifier";+import { LinkTo } from "@ember/routing";import { service } from "@ember/service";+import { htmlSafe } from "@ember/template";+import { and, eq, not } from "truth-helpers";+import PluginOutlet from "discourse/components/plugin-outlet";+import boundAvatarTemplate from "discourse/helpers/bound-avatar-template";+import boundDate from "discourse/helpers/bound-date";+import concatClass from "discourse/helpers/concat-class";+import icon from "discourse/helpers/d-icon";+import { i18n } from "discourse-i18n";export default class Revision extends Component {@service site;@service siteSettings;-}--<div id="revision">- <div id="revision-details">- {{d-icon "pencil"}}- <LinkTo- @route="user"- @model={{@model.username}}- class="revision-details__user"- >- {{bound-avatar-template @model.avatar_template "small"}}- {{#if this.siteSettings.prioritize_full_name_in_ux}}- {{@model.acting_user_name}}- {{else}}- {{@model.username}}- {{/if}}- </LinkTo>- <PluginOutlet- @name="revision-user-details-after"- @outletArgs={{hash model=@model}}- />- <span class="date">{{bound-date @model.created_at}}</span>- {{#if @model.edit_reason}}- <span class="edit-reason">{{@model.edit_reason}}</span>- {{/if}}- {{#if this.site.desktopView}}- <span>- {{#if @model.user_changes}}- {{bound-avatar-template- @model.user_changes.previous.avatar_template- "small"- }}- {{@model.user_changes.previous.username}}- →- {{bound-avatar-template- @model.user_changes.current.avatar_template- "small"- }}- {{@model.user_changes.current.username}}+ <template>+ <div id="revision">+ <div id="revision-details">+ {{icon "pencil"}}+ <LinkTo+ @route="user"+ @model={{@model.username}}+ class="revision-details__user"+ >+ {{boundAvatarTemplate @model.avatar_template "small"}}+ {{#if this.siteSettings.prioritize_full_name_in_ux}}+ {{@model.acting_user_name}}+ {{else}}+ {{@model.username}}+ {{/if}}+ </LinkTo>+ <PluginOutlet+ @name="revision-user-details-after"+ @outletArgs={{hash model=@model}}+ />+ <span class="date">{{boundDate @model.created_at}}</span>+ {{#if @model.edit_reason}}+ <span class="edit-reason">{{@model.edit_reason}}</span>{{/if}}- {{#if @model.wiki_changes}}- {{d-icon- "far-pen-to-square"- class=(if @model.wiki_changes.current "diff-ins" "diff-del")- }}- {{/if}}+ {{#if this.site.desktopView}}+ <span>+ {{#if @model.user_changes}}+ {{boundAvatarTemplate+ @model.user_changes.previous.avatar_template+ "small"+ }}+ {{@model.user_changes.previous.username}}+ →+ {{boundAvatarTemplate+ @model.user_changes.current.avatar_template+ "small"+ }}+ {{@model.user_changes.current.username}}+ {{/if}}- {{#if @model.post_type_changes}}- {{d-icon- "shield-halved"- class=(if- (eq- @model.post_type_changes.current- @site.post_types.moderator_action- )- "diff-del"- "diff-ins"- )- }}- {{/if}}+ {{#if @model.wiki_changes}}+ {{icon+ "far-pen-to-square"+ class=(if @model.wiki_changes.current "diff-ins" "diff-del")+ }}+ {{/if}}- {{#if @model.archetype_changes}}- {{d-icon- (if- (eq @model.archetype_changes.current "private_message")- "envelope"- "comment"- )- }}- {{/if}}+ {{#if @model.post_type_changes}}+ {{icon+ "shield-halved"+ class=(if+ (eq+ @model.post_type_changes.current+ @site.post_types.moderator_action+ )+ "diff-del"+ "diff-ins"+ )+ }}+ {{/if}}- {{#if (and @model.category_id_changes (not @model.archetype_changes))}}- {{#if @previousCategory}}- {{html-safe @previousCategory}}- {{else}}- {{d-icon "far-eye-slash" class="diff-del"}}- {{/if}}- →- {{#if @currentCategory}}- {{html-safe @currentCategory}}- {{else}}- {{d-icon "far-eye-slash" class="diff-ins"}}- {{/if}}- {{/if}}- </span>- {{/if}}- </div>+ {{#if @model.archetype_changes}}+ {{icon+ (if+ (eq @model.archetype_changes.current "private_message")+ "envelope"+ "comment"+ )+ }}+ {{/if}}- {{#if this.site.desktopView}}- <div id="display-modes">- <ul class="nav nav-pills">- <li>- <a- href- class={{concat-class- "inline-mode"- (if (eq @viewMode "inline") "active")- }}- {{on "click" @displayInline}}- title={{i18n "post.revisions.displays.inline.title"}}- aria-label={{i18n "post.revisions.displays.inline.title"}}- >- {{d-icon "far-square"}}- {{i18n "post.revisions.displays.inline.button"}}- </a>- </li>- <li>- <a- href- class={{concat-class- "side-by-side-mode"- (if (eq @viewMode "side_by_side") "active")- }}- {{on "click" @displaySideBySide}}- title={{i18n "post.revisions.displays.side_by_side.title"}}- aria-label={{i18n "post.revisions.displays.side_by_side.title"}}- >- {{d-icon "table-columns"}}- {{i18n "post.revisions.displays.side_by_side.button"}}- </a>- </li>- <li>- <a- href- class={{concat-class- "side-by-side-markdown-mode"- (if (eq @viewMode "side_by_side_markdown") "active")+ {{#if+ (and @model.category_id_changes (not @model.archetype_changes))}}- {{on "click" @displaySideBySideMarkdown}}- title={{i18n "post.revisions.displays.side_by_side_markdown.title"}}- aria-label={{i18n- "post.revisions.displays.side_by_side_markdown.title"- }}- >- {{d-icon "table-columns"}}- {{i18n "post.revisions.displays.side_by_side_markdown.button"}}- </a>- </li>- </ul>+ {{#if @previousCategory}}+ {{htmlSafe @previousCategory}}+ {{else}}+ {{icon "far-eye-slash" class="diff-del"}}+ {{/if}}+ →+ {{#if @currentCategory}}+ {{htmlSafe @currentCategory}}+ {{else}}+ {{icon "far-eye-slash" class="diff-ins"}}+ {{/if}}+ {{/if}}+ </span>+ {{/if}}+ </div>++ {{#if this.site.desktopView}}+ <div id="display-modes">+ <ul class="nav nav-pills">+ <li>+ <a+ href+ class={{concatClass+ "inline-mode"+ (if (eq @viewMode "inline") "active")+ }}+ {{on "click" @displayInline}}+ title={{i18n "post.revisions.displays.inline.title"}}+ aria-label={{i18n "post.revisions.displays.inline.title"}}+ >+ {{icon "far-square"}}+ {{i18n "post.revisions.displays.inline.button"}}+ </a>+ </li>+ <li>+ <a+ href+ class={{concatClass+ "side-by-side-mode"+ (if (eq @viewMode "side_by_side") "active")+ }}+ {{on "click" @displaySideBySide}}+ title={{i18n "post.revisions.displays.side_by_side.title"}}+ aria-label={{i18n "post.revisions.displays.side_by_side.title"}}+ >+ {{icon "table-columns"}}+ {{i18n "post.revisions.displays.side_by_side.button"}}+ </a>+ </li>+ <li>+ <a+ href+ class={{concatClass+ "side-by-side-markdown-mode"+ (if (eq @viewMode "side_by_side_markdown") "active")+ }}+ {{on "click" @displaySideBySideMarkdown}}+ title={{i18n+ "post.revisions.displays.side_by_side_markdown.title"+ }}+ aria-label={{i18n+ "post.revisions.displays.side_by_side_markdown.title"+ }}+ >+ {{icon "table-columns"}}+ {{i18n "post.revisions.displays.side_by_side_markdown.button"}}+ </a>+ </li>+ </ul>+ </div>+ {{/if}}</div>- {{/if}}-</div>\ No newline at end of file+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/history/topic-footer.gjs b/app/assets/javascripts/discourse/app/components/modal/history/topic-footer.gjsindex 398fa1163ec..4101961942a 100644--- a/app/assets/javascripts/discourse/app/components/modal/history/topic-footer.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/history/topic-footer.gjs@@ -1,90 +1,98 @@-<div id="revision-controls">- <div class="revision-controls--back">- <DButton- class="btn-default first-revision"- @action={{@loadFirstVersion}}- @icon="backward-fast"- @title="post.revisions.controls.first"- @disabled={{@loadFirstDisabled}}- />- <DButton- class="btn-default previous-revision"- @action={{@loadPreviousVersion}}- @icon="backward"- @title="post.revisions.controls.previous"- @disabled={{@loadPreviousDisabled}}- />- </div>- <div id="revision-numbers" class={{unless @displayRevisions "invisible"}}>- <ConditionalLoadingSpinner @condition={{@loading}} @size="small">- {{html-safe @revisionsText}}- </ConditionalLoadingSpinner>- </div>- <div class="revision-controls--forward">- <DButton- class="btn-default next-revision"- @action={{@loadNextVersion}}- @icon="forward"- @title="post.revisions.controls.next"- @disabled={{@loadNextDisabled}}- />- <DButton- class="btn-default last-revision"- @action={{@loadLastVersion}}- @icon="forward-fast"- @title="post.revisions.controls.last"- @disabled={{@loadLastDisabled}}- />- </div>-</div>--<div id="revision-footer-buttons">- {{#if @displayEdit}}- <DButton- @action={{@editPost}}- @icon="pencil"- class="btn-default edit-post"- @label={{@editButtonLabel}}- />- {{/if}}+import { htmlSafe } from "@ember/template";+import { and } from "truth-helpers";+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";+import DButton from "discourse/components/d-button";- {{#if @isStaff}}- {{#if @revertToRevisionText}}+const TopicFooter = <template>+ <div id="revision-controls">+ <div class="revision-controls--back"><DButton- @action={{@revertToVersion}}- @icon="arrow-rotate-left"- @translatedLabel={{@revertToRevisionText}}- class="btn-danger revert-to-version"- @disabled={{@loading}}+ class="btn-default first-revision"+ @action={{@loadFirstVersion}}+ @icon="backward-fast"+ @title="post.revisions.controls.first"+ @disabled={{@loadFirstDisabled}}/>- {{/if}}-- {{#if @model.previous_hidden}}<DButton- @action={{@showVersion}}- @icon="far-eye"- @label="post.revisions.controls.show"- class="btn-default show-revision"- @disabled={{@loading}}+ class="btn-default previous-revision"+ @action={{@loadPreviousVersion}}+ @icon="backward"+ @title="post.revisions.controls.previous"+ @disabled={{@loadPreviousDisabled}}/>- {{else}}+ </div>+ <div id="revision-numbers" class={{unless @displayRevisions "invisible"}}>+ <ConditionalLoadingSpinner @condition={{@loading}} @size="small">+ {{htmlSafe @revisionsText}}+ </ConditionalLoadingSpinner>+ </div>+ <div class="revision-controls--forward"><DButton- @action={{@hideVersion}}- @icon="far-eye-slash"- @label="post.revisions.controls.hide"- class="btn-danger hide-revision"- @disabled={{@loading}}+ class="btn-default next-revision"+ @action={{@loadNextVersion}}+ @icon="forward"+ @title="post.revisions.controls.next"+ @disabled={{@loadNextDisabled}}/>- {{/if}}+ <DButton+ class="btn-default last-revision"+ @action={{@loadLastVersion}}+ @icon="forward-fast"+ @title="post.revisions.controls.last"+ @disabled={{@loadLastDisabled}}+ />+ </div>+ </div>- {{#if (and @canPermanentlyDelete @model.previous_hidden)}}+ <div id="revision-footer-buttons">+ {{#if @displayEdit}}<DButton- @action={{@permanentlyDeleteVersions}}- @icon="trash-can"- @label="post.revisions.controls.destroy"- class="btn-danger destroy-revision"- @disabled={{@loading}}+ @action={{@editPost}}+ @icon="pencil"+ class="btn-default edit-post"+ @label={{@editButtonLabel}}/>{{/if}}- {{/if}}-</div>\ No newline at end of file++ {{#if @isStaff}}+ {{#if @revertToRevisionText}}+ <DButton+ @action={{@revertToVersion}}+ @icon="arrow-rotate-left"+ @translatedLabel={{@revertToRevisionText}}+ class="btn-danger revert-to-version"+ @disabled={{@loading}}+ />+ {{/if}}++ {{#if @model.previous_hidden}}+ <DButton+ @action={{@showVersion}}+ @icon="far-eye"+ @label="post.revisions.controls.show"+ class="btn-default show-revision"+ @disabled={{@loading}}+ />+ {{else}}+ <DButton+ @action={{@hideVersion}}+ @icon="far-eye-slash"+ @label="post.revisions.controls.hide"+ class="btn-danger hide-revision"+ @disabled={{@loading}}+ />+ {{/if}}++ {{#if (and @canPermanentlyDelete @model.previous_hidden)}}+ <DButton+ @action={{@permanentlyDeleteVersions}}+ @icon="trash-can"+ @label="post.revisions.controls.destroy"+ class="btn-danger destroy-revision"+ @disabled={{@loading}}+ />+ {{/if}}+ {{/if}}+ </div>+</template>;+export default TopicFooter;diff --git a/app/assets/javascripts/discourse/app/components/modal/json-schema-editor.gjs b/app/assets/javascripts/discourse/app/components/modal/json-schema-editor.gjsindex 3358c9c06ff..ad5029c6f5c 100644--- a/app/assets/javascripts/discourse/app/components/modal/json-schema-editor.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/json-schema-editor.gjs@@ -1,9 +1,14 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";import { action } from "@ember/object";+import didInsert from "@ember/render-modifiers/modifiers/did-insert";+import willDestroy from "@ember/render-modifiers/modifiers/will-destroy";import { waitForPromise } from "@ember/test-waiters";import { create } from "virtual-dom";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";import { iconNode } from "discourse/lib/icon-library";+import { i18n } from "discourse-i18n";export default class JsonSchemaEditorModal extends Component {@tracked editor = null;@@ -60,6 +65,36 @@ export default class JsonSchemaEditorModal extends Component {startval: this.value ? JSON.parse(this.value) : null,});}++ <template>+ <DModal+ @flash={{this.flash}}+ @flashType={{this.flashType}}+ @closeModal={{@closeModal}}+ @title={{i18n+ "admin.site_settings.json_schema.modal_title"+ }}+ @inline={{@inline}}+ class="json-schema-editor-modal"+ >+ <:body>+ <div+ id="json-editor-holder"+ {{didInsert this.buildJsonEditor}}+ {{willDestroy this.teardownJsonEditor}}+ ></div>+ </:body>++ <:footer>+ <DButton+ @action={{this.saveChanges}}+ @label="save"+ class="btn-primary"+ />+ </:footer>+ </DModal>+ </template>}class DiscourseJsonSchemaEditorIconlib {@@ -84,27 +119,3 @@ class DiscourseJsonSchemaEditorIconlib {return create(iconNode(this.mapping[key]));}}--<DModal- @flash={{this.flash}}- @flashType={{this.flashType}}- @closeModal={{@closeModal}}- @title={{i18n- "admin.site_settings.json_schema.modal_title"- }}- @inline={{@inline}}- class="json-schema-editor-modal"->- <:body>- <div- id="json-editor-holder"- {{did-insert this.buildJsonEditor}}- {{will-destroy this.teardownJsonEditor}}- ></div>- </:body>-- <:footer>- <DButton @action={{this.saveChanges}} @label="save" class="btn-primary" />- </:footer>-</DModal>\ No newline at end of filediff --git a/app/assets/javascripts/discourse/app/components/modal/login.gjs b/app/assets/javascripts/discourse/app/components/modal/login.gjsindex 90467484904..27766c6be0e 100644--- a/app/assets/javascripts/discourse/app/components/modal/login.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/login.gjs@@ -1,10 +1,20 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { hash } from "@ember/helper";+import { on } from "@ember/modifier";import { action } from "@ember/object";+import didInsert from "@ember/render-modifiers/modifiers/did-insert";import { schedule } from "@ember/runloop";import { service } from "@ember/service";import { htmlSafe } from "@ember/template";import { isEmpty } from "@ember/utils";+import { and } from "truth-helpers";+import DModal from "discourse/components/d-modal";+import LocalLoginForm from "discourse/components/local-login-form";+import LoginButtons from "discourse/components/login-buttons";+import LoginPageCta from "discourse/components/login-page-cta";+import PluginOutlet from "discourse/components/plugin-outlet";+import WelcomeHeader from "discourse/components/welcome-header";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import cookie, { removeCookie } from "discourse/lib/cookie";@@ -377,136 +387,140 @@ export default class Login extends Component {});}}-}--<DModal- class="login-modal -large"- @bodyClass={{this.modalBodyClasses}}- @closeModal={{@closeModal}}- @flash={{this.flash}}- @flashType={{this.flashType}}- {{did-insert this.preloadLogin}}- {{on "click" this.interceptResetLink}}->- <:body>- <PluginOutlet @name="login-before-modal-body" @connectorTagName="div" />-- {{#if this.hasNoLoginOptions}}- <div class={{if this.site.desktopView "login-left-side"}}>- <div class="login-welcome-header no-login-methods-configured">- <h1 class="login-title">{{i18n "login.no_login_methods.title"}}</h1>- <img />- <p class="login-subheader">- {{html-safe- (i18n- "login.no_login_methods.description"- (hash adminLoginPath=this.adminLoginPath)- )- }}- </p>- </div>- </div>- {{else}}- {{#if this.site.mobileView}}- <WelcomeHeader @header={{i18n "login.header_title"}}>- <PluginOutlet- @name="login-header-bottom"- @outletArgs={{hash createAccount=this.createAccount}}- />- </WelcomeHeader>- {{#if this.showLoginButtons}}- <LoginButtons- @externalLogin={{this.externalLoginAction}}- @passkeyLogin={{this.passkeyLogin}}- @context="login"- />- {{/if}}- {{/if}}- {{#if this.canLoginLocal}}- <div class={{if this.site.desktopView "login-left-side"}}>- {{#if this.site.desktopView}}+ <template>+ <DModal+ class="login-modal -large"+ @bodyClass={{this.modalBodyClasses}}+ @closeModal={{@closeModal}}+ @flash={{this.flash}}+ @flashType={{this.flashType}}+ {{didInsert this.preloadLogin}}+ {{on "click" this.interceptResetLink}}+ >+ <:body>+ <PluginOutlet @name="login-before-modal-body" @connectorTagName="div" />++ {{#if this.hasNoLoginOptions}}+ <div class={{if this.site.desktopView "login-left-side"}}>+ <div class="login-welcome-header no-login-methods-configured">+ <h1 class="login-title">{{i18n+ "login.no_login_methods.title"+ }}</h1>+ <img />+ <p class="login-subheader">+ {{htmlSafe+ (i18n+ "login.no_login_methods.description"+ (hash adminLoginPath=this.adminLoginPath)+ )+ }}+ </p>+ </div>+ </div>+ {{else}}+ {{#if this.site.mobileView}}<WelcomeHeader @header={{i18n "login.header_title"}}><PluginOutlet@name="login-header-bottom"@outletArgs={{hash createAccount=this.createAccount}}/></WelcomeHeader>+ {{#if this.showLoginButtons}}+ <LoginButtons+ @externalLogin={{this.externalLoginAction}}+ @passkeyLogin={{this.passkeyLogin}}+ @context="login"+ />+ {{/if}}{{/if}}- <LocalLoginForm- @loginName={{this.loginName}}- @loginNameChanged={{this.loginNameChanged}}- @canLoginLocalWithEmail={{this.canLoginLocalWithEmail}}- @canUsePasskeys={{this.canUsePasskeys}}- @passkeyLogin={{this.passkeyLogin}}- @loginPassword={{this.loginPassword}}- @secondFactorMethod={{this.secondFactorMethod}}- @secondFactorToken={{this.secondFactorToken}}- @backupEnabled={{this.backupEnabled}}- @totpEnabled={{this.totpEnabled}}- @securityKeyAllowedCredentialIds={{this.securityKeyAllowedCredentialIds}}- @securityKeyChallenge={{this.securityKeyChallenge}}- @showSecurityKey={{this.showSecurityKey}}- @otherMethodAllowed={{this.otherMethodAllowed}}- @showSecondFactor={{this.showSecondFactor}}- @handleForgotPassword={{this.handleForgotPassword}}- @login={{this.triggerLogin}}- @flashChanged={{this.flashChanged}}- @flashTypeChanged={{this.flashTypeChanged}}- @securityKeyCredentialChanged={{this.securityKeyCredentialChanged}}- />- {{#if this.site.desktopView}}- <div class="d-modal__footer">- <LoginPageCta- @canLoginLocal={{this.canLoginLocal}}++ {{#if this.canLoginLocal}}+ <div class={{if this.site.desktopView "login-left-side"}}>+ {{#if this.site.desktopView}}+ <WelcomeHeader @header={{i18n "login.header_title"}}>+ <PluginOutlet+ @name="login-header-bottom"+ @outletArgs={{hash createAccount=this.createAccount}}+ />+ </WelcomeHeader>+ {{/if}}+ <LocalLoginForm+ @loginName={{this.loginName}}+ @loginNameChanged={{this.loginNameChanged}}+ @canLoginLocalWithEmail={{this.canLoginLocalWithEmail}}+ @canUsePasskeys={{this.canUsePasskeys}}+ @passkeyLogin={{this.passkeyLogin}}+ @loginPassword={{this.loginPassword}}+ @secondFactorMethod={{this.secondFactorMethod}}+ @secondFactorToken={{this.secondFactorToken}}+ @backupEnabled={{this.backupEnabled}}+ @totpEnabled={{this.totpEnabled}}+ @securityKeyAllowedCredentialIds={{this.securityKeyAllowedCredentialIds}}+ @securityKeyChallenge={{this.securityKeyChallenge}}@showSecurityKey={{this.showSecurityKey}}- @login={{this.triggerLogin}}- @loginButtonLabel={{this.loginButtonLabel}}- @loginDisabled={{this.loginDisabled}}- @showSignupLink={{this.showSignupLink}}- @createAccount={{this.createAccount}}- @loggingIn={{this.loggingIn}}+ @otherMethodAllowed={{this.otherMethodAllowed}}@showSecondFactor={{this.showSecondFactor}}+ @handleForgotPassword={{this.handleForgotPassword}}+ @login={{this.triggerLogin}}+ @flashChanged={{this.flashChanged}}+ @flashTypeChanged={{this.flashTypeChanged}}+ @securityKeyCredentialChanged={{this.securityKeyCredentialChanged}}/>+ {{#if this.site.desktopView}}+ <div class="d-modal__footer">+ <LoginPageCta+ @canLoginLocal={{this.canLoginLocal}}+ @showSecurityKey={{this.showSecurityKey}}+ @login={{this.triggerLogin}}+ @loginButtonLabel={{this.loginButtonLabel}}+ @loginDisabled={{this.loginDisabled}}+ @showSignupLink={{this.showSignupLink}}+ @createAccount={{this.createAccount}}+ @loggingIn={{this.loggingIn}}+ @showSecondFactor={{this.showSecondFactor}}+ />+ </div>+ {{/if}}</div>{{/if}}- </div>- {{/if}}- {{#if (and this.showLoginButtons this.site.desktopView)}}- {{#unless this.canLoginLocal}}- <div class="login-left-side">- <WelcomeHeader @header={{i18n "login.header_title"}} />- </div>- {{/unless}}- {{#if this.hasAtLeastOneLoginButton}}- <div class="login-right-side">- <LoginButtons- @externalLogin={{this.externalLoginAction}}- @passkeyLogin={{this.passkeyLogin}}- @context="login"+ {{#if (and this.showLoginButtons this.site.desktopView)}}+ {{#unless this.canLoginLocal}}+ <div class="login-left-side">+ <WelcomeHeader @header={{i18n "login.header_title"}} />+ </div>+ {{/unless}}+ {{#if this.hasAtLeastOneLoginButton}}+ <div class="login-right-side">+ <LoginButtons+ @externalLogin={{this.externalLoginAction}}+ @passkeyLogin={{this.passkeyLogin}}+ @context="login"+ />+ </div>+ {{/if}}+ {{/if}}+ {{/if}}+ </:body>++ <:footer>+ {{#if this.site.mobileView}}+ {{#unless this.hasNoLoginOptions}}+ <LoginPageCta+ @canLoginLocal={{this.canLoginLocal}}+ @showSecurityKey={{this.showSecurityKey}}+ @login={{this.triggerLogin}}+ @loginButtonLabel={{this.loginButtonLabel}}+ @loginDisabled={{this.loginDisabled}}+ @showSignupLink={{this.showSignupLink}}+ @createAccount={{this.createAccount}}+ @loggingIn={{this.loggingIn}}+ @showSecondFactor={{this.showSecondFactor}}/>- </div>+ {{/unless}}{{/if}}- {{/if}}- {{/if}}- </:body>-- <:footer>- {{#if this.site.mobileView}}- {{#unless this.hasNoLoginOptions}}- <LoginPageCta- @canLoginLocal={{this.canLoginLocal}}- @showSecurityKey={{this.showSecurityKey}}- @login={{this.triggerLogin}}- @loginButtonLabel={{this.loginButtonLabel}}- @loginDisabled={{this.loginDisabled}}- @showSignupLink={{this.showSignupLink}}- @createAccount={{this.createAccount}}- @loggingIn={{this.loggingIn}}- @showSecondFactor={{this.showSecondFactor}}- />- {{/unless}}- {{/if}}- </:footer>-</DModal>\ No newline at end of file+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/not-activated.gjs b/app/assets/javascripts/discourse/app/components/modal/not-activated.gjsindex 5264f5f8a2f..faf24540fb3 100644--- a/app/assets/javascripts/discourse/app/components/modal/not-activated.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/not-activated.gjs@@ -1,7 +1,11 @@import Component from "@glimmer/component";import { action } from "@ember/object";import { service } from "@ember/service";+import { htmlSafe } from "@ember/template";+import ActivationControls from "discourse/components/activation-controls";+import DModal from "discourse/components/d-modal";import { resendActivationEmail } from "discourse/lib/user-activation";+import { i18n } from "discourse-i18n";import ActivationEdit from "./activation-edit";import ActivationResent from "./activation-resent";@@ -26,20 +30,22 @@ export default class NotActivated extends Component {},});}-}-<DModal- @closeModal={{@closeModal}}- @title={{i18n "log_in"}}- class="not-activated-modal"->- <:body>- {{html-safe (i18n "login.not_activated" [email protected])}}- </:body>- <:footer>- <ActivationControls- @sendActivationEmail={{this.sendActivationEmail}}- @editActivationEmail={{this.editActivationEmail}}- />- </:footer>-</DModal>\ No newline at end of file+ <template>+ <DModal+ @closeModal={{@closeModal}}+ @title={{i18n "log_in"}}+ class="not-activated-modal"+ >+ <:body>+ {{htmlSafe (i18n "login.not_activated" [email protected])}}+ </:body>+ <:footer>+ <ActivationControls+ @sendActivationEmail={{this.sendActivationEmail}}+ @editActivationEmail={{this.editActivationEmail}}+ />+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/post-enqueued.gjs b/app/assets/javascripts/discourse/app/components/modal/post-enqueued.gjsindex 991d60d93c1..a09f30f8155 100644--- a/app/assets/javascripts/discourse/app/components/modal/post-enqueued.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/post-enqueued.gjs@@ -1,21 +1,29 @@-<DModal- @closeModal={{@closeModal}}- @title={{i18n "review.approval.title"}}- class="post-enqueued-modal"->- <:body>- <p>{{i18n "review.approval.description"}}</p>- <p>- {{html-safe- (i18n "review.approval.pending_posts" [email protected]_count)- }}- </p>- </:body>- <:footer>- <DButton- @action={{@closeModal}}- class="btn-primary"- @label="review.approval.ok"- />- </:footer>-</DModal>\ No newline at end of file+import { htmlSafe } from "@ember/template";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";+import { i18n } from "discourse-i18n";++const PostEnqueued = <template>+ <DModal+ @closeModal={{@closeModal}}+ @title={{i18n "review.approval.title"}}+ class="post-enqueued-modal"+ >+ <:body>+ <p>{{i18n "review.approval.description"}}</p>+ <p>+ {{htmlSafe+ (i18n "review.approval.pending_posts" [email protected]_count)+ }}+ </p>+ </:body>+ <:footer>+ <DButton+ @action={{@closeModal}}+ class="btn-primary"+ @label="review.approval.ok"+ />+ </:footer>+ </DModal>+</template>;+export default PostEnqueued;diff --git a/app/assets/javascripts/discourse/app/components/modal/publish-page.gjs b/app/assets/javascripts/discourse/app/components/modal/publish-page.gjsindex c7aec48e5ee..7340640aa8a 100644--- a/app/assets/javascripts/discourse/app/components/modal/publish-page.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/publish-page.gjs@@ -1,9 +1,16 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { Input } from "@ember/component";+import { on } from "@ember/modifier";import { action } from "@ember/object";import { service } from "@ember/service";+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";+import TextField from "discourse/components/text-field";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";+import { i18n } from "discourse-i18n";const States = {initializing: "initializing",@@ -162,110 +169,112 @@ export default class PublishPageModal extends Component {this.publish();}}-}-<DModal- @closeModal={{@closeModal}}- @title={{i18n "topic.publish_page.title"}}- class="publish-page-modal"->- <:body>- {{#if this.unpublished}}- <p>{{i18n "topic.publish_page.unpublished"}}</p>- {{else}}- <ConditionalLoadingSpinner @condition={{this.initializing}}>- <p class="publish-description">{{i18n- "topic.publish_page.description"- }}</p>-- <form>- <div class="controls">- <label>{{i18n "topic.publish_page.slug"}}</label>- <TextField- @value={{this.publishedPage.slug}}- @onChange={{this.checkSlug}}- @onChangeImmediate={{this.startCheckSlug}}- @disabled={{this.existing}}- class="publish-slug"- />- </div>-- <div class="controls">- <label>{{i18n "topic.publish_page.public"}}</label>-- <p class="description">- <Input- @type="checkbox"- @checked={{readonly this.publishedPage.public}}- {{on "click" this.onChangePublic}}- />- {{i18n "topic.publish_page.public_description"}}- </p>- </div>- </form>-- <div class="publish-url">- <ConditionalLoadingSpinner @condition={{this.checking}} />-- {{#if this.existing}}- <div class="current-url">- {{i18n "topic.publish_page.publish_url"}}- <div>- <a- href={{this.publishedPage.url}}- target="_blank"- rel="noopener noreferrer"- >{{this.publishedPage.url}}</a>+ <template>+ <DModal+ @closeModal={{@closeModal}}+ @title={{i18n "topic.publish_page.title"}}+ class="publish-page-modal"+ >+ <:body>+ {{#if this.unpublished}}+ <p>{{i18n "topic.publish_page.unpublished"}}</p>+ {{else}}+ <ConditionalLoadingSpinner @condition={{this.initializing}}>+ <p class="publish-description">{{i18n+ "topic.publish_page.description"+ }}</p>++ <form>+ <div class="controls">+ <label>{{i18n "topic.publish_page.slug"}}</label>+ <TextField+ @value={{this.publishedPage.slug}}+ @onChange={{this.checkSlug}}+ @onChangeImmediate={{this.startCheckSlug}}+ @disabled={{this.existing}}+ class="publish-slug"+ /></div>- </div>- {{else}}- {{#if this.showUrl}}- <div class="valid-slug">- {{i18n "topic.publish_page.preview_url"}}- <div class="example-url">{{this.publishedPage.url}}</div>++ <div class="controls">+ <label>{{i18n "topic.publish_page.public"}}</label>++ <p class="description">+ <Input+ @type="checkbox"+ @checked={{readonly this.publishedPage.public}}+ {{on "click" this.onChangePublic}}+ />+ {{i18n "topic.publish_page.public_description"}}+ </p></div>- {{/if}}-- {{#if this.invalid}}- {{i18n "topic.publish_page.invalid_slug"}}- <span class="invalid-slug">{{this.reason}}.</span>- {{/if}}- {{/if}}-- </div>- </ConditionalLoadingSpinner>- {{/if}}- </:body>- <:footer>- {{#if this.showUnpublish}}- <DButton- @label="topic.publish_page.unpublish"- @icon="trash-can"- @isLoading={{this.unpublishing}}- @action={{this.unpublish}}- class="btn-danger"- />-- <DButton- @icon="xmark"- @label="close"- @action={{@closeModal}}- class="close-publish-page"- />- {{else if this.unpublished}}- <DButton- @label="topic.publish_page.publishing_settings"- @action={{this.startNew}}- />- {{else}}- <DButton- @label="topic.publish_page.publish"- @icon="file"- @disabled={{this.disabled}}- @isLoading={{this.saving}}- @action={{this.publish}}- class="btn-primary publish-page"- />- {{/if}}- </:footer>-</DModal>\ No newline at end of file+ </form>++ <div class="publish-url">+ <ConditionalLoadingSpinner @condition={{this.checking}} />++ {{#if this.existing}}+ <div class="current-url">+ {{i18n "topic.publish_page.publish_url"}}+ <div>+ <a+ href={{this.publishedPage.url}}+ target="_blank"+ rel="noopener noreferrer"+ >{{this.publishedPage.url}}</a>+ </div>+ </div>+ {{else}}+ {{#if this.showUrl}}+ <div class="valid-slug">+ {{i18n "topic.publish_page.preview_url"}}+ <div class="example-url">{{this.publishedPage.url}}</div>+ </div>+ {{/if}}++ {{#if this.invalid}}+ {{i18n "topic.publish_page.invalid_slug"}}+ <span class="invalid-slug">{{this.reason}}.</span>+ {{/if}}+ {{/if}}++ </div>+ </ConditionalLoadingSpinner>+ {{/if}}+ </:body>+ <:footer>+ {{#if this.showUnpublish}}+ <DButton+ @label="topic.publish_page.unpublish"+ @icon="trash-can"+ @isLoading={{this.unpublishing}}+ @action={{this.unpublish}}+ class="btn-danger"+ />++ <DButton+ @icon="xmark"+ @label="close"+ @action={{@closeModal}}+ class="close-publish-page"+ />+ {{else if this.unpublished}}+ <DButton+ @label="topic.publish_page.publishing_settings"+ @action={{this.startNew}}+ />+ {{else}}+ <DButton+ @label="topic.publish_page.publish"+ @icon="file"+ @disabled={{this.disabled}}+ @isLoading={{this.saving}}+ @action={{this.publish}}+ class="btn-primary publish-page"+ />+ {{/if}}+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/raw-email.gjs b/app/assets/javascripts/discourse/app/components/modal/raw-email.gjsindex dc19e1413a4..491688b35a4 100644--- a/app/assets/javascripts/discourse/app/components/modal/raw-email.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/raw-email.gjs@@ -1,7 +1,13 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { Textarea } from "@ember/component";import { action } from "@ember/object";+import { eq } from "truth-helpers";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";+import IframedHtml from "discourse/components/iframed-html";import Post from "discourse/models/post";+import { i18n } from "discourse-i18n";export default class RawEmailComponent extends Component {@tracked rawEmail = this.args.model.rawEmail || "";@@ -38,55 +44,60 @@ export default class RawEmailComponent extends Component {displayHtmlPart() {this.tab = "html_part";}-}-<DModal- @title={{i18n "raw_email.title"}}- class="incoming-email-modal"- @closeModal={{@closeModal}}->- <:body>- <div class="incoming-email-tabs">- <DButton- @action={{this.displayRaw}}- @label="post.raw_email.displays.raw.button"- @title="post.raw_email.displays.raw.title"- class={{if (eq this.tab "raw") "active"}}- />+ <template>+ <DModal+ @title={{i18n "raw_email.title"}}+ class="incoming-email-modal"+ @closeModal={{@closeModal}}+ >+ <:body>+ <div class="incoming-email-tabs">+ <DButton+ @action={{this.displayRaw}}+ @label="post.raw_email.displays.raw.button"+ @title="post.raw_email.displays.raw.title"+ class={{if (eq this.tab "raw") "active"}}+ />- {{#if this.textPart}}- <DButton- @action={{this.displayTextPart}}- @label="post.raw_email.displays.text_part.button"- @title="post.raw_email.displays.text_part.title"- class={{if (eq this.tab "text_part") "active"}}- />- {{/if}}+ {{#if this.textPart}}+ <DButton+ @action={{this.displayTextPart}}+ @label="post.raw_email.displays.text_part.button"+ @title="post.raw_email.displays.text_part.title"+ class={{if (eq this.tab "text_part") "active"}}+ />+ {{/if}}- {{#if this.htmlPart}}- <DButton- @action={{this.displayHtmlPart}}- @label="post.raw_email.displays.html_part.button"- @title="post.raw_email.displays.html_part.title"- class={{if (eq this.tab "html_part") "active"}}- />- {{/if}}- </div>+ {{#if this.htmlPart}}+ <DButton+ @action={{this.displayHtmlPart}}+ @label="post.raw_email.displays.html_part.button"+ @title="post.raw_email.displays.html_part.title"+ class={{if (eq this.tab "html_part") "active"}}+ />+ {{/if}}+ </div>- <div class="incoming-email-content">- {{#if (eq this.tab "raw")}}- {{#if this.rawEmail}}- <Textarea @value={{this.rawEmail}} />- {{else}}- {{i18n "raw_email.not_available"}}- {{/if}}- {{/if}}- {{#if (eq this.tab "text_part")}}- <Textarea @value={{this.textPart}} />- {{/if}}- {{#if (eq this.tab "html_part")}}- <IframedHtml @html={{this.htmlPart}} class="incoming-email-html-part" />- {{/if}}- </div>- </:body>-</DModal>\ No newline at end of file+ <div class="incoming-email-content">+ {{#if (eq this.tab "raw")}}+ {{#if this.rawEmail}}+ <Textarea @value={{this.rawEmail}} />+ {{else}}+ {{i18n "raw_email.not_available"}}+ {{/if}}+ {{/if}}+ {{#if (eq this.tab "text_part")}}+ <Textarea @value={{this.textPart}} />+ {{/if}}+ {{#if (eq this.tab "html_part")}}+ <IframedHtml+ @html={{this.htmlPart}}+ class="incoming-email-html-part"+ />+ {{/if}}+ </div>+ </:body>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/reject-reason-reviewable.gjs b/app/assets/javascripts/discourse/app/components/modal/reject-reason-reviewable.gjsindex d7200bc3810..7eb0a0f28d0 100644--- a/app/assets/javascripts/discourse/app/components/modal/reject-reason-reviewable.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/reject-reason-reviewable.gjs@@ -1,5 +1,9 @@import Component from "@glimmer/component";+import { Input, Textarea } from "@ember/component";import { action } from "@ember/object";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";+import { i18n } from "discourse-i18n";export default class RejectReasonReviewableModal extends Component {rejectReason;@@ -14,35 +18,37 @@ export default class RejectReasonReviewableModal extends Component {this.args.closeModal();await this.args.model.performConfirmed(this.args.model.action);}-}-<DModal- @bodyClass="reject-reason-reviewable-modal__explain-reviewable"- @closeModal={{@closeModal}}- @title={{i18n "review.reject_reason.title"}}- class="reject-reason-reviewable-modal"->- <:body>- <Textarea @value={{this.rejectReason}} />- <div class="control-group">- <label>- <Input- @type="checkbox"- class="reject-reason-reviewable-modal__send_email--inline"- @checked={{this.sendEmail}}- />- {{i18n "review.reject_reason.send_email"}}- </label>- </div>- </:body>+ <template>+ <DModal+ @bodyClass="reject-reason-reviewable-modal__explain-reviewable"+ @closeModal={{@closeModal}}+ @title={{i18n "review.reject_reason.title"}}+ class="reject-reason-reviewable-modal"+ >+ <:body>+ <Textarea @value={{this.rejectReason}} />+ <div class="control-group">+ <label>+ <Input+ @type="checkbox"+ class="reject-reason-reviewable-modal__send_email--inline"+ @checked={{this.sendEmail}}+ />+ {{i18n "review.reject_reason.send_email"}}+ </label>+ </div>+ </:body>- <:footer>- <DButton- @icon="trash-can"- @action={{this.perform}}- @label="admin.user.delete"- class="btn-danger"- />- <DButton @action={{@closeModal}} @label="cancel" class="cancel" />- </:footer>-</DModal>\ No newline at end of file+ <:footer>+ <DButton+ @icon="trash-can"+ @action={{this.perform}}+ @label="admin.user.delete"+ class="btn-danger"+ />+ <DButton @action={{@closeModal}} @label="cancel" class="cancel" />+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/reorder-categories.gjs b/app/assets/javascripts/discourse/app/components/modal/reorder-categories.gjsindex a12060ca593..02e4df26e8a 100644--- a/app/assets/javascripts/discourse/app/components/modal/reorder-categories.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/reorder-categories.gjs@@ -1,9 +1,17 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { concat, fn } from "@ember/helper";+import { on } from "@ember/modifier";import { action } from "@ember/object";import { service } from "@ember/service";+import { eq, not } from "truth-helpers";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";+import categoryBadge from "discourse/helpers/category-badge";+import withEventValue from "discourse/helpers/with-event-value";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";+import { i18n } from "discourse-i18n";class Entry {@tracked position;@@ -175,69 +183,71 @@ export default class ReorderCategories extends Component {popupAjaxError(e);}}-}-<DModal- @title={{i18n "categories.reorder.title"}}- @closeModal={{@closeModal}}- @inline={{@inline}}- class="reorder-categories"->- <:body>- <table>- <thead>- <th>{{i18n "categories.category"}}</th>- <th class="reorder-categories__header-position">- {{i18n "categories.reorder.position"}}- </th>- </thead>- <tbody>- {{#each this.sortedEntries as |entry|}}- <tr- data-category-id={{entry.category.id}}- class={{if- (eq this.highlightedCategoryId entry.category.id)- "highlighted"- }}- >- <td>- <div class={{concat "reorder-categories-depth-" entry.depth}}>- {{category-badge entry.category allowUncategorized="true"}}- </div>- </td>-- <td>- <div class="reorder-categories-actions">- <input- {{on "change" (with-event-value (fn this.change entry))}}- value={{entry.position}}- type="number"- min="0"- />- <DButton- @action={{fn this.move entry -1}}- @icon="arrow-up"- class="btn-default no-text move-up"- />- <DButton- @action={{fn this.move entry 1}}- @icon="arrow-down"- class="btn-default no-text move-down"- />- </div>- </td>- </tr>- {{/each}}- </tbody>- </table>- </:body>-- <:footer>- <DButton- @action={{this.save}}- @label="categories.reorder.save"- @disabled={{not this.changed}}- class="btn-primary"- />- </:footer>-</DModal>\ No newline at end of file+ <template>+ <DModal+ @title={{i18n "categories.reorder.title"}}+ @closeModal={{@closeModal}}+ @inline={{@inline}}+ class="reorder-categories"+ >+ <:body>+ <table>+ <thead>+ <th>{{i18n "categories.category"}}</th>+ <th class="reorder-categories__header-position">+ {{i18n "categories.reorder.position"}}+ </th>+ </thead>+ <tbody>+ {{#each this.sortedEntries as |entry|}}+ <tr+ data-category-id={{entry.category.id}}+ class={{if+ (eq this.highlightedCategoryId entry.category.id)+ "highlighted"+ }}+ >+ <td>+ <div class={{concat "reorder-categories-depth-" entry.depth}}>+ {{categoryBadge entry.category allowUncategorized="true"}}+ </div>+ </td>++ <td>+ <div class="reorder-categories-actions">+ <input+ {{on "change" (withEventValue (fn this.change entry))}}+ value={{entry.position}}+ type="number"+ min="0"+ />+ <DButton+ @action={{fn this.move entry -1}}+ @icon="arrow-up"+ class="btn-default no-text move-up"+ />+ <DButton+ @action={{fn this.move entry 1}}+ @icon="arrow-down"+ class="btn-default no-text move-down"+ />+ </div>+ </td>+ </tr>+ {{/each}}+ </tbody>+ </table>+ </:body>++ <:footer>+ <DButton+ @action={{this.save}}+ @label="categories.reorder.save"+ @disabled={{not this.changed}}+ class="btn-primary"+ />+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/request-group-membership-form.gjs b/app/assets/javascripts/discourse/app/components/modal/request-group-membership-form.gjsindex 1eb402d25ac..6e00264f8f1 100644--- a/app/assets/javascripts/discourse/app/components/modal/request-group-membership-form.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/request-group-membership-form.gjs@@ -1,7 +1,15 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { fn } from "@ember/helper";+import { on } from "@ember/modifier";import { action } from "@ember/object";import { isEmpty } from "@ember/utils";+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";+import DModalCancel from "discourse/components/d-modal-cancel";+import ExpandingTextArea from "discourse/components/expanding-text-area";+import withEventValue from "discourse/helpers/with-event-value";import { popupAjaxError } from "discourse/lib/ajax-error";import DiscourseURL from "discourse/lib/url";import { i18n } from "discourse-i18n";@@ -33,37 +41,39 @@ export default class RequestGroupMembershipForm extends Component {this.loading = false;}}-}-<DModal- @title={{this.title}}- @closeModal={{@closeModal}}- @inline={{@inline}}- class="request-group-membership-form"->- <:body>- <div class="control-group">- <label>- {{i18n "groups.membership_request.reason"}}- </label>+ <template>+ <DModal+ @title={{this.title}}+ @closeModal={{@closeModal}}+ @inline={{@inline}}+ class="request-group-membership-form"+ >+ <:body>+ <div class="control-group">+ <label>+ {{i18n "groups.membership_request.reason"}}+ </label>- <ExpandingTextArea- {{on "input" (with-event-value (fn (mut this.reason)))}}- value={{this.reason}}- maxlength="5000"- />- </div>- </:body>+ <ExpandingTextArea+ {{on "input" (withEventValue (fn (mut this.reason)))}}+ value={{this.reason}}+ maxlength="5000"+ />+ </div>+ </:body>- <:footer>- <DButton- @action={{this.requestMember}}- @label="groups.membership_request.submit"- @disabled={{this.disableSubmit}}- class="btn-primary"- />+ <:footer>+ <DButton+ @action={{this.requestMember}}+ @label="groups.membership_request.submit"+ @disabled={{this.disableSubmit}}+ class="btn-primary"+ />- <DModalCancel @close={{@closeModal}} />- <ConditionalLoadingSpinner @size="small" @condition={{this.loading}} />- </:footer>-</DModal>\ No newline at end of file+ <DModalCancel @close={{@closeModal}} />+ <ConditionalLoadingSpinner @size="small" @condition={{this.loading}} />+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/second-factor-add-security-key.gjs b/app/assets/javascripts/discourse/app/components/modal/second-factor-add-security-key.gjsindex fcd04c9fef2..613393b23df 100644--- a/app/assets/javascripts/discourse/app/components/modal/second-factor-add-security-key.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/second-factor-add-security-key.gjs@@ -1,7 +1,13 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { Input } from "@ember/component";import { action } from "@ember/object";+import didInsert from "@ember/render-modifiers/modifiers/did-insert";import { service } from "@ember/service";+import { htmlSafe } from "@ember/template";+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";import {bufferToBase64,isWebauthnSupported,@@ -154,53 +160,55 @@ export default class SecondFactorAddSecurityKey extends Component {});}-}-<DModal- @closeModal={{@closeModal}}- @title={{i18n "user.second_factor.security_key.add"}}- {{did-insert this.securityKeyRequested}}->- <:body>- <ConditionalLoadingSpinner @condition={{this.loading}}>- {{#if this.errorMessage}}- <div class="control-group">- <div class="controls">- <div class="alert alert-error">{{this.errorMessage}}</div>- </div>- </div>- {{/if}}+ <template>+ <DModal+ @closeModal={{@closeModal}}+ @title={{i18n "user.second_factor.security_key.add"}}+ {{didInsert this.securityKeyRequested}}+ >+ <:body>+ <ConditionalLoadingSpinner @condition={{this.loading}}>+ {{#if this.errorMessage}}+ <div class="control-group">+ <div class="controls">+ <div class="alert alert-error">{{this.errorMessage}}</div>+ </div>+ </div>+ {{/if}}- <div class="control-group">- <div class="controls">- {{html-safe- (i18n "user.second_factor.enable_security_key_description")- }}- </div>- </div>+ <div class="control-group">+ <div class="controls">+ {{htmlSafe+ (i18n "user.second_factor.enable_security_key_description")+ }}+ </div>+ </div>- <div class="control-group">- <div class="controls">- <Input- @value={{this.securityKeyName}}- id="security-key-name"- placeholder="security key name"- maxlength={{this.maxSecondFactorNameLength}}- />- </div>- </div>+ <div class="control-group">+ <div class="controls">+ <Input+ @value={{this.securityKeyName}}+ id="security-key-name"+ placeholder="security key name"+ maxlength={{this.maxSecondFactorNameLength}}+ />+ </div>+ </div>- <div class="control-group">- <div class="controls">- {{#unless this.webauthnUnsupported}}- <DButton- class="btn-primary add-security-key"- @action={{this.registerSecurityKey}}- @label="user.second_factor.security_key.register"- />- {{/unless}}- </div>- </div>- </ConditionalLoadingSpinner>- </:body>-</DModal>\ No newline at end of file+ <div class="control-group">+ <div class="controls">+ {{#unless this.webauthnUnsupported}}+ <DButton+ class="btn-primary add-security-key"+ @action={{this.registerSecurityKey}}+ @label="user.second_factor.security_key.register"+ />+ {{/unless}}+ </div>+ </div>+ </ConditionalLoadingSpinner>+ </:body>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/second-factor-add-totp.gjs b/app/assets/javascripts/discourse/app/components/modal/second-factor-add-totp.gjsindex 793fc5a60fe..7b92e451291 100644--- a/app/assets/javascripts/discourse/app/components/modal/second-factor-add-totp.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/second-factor-add-totp.gjs@@ -1,6 +1,15 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { fn } from "@ember/helper";+import { on } from "@ember/modifier";import { action } from "@ember/object";+import didInsert from "@ember/render-modifiers/modifiers/did-insert";+import { htmlSafe } from "@ember/template";+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";+import SecondFactorInput from "discourse/components/second-factor-input";+import withEventValue from "discourse/helpers/with-event-value";import {MAX_SECOND_FACTOR_NAME_LENGTH,SECOND_FACTOR_METHODS,@@ -72,88 +81,93 @@ export default class SecondFactorAddTotp extends Component {.catch((error) => this.args.model.onError(error)).finally(() => (this.loading = false));}-}--<DModal- @closeModal={{@closeModal}}- @title={{i18n "user.second_factor.totp.add"}}- {{did-insert this.totpRequested}}->- <:body>- <ConditionalLoadingSpinner @condition={{this.loading}}>- {{#if this.errorMessage}}- <div class="control-group">- <div class="controls">- <div class="alert alert-error">{{this.errorMessage}}</div>- </div>- </div>- {{/if}}- <div class="control-group">- <div class="controls">- {{html-safe (i18n "user.second_factor.enable_description")}}- </div>- </div>+ <template>+ <DModal+ @closeModal={{@closeModal}}+ @title={{i18n "user.second_factor.totp.add"}}+ {{didInsert this.totpRequested}}+ >+ <:body>+ <ConditionalLoadingSpinner @condition={{this.loading}}>+ {{#if this.errorMessage}}+ <div class="control-group">+ <div class="controls">+ <div class="alert alert-error">{{this.errorMessage}}</div>+ </div>+ </div>+ {{/if}}- <div class="control-group">- <div class="controls">- <div class="qr-code">- <img src={{html-safe this.secondFactorImage}} />+ <div class="control-group">+ <div class="controls">+ {{htmlSafe (i18n "user.second_factor.enable_description")}}+ </div></div>- <p>- {{#if this.showSecondFactorKey}}- <div class="second-factor-key">- {{this.secondFactorKey}}++ <div class="control-group">+ <div class="controls">+ <div class="qr-code">+ <img src={{htmlSafe this.secondFactorImage}} /></div>- {{else}}- <a- href- class="show-second-factor-key"- {{on "click" this.enableShowSecondFactorKey}}- >{{i18n "user.second_factor.show_key_description"}}</a>- {{/if}}- </p>- </div>- </div>+ <p>+ {{#if this.showSecondFactorKey}}+ <div class="second-factor-key">+ {{this.secondFactorKey}}+ </div>+ {{else}}+ <a+ href+ class="show-second-factor-key"+ {{on "click" this.enableShowSecondFactorKey}}+ >{{i18n "user.second_factor.show_key_description"}}</a>+ {{/if}}+ </p>+ </div>+ </div>- <div class="control-group">- <label class="control-label input-prepend">{{i18n- "user.second_factor.name"- }}</label>- <div class="controls">- <input- {{on "input" (with-event-value (fn (mut this.secondFactorName)))}}- value={{this.secondFactorName}}- type="text"- placeholder={{i18n "user.second_factor.totp.default_name"}}- maxlength={{this.maxSecondFactorNameLength}}- id="second-factor-name"- />- </div>+ <div class="control-group">+ <label class="control-label input-prepend">{{i18n+ "user.second_factor.name"+ }}</label>+ <div class="controls">+ <input+ {{on "input" (withEventValue (fn (mut this.secondFactorName)))}}+ value={{this.secondFactorName}}+ type="text"+ placeholder={{i18n "user.second_factor.totp.default_name"}}+ maxlength={{this.maxSecondFactorNameLength}}+ id="second-factor-name"+ />+ </div>- <label class="control-label input-prepend">- {{i18n "user.second_factor.label"}}- </label>- <div class="controls">- <SecondFactorInput- {{on "input" (with-event-value (fn (mut this.secondFactorToken)))}}- @secondFactorMethod={{this.totpType}}- value={{this.secondFactorToken}}- placeholder="123456"- id="second-factor-token"- />- </div>- </div>+ <label class="control-label input-prepend">+ {{i18n "user.second_factor.label"}}+ </label>+ <div class="controls">+ <SecondFactorInput+ {{on+ "input"+ (withEventValue (fn (mut this.secondFactorToken)))+ }}+ @secondFactorMethod={{this.totpType}}+ value={{this.secondFactorToken}}+ placeholder="123456"+ id="second-factor-token"+ />+ </div>+ </div>- <div class="control-group">- <div class="controls">- <DButton- class="btn-primary add-totp"- @action={{this.enableSecondFactor}}- @label="enable"- />- </div>- </div>- </ConditionalLoadingSpinner>- </:body>-</DModal>\ No newline at end of file+ <div class="control-group">+ <div class="controls">+ <DButton+ class="btn-primary add-totp"+ @action={{this.enableSecondFactor}}+ @label="enable"+ />+ </div>+ </div>+ </ConditionalLoadingSpinner>+ </:body>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/second-factor-backup-edit.gjs b/app/assets/javascripts/discourse/app/components/modal/second-factor-backup-edit.gjsindex 3983d71f69e..0529a825dae 100644--- a/app/assets/javascripts/discourse/app/components/modal/second-factor-backup-edit.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/second-factor-backup-edit.gjs@@ -1,6 +1,11 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";import { action } from "@ember/object";+import { htmlSafe } from "@ember/template";+import BackupCodes from "discourse/components/backup-codes";+import ConditionalLoadingSection from "discourse/components/conditional-loading-section";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";import { debounce } from "discourse/lib/decorators";import { SECOND_FACTOR_METHODS } from "discourse/models/user";import { i18n } from "discourse-i18n";@@ -62,67 +67,70 @@ export default class SecondFactorBackupEdit extends Component {this.successMessage = null;this.errorMessage = null;}-}-<DModal- @title={{i18n "user.second_factor_backup.title"}}- @closeModal={{@closeModal}}- class="second-factor-backup-edit-modal"->- <:body>- {{#if this.successMessage}}- <div class="alert alert-success">- {{this.successMessage}}- </div>- {{/if}}+ <template>+ <DModal+ @title={{i18n "user.second_factor_backup.title"}}+ @closeModal={{@closeModal}}+ class="second-factor-backup-edit-modal"+ >+ <:body>+ {{#if this.successMessage}}+ <div class="alert alert-success">+ {{this.successMessage}}+ </div>+ {{/if}}- {{#if this.errorMessage}}- <div class="alert alert-error">- {{this.errorMessage}}- </div>- {{/if}}+ {{#if this.errorMessage}}+ <div class="alert alert-error">+ {{this.errorMessage}}+ </div>+ {{/if}}- <ConditionalLoadingSection @isLoading={{this.loading}}>- {{#if this.backupCodes}}- <h3>{{i18n "user.second_factor_backup.codes.title"}}</h3>- <p>{{i18n "user.second_factor_backup.codes.description"}}</p>- <BackupCodes- @copyBackupCode={{this.copyBackupCode}}- @backupCodes={{this.backupCodes}}- />- {{/if}}- </ConditionalLoadingSection>+ <ConditionalLoadingSection @isLoading={{this.loading}}>+ {{#if this.backupCodes}}+ <h3>{{i18n "user.second_factor_backup.codes.title"}}</h3>+ <p>{{i18n "user.second_factor_backup.codes.description"}}</p>+ <BackupCodes+ @copyBackupCode={{this.copyBackupCode}}+ @backupCodes={{this.backupCodes}}+ />+ {{/if}}+ </ConditionalLoadingSection>- {{#if this.backupEnabled}}- {{html-safe- (i18n- "user.second_factor_backup.remaining_codes" count=this.remainingCodes- )- }}- {{else}}- {{html-safe (i18n "user.second_factor_backup.not_enabled")}}- {{/if}}- </:body>- <:footer>- <div class="actions">- {{#if this.backupEnabled}}- <DButton- class="btn-primary"- @icon="arrow-rotate-right"- @action={{this.generateSecondFactorCodes}}- @type="submit"- @isLoading={{this.loading}}- @label="user.second_factor_backup.regenerate"- />- {{else}}- <DButton- class="btn-primary"- @action={{this.generateSecondFactorCodes}}- @type="submit"- @disabled={{this.loading}}- @label="user.second_factor_backup.enable"- />- {{/if}}- </div>- </:footer>-</DModal>\ No newline at end of file+ {{#if this.backupEnabled}}+ {{htmlSafe+ (i18n+ "user.second_factor_backup.remaining_codes"+ count=this.remainingCodes+ )+ }}+ {{else}}+ {{htmlSafe (i18n "user.second_factor_backup.not_enabled")}}+ {{/if}}+ </:body>+ <:footer>+ <div class="actions">+ {{#if this.backupEnabled}}+ <DButton+ class="btn-primary"+ @icon="arrow-rotate-right"+ @action={{this.generateSecondFactorCodes}}+ @type="submit"+ @isLoading={{this.loading}}+ @label="user.second_factor_backup.regenerate"+ />+ {{else}}+ <DButton+ class="btn-primary"+ @action={{this.generateSecondFactorCodes}}+ @type="submit"+ @disabled={{this.loading}}+ @label="user.second_factor_backup.enable"+ />+ {{/if}}+ </div>+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/second-factor-edit-security-key.gjs b/app/assets/javascripts/discourse/app/components/modal/second-factor-edit-security-key.gjsindex edb7f991dbe..7ef6357f5e9 100644--- a/app/assets/javascripts/discourse/app/components/modal/second-factor-edit-security-key.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/second-factor-edit-security-key.gjs@@ -1,7 +1,11 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { Input } from "@ember/component";import { action } from "@ember/object";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";import { MAX_SECOND_FACTOR_NAME_LENGTH } from "discourse/models/user";+import { i18n } from "discourse-i18n";export default class SecondFactorEditSecurityKey extends Component {@tracked loading = false;@@ -31,33 +35,35 @@ export default class SecondFactorEditSecurityKey extends Component {this.args.closeModal();});}-}-<DModal- @title={{i18n "user.second_factor.security_key.edit"}}- @closeModal={{@closeModal}}- @tagName="form"->- <:body>- <div class="input-group">- <label for="security-key-name">{{i18n- "user.second_factor.security_key.edit_description"- }}</label>- <Input- name="security-key-name"- id="security-key-name"- maxlength={{this.maxSecondFactorNameLength}}- @type="text"- @value={{@model.securityKey.name}}- />- </div>- </:body>- <:footer>- <DButton- @action={{this.editSecurityKey}}- class="btn-primary"- @label="user.second_factor.security_key.save"- @type="submit"- />- </:footer>-</DModal>\ No newline at end of file+ <template>+ <DModal+ @title={{i18n "user.second_factor.security_key.edit"}}+ @closeModal={{@closeModal}}+ @tagName="form"+ >+ <:body>+ <div class="input-group">+ <label for="security-key-name">{{i18n+ "user.second_factor.security_key.edit_description"+ }}</label>+ <Input+ name="security-key-name"+ id="security-key-name"+ maxlength={{this.maxSecondFactorNameLength}}+ @type="text"+ @value={{@model.securityKey.name}}+ />+ </div>+ </:body>+ <:footer>+ <DButton+ @action={{this.editSecurityKey}}+ class="btn-primary"+ @label="user.second_factor.security_key.save"+ @type="submit"+ />+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/second-factor-edit.gjs b/app/assets/javascripts/discourse/app/components/modal/second-factor-edit.gjsindex 4c5fea3e651..1362283ef5f 100644--- a/app/assets/javascripts/discourse/app/components/modal/second-factor-edit.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/second-factor-edit.gjs@@ -1,7 +1,11 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { Input } from "@ember/component";import { action } from "@ember/object";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";import { MAX_SECOND_FACTOR_NAME_LENGTH } from "discourse/models/user";+import { i18n } from "discourse-i18n";export default class SecondFactorEdit extends Component {@tracked loading = false;@@ -33,30 +37,32 @@ export default class SecondFactorEdit extends Component {this.args.closeModal();});}-}-<DModal- @title={{i18n "user.second_factor.edit_title"}}- @closeModal={{@closeModal}}->- <:body>- <div class="input-group">- <label for="authenticator-name">{{i18n- "user.second_factor.edit_description"- }}</label>- <Input- name="authenticator-name"- maxlength={{this.maxSecondFactorNameLength}}- @type="text"- @value={{@model.secondFactor.name}}- />- </div>- </:body>- <:footer>- <DButton- @action={{this.editSecondFactor}}- class="btn-primary"- @label="user.second_factor.save"- />- </:footer>-</DModal>\ No newline at end of file+ <template>+ <DModal+ @title={{i18n "user.second_factor.edit_title"}}+ @closeModal={{@closeModal}}+ >+ <:body>+ <div class="input-group">+ <label for="authenticator-name">{{i18n+ "user.second_factor.edit_description"+ }}</label>+ <Input+ name="authenticator-name"+ maxlength={{this.maxSecondFactorNameLength}}+ @type="text"+ @value={{@model.secondFactor.name}}+ />+ </div>+ </:body>+ <:footer>+ <DButton+ @action={{this.editSecondFactor}}+ class="btn-primary"+ @label="user.second_factor.save"+ />+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/share-topic.gjs b/app/assets/javascripts/discourse/app/components/modal/share-topic.gjsindex 05077cad5d0..a2639747b99 100644--- a/app/assets/javascripts/discourse/app/components/modal/share-topic.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/share-topic.gjs@@ -1,9 +1,15 @@-import Component from "@ember/component";+import Component, { Input } from "@ember/component";+import { hash } from "@ember/helper";import { action } from "@ember/object";import { readOnly } from "@ember/object/computed";import { getOwner } from "@ember/owner";import { service } from "@ember/service";+import CopyButton from "discourse/components/copy-button";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";import CreateInvite from "discourse/components/modal/create-invite";+import PluginOutlet from "discourse/components/plugin-outlet";+import ShareSource from "discourse/components/share-source";import discourseComputed, { afterRender } from "discourse/lib/decorators";import { longDateNoYear } from "discourse/lib/formatter";import { getAbsoluteURL } from "discourse/lib/get-url";@@ -114,83 +120,85 @@ export default class ShareTopicModal extends Component.extend(topicController.actions.replyAsNewTopic.call(topicController, post);this.closeModal();}-}-<DModal- @title={{if- this.post- (i18n "post.share.title" post_number=this.post.post_number)- (i18n "topic.share.title")- }}- @subtitle={{if this.post this.displayDate}}- @closeModal={{@closeModal}}- @flash={{this.flash}}- @flashType={{this.flashType}}- class="share-topic-modal"->- <form>- <div class="input-group invite-link">- <label for="invite-link">- {{if- this.post- (i18n "post.share.instructions" post_number=this.post.post_number)- (i18n "topic.share.instructions")- }}- </label>- <div class="link-share-container">- <Input- id="invite-link"- name="invite-link"- class="invite-link"- @value={{this.url}}- readonly={{true}}- size="200"- />- <CopyButton @selector="input.invite-link" @ariaLabel="share.url" />- </div>- </div>-- <div class="link-share-actions">- <div class="sources">- {{#each this.sources as |source|}}- <ShareSource @source={{source}} @action={{this.share}} />- {{/each}}-- {{#if this.allowInvites}}- <DButton- @label="topic.share.invite_users"- @icon="user-plus"- @action={{this.inviteUsers}}- class="btn-default invite"- />- {{/if}}-- {{#if this.topic.details.can_reply_as_new_topic}}- {{#if this.topic.isPrivateMessage}}- <DButton- @action={{this.replyAsNewTopic}}- @icon="plus"- @ariaLabel="post.reply_as_new_private_message"- @title="post.reply_as_new_private_message"- @label="user.new_private_message"- class="btn-default new-topic"+ <template>+ <DModal+ @title={{if+ this.post+ (i18n "post.share.title" post_number=this.post.post_number)+ (i18n "topic.share.title")+ }}+ @subtitle={{if this.post this.displayDate}}+ @closeModal={{@closeModal}}+ @flash={{this.flash}}+ @flashType={{this.flashType}}+ class="share-topic-modal"+ >+ <form>+ <div class="input-group invite-link">+ <label for="invite-link">+ {{if+ this.post+ (i18n "post.share.instructions" post_number=this.post.post_number)+ (i18n "topic.share.instructions")+ }}+ </label>+ <div class="link-share-container">+ <Input+ id="invite-link"+ name="invite-link"+ class="invite-link"+ @value={{this.url}}+ readonly={{true}}+ size="200"/>- {{else}}- <DButton- @action={{this.replyAsNewTopic}}- @icon="plus"- @ariaLabel="post.reply_as_new_topic"- @title="post.reply_as_new_topic"- @label="topic.create"- class="btn-default new-topic"+ <CopyButton @selector="input.invite-link" @ariaLabel="share.url" />+ </div>+ </div>++ <div class="link-share-actions">+ <div class="sources">+ {{#each this.sources as |source|}}+ <ShareSource @source={{source}} @action={{this.share}} />+ {{/each}}++ {{#if this.allowInvites}}+ <DButton+ @label="topic.share.invite_users"+ @icon="user-plus"+ @action={{this.inviteUsers}}+ class="btn-default invite"+ />+ {{/if}}++ {{#if this.topic.details.can_reply_as_new_topic}}+ {{#if this.topic.isPrivateMessage}}+ <DButton+ @action={{this.replyAsNewTopic}}+ @icon="plus"+ @ariaLabel="post.reply_as_new_private_message"+ @title="post.reply_as_new_private_message"+ @label="user.new_private_message"+ class="btn-default new-topic"+ />+ {{else}}+ <DButton+ @action={{this.replyAsNewTopic}}+ @icon="plus"+ @ariaLabel="post.reply_as_new_topic"+ @title="post.reply_as_new_topic"+ @label="topic.create"+ class="btn-default new-topic"+ />+ {{/if}}+ {{/if}}+ <PluginOutlet+ @name="share-topic-sources"+ @outletArgs={{hash topic=this.topic post=this.post}}/>- {{/if}}- {{/if}}- <PluginOutlet- @name="share-topic-sources"- @outletArgs={{hash topic=this.topic post=this.post}}- />- </div>- </div>- </form>-</DModal>\ No newline at end of file+ </div>+ </div>+ </form>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/modal/sidebar-section-form.gjs b/app/assets/javascripts/discourse/app/components/modal/sidebar-section-form.gjsindex 8a43df95155..6553cbe516e 100644--- a/app/assets/javascripts/discourse/app/components/modal/sidebar-section-form.gjs+++ b/app/assets/javascripts/discourse/app/components/modal/sidebar-section-form.gjs@@ -1,15 +1,24 @@import { cached, tracked } from "@glimmer/tracking";import { A } from "@ember/array";-import Component from "@ember/component";+import Component, { Input } from "@ember/component";+import { fn } from "@ember/helper";+import { on } from "@ember/modifier";import { action } from "@ember/object";import { service } from "@ember/service";import { isEmpty } from "@ember/utils";+import { and, not } from "truth-helpers";+import DButton from "discourse/components/d-button";+import DModal from "discourse/components/d-modal";+import SectionFormLink from "discourse/components/sidebar/section-form-link";+import icon from "discourse/helpers/d-icon";+import withEventValue from "discourse/helpers/with-event-value";import { ajax } from "discourse/lib/ajax";import { extractError } from "discourse/lib/ajax-error";import { SIDEBAR_SECTION, SIDEBAR_URL } from "discourse/lib/constants";import { afterRender, bind } from "discourse/lib/decorators";import { sanitize } from "discourse/lib/text";import { i18n } from "discourse-i18n";+import DTooltip from "float-kit/components/d-tooltip";class Section {@tracked title;@@ -80,9 +89,9 @@ class SectionLink {@tracked value;@tracked _destroy;- constructor({ router, icon, name, value, id, objectId, segment }) {+ constructor({ router, icon: iconName, name, value, id, objectId, segment }) {this.router = router;- this.icon = icon || "link";+ this.icon = iconName || "link";this.name = name;this.value = value;this.id = id;@@ -523,171 +532,179 @@ export default class SidebarSectionForm extends Component {},});}-}--<DModal- @closeModal={{@closeModal}}- @flash={{this.flash}}- @flashType={{this.flashType}}- @title={{i18n this.header}}- class="sidebar-section-form-modal"->- <:body>- <form class="form-horizontal sidebar-section-form">- {{#unless this.transformedModel.hideTitleInput}}- <div class="sidebar-section-form__input-wrapper">- <label for="section-name">- {{i18n "sidebar.sections.custom.title.label"}}- </label>-- <Input- name="section-name"- @type="text"- @value={{this.transformedModel.title}}- class={{this.transformedModel.titleCssClass}}- id="section-name"- {{on- "input"- (with-event-value (fn (mut this.transformedModel.title)))- }}- />- {{#if this.transformedModel.invalidTitleMessage}}- <div class="title warning">- {{this.transformedModel.invalidTitleMessage}}+ <template>+ <DModal+ @closeModal={{@closeModal}}+ @flash={{this.flash}}+ @flashType={{this.flashType}}+ @title={{i18n this.header}}+ class="sidebar-section-form-modal"+ >+ <:body>+ <form class="form-horizontal sidebar-section-form">+ {{#unless this.transformedModel.hideTitleInput}}+ <div class="sidebar-section-form__input-wrapper">+ <label for="section-name">+ {{i18n "sidebar.sections.custom.title.label"}}+ </label>++ <Input+ name="section-name"+ @type="text"+ @value={{this.transformedModel.title}}+ class={{this.transformedModel.titleCssClass}}+ id="section-name"+ {{on+ "input"+ (withEventValue (fn (mut this.transformedModel.title)))+ }}+ />++ {{#if this.transformedModel.invalidTitleMessage}}+ <div class="title warning">+ {{this.transformedModel.invalidTitleMessage}}+ </div>+ {{/if}}</div>- {{/if}}- </div>- {{/unless}}- <div- role="table"- aria-rowcount={{this.activeLinks.length}}- class="sidebar-section-form__links-wrapper"- >-- <div class="row-wrapper header" role="row">+ {{/unless}}<div- class="input-group link-icon"- role="columnheader"- aria-sort="none"+ role="table"+ aria-rowcount={{this.activeLinks.length}}+ class="sidebar-section-form__links-wrapper">- <label>{{i18n "sidebar.sections.custom.links.icon.label"}}</label>- </div>- <div- class="input-group link-name"- role="columnheader"- aria-sort="none"- >- <label>{{i18n "sidebar.sections.custom.links.name.label"}}</label>+ <div class="row-wrapper header" role="row">+ <div+ class="input-group link-icon"+ role="columnheader"+ aria-sort="none"+ >+ <label>{{i18n+ "sidebar.sections.custom.links.icon.label"+ }}</label>+ </div>++ <div+ class="input-group link-name"+ role="columnheader"+ aria-sort="none"+ >+ <label>{{i18n+ "sidebar.sections.custom.links.name.label"+ }}</label>+ </div>++ <div+ class="input-group link-url"+ role="columnheader"+ aria-sort="none"+ >+ <label>{{i18n+ "sidebar.sections.custom.links.value.label"+ }}</label>+ </div>+ </div>++ {{#each this.activeLinks as |link|}}+ <SectionFormLink+ @link={{link}}+ @deleteLink={{this.deleteLink}}+ @reorderCallback={{this.reorder}}+ @setDraggedLinkCallback={{this.setDraggedLink}}+ />+ {{/each}}+</div>+ <DButton+ @action={{this.addLink}}+ @title="sidebar.sections.custom.links.add"+ @icon="plus"+ @label="sidebar.sections.custom.links.add"+ @ariaLabel="sidebar.sections.custom.links.add"+ class="btn-flat btn-text add-link"+ />+ {{#if this.transformedModel.sectionType}}+ <hr />+ <h3>{{i18n "sidebar.sections.custom.more_menu"}}</h3>+ {{#each this.activeSecondaryLinks as |link|}}+ <SectionFormLink+ @link={{link}}+ @deleteLink={{this.deleteLink}}+ @reorderCallback={{this.reorder}}+ @setDraggedLinkCallback={{this.setDraggedLink}}+ />+ {{/each}}+ <DButton+ @action={{this.addSecondaryLink}}+ @title="sidebar.sections.custom.links.add"+ @icon="plus"+ @label="sidebar.sections.custom.links.add"+ @ariaLabel="sidebar.sections.custom.links.add"+ class="btn-flat btn-text add-link"+ />+ {{/if}}+ </form>+ </:body>+ <:footer>+ <DButton+ @action={{this.save}}+ @label="sidebar.sections.custom.save"+ @ariaLabel="sidebar.sections.custom.save"+ @disabled={{not this.transformedModel.valid}}+ id="save-section"+ class="btn-primary"+ />+ {{#if (and this.currentUser.admin)}}<div- class="input-group link-url"- role="columnheader"- aria-sort="none"+ class="mark-public-wrapper+ {{if this.transformedModel.sectionType '-disabled'}}">- <label>{{i18n "sidebar.sections.custom.links.value.label"}}</label>+ <label class="checkbox-label">+ {{#if this.transformedModel.sectionType}}+ <DTooltip+ @content={{i18n "sidebar.sections.custom.always_public"}}+ class="always-public-tooltip"+ >+ <:trigger>+ {{icon "square-check"}}+ <span>{{i18n "sidebar.sections.custom.public"}}</span>+ </:trigger>+ </DTooltip>+ {{else}}+ <Input+ @type="checkbox"+ @checked={{this.transformedModel.public}}+ class="mark-public"+ disabled={{this.transformedModel.sectionType}}+ />+ <span>{{i18n "sidebar.sections.custom.public"}}</span>+ {{/if}}+ </label></div>- </div>-- {{#each this.activeLinks as |link|}}- <Sidebar::SectionFormLink- @link={{link}}- @deleteLink={{this.deleteLink}}- @reorderCallback={{this.reorder}}- @setDraggedLinkCallback={{this.setDraggedLink}}+ {{/if}}+ {{#if this.canDelete}}+ <DButton+ @icon="trash-can"+ @action={{this.delete}}+ @label="sidebar.sections.custom.delete"+ @ariaLabel="sidebar.sections.custom.delete"+ id="delete-section"+ class="btn-danger delete"/>- {{/each}}-- </div>- <DButton- @action={{this.addLink}}- @title="sidebar.sections.custom.links.add"- @icon="plus"- @label="sidebar.sections.custom.links.add"- @ariaLabel="sidebar.sections.custom.links.add"- class="btn-flat btn-text add-link"- />-- {{#if this.transformedModel.sectionType}}- <hr />- <h3>{{i18n "sidebar.sections.custom.more_menu"}}</h3>- {{#each this.activeSecondaryLinks as |link|}}- <Sidebar::SectionFormLink- @link={{link}}- @deleteLink={{this.deleteLink}}- @reorderCallback={{this.reorder}}- @setDraggedLinkCallback={{this.setDraggedLink}}+ {{/if}}+ {{#if this.transformedModel.sectionType}}+ <DButton+ @action={{this.resetToDefault}}+ @icon="arrow-rotate-left"+ @title="sidebar.sections.custom.links.reset"+ @label="sidebar.sections.custom.links.reset"+ @ariaLabel="sidebar.sections.custom.links.reset"+ class="btn-flat btn-text reset-link"/>- {{/each}}- <DButton- @action={{this.addSecondaryLink}}- @title="sidebar.sections.custom.links.add"- @icon="plus"- @label="sidebar.sections.custom.links.add"- @ariaLabel="sidebar.sections.custom.links.add"- class="btn-flat btn-text add-link"- />- {{/if}}- </form>- </:body>- <:footer>- <DButton- @action={{this.save}}- @label="sidebar.sections.custom.save"- @ariaLabel="sidebar.sections.custom.save"- @disabled={{not this.transformedModel.valid}}- id="save-section"- class="btn-primary"- />- {{#if (and this.currentUser.admin)}}- <div- class="mark-public-wrapper- {{if this.transformedModel.sectionType '-disabled'}}"- >- <label class="checkbox-label">- {{#if this.transformedModel.sectionType}}- <DTooltip- @content={{i18n "sidebar.sections.custom.always_public"}}- class="always-public-tooltip"- >- <:trigger>- {{d-icon "square-check"}}- <span>{{i18n "sidebar.sections.custom.public"}}</span>- </:trigger>- </DTooltip>- {{else}}- <Input- @type="checkbox"- @checked={{this.transformedModel.public}}- class="mark-public"- disabled={{this.transformedModel.sectionType}}- />- <span>{{i18n "sidebar.sections.custom.public"}}</span>- {{/if}}- </label>- </div>- {{/if}}- {{#if this.canDelete}}- <DButton- @icon="trash-can"- @action={{this.delete}}- @label="sidebar.sections.custom.delete"- @ariaLabel="sidebar.sections.custom.delete"- id="delete-section"- class="btn-danger delete"- />- {{/if}}- {{#if this.transformedModel.sectionType}}- <DButton- @action={{this.resetToDefault}}- @icon="arrow-rotate-left"- @title="sidebar.sections.custom.links.reset"- @label="sidebar.sections.custom.links.reset"- @ariaLabel="sidebar.sections.custom.links.reset"- class="btn-flat btn-text reset-link"- />- {{/if}}- </:footer>-</DModal>\ No newline at end of file+ {{/if}}+ </:footer>+ </DModal>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/mount-widget.gjs b/app/assets/javascripts/discourse/app/components/mount-widget.gjsindex 6312a986ff0..28063a124ef 100644--- a/app/assets/javascripts/discourse/app/components/mount-widget.gjs+++ b/app/assets/javascripts/discourse/app/components/mount-widget.gjs@@ -202,13 +202,15 @@ export default class MountWidget extends Component {super.didUpdateAttrs(...arguments);this.queueRerender();}-}-{{#each this._childComponents as |info|}}- {{#in-element info.element insertBefore=null}}- <info.component- @data={{info.data}}- @setWrapperElementAttrs={{info.setWrapperElementAttrs}}- />- {{/in-element}}-{{/each}}\ No newline at end of file+ <template>+ {{#each this._childComponents as |info|}}+ {{#in-element info.element insertBefore=null}}+ <info.component+ @data={{info.data}}+ @setWrapperElementAttrs={{info.setWrapperElementAttrs}}+ />+ {{/in-element}}+ {{/each}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/navigation-item.gjs b/app/assets/javascripts/discourse/app/components/navigation-item.gjsindex 3ad6829f833..2d5619e3861 100644--- a/app/assets/javascripts/discourse/app/components/navigation-item.gjs+++ b/app/assets/javascripts/discourse/app/components/navigation-item.gjs@@ -96,15 +96,17 @@ export default class NavigationItem extends Component {this.set("activeClass", this.active ? "active" : "");}-}-<a- href={{this.hrefLink}}- class={{this.activeClass}}- aria-current={{if this.activeClass "page"}}->- {{#if this.hasIcon}}- <span class={{this.content.name}}></span>- {{/if}}- {{this.content.displayName}}-</a>\ No newline at end of file+ <template>+ <a+ href={{this.hrefLink}}+ class={{this.activeClass}}+ aria-current={{if this.activeClass "page"}}+ >+ {{#if this.hasIcon}}+ <span class={{this.content.name}}></span>+ {{/if}}+ {{this.content.displayName}}+ </a>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/parent-category-row.gjs b/app/assets/javascripts/discourse/app/components/parent-category-row.gjsindex fa450c9c8a1..57239208522 100644--- a/app/assets/javascripts/discourse/app/components/parent-category-row.gjs+++ b/app/assets/javascripts/discourse/app/components/parent-category-row.gjs@@ -1,223 +1,243 @@+import { array, hash } from "@ember/helper";+import { LinkTo } from "@ember/routing";+import { htmlSafe } from "@ember/template";+import { gt } from "truth-helpers";import CategoryListItem from "discourse/components/category-list-item";+import CategoryTitleLink from "discourse/components/category-title-link";+import CategoryUnread from "discourse/components/category-unread";+import MobileCategoryTopic from "discourse/components/mobile-category-topic";+import PluginOutlet from "discourse/components/plugin-outlet";+import SubCategoryItem from "discourse/components/sub-category-item";+import SubCategoryRow from "discourse/components/sub-category-row";+import FeaturedTopic from "discourse/components/topic-list/featured-topic";+import borderColor from "discourse/helpers/border-color";+import categoryColorVariable from "discourse/helpers/category-color-variable";+import dirSpan from "discourse/helpers/dir-span";+import { i18n } from "discourse-i18n";-export default class ParentCategoryRow extends CategoryListItem {}--{{#unless this.isHidden}}- <PluginOutlet- @name="category-list-above-each-category"- @outletArgs={{hash category=this.category}}- />-- {{#if this.site.mobileView}}- <PluginOutlet- @name="category-list-before-category-mobile"- @outletArgs={{hash- category=this.category- listType=this.listType- isMuted=this.isMuted- }}- />- <div- data-category-id={{this.category.id}}- data-notification-level={{this.category.notificationLevelString}}- style={{border-color this.category.color}}- class="category-list-item category {{if this.isMuted 'muted'}}"- >- <table class="topic-list">- <tbody>- <tr>- <th class="main-link">- <CategoryTitleLink @category={{this.category}} />- </th>- <PluginOutlet- @name="category-list-after-title-mobile-section"- @outletArgs={{hash category=this.category}}- />- </tr>- {{#if this.category.description_excerpt}}- <tr class="category-description">- <td colspan="3">- {{html-safe this.category.description_excerpt}}- </td>- </tr>- {{/if}}- {{#unless this.isMuted}}- {{#if this.showTopics}}- {{#each this.category.featuredTopics as |t|}}- <MobileCategoryTopic @topic={{t}} />- {{/each}}- {{/if}}- {{/unless}}- {{#if this.category.isGrandParent}}- {{#each this.category.subcategories as |subcategory|}}- <SubCategoryRow- @category={{subcategory}}- @listType={{this.listType}}- />- {{/each}}- {{else if this.category.subcategories}}- <tr class="subcategories-list">- <td>- <div class="subcategories">- {{#each this.category.subcategories as |subcategory|}}- <SubCategoryItem- @category={{subcategory}}- @listType={{this.listType}}- />- {{/each}}- </div>- </td>- </tr>- {{/if}}- </tbody>- </table>- <footer class="clearfix category-topics-count">- <div class="category-stat">- <a href={{this.category.url}}>- {{html-safe this.category.statTotal}}- </a>- </div>- {{#unless this.category.pickAll}}- <div class="category-stat">- <a href={{this.category.url}}>- {{html-safe this.category.stat}}- </a>- </div>- {{/unless}}- </footer>- </div>- {{else}}-- <tr- data-category-id={{this.category.id}}- data-notification-level={{this.category.notificationLevelString}}- class="{{if- this.category.description_excerpt- 'has-description'- 'no-description'- }}- {{this.applyValueTransformer- 'parent-category-row-class'- (array)- (hash category=this.category)- }}- {{if this.category.uploaded_logo.url 'has-logo' 'no-logo'}}"- >-+export default class ParentCategoryRow extends CategoryListItem {+ <template>+ {{#unless this.isHidden}}<PluginOutlet- @name="category-list-before-category-section"- @outletArgs={{hash category=this.category listType=this.listType}}+ @name="category-list-above-each-category"+ @outletArgs={{hash category=this.category}}/>- <td- class="category {{if this.isMuted 'muted'}}"- style={{category-color-variable this.category.color}}- >- <CategoryTitleLink @category={{this.category}} />+ {{#if this.site.mobileView}}<PluginOutlet- @name="below-category-title-link"- @connectorTagName="div"- @outletArgs={{hash category=this.category}}+ @name="category-list-before-category-mobile"+ @outletArgs={{hash+ category=this.category+ listType=this.listType+ isMuted=this.isMuted+ }}/>-- {{#if this.category.description_excerpt}}- <div class="category-description">- {{dir-span this.category.description_excerpt htmlSafe="true"}}- </div>- {{/if}}-- {{#if this.category.isGrandParent}}- <table class="category-list subcategories-with-subcategories">+ <div+ data-category-id={{this.category.id}}+ data-notification-level={{this.category.notificationLevelString}}+ style={{borderColor this.category.color}}+ class="category-list-item category {{if this.isMuted 'muted'}}"+ >+ <table class="topic-list"><tbody>- {{#each this.category.subcategories as |subcategory|}}- <SubCategoryRow- @category={{subcategory}}- @listType={{this.listType}}+ <tr>+ <th class="main-link">+ <CategoryTitleLink @category={{this.category}} />+ </th>+ <PluginOutlet+ @name="category-list-after-title-mobile-section"+ @outletArgs={{hash category=this.category}}/>- {{/each}}- {{#if (gt this.category.unloadedSubcategoryCount 0)}}- {{i18n- "category_row.subcategory_count"- count=this.category.unloadedSubcategoryCount- }}+ </tr>+ {{#if this.category.description_excerpt}}+ <tr class="category-description">+ <td colspan="3">+ {{htmlSafe this.category.description_excerpt}}+ </td>+ </tr>+ {{/if}}+ {{#unless this.isMuted}}+ {{#if this.showTopics}}+ {{#each this.category.featuredTopics as |t|}}+ <MobileCategoryTopic @topic={{t}} />+ {{/each}}+ {{/if}}+ {{/unless}}+ {{#if this.category.isGrandParent}}+ {{#each this.category.subcategories as |subcategory|}}+ <SubCategoryRow+ @category={{subcategory}}+ @listType={{this.listType}}+ />+ {{/each}}+ {{else if this.category.subcategories}}+ <tr class="subcategories-list">+ <td>+ <div class="subcategories">+ {{#each this.category.subcategories as |subcategory|}}+ <SubCategoryItem+ @category={{subcategory}}+ @listType={{this.listType}}+ />+ {{/each}}+ </div>+ </td>+ </tr>{{/if}}</tbody></table>- {{else if this.category.subcategories}}- <div class="subcategories">- {{#each this.category.subcategories as |subcategory|}}- <SubCategoryItem- @category={{subcategory}}- @listType={{this.listType}}- />- {{/each}}- {{#if (gt this.category.unloadedSubcategoryCount 0)}}- <div class="subcategories__more-subcategories">- <LinkTo- @route="discovery.subcategories"- @model={{this.slugPath}}- >- {{i18n- "category_row.subcategory_count"- count=this.category.unloadedSubcategoryCount- }}- </LinkTo>+ <footer class="clearfix category-topics-count">+ <div class="category-stat">+ <a href={{this.category.url}}>+ {{htmlSafe this.category.statTotal}}+ </a>+ </div>+ {{#unless this.category.pickAll}}+ <div class="category-stat">+ <a href={{this.category.url}}>+ {{htmlSafe this.category.stat}}+ </a></div>- {{/if}}- </div>- {{/if}}- </td>+ {{/unless}}+ </footer>+ </div>+ {{else}}- <PluginOutlet- @name="category-list-before-topics-section"- @outletArgs={{hash category=this.category}}- />+ <tr+ data-category-id={{this.category.id}}+ data-notification-level={{this.category.notificationLevelString}}+ class="{{if+ this.category.description_excerpt+ 'has-description'+ 'no-description'+ }}+ {{this.applyValueTransformer+ 'parent-category-row-class'+ (array)+ (hash category=this.category)+ }}+ {{if this.category.uploaded_logo.url 'has-logo' 'no-logo'}}"+ >- <PluginOutlet- @name="category-list-topics-wrapper"- @outletArgs={{hash category=this.category}}- >- <td class="topics">- <div title={{this.category.statTitle}}>{{html-safe- this.category.stat- }}</div>- <CategoryUnread- @category={{this.category}}- @tagName="div"- @unreadTopicsCount={{this.unreadTopicsCount}}- @newTopicsCount={{this.newTopicsCount}}- class="unread-new"+ <PluginOutlet+ @name="category-list-before-category-section"+ @outletArgs={{hash category=this.category listType=this.listType}}/>- </td>- </PluginOutlet>- <PluginOutlet- @name="category-list-after-topics-section"- @outletArgs={{hash category=this.category}}- />-- <PluginOutlet- @name="category-list-latest-wrapper"- @outletArgs={{hash category=this.category showTopics=this.showTopics}}- >- {{#unless this.isMuted}}- {{#if this.showTopics}}- <td class="latest">- {{#each this.category.featuredTopics as |t|}}- {{#if this.site.useGlimmerTopicList}}- <TopicList::FeaturedTopic @topic={{t}} />- {{else}}- <FeaturedTopic @topic={{t}} />- {{/if}}- {{/each}}- </td>+ <td+ class="category {{if this.isMuted 'muted'}}"+ style={{categoryColorVariable this.category.color}}+ >+ <CategoryTitleLink @category={{this.category}} /><PluginOutlet- @name="category-list-after-latest-section"+ @name="below-category-title-link"+ @connectorTagName="div"@outletArgs={{hash category=this.category}}/>- {{/if}}- {{/unless}}- </PluginOutlet>- </tr>- {{/if}}-{{/unless}}\ No newline at end of file++ {{#if this.category.description_excerpt}}+ <div class="category-description">+ {{dirSpan this.category.description_excerpt htmlSafe="true"}}+ </div>+ {{/if}}++ {{#if this.category.isGrandParent}}+ <table class="category-list subcategories-with-subcategories">+ <tbody>+ {{#each this.category.subcategories as |subcategory|}}+ <SubCategoryRow+ @category={{subcategory}}+ @listType={{this.listType}}+ />+ {{/each}}+ {{#if (gt this.category.unloadedSubcategoryCount 0)}}+ {{i18n+ "category_row.subcategory_count"+ count=this.category.unloadedSubcategoryCount+ }}+ {{/if}}+ </tbody>+ </table>+ {{else if this.category.subcategories}}+ <div class="subcategories">+ {{#each this.category.subcategories as |subcategory|}}+ <SubCategoryItem+ @category={{subcategory}}+ @listType={{this.listType}}+ />+ {{/each}}+ {{#if (gt this.category.unloadedSubcategoryCount 0)}}+ <div class="subcategories__more-subcategories">+ <LinkTo+ @route="discovery.subcategories"+ @model={{this.slugPath}}+ >+ {{i18n+ "category_row.subcategory_count"+ count=this.category.unloadedSubcategoryCount+ }}+ </LinkTo>+ </div>+ {{/if}}+ </div>+ {{/if}}+ </td>++ <PluginOutlet+ @name="category-list-before-topics-section"+ @outletArgs={{hash category=this.category}}+ />++ <PluginOutlet+ @name="category-list-topics-wrapper"+ @outletArgs={{hash category=this.category}}+ >+ <td class="topics">+ <div title={{this.category.statTitle}}>{{htmlSafe+ this.category.stat+ }}</div>+ <CategoryUnread+ @category={{this.category}}+ @tagName="div"+ @unreadTopicsCount={{this.unreadTopicsCount}}+ @newTopicsCount={{this.newTopicsCount}}+ class="unread-new"+ />+ </td>+ </PluginOutlet>++ <PluginOutlet+ @name="category-list-after-topics-section"+ @outletArgs={{hash category=this.category}}+ />++ <PluginOutlet+ @name="category-list-latest-wrapper"+ @outletArgs={{hash+ category=this.category+ showTopics=this.showTopics+ }}+ >+ {{#unless this.isMuted}}+ {{#if this.showTopics}}+ <td class="latest">+ {{#each this.category.featuredTopics as |t|}}+ {{#if this.site.useGlimmerTopicList}}+ <FeaturedTopic @topic={{t}} />+ {{else}}+ <FeaturedTopic @topic={{t}} />+ {{/if}}+ {{/each}}+ </td>+ <PluginOutlet+ @name="category-list-after-latest-section"+ @outletArgs={{hash category=this.category}}+ />+ {{/if}}+ {{/unless}}+ </PluginOutlet>+ </tr>+ {{/if}}+ {{/unless}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/pick-files-button.gjs b/app/assets/javascripts/discourse/app/components/pick-files-button.gjsindex 25c0c7f20c8..c20d48da7dc 100644--- a/app/assets/javascripts/discourse/app/components/pick-files-button.gjs+++ b/app/assets/javascripts/discourse/app/components/pick-files-button.gjs@@ -1,8 +1,12 @@import Component from "@ember/component";import { action } from "@ember/object";+import didInsert from "@ember/render-modifiers/modifiers/did-insert";import { service } from "@ember/service";import { isBlank } from "@ember/utils";import { classNames } from "@ember-decorators/component";+import { or } from "truth-helpers";+import DButton from "discourse/components/d-button";+import noop from "discourse/helpers/noop";import discourseComputed, { bind } from "discourse/lib/decorators";import {authorizedExtensions,@@ -119,32 +123,34 @@ export default class PickFilesButton extends Component {_fileExtension(fileName) {return fileName.split(".").pop();}-}-{{#if this.showButton}}- <DButton- @action={{action "openSystemFilePicker"}}- @label={{this.label}}- @icon={{this.icon}}- />-{{/if}}-{{#if this.acceptsAllFormats}}- <input- {{did-insert (or @registerFileInput (noop))}}- type="file"- id={{this.fileInputId}}- class={{this.fileInputClass}}- multiple={{this.allowMultiple}}- disabled={{this.fileInputDisabled}}- />-{{else}}- <input- {{did-insert (or @registerFileInput (noop))}}- type="file"- id={{this.fileInputId}}- class={{this.fileInputClass}}- accept={{this.acceptedFormats}}- multiple={{this.allowMultiple}}- disabled={{this.fileInputDisabled}}- />-{{/if}}\ No newline at end of file+ <template>+ {{#if this.showButton}}+ <DButton+ @action={{action "openSystemFilePicker"}}+ @label={{this.label}}+ @icon={{this.icon}}+ />+ {{/if}}+ {{#if this.acceptsAllFormats}}+ <input+ {{didInsert (or @registerFileInput (noop))}}+ type="file"+ id={{this.fileInputId}}+ class={{this.fileInputClass}}+ multiple={{this.allowMultiple}}+ disabled={{this.fileInputDisabled}}+ />+ {{else}}+ <input+ {{didInsert (or @registerFileInput (noop))}}+ type="file"+ id={{this.fileInputId}}+ class={{this.fileInputClass}}+ accept={{this.acceptedFormats}}+ multiple={{this.allowMultiple}}+ disabled={{this.fileInputDisabled}}+ />+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/plugin-outlet.gjs b/app/assets/javascripts/discourse/app/components/plugin-outlet.gjsindex 7a5b41c5a53..1765c3104e7 100644--- a/app/assets/javascripts/discourse/app/components/plugin-outlet.gjs+++ b/app/assets/javascripts/discourse/app/components/plugin-outlet.gjs@@ -1,9 +1,13 @@import Component from "@glimmer/component";import { cached } from "@glimmer/tracking";import ClassicComponent from "@ember/component";+import { concat } from "@ember/helper";import { get } from "@ember/object";import { getOwner } from "@ember/owner";import { service } from "@ember/service";+import { or } from "truth-helpers";+import PluginConnector from "discourse/components/plugin-connector";+import PluginOutlet from "discourse/components/plugin-outlet";import { bind } from "discourse/lib/decorators";import deprecated from "discourse/lib/deprecated";import { helperContext } from "discourse/lib/helpers";@@ -133,74 +137,76 @@ export default class PluginOutletComponent extends Component {get wrapperComponent() {return PluginOutletWithTagNameWrapper;}-}--class PluginOutletWithTagNameWrapper extends ClassicComponent {}-{{~#if @tagName~}}- {{!+ <template>+ {{~#if @tagName~}}+ {{!Older outlets have a wrapper tagName. RFC0389 proposes an interface for dynamic tag names, which we may want to use in future.But for now, this classic component wrapper takes care of the tagName.}}- <this.wrapperComponent @tagName={{@tagName}}>- {{~#each (this.getConnectors) as |c|~}}- {{~#if c.componentClass~}}- <c.componentClass @outletArgs={{this.outletArgsWithDeprecations}} />- {{~else if @defaultGlimmer~}}- <c.templateOnly @outletArgs={{this.outletArgsWithDeprecations}} />+ <this.wrapperComponent @tagName={{@tagName}}>+ {{~#each (this.getConnectors) as |c|~}}+ {{~#if c.componentClass~}}+ <c.componentClass @outletArgs={{this.outletArgsWithDeprecations}} />+ {{~else if @defaultGlimmer~}}+ <c.templateOnly @outletArgs={{this.outletArgsWithDeprecations}} />+ {{~else~}}+ <PluginConnector+ @connector={{c}}+ @args={{this.outletArgs}}+ @deprecatedArgs={{@deprecatedArgs}}+ @outletArgs={{this.outletArgsWithDeprecations}}+ @tagName={{or @connectorTagName ""}}+ @layout={{c.template}}+ class={{c.classicClassNames}}+ />+ {{~/if~}}+ {{~/each~}}+ </this.wrapperComponent>+ {{~else if (this.connectorsExist hasBlock=(has-block))~}}+ {{! The modern path: no wrapper element = no classic component }}++ {{~#if (has-block)~}}+ <PluginOutlet+ @name={{concat @name "__before"}}+ @outletArgs={{this.outletArgsWithDeprecations}}+ />+ {{~/if~}}++ {{~#each (this.getConnectors hasBlock=(has-block)) as |c|~}}+ {{~#if c.componentClass~}}+ <c.componentClass+ @outletArgs={{this.outletArgsWithDeprecations}}+ >{{yield}}</c.componentClass>+ {{~else if @defaultGlimmer~}}+ <c.templateOnly+ @outletArgs={{this.outletArgsWithDeprecations}}+ >{{yield}}</c.templateOnly>+ {{~else~}}+ <PluginConnector+ @connector={{c}}+ @args={{this.outletArgs}}+ @deprecatedArgs={{@deprecatedArgs}}+ @outletArgs={{this.outletArgsWithDeprecations}}+ @tagName={{or @connectorTagName ""}}+ @layout={{c.template}}+ class={{c.classicClassNames}}+ >{{yield}}</PluginConnector>+ {{~/if~}}{{~else~}}- <PluginConnector- @connector={{c}}- @args={{this.outletArgs}}- @deprecatedArgs={{@deprecatedArgs}}+ {{yield}}+ {{~/each~}}++ {{~#if (has-block)~}}+ <PluginOutlet+ @name={{concat @name "__after"}}@outletArgs={{this.outletArgsWithDeprecations}}- @tagName={{or @connectorTagName ""}}- @layout={{c.template}}- class={{c.classicClassNames}}/>{{~/if~}}- {{~/each~}}- </this.wrapperComponent>-{{~else if (this.connectorsExist hasBlock=(has-block))~}}- {{~! The modern path: no wrapper element = no classic component ~}}-- {{~#if (has-block)~}}- <PluginOutlet- @name={{concat @name "__before"}}- @outletArgs={{this.outletArgsWithDeprecations}}- />- {{~/if~}}-- {{~#each (this.getConnectors hasBlock=(has-block)) as |c|~}}- {{~#if c.componentClass~}}- <c.componentClass- @outletArgs={{this.outletArgsWithDeprecations}}- >{{yield}}</c.componentClass>- {{~else if @defaultGlimmer~}}- <c.templateOnly- @outletArgs={{this.outletArgsWithDeprecations}}- >{{yield}}</c.templateOnly>{{~else~}}- <PluginConnector- @connector={{c}}- @args={{this.outletArgs}}- @deprecatedArgs={{@deprecatedArgs}}- @outletArgs={{this.outletArgsWithDeprecations}}- @tagName={{or @connectorTagName ""}}- @layout={{c.template}}- class={{c.classicClassNames}}- >{{yield}}</PluginConnector>+ {{yield}}{{~/if~}}- {{~else~}}- {{yield}}- {{~/each~}}-- {{~#if (has-block)~}}- <PluginOutlet- @name={{concat @name "__after"}}- @outletArgs={{this.outletArgsWithDeprecations}}- />- {{~/if~}}-{{~else~}}- {{yield}}-{{~/if~}}\ No newline at end of file+ </template>+}++class PluginOutletWithTagNameWrapper extends ClassicComponent {}diff --git a/app/assets/javascripts/discourse/app/components/popup-input-tip.gjs b/app/assets/javascripts/discourse/app/components/popup-input-tip.gjsindex 6a94b24c4f7..7f013f56c9b 100644--- a/app/assets/javascripts/discourse/app/components/popup-input-tip.gjs+++ b/app/assets/javascripts/discourse/app/components/popup-input-tip.gjs@@ -7,6 +7,7 @@ import {classNameBindings,tagName,} from "@ember-decorators/component";+import icon from "discourse/helpers/d-icon";import discourseComputed from "discourse/lib/decorators";@tagName("a")@@ -59,6 +60,6 @@ export default class PopupInputTip extends Component {this.set("tipReason", null);}}-}-{{this.tipReason}} {{d-icon "circle-xmark"}}\ No newline at end of file+ <template>{{this.tipReason}} {{icon "circle-xmark"}}</template>+}diff --git a/app/assets/javascripts/discourse/app/components/popup-menu.gjs b/app/assets/javascripts/discourse/app/components/popup-menu.gjsindex 59eec722eee..72364d65ed4 100644--- a/app/assets/javascripts/discourse/app/components/popup-menu.gjs+++ b/app/assets/javascripts/discourse/app/components/popup-menu.gjs@@ -1,8 +1,11 @@import Component from "@ember/component";+import { i18n } from "discourse-i18n";-export default class PopupMenu extends Component {}--<h3>{{i18n this.title}}</h3>-<ul>- {{yield}}-</ul>\ No newline at end of file+export default class PopupMenu extends Component {+ <template>+ <h3>{{i18n this.title}}</h3>+ <ul>+ {{yield}}+ </ul>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/reviewable-conversation-post.gjs b/app/assets/javascripts/discourse/app/components/reviewable-conversation-post.gjsindex da7e055ea2c..68f7f5c7090 100644--- a/app/assets/javascripts/discourse/app/components/reviewable-conversation-post.gjs+++ b/app/assets/javascripts/discourse/app/components/reviewable-conversation-post.gjs@@ -1,19 +1,23 @@import Component from "@ember/component";import { gte } from "@ember/object/computed";+import { LinkTo } from "@ember/routing";+import { htmlSafe } from "@ember/template";export default class ReviewableConversationPost extends Component {@gte("index", 1) showUsername;-}-{{#if this.post}}- <div class="reviewable-conversation-post">- {{#if this.showUsername}}- <LinkTo- @route="user"- @model={{this.post.user}}- class="username"- >@{{this.post.user.username}}</LinkTo>+ <template>+ {{#if this.post}}+ <div class="reviewable-conversation-post">+ {{#if this.showUsername}}+ <LinkTo+ @route="user"+ @model={{this.post.user}}+ class="username"+ >@{{this.post.user.username}}</LinkTo>+ {{/if}}+ {{htmlSafe this.post.excerpt}}+ </div>{{/if}}- {{html-safe this.post.excerpt}}- </div>-{{/if}}\ No newline at end of file+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/reviewable-field-editor.gjs b/app/assets/javascripts/discourse/app/components/reviewable-field-editor.gjsindex 1bc2725b69c..3171832f0dc 100644--- a/app/assets/javascripts/discourse/app/components/reviewable-field-editor.gjs+++ b/app/assets/javascripts/discourse/app/components/reviewable-field-editor.gjs@@ -1,5 +1,8 @@import Component from "@ember/component";+import DEditor from "discourse/components/d-editor";-export default class ReviewableFieldEditor extends Component {}--<DEditor @value={{this.value}} @change={{this.valueChanged}} />\ No newline at end of file+export default class ReviewableFieldEditor extends Component {+ <template>+ <DEditor @value={{this.value}} @change={{this.valueChanged}} />+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/reviewable-field-text.gjs b/app/assets/javascripts/discourse/app/components/reviewable-field-text.gjsindex 742279f0a71..df6ec48b63e 100644--- a/app/assets/javascripts/discourse/app/components/reviewable-field-text.gjs+++ b/app/assets/javascripts/discourse/app/components/reviewable-field-text.gjs@@ -1,9 +1,12 @@-import Component from "@ember/component";+import Component, { Input } from "@ember/component";+import { on } from "@ember/modifier";-export default class ReviewableFieldText extends Component {}--<Input- @value={{this.value}}- class="reviewable-input-text"- {{on "change" this.valueChanged}}-/>\ No newline at end of file+export default class ReviewableFieldText extends Component {+ <template>+ <Input+ @value={{this.value}}+ class="reviewable-input-text"+ {{on "change" this.valueChanged}}+ />+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/reviewable-field-textarea.gjs b/app/assets/javascripts/discourse/app/components/reviewable-field-textarea.gjsindex 28f77543eda..c6a39bba94d 100644--- a/app/assets/javascripts/discourse/app/components/reviewable-field-textarea.gjs+++ b/app/assets/javascripts/discourse/app/components/reviewable-field-textarea.gjs@@ -1,9 +1,12 @@-import Component from "@ember/component";+import Component, { Textarea } from "@ember/component";+import { on } from "@ember/modifier";-export default class ReviewableFieldTextarea extends Component {}--<Textarea- @value={{this.value}}- {{on "change" this.valueChanged}}- class="reviewable-input-textarea"-/>\ No newline at end of file+export default class ReviewableFieldTextarea extends Component {+ <template>+ <Textarea+ @value={{this.value}}+ {{on "change" this.valueChanged}}+ class="reviewable-input-textarea"+ />+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/reviewable-field.gjs b/app/assets/javascripts/discourse/app/components/reviewable-field.gjsindex 30aebc5ae36..d7edb8dbcae 100644--- a/app/assets/javascripts/discourse/app/components/reviewable-field.gjs+++ b/app/assets/javascripts/discourse/app/components/reviewable-field.gjs@@ -1,10 +1,12 @@import Component from "@ember/component";-export default class ReviewableField extends Component {}--{{#if this.value}}- <div class={{this.classes}}>- <div class="name">{{this.name}}</div>- <div class="value">{{this.value}}</div>- </div>-{{/if}}\ No newline at end of file+export default class ReviewableField extends Component {+ <template>+ {{#if this.value}}+ <div class={{this.classes}}>+ <div class="name">{{this.name}}</div>+ <div class="value">{{this.value}}</div>+ </div>+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/reviewable-flagged-post.gjs b/app/assets/javascripts/discourse/app/components/reviewable-flagged-post.gjsindex d5e23debded..277d394d323 100644--- a/app/assets/javascripts/discourse/app/components/reviewable-flagged-post.gjs+++ b/app/assets/javascripts/discourse/app/components/reviewable-flagged-post.gjs@@ -1,7 +1,17 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { hash } from "@ember/helper";import { action } from "@ember/object";+import didInsert from "@ember/render-modifiers/modifiers/did-insert";+import { htmlSafe } from "@ember/template";+import DButton from "discourse/components/d-button";+import PluginOutlet from "discourse/components/plugin-outlet";+import ReviewableCreatedBy from "discourse/components/reviewable-created-by";+import ReviewablePostEdits from "discourse/components/reviewable-post-edits";+import ReviewablePostHeader from "discourse/components/reviewable-post-header";+import ReviewableTopicLink from "discourse/components/reviewable-topic-link";import { bind } from "discourse/lib/decorators";+import { i18n } from "discourse-i18n";export default class ReviewableFlaggedPost extends Component {@tracked isCollapsed = false;@@ -36,47 +46,49 @@ export default class ReviewableFlaggedPost extends Component {icon: "chevron-up",};}-}--<div class="flagged-post-header">- <ReviewableTopicLink @reviewable={{@reviewable}} @tagName="" />- <ReviewablePostEdits @reviewable={{@reviewable}} @tagName="" />-</div>-<div class="post-contents-wrapper">- <ReviewableCreatedBy @user={{@reviewable.target_created_by}} />- <div class="post-contents">- <ReviewablePostHeader- @reviewable={{@reviewable}}- @createdBy={{@reviewable.target_created_by}}- @tagName=""- />- <div- class="post-body {{if this.isCollapsed 'is-collapsed'}}"- {{did-insert this.calculatePostBodySize @reviewable}}- >- {{#if @reviewable.blank_post}}- <p>{{i18n "review.deleted_post"}}</p>- {{else}}- {{html-safe @reviewable.cooked}}- {{/if}}+ <template>+ <div class="flagged-post-header">+ <ReviewableTopicLink @reviewable={{@reviewable}} @tagName="" />+ <ReviewablePostEdits @reviewable={{@reviewable}} @tagName="" /></div>- {{#if this.isLongPost}}- <DButton- @action={{this.toggleContent}}- @label={{this.collapseButtonProps.label}}- @icon={{this.collapseButtonProps.icon}}- class="btn-default btn-icon post-body__toggle-btn"- />- {{/if}}- <span>- <PluginOutlet- @name="after-reviewable-flagged-post-body"- @connectorTagName="div"- @outletArgs={{hash model=@reviewable}}- />- </span>- {{yield}}- </div>-</div>\ No newline at end of file+ <div class="post-contents-wrapper">+ <ReviewableCreatedBy @user={{@reviewable.target_created_by}} />+ <div class="post-contents">+ <ReviewablePostHeader+ @reviewable={{@reviewable}}+ @createdBy={{@reviewable.target_created_by}}+ @tagName=""+ />+ <div+ class="post-body {{if this.isCollapsed 'is-collapsed'}}"+ {{didInsert this.calculatePostBodySize @reviewable}}+ >+ {{#if @reviewable.blank_post}}+ <p>{{i18n "review.deleted_post"}}</p>+ {{else}}+ {{htmlSafe @reviewable.cooked}}+ {{/if}}+ </div>++ {{#if this.isLongPost}}+ <DButton+ @action={{this.toggleContent}}+ @label={{this.collapseButtonProps.label}}+ @icon={{this.collapseButtonProps.icon}}+ class="btn-default btn-icon post-body__toggle-btn"+ />+ {{/if}}+ <span>+ <PluginOutlet+ @name="after-reviewable-flagged-post-body"+ @connectorTagName="div"+ @outletArgs={{hash model=@reviewable}}+ />+ </span>+ {{yield}}+ </div>+ </div>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/reviewable-histories.gjs b/app/assets/javascripts/discourse/app/components/reviewable-histories.gjsindex 988178123a4..8eb67216cf1 100644--- a/app/assets/javascripts/discourse/app/components/reviewable-histories.gjs+++ b/app/assets/javascripts/discourse/app/components/reviewable-histories.gjs@@ -1,34 +1,41 @@import Component from "@ember/component";import { filterBy } from "@ember/object/computed";+import UserLink from "discourse/components/user-link";+import avatar from "discourse/helpers/avatar";+import formatDate from "discourse/helpers/format-date";+import reviewableHistoryDescription from "discourse/helpers/reviewable-history-description";+import { i18n } from "discourse-i18n";export default class ReviewableHistories extends Component {@filterBy("histories", "created", false) filteredHistories;-}-{{#if this.filteredHistories}}- <table class="reviewable-histories">- <thead>- <tr>- <th colspan="3">{{i18n "review.history.title"}}</th>- </tr>- </thead>- <tbody>- {{#each this.filteredHistories as |rh|}}- {{#unless rh.created}}+ <template>+ {{#if this.filteredHistories}}+ <table class="reviewable-histories">+ <thead><tr>- <td>- {{reviewable-history-description rh}}- </td>- <td>- <UserLink @user={{this.rs.user}}>- {{avatar rh.created_by imageSize="tiny"}}- {{rh.created_by.username}}- </UserLink>- </td>- <td>{{format-date rh.created_at format="medium"}}</td>+ <th colspan="3">{{i18n "review.history.title"}}</th></tr>- {{/unless}}- {{/each}}- </tbody>- </table>-{{/if}}\ No newline at end of file+ </thead>+ <tbody>+ {{#each this.filteredHistories as |rh|}}+ {{#unless rh.created}}+ <tr>+ <td>+ {{reviewableHistoryDescription rh}}+ </td>+ <td>+ <UserLink @user={{this.rs.user}}>+ {{avatar rh.created_by imageSize="tiny"}}+ {{rh.created_by.username}}+ </UserLink>+ </td>+ <td>{{formatDate rh.created_at format="medium"}}</td>+ </tr>+ {{/unless}}+ {{/each}}+ </tbody>+ </table>+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/reviewable-post-edits.gjs b/app/assets/javascripts/discourse/app/components/reviewable-post-edits.gjsindex 2fd058c3852..657d34cbf73 100644--- a/app/assets/javascripts/discourse/app/components/reviewable-post-edits.gjs+++ b/app/assets/javascripts/discourse/app/components/reviewable-post-edits.gjs@@ -1,11 +1,14 @@import Component from "@ember/component";+import { on } from "@ember/modifier";import { action } from "@ember/object";import { gt } from "@ember/object/computed";import { service } from "@ember/service";import HistoryModal from "discourse/components/modal/history";+import icon from "discourse/helpers/d-icon";import discourseComputed from "discourse/lib/decorators";import { longDate } from "discourse/lib/formatter";import { historyHeat } from "discourse/widgets/post-edits-indicator";+import { i18n } from "discourse-i18n";export default class ReviewablePostEdits extends Component {@service modal;@@ -37,15 +40,17 @@ export default class ReviewablePostEdits extends Component {});});}-}-{{#if this.hasEdits}}- <a- href- {{on "click" this.showEditHistory}}- class="has-edits {{this.historyClass}}"- title={{i18n "post.last_edited_on" dateTime=this.editedDate}}- >- {{d-icon "pencil"}}- </a>-{{/if}}\ No newline at end of file+ <template>+ {{#if this.hasEdits}}+ <a+ href+ {{on "click" this.showEditHistory}}+ class="has-edits {{this.historyClass}}"+ title={{i18n "post.last_edited_on" dateTime=this.editedDate}}+ >+ {{icon "pencil"}}+ </a>+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/reviewable-post-header.gjs b/app/assets/javascripts/discourse/app/components/reviewable-post-header.gjsindex adffcee27dd..93244eccc02 100644--- a/app/assets/javascripts/discourse/app/components/reviewable-post-header.gjs+++ b/app/assets/javascripts/discourse/app/components/reviewable-post-header.gjs@@ -1,20 +1,26 @@import Component from "@ember/component";+import { concat } from "@ember/helper";+import ReviewableCreatedByName from "discourse/components/reviewable-created-by-name";+import icon from "discourse/helpers/d-icon";+import { i18n } from "discourse-i18n";-export default class ReviewablePostHeader extends Component {}--<div class="reviewable-post-header">- <ReviewableCreatedByName @user={{this.createdBy}} />- {{#if this.reviewable.reply_to_post_number}}- <a- href={{concat- this.reviewable.topic_url- "/"- this.reviewable.reply_to_post_number- }}- class="reviewable-reply-to"- >- {{d-icon "share"}}- <span>{{i18n "review.in_reply_to"}}</span>- </a>- {{/if}}-</div>\ No newline at end of file+export default class ReviewablePostHeader extends Component {+ <template>+ <div class="reviewable-post-header">+ <ReviewableCreatedByName @user={{this.createdBy}} />+ {{#if this.reviewable.reply_to_post_number}}+ <a+ href={{concat+ this.reviewable.topic_url+ "/"+ this.reviewable.reply_to_post_number+ }}+ class="reviewable-reply-to"+ >+ {{icon "share"}}+ <span>{{i18n "review.in_reply_to"}}</span>+ </a>+ {{/if}}+ </div>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/reviewable-post.gjs b/app/assets/javascripts/discourse/app/components/reviewable-post.gjsindex fc7b578b23c..b344e628373 100644--- a/app/assets/javascripts/discourse/app/components/reviewable-post.gjs+++ b/app/assets/javascripts/discourse/app/components/reviewable-post.gjs@@ -1,27 +1,35 @@import Component from "@ember/component";+import { htmlSafe } from "@ember/template";+import ReviewableCreatedBy from "discourse/components/reviewable-created-by";+import ReviewablePostEdits from "discourse/components/reviewable-post-edits";+import ReviewablePostHeader from "discourse/components/reviewable-post-header";+import ReviewableTopicLink from "discourse/components/reviewable-topic-link";+import { i18n } from "discourse-i18n";-export default class ReviewablePost extends Component {}--<div class="flagged-post-header">- <ReviewableTopicLink @reviewable={{this.reviewable}} @tagName="" />- <ReviewablePostEdits @reviewable={{this.reviewable}} @tagName="" />-</div>+export default class ReviewablePost extends Component {+ <template>+ <div class="flagged-post-header">+ <ReviewableTopicLink @reviewable={{this.reviewable}} @tagName="" />+ <ReviewablePostEdits @reviewable={{this.reviewable}} @tagName="" />+ </div>-<div class="post-contents-wrapper">- <ReviewableCreatedBy @user={{this.reviewable.target_created_by}} />- <div class="post-contents">- <ReviewablePostHeader- @reviewable={{this.reviewable}}- @createdBy={{this.reviewable.target_created_by}}- @tagName=""- />- <div class="post-body">- {{#if this.reviewable.blank_post}}- <p>{{i18n "review.deleted_post"}}</p>- {{else}}- {{html-safe this.reviewable.cooked}}- {{/if}}+ <div class="post-contents-wrapper">+ <ReviewableCreatedBy @user={{this.reviewable.target_created_by}} />+ <div class="post-contents">+ <ReviewablePostHeader+ @reviewable={{this.reviewable}}+ @createdBy={{this.reviewable.target_created_by}}+ @tagName=""+ />+ <div class="post-body">+ {{#if this.reviewable.blank_post}}+ <p>{{i18n "review.deleted_post"}}</p>+ {{else}}+ {{htmlSafe this.reviewable.cooked}}+ {{/if}}+ </div>+ {{yield}}+ </div></div>- {{yield}}- </div>-</div>\ No newline at end of file+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/reviewable-queued-post.gjs b/app/assets/javascripts/discourse/app/components/reviewable-queued-post.gjsindex 92c9a44b367..88723d6fd98 100644--- a/app/assets/javascripts/discourse/app/components/reviewable-queued-post.gjs+++ b/app/assets/javascripts/discourse/app/components/reviewable-queued-post.gjs@@ -1,8 +1,18 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { hash } from "@ember/helper";+import { on } from "@ember/modifier";import { action } from "@ember/object";import { service } from "@ember/service";+import CookText from "discourse/components/cook-text";+import DButton from "discourse/components/d-button";import RawEmailModal from "discourse/components/modal/raw-email";+import ReviewableCreatedBy from "discourse/components/reviewable-created-by";+import ReviewablePostHeader from "discourse/components/reviewable-post-header";+import ReviewableTags from "discourse/components/reviewable-tags";+import ReviewableTopicLink from "discourse/components/reviewable-topic-link";+import categoryBadge from "discourse/helpers/category-badge";+import icon from "discourse/helpers/d-icon";export default class ReviewableQueuedPost extends Component {@service modal;@@ -52,51 +62,53 @@ export default class ReviewableQueuedPost extends Component {this.isLongPost = false;}}-}-<ReviewableTopicLink @reviewable={{@reviewable}} @tagName="">- <div class="title-text">- {{d-icon "square-plus" title="review.new_topic"}}- {{@reviewable.payload.title}}- </div>- {{category-badge @reviewable.category}}- <ReviewableTags @tags={{@reviewable.payload.tags}} @tagName="" />- {{#if @reviewable.payload.via_email}}- <a href {{on "click" this.showRawEmail}} class="show-raw-email">- {{d-icon "envelope" title="post.via_email"}}- </a>- {{/if}}-</ReviewableTopicLink>+ <template>+ <ReviewableTopicLink @reviewable={{@reviewable}} @tagName="">+ <div class="title-text">+ {{icon "square-plus" title="review.new_topic"}}+ {{@reviewable.payload.title}}+ </div>+ {{categoryBadge @reviewable.category}}+ <ReviewableTags @tags={{@reviewable.payload.tags}} @tagName="" />+ {{#if @reviewable.payload.via_email}}+ <a href {{on "click" this.showRawEmail}} class="show-raw-email">+ {{icon "envelope" title="post.via_email"}}+ </a>+ {{/if}}+ </ReviewableTopicLink>-<div class="post-contents-wrapper">- <ReviewableCreatedBy @user={{@reviewable.target_created_by}} />+ <div class="post-contents-wrapper">+ <ReviewableCreatedBy @user={{@reviewable.target_created_by}} />- <div class="post-contents">- <ReviewablePostHeader- @reviewable={{@reviewable}}- @createdBy={{@reviewable.target_created_by}}- @tagName=""- />+ <div class="post-contents">+ <ReviewablePostHeader+ @reviewable={{@reviewable}}+ @createdBy={{@reviewable.target_created_by}}+ @tagName=""+ />- <CookText- class="post-body {{if this.isCollapsed 'is-collapsed'}}"- @rawText={{@reviewable.payload.raw}}- @categoryId={{@reviewable.category_id}}- @topicId={{@reviewable.topic_id}}- @paintOneboxes={{true}}- @opts={{hash removeMissing=true}}- @onOffsetHeightCalculated={{this.setPostBodyHeight}}- />+ <CookText+ class="post-body {{if this.isCollapsed 'is-collapsed'}}"+ @rawText={{@reviewable.payload.raw}}+ @categoryId={{@reviewable.category_id}}+ @topicId={{@reviewable.topic_id}}+ @paintOneboxes={{true}}+ @opts={{hash removeMissing=true}}+ @onOffsetHeightCalculated={{this.setPostBodyHeight}}+ />- {{#if this.isLongPost}}- <DButton- @action={{this.toggleContent}}- @label={{this.collapseButtonProps.label}}- @icon={{this.collapseButtonProps.icon}}- class="btn-default btn-icon post-body__toggle-btn"- />- {{/if}}+ {{#if this.isLongPost}}+ <DButton+ @action={{this.toggleContent}}+ @label={{this.collapseButtonProps.label}}+ @icon={{this.collapseButtonProps.icon}}+ class="btn-default btn-icon post-body__toggle-btn"+ />+ {{/if}}- {{yield}}- </div>-</div>\ No newline at end of file+ {{yield}}+ </div>+ </div>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/reviewable-score.gjs b/app/assets/javascripts/discourse/app/components/reviewable-score.gjsindex ad4834f3c18..5a6f7e71f2c 100644--- a/app/assets/javascripts/discourse/app/components/reviewable-score.gjs+++ b/app/assets/javascripts/discourse/app/components/reviewable-score.gjs@@ -1,6 +1,11 @@import Component from "@ember/component";import { gt } from "@ember/object/computed";import { tagName } from "@ember-decorators/component";+import UserLink from "discourse/components/user-link";+import avatar from "discourse/helpers/avatar";+import icon from "discourse/helpers/d-icon";+import formatDate from "discourse/helpers/format-date";+import reviewableStatus from "discourse/helpers/reviewable-status";import discourseComputed from "discourse/lib/decorators";@tagName("")@@ -18,48 +23,50 @@ export default class ReviewableScore extends Component {return title;}-}-<tr class="reviewable-score">- <td class="user">- <UserLink @user={{this.rs.user}}>- {{avatar this.rs.user imageSize="tiny"}}- {{this.rs.user.username}}- </UserLink>- </td>+ <template>+ <tr class="reviewable-score">+ <td class="user">+ <UserLink @user={{this.rs.user}}>+ {{avatar this.rs.user imageSize="tiny"}}+ {{this.rs.user.username}}+ </UserLink>+ </td>- <td>- {{format-date this.rs.created_at format="tiny"}}- </td>+ <td>+ {{formatDate this.rs.created_at format="tiny"}}+ </td>- <td>- {{d-icon this.rs.score_type.icon}}- {{this.title}}- </td>+ <td>+ {{icon this.rs.score_type.icon}}+ {{this.title}}+ </td>- {{#if this.showStatus}}- <td class="reviewed-by">- {{#if this.rs.reviewed_by}}- <UserLink @user={{this.rs.reviewed_by}}>- {{avatar this.rs.reviewed_by imageSize="tiny"}}- {{this.rs.reviewed_by.username}}- </UserLink>- {{else}}- —- {{/if}}- </td>+ {{#if this.showStatus}}+ <td class="reviewed-by">+ {{#if this.rs.reviewed_by}}+ <UserLink @user={{this.rs.reviewed_by}}>+ {{avatar this.rs.reviewed_by imageSize="tiny"}}+ {{this.rs.reviewed_by.username}}+ </UserLink>+ {{else}}+ —+ {{/if}}+ </td>- <td>- {{#if this.rs.reviewed_by}}- {{format-date this.rs.reviewed_at format="tiny"}}- {{/if}}- </td>+ <td>+ {{#if this.rs.reviewed_by}}+ {{formatDate this.rs.reviewed_at format="tiny"}}+ {{/if}}+ </td>- <td>- {{reviewable-status this.rs.status this.reviewable.type}}- </td>+ <td>+ {{reviewableStatus this.rs.status this.reviewable.type}}+ </td>- {{else}}- <td colspan="4"></td>- {{/if}}-</tr>\ No newline at end of file+ {{else}}+ <td colspan="4"></td>+ {{/if}}+ </tr>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/reviewable-scores.gjs b/app/assets/javascripts/discourse/app/components/reviewable-scores.gjsindex 940f408db03..fae349c52db 100644--- a/app/assets/javascripts/discourse/app/components/reviewable-scores.gjs+++ b/app/assets/javascripts/discourse/app/components/reviewable-scores.gjs@@ -1,51 +1,57 @@import Component from "@ember/component";+import { htmlSafe } from "@ember/template";+import ReviewableConversationPost from "discourse/components/reviewable-conversation-post";+import ReviewableScore from "discourse/components/reviewable-score";+import { i18n } from "discourse-i18n";-export default class ReviewableScores extends Component {}+export default class ReviewableScores extends Component {+ <template>+ {{#if this.reviewable.reviewable_scores}}+ <div class="reviewable-scores__table-wrapper">+ <table class="reviewable-scores">+ <thead>+ <tr>+ <th>{{i18n "review.scores.submitted_by"}}</th>+ <th>{{i18n "review.scores.date"}}</th>+ <th>{{i18n "review.scores.type"}}</th>+ <th>{{i18n "review.scores.reviewed_by"}}</th>+ <th>{{i18n "review.scores.reviewed_timestamp"}}</th>+ <th>{{i18n "review.scores.status"}}</th>+ </tr>+ </thead>+ <tbody>+ {{#each this.reviewable.reviewable_scores as |rs|}}+ <ReviewableScore @rs={{rs}} @reviewable={{this.reviewable}} />+ {{/each}}+ </tbody>+ </table>+ </div>-{{#if this.reviewable.reviewable_scores}}- <div class="reviewable-scores__table-wrapper">- <table class="reviewable-scores">- <thead>- <tr>- <th>{{i18n "review.scores.submitted_by"}}</th>- <th>{{i18n "review.scores.date"}}</th>- <th>{{i18n "review.scores.type"}}</th>- <th>{{i18n "review.scores.reviewed_by"}}</th>- <th>{{i18n "review.scores.reviewed_timestamp"}}</th>- <th>{{i18n "review.scores.status"}}</th>- </tr>- </thead>- <tbody>- {{#each this.reviewable.reviewable_scores as |rs|}}- <ReviewableScore @rs={{rs}} @reviewable={{this.reviewable}} />- {{/each}}- </tbody>- </table>- </div>+ {{#each this.reviewable.reviewable_scores as |rs|}}+ {{#if rs.reason}}+ <div class="reviewable-score-reason">{{htmlSafe rs.reason}}</div>+ {{/if}}+ {{#if rs.context}}+ <div class="reviewable-score-context">{{htmlSafe rs.context}}</div>+ {{/if}}- {{#each this.reviewable.reviewable_scores as |rs|}}- {{#if rs.reason}}- <div class="reviewable-score-reason">{{html-safe rs.reason}}</div>- {{/if}}- {{#if rs.context}}- <div class="reviewable-score-context">{{html-safe rs.context}}</div>- {{/if}}+ {{#if rs.reviewable_conversation}}+ <div class="reviewable-conversation">+ {{#each rs.reviewable_conversation.conversation_posts as |p index|}}+ <ReviewableConversationPost @post={{p}} @index={{index}} />+ {{/each}}+ <div class="controls">+ <a+ href={{rs.reviewable_conversation.permalink}}+ class="btn btn-small"+ >+ {{i18n "review.conversation.view_full"}}+ </a>+ </div>+ </div>+ {{/if}}+ {{/each}}- {{#if rs.reviewable_conversation}}- <div class="reviewable-conversation">- {{#each rs.reviewable_conversation.conversation_posts as |p index|}}- <ReviewableConversationPost @post={{p}} @index={{index}} />- {{/each}}- <div class="controls">- <a- href={{rs.reviewable_conversation.permalink}}- class="btn btn-small"- >- {{i18n "review.conversation.view_full"}}- </a>- </div>- </div>{{/if}}- {{/each}}--{{/if}}\ No newline at end of file+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/reviewable-tags.gjs b/app/assets/javascripts/discourse/app/components/reviewable-tags.gjsindex 26b22e660e0..b3701c7fbf7 100644--- a/app/assets/javascripts/discourse/app/components/reviewable-tags.gjs+++ b/app/assets/javascripts/discourse/app/components/reviewable-tags.gjs@@ -1,9 +1,12 @@import Component from "@ember/component";+import discourseTag from "discourse/helpers/discourse-tag";-export default class ReviewableTags extends Component {}--{{#if this.tags}}- <div class="list-tags">- {{#each this.tags as |t|}}{{discourse-tag t}}{{/each}}- </div>-{{/if}}\ No newline at end of file+export default class ReviewableTags extends Component {+ <template>+ {{#if this.tags}}+ <div class="list-tags">+ {{#each this.tags as |t|}}{{discourseTag t}}{{/each}}+ </div>+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/reviewable-topic-link.gjs b/app/assets/javascripts/discourse/app/components/reviewable-topic-link.gjsindex ac6be71ab65..ce5baf859bc 100644--- a/app/assets/javascripts/discourse/app/components/reviewable-topic-link.gjs+++ b/app/assets/javascripts/discourse/app/components/reviewable-topic-link.gjs@@ -1,27 +1,36 @@import Component from "@ember/component";+import { array } from "@ember/helper";+import { LinkTo } from "@ember/routing";+import { htmlSafe } from "@ember/template";+import ReviewableTags from "discourse/components/reviewable-tags";+import TopicStatus from "discourse/components/topic-status";+import categoryBadge from "discourse/helpers/category-badge";+import { i18n } from "discourse-i18n";-export default class ReviewableTopicLink extends Component {}--<div class="post-topic">- {{#if this.reviewable.topic}}- <TopicStatus- @topic={{this.reviewable.topic}}- @showPrivateMessageIcon={{true}}- />- <a href={{this.reviewable.target_url}} class="title-text">{{html-safe- this.reviewable.topic.fancyTitle- }}</a>- {{category-badge this.reviewable.category}}- <ReviewableTags @tags={{this.reviewable.topic_tags}} @tagName="" />- {{else if (has-block)}}- {{yield}}- {{else}}- <span class="title-text">- {{i18n "review.topics.deleted"}}- <LinkTo- @route="topic"- @models={{array "-" this.reviewable.removed_topic_id}}- >{{i18n "review.topics.original"}}</LinkTo>- </span>- {{/if}}-</div>\ No newline at end of file+export default class ReviewableTopicLink extends Component {+ <template>+ <div class="post-topic">+ {{#if this.reviewable.topic}}+ <TopicStatus+ @topic={{this.reviewable.topic}}+ @showPrivateMessageIcon={{true}}+ />+ <a href={{this.reviewable.target_url}} class="title-text">{{htmlSafe+ this.reviewable.topic.fancyTitle+ }}</a>+ {{categoryBadge this.reviewable.category}}+ <ReviewableTags @tags={{this.reviewable.topic_tags}} @tagName="" />+ {{else if (has-block)}}+ {{yield}}+ {{else}}+ <span class="title-text">+ {{i18n "review.topics.deleted"}}+ <LinkTo+ @route="topic"+ @models={{array "-" this.reviewable.removed_topic_id}}+ >{{i18n "review.topics.original"}}</LinkTo>+ </span>+ {{/if}}+ </div>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/reviewable-user.gjs b/app/assets/javascripts/discourse/app/components/reviewable-user.gjsindex fa77ad72f7b..f242612a1c0 100644--- a/app/assets/javascripts/discourse/app/components/reviewable-user.gjs+++ b/app/assets/javascripts/discourse/app/components/reviewable-user.gjs@@ -1,83 +1,89 @@import Component from "@ember/component";+import { concat } from "@ember/helper";+import ReviewableField from "discourse/components/reviewable-field";+import getUrl from "discourse/helpers/get-url";import discourseComputed from "discourse/lib/decorators";+import { i18n } from "discourse-i18n";export default class ReviewableUser extends Component {@discourseComputed("reviewable.user_fields")userFields(fields) {return this.site.collectUserFields(fields);}-}-<div class="reviewable-user-info">- <div class="reviewable-user-fields">- <div class="reviewable-user-details username">- <div class="name">{{i18n "review.user.username"}}</div>- <div class="value">- {{#if this.reviewable.link_admin}}- <a- href={{get-url- (concat- "/admin/users/"- this.reviewable.user_id- "/"- this.reviewable.payload.username- )- }}- >- {{this.reviewable.payload.username}}- </a>- {{else}}- {{this.reviewable.payload.username}}- {{/if}}- </div>- </div>+ <template>+ <div class="reviewable-user-info">+ <div class="reviewable-user-fields">+ <div class="reviewable-user-details username">+ <div class="name">{{i18n "review.user.username"}}</div>+ <div class="value">+ {{#if this.reviewable.link_admin}}+ <a+ href={{getUrl+ (concat+ "/admin/users/"+ this.reviewable.user_id+ "/"+ this.reviewable.payload.username+ )+ }}+ >+ {{this.reviewable.payload.username}}+ </a>+ {{else}}+ {{this.reviewable.payload.username}}+ {{/if}}+ </div>+ </div>- <ReviewableField- @classes="reviewable-user-details name"- @name={{i18n "review.user.name"}}- @value={{this.reviewable.payload.name}}- />+ <ReviewableField+ @classes="reviewable-user-details name"+ @name={{i18n "review.user.name"}}+ @value={{this.reviewable.payload.name}}+ />- <ReviewableField- @classes="reviewable-user-details email"- @name={{i18n "review.user.email"}}- @value={{this.reviewable.payload.email}}- />+ <ReviewableField+ @classes="reviewable-user-details email"+ @name={{i18n "review.user.email"}}+ @value={{this.reviewable.payload.email}}+ />- <ReviewableField- @classes="reviewable-user-details bio"- @name={{i18n "review.user.bio"}}- @value={{this.reviewable.payload.bio}}- />+ <ReviewableField+ @classes="reviewable-user-details bio"+ @name={{i18n "review.user.bio"}}+ @value={{this.reviewable.payload.bio}}+ />- {{#if this.reviewable.payload.website}}- <div class="reviewable-user-details website">- <div class="name">{{i18n "review.user.website"}}</div>- <div class="value">- <a- href={{this.reviewable.payload.website}}- target="_blank"- rel="noopener noreferrer"- >{{this.reviewable.payload.website}}</a>- </div>- </div>- {{/if}}+ {{#if this.reviewable.payload.website}}+ <div class="reviewable-user-details website">+ <div class="name">{{i18n "review.user.website"}}</div>+ <div class="value">+ <a+ href={{this.reviewable.payload.website}}+ target="_blank"+ rel="noopener noreferrer"+ >{{this.reviewable.payload.website}}</a>+ </div>+ </div>+ {{/if}}- <ReviewableField- @classes="reviewable-user-details reject-reason"- @name={{i18n "review.user.reject_reason"}}- @value={{this.reviewable.reject_reason}}- />+ <ReviewableField+ @classes="reviewable-user-details reject-reason"+ @name={{i18n "review.user.reject_reason"}}+ @value={{this.reviewable.reject_reason}}+ />- {{#each this.userFields as |f|}}- <ReviewableField- @classes="reviewable-user-details user-field"- @name={{f.name}}- @value={{f.value}}- @tagName=""- />- {{/each}}- </div>+ {{#each this.userFields as |f|}}+ <ReviewableField+ @classes="reviewable-user-details user-field"+ @name={{f.name}}+ @value={{f.value}}+ @tagName=""+ />+ {{/each}}+ </div>- {{yield}}-</div>\ No newline at end of file+ {{yield}}+ </div>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/save-controls.gjs b/app/assets/javascripts/discourse/app/components/save-controls.gjsindex 91e004b03f0..3178778bdc4 100644--- a/app/assets/javascripts/discourse/app/components/save-controls.gjs+++ b/app/assets/javascripts/discourse/app/components/save-controls.gjs@@ -1,7 +1,9 @@import Component from "@ember/component";import { or } from "@ember/object/computed";import { classNames } from "@ember-decorators/component";+import DButton from "discourse/components/d-button";import discourseComputed from "discourse/lib/decorators";+import { i18n } from "discourse-i18n";@classNames("controls", "save-button")export default class SaveControls extends Component {@@ -16,16 +18,18 @@ export default class SaveControls extends Component {savingText(saving) {return saving ? "saving" : "save";}-}-<DButton- @action={{this.action}}- @disabled={{this.buttonDisabled}}- @label={{this.savingText}}- class="btn-primary save-changes"-/>-{{#if this.saved}}- <span class="saved">{{i18n "saved"}}</span>-{{/if}}+ <template>+ <DButton+ @action={{this.action}}+ @disabled={{this.buttonDisabled}}+ @label={{this.savingText}}+ class="btn-primary save-changes"+ />+ {{#if this.saved}}+ <span class="saved">{{i18n "saved"}}</span>+ {{/if}}-{{yield}}\ No newline at end of file+ {{yield}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/search-menu-panel.gjs b/app/assets/javascripts/discourse/app/components/search-menu-panel.gjsindex 9d5180c8f56..2d6d5df7ed5 100644--- a/app/assets/javascripts/discourse/app/components/search-menu-panel.gjs+++ b/app/assets/javascripts/discourse/app/components/search-menu-panel.gjs@@ -1,5 +1,7 @@import Component from "@glimmer/component";import { service } from "@ember/service";+import MenuPanel from "discourse/components/menu-panel";+import SearchMenu from "discourse/components/search-menu";export default class SearchMenuPanel extends Component {@service site;@@ -9,15 +11,17 @@ export default class SearchMenuPanel extends Component {? "slide-in": "drop-down";}-}-<MenuPanel- @animationClass={{this.animationClass}}- @panelClass="search-menu-panel"->- <SearchMenu- @onClose={{@closeSearchMenu}}- @inlineResults={{true}}- @autofocusInput={{true}}- />-</MenuPanel>\ No newline at end of file+ <template>+ <MenuPanel+ @animationClass={{this.animationClass}}+ @panelClass="search-menu-panel"+ >+ <SearchMenu+ @onClose={{@closeSearchMenu}}+ @inlineResults={{true}}+ @autofocusInput={{true}}+ />+ </MenuPanel>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/search-menu.gjs b/app/assets/javascripts/discourse/app/components/search-menu.gjsindex db5c6996dd8..b5f1844421a 100644--- a/app/assets/javascripts/discourse/app/components/search-menu.gjs+++ b/app/assets/javascripts/discourse/app/components/search-menu.gjs@@ -1,9 +1,20 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { hash } from "@ember/helper";+import { on } from "@ember/modifier";import { action } from "@ember/object";+import didInsert from "@ember/render-modifiers/modifiers/did-insert";import { cancel } from "@ember/runloop";import { service } from "@ember/service";import { Promise } from "rsvp";+import DButton from "discourse/components/d-button";+import MenuPanel from "discourse/components/menu-panel";+import PluginOutlet from "discourse/components/plugin-outlet";+import AdvancedButton from "discourse/components/search-menu/advanced-button";+import ClearButton from "discourse/components/search-menu/clear-button";+import Results from "discourse/components/search-menu/results";+import SearchTerm from "discourse/components/search-menu/search-term";+import loadingSpinner from "discourse/helpers/loading-spinner";import { popupAjaxError } from "discourse/lib/ajax-error";import { CANCELLED_STATUS } from "discourse/lib/autocomplete";import { search as searchCategoryTag } from "discourse/lib/category-tag-search";@@ -373,97 +384,97 @@ export default class SearchMenu extends Component {}}}-}-<div- class={{this.classNames}}- {{did-insert this.setupEventListeners}}- {{! template-lint-disable no-invalid-interactive }}- {{on "keydown" this.onKeydown}}->- <div class="search-input">- {{#if this.search.inTopicContext}}- <DButton- @icon="xmark"- @label="search.in_this_topic"- @title="search.in_this_topic_tooltip"- @action={{this.clearTopicContext}}- class="btn-small search-context"- />- {{else if this.inPMInboxContext}}- <DButton- @icon="xmark"- @label="search.in_messages"- @title="search.in_messages_tooltip"- @action={{this.clearPMInboxContext}}- class="btn-small search-context"- />- {{/if}}-- <PluginOutlet- @name="search-menu-before-term-input"- @outletArgs={{hash openSearchMenu=this.open}}- />-- <SearchMenu::SearchTerm- @searchTermChanged={{this.searchTermChanged}}- @typeFilter={{this.typeFilter}}- @updateTypeFilter={{this.updateTypeFilter}}- @triggerSearch={{this.triggerSearch}}- @fullSearch={{this.fullSearch}}- @clearPMInboxContext={{this.clearPMInboxContext}}- @clearTopicContext={{this.clearTopicContext}}- @closeSearchMenu={{this.close}}- @openSearchMenu={{this.open}}- @autofocus={{@autofocusInput}}- />-- {{#if this.loading}}- <div class="searching">- {{loading-spinner}}- </div>- {{else}}- <div class="searching">- <PluginOutlet @name="search-menu-before-advanced-search" />- {{#if this.search.activeGlobalSearchTerm}}- <SearchMenu::ClearButton @clearSearch={{this.clearSearch}} />+ <template>+ <div+ class={{this.classNames}}+ {{didInsert this.setupEventListeners}}+ {{! template-lint-disable no-invalid-interactive }}+ {{on "keydown" this.onKeydown}}+ >+ <div class="search-input">+ {{#if this.search.inTopicContext}}+ <DButton+ @icon="xmark"+ @label="search.in_this_topic"+ @title="search.in_this_topic_tooltip"+ @action={{this.clearTopicContext}}+ class="btn-small search-context"+ />+ {{else if this.inPMInboxContext}}+ <DButton+ @icon="xmark"+ @label="search.in_messages"+ @title="search.in_messages_tooltip"+ @action={{this.clearPMInboxContext}}+ class="btn-small search-context"+ />{{/if}}- <SearchMenu::AdvancedButton- @openAdvancedSearch={{this.openAdvancedSearch}}++ <PluginOutlet+ @name="search-menu-before-term-input"+ @outletArgs={{hash openSearchMenu=this.open}}+ />++ <SearchTerm+ @searchTermChanged={{this.searchTermChanged}}+ @typeFilter={{this.typeFilter}}+ @updateTypeFilter={{this.updateTypeFilter}}+ @triggerSearch={{this.triggerSearch}}+ @fullSearch={{this.fullSearch}}+ @clearPMInboxContext={{this.clearPMInboxContext}}+ @clearTopicContext={{this.clearTopicContext}}+ @closeSearchMenu={{this.close}}+ @openSearchMenu={{this.open}}+ @autofocus={{@autofocusInput}}/>++ {{#if this.loading}}+ <div class="searching">+ {{loadingSpinner}}+ </div>+ {{else}}+ <div class="searching">+ <PluginOutlet @name="search-menu-before-advanced-search" />+ {{#if this.search.activeGlobalSearchTerm}}+ <ClearButton @clearSearch={{this.clearSearch}} />+ {{/if}}+ <AdvancedButton @openAdvancedSearch={{this.openAdvancedSearch}} />+ </div>+ {{/if}}</div>- {{/if}}- </div>-- {{#if @inlineResults}}- <SearchMenu::Results- @loading={{this.loading}}- @invalidTerm={{this.invalidTerm}}- @suggestionKeyword={{this.suggestionKeyword}}- @suggestionResults={{this.suggestionResults}}- @searchTopics={{this.includesTopics}}- @inPMInboxContext={{this.inPMInboxContext}}- @triggerSearch={{this.triggerSearch}}- @updateTypeFilter={{this.updateTypeFilter}}- @closeSearchMenu={{this.close}}- @searchTermChanged={{this.searchTermChanged}}- @clearSearch={{this.clearSearch}}- />- {{else if this.displayMenuPanelResults}}- <MenuPanel @panelClass="search-menu-panel">- <SearchMenu::Results- @loading={{this.loading}}- @invalidTerm={{this.invalidTerm}}- @suggestionKeyword={{this.suggestionKeyword}}- @suggestionResults={{this.suggestionResults}}- @searchTopics={{this.includesTopics}}- @inPMInboxContext={{this.inPMInboxContext}}- @triggerSearch={{this.triggerSearch}}- @updateTypeFilter={{this.updateTypeFilter}}- @closeSearchMenu={{this.close}}- @searchTermChanged={{this.searchTermChanged}}- @clearSearch={{this.clearSearch}}- />- </MenuPanel>- {{/if}}-</div>\ No newline at end of file++ {{#if @inlineResults}}+ <Results+ @loading={{this.loading}}+ @invalidTerm={{this.invalidTerm}}+ @suggestionKeyword={{this.suggestionKeyword}}+ @suggestionResults={{this.suggestionResults}}+ @searchTopics={{this.includesTopics}}+ @inPMInboxContext={{this.inPMInboxContext}}+ @triggerSearch={{this.triggerSearch}}+ @updateTypeFilter={{this.updateTypeFilter}}+ @closeSearchMenu={{this.close}}+ @searchTermChanged={{this.searchTermChanged}}+ @clearSearch={{this.clearSearch}}+ />+ {{else if this.displayMenuPanelResults}}+ <MenuPanel @panelClass="search-menu-panel">+ <Results+ @loading={{this.loading}}+ @invalidTerm={{this.invalidTerm}}+ @suggestionKeyword={{this.suggestionKeyword}}+ @suggestionResults={{this.suggestionResults}}+ @searchTopics={{this.includesTopics}}+ @inPMInboxContext={{this.inPMInboxContext}}+ @triggerSearch={{this.triggerSearch}}+ @updateTypeFilter={{this.updateTypeFilter}}+ @closeSearchMenu={{this.close}}+ @searchTermChanged={{this.searchTermChanged}}+ @clearSearch={{this.clearSearch}}+ />+ </MenuPanel>+ {{/if}}+ </div>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/search-menu/advanced-button.gjs b/app/assets/javascripts/discourse/app/components/search-menu/advanced-button.gjsindex d43dfd52f3e..77940b1aba6 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/advanced-button.gjs+++ b/app/assets/javascripts/discourse/app/components/search-menu/advanced-button.gjs@@ -1,6 +1,12 @@-<DButton- class="show-advanced-search btn-transparent"- title={{i18n "search.open_advanced"}}- @action={{@openAdvancedSearch}}- @icon="sliders"-/>\ No newline at end of file+import DButton from "discourse/components/d-button";+import { i18n } from "discourse-i18n";++const AdvancedButton = <template>+ <DButton+ class="show-advanced-search btn-transparent"+ title={{i18n "search.open_advanced"}}+ @action={{@openAdvancedSearch}}+ @icon="sliders"+ />+</template>;+export default AdvancedButton;diff --git a/app/assets/javascripts/discourse/app/components/search-menu/browser-search-tip.gjs b/app/assets/javascripts/discourse/app/components/search-menu/browser-search-tip.gjsindex f35d5ce8cb7..7189e5804dc 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/browser-search-tip.gjs+++ b/app/assets/javascripts/discourse/app/components/search-menu/browser-search-tip.gjs@@ -6,13 +6,15 @@ export default class BrowserSearchTip extends Component {get translatedLabel() {return i18n("search.browser_tip", { modifier: translateModKey("Meta+") });}-}-<div class="browser-search-tip">- <span class="tip-label">- {{this.translatedLabel}}- </span>- <span class="tip-description">- {{i18n "search.browser_tip_description"}}- </span>-</div>\ No newline at end of file+ <template>+ <div class="browser-search-tip">+ <span class="tip-label">+ {{this.translatedLabel}}+ </span>+ <span class="tip-description">+ {{i18n "search.browser_tip_description"}}+ </span>+ </div>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/search-menu/clear-button.gjs b/app/assets/javascripts/discourse/app/components/search-menu/clear-button.gjsindex bfc9b6ad723..b70375e06dd 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/clear-button.gjs+++ b/app/assets/javascripts/discourse/app/components/search-menu/clear-button.gjs@@ -1,9 +1,16 @@-<a- class="clear-search"- aria-label="clear_input"- title={{i18n "search.clear_search"}}- href- {{on "click" @clearSearch}}->- {{d-icon "xmark"}}-</a>\ No newline at end of file+import { on } from "@ember/modifier";+import icon from "discourse/helpers/d-icon";+import { i18n } from "discourse-i18n";++const ClearButton = <template>+ <a+ class="clear-search"+ aria-label="clear_input"+ title={{i18n "search.clear_search"}}+ href+ {{on "click" @clearSearch}}+ >+ {{icon "xmark"}}+ </a>+</template>;+export default ClearButton;diff --git a/app/assets/javascripts/discourse/app/components/search-menu/highlighted-search.gjs b/app/assets/javascripts/discourse/app/components/search-menu/highlighted-search.gjsindex e1adb48b965..00fb59c90e1 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/highlighted-search.gjs+++ b/app/assets/javascripts/discourse/app/components/search-menu/highlighted-search.gjs@@ -1,6 +1,8 @@import Component from "@glimmer/component";import { action } from "@ember/object";+import didInsert from "@ember/render-modifiers/modifiers/did-insert";import { service } from "@ember/service";+import { htmlSafe } from "@ember/template";import highlightSearch from "discourse/lib/highlight-search";export default class HighlightedSearch extends Component {@@ -10,8 +12,10 @@ export default class HighlightedSearch extends Component {highlight(element) {highlightSearch(element, this.search.activeGlobalSearchTerm);}-}-<span {{did-insert this.highlight}}>- {{html-safe @string}}-</span>\ No newline at end of file+ <template>+ <span {{didInsert this.highlight}}>+ {{htmlSafe @string}}+ </span>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/search-menu/results.gjs b/app/assets/javascripts/discourse/app/components/search-menu/results.gjsindex 55562e1c056..49fc1e7434b 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/results.gjs+++ b/app/assets/javascripts/discourse/app/components/search-menu/results.gjs@@ -1,7 +1,17 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { hash } from "@ember/helper";import { action } from "@ember/object";import { service } from "@ember/service";+import { and, not } from "truth-helpers";+import ConditionalLoadingSection from "discourse/components/conditional-loading-section";+import PluginOutlet from "discourse/components/plugin-outlet";+import BrowserSearchTip from "discourse/components/search-menu/browser-search-tip";+import Assistant from "discourse/components/search-menu/results/assistant";+import InitialOptions from "discourse/components/search-menu/results/initial-options";+import MoreLink from "discourse/components/search-menu/results/more-link";+import Types from "discourse/components/search-menu/results/types";+import { i18n } from "discourse-i18n";import CategoryViewComponent from "./results/type/category";import GroupViewComponent from "./results/type/group";import PostViewComponent from "./results/type/post";@@ -54,91 +64,93 @@ export default class Results extends Component {updateSearchTopics(value) {this.searchTopics = value;}-}-{{#if (and this.search.inTopicContext (not @searchTopics))}}- <SearchMenu::BrowserSearchTip />-{{else}}- <ConditionalLoadingSection @isLoading={{this.loading}}>- <div class="results">- <PluginOutlet- @name="search-menu-results-top"- @outletArgs={{hash- closeSearchMenu=@closeSearchMenu- searchTerm=this.search.activeGlobalSearchTerm- inTopicContext=this.search.inTopicContext- searchTopics=@searchTopics- }}- />- {{#if @suggestionKeyword}}- <SearchMenu::Results::Assistant- @suggestionKeyword={{@suggestionKeyword}}- @results={{@suggestionResults}}- @closeSearchMenu={{@closeSearchMenu}}- @searchTermChanged={{@searchTermChanged}}- />- {{else if this.termTooShort}}- <div class="no-results">{{i18n "search.too_short"}}</div>- {{else if this.noTopicResults}}- <div class="no-results">{{i18n "search.no_results"}}</div>- {{else if this.renderInitialOptions}}- <SearchMenu::Results::InitialOptions- @closeSearchMenu={{@closeSearchMenu}}- @searchTermChanged={{@searchTermChanged}}- />- {{else}}- {{#if (and (not @searchTopics) (not @inPMInboxContext))}}- {{! render the first couple suggestions before a search has been performed}}- <SearchMenu::Results::InitialOptions- @closeSearchMenu={{@closeSearchMenu}}- @searchTermChanged={{@searchTermChanged}}+ <template>+ {{#if (and this.search.inTopicContext (not @searchTopics))}}+ <BrowserSearchTip />+ {{else}}+ <ConditionalLoadingSection @isLoading={{this.loading}}>+ <div class="results">+ <PluginOutlet+ @name="search-menu-results-top"+ @outletArgs={{hash+ closeSearchMenu=@closeSearchMenu+ searchTerm=this.search.activeGlobalSearchTerm+ inTopicContext=this.search.inTopicContext+ searchTopics=@searchTopics+ }}/>- {{/if}}+ {{#if @suggestionKeyword}}+ <Assistant+ @suggestionKeyword={{@suggestionKeyword}}+ @results={{@suggestionResults}}+ @closeSearchMenu={{@closeSearchMenu}}+ @searchTermChanged={{@searchTermChanged}}+ />+ {{else if this.termTooShort}}+ <div class="no-results">{{i18n "search.too_short"}}</div>+ {{else if this.noTopicResults}}+ <div class="no-results">{{i18n "search.no_results"}}</div>+ {{else if this.renderInitialOptions}}+ <InitialOptions+ @closeSearchMenu={{@closeSearchMenu}}+ @searchTermChanged={{@searchTermChanged}}+ />+ {{else}}+ {{#if (and (not @searchTopics) (not @inPMInboxContext))}}+ {{! render the first couple suggestions before a search has been performed}}+ <InitialOptions+ @closeSearchMenu={{@closeSearchMenu}}+ @searchTermChanged={{@searchTermChanged}}+ />+ {{/if}}- {{#if (and @searchTopics this.resultTypesWithComponent)}}- {{! render results after a search has been performed }}- <SearchMenu::Results::Types- @resultTypes={{this.resultTypesWithComponent}}- @topicResultsOnly={{true}}- @closeSearchMenu={{@closeSearchMenu}}- @searchLogId={{this.searchLogId}}- />- <SearchMenu::Results::MoreLink- @updateTypeFilter={{@updateTypeFilter}}- @triggerSearch={{@triggerSearch}}- @resultTypes={{this.resultTypesWithComponent}}- @closeSearchMenu={{@closeSearchMenu}}- @searchTermChanged={{@searchTermChanged}}+ {{#if (and @searchTopics this.resultTypesWithComponent)}}+ {{! render results after a search has been performed }}+ <Types+ @resultTypes={{this.resultTypesWithComponent}}+ @topicResultsOnly={{true}}+ @closeSearchMenu={{@closeSearchMenu}}+ @searchLogId={{this.searchLogId}}+ />+ <MoreLink+ @updateTypeFilter={{@updateTypeFilter}}+ @triggerSearch={{@triggerSearch}}+ @resultTypes={{this.resultTypesWithComponent}}+ @closeSearchMenu={{@closeSearchMenu}}+ @searchTermChanged={{@searchTermChanged}}+ />+ {{else if+ (and+ (not @inPMInboxContext)+ (not @searchTopics)+ this.resultTypesWithComponent+ )+ }}+ <Types+ @resultTypes={{this.resultTypesWithComponent}}+ @closeSearchMenu={{@closeSearchMenu}}+ @searchTermChanged={{@searchTermChanged}}+ @displayNameWithUser={{true}}+ @searchLogId={{this.searchLogId}}+ />+ {{/if}}+ <PluginOutlet+ @name="search-menu-with-results-bottom"+ @outletArgs={{hash resultTypes=this.resultTypesWithComponent}}+ />+ {{/if}}+ <PluginOutlet+ @name="search-menu-results-bottom"+ @outletArgs={{hash+ inTopicContext=this.search.inTopicContext+ searchTermChanged=@searchTermChanged+ searchTopics=@searchTopics+ closeSearchMenu=@closeSearchMenu+ }}/>- {{else if- (and- (not @inPMInboxContext)- (not @searchTopics)- this.resultTypesWithComponent- )- }}- <SearchMenu::Results::Types- @resultTypes={{this.resultTypesWithComponent}}- @closeSearchMenu={{@closeSearchMenu}}- @searchTermChanged={{@searchTermChanged}}- @displayNameWithUser={{true}}- @searchLogId={{this.searchLogId}}- />- {{/if}}- <PluginOutlet- @name="search-menu-with-results-bottom"- @outletArgs={{hash resultTypes=this.resultTypesWithComponent}}- />- {{/if}}- <PluginOutlet- @name="search-menu-results-bottom"- @outletArgs={{hash- inTopicContext=this.search.inTopicContext- searchTermChanged=@searchTermChanged- searchTopics=@searchTopics- closeSearchMenu=@closeSearchMenu- }}- />- </div>- </ConditionalLoadingSection>-{{/if}}\ No newline at end of file+ </div>+ </ConditionalLoadingSection>+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/search-menu/results/assistant-item.gjs b/app/assets/javascripts/discourse/app/components/search-menu/results/assistant-item.gjsindex d8ee1668596..cae33e3c619 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/results/assistant-item.gjs+++ b/app/assets/javascripts/discourse/app/components/search-menu/results/assistant-item.gjs@@ -1,9 +1,17 @@import Component from "@glimmer/component";+import { on } from "@ember/modifier";import { action } from "@ember/object";import { service } from "@ember/service";+import { and, or } from "truth-helpers";import { focusSearchInput } from "discourse/components/search-menu";+import Category from "discourse/components/search-menu/results/type/category";+import Tag from "discourse/components/search-menu/results/type/tag";+import User from "discourse/components/search-menu/results/type/user";+import concatClass from "discourse/helpers/concat-class";+import icon from "discourse/helpers/d-icon";import { debounce } from "discourse/lib/decorators";import getURL from "discourse/lib/get-url";+import { i18n } from "discourse-i18n";const _itemSelectCallbacks = [];export function addItemSelectCallback(fn) {@@ -122,62 +130,64 @@ export default class AssistantItem extends Component {});focusSearchInput();}-}-{{! template-lint-disable no-pointer-down-event-binding }}-{{! template-lint-disable no-invalid-interactive }}-<li- class={{concat-class @typeClass "search-menu-assistant-item"}}- {{on "keydown" this.onKeydown}}- {{on "click" this.onClick}}- data-usage={{@usage}}->- <a class="search-link" href={{this.href}}>- <span aria-label={{i18n "search.title"}}>- {{d-icon (or @icon "magnifying-glass")}}- </span>-- {{#if this.prefix}}- <span class="search-item-prefix">- {{this.prefix}}- </span>- {{/if}}-- {{#if @withInLabel}}- <span class="label-suffix">{{i18n "search.in"}}</span>- {{/if}}-- {{#if @category}}- <SearchMenu::Results::Type::Category @result={{@category}} />- {{#if (and @tag @isIntersection)}}- <span class="search-item-tag">- {{d-icon "tag"}}{{@tag}}+ <template>+ {{! template-lint-disable no-pointer-down-event-binding }}+ {{! template-lint-disable no-invalid-interactive }}+ <li+ class={{concatClass @typeClass "search-menu-assistant-item"}}+ {{on "keydown" this.onKeydown}}+ {{on "click" this.onClick}}+ data-usage={{@usage}}+ >+ <a class="search-link" href={{this.href}}>+ <span aria-label={{i18n "search.title"}}>+ {{icon (or @icon "magnifying-glass")}}</span>- {{/if}}- {{else if @tag}}- {{#if (and @isIntersection @additionalTags.length)}}- <span class="search-item-tag">{{this.tagsSlug}}</span>- {{else}}- <span class="search-item-tag">- <SearchMenu::Results::Type::Tag @result={{@tag}} />++ {{#if this.prefix}}+ <span class="search-item-prefix">+ {{this.prefix}}+ </span>+ {{/if}}++ {{#if @withInLabel}}+ <span class="label-suffix">{{i18n "search.in"}}</span>+ {{/if}}++ {{#if @category}}+ <Category @result={{@category}} />+ {{#if (and @tag @isIntersection)}}+ <span class="search-item-tag">+ {{icon "tag"}}{{@tag}}+ </span>+ {{/if}}+ {{else if @tag}}+ {{#if (and @isIntersection @additionalTags.length)}}+ <span class="search-item-tag">{{this.tagsSlug}}</span>+ {{else}}+ <span class="search-item-tag">+ <Tag @result={{@tag}} />+ </span>+ {{/if}}+ {{else if @user}}+ <span class="search-item-user">+ <User @result={{@user}} />+ </span>+ {{/if}}++ <span class="search-item-slug">+ {{#if @suffix}}+ <span class="label-suffix">{{@suffix}}</span>+ {{/if}}+ {{@label}}</span>- {{/if}}- {{else if @user}}- <span class="search-item-user">- <SearchMenu::Results::Type::User @result={{@user}} />- </span>- {{/if}}-- <span class="search-item-slug">- {{#if @suffix}}- <span class="label-suffix">{{@suffix}}</span>- {{/if}}- {{@label}}- </span>- {{#if @extraHint}}- <span class="extra-hint">- {{i18n "search.enter_hint"}}- </span>- {{/if}}- </a>-</li>\ No newline at end of file+ {{#if @extraHint}}+ <span class="extra-hint">+ {{i18n "search.enter_hint"}}+ </span>+ {{/if}}+ </a>+ </li>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/search-menu/results/assistant.gjs b/app/assets/javascripts/discourse/app/components/search-menu/results/assistant.gjsindex 26e14c4002f..8a7c954bfcc 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/results/assistant.gjs+++ b/app/assets/javascripts/discourse/app/components/search-menu/results/assistant.gjs@@ -1,5 +1,10 @@import Component from "@glimmer/component";+import { concat, get, hash } from "@ember/helper";import { service } from "@ember/service";+import { eq } from "truth-helpers";+import PluginOutlet from "discourse/components/plugin-outlet";+import AssistantItem from "discourse/components/search-menu/results/assistant-item";+import { i18n } from "discourse-i18n";const suggestionShortcuts = ["in:title",@@ -119,6 +124,110 @@ export default class Assistant extends Component {// quick suggest user search in the topic or globallyreturn this.args.results[0];}++ <template>+ <ul class="search-menu-assistant">+ {{! suggestion type keywords are mapped to SUGGESTION_KEYWORD_MAP }}+ {{#if (eq this.suggestionType "tagIntersection")}}+ <PluginOutlet+ @name="search-menu-results-assistant-tag-intersection-top"+ />+ {{#each @results as |result|}}+ <AssistantItem+ @tag={{result.tagName}}+ @additionalTags={{result.additionalTags}}+ @category={{result.category}}+ @slug={{@slug}}+ @withInLabel={{@withInLabel}}+ @isIntersection={{true}}+ @searchAllTopics={{true}}+ @searchTermChanged={{@searchTermChanged}}+ @suggestionKeyword={{@suggestionKeyword}}+ @typeClass="tag-intersection"+ />+ {{/each}}+ {{else if (eq this.suggestionType "categoryOrTag")}}+ <PluginOutlet+ @name="search-menu-results-assistant-category-or-tag-top"+ />+ {{#each @results as |result|}}+ {{#if result.model}}+ {{! render category }}+ <AssistantItem+ @category={{result.model}}+ @slug={{get this.fullSlugForCategoryMap result.model.id}}+ @withInLabel={{@withInLabel}}+ @searchAllTopics={{true}}+ @searchTermChanged={{@searchTermChanged}}+ @suggestionKeyword={{@suggestionKeyword}}+ @typeClass="category"+ />+ {{else}}+ {{! render tag }}+ <AssistantItem+ @tag={{result.name}}+ @slug={{concat this.prefix "#" result.name}}+ @withInLabel={{@withInLabel}}+ @searchAllTopics={{true}}+ @searchTermChanged={{@searchTermChanged}}+ @suggestionKeyword={{@suggestionKeyword}}+ @typeClass="tag"+ />+ {{/if}}+ {{/each}}+ {{else if (eq this.suggestionType "user")}}+ <PluginOutlet @name="search-menu-results-assistant-user-top" />+ {{#if this.userMatchesInTopic}}+ <AssistantItem+ @extraHint={{true}}+ @user={{this.user}}+ @slug={{concat this.prefix "@" this.user.username}}+ @suffix={{i18n "search.in_topics_posts"}}+ @searchAllTopics={{true}}+ @searchTermChanged={{@searchTermChanged}}+ @suggestionKeyword={{@suggestionKeyword}}+ @typeClass="user"+ />++ <AssistantItem+ @user={{this.user}}+ @slug={{concat this.prefix "@" this.user.username}}+ @suffix={{i18n "search.in_this_topic"}}+ @searchTermChanged={{@searchTermChanged}}+ @suggestionKeyword={{@suggestionKeyword}}+ @typeClass="user"+ />+ {{else}}+ {{#each @results as |result|}}+ <AssistantItem+ @user={{result}}+ @slug={{concat this.prefix "@" result.username}}+ @searchAllTopics={{true}}+ @searchTermChanged={{@searchTermChanged}}+ @suggestionKeyword={{@suggestionKeyword}}+ @typeClass="user"+ />+ {{/each}}+ {{/if}}+ {{else}}+ <PluginOutlet+ @name="search-menu-results-assistant-shortcut-top"+ @outletArgs={{hash suggestionShortcuts=this.suggestionShortcuts}}+ />+ {{#each this.suggestionShortcuts as |item|}}+ <AssistantItem+ @slug={{concat this.prefix item}}+ @label={{item}}+ @searchAllTopics={{true}}+ @searchTermChanged={{@searchTermChanged}}+ @suggestionKeyword={{@suggestionKeyword}}+ @typeClass="shortcut"+ />+ {{/each}}+ {{/if}}+ <PluginOutlet @name="search-menu-assistant-bottom" />+ </ul>+ </template>}export function addSearchSuggestion(value) {@@ -126,101 +235,3 @@ export function addSearchSuggestion(value) {suggestionShortcuts.push(value);}}--<ul class="search-menu-assistant">- {{! suggestion type keywords are mapped to SUGGESTION_KEYWORD_MAP }}- {{#if (eq this.suggestionType "tagIntersection")}}- <PluginOutlet @name="search-menu-results-assistant-tag-intersection-top" />- {{#each @results as |result|}}- <SearchMenu::Results::AssistantItem- @tag={{result.tagName}}- @additionalTags={{result.additionalTags}}- @category={{result.category}}- @slug={{@slug}}- @withInLabel={{@withInLabel}}- @isIntersection={{true}}- @searchAllTopics={{true}}- @searchTermChanged={{@searchTermChanged}}- @suggestionKeyword={{@suggestionKeyword}}- @typeClass="tag-intersection"- />- {{/each}}- {{else if (eq this.suggestionType "categoryOrTag")}}- <PluginOutlet @name="search-menu-results-assistant-category-or-tag-top" />- {{#each @results as |result|}}- {{#if result.model}}- {{! render category }}- <SearchMenu::Results::AssistantItem- @category={{result.model}}- @slug={{get this.fullSlugForCategoryMap result.model.id}}- @withInLabel={{@withInLabel}}- @searchAllTopics={{true}}- @searchTermChanged={{@searchTermChanged}}- @suggestionKeyword={{@suggestionKeyword}}- @typeClass="category"- />- {{else}}- {{! render tag }}- <SearchMenu::Results::AssistantItem- @tag={{result.name}}- @slug={{concat this.prefix "#" result.name}}- @withInLabel={{@withInLabel}}- @searchAllTopics={{true}}- @searchTermChanged={{@searchTermChanged}}- @suggestionKeyword={{@suggestionKeyword}}- @typeClass="tag"- />- {{/if}}- {{/each}}- {{else if (eq this.suggestionType "user")}}- <PluginOutlet @name="search-menu-results-assistant-user-top" />- {{#if this.userMatchesInTopic}}- <SearchMenu::Results::AssistantItem- @extraHint={{true}}- @user={{this.user}}- @slug={{concat this.prefix "@" this.user.username}}- @suffix={{i18n "search.in_topics_posts"}}- @searchAllTopics={{true}}- @searchTermChanged={{@searchTermChanged}}- @suggestionKeyword={{@suggestionKeyword}}- @typeClass="user"- />-- <SearchMenu::Results::AssistantItem- @user={{this.user}}- @slug={{concat this.prefix "@" this.user.username}}- @suffix={{i18n "search.in_this_topic"}}- @searchTermChanged={{@searchTermChanged}}- @suggestionKeyword={{@suggestionKeyword}}- @typeClass="user"- />- {{else}}- {{#each @results as |result|}}- <SearchMenu::Results::AssistantItem- @user={{result}}- @slug={{concat this.prefix "@" result.username}}- @searchAllTopics={{true}}- @searchTermChanged={{@searchTermChanged}}- @suggestionKeyword={{@suggestionKeyword}}- @typeClass="user"- />- {{/each}}- {{/if}}- {{else}}- <PluginOutlet- @name="search-menu-results-assistant-shortcut-top"- @outletArgs={{hash suggestionShortcuts=this.suggestionShortcuts}}- />- {{#each this.suggestionShortcuts as |item|}}- <SearchMenu::Results::AssistantItem- @slug={{concat this.prefix item}}- @label={{item}}- @searchAllTopics={{true}}- @searchTermChanged={{@searchTermChanged}}- @suggestionKeyword={{@suggestionKeyword}}- @typeClass="shortcut"- />- {{/each}}- {{/if}}- <PluginOutlet @name="search-menu-assistant-bottom" />-</ul>\ No newline at end of filediff --git a/app/assets/javascripts/discourse/app/components/search-menu/results/blurb.gjs b/app/assets/javascripts/discourse/app/components/search-menu/results/blurb.gjsindex 228b4846d8f..36d1cf0db68 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/results/blurb.gjs+++ b/app/assets/javascripts/discourse/app/components/search-menu/results/blurb.gjs@@ -1,19 +1,24 @@import Component from "@glimmer/component";import { service } from "@ember/service";+import { htmlSafe } from "@ember/template";+import HighlightedSearch from "discourse/components/search-menu/highlighted-search";+import formatAge from "discourse/helpers/format-age";export default class Blurb extends Component {@service siteSettings;@service site;-}-<span class="blurb">- {{format-age @result.created_at}}- <span class="blurb__separator"> - </span>- {{#if this.siteSettings.use_pg_headlines_for_excerpt}}- <span>{{html-safe @result.blurb}}</span>- {{else}}- <span class="blurb__text">- <SearchMenu::HighlightedSearch @string={{@result.blurb}} />+ <template>+ <span class="blurb">+ {{formatAge @result.created_at}}+ <span class="blurb__separator"> - </span>+ {{#if this.siteSettings.use_pg_headlines_for_excerpt}}+ <span>{{htmlSafe @result.blurb}}</span>+ {{else}}+ <span class="blurb__text">+ <HighlightedSearch @string={{@result.blurb}} />+ </span>+ {{/if}}</span>- {{/if}}-</span>\ No newline at end of file+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/search-menu/results/initial-options.gjs b/app/assets/javascripts/discourse/app/components/search-menu/results/initial-options.gjsindex 8a528806651..a762e9d7bef 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/results/initial-options.gjs+++ b/app/assets/javascripts/discourse/app/components/search-menu/results/initial-options.gjs@@ -1,9 +1,14 @@import Component from "@glimmer/component";+import { hash } from "@ember/helper";import { service } from "@ember/service";+import { and, or } from "truth-helpers";+import PluginOutlet from "discourse/components/plugin-outlet";import { MODIFIER_REGEXP } from "discourse/components/search-menu";+import AssistantItem from "discourse/components/search-menu/results/assistant-item";+import RandomQuickTip from "discourse/components/search-menu/results/random-quick-tip";+import RecentSearches from "discourse/components/search-menu/results/recent-searches";import { i18n } from "discourse-i18n";import Assistant from "./assistant";-import AssistantItem from "./assistant-item";const SEARCH_CONTEXT_TYPE_COMPONENTS = {topic: AssistantItem,@@ -141,81 +146,83 @@ export default class InitialOptions extends Component {username: this.search.searchContext.user.username,});}-}-<ul class="search-menu-initial-options">- <PluginOutlet- @name="search-menu-initial-options"- @outletArgs={{hash- termMatchesContextTypeKeyword=this.termMatchesContextTypeKeyword- contextTypeComponent=this.contextTypeComponent- slug=this.slug- suggestionKeyword=this.contextTypeKeyword- results=this.initialResults- withInLabel=this.withInLabel- suffix=this.suffix- label=this.label- closeSearchMenu=@closeSearchMenu- searchTermChanged=@searchTermChanged- }}- >- {{#if this.termMatchesContextTypeKeyword}}- <SearchMenu::Results::AssistantItem- @slug={{this.slug}}- @extraHint={{true}}- @closeSearchMenu={{@closeSearchMenu}}- @searchTermChanged={{@searchTermChanged}}- @suggestionKeyword={{this.contextTypeKeyword}}- />- {{else}}- {{#if (or this.search.activeGlobalSearchTerm this.search.searchContext)}}- {{#if this.search.activeGlobalSearchTerm}}- <SearchMenu::Results::AssistantItem- @suffix={{i18n "search.in_topics_posts"}}- @closeSearchMenu={{@closeSearchMenu}}- @searchAllTopics={{true}}- @extraHint={{true}}- @searchTermChanged={{@searchTermChanged}}- @suggestionKeyword={{this.contextTypeKeyword}}- />- {{/if}}-- {{#if this.search.searchContext}}- <this.contextTypeComponent+ <template>+ <ul class="search-menu-initial-options">+ <PluginOutlet+ @name="search-menu-initial-options"+ @outletArgs={{hash+ termMatchesContextTypeKeyword=this.termMatchesContextTypeKeyword+ contextTypeComponent=this.contextTypeComponent+ slug=this.slug+ suggestionKeyword=this.contextTypeKeyword+ results=this.initialResults+ withInLabel=this.withInLabel+ suffix=this.suffix+ label=this.label+ closeSearchMenu=@closeSearchMenu+ searchTermChanged=@searchTermChanged+ }}+ >+ {{#if this.termMatchesContextTypeKeyword}}+ <AssistantItem@slug={{this.slug}}- @suggestionKeyword={{this.contextTypeKeyword}}- @results={{this.initialResults}}- @withInLabel={{this.withInLabel}}- @suffix={{this.suffix}}- @label={{this.label}}+ @extraHint={{true}}@closeSearchMenu={{@closeSearchMenu}}@searchTermChanged={{@searchTermChanged}}+ @suggestionKeyword={{this.contextTypeKeyword}}/>-+ {{else}}{{#if- (and- this.currentUser- this.siteSettings.log_search_queries- this.displayInitialOptions- )+ (or this.search.activeGlobalSearchTerm this.search.searchContext)}}- <SearchMenu::Results::RecentSearches- @closeSearchMenu={{@closeSearchMenu}}- @searchTermChanged={{@searchTermChanged}}- />+ {{#if this.search.activeGlobalSearchTerm}}+ <AssistantItem+ @suffix={{i18n "search.in_topics_posts"}}+ @closeSearchMenu={{@closeSearchMenu}}+ @searchAllTopics={{true}}+ @extraHint={{true}}+ @searchTermChanged={{@searchTermChanged}}+ @suggestionKeyword={{this.contextTypeKeyword}}+ />+ {{/if}}++ {{#if this.search.searchContext}}+ <this.contextTypeComponent+ @slug={{this.slug}}+ @suggestionKeyword={{this.contextTypeKeyword}}+ @results={{this.initialResults}}+ @withInLabel={{this.withInLabel}}+ @suffix={{this.suffix}}+ @label={{this.label}}+ @closeSearchMenu={{@closeSearchMenu}}+ @searchTermChanged={{@searchTermChanged}}+ />++ {{#if+ (and+ this.currentUser+ this.siteSettings.log_search_queries+ this.displayInitialOptions+ )+ }}+ <RecentSearches+ @closeSearchMenu={{@closeSearchMenu}}+ @searchTermChanged={{@searchTermChanged}}+ />+ {{/if}}+ {{/if}}+ {{else}}+ <RandomQuickTip @searchTermChanged={{@searchTermChanged}} />+ {{#if (and this.currentUser this.siteSettings.log_search_queries)}}+ <RecentSearches+ @closeSearchMenu={{@closeSearchMenu}}+ @searchTermChanged={{@searchTermChanged}}+ />+ {{/if}}{{/if}}{{/if}}- {{else}}- <SearchMenu::Results::RandomQuickTip- @searchTermChanged={{@searchTermChanged}}- />- {{#if (and this.currentUser this.siteSettings.log_search_queries)}}- <SearchMenu::Results::RecentSearches- @closeSearchMenu={{@closeSearchMenu}}- @searchTermChanged={{@searchTermChanged}}- />- {{/if}}- {{/if}}- {{/if}}- </PluginOutlet>-</ul>\ No newline at end of file+ </PluginOutlet>+ </ul>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/search-menu/results/more-link.gjs b/app/assets/javascripts/discourse/app/components/search-menu/results/more-link.gjsindex 7ea44b57298..546d5439a96 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/results/more-link.gjs+++ b/app/assets/javascripts/discourse/app/components/search-menu/results/more-link.gjs@@ -1,7 +1,10 @@import Component from "@glimmer/component";+import { fn } from "@ember/helper";+import { on } from "@ember/modifier";import { action } from "@ember/object";import { service } from "@ember/service";import DiscourseURL from "discourse/lib/url";+import { i18n } from "discourse-i18n";export default class MoreLink extends Component {@service search;@@ -42,26 +45,28 @@ export default class MoreLink extends Component {this.search.handleArrowUpOrDown(e);}-}-{{#if this.topicResults}}- {{! template-lint-disable no-invalid-interactive }}- <div class="search-menu__show-more" {{on "keyup" this.onKeyup}}>- {{#if this.moreUrl}}- <a- href={{this.moreUrl}}- {{on "click" this.transitionToMoreUrl}}- class="filter search-link"- >- {{i18n "more"}}...- </a>- {{else if this.topicResults.more}}- <a- {{on "click" (fn this.moreOfType this.topicResults.type)}}- class="filter search-link"- >- {{i18n "more"}}...- </a>+ <template>+ {{#if this.topicResults}}+ {{! template-lint-disable no-invalid-interactive }}+ <div class="search-menu__show-more" {{on "keyup" this.onKeyup}}>+ {{#if this.moreUrl}}+ <a+ href={{this.moreUrl}}+ {{on "click" this.transitionToMoreUrl}}+ class="filter search-link"+ >+ {{i18n "more"}}...+ </a>+ {{else if this.topicResults.more}}+ <a+ {{on "click" (fn this.moreOfType this.topicResults.type)}}+ class="filter search-link"+ >+ {{i18n "more"}}...+ </a>+ {{/if}}+ </div>{{/if}}- </div>-{{/if}}\ No newline at end of file+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/search-menu/results/random-quick-tip.gjs b/app/assets/javascripts/discourse/app/components/search-menu/results/random-quick-tip.gjsindex 7c59f8b2263..81483049d79 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/results/random-quick-tip.gjs+++ b/app/assets/javascripts/discourse/app/components/search-menu/results/random-quick-tip.gjs@@ -1,7 +1,9 @@import Component from "@glimmer/component";+import { on } from "@ember/modifier";import { action } from "@ember/object";import { service } from "@ember/service";import { focusSearchInput } from "discourse/components/search-menu";+import concatClass from "discourse/helpers/concat-class";import { i18n } from "discourse-i18n";const DEFAULT_QUICK_TIPS = [@@ -71,21 +73,23 @@ export default class RandomQuickTip extends Component {e.preventDefault();}}-}-<li class="search-random-quick-tip">- <button- class={{concat-class- "tip-label"- (if this.randomTip.clickable "tip-clickable")- }}- {{on "click" this.tipSelected}}- aria-describedby="tip-description"- >- {{this.randomTip.label}}- </button>+ <template>+ <li class="search-random-quick-tip">+ <button+ class={{concatClass+ "tip-label"+ (if this.randomTip.clickable "tip-clickable")+ }}+ {{on "click" this.tipSelected}}+ aria-describedby="tip-description"+ >+ {{this.randomTip.label}}+ </button>- <span id="tip-description">- {{this.randomTip.description}}- </span>-</li>\ No newline at end of file+ <span id="tip-description">+ {{this.randomTip.description}}+ </span>+ </li>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/search-menu/results/recent-searches.gjs b/app/assets/javascripts/discourse/app/components/search-menu/results/recent-searches.gjsindex 771eeb9f76a..ad0c50b5f78 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/results/recent-searches.gjs+++ b/app/assets/javascripts/discourse/app/components/search-menu/results/recent-searches.gjs@@ -1,7 +1,10 @@import Component from "@glimmer/component";import { action } from "@ember/object";import { service } from "@ember/service";+import FlatButton from "discourse/components/flat-button";+import AssistantItem from "discourse/components/search-menu/results/assistant-item";import User from "discourse/models/user";+import { i18n } from "discourse-i18n";export default class RecentSearches extends Component {@service currentUser;@@ -44,30 +47,32 @@ export default class RecentSearches extends Component {this.currentUser.set("recent_searches", result.recent_searches);}}-}-{{#if this.currentUser.recent_searches}}- <div class="search-menu-recent">- <div class="heading">- <h4>{{i18n "search.recent"}}</h4>- <FlatButton- @title="search.clear_recent"- @icon="xmark"- @action={{this.clearRecent}}- class="clear-recent-searches"- />- </div>+ <template>+ {{#if this.currentUser.recent_searches}}+ <div class="search-menu-recent">+ <div class="heading">+ <h4>{{i18n "search.recent"}}</h4>+ <FlatButton+ @title="search.clear_recent"+ @icon="xmark"+ @action={{this.clearRecent}}+ class="clear-recent-searches"+ />+ </div>- {{#each this.currentUser.recent_searches as |slug|}}- <SearchMenu::Results::AssistantItem- @icon="clock-rotate-left"- @label={{slug}}- @slug={{slug}}- @closeSearchMenu={{@closeSearchMenu}}- @searchTermChanged={{@searchTermChanged}}- @usage="recent-search"- @concatSlug={{true}}- />- {{/each}}- </div>-{{/if}}\ No newline at end of file+ {{#each this.currentUser.recent_searches as |slug|}}+ <AssistantItem+ @icon="clock-rotate-left"+ @label={{slug}}+ @slug={{slug}}+ @closeSearchMenu={{@closeSearchMenu}}+ @searchTermChanged={{@searchTermChanged}}+ @usage="recent-search"+ @concatSlug={{true}}+ />+ {{/each}}+ </div>+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/search-menu/results/type/category.gjs b/app/assets/javascripts/discourse/app/components/search-menu/results/type/category.gjsindex 64b312acfc5..6ec2e1b9628 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/results/type/category.gjs+++ b/app/assets/javascripts/discourse/app/components/search-menu/results/type/category.gjs@@ -1 +1,6 @@-{{category-link @result link=false allowUncategorized=true}}\ No newline at end of file+import categoryLink from "discourse/helpers/category-link";++const Category = <template>+ {{categoryLink @result link=false allowUncategorized=true}}+</template>;+export default Category;diff --git a/app/assets/javascripts/discourse/app/components/search-menu/results/type/group.gjs b/app/assets/javascripts/discourse/app/components/search-menu/results/type/group.gjsindex b6e45dc3454..1930ace0e0b 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/results/type/group.gjs+++ b/app/assets/javascripts/discourse/app/components/search-menu/results/type/group.gjs@@ -1,20 +1,27 @@-<div class="group-result {{if @result.flairUrl '--with-flair'}}">- {{#if @result.flairUrl}}- <AvatarFlair- @flairName={{@result.name}}- @flairUrl={{@result.flairUrl}}- @flairBgColor={{@result.flairBgColor}}- @flairColor={{@result.flairColor}}- @class="avatar-flair__wrapper"- />- {{else}}- {{d-icon "users"}}- {{/if}}- <div class="group-names {{if @result.fullName '--group-with-slug'}}">- <span class="name">{{or @result.fullName @result.name}}</span>- {{! show the name of the group if we also show the full name }}- {{#if @result.fullName}}- <div class="slug">{{@result.name}}</div>+import { or } from "truth-helpers";+import AvatarFlair from "discourse/components/avatar-flair";+import icon from "discourse/helpers/d-icon";++const Group = <template>+ <div class="group-result {{if @result.flairUrl '--with-flair'}}">+ {{#if @result.flairUrl}}+ <AvatarFlair+ @flairName={{@result.name}}+ @flairUrl={{@result.flairUrl}}+ @flairBgColor={{@result.flairBgColor}}+ @flairColor={{@result.flairColor}}+ @class="avatar-flair__wrapper"+ />+ {{else}}+ {{icon "users"}}{{/if}}+ <div class="group-names {{if @result.fullName '--group-with-slug'}}">+ <span class="name">{{or @result.fullName @result.name}}</span>+ {{! show the name of the group if we also show the full name }}+ {{#if @result.fullName}}+ <div class="slug">{{@result.name}}</div>+ {{/if}}+ </div></div>-</div>\ No newline at end of file+</template>;+export default Group;diff --git a/app/assets/javascripts/discourse/app/components/search-menu/results/type/post.gjs b/app/assets/javascripts/discourse/app/components/search-menu/results/type/post.gjsindex b96d53e4090..46a54592424 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/results/type/post.gjs+++ b/app/assets/javascripts/discourse/app/components/search-menu/results/type/post.gjs@@ -1,2 +1,8 @@-{{i18n "search.post_format" @result}}-<SearchMenu::Results::Blurb @result={{@result}} />\ No newline at end of file+import Blurb from "discourse/components/search-menu/results/blurb";+import { i18n } from "discourse-i18n";++const Post = <template>+ {{i18n "search.post_format" @result}}+ <Blurb @result={{@result}} />+</template>;+export default Post;diff --git a/app/assets/javascripts/discourse/app/components/search-menu/results/type/tag.gjs b/app/assets/javascripts/discourse/app/components/search-menu/results/type/tag.gjsindex 6d5c636b5f1..36e68a739af 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/results/type/tag.gjs+++ b/app/assets/javascripts/discourse/app/components/search-menu/results/type/tag.gjs@@ -1,2 +1,9 @@-{{d-icon "tag"}}-{{discourse-tag (or @result.id @result) tagName="span"}}\ No newline at end of file+import { or } from "truth-helpers";+import icon from "discourse/helpers/d-icon";+import discourseTag from "discourse/helpers/discourse-tag";++const Tag = <template>+ {{icon "tag"}}+ {{discourseTag (or @result.id @result) tagName="span"}}+</template>;+export default Tag;diff --git a/app/assets/javascripts/discourse/app/components/search-menu/results/type/topic.gjs b/app/assets/javascripts/discourse/app/components/search-menu/results/type/topic.gjsindex 10ff6ed35ee..d97c5f79a47 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/results/type/topic.gjs+++ b/app/assets/javascripts/discourse/app/components/search-menu/results/type/topic.gjs@@ -1,43 +1,58 @@import Component from "@glimmer/component";+import { hash } from "@ember/helper";import { service } from "@ember/service";+import { htmlSafe } from "@ember/template";+import { and } from "truth-helpers";+import PluginOutlet from "discourse/components/plugin-outlet";+import HighlightedSearch from "discourse/components/search-menu/highlighted-search";+import Blurb from "discourse/components/search-menu/results/blurb";+import TopicStatus from "discourse/components/topic-status";+import categoryLink from "discourse/helpers/category-link";+import discourseTags from "discourse/helpers/discourse-tags";+import replaceEmoji from "discourse/helpers/replace-emoji";export default class Results extends Component {@service siteSettings;-}-<span class="topic">- <span class="first-line">- <TopicStatus- @topic={{@result.topic}}- @disableActions={{true}}- @context="topic-view-title"- />- <span class="topic-title" data-topic-id={{@result.topic.id}}>- {{#if- (and- this.siteSettings.use_pg_headlines_for_excerpt- @result.topic_title_headline- )- }}- <a href={{if @withTopicUrl @result.url}}>- {{replace-emoji (html-safe @result.topic_title_headline)}}- </a>- {{else}}- <a href={{if @withTopicUrl @result.url}}>- <SearchMenu::HighlightedSearch @string={{@result.topic.fancyTitle}} />- </a>- {{/if}}- <PluginOutlet- @name="search-menu-results-topic-title-suffix"- @outletArgs={{hash [email protected]}}- />+ <template>+ <span class="topic">+ <span class="first-line">+ <TopicStatus+ @topic={{@result.topic}}+ @disableActions={{true}}+ @context="topic-view-title"+ />+ <span class="topic-title" data-topic-id={{@result.topic.id}}>+ {{#if+ (and+ this.siteSettings.use_pg_headlines_for_excerpt+ @result.topic_title_headline+ )+ }}+ <a href={{if @withTopicUrl @result.url}}>+ {{replaceEmoji (htmlSafe @result.topic_title_headline)}}+ </a>+ {{else}}+ <a href={{if @withTopicUrl @result.url}}>+ <HighlightedSearch @string={{@result.topic.fancyTitle}} />+ </a>+ {{/if}}+ <PluginOutlet+ @name="search-menu-results-topic-title-suffix"+ @outletArgs={{hash [email protected]}}+ />+ </span>+ </span>+ <span class="second-line">+ {{categoryLink+ @result.topic.category+ link=(if @withTopicUrl true false)+ }}+ {{#if this.siteSettings.tagging_enabled}}+ {{discourseTags @result.topic tagName="span"}}+ {{/if}}+ </span></span>- </span>- <span class="second-line">- {{category-link @result.topic.category link=(if @withTopicUrl true false)}}- {{#if this.siteSettings.tagging_enabled}}- {{discourse-tags @result.topic tagName="span"}}- {{/if}}- </span>-</span>-<SearchMenu::Results::Blurb @result={{@result}} />\ No newline at end of file+ <Blurb @result={{@result}} />+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/search-menu/results/type/user.gjs b/app/assets/javascripts/discourse/app/components/search-menu/results/type/user.gjsindex d6a9a070ad3..777680c336f 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/results/type/user.gjs+++ b/app/assets/javascripts/discourse/app/components/search-menu/results/type/user.gjs@@ -1,19 +1,26 @@-{{avatar- @result- imageSize="small"- [email protected]_template-}}-<div class="user-titles">- {{#if (and @displayNameWithUser @result.name)}}- <span class="name">{{@result.name}}</span>- {{/if}}- <span class="username">- {{format-username @result.username}}- </span>- {{#if @result.custom_data}}- {{#each @result.custom_data as |row|}}- <span class="custom-field">{{row.name}}: {{row.value}}</span>- {{/each}}- {{/if}}-</div>\ No newline at end of file+import { and } from "truth-helpers";+import avatar from "discourse/helpers/avatar";+import formatUsername from "discourse/helpers/format-username";++const User = <template>+ {{avatar+ @result+ imageSize="small"+ [email protected]_template+ }}+ <div class="user-titles">+ {{#if (and @displayNameWithUser @result.name)}}+ <span class="name">{{@result.name}}</span>+ {{/if}}+ <span class="username">+ {{formatUsername @result.username}}+ </span>+ {{#if @result.custom_data}}+ {{#each @result.custom_data as |row|}}+ <span class="custom-field">{{row.name}}: {{row.value}}</span>+ {{/each}}+ {{/if}}+ </div>+</template>;+export default User;diff --git a/app/assets/javascripts/discourse/app/components/search-menu/results/types.gjs b/app/assets/javascripts/discourse/app/components/search-menu/results/types.gjsindex e468bab3e80..4edbf0d8f9c 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/results/types.gjs+++ b/app/assets/javascripts/discourse/app/components/search-menu/results/types.gjs@@ -1,9 +1,14 @@import Component from "@glimmer/component";+import { concat, fn, hash } from "@ember/helper";+import { on } from "@ember/modifier";import { action } from "@ember/object";import { service } from "@ember/service";+import { or } from "truth-helpers";+import PluginOutlet from "discourse/components/plugin-outlet";import { wantsNewWindow } from "discourse/lib/intercept-click";import { logSearchLinkClick } from "discourse/lib/search";import DiscourseURL from "discourse/lib/url";+import { i18n } from "discourse-i18n";export default class Types extends Component {@service search;@@ -65,43 +70,45 @@ export default class Types extends Component {DiscourseURL.routeTo(href);this.args.closeSearchMenu();}-}-{{#each this.filteredResultTypes as |resultType|}}- <div class={{resultType.componentName}}>- <PluginOutlet- @name="search-menu-results-type-top"- @outletArgs={{hash resultType=resultType}}- />- <ul- class="list"- aria-label={{concat (i18n "search.results") " " resultType.type}}- >- {{#each resultType.results as |result|}}- {{! template-lint-disable no-pointer-down-event-binding }}- {{! template-lint-disable no-invalid-interactive }}- <li- class="item"- {{on- "keydown"- (fn this.onKeydown (hash resultType=resultType result=result))- }}+ <template>+ {{#each this.filteredResultTypes as |resultType|}}+ <div class={{resultType.componentName}}>+ <PluginOutlet+ @name="search-menu-results-type-top"+ @outletArgs={{hash resultType=resultType}}+ />+ <ul+ class="list"+ aria-label={{concat (i18n "search.results") " " resultType.type}}>- <a- href={{or result.url result.path}}- {{on- "click"- (fn this.onClick (hash resultType=resultType result=result))- }}- class="search-link"- >- <resultType.component- @result={{result}}- @displayNameWithUser={{@displayNameWithUser}}- />- </a>- </li>- {{/each}}- </ul>- </div>-{{/each}}\ No newline at end of file+ {{#each resultType.results as |result|}}+ {{! template-lint-disable no-pointer-down-event-binding }}+ {{! template-lint-disable no-invalid-interactive }}+ <li+ class="item"+ {{on+ "keydown"+ (fn this.onKeydown (hash resultType=resultType result=result))+ }}+ >+ <a+ href={{or result.url result.path}}+ {{on+ "click"+ (fn this.onClick (hash resultType=resultType result=result))+ }}+ class="search-link"+ >+ <resultType.component+ @result={{result}}+ @displayNameWithUser={{@displayNameWithUser}}+ />+ </a>+ </li>+ {{/each}}+ </ul>+ </div>+ {{/each}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/search-menu/search-term.gjs b/app/assets/javascripts/discourse/app/components/search-menu/search-term.gjsindex c91f8b7ed72..bd6eb1f362e 100644--- a/app/assets/javascripts/discourse/app/components/search-menu/search-term.gjs+++ b/app/assets/javascripts/discourse/app/components/search-menu/search-term.gjs@@ -1,12 +1,15 @@import Component from "@glimmer/component";import { tracked } from "@glimmer/tracking";+import { on } from "@ember/modifier";import { action } from "@ember/object";+import didInsert from "@ember/render-modifiers/modifiers/did-insert";import { service } from "@ember/service";import {DEFAULT_TYPE_FILTER,SEARCH_INPUT_ID,} from "discourse/components/search-menu";import { isiPad } from "discourse/lib/utilities";+import { i18n } from "discourse-i18n";const SECOND_ENTER_MAX_DELAY = 15000;@@ -114,19 +117,21 @@ export default class SearchTerm extends Component {this.args.searchTermChanged(parsedVal);}}-}-<input- id={{this.inputId}}- type="search"- autocomplete="off"- enterkeyhint="search"- value={{this.search.activeGlobalSearchTerm}}- placeholder={{i18n "search.title"}}- aria-label={{i18n "search.title"}}- {{on "keyup" this.onKeyup}}- {{on "keydown" this.onKeydown}}- {{on "input" this.updateSearchTerm}}- {{on "focus" @openSearchMenu}}- {{did-insert this.focus}}-/>\ No newline at end of file+ <template>+ <input+ id={{this.inputId}}+ type="search"+ autocomplete="off"+ enterkeyhint="search"+ value={{this.search.activeGlobalSearchTerm}}+ placeholder={{i18n "search.title"}}+ aria-label={{i18n "search.title"}}+ {{on "keyup" this.onKeyup}}+ {{on "keydown" this.onKeydown}}+ {{on "input" this.updateSearchTerm}}+ {{on "focus" @openSearchMenu}}+ {{didInsert this.focus}}+ />+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/search-result-entries.gjs b/app/assets/javascripts/discourse/app/components/search-result-entries.gjsindex ae002c3d8db..fc5d888639b 100644--- a/app/assets/javascripts/discourse/app/components/search-result-entries.gjs+++ b/app/assets/javascripts/discourse/app/components/search-result-entries.gjs@@ -1,17 +1,20 @@import Component from "@ember/component";import { tagName } from "@ember-decorators/component";+import SearchResultEntry from "discourse/components/search-result-entry";@tagName("")-export default class SearchResultEntries extends Component {}--<div class="fps-result-entries" role="list">- {{#each this.posts as |post|}}- <SearchResultEntry- @post={{post}}- @bulkSelectEnabled={{this.bulkSelectEnabled}}- @selected={{this.selected}}- @highlightQuery={{this.highlightQuery}}- @searchLogId={{this.searchLogId}}- />- {{/each}}-</div>\ No newline at end of file+export default class SearchResultEntries extends Component {+ <template>+ <div class="fps-result-entries" role="list">+ {{#each this.posts as |post|}}+ <SearchResultEntry+ @post={{post}}+ @bulkSelectEnabled={{this.bulkSelectEnabled}}+ @selected={{this.selected}}+ @highlightQuery={{this.highlightQuery}}+ @searchLogId={{this.searchLogId}}+ />+ {{/each}}+ </div>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/search-result-entry.gjs b/app/assets/javascripts/discourse/app/components/search-result-entry.gjsindex ed204d39af5..b02e39dfb93 100644--- a/app/assets/javascripts/discourse/app/components/search-result-entry.gjs+++ b/app/assets/javascripts/discourse/app/components/search-result-entry.gjs@@ -1,11 +1,23 @@import Component from "@ember/component";+import { fn, hash } from "@ember/helper";+import { on } from "@ember/modifier";import { action } from "@ember/object";+import { htmlSafe } from "@ember/template";import {attributeBindings,classNameBindings,classNames,tagName,} from "@ember-decorators/component";+import HighlightSearch from "discourse/components/highlight-search";+import PluginOutlet from "discourse/components/plugin-outlet";+import TrackSelected from "discourse/components/track-selected";+import avatar from "discourse/helpers/avatar";+import categoryLink from "discourse/helpers/category-link";+import icon from "discourse/helpers/d-icon";+import discourseTags from "discourse/helpers/discourse-tags";+import formatDate from "discourse/helpers/format-date";+import raw from "discourse/helpers/raw";import { wantsNewWindow } from "discourse/lib/intercept-click";import { logSearchLinkClick } from "discourse/lib/search";@@ -31,109 +43,115 @@ export default class SearchResultEntry extends Component {});}}-}--<PluginOutlet- @name="search-results-topic-avatar-wrapper"- @outletArgs={{hash post=this.post}}->- <div class="author">- <a href={{this.post.userPath}} data-user-card={{this.post.username}}>- {{avatar this.post imageSize="large"}}- </a>- </div>-</PluginOutlet>+ <template>+ <PluginOutlet+ @name="search-results-topic-avatar-wrapper"+ @outletArgs={{hash post=this.post}}+ >+ <div class="author">+ <a href={{this.post.userPath}} data-user-card={{this.post.username}}>+ {{avatar this.post imageSize="large"}}+ </a>+ </div>-<div class="fps-topic" data-topic-id={{this.post.topic.id}}>- <div class="topic">+ </PluginOutlet>- {{#if this.bulkSelectEnabled}}- <TrackSelected- @selectedList={{this.selected}}- @selectedId={{this.post.topic}}- class="bulk-select"- />- {{/if}}+ <div class="fps-topic" data-topic-id={{this.post.topic.id}}>+ <div class="topic">- <a- href={{this.post.url}}- {{on "click" (fn this.logClick this.post.topic_id)}}- class="search-link{{if this.post.topic.visited ' visited'}}"- role="heading"- aria-level="2"- >- {{raw "topic-status" topic=this.post.topic showPrivateMessageIcon=true}}- <span class="topic-title">- {{#if this.post.useTopicTitleHeadline}}- {{html-safe this.post.topicTitleHeadline}}- {{else}}- <HighlightSearch @highlight={{this.highlightQuery}}>- {{html-safe this.post.topic.fancyTitle}}- </HighlightSearch>+ {{#if this.bulkSelectEnabled}}+ <TrackSelected+ @selectedList={{this.selected}}+ @selectedId={{this.post.topic}}+ class="bulk-select"+ />{{/if}}- </span>- <PluginOutlet- @name="search-results-topic-title-suffix"- @outletArgs={{hash topic=this.post.topic}}- />- </a>- <div class="search-category">- {{#if this.post.topic.category.parentCategory}}- {{category-link this.post.topic.category.parentCategory}}- {{/if}}- {{category-link this.post.topic.category hideParent=true}}- {{#if this.post.topic}}- {{discourse-tags this.post.topic}}- {{/if}}- <span>- <PluginOutlet- @name="full-page-search-category"- @connectorTagName="div"- @outletArgs={{hash post=this.post}}- />- </span>- </div>- </div>+ <a+ href={{this.post.url}}+ {{on "click" (fn this.logClick this.post.topic_id)}}+ class="search-link{{if this.post.topic.visited ' visited'}}"+ role="heading"+ aria-level="2"+ >+ {{raw+ "topic-status"+ topic=this.post.topic+ showPrivateMessageIcon=true+ }}+ <span class="topic-title">+ {{#if this.post.useTopicTitleHeadline}}+ {{htmlSafe this.post.topicTitleHeadline}}+ {{else}}+ <HighlightSearch @highlight={{this.highlightQuery}}>+ {{htmlSafe this.post.topic.fancyTitle}}+ </HighlightSearch>+ {{/if}}+ </span>+ <PluginOutlet+ @name="search-results-topic-title-suffix"+ @outletArgs={{hash topic=this.post.topic}}+ />+ </a>- <PluginOutlet- @name="search-result-entry-blurb-wrapper"- @outletArgs={{hash post=this.post logClick=this.logClick}}- >- <div class="blurb container">- <span class="date">- {{format-date this.post.created_at format="tiny"}}- {{#if this.post.blurb}}- <span class="separator">-</span>- {{/if}}- </span>+ <div class="search-category">+ {{#if this.post.topic.category.parentCategory}}+ {{categoryLink this.post.topic.category.parentCategory}}+ {{/if}}+ {{categoryLink this.post.topic.category hideParent=true}}+ {{#if this.post.topic}}+ {{discourseTags this.post.topic}}+ {{/if}}+ <span>+ <PluginOutlet+ @name="full-page-search-category"+ @connectorTagName="div"+ @outletArgs={{hash post=this.post}}+ />+ </span>+ </div>+ </div>- {{#if this.post.blurb}}- {{#if this.siteSettings.use_pg_headlines_for_excerpt}}- {{html-safe this.post.blurb}}- {{else}}- <HighlightSearch @highlight={{this.highlightQuery}}>- {{html-safe this.post.blurb}}- </HighlightSearch>+ <PluginOutlet+ @name="search-result-entry-blurb-wrapper"+ @outletArgs={{hash post=this.post logClick=this.logClick}}+ >+ <div class="blurb container">+ <span class="date">+ {{formatDate this.post.created_at format="tiny"}}+ {{#if this.post.blurb}}+ <span class="separator">-</span>+ {{/if}}+ </span>++ {{#if this.post.blurb}}+ {{#if this.siteSettings.use_pg_headlines_for_excerpt}}+ {{htmlSafe this.post.blurb}}+ {{else}}+ <HighlightSearch @highlight={{this.highlightQuery}}>+ {{htmlSafe this.post.blurb}}+ </HighlightSearch>+ {{/if}}+ {{/if}}+ </div>+ </PluginOutlet>++ <PluginOutlet+ @name="search-result-entry-stats-wrapper"+ @outletArgs={{hash post=this.post}}+ >+ {{#if this.showLikeCount}}+ {{#if this.post.like_count}}+ <span class="like-count">+ <span class="value">{{this.post.like_count}}</span>+ {{icon "heart"}}+ </span>+ {{/if}}{{/if}}- {{/if}}+ </PluginOutlet></div>- </PluginOutlet>-- <PluginOutlet- @name="search-result-entry-stats-wrapper"- @outletArgs={{hash post=this.post}}- >- {{#if this.showLikeCount}}- {{#if this.post.like_count}}- <span class="like-count">- <span class="value">{{this.post.like_count}}</span>- {{d-icon "heart"}}- </span>- {{/if}}- {{/if}}- </PluginOutlet>-</div>-<PluginOutlet @name="after-search-result-entry" />\ No newline at end of file+ <PluginOutlet @name="after-search-result-entry" />+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/second-factor-form.gjs b/app/assets/javascripts/discourse/app/components/second-factor-form.gjsindex 2f6924b4db7..dd0dffa4e5e 100644--- a/app/assets/javascripts/discourse/app/components/second-factor-form.gjs+++ b/app/assets/javascripts/discourse/app/components/second-factor-form.gjs@@ -1,5 +1,7 @@import Component from "@ember/component";+import { on } from "@ember/modifier";import { action } from "@ember/object";+import { htmlSafe } from "@ember/template";import discourseComputed from "discourse/lib/decorators";import { SECOND_FACTOR_METHODS } from "discourse/models/user";import { i18n } from "discourse-i18n";@@ -62,26 +64,28 @@ export default class SecondFactorForm extends Component {this.set("secondFactorMethod", SECOND_FACTOR_METHODS.TOTP);}}-}-<div id="second-factor">- <h3>{{this.secondFactorTitle}}</h3>+ <template>+ <div id="second-factor">+ <h3>{{this.secondFactorTitle}}</h3>- {{#if this.optionalText}}- <p>{{html-safe this.optionalText}}</p>- {{/if}}+ {{#if this.optionalText}}+ <p>{{htmlSafe this.optionalText}}</p>+ {{/if}}- <p class="second-factor__description">{{this.secondFactorDescription}}</p>+ <p class="second-factor__description">{{this.secondFactorDescription}}</p>- {{yield}}+ {{yield}}- {{#if this.showToggleMethodLink}}- <p>- <a- href- class="toggle-second-factor-method"- {{on "click" this.toggleSecondFactorMethod}}- >{{i18n this.linkText}}</a>- </p>- {{/if}}-</div>\ No newline at end of file+ {{#if this.showToggleMethodLink}}+ <p>+ <a+ href+ class="toggle-second-factor-method"+ {{on "click" this.toggleSecondFactorMethod}}+ >{{i18n this.linkText}}</a>+ </p>+ {{/if}}+ </div>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/selected-posts.gjs b/app/assets/javascripts/discourse/app/components/selected-posts.gjsindex 061fd729ba0..af0a065146e 100644--- a/app/assets/javascripts/discourse/app/components/selected-posts.gjs+++ b/app/assets/javascripts/discourse/app/components/selected-posts.gjs@@ -1,68 +1,75 @@import Component from "@ember/component";+import { on } from "@ember/modifier";+import CountI18n from "discourse/components/count-i18n";+import DButton from "discourse/components/d-button";+import routeAction from "discourse/helpers/route-action";+import { i18n } from "discourse-i18n";-export default class SelectedPosts extends Component {}+export default class SelectedPosts extends Component {+ <template>+ <p>+ <CountI18n+ @key="topic.multi_select.description"+ @count={{this.selectedPostsCount}}+ />+ </p>-<p>- <CountI18n- @key="topic.multi_select.description"- @count={{this.selectedPostsCount}}- />-</p>+ {{#if this.canSelectAll}}+ <p>+ <a class="select-all" href {{on "click" this.selectAll}}>+ {{i18n "topic.multi_select.select_all"}}+ </a>+ </p>+ {{/if}}-{{#if this.canSelectAll}}- <p>- <a class="select-all" href {{on "click" this.selectAll}}>- {{i18n "topic.multi_select.select_all"}}- </a>- </p>-{{/if}}+ {{#if this.canDeselectAll}}+ <p>+ <a href {{on "click" this.deselectAll}}>+ {{i18n "topic.multi_select.deselect_all"}}+ </a>+ </p>+ {{/if}}-{{#if this.canDeselectAll}}- <p>- <a href {{on "click" this.deselectAll}}>- {{i18n "topic.multi_select.deselect_all"}}- </a>- </p>-{{/if}}+ {{#if this.canDeleteSelected}}+ <DButton+ @action={{this.deleteSelected}}+ @icon="trash-can"+ @label="topic.multi_select.delete"+ class="btn-danger"+ />+ {{/if}}-{{#if this.canDeleteSelected}}- <DButton- @action={{this.deleteSelected}}- @icon="trash-can"- @label="topic.multi_select.delete"- class="btn-danger"- />-{{/if}}+ {{#if this.canMergeTopic}}+ <DButton+ @action={{routeAction "moveToTopic"}}+ @icon="right-from-bracket"+ @label="topic.move_to.action"+ class="btn-primary move-to-topic"+ />+ {{/if}}-{{#if this.canMergeTopic}}- <DButton- @action={{route-action "moveToTopic"}}- @icon="right-from-bracket"- @label="topic.move_to.action"- class="btn-primary move-to-topic"- />-{{/if}}+ {{#if this.canChangeOwner}}+ <DButton+ @action={{routeAction "changeOwner"}}+ @icon="user"+ @label="topic.change_owner.action"+ class="btn-primary"+ />+ {{/if}}-{{#if this.canChangeOwner}}- <DButton- @action={{route-action "changeOwner"}}- @icon="user"- @label="topic.change_owner.action"- class="btn-primary"- />-{{/if}}+ {{#if this.canMergePosts}}+ <DButton+ @action={{this.mergePosts}}+ @icon="up-down"+ @label="topic.merge_posts.action"+ class="btn-primary"+ />+ {{/if}}-{{#if this.canMergePosts}}- <DButton- @action={{this.mergePosts}}- @icon="up-down"- @label="topic.merge_posts.action"- class="btn-primary"- />-{{/if}}--<p class="cancel">- <a href {{on "click" this.toggleMultiSelect}}>- {{i18n "topic.multi_select.cancel"}}- </a>-</p>\ No newline at end of file+ <p class="cancel">+ <a href {{on "click" this.toggleMultiSelect}}>+ {{i18n "topic.multi_select.cancel"}}+ </a>+ </p>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/share-panel.gjs b/app/assets/javascripts/discourse/app/components/share-panel.gjsindex 5ab5dfe19eb..0c42e000fcb 100644--- a/app/assets/javascripts/discourse/app/components/share-panel.gjs+++ b/app/assets/javascripts/discourse/app/components/share-panel.gjs@@ -1,7 +1,10 @@import Component from "@ember/component";import { action } from "@ember/object";import { alias } from "@ember/object/computed";+import { htmlSafe } from "@ember/template";import { isEmpty } from "@ember/utils";+import DTextarea from "discourse/components/d-textarea";+import ShareSource from "discourse/components/share-source";import discourseComputed from "discourse/lib/decorators";import discourseLater from "discourse/lib/later";import Sharing from "discourse/lib/sharing";@@ -67,22 +70,24 @@ export default class SharePanel extends Component {title: this.topic.get("title"),});}-}-<div class="header">- <h3 class="title">{{html-safe this.shareTitle}}</h3>-</div>+ <template>+ <div class="header">+ <h3 class="title">{{htmlSafe this.shareTitle}}</h3>+ </div>-<div class="body">- <DTextarea- @value={{this.shareUrl}}- @aria-label={{i18n "share.url"}}- class="topic-share-url"- />+ <div class="body">+ <DTextarea+ @value={{this.shareUrl}}+ @aria-label={{i18n "share.url"}}+ class="topic-share-url"+ />- <div class="sources">- {{#each this.sources as |source|}}- <ShareSource @source={{source}} @action={{this.share}} />- {{/each}}- </div>-</div>\ No newline at end of file+ <div class="sources">+ {{#each this.sources as |source|}}+ <ShareSource @source={{source}} @action={{this.share}} />+ {{/each}}+ </div>+ </div>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/sidebar.gjs b/app/assets/javascripts/discourse/app/components/sidebar.gjsindex d78a2310e16..1220b0ed059 100644--- a/app/assets/javascripts/discourse/app/components/sidebar.gjs+++ b/app/assets/javascripts/discourse/app/components/sidebar.gjs@@ -1,5 +1,11 @@import Component from "@glimmer/component";import { service } from "@ember/service";+import PluginOutlet from "discourse/components/plugin-outlet";+import ApiPanels from "discourse/components/sidebar/api-panels";+import Footer from "discourse/components/sidebar/footer";+import Sections from "discourse/components/sidebar/sections";+import SwitchPanelButtons from "discourse/components/sidebar/switch-panel-buttons";+import bodyClass from "discourse/helpers/body-class";import { bind } from "discourse/lib/decorators";export default class Sidebar extends Component {@@ -62,35 +68,37 @@ export default class Sidebar extends Component {this.args.toggleSidebar();}}-}--{{body-class "has-sidebar-page"}}--<section id="d-sidebar" class="sidebar-container">- {{#if this.showSwitchPanelButtonsOnTop}}- <Sidebar::SwitchPanelButtons @buttons={{this.switchPanelButtons}} />- {{/if}}-- <PluginOutlet @name="before-sidebar-sections" />- {{#if this.sidebarState.showMainPanel}}- <Sidebar::Sections- @currentUser={{this.currentUser}}- @collapsableSections={{true}}- @panel={{this.sidebarState.currentPanel}}- />- {{else}}- <Sidebar::ApiPanels- @currentUser={{this.currentUser}}- @collapsableSections={{true}}- />- {{/if}}-- <PluginOutlet @name="after-sidebar-sections" />-- {{#unless this.showSwitchPanelButtonsOnTop}}- <Sidebar::SwitchPanelButtons @buttons={{this.switchPanelButtons}} />- {{/unless}}-- <Sidebar::Footer />-</section>\ No newline at end of file+ <template>+ {{bodyClass "has-sidebar-page"}}++ <section id="d-sidebar" class="sidebar-container">+ {{#if this.showSwitchPanelButtonsOnTop}}+ <SwitchPanelButtons @buttons={{this.switchPanelButtons}} />+ {{/if}}++ <PluginOutlet @name="before-sidebar-sections" />++ {{#if this.sidebarState.showMainPanel}}+ <Sections+ @currentUser={{this.currentUser}}+ @collapsableSections={{true}}+ @panel={{this.sidebarState.currentPanel}}+ />+ {{else}}+ <ApiPanels+ @currentUser={{this.currentUser}}+ @collapsableSections={{true}}+ />+ {{/if}}++ <PluginOutlet @name="after-sidebar-sections" />++ {{#unless this.showSwitchPanelButtonsOnTop}}+ <SwitchPanelButtons @buttons={{this.switchPanelButtons}} />+ {{/unless}}++ <Footer />+ </section>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/signup-cta.gjs b/app/assets/javascripts/discourse/app/components/signup-cta.gjsindex aa7030b738d..410066f37fb 100644--- a/app/assets/javascripts/discourse/app/components/signup-cta.gjs+++ b/app/assets/javascripts/discourse/app/components/signup-cta.gjs@@ -1,7 +1,12 @@import Component from "@ember/component";+import { on } from "@ember/modifier";import { action } from "@ember/object";-import { on } from "@ember-decorators/object";+import { on as onEvent } from "@ember-decorators/object";+import DButton from "discourse/components/d-button";+import replaceEmoji from "discourse/helpers/replace-emoji";+import routeAction from "discourse/helpers/route-action";import discourseLater from "discourse/lib/later";+import { i18n } from "discourse-i18n";export default class SignupCta extends Component {action = "showCreateAccount";@@ -20,38 +25,40 @@ export default class SignupCta extends Component {discourseLater(() => this.session.set("showSignupCta", false), 20 * 1000);}- @on("willDestroyElement")+ @onEvent("willDestroyElement")_turnOffIfHidden() {if (this.session.get("hideSignupCta")) {this.session.set("showSignupCta", false);}}-}-<div class="signup-cta alert alert-info">- {{#if this.session.hideSignupCta}}- <h3>- {{i18n "signup_cta.hidden_for_session"}}- </h3>- {{else}}- <h3>{{replace-emoji (i18n "signup_cta.intro")}}</h3>- <p>{{replace-emoji (i18n "signup_cta.value_prop")}}</p>+ <template>+ <div class="signup-cta alert alert-info">+ {{#if this.session.hideSignupCta}}+ <h3>+ {{i18n "signup_cta.hidden_for_session"}}+ </h3>+ {{else}}+ <h3>{{replaceEmoji (i18n "signup_cta.intro")}}</h3>+ <p>{{replaceEmoji (i18n "signup_cta.value_prop")}}</p>- <div class="buttons">- <DButton- @action={{route-action "showCreateAccount"}}- @label="signup_cta.sign_up"- @icon="user"- class="btn-primary"- />- <DButton- @action={{action "hideForSession"}}- @label="signup_cta.hide_session"- class="no-icon"- />- <a href {{on "click" this.neverShow}}>{{i18n- "signup_cta.hide_forever"- }}</a>+ <div class="buttons">+ <DButton+ @action={{routeAction "showCreateAccount"}}+ @label="signup_cta.sign_up"+ @icon="user"+ class="btn-primary"+ />+ <DButton+ @action={{action "hideForSession"}}+ @label="signup_cta.hide_session"+ class="no-icon"+ />+ <a href {{on "click" this.neverShow}}>{{i18n+ "signup_cta.hide_forever"+ }}</a>+ </div>+ {{/if}}</div>- {{/if}}-</div>\ No newline at end of file+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/slow-mode-info.gjs b/app/assets/javascripts/discourse/app/components/slow-mode-info.gjsindex 87a68ede17a..e9a393a6a94 100644--- a/app/assets/javascripts/discourse/app/components/slow-mode-info.gjs+++ b/app/assets/javascripts/discourse/app/components/slow-mode-info.gjs@@ -1,9 +1,12 @@import Component from "@ember/component";import { action } from "@ember/object";+import DButton from "discourse/components/d-button";+import icon from "discourse/helpers/d-icon";import { durationTextFromSeconds } from "discourse/helpers/slow-mode";import { popupAjaxError } from "discourse/lib/ajax-error";import discourseComputed from "discourse/lib/decorators";import Topic from "discourse/models/topic";+import { i18n } from "discourse-i18n";export default class SlowModeInfo extends Component {@discourseComputed("topic.slow_mode_seconds")@@ -22,23 +25,28 @@ export default class SlowModeInfo extends Component {.catch(popupAjaxError).then(() => this.set("topic.slow_mode_seconds", 0));}-}-{{#if this.showSlowModeNotice}}- <div class="topic-status-info">- <h3 class="slow-mode-heading">- <span>- {{d-icon "hourglass-start"}}- {{i18n "topic.slow_mode_notice.duration" duration=this.durationText}}- </span>+ <template>+ {{#if this.showSlowModeNotice}}+ <div class="topic-status-info">+ <h3 class="slow-mode-heading">+ <span>+ {{icon "hourglass-start"}}+ {{i18n+ "topic.slow_mode_notice.duration"+ duration=this.durationText+ }}+ </span>- {{#if this.user.canManageTopic}}- <DButton- @action={{this.disableSlowMode}}- @icon="trash-can"- class="slow-mode-remove"- />- {{/if}}- </h3>- </div>-{{/if}}\ No newline at end of file+ {{#if this.user.canManageTopic}}+ <DButton+ @action={{this.disableSlowMode}}+ @icon="trash-can"+ class="slow-mode-remove"+ />+ {{/if}}+ </h3>+ </div>+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/sub-category-item.gjs b/app/assets/javascripts/discourse/app/components/sub-category-item.gjsindex dccc3796e29..69c2e81f735 100644--- a/app/assets/javascripts/discourse/app/components/sub-category-item.gjs+++ b/app/assets/javascripts/discourse/app/components/sub-category-item.gjs@@ -1,21 +1,26 @@import CategoryListItem from "discourse/components/category-list-item";+import CategoryTitleBefore from "discourse/components/category-title-before";+import CategoryUnread from "discourse/components/category-unread";+import categoryLink from "discourse/helpers/category-link";-export default class SubCategoryItem extends CategoryListItem {}--{{#unless this.isMuted}}- {{#if this.site.mobileView}}- {{category-link this.category}}- {{else}}- <span class="subcategory">- <CategoryTitleBefore @category={{this.category}} />- {{category-link this.category hideParent="true"}}- {{#unless this.hideUnread}}- <CategoryUnread- @category={{this.category}}- @unreadTopicsCount={{this.unreadTopicsCount}}- @newTopicsCount={{this.newTopicsCount}}- />- {{/unless}}- </span>- {{/if}}-{{/unless}}\ No newline at end of file+export default class SubCategoryItem extends CategoryListItem {+ <template>+ {{#unless this.isMuted}}+ {{#if this.site.mobileView}}+ {{categoryLink this.category}}+ {{else}}+ <span class="subcategory">+ <CategoryTitleBefore @category={{this.category}} />+ {{categoryLink this.category hideParent="true"}}+ {{#unless this.hideUnread}}+ <CategoryUnread+ @category={{this.category}}+ @unreadTopicsCount={{this.unreadTopicsCount}}+ @newTopicsCount={{this.newTopicsCount}}+ />+ {{/unless}}+ </span>+ {{/if}}+ {{/unless}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/sub-category-row.gjs b/app/assets/javascripts/discourse/app/components/sub-category-row.gjsindex f0da753d608..b88a6be822b 100644--- a/app/assets/javascripts/discourse/app/components/sub-category-row.gjs+++ b/app/assets/javascripts/discourse/app/components/sub-category-row.gjs@@ -1,63 +1,69 @@import CategoryListItem from "discourse/components/category-list-item";+import CategoryTitleLink from "discourse/components/category-title-link";+import SubCategoryItem from "discourse/components/sub-category-item";+import borderColor from "discourse/helpers/border-color";+import dirSpan from "discourse/helpers/dir-span";-export default class SubCategoryRow extends CategoryListItem {}--{{#unless this.isHidden}}- {{#if this.site.mobileView}}- <tr- data-category-id={{this.category.id}}- style={{border-color this.category.color}}- class="subcategory-list-item category {{if this.isMuted 'muted'}}"- >- <td>- <CategoryTitleLink @tagName="h4" @category={{this.category}} />- <div class="subcategories-list">- {{#if this.category.subcategories}}- <div class="subcategories">- {{#each this.category.subcategories as |subcategory|}}- <SubCategoryItem- @category={{subcategory}}- @listType={{this.listType}}- />- {{/each}}+export default class SubCategoryRow extends CategoryListItem {+ <template>+ {{#unless this.isHidden}}+ {{#if this.site.mobileView}}+ <tr+ data-category-id={{this.category.id}}+ style={{borderColor this.category.color}}+ class="subcategory-list-item category {{if this.isMuted 'muted'}}"+ >+ <td>+ <CategoryTitleLink @tagName="h4" @category={{this.category}} />+ <div class="subcategories-list">+ {{#if this.category.subcategories}}+ <div class="subcategories">+ {{#each this.category.subcategories as |subcategory|}}+ <SubCategoryItem+ @category={{subcategory}}+ @listType={{this.listType}}+ />+ {{/each}}+ </div>+ {{/if}}</div>- {{/if}}- </div>- </td>- </tr>- {{else}}- <tr- data-category-id={{this.category.id}}- data-notification-level={{this.category.notificationLevelString}}- class="{{if- this.category.description_excerpt- 'has-description'- 'no-description'- }}- {{if this.category.uploaded_logo.url 'has-logo' 'no-logo'}}"- >- <td- class="category {{if this.isMuted 'muted'}}"- style={{border-color this.category.color}}- >- <CategoryTitleLink @tagName="h4" @category={{this.category}} />- {{#if this.category.description_excerpt}}- <div class="category-description subcategory-description">- {{dir-span this.category.description_excerpt htmlSafe="true"}}- </div>- {{/if}}- {{#if this.category.subcategories}}- <div class="subcategories">- {{#each this.category.subcategories as |subsubcategory|}}- <SubCategoryItem- @category={{subsubcategory}}- @hideUnread="true"- @listType={{this.listType}}- />- {{/each}}- </div>- {{/if}}- </td>- </tr>- {{/if}}-{{/unless}}\ No newline at end of file+ </td>+ </tr>+ {{else}}+ <tr+ data-category-id={{this.category.id}}+ data-notification-level={{this.category.notificationLevelString}}+ class="{{if+ this.category.description_excerpt+ 'has-description'+ 'no-description'+ }}+ {{if this.category.uploaded_logo.url 'has-logo' 'no-logo'}}"+ >+ <td+ class="category {{if this.isMuted 'muted'}}"+ style={{borderColor this.category.color}}+ >+ <CategoryTitleLink @tagName="h4" @category={{this.category}} />+ {{#if this.category.description_excerpt}}+ <div class="category-description subcategory-description">+ {{dirSpan this.category.description_excerpt htmlSafe="true"}}+ </div>+ {{/if}}+ {{#if this.category.subcategories}}+ <div class="subcategories">+ {{#each this.category.subcategories as |subsubcategory|}}+ <SubCategoryItem+ @category={{subsubcategory}}+ @hideUnread="true"+ @listType={{this.listType}}+ />+ {{/each}}+ </div>+ {{/if}}+ </td>+ </tr>+ {{/if}}+ {{/unless}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/subcategories-with-featured-topics.gjs b/app/assets/javascripts/discourse/app/components/subcategories-with-featured-topics.gjsindex 37a9aee460d..5026ac388da 100644--- a/app/assets/javascripts/discourse/app/components/subcategories-with-featured-topics.gjs+++ b/app/assets/javascripts/discourse/app/components/subcategories-with-featured-topics.gjs@@ -1,57 +1,77 @@import Component from "@ember/component";+import { hash } from "@ember/helper";+import { htmlSafe } from "@ember/template";+import CategoryTitleLink from "discourse/components/category-title-link";+import ParentCategoryRow from "discourse/components/parent-category-row";+import PluginOutlet from "discourse/components/plugin-outlet";+import { i18n } from "discourse-i18n";-export default class SubcategoriesWithFeaturedTopics extends Component {}--{{#each this.categories as |category|}}- {{#if this.site.mobileView}}- <PluginOutlet- @name="mobile-subcategories-with-featured-topics-list"- @outletArgs={{hash category=category}}- >- <div class="category-list subcategory-list with-topics">- <div class="parent-category">- <CategoryTitleLink @category={{category}} />- <span class="stat" title={{category.statTitle}}>{{html-safe- category.stat- }}</span>- </div>- <div class="subcategories">- {{#each category.serializedSubcategories as |subCategory|}}- <ParentCategoryRow @category={{subCategory}} @showTopics={{true}} />- {{else}}- {{! No subcategories... so just show the parent to avoid confusion }}- <ParentCategoryRow @category={{category}} @showTopics={{true}} />- {{/each}}- </div>- </div>- </PluginOutlet>- {{else}}- <PluginOutlet- @name="subcategories-with-featured-topics-list"- @outletArgs={{hash category=category}}- >- <table class="category-list subcategory-list with-topics">- <thead>- <tr>- <th class="parent-category">+export default class SubcategoriesWithFeaturedTopics extends Component {+ <template>+ {{#each this.categories as |category|}}+ {{#if this.site.mobileView}}+ <PluginOutlet+ @name="mobile-subcategories-with-featured-topics-list"+ @outletArgs={{hash category=category}}+ >+ <div class="category-list subcategory-list with-topics">+ <div class="parent-category"><CategoryTitleLink @category={{category}} />- <span class="stat" title={{category.statTitle}}>{{html-safe+ <span class="stat" title={{category.statTitle}}>{{htmlSafecategory.stat}}</span>- </th>- <th class="topics">{{i18n "categories.topics"}}</th>- <th class="latest">{{i18n "categories.latest"}}</th>- </tr>- </thead>- <tbody aria-labelledby="categories-only-category">- {{#each category.serializedSubcategories as |subCategory|}}- <ParentCategoryRow @category={{subCategory}} @showTopics={{true}} />- {{else}}- {{! No subcategories... so just show the parent to avoid confusion }}- <ParentCategoryRow @category={{category}} @showTopics={{true}} />- {{/each}}- </tbody>- </table>- </PluginOutlet>- {{/if}}-{{/each}}\ No newline at end of file+ </div>+ <div class="subcategories">+ {{#each category.serializedSubcategories as |subCategory|}}+ <ParentCategoryRow+ @category={{subCategory}}+ @showTopics={{true}}+ />+ {{else}}+ {{! No subcategories... so just show the parent to avoid confusion }}+ <ParentCategoryRow+ @category={{category}}+ @showTopics={{true}}+ />+ {{/each}}+ </div>+ </div>+ </PluginOutlet>+ {{else}}+ <PluginOutlet+ @name="subcategories-with-featured-topics-list"+ @outletArgs={{hash category=category}}+ >+ <table class="category-list subcategory-list with-topics">+ <thead>+ <tr>+ <th class="parent-category">+ <CategoryTitleLink @category={{category}} />+ <span class="stat" title={{category.statTitle}}>{{htmlSafe+ category.stat+ }}</span>+ </th>+ <th class="topics">{{i18n "categories.topics"}}</th>+ <th class="latest">{{i18n "categories.latest"}}</th>+ </tr>+ </thead>+ <tbody aria-labelledby="categories-only-category">+ {{#each category.serializedSubcategories as |subCategory|}}+ <ParentCategoryRow+ @category={{subCategory}}+ @showTopics={{true}}+ />+ {{else}}+ {{! No subcategories... so just show the parent to avoid confusion }}+ <ParentCategoryRow+ @category={{category}}+ @showTopics={{true}}+ />+ {{/each}}+ </tbody>+ </table>+ </PluginOutlet>+ {{/if}}+ {{/each}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/tag-list.gjs b/app/assets/javascripts/discourse/app/components/tag-list.gjsindex 0d260b3f8ed..f701502ead0 100644--- a/app/assets/javascripts/discourse/app/components/tag-list.gjs+++ b/app/assets/javascripts/discourse/app/components/tag-list.gjs@@ -1,6 +1,9 @@import Component from "@ember/component";import { sort } from "@ember/object/computed";import { classNameBindings } from "@ember-decorators/component";+import CategoryTitleLink from "discourse/components/category-title-link";+import icon from "discourse/helpers/d-icon";+import discourseTag from "discourse/helpers/discourse-tag";import discourseComputed from "discourse/lib/decorators";import Category from "discourse/models/category";import { i18n } from "discourse-i18n";@@ -41,35 +44,37 @@ export default class TagList extends Component {return groupName && `tag-group-${groupName}`;}}-}-{{#if this.title}}- <h3>{{this.title}}</h3>-{{/if}}-{{#if this.category}}- <CategoryTitleLink @category={{this.category}} />-{{/if}}-{{#if this.tagGroupName}}- <h3>{{this.tagGroupName}}</h3>-{{/if}}-{{#each this.sortedTags as |tag|}}- <div class="tag-box">- {{discourse-tag- tag.id- description=tag.description- isPrivateMessage=this.isPrivateMessage- pmOnly=tag.pmOnly- tagsForUser=this.tagsForUser- }}- {{#if tag.pmOnly}}- {{d-icon "envelope"}}+ <template>+ {{#if this.title}}+ <h3>{{this.title}}</h3>+ {{/if}}+ {{#if this.category}}+ <CategoryTitleLink @category={{this.category}} />{{/if}}- {{#if tag.totalCount}}- <span class="tag-count">- x- {{tag.totalCount}}- </span>+ {{#if this.tagGroupName}}+ <h3>{{this.tagGroupName}}</h3>{{/if}}- </div>-{{/each}}-<div class="clearfix"></div>\ No newline at end of file+ {{#each this.sortedTags as |tag|}}+ <div class="tag-box">+ {{discourseTag+ tag.id+ description=tag.description+ isPrivateMessage=this.isPrivateMessage+ pmOnly=tag.pmOnly+ tagsForUser=this.tagsForUser+ }}+ {{#if tag.pmOnly}}+ {{icon "envelope"}}+ {{/if}}+ {{#if tag.totalCount}}+ <span class="tag-count">+ x+ {{tag.totalCount}}+ </span>+ {{/if}}+ </div>+ {{/each}}+ <div class="clearfix"></div>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/tap-tile-grid.gjs b/app/assets/javascripts/discourse/app/components/tap-tile-grid.gjsindex 3921a118344..5d3f45781ac 100644--- a/app/assets/javascripts/discourse/app/components/tap-tile-grid.gjs+++ b/app/assets/javascripts/discourse/app/components/tap-tile-grid.gjs@@ -1,9 +1,10 @@import Component from "@ember/component";+import { hash } from "@ember/helper";import { classNames } from "@ember-decorators/component";@classNames("tap-tile-grid")export default class TapTileGrid extends Component {activeTile = null;-}-{{yield (hash activeTile=this.activeTile)}}\ No newline at end of file+ <template>{{yield (hash activeTile=this.activeTile)}}</template>+}diff --git a/app/assets/javascripts/discourse/app/components/tap-tile.gjs b/app/assets/javascripts/discourse/app/components/tap-tile.gjsindex 771ee0d1346..db27517b103 100644--- a/app/assets/javascripts/discourse/app/components/tap-tile.gjs+++ b/app/assets/javascripts/discourse/app/components/tap-tile.gjs@@ -5,6 +5,7 @@ import {classNameBindings,classNames,} from "@ember-decorators/component";+import icon from "discourse/helpers/d-icon";import { propertyEqual } from "discourse/lib/computed";@classNames("tap-tile")@@ -32,9 +33,11 @@ export default class TapTile extends Component {this.onChange(this.tileId);}}-}-{{#if this.icon}}- {{d-icon this.icon}}-{{/if}}-{{yield}}\ No newline at end of file+ <template>+ {{#if this.icon}}+ {{icon this.icon}}+ {{/if}}+ {{yield}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/time-shortcut-picker.gjs b/app/assets/javascripts/discourse/app/components/time-shortcut-picker.gjsindex a35de08bb81..e1dad3daafc 100644--- a/app/assets/javascripts/discourse/app/components/time-shortcut-picker.gjs+++ b/app/assets/javascripts/discourse/app/components/time-shortcut-picker.gjs@@ -1,8 +1,14 @@-import Component from "@ember/component";+import Component, { Input } from "@ember/component";+import { fn } from "@ember/helper";import { action } from "@ember/object";import { and, equal } from "@ember/object/computed";import { tagName } from "@ember-decorators/component";import { observes, on } from "@ember-decorators/object";+import DatePickerFuture from "discourse/components/date-picker-future";+import RelativeTimePicker from "discourse/components/relative-time-picker";+import TapTile from "discourse/components/tap-tile";+import TapTileGrid from "discourse/components/tap-tile-grid";+import icon from "discourse/helpers/d-icon";import discourseComputed from "discourse/lib/decorators";import {defaultTimeShortcuts,@@ -279,56 +285,60 @@ export default class TimeShortcutPicker extends Component {_defaultCustomDateTime() {return moment.tz(this.userTimezone).add(1, "hour");}-}-<TapTileGrid @activeTile={{this.selectedShortcut}} as |grid|>- {{#each this.options key="id" as |option|}}- {{#unless option.hidden}}- <TapTile- @tileId={{option.id}}- @activeTile={{grid.activeTile}}- @onChange={{action "selectShortcut"}}- >-- <div class="tap-tile-title">{{i18n option.label}}</div>- <div class="tap-tile-date">{{option.timeFormatted}}</div>- </TapTile>- {{/unless}}-- {{#if option.isCustomTimeShortcut}}- {{#if this.customDatetimeSelected}}- <div class="control-group custom-date-time-wrap custom-input-wrap">- <div class="tap-tile-date-input">- {{d-icon "calendar-days"}}- <DatePickerFuture- @value={{this.customDate}}- @defaultDate={{this.defaultCustomDate}}- @onSelect={{fn (mut this.customDate)}}- @id="custom-date"- />- </div>- <div class="tap-tile-time-input">- {{d-icon "far-clock"}}- <Input- placeholder="--:--"- id="custom-time"- @type="time"- class="time-input"- @value={{this.customTime}}- />- </div>- </div>- <div class="control-group custom-date-time-wrap custom-relative-wrap">- <label class="control-label" for="bookmark-relative-time-picker">- {{i18n "relative_time_picker.relative"}}- </label>- <RelativeTimePicker- @durationMinutes={{this.selectedDurationMins}}- @onChange={{this.relativeTimeChanged}}- id="bookmark-relative-time-picker"- />- </div>- {{/if}}- {{/if}}- {{/each}}-</TapTileGrid>\ No newline at end of file+ <template>+ <TapTileGrid @activeTile={{this.selectedShortcut}} as |grid|>+ {{#each this.options key="id" as |option|}}+ {{#unless option.hidden}}+ <TapTile+ @tileId={{option.id}}+ @activeTile={{grid.activeTile}}+ @onChange={{action "selectShortcut"}}+ >++ <div class="tap-tile-title">{{i18n option.label}}</div>+ <div class="tap-tile-date">{{option.timeFormatted}}</div>+ </TapTile>+ {{/unless}}++ {{#if option.isCustomTimeShortcut}}+ {{#if this.customDatetimeSelected}}+ <div class="control-group custom-date-time-wrap custom-input-wrap">+ <div class="tap-tile-date-input">+ {{icon "calendar-days"}}+ <DatePickerFuture+ @value={{this.customDate}}+ @defaultDate={{this.defaultCustomDate}}+ @onSelect={{fn (mut this.customDate)}}+ @id="custom-date"+ />+ </div>+ <div class="tap-tile-time-input">+ {{icon "far-clock"}}+ <Input+ placeholder="--:--"+ id="custom-time"+ @type="time"+ class="time-input"+ @value={{this.customTime}}+ />+ </div>+ </div>+ <div+ class="control-group custom-date-time-wrap custom-relative-wrap"+ >+ <label class="control-label" for="bookmark-relative-time-picker">+ {{i18n "relative_time_picker.relative"}}+ </label>+ <RelativeTimePicker+ @durationMinutes={{this.selectedDurationMins}}+ @onChange={{this.relativeTimeChanged}}+ id="bookmark-relative-time-picker"+ />+ </div>+ {{/if}}+ {{/if}}+ {{/each}}+ </TapTileGrid>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/toggle-password-mask.gjs b/app/assets/javascripts/discourse/app/components/toggle-password-mask.gjsindex d6d62d82243..5615bbdd150 100644--- a/app/assets/javascripts/discourse/app/components/toggle-password-mask.gjs+++ b/app/assets/javascripts/discourse/app/components/toggle-password-mask.gjs@@ -1,10 +1,15 @@-<DButton- @action={{@togglePasswordMask}}- @icon={{if @maskPassword "far-eye" "far-eye-slash"}}- @title={{if- @maskPassword- "login.show_password_title"- "login.hide_password_title"- }}- class="btn-transparent toggle-password-mask"-/>\ No newline at end of file+import DButton from "discourse/components/d-button";++const TogglePasswordMask = <template>+ <DButton+ @action={{@togglePasswordMask}}+ @icon={{if @maskPassword "far-eye" "far-eye-slash"}}+ @title={{if+ @maskPassword+ "login.show_password_title"+ "login.hide_password_title"+ }}+ class="btn-transparent toggle-password-mask"+ />+</template>;+export default TogglePasswordMask;diff --git a/app/assets/javascripts/discourse/app/components/top-period-buttons.gjs b/app/assets/javascripts/discourse/app/components/top-period-buttons.gjsindex 8fe2500bfb6..dad698a7156 100644--- a/app/assets/javascripts/discourse/app/components/top-period-buttons.gjs+++ b/app/assets/javascripts/discourse/app/components/top-period-buttons.gjs@@ -1,6 +1,9 @@import Component from "@ember/component";+import { fn } from "@ember/helper";import { action } from "@ember/object";import { classNames } from "@ember-decorators/component";+import DButton from "discourse/components/d-button";+import periodTitle from "discourse/helpers/period-title";import discourseComputed from "discourse/lib/decorators";@classNames("top-title-buttons")@@ -14,12 +17,14 @@ export default class TopPeriodButtons extends Component {changePeriod(p) {this.action(p);}-}-{{#each this.periods as |p|}}- <DButton- @action={{fn this.changePeriod p}}- @translatedLabel={{period-title p}}- class="btn-default"- />-{{/each}}\ No newline at end of file+ <template>+ {{#each this.periods as |p|}}+ <DButton+ @action={{fn this.changePeriod p}}+ @translatedLabel={{periodTitle p}}+ class="btn-default"+ />+ {{/each}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/topic-category.gjs b/app/assets/javascripts/discourse/app/components/topic-category.gjsindex 332e8179ae3..890c8914e30 100644--- a/app/assets/javascripts/discourse/app/components/topic-category.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-category.gjs@@ -1,30 +1,37 @@import Component from "@ember/component";+import { hash } from "@ember/helper";+import PluginOutlet from "discourse/components/plugin-outlet";+import boundCategoryLink from "discourse/helpers/bound-category-link";+import discourseTags from "discourse/helpers/discourse-tags";+import topicFeaturedLink from "discourse/helpers/topic-featured-link";// Injections don't occur without a class-export default class TopicCategory extends Component {}--{{#unless this.topic.isPrivateMessage}}- {{bound-category-link- this.topic.category- ancestors=this.topic.category.predecessors- hideParent=true- }}-{{/unless}}-<div class="topic-header-extra">- {{#if this.siteSettings.tagging_enabled}}- <div class="list-tags">- {{discourse-tags this.topic mode="list" tags=this.topic.tags}}+export default class TopicCategory extends Component {+ <template>+ {{#unless this.topic.isPrivateMessage}}+ {{boundCategoryLink+ this.topic.category+ ancestors=this.topic.category.predecessors+ hideParent=true+ }}+ {{/unless}}+ <div class="topic-header-extra">+ {{#if this.siteSettings.tagging_enabled}}+ <div class="list-tags">+ {{discourseTags this.topic mode="list" tags=this.topic.tags}}+ </div>+ {{/if}}+ {{#if this.siteSettings.topic_featured_link_enabled}}+ {{topicFeaturedLink this.topic}}+ {{/if}}</div>- {{/if}}- {{#if this.siteSettings.topic_featured_link_enabled}}- {{topic-featured-link this.topic}}- {{/if}}-</div>-<span>- <PluginOutlet- @name="topic-category"- @connectorTagName="div"- @outletArgs={{hash topic=this.topic category=this.topic.category}}- />-</span>\ No newline at end of file+ <span>+ <PluginOutlet+ @name="topic-category"+ @connectorTagName="div"+ @outletArgs={{hash topic=this.topic category=this.topic.category}}+ />+ </span>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/topic-entrance.gjs b/app/assets/javascripts/discourse/app/components/topic-entrance.gjsindex cf535b1f93e..75085e1c538 100644--- a/app/assets/javascripts/discourse/app/components/topic-entrance.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-entrance.gjs@@ -2,9 +2,12 @@ import Component from "@ember/component";import { action } from "@ember/object";import { scheduleOnce } from "@ember/runloop";import { service } from "@ember/service";+import { htmlSafe } from "@ember/template";import { classNameBindings } from "@ember-decorators/component";import { on } from "@ember-decorators/object";import $ from "jquery";+import DButton from "discourse/components/d-button";+import icon from "discourse/helpers/d-icon";import discourseComputed, { bind } from "discourse/lib/decorators";import DiscourseURL from "discourse/lib/url";import { i18n } from "discourse-i18n";@@ -199,30 +202,32 @@ export default class TopicEntrance extends Component {enterBottom() {this._jumpTo(this.get("topic.lastPostUrl"));}-}-<DButton- @action={{action "enterTop"}}- @translatedAriaLabel={{i18n- "topic_entrance.sr_jump_top_button"- date=this.topDate- }}- title={{i18n "topic_entrance.jump_top_button_title"}}- class="btn-default full jump-top"->- {{d-icon "backward-step"}}- {{html-safe this.topDate}}-</DButton>--<DButton- @action={{action "enterBottom"}}- @translatedAriaLabel={{i18n- "topic_entrance.sr_jump_bottom_button"- date=this.bottomDate- }}- title={{i18n "topic_entrance.jump_bottom_button_title"}}- class="btn-default full jump-bottom"->- {{html-safe this.bottomDate}}- {{d-icon "forward-step"}}-</DButton>\ No newline at end of file+ <template>+ <DButton+ @action={{action "enterTop"}}+ @translatedAriaLabel={{i18n+ "topic_entrance.sr_jump_top_button"+ date=this.topDate+ }}+ title={{i18n "topic_entrance.jump_top_button_title"}}+ class="btn-default full jump-top"+ >+ {{icon "backward-step"}}+ {{htmlSafe this.topDate}}+ </DButton>++ <DButton+ @action={{action "enterBottom"}}+ @translatedAriaLabel={{i18n+ "topic_entrance.sr_jump_bottom_button"+ date=this.bottomDate+ }}+ title={{i18n "topic_entrance.jump_bottom_button_title"}}+ class="btn-default full jump-bottom"+ >+ {{htmlSafe this.bottomDate}}+ {{icon "forward-step"}}+ </DButton>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/topic-list-item.gjs b/app/assets/javascripts/discourse/app/components/topic-list-item.gjsindex 79ccb08587d..02242b08847 100644--- a/app/assets/javascripts/discourse/app/components/topic-list-item.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-list-item.gjs@@ -1,4 +1,5 @@import Component from "@ember/component";+import { hash } from "@ember/helper";import { alias } from "@ember/object/computed";import { getOwner } from "@ember/owner";import { schedule } from "@ember/runloop";@@ -11,6 +12,7 @@ import {} from "@ember-decorators/component";import { observes, on } from "@ember-decorators/object";import $ from "jquery";+import PluginOutlet from "discourse/components/plugin-outlet";import discourseComputed, { bind } from "discourse/lib/decorators";import deprecated from "discourse/lib/deprecated";import { wantsNewWindow } from "discourse/lib/intercept-click";@@ -405,10 +407,12 @@ export default class TopicListItem extends Component {_titleElement() {return this.element.querySelector(".main-link .title");}-}-<PluginOutlet- @name="above-topic-list-item"- @outletArgs={{hash topic=this.topic}}-/>-{{this.topicListItemContents}}\ No newline at end of file+ <template>+ <PluginOutlet+ @name="above-topic-list-item"+ @outletArgs={{hash topic=this.topic}}+ />+ {{this.topicListItemContents}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/topic-list.gjs b/app/assets/javascripts/discourse/app/components/topic-list.gjsindex eca6255cfe7..bb0cd08705f 100644--- a/app/assets/javascripts/discourse/app/components/topic-list.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-list.gjs@@ -1,4 +1,5 @@import Component from "@ember/component";+import { hash } from "@ember/helper";import { dependentKeyCompat } from "@ember/object/compat";import { alias } from "@ember/object/computed";import { service } from "@ember/service";@@ -8,10 +9,14 @@ import {tagName,} from "@ember-decorators/component";import { observes, on } from "@ember-decorators/object";+import PluginOutlet from "discourse/components/plugin-outlet";+import TopicListItem from "discourse/components/topic-list-item";+import raw from "discourse/helpers/raw";import discourseComputed from "discourse/lib/decorators";import deprecated from "discourse/lib/deprecated";import { RAW_TOPIC_LIST_DEPRECATION_OPTIONS } from "discourse/lib/plugin-api";import LoadMore from "discourse/mixins/load-more";+import { i18n } from "discourse-i18n";@tagName("table")@classNames("topic-list")@@ -248,85 +253,87 @@ export default class TopicList extends Component.extend(LoadMore) {});}}-}-<caption class="sr-only">{{i18n "sr_topic_list_caption"}}</caption>--<thead class="topic-list-header">- {{raw- "topic-list-header"- canBulkSelect=this.canBulkSelect- toggleInTitle=this.toggleInTitle- hideCategory=this.hideCategory- showPosters=this.showPosters- showLikes=this.showLikes- showOpLikes=this.showOpLikes- order=this.order- ascending=this.ascending- sortable=this.sortable- listTitle=this.listTitle- bulkSelectEnabled=this.bulkSelectEnabled- bulkSelectHelper=this.bulkSelectHelper- canDoBulkActions=this.canDoBulkActions- showTopicsAndRepliesToggle=this.showTopicsAndRepliesToggle- newListSubset=this.newListSubset- newRepliesCount=this.newRepliesCount- newTopicsCount=this.newTopicsCount- }}-</thead>--<PluginOutlet- @name="before-topic-list-body"- @outletArgs={{hash- topics=this.topics- selected=this.selected- bulkSelectEnabled=this.bulkSelectEnabled- lastVisitedTopic=this.lastVisitedTopic- discoveryList=this.discoveryList- hideCategory=this.hideCategory- }}-/>--<tbody class="topic-list-body">- {{#each this.filteredTopics as |topic index|}}- <TopicListItem- @topic={{topic}}- @bulkSelectEnabled={{this.bulkSelectEnabled}}- @showTopicPostBadges={{this.showTopicPostBadges}}- @hideCategory={{this.hideCategory}}- @showPosters={{this.showPosters}}- @showLikes={{this.showLikes}}- @showOpLikes={{this.showOpLikes}}- @expandGloballyPinned={{this.expandGloballyPinned}}- @expandAllPinned={{this.expandAllPinned}}- @lastVisitedTopic={{this.lastVisitedTopic}}- @selected={{this.selected}}- @lastChecked={{this.lastChecked}}- @tagsForUser={{this.tagsForUser}}- @focusLastVisitedTopic={{this.focusLastVisitedTopic}}- @index={{index}}+ <template>+ <caption class="sr-only">{{i18n "sr_topic_list_caption"}}</caption>++ <thead class="topic-list-header">+ {{raw+ "topic-list-header"+ canBulkSelect=this.canBulkSelect+ toggleInTitle=this.toggleInTitle+ hideCategory=this.hideCategory+ showPosters=this.showPosters+ showLikes=this.showLikes+ showOpLikes=this.showOpLikes+ order=this.order+ ascending=this.ascending+ sortable=this.sortable+ listTitle=this.listTitle+ bulkSelectEnabled=this.bulkSelectEnabled+ bulkSelectHelper=this.bulkSelectHelper+ canDoBulkActions=this.canDoBulkActions+ showTopicsAndRepliesToggle=this.showTopicsAndRepliesToggle+ newListSubset=this.newListSubset+ newRepliesCount=this.newRepliesCount+ newTopicsCount=this.newTopicsCount+ }}+ </thead>++ <PluginOutlet+ @name="before-topic-list-body"+ @outletArgs={{hash+ topics=this.topics+ selected=this.selected+ bulkSelectEnabled=this.bulkSelectEnabled+ lastVisitedTopic=this.lastVisitedTopic+ discoveryList=this.discoveryList+ hideCategory=this.hideCategory+ }}/>- {{raw- "list/visited-line"- lastVisitedTopic=this.lastVisitedTopic- topic=topic- }}++ <tbody class="topic-list-body">+ {{#each this.filteredTopics as |topic index|}}+ <TopicListItem+ @topic={{topic}}+ @bulkSelectEnabled={{this.bulkSelectEnabled}}+ @showTopicPostBadges={{this.showTopicPostBadges}}+ @hideCategory={{this.hideCategory}}+ @showPosters={{this.showPosters}}+ @showLikes={{this.showLikes}}+ @showOpLikes={{this.showOpLikes}}+ @expandGloballyPinned={{this.expandGloballyPinned}}+ @expandAllPinned={{this.expandAllPinned}}+ @lastVisitedTopic={{this.lastVisitedTopic}}+ @selected={{this.selected}}+ @lastChecked={{this.lastChecked}}+ @tagsForUser={{this.tagsForUser}}+ @focusLastVisitedTopic={{this.focusLastVisitedTopic}}+ @index={{index}}+ />+ {{raw+ "list/visited-line"+ lastVisitedTopic=this.lastVisitedTopic+ topic=topic+ }}+ <PluginOutlet+ @name="after-topic-list-item"+ @outletArgs={{hash topic=topic index=index}}+ @connectorTagName="tr"+ />+ {{/each}}+ </tbody>+<PluginOutlet- @name="after-topic-list-item"- @outletArgs={{hash topic=topic index=index}}- @connectorTagName="tr"+ @name="after-topic-list-body"+ @outletArgs={{hash+ topics=this.topics+ selected=this.selected+ bulkSelectEnabled=this.bulkSelectEnabled+ lastVisitedTopic=this.lastVisitedTopic+ discoveryList=this.discoveryList+ hideCategory=this.hideCategory+ }}/>- {{/each}}-</tbody>--<PluginOutlet- @name="after-topic-list-body"- @outletArgs={{hash- topics=this.topics- selected=this.selected- bulkSelectEnabled=this.bulkSelectEnabled- lastVisitedTopic=this.lastVisitedTopic- discoveryList=this.discoveryList- hideCategory=this.hideCategory- }}-/>\ No newline at end of file+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/topic-map/topic-map-link.gjs b/app/assets/javascripts/discourse/app/components/topic-map/topic-map-link.gjsindex 2103b2ed673..ca2c345a568 100644--- a/app/assets/javascripts/discourse/app/components/topic-map/topic-map-link.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-map/topic-map-link.gjs@@ -1,7 +1,7 @@import Component from "@glimmer/component";+import { and } from "truth-helpers";import replaceEmoji from "discourse/helpers/replace-emoji";import { i18n } from "discourse-i18n";-import and from "truth-helpers/helpers/and";const TRUNCATE_LENGTH_LIMIT = 85;diff --git a/app/assets/javascripts/discourse/app/components/topic-navigation.gjs b/app/assets/javascripts/discourse/app/components/topic-navigation.gjsindex 9879c5aa19b..0e4983c394b 100644--- a/app/assets/javascripts/discourse/app/components/topic-navigation.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-navigation.gjs@@ -277,8 +277,10 @@ export default class TopicNavigation extends Component {this._swipeEvents.removeTouchListeners();}}-}-{{#if this.canRender}}- {{yield this.info}}-{{/if}}\ No newline at end of file+ <template>+ {{#if this.canRender}}+ {{yield this.info}}+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/topic-progress.gjs b/app/assets/javascripts/discourse/app/components/topic-progress.gjsindex ebfa5ae2a68..61ae0507075 100644--- a/app/assets/javascripts/discourse/app/components/topic-progress.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-progress.gjs@@ -2,8 +2,12 @@ import Component from "@ember/component";import { action } from "@ember/object";import { alias } from "@ember/object/computed";import { scheduleOnce } from "@ember/runloop";+import { htmlSafe } from "@ember/template";import { classNameBindings } from "@ember-decorators/component";+import DButton from "discourse/components/d-button";+import PluginOutlet from "discourse/components/plugin-outlet";import discourseComputed from "discourse/lib/decorators";+import { i18n } from "discourse-i18n";@classNameBindings("docked")export default class TopicProgress extends Component {@@ -92,38 +96,40 @@ export default class TopicProgress extends Component {goBack() {this.jumpToPost(this.get("topic.last_read_post_number"));}-}-{{#unless this.hideProgress}}- {{yield}}-{{/unless}}--{{#if this.showBackButton}}- <div class="progress-back-container">- <DButton- @label="topic.timeline.back"- @action={{this.goBack}}- @icon="arrow-down"- class="btn-primary btn-small progress-back"- />- </div>-{{/if}}--<nav- title={{i18n "topic.progress.title"}}- aria-label={{i18n "topic.progress.title"}}- class={{if this.hideProgress "hidden"}}- id="topic-progress"- style={{html-safe this.progressStyle}}->- <div class="nums">- <span>{{this.progressPosition}}</span>- <span class={{if this.hugeNumberOfPosts "hidden"}}>/</span>- <span- class={{if this.hugeNumberOfPosts "hidden"}}- >{{this.postStream.filteredPostsCount}}</span>- </div>- <div class="bg"></div>-</nav>--<PluginOutlet @name="after-topic-progress" @connectorTagName="div" />\ No newline at end of file+ <template>+ {{#unless this.hideProgress}}+ {{yield}}+ {{/unless}}++ {{#if this.showBackButton}}+ <div class="progress-back-container">+ <DButton+ @label="topic.timeline.back"+ @action={{this.goBack}}+ @icon="arrow-down"+ class="btn-primary btn-small progress-back"+ />+ </div>+ {{/if}}++ <nav+ title={{i18n "topic.progress.title"}}+ aria-label={{i18n "topic.progress.title"}}+ class={{if this.hideProgress "hidden"}}+ id="topic-progress"+ style={{htmlSafe this.progressStyle}}+ >+ <div class="nums">+ <span>{{this.progressPosition}}</span>+ <span class={{if this.hugeNumberOfPosts "hidden"}}>/</span>+ <span+ class={{if this.hugeNumberOfPosts "hidden"}}+ >{{this.postStream.filteredPostsCount}}</span>+ </div>+ <div class="bg"></div>+ </nav>++ <PluginOutlet @name="after-topic-progress" @connectorTagName="div" />+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/topic-timer-info.gjs b/app/assets/javascripts/discourse/app/components/topic-timer-info.gjsindex a21bca03fdb..0f402fd95e9 100644--- a/app/assets/javascripts/discourse/app/components/topic-timer-info.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-timer-info.gjs@@ -3,6 +3,7 @@ import { cancel, next } from "@ember/runloop";import { htmlSafe } from "@ember/template";import { classNames } from "@ember-decorators/component";import { on } from "@ember-decorators/object";+import DButton from "discourse/components/d-button";import { DELETE_REPLIES_TYPE } from "discourse/components/modal/edit-topic-timer";import discourseComputed from "discourse/lib/decorators";import { isTesting } from "discourse/lib/environment";@@ -160,31 +161,33 @@ export default class TopicTimerInfo extends Component {return `topic.status_update_notice.auto_${statusType}`;}-}-{{#if this.showTopicTimer}}- <h3 class="topic-timer-heading">- <span title={{this.title}}>- {{this.clockIcon}}- {{this.notice}}- </span>- <div class="topic-timer-modify">- {{#if this.showEdit}}- <DButton- @title="post.controls.edit_timer"- @icon="pencil"- @action={{this.showTopicTimerModal}}- class="topic-timer-edit no-text"- />- {{/if}}- {{#if this.showTrashCan}}- <DButton- @title="post.controls.remove_timer"- @icon="trash-can"- @action={{this.removeTopicTimer}}- class="topic-timer-remove no-text"- />- {{/if}}- </div>- </h3>-{{/if}}\ No newline at end of file+ <template>+ {{#if this.showTopicTimer}}+ <h3 class="topic-timer-heading">+ <span title={{this.title}}>+ {{this.clockIcon}}+ {{this.notice}}+ </span>+ <div class="topic-timer-modify">+ {{#if this.showEdit}}+ <DButton+ @title="post.controls.edit_timer"+ @icon="pencil"+ @action={{this.showTopicTimerModal}}+ class="topic-timer-edit no-text"+ />+ {{/if}}+ {{#if this.showTrashCan}}+ <DButton+ @title="post.controls.remove_timer"+ @icon="trash-can"+ @action={{this.removeTopicTimer}}+ class="topic-timer-remove no-text"+ />+ {{/if}}+ </div>+ </h3>+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/user-avatar-flair.gjs b/app/assets/javascripts/discourse/app/components/user-avatar-flair.gjsindex 51f68838a0e..b182eca5eb6 100644--- a/app/assets/javascripts/discourse/app/components/user-avatar-flair.gjs+++ b/app/assets/javascripts/discourse/app/components/user-avatar-flair.gjs@@ -1,5 +1,6 @@import Component from "@ember/component";import { tagName } from "@ember-decorators/component";+import AvatarFlair from "discourse/components/avatar-flair";import autoGroupFlairForUser from "discourse/lib/avatar-flair";import discourseComputed from "discourse/lib/decorators";@@ -30,13 +31,15 @@ export default class UserAvatarFlair extends Component {};}}-}-{{#if this.flair}}- <AvatarFlair- @flairName={{this.flair.flairName}}- @flairUrl={{this.flair.flairUrl}}- @flairBgColor={{this.flair.flairBgColor}}- @flairColor={{this.flair.flairColor}}- />-{{/if}}\ No newline at end of file+ <template>+ {{#if this.flair}}+ <AvatarFlair+ @flairName={{this.flair.flairName}}+ @flairUrl={{this.flair.flairUrl}}+ @flairBgColor={{this.flair.flairBgColor}}+ @flairColor={{this.flair.flairColor}}+ />+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/user-card-contents.gjs b/app/assets/javascripts/discourse/app/components/user-card-contents.gjsindex 8e3c806fa48..874fb4fc27f 100644--- a/app/assets/javascripts/discourse/app/components/user-card-contents.gjs+++ b/app/assets/javascripts/discourse/app/components/user-card-contents.gjs@@ -1,14 +1,30 @@+import { array, fn, hash } from "@ember/helper";+import { on } from "@ember/modifier";import EmberObject, { action, computed, set } from "@ember/object";import { alias, and, gt, gte, not, or } from "@ember/object/computed";+import { LinkTo } from "@ember/routing";import { dasherize } from "@ember/string";+import { htmlSafe } from "@ember/template";import { isEmpty } from "@ember/utils";import {attributeBindings,classNameBindings,classNames,} from "@ember-decorators/component";-import { observes, on } from "@ember-decorators/object";+import { observes, on as onEvent } from "@ember-decorators/object";import CardContentsBase from "discourse/components/card-contents-base";+import DButton from "discourse/components/d-button";+import HtmlWithLinks from "discourse/components/html-with-links";+import PluginOutlet from "discourse/components/plugin-outlet";+import UserAvatarFlair from "discourse/components/user-avatar-flair";+import UserBadge from "discourse/components/user-badge";+import boundAvatar from "discourse/helpers/bound-avatar";+import icon from "discourse/helpers/d-icon";+import formatDate from "discourse/helpers/format-date";+import formatDuration from "discourse/helpers/format-duration";+import formatUsername from "discourse/helpers/format-username";+import replaceEmoji from "discourse/helpers/replace-emoji";+import userStatus from "discourse/helpers/user-status";import CanCheckEmailsHelper from "discourse/lib/can-check-emails-helper";import { setting } from "discourse/lib/computed";import discourseComputed from "discourse/lib/decorators";@@ -211,12 +227,12 @@ export default class UserCardContents extends CardContentsBase {return profileHidden || inactive;}- @on("didInsertElement")+ @onEvent("didInsertElement")_inserted() {this.appEvents.on("dom:clean", this, this.cleanUp);}- @on("didDestroyElement")+ @onEvent("didDestroyElement")_destroyed() {this.appEvents.off("dom:clean", this, this.cleanUp);}@@ -316,431 +332,452 @@ export default class UserCardContents extends CardContentsBase {checkEmail(user) {user.checkEmail();}-}--{{#if this.visible}}- <PluginOutlet- @name="before-user-card-content"- @outletArgs={{hash user=this.user}}- />- <div class="card-content">- {{#if this.loading}}- <div class="card-row first-row">- <div class="user-card-avatar">- <div- class="card-avatar-placeholder animated-placeholder placeholder-animation"- ></div>- </div>- </div>- <div class="card-row second-row">- <div class="animated-placeholder placeholder-animation"></div>- </div>- <div class="card-row">- <div class="animated-placeholder placeholder-animation"></div>- </div>- <div class="card-row">- <div class="animated-placeholder placeholder-animation"></div>- </div>- <div class="card-row">- <div class="animated-placeholder placeholder-animation"></div>- </div>- {{else}}- <div class="card-row first-row">- <PluginOutlet- @name="user-card-main-info"- @outletArgs={{hash- user=this.user- post=this.post- contentHidden=this.contentHidden- handleShowUser=this.handleShowUser- }}- >- <div class="user-card-avatar" aria-hidden="true">- {{#if this.contentHidden}}- <span class="card-huge-avatar">{{bound-avatar- this.user- "huge"- }}</span>- {{else}}- <a- {{on "click" this.handleShowUser}}- href={{this.user.path}}- class="card-huge-avatar"- tabindex="-1"- >{{bound-avatar this.user "huge"}}</a>- {{/if}}-- <UserAvatarFlair @user={{this.user}} />-- <div>- <PluginOutlet- @name="user-card-avatar-flair"- @connectorTagName="div"- @outletArgs={{hash user=this.user}}- />+ <template>+ {{#if this.visible}}+ <PluginOutlet+ @name="before-user-card-content"+ @outletArgs={{hash user=this.user}}+ />+ <div class="card-content">+ {{#if this.loading}}+ <div class="card-row first-row">+ <div class="user-card-avatar">+ <div+ class="card-avatar-placeholder animated-placeholder placeholder-animation"+ ></div></div></div>- <div class="names">- <div- class="names__primary- {{this.staff}}- {{this.newUser}}- {{if this.nameFirst 'full-name' 'username'}}"++ <div class="card-row second-row">+ <div class="animated-placeholder placeholder-animation"></div>+ </div>+ <div class="card-row">+ <div class="animated-placeholder placeholder-animation"></div>+ </div>+ <div class="card-row">+ <div class="animated-placeholder placeholder-animation"></div>+ </div>+ <div class="card-row">+ <div class="animated-placeholder placeholder-animation"></div>+ </div>+ {{else}}+ <div class="card-row first-row">+ <PluginOutlet+ @name="user-card-main-info"+ @outletArgs={{hash+ user=this.user+ post=this.post+ contentHidden=this.contentHidden+ handleShowUser=this.handleShowUser+ }}>- {{#if this.contentHidden}}- <span class="name-username-wrapper">- {{if- this.nameFirst- this.user.name- (format-username this.user.username)- }}- </span>- {{else}}- <a- {{on "click" this.handleShowUser}}- href={{this.user.path}}- class="user-profile-link"- aria-label={{i18n- "user.profile_link"- username=this.user.username- }}+ <div class="user-card-avatar" aria-hidden="true">+ {{#if this.contentHidden}}+ <span class="card-huge-avatar">{{boundAvatar+ this.user+ "huge"+ }}</span>+ {{else}}+ <a+ {{on "click" this.handleShowUser}}+ href={{this.user.path}}+ class="card-huge-avatar"+ tabindex="-1"+ >{{boundAvatar this.user "huge"}}</a>+ {{/if}}++ <UserAvatarFlair @user={{this.user}} />++ <div>+ <PluginOutlet+ @name="user-card-avatar-flair"+ @connectorTagName="div"+ @outletArgs={{hash user=this.user}}+ />+ </div>+ </div>+ <div class="names">+ <div+ class="names__primary+ {{this.staff}}+ {{this.newUser}}+ {{if this.nameFirst 'full-name' 'username'}}">- <span class="name-username-wrapper">- {{if- this.nameFirst- this.user.name- (format-username this.user.username)- }}- </span>- {{user-status this.user currentUser=this.currentUser}}- </a>+ {{#if this.contentHidden}}+ <span class="name-username-wrapper">+ {{if+ this.nameFirst+ this.user.name+ (formatUsername this.user.username)+ }}+ </span>+ {{else}}+ <a+ {{on "click" this.handleShowUser}}+ href={{this.user.path}}+ class="user-profile-link"+ aria-label={{i18n+ "user.profile_link"+ username=this.user.username+ }}+ >+ <span class="name-username-wrapper">+ {{if+ this.nameFirst+ this.user.name+ (formatUsername this.user.username)+ }}+ </span>+ {{userStatus this.user currentUser=this.currentUser}}+ </a>+ {{/if}}+ </div>+ <PluginOutlet+ @name="user-card-after-username"+ @connectorTagName="div"+ @outletArgs={{hash+ user=this.user+ showUser=this.handleShowUser+ }}+ />+ {{#if this.nameFirst}}+ <div+ class="names__secondary username"+ >{{this.user.username}}</div>+ {{else}}+ {{#if this.user.name}}+ <div+ class="names__secondary full-name"+ >{{this.user.name}}</div>+ {{/if}}+ {{/if}}+ {{#if this.user.title}}+ <div class="names__secondary">{{this.user.title}}</div>+ {{/if}}+ {{#if this.user.staged}}+ <div class="names__secondary staged">{{i18n+ "user.staged"+ }}</div>+ {{/if}}+ {{#if this.hasStatus}}+ <div class="user-status">+ {{htmlSafe this.userStatusEmoji}}+ <span class="user-status__description">+ {{this.user.status.description}}+ </span>+ {{formatDate this.user.status.ends_at format="tiny"}}+ </div>+ {{/if}}+ <div>+ <PluginOutlet+ @name="user-card-post-names"+ @connectorTagName="div"+ @outletArgs={{hash user=this.user}}+ />+ </div>+ </div>+ </PluginOutlet>+ <ul class="usercard-controls">+ {{#if this.user.can_send_private_message_to_user}}+ <li class="compose-pm">+ <DButton+ @action={{fn this.composePM this.user this.post}}+ @icon="envelope"+ @label="user.private_message"+ class="btn-primary"+ />+ </li>{{/if}}- </div>+ <PluginOutlet+ @name="user-card-below-message-button"+ @connectorTagName="li"+ @outletArgs={{hash user=this.user close=this.close}}+ />+ {{#if this.showFilter}}+ <li>+ <DButton+ @action={{fn this.handleFilterPosts this.user}}+ @icon="filter"+ @translatedLabel={{this.filterPostsLabel}}+ class="btn-default"+ />+ </li>+ {{/if}}+ {{#if this.hasUserFilters}}+ <li>+ <DButton+ @action={{action "cancelFilter"}}+ @icon="xmark"+ @label="topic.filters.cancel"+ />+ </li>+ {{/if}}+ {{#if this.showDelete}}+ <li>+ <DButton+ @action={{fn this.deleteUser this.user}}+ @icon="triangle-exclamation"+ @label="admin.user.delete"+ class="btn-danger"+ />+ </li>+ {{/if}}+ <PluginOutlet+ @name="user-card-additional-buttons"+ @connectorTagName="li"+ @outletArgs={{hash user=this.user close=this.close}}+ />+ </ul><PluginOutlet- @name="user-card-after-username"+ @name="user-card-additional-controls"@connectorTagName="div"- @outletArgs={{hash user=this.user showUser=this.handleShowUser}}+ @outletArgs={{hash user=this.user close=this.close}}/>- {{#if this.nameFirst}}- <div- class="names__secondary username"- >{{this.user.username}}</div>- {{else}}- {{#if this.user.name}}- <div class="names__secondary full-name">{{this.user.name}}</div>- {{/if}}- {{/if}}- {{#if this.user.title}}- <div class="names__secondary">{{this.user.title}}</div>- {{/if}}- {{#if this.user.staged}}- <div class="names__secondary staged">{{i18n "user.staged"}}</div>- {{/if}}- {{#if this.hasStatus}}- <div class="user-status">- {{html-safe this.userStatusEmoji}}- <span class="user-status__description">- {{this.user.status.description}}- </span>- {{format-date this.user.status.ends_at format="tiny"}}+ </div>++ {{#if this.user.profile_hidden}}+ <div class="card-row second-row">+ <div class="profile-hidden">+ <span role="alert">{{i18n "user.profile_hidden"}}</span>+ </div>+ </div>+ {{else if this.user.inactive}}+ <div class="card-row second-row">+ <div class="inactive-user">+ <span role="alert">{{i18n "user.inactive_user"}}</span></div>- {{/if}}- <div>- <PluginOutlet- @name="user-card-post-names"- @connectorTagName="div"- @outletArgs={{hash user=this.user}}- /></div>- </div>- </PluginOutlet>- <ul class="usercard-controls">- {{#if this.user.can_send_private_message_to_user}}- <li class="compose-pm">- <DButton- @action={{fn (action "composePM") this.user this.post}}- @icon="envelope"- @label="user.private_message"- class="btn-primary"- />- </li>- {{/if}}- <PluginOutlet- @name="user-card-below-message-button"- @connectorTagName="li"- @outletArgs={{hash user=this.user close=(action "close")}}- />- {{#if this.showFilter}}- <li>- <DButton- @action={{fn this.handleFilterPosts this.user}}- @icon="filter"- @translatedLabel={{this.filterPostsLabel}}- class="btn-default"- />- </li>- {{/if}}- {{#if this.hasUserFilters}}- <li>- <DButton- @action={{action "cancelFilter"}}- @icon="xmark"- @label="topic.filters.cancel"- />- </li>{{/if}}- {{#if this.showDelete}}- <li>- <DButton- @action={{fn (action "deleteUser") this.user}}- @icon="triangle-exclamation"- @label="admin.user.delete"- class="btn-danger"- />- </li>++ {{#if this.isSuspendedOrHasBio}}+ <div class="card-row second-row">+ {{#if this.user.suspend_reason}}+ <div class="suspended">+ <div class="suspension-date">+ {{icon "ban"}}+ {{#if this.user.suspendedForever}}+ {{i18n "user.suspended_permanently"}}+ {{else}}+ {{i18n+ "user.suspended_notice"+ date=this.user.suspendedTillDate+ }}+ {{/if}}+ </div>+ <div class="suspension-reason">+ <span class="suspension-reason-title">{{i18n+ "user.suspended_reason"+ }}</span>+ <span+ class="suspension-reason-description"+ >{{this.user.suspend_reason}}</span>+ </div>+ </div>+ {{else}}+ {{#if this.user.bio_excerpt}}+ <div class="bio">+ <HtmlWithLinks>+ {{htmlSafe this.user.bio_excerpt}}+ </HtmlWithLinks>+ </div>+ {{/if}}+ {{/if}}+ </div>{{/if}}- <PluginOutlet- @name="user-card-additional-buttons"- @connectorTagName="li"- @outletArgs={{hash user=this.user close=(action "close")}}- />- </ul>- <PluginOutlet- @name="user-card-additional-controls"- @connectorTagName="div"- @outletArgs={{hash user=this.user close=(action "close")}}- />- </div>- {{#if this.user.profile_hidden}}- <div class="card-row second-row">- <div class="profile-hidden">- <span role="alert">{{i18n "user.profile_hidden"}}</span>- </div>- </div>- {{else if this.user.inactive}}- <div class="card-row second-row">- <div class="inactive-user">- <span role="alert">{{i18n "user.inactive_user"}}</span>- </div>- </div>- {{/if}}-- {{#if this.isSuspendedOrHasBio}}- <div class="card-row second-row">- {{#if this.user.suspend_reason}}- <div class="suspended">- <div class="suspension-date">- {{d-icon "ban"}}- {{#if this.user.suspendedForever}}- {{i18n "user.suspended_permanently"}}- {{else}}- {{i18n- "user.suspended_notice"- date=this.user.suspendedTillDate+ {{#if this.showFeaturedTopic}}+ <div class="card-row">+ <div class="featured-topic">+ <span class="desc">{{i18n "user.featured_topic"}}</span>+ <LinkTo+ @route="topic"+ @models={{array+ this.user.featured_topic.slug+ this.user.featured_topic.id}}- {{/if}}- </div>- <div class="suspension-reason">- <span class="suspension-reason-title">{{i18n- "user.suspended_reason"- }}</span>- <span- class="suspension-reason-description"- >{{this.user.suspend_reason}}</span>+ >{{replaceEmoji+ (htmlSafe this.user.featured_topic.fancy_title)+ }}</LinkTo></div></div>- {{else}}- {{#if this.user.bio_excerpt}}- <div class="bio">- <HtmlWithLinks>- {{html-safe this.user.bio_excerpt}}- </HtmlWithLinks>- </div>- {{/if}}{{/if}}- </div>- {{/if}}-- {{#if this.showFeaturedTopic}}- <div class="card-row">- <div class="featured-topic">- <span class="desc">{{i18n "user.featured_topic"}}</span>- <LinkTo- @route="topic"- @models={{array- this.user.featured_topic.slug- this.user.featured_topic.id- }}- >{{replace-emoji- (html-safe this.user.featured_topic.fancy_title)- }}</LinkTo>- </div>- </div>- {{/if}}-- {{#if this.hasLocaleOrWebsite}}- <div class="card-row">- <div class="location-and-website">- {{#if this.user.website_name}}- <span class="website-name">- {{d-icon "globe"}}- {{#if this.linkWebsite}}- {{! template-lint-disable link-rel-noopener }}- <a- href={{this.user.website}}- rel="noopener {{unless this.removeNoFollow 'nofollow ugc'}}"- target="_blank"- >{{this.user.website_name}}</a>- {{! template-lint-enable link-rel-noopener }}- {{else}}- <span- title={{this.user.website}}- >{{this.user.website_name}}</span>++ {{#if this.hasLocaleOrWebsite}}+ <div class="card-row">+ <div class="location-and-website">+ {{#if this.user.website_name}}+ <span class="website-name">+ {{icon "globe"}}+ {{#if this.linkWebsite}}+ {{! template-lint-disable link-rel-noopener }}+ <a+ href={{this.user.website}}+ rel="noopener {{unless+ this.removeNoFollow+ 'nofollow ugc'+ }}"+ target="_blank"+ >{{this.user.website_name}}</a>+ {{! template-lint-enable link-rel-noopener }}+ {{else}}+ <span+ title={{this.user.website}}+ >{{this.user.website_name}}</span>+ {{/if}}+ </span>{{/if}}- </span>- {{/if}}- {{#if this.user.location}}- <span class="location">- {{d-icon "location-dot"}}- <span>{{this.user.location}}</span>- </span>- {{/if}}- {{#if this.showUserLocalTime}}- <span class="local-time" title={{i18n "local_time"}}>- {{d-icon "far-clock"}}- <span>{{this.formattedUserLocalTime}}</span>- </span>- {{/if}}- <span>- <PluginOutlet- @name="user-card-location-and-website"- @connectorTagName="div"- @outletArgs={{hash user=this.user}}- />- </span>- </div>- </div>- {{/if}}-- <div class="card-row metadata-row">- {{#unless this.contentHidden}}- <div class="metadata">- {{#if this.user.last_posted_at}}- <div class="metadata__last-posted">- <span class="desc">{{i18n "last_post"}}</span>- {{format-date this.user.last_posted_at leaveAgo="true"}}</div>- {{/if}}- <div class="metadata__user-created">- <span class="desc">{{i18n "joined"}}</span>- {{format-date this.user.created_at leaveAgo="true"}}</div>- {{#if this.user.time_read}}- <div class="metadata__time-read" title={{this.timeReadTooltip}}>- <span class="desc">{{i18n "time_read"}}</span>- {{format-duration this.user.time_read}}- {{#if this.showRecentTimeRead}}- <span>- ({{i18n- "time_read_recently"- time_read=this.recentTimeRead- }})+ {{#if this.user.location}}+ <span class="location">+ {{icon "location-dot"}}+ <span>{{this.user.location}}</span></span>{{/if}}- </div>- {{/if}}- {{#if this.showCheckEmail}}- <div class="metadata__email">- {{d-icon "envelope" title="user.email.title"}}- {{#if this.user.email}}- {{this.user.email}}- {{else}}- <DButton- @action={{fn (action "checkEmail") this.user}}- @icon="envelope"- @label="admin.users.check_email.text"- class="btn-primary"+ {{#if this.showUserLocalTime}}+ <span class="local-time" title={{i18n "local_time"}}>+ {{icon "far-clock"}}+ <span>{{this.formattedUserLocalTime}}</span>+ </span>+ {{/if}}+ <span>+ <PluginOutlet+ @name="user-card-location-and-website"+ @connectorTagName="div"+ @outletArgs={{hash user=this.user}}/>+ </span>+ </div>+ </div>+ {{/if}}++ <div class="card-row metadata-row">+ {{#unless this.contentHidden}}+ <div class="metadata">+ {{#if this.user.last_posted_at}}+ <div class="metadata__last-posted">+ <span class="desc">{{i18n "last_post"}}</span>+ {{formatDate+ this.user.last_posted_at+ leaveAgo="true"+ }}</div>{{/if}}+ <div class="metadata__user-created">+ <span class="desc">{{i18n "joined"}}</span>+ {{formatDate this.user.created_at leaveAgo="true"}}</div>+ {{#if this.user.time_read}}+ <div+ class="metadata__time-read"+ title={{this.timeReadTooltip}}+ >+ <span class="desc">{{i18n "time_read"}}</span>+ {{formatDuration this.user.time_read}}+ {{#if this.showRecentTimeRead}}+ <span>+ ({{i18n+ "time_read_recently"+ time_read=this.recentTimeRead+ }})+ </span>+ {{/if}}+ </div>+ {{/if}}+ {{#if this.showCheckEmail}}+ <div class="metadata__email">+ {{icon "envelope" title="user.email.title"}}+ {{#if this.user.email}}+ {{this.user.email}}+ {{else}}+ <DButton+ @action={{fn this.checkEmail this.user}}+ @icon="envelope"+ @label="admin.users.check_email.text"+ class="btn-primary"+ />+ {{/if}}+ </div>+ {{/if}}+ <PluginOutlet+ @name="user-card-metadata"+ @connectorTagName="div"+ @outletArgs={{hash user=this.user}}+ /></div>- {{/if}}+ {{/unless}}<PluginOutlet- @name="user-card-metadata"+ @name="user-card-after-metadata"@connectorTagName="div"@outletArgs={{hash user=this.user}}/></div>- {{/unless}}- <PluginOutlet- @name="user-card-after-metadata"- @connectorTagName="div"- @outletArgs={{hash user=this.user}}- />- </div>- {{#if this.publicUserFields}}- <div class="card-row">- <div class="public-user-fields">- {{#each this.publicUserFields as |uf|}}- {{#if uf.value}}- <div- class="public-user-field public-user-field__{{uf.field.dasherized_name}}"- >- <span class="user-field-name">{{uf.field.name}}:</span>- <span class="user-field-value">- {{#each uf.value as |v|}}- {{! some values are arrays }}- <span class="user-field-value-list-item">- {{#if uf.field.searchable}}- <LinkTo- @route="users"- @query={{hash name=v}}- {{on "click" (fn this.refreshRoute v)}}- >{{v}}</LinkTo>+ {{#if this.publicUserFields}}+ <div class="card-row">+ <div class="public-user-fields">+ {{#each this.publicUserFields as |uf|}}+ {{#if uf.value}}+ <div+ class="public-user-field public-user-field__{{uf.field.dasherized_name}}"+ >+ <span class="user-field-name">{{uf.field.name}}:</span>+ <span class="user-field-value">+ {{#each uf.value as |v|}}+ {{! some values are arrays }}+ <span class="user-field-value-list-item">+ {{#if uf.field.searchable}}+ <LinkTo+ @route="users"+ @query={{hash name=v}}+ {{on "click" (fn this.refreshRoute v)}}+ >{{v}}</LinkTo>+ {{else}}+ {{v}}+ {{/if}}+ </span>{{else}}- {{v}}- {{/if}}+ {{uf.value}}+ {{/each}}</span>- {{else}}- {{uf.value}}- {{/each}}- </span>- </div>- {{/if}}- {{/each}}- </div>- </div>- {{/if}}-- <PluginOutlet- @name="user-card-before-badges"- @connectorTagName="div"- @outletArgs={{hash user=this.user}}- />+ </div>+ {{/if}}+ {{/each}}+ </div>+ </div>+ {{/if}}- {{#if this.showBadges}}- <div class="card-row"><PluginOutlet- @name="user-card-badges"- @outletArgs={{hash user=this.user post=this.post}}- >- {{#if this.user.featured_user_badges}}- <div class="badge-section">- {{#each this.user.featured_user_badges as |ub|}}- <UserBadge @badge={{ub.badge}} @user={{this.user}} />- {{/each}}- {{#if this.showMoreBadges}}- <span class="more-user-badges">- <LinkTo @route="user.badges" @model={{this.user}}>- {{i18n "badges.more_badges" count=this.moreBadgesCount}}- </LinkTo>- </span>+ @name="user-card-before-badges"+ @connectorTagName="div"+ @outletArgs={{hash user=this.user}}+ />++ {{#if this.showBadges}}+ <div class="card-row">+ <PluginOutlet+ @name="user-card-badges"+ @outletArgs={{hash user=this.user post=this.post}}+ >+ {{#if this.user.featured_user_badges}}+ <div class="badge-section">+ {{#each this.user.featured_user_badges as |ub|}}+ <UserBadge @badge={{ub.badge}} @user={{this.user}} />+ {{/each}}+ {{#if this.showMoreBadges}}+ <span class="more-user-badges">+ <LinkTo @route="user.badges" @model={{this.user}}>+ {{i18n+ "badges.more_badges"+ count=this.moreBadgesCount+ }}+ </LinkTo>+ </span>+ {{/if}}+ </div>{{/if}}- </div>- {{/if}}- </PluginOutlet>- </div>- {{/if}}+ </PluginOutlet>+ </div>+ {{/if}}+ {{/if}}+ </div>{{/if}}- </div>-{{/if}}\ No newline at end of file+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/user-fields/confirm.gjs b/app/assets/javascripts/discourse/app/components/user-fields/confirm.gjsindex cd229747a7c..f15556d7857 100644--- a/app/assets/javascripts/discourse/app/components/user-fields/confirm.gjs+++ b/app/assets/javascripts/discourse/app/components/user-fields/confirm.gjs@@ -1,30 +1,38 @@+import { Input } from "@ember/component";+import { concat } from "@ember/helper";+import { htmlSafe } from "@ember/template";+import InputTip from "discourse/components/input-tip";+import { i18n } from "discourse-i18n";import UserFieldBase from "./base";-export default class UserFieldConfirm extends UserFieldBase {}+export default class UserFieldConfirm extends UserFieldBase {+ <template>+ {{#if this.field.name}}+ <label class="control-label">+ {{this.field.name}}+ {{~#unless this.field.required}}+ {{i18n "user_fields.optional"}}{{/unless~}}+ </label>+ {{/if}}-{{#if this.field.name}}- <label class="control-label">- {{this.field.name}}- {{~#unless this.field.required}} {{i18n "user_fields.optional"}}{{/unless~}}- </label>-{{/if}}--<div class="controls">- <label class="control-label checkbox-label">- <Input- id={{concat "user-" this.elementId}}- @checked={{this.value}}- @type="checkbox"- />- <span>- {{html-safe this.field.description}}- {{#unless this.field.name}}{{#if this.field.required}}<span- class="required"- >*</span>{{/if}}{{/unless}}- </span>- </label>- <InputTip- @validation={{@validation}}- class={{unless @validation.reason "hidden"}}- />-</div>\ No newline at end of file+ <div class="controls">+ <label class="control-label checkbox-label">+ <Input+ id={{concat "user-" this.elementId}}+ @checked={{this.value}}+ @type="checkbox"+ />+ <span>+ {{htmlSafe this.field.description}}+ {{#unless this.field.name}}{{#if this.field.required}}<span+ class="required"+ >*</span>{{/if}}{{/unless}}+ </span>+ </label>+ <InputTip+ @validation={{@validation}}+ class={{unless @validation.reason "hidden"}}+ />+ </div>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/user-fields/text.gjs b/app/assets/javascripts/discourse/app/components/user-fields/text.gjsindex ee15ec48bbe..3346c9631b6 100644--- a/app/assets/javascripts/discourse/app/components/user-fields/text.gjs+++ b/app/assets/javascripts/discourse/app/components/user-fields/text.gjs@@ -1,25 +1,33 @@+import { Input } from "@ember/component";+import { concat } from "@ember/helper";+import { htmlSafe } from "@ember/template";+import InputTip from "discourse/components/input-tip";+import { i18n } from "discourse-i18n";import UserFieldBase from "./base";-export default class UserFieldText extends UserFieldBase {}--<div class="controls">- <Input- id={{concat "user-" this.elementId}}- @value={{this.value}}- maxlength={{this.site.user_field_max_length}}- />- <label- class="control-label alt-placeholder"- for={{concat "user-" this.elementId}}- >- {{this.field.name}}- {{~#unless this.field.required}} {{i18n "user_fields.optional"}}{{/unless~}}- </label>- <InputTip- @validation={{this.validation}}- class={{unless this.validation "hidden"}}- />- {{#unless this.validation}}- <div class="instructions">{{html-safe this.field.description}}</div>- {{/unless}}-</div>\ No newline at end of file+export default class UserFieldText extends UserFieldBase {+ <template>+ <div class="controls">+ <Input+ id={{concat "user-" this.elementId}}+ @value={{this.value}}+ maxlength={{this.site.user_field_max_length}}+ />+ <label+ class="control-label alt-placeholder"+ for={{concat "user-" this.elementId}}+ >+ {{this.field.name}}+ {{~#unless this.field.required}}+ {{i18n "user_fields.optional"}}{{/unless~}}+ </label>+ <InputTip+ @validation={{this.validation}}+ class={{unless this.validation "hidden"}}+ />+ {{#unless this.validation}}+ <div class="instructions">{{htmlSafe this.field.description}}</div>+ {{/unless}}+ </div>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/user-info.gjs b/app/assets/javascripts/discourse/app/components/user-info.gjsindex b0e687bc52d..172d327780c 100644--- a/app/assets/javascripts/discourse/app/components/user-info.gjs+++ b/app/assets/javascripts/discourse/app/components/user-info.gjs@@ -1,9 +1,16 @@import Component from "@ember/component";+import { hash } from "@ember/helper";import { alias } from "@ember/object/computed";import {attributeBindings,classNameBindings,} from "@ember-decorators/component";+import { and } from "truth-helpers";+import PluginOutlet from "discourse/components/plugin-outlet";+import UserAvatarFlair from "discourse/components/user-avatar-flair";+import UserStatusMessage from "discourse/components/user-status-message";+import avatar from "discourse/helpers/avatar";+import formatUsername from "discourse/helpers/format-username";import discourseComputed from "discourse/lib/decorators";import { prioritizeNameInUx } from "discourse/lib/settings";import { userPath } from "discourse/lib/url";@@ -36,65 +43,67 @@ export default class UserInfo extends Component {nameFirst(name) {return prioritizeNameInUx(name);}-}-{{#if this.includeAvatar}}- <div class="user-image">- <div class="user-image-inner">- <a- href={{this.userPath}}- data-user-card={{@user.username}}- aria-hidden="true"- >{{avatar @user imageSize="large"}}</a>- <UserAvatarFlair @user={{@user}} />- </div>- </div>-{{/if}}-<div class="user-detail">- <div class="name-line">- {{#if this.includeLink}}- <a- href={{this.userPath}}- data-user-card={{@user.username}}- role="heading"- >- <span class={{if this.nameFirst "name" "username"}}>- {{if this.nameFirst @user.name (format-username @user.username)}}- </span>- <span class={{if this.nameFirst "username" "name"}}>- {{if this.nameFirst (format-username @user.username) @user.name}}- </span>- </a>- {{else}}- <span class={{if this.nameFirst "name" "username"}}>- {{if this.nameFirst @user.name (format-username @user.username)}}- </span>- <span class={{if this.nameFirst "username" "name"}}>- {{if this.nameFirst (format-username @user.username) @user.name}}- </span>- {{/if}}- {{#if (and @showStatus @user.status)}}- <UserStatusMessage- @status={{@user.status}}- @showDescription={{@showStatusDescription}}- />+ <template>+ {{#if this.includeAvatar}}+ <div class="user-image">+ <div class="user-image-inner">+ <a+ href={{this.userPath}}+ data-user-card={{@user.username}}+ aria-hidden="true"+ >{{avatar @user imageSize="large"}}</a>+ <UserAvatarFlair @user={{@user}} />+ </div>+ </div>{{/if}}+ <div class="user-detail">+ <div class="name-line">+ {{#if this.includeLink}}+ <a+ href={{this.userPath}}+ data-user-card={{@user.username}}+ role="heading"+ >+ <span class={{if this.nameFirst "name" "username"}}>+ {{if this.nameFirst @user.name (formatUsername @user.username)}}+ </span>+ <span class={{if this.nameFirst "username" "name"}}>+ {{if this.nameFirst (formatUsername @user.username) @user.name}}+ </span>+ </a>+ {{else}}+ <span class={{if this.nameFirst "name" "username"}}>+ {{if this.nameFirst @user.name (formatUsername @user.username)}}+ </span>+ <span class={{if this.nameFirst "username" "name"}}>+ {{if this.nameFirst (formatUsername @user.username) @user.name}}+ </span>+ {{/if}}+ {{#if (and @showStatus @user.status)}}+ <UserStatusMessage+ @status={{@user.status}}+ @showDescription={{@showStatusDescription}}+ />+ {{/if}}+ <PluginOutlet+ @name="after-user-name"+ @connectorTagName="span"+ @outletArgs={{hash user=this.user}}+ />+ </div>+ <div class="title">{{@user.title}}</div>+ {{#if (has-block)}}+ <div class="details">+ {{yield}}+ </div>+ {{/if}}+ </div>+<PluginOutlet- @name="after-user-name"- @connectorTagName="span"+ @name="after-user-info"+ @connectorTagName="div"@outletArgs={{hash user=this.user}}/>- </div>- <div class="title">{{@user.title}}</div>- {{#if (has-block)}}- <div class="details">- {{yield}}- </div>- {{/if}}-</div>--<PluginOutlet- @name="after-user-info"- @connectorTagName="div"- @outletArgs={{hash user=this.user}}-/>\ No newline at end of file+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/user-menu/bookmarks-list-empty-state.gjs b/app/assets/javascripts/discourse/app/components/user-menu/bookmarks-list-empty-state.gjsindex 50b063030d9..c64db7dcee3 100644--- a/app/assets/javascripts/discourse/app/components/user-menu/bookmarks-list-empty-state.gjs+++ b/app/assets/javascripts/discourse/app/components/user-menu/bookmarks-list-empty-state.gjs@@ -1,10 +1,17 @@-<div class="empty-state">- <span class="empty-state-title">- {{i18n "user.no_bookmarks_title"}}- </span>- <div class="empty-state-body">- <p>- {{html-safe (i18n "user.no_bookmarks_body" icon=(d-icon "bookmark"))}}- </p>+import { htmlSafe } from "@ember/template";+import icon from "discourse/helpers/d-icon";+import { i18n } from "discourse-i18n";++const BookmarksListEmptyState = <template>+ <div class="empty-state">+ <span class="empty-state-title">+ {{i18n "user.no_bookmarks_title"}}+ </span>+ <div class="empty-state-body">+ <p>+ {{htmlSafe (i18n "user.no_bookmarks_body" icon=(icon "bookmark"))}}+ </p>+ </div></div>-</div>\ No newline at end of file+</template>;+export default BookmarksListEmptyState;diff --git a/app/assets/javascripts/discourse/app/components/user-menu/items-list-empty-state.gjs b/app/assets/javascripts/discourse/app/components/user-menu/items-list-empty-state.gjsindex 22227f0d2f8..61296dbb9bc 100644--- a/app/assets/javascripts/discourse/app/components/user-menu/items-list-empty-state.gjs+++ b/app/assets/javascripts/discourse/app/components/user-menu/items-list-empty-state.gjs@@ -1,5 +1,10 @@-<div class="empty-state">- <span class="empty-state-title">- {{i18n "user_menu.generic_no_items"}}- </span>-</div>\ No newline at end of file+import { i18n } from "discourse-i18n";++const ItemsListEmptyState = <template>+ <div class="empty-state">+ <span class="empty-state-title">+ {{i18n "user_menu.generic_no_items"}}+ </span>+ </div>+</template>;+export default ItemsListEmptyState;diff --git a/app/assets/javascripts/discourse/app/components/user-menu/likes-list-empty-state.gjs b/app/assets/javascripts/discourse/app/components/user-menu/likes-list-empty-state.gjsindex 5440289c382..33d4d212c98 100644--- a/app/assets/javascripts/discourse/app/components/user-menu/likes-list-empty-state.gjs+++ b/app/assets/javascripts/discourse/app/components/user-menu/likes-list-empty-state.gjs@@ -1,15 +1,22 @@-<div class="empty-state">- <span class="empty-state-title">- {{i18n "user.no_likes_title"}}- </span>- <div class="empty-state-body">- <p>- {{html-safe- (i18n- "user.no_likes_body"- preferencesUrl=(get-url "/my/preferences/notifications")- )- }}- </p>+import { htmlSafe } from "@ember/template";+import getUrl from "discourse/helpers/get-url";+import { i18n } from "discourse-i18n";++const LikesListEmptyState = <template>+ <div class="empty-state">+ <span class="empty-state-title">+ {{i18n "user.no_likes_title"}}+ </span>+ <div class="empty-state-body">+ <p>+ {{htmlSafe+ (i18n+ "user.no_likes_body"+ preferencesUrl=(getUrl "/my/preferences/notifications")+ )+ }}+ </p>+ </div></div>-</div>\ No newline at end of file+</template>;+export default LikesListEmptyState;diff --git a/app/assets/javascripts/discourse/app/components/user-menu/menu-item.gjs b/app/assets/javascripts/discourse/app/components/user-menu/menu-item.gjsindex fbde40cb490..3fe8997f97b 100644--- a/app/assets/javascripts/discourse/app/components/user-menu/menu-item.gjs+++ b/app/assets/javascripts/discourse/app/components/user-menu/menu-item.gjs@@ -1,6 +1,10 @@import Component from "@glimmer/component";+import { concat } from "@ember/helper";+import { on } from "@ember/modifier";import { action } from "@ember/object";import { htmlSafe } from "@ember/template";+import PluginOutlet from "discourse/components/plugin-outlet";+import icon from "discourse/helpers/d-icon";import { emojiUnescape } from "discourse/lib/text";import { escapeExpression } from "discourse/lib/utilities";@@ -76,38 +80,40 @@ export default class UserMenuItem extends Component {closeUserMenu: this.args.closeUserMenu,});}-}-<li class={{this.className}}>- <a- href={{this.linkHref}}- title={{this.linkTitle}}- {{on "click" this.onClick}}- >- {{#if this.iconComponent}}- <this.iconComponent @data={{this.iconComponentArgs}} />- {{else}}- {{d-icon this.icon}}- {{/if}}- <div>- {{#if this.label}}- <span class={{concat "item-label " this.labelClass}}>- {{this.label}}- </span>- {{/if}}- {{#if this.description}}- <span- class={{concat "item-description " this.descriptionClass}}- data-topic-id={{this.topicId}}- >- {{this.description}}- </span>- {{/if}}- </div>-- {{#if this.endComponent}}- <this.endComponent />- {{/if}}- </a>- <PluginOutlet @name="menu-item-end" @outletArgs={{this.endOutletArgs}} />-</li>\ No newline at end of file+ <template>+ <li class={{this.className}}>+ <a+ href={{this.linkHref}}+ title={{this.linkTitle}}+ {{on "click" this.onClick}}+ >+ {{#if this.iconComponent}}+ <this.iconComponent @data={{this.iconComponentArgs}} />+ {{else}}+ {{icon this.icon}}+ {{/if}}+ <div>+ {{#if this.label}}+ <span class={{concat "item-label " this.labelClass}}>+ {{this.label}}+ </span>+ {{/if}}+ {{#if this.description}}+ <span+ class={{concat "item-description " this.descriptionClass}}+ data-topic-id={{this.topicId}}+ >+ {{this.description}}+ </span>+ {{/if}}+ </div>++ {{#if this.endComponent}}+ <this.endComponent />+ {{/if}}+ </a>+ <PluginOutlet @name="menu-item-end" @outletArgs={{this.endOutletArgs}} />+ </li>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/user-menu/menu-tab.gjs b/app/assets/javascripts/discourse/app/components/user-menu/menu-tab.gjsindex 21f0b9c0623..c7d389befe4 100644--- a/app/assets/javascripts/discourse/app/components/user-menu/menu-tab.gjs+++ b/app/assets/javascripts/discourse/app/components/user-menu/menu-tab.gjs@@ -1,4 +1,6 @@import Component from "@glimmer/component";+import { on } from "@ember/modifier";+import icon from "discourse/helpers/d-icon";export default class UserMenuTab extends Component {get isActive() {@@ -24,25 +26,30 @@ export default class UserMenuTab extends Component {get ariaControls() {return `quick-access-${this.args.tab.id}`;}-}-<a- role="tab"- class={{this.classNames}}- id={{this.id}}- tabindex={{this.tabIndex}}- title={{@tab.title}}- aria-label={{@tab.title}}- aria-selected={{if this.isActive "true" "false"}}- aria-controls={{this.ariaControls}}- data-tab-number={{@tab.position}}- href={{@tab.linkWhenActive}}- {{on "click" @onTabClick}}- {{on "keydown" @onTabClick}}->- {{d-icon @tab.icon}}- {{#if @tab.count}}- <span aria-hidden="true" class="badge-notification">{{@tab.count}}</span>- {{/if}}- {{yield}}-</a>\ No newline at end of file+ <template>+ <a+ role="tab"+ class={{this.classNames}}+ id={{this.id}}+ tabindex={{this.tabIndex}}+ title={{@tab.title}}+ aria-label={{@tab.title}}+ aria-selected={{if this.isActive "true" "false"}}+ aria-controls={{this.ariaControls}}+ data-tab-number={{@tab.position}}+ href={{@tab.linkWhenActive}}+ {{on "click" @onTabClick}}+ {{on "keydown" @onTabClick}}+ >+ {{icon @tab.icon}}+ {{#if @tab.count}}+ <span+ aria-hidden="true"+ class="badge-notification"+ >{{@tab.count}}</span>+ {{/if}}+ {{yield}}+ </a>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/user-menu/menu.gjs b/app/assets/javascripts/discourse/app/components/user-menu/menu.gjsindex dc2a84b2c02..f0331c32fdc 100644--- a/app/assets/javascripts/discourse/app/components/user-menu/menu.gjs+++ b/app/assets/javascripts/discourse/app/components/user-menu/menu.gjs@@ -1,14 +1,19 @@import Component from "@glimmer/component";import { cached, tracked } from "@glimmer/tracking";+import { concat, fn, hash } from "@ember/helper";import { action } from "@ember/object";import { getOwner } from "@ember/owner";+import didInsert from "@ember/render-modifiers/modifiers/did-insert";import { service } from "@ember/service";+import PluginOutlet from "discourse/components/plugin-outlet";+import MenuTab from "discourse/components/user-menu/menu-tab";import { bind } from "discourse/lib/decorators";import deprecated from "discourse/lib/deprecated";import getUrl from "discourse/lib/get-url";import { wantsNewWindow } from "discourse/lib/intercept-click";import UserMenuTab, { CUSTOM_TABS_CLASSES } from "discourse/lib/user-menu/tab";import { NO_REMINDER_ICON } from "discourse/models/bookmark";+import { i18n } from "discourse-i18n";import UserMenuBookmarksList from "./bookmarks-list";import UserMenuLikesNotificationsList from "./likes-notifications-list";import UserMenuMessagesList from "./messages-list";@@ -323,56 +328,58 @@ export default class UserMenu extends Component {focusFirstTab(topTabsContainerElement) {topTabsContainerElement.querySelector(".btn.active")?.focus();}-}-<div- class={{this.classNames}}- data-tab-id={{this.currentTabId}}- data-max-width="320"- {{did-insert this.triggerRenderedAppEvent}}->- <div class="panel-body">- <div class="panel-body-contents">- <div- class="menu-tabs-container"- role="tablist"- aria-orientation="vertical"- aria-label={{i18n "user_menu.sr_menu_tabs"}}- >- <div class="top-tabs tabs-list" {{did-insert this.focusFirstTab}}>- {{#each this.topTabs as |tab|}}- <UserMenu::MenuTab- @tab={{tab}}- @currentTabId={{this.currentTabId}}- @onTabClick={{fn this.handleTabClick tab}}+ <template>+ <div+ class={{this.classNames}}+ data-tab-id={{this.currentTabId}}+ data-max-width="320"+ {{didInsert this.triggerRenderedAppEvent}}+ >+ <div class="panel-body">+ <div class="panel-body-contents">+ <div+ class="menu-tabs-container"+ role="tablist"+ aria-orientation="vertical"+ aria-label={{i18n "user_menu.sr_menu_tabs"}}+ >+ <div class="top-tabs tabs-list" {{didInsert this.focusFirstTab}}>+ {{#each this.topTabs as |tab|}}+ <MenuTab+ @tab={{tab}}+ @currentTabId={{this.currentTabId}}+ @onTabClick={{fn this.handleTabClick tab}}+ />+ {{/each}}+ </div>+ <div class="bottom-tabs tabs-list">+ {{#each this.bottomTabs as |tab|}}+ <MenuTab+ @tab={{tab}}+ @currentTabId={{this.currentTabId}}+ @onTabClick={{fn this.handleTabClick tab}}+ />+ {{/each}}+ </div>++ <PluginOutlet+ @name="user-menu-tabs-list__after"+ @outletArgs={{hash user=this.currentUser}}/>- {{/each}}- </div>- <div class="bottom-tabs tabs-list">- {{#each this.bottomTabs as |tab|}}- <UserMenu::MenuTab- @tab={{tab}}- @currentTabId={{this.currentTabId}}- @onTabClick={{fn this.handleTabClick tab}}+ </div>+ <div+ id={{concat "quick-access-" this.currentTabId}}+ class="quick-access-panel"+ >+ <this.currentPanelComponent+ @closeUserMenu={{@closeUserMenu}}+ @filterByTypes={{this.currentNotificationTypes}}+ @ariaLabelledby={{concat "user-menu-button-" this.currentTabId}}/>- {{/each}}+ </div></div>-- <PluginOutlet- @name="user-menu-tabs-list__after"- @outletArgs={{hash user=this.currentUser}}- />- </div>- <div- id={{concat "quick-access-" this.currentTabId}}- class="quick-access-panel"- >- <this.currentPanelComponent- @closeUserMenu={{@closeUserMenu}}- @filterByTypes={{this.currentNotificationTypes}}- @ariaLabelledby={{concat "user-menu-button-" this.currentTabId}}- /></div></div>- </div>-</div>\ No newline at end of file+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/user-menu/messages-list-empty-state.gjs b/app/assets/javascripts/discourse/app/components/user-menu/messages-list-empty-state.gjsindex 226a84b73e8..678063219a3 100644--- a/app/assets/javascripts/discourse/app/components/user-menu/messages-list-empty-state.gjs+++ b/app/assets/javascripts/discourse/app/components/user-menu/messages-list-empty-state.gjs@@ -1,16 +1,24 @@-<div class="empty-state">- <span class="empty-state-title">- {{i18n "user.no_messages_title"}}- </span>- <div class="empty-state-body">- <p>- {{html-safe- (i18n- "user.no_messages_body"- icon=(d-icon "envelope")- aboutUrl=(get-url "/about")- )- }}- </p>+import { htmlSafe } from "@ember/template";+import icon from "discourse/helpers/d-icon";+import getUrl from "discourse/helpers/get-url";+import { i18n } from "discourse-i18n";++const MessagesListEmptyState = <template>+ <div class="empty-state">+ <span class="empty-state-title">+ {{i18n "user.no_messages_title"}}+ </span>+ <div class="empty-state-body">+ <p>+ {{htmlSafe+ (i18n+ "user.no_messages_body"+ icon=(icon "envelope")+ aboutUrl=(getUrl "/about")+ )+ }}+ </p>+ </div></div>-</div>\ No newline at end of file+</template>;+export default MessagesListEmptyState;diff --git a/app/assets/javascripts/discourse/app/components/user-menu/notifications-list-empty-state.gjs b/app/assets/javascripts/discourse/app/components/user-menu/notifications-list-empty-state.gjsindex 4b3facdb878..e1eef082ac9 100644--- a/app/assets/javascripts/discourse/app/components/user-menu/notifications-list-empty-state.gjs+++ b/app/assets/javascripts/discourse/app/components/user-menu/notifications-list-empty-state.gjs@@ -1,16 +1,24 @@-<div class="empty-state">- <span class="empty-state-title">- {{i18n "user.no_notifications_title"}}- </span>- <div class="empty-state-body">- <p>- {{html-safe- (i18n- "user.no_notifications_body"- icon=(d-icon "bell")- preferencesUrl=(get-url "/my/preferences/notifications")- )- }}- </p>+import { htmlSafe } from "@ember/template";+import icon from "discourse/helpers/d-icon";+import getUrl from "discourse/helpers/get-url";+import { i18n } from "discourse-i18n";++const NotificationsListEmptyState = <template>+ <div class="empty-state">+ <span class="empty-state-title">+ {{i18n "user.no_notifications_title"}}+ </span>+ <div class="empty-state-body">+ <p>+ {{htmlSafe+ (i18n+ "user.no_notifications_body"+ icon=(icon "bell")+ preferencesUrl=(getUrl "/my/preferences/notifications")+ )+ }}+ </p>+ </div></div>-</div>\ No newline at end of file+</template>;+export default NotificationsListEmptyState;diff --git a/app/assets/javascripts/discourse/app/components/user-menu/other-notifications-list-empty-state.gjs b/app/assets/javascripts/discourse/app/components/user-menu/other-notifications-list-empty-state.gjsindex 879134e8ebb..0a623394acb 100644--- a/app/assets/javascripts/discourse/app/components/user-menu/other-notifications-list-empty-state.gjs+++ b/app/assets/javascripts/discourse/app/components/user-menu/other-notifications-list-empty-state.gjs@@ -1,10 +1,16 @@-<div class="empty-state">- <span class="empty-state-title">- {{i18n "user.no_other_notifications_title"}}- </span>- <div class="empty-state-body">- <p>- {{html-safe (i18n "user.no_other_notifications_body")}}- </p>+import { htmlSafe } from "@ember/template";+import { i18n } from "discourse-i18n";++const OtherNotificationsListEmptyState = <template>+ <div class="empty-state">+ <span class="empty-state-title">+ {{i18n "user.no_other_notifications_title"}}+ </span>+ <div class="empty-state-body">+ <p>+ {{htmlSafe (i18n "user.no_other_notifications_body")}}+ </p>+ </div></div>-</div>\ No newline at end of file+</template>;+export default OtherNotificationsListEmptyState;diff --git a/app/assets/javascripts/discourse/app/components/user-menu/profile-tab-content.gjs b/app/assets/javascripts/discourse/app/components/user-menu/profile-tab-content.gjsindex 178ca285b90..4a45de403c5 100644--- a/app/assets/javascripts/discourse/app/components/user-menu/profile-tab-content.gjs+++ b/app/assets/javascripts/discourse/app/components/user-menu/profile-tab-content.gjs@@ -1,11 +1,19 @@import Component from "@glimmer/component";import { action } from "@ember/object";+import { LinkTo } from "@ember/routing";import { service } from "@ember/service";+import DButton from "discourse/components/d-button";import DoNotDisturbModal from "discourse/components/modal/do-not-disturb";import UserStatusModal from "discourse/components/modal/user-status";+import concatClass from "discourse/helpers/concat-class";+import icon from "discourse/helpers/d-icon";+import emoji from "discourse/helpers/emoji";+import formatAge from "discourse/helpers/format-age";+import routeAction from "discourse/helpers/route-action";import { ajax } from "discourse/lib/ajax";import DoNotDisturb from "discourse/lib/do-not-disturb";import { userPath } from "discourse/lib/url";+import { i18n } from "discourse-i18n";const _extraItems = [];@@ -107,172 +115,186 @@ export default class UserMenuProfileTabContent extends Component {await ajax(userPath("toggle-anon"), { type: "POST" });window.location.reload();}-}-<ul aria-labelledby={{@ariaLabelledby}}>- {{#if this.siteSettings.enable_user_status}}- <li class="set-user-status">- <DButton- @action={{this.setUserStatusClick}}- class="btn-flat profile-tab-btn"+ <template>+ <ul aria-labelledby={{@ariaLabelledby}}>+ {{#if this.siteSettings.enable_user_status}}+ <li class="set-user-status">+ <DButton+ @action={{this.setUserStatusClick}}+ class="btn-flat profile-tab-btn"+ >+ {{#if this.currentUser.status}}+ {{emoji this.currentUser.status.emoji}}+ <span class="item-label">+ {{this.currentUser.status.description}}+ {{#if this.currentUser.status.ends_at}}+ {{formatAge this.currentUser.status.ends_at}}+ {{/if}}+ </span>+ {{else}}+ {{icon "circle-plus"}}+ <span class="item-label">+ {{i18n "user_status.set_custom_status"}}+ </span>+ {{/if}}+ </DButton>+ </li>+ {{/if}}++ <li+ class={{concatClass+ "presence-toggle"+ (unless this.isPresenceHidden "enabled")+ }}+ title={{i18n "presence_toggle.title"}}>- {{#if this.currentUser.status}}- {{emoji this.currentUser.status.emoji}}+ <DButton+ @action={{this.togglePresence}}+ class="btn-flat profile-tab-btn"+ >+ {{icon (if this.isPresenceHidden "toggle-off" "toggle-on")}}<span class="item-label">- {{this.currentUser.status.description}}- {{#if this.currentUser.status.ends_at}}- {{format-age this.currentUser.status.ends_at}}+ {{#if this.isPresenceHidden}}+ {{i18n "presence_toggle.offline"}}+ {{else}}+ {{i18n "presence_toggle.online"}}{{/if}}</span>- {{else}}- {{d-icon "circle-plus"}}+ </DButton>+ </li>++ <li+ class={{concatClass+ "do-not-disturb"+ (if this.isInDoNotDisturb "enabled")+ }}+ >+ <DButton+ @action={{this.doNotDisturbClick}}+ class="btn-flat profile-tab-btn"+ >+ {{icon (if this.isInDoNotDisturb "toggle-on" "toggle-off")}}<span class="item-label">- {{i18n "user_status.set_custom_status"}}+ {{#if this.isInDoNotDisturb}}+ <span>{{i18n "pause_notifications.label"}}</span>+ {{#if this.showDoNotDisturbEndDate}}+ {{formatAge this.doNotDisturbDateTime}}+ {{/if}}+ {{else}}+ {{i18n "pause_notifications.label"}}+ {{/if}}</span>- {{/if}}- </DButton>- </li>- {{/if}}+ </DButton>+ </li>- <li- class={{concat-class- "presence-toggle"- (unless this.isPresenceHidden "enabled")- }}- title={{i18n "presence_toggle.title"}}- >- <DButton @action={{this.togglePresence}} class="btn-flat profile-tab-btn">- {{d-icon (if this.isPresenceHidden "toggle-off" "toggle-on")}}- <span class="item-label">- {{#if this.isPresenceHidden}}- {{i18n "presence_toggle.offline"}}- {{else}}- {{i18n "presence_toggle.online"}}- {{/if}}- </span>- </DButton>- </li>+ <hr />- <li- class={{concat-class "do-not-disturb" (if this.isInDoNotDisturb "enabled")}}- >- <DButton- @action={{this.doNotDisturbClick}}- class="btn-flat profile-tab-btn"- >- {{d-icon (if this.isInDoNotDisturb "toggle-on" "toggle-off")}}- <span class="item-label">- {{#if this.isInDoNotDisturb}}- <span>{{i18n "pause_notifications.label"}}</span>- {{#if this.showDoNotDisturbEndDate}}- {{format-age this.doNotDisturbDateTime}}- {{/if}}- {{else}}- {{i18n "pause_notifications.label"}}- {{/if}}- </span>- </DButton>- </li>-- <hr />-- <li class="summary">- <LinkTo @route="user.summary" @model={{this.currentUser}}>- {{d-icon "user"}}- <span class="item-label">- {{i18n "user.summary.title"}}- </span>- </LinkTo>- </li>-- <li class="activity">- <LinkTo @route="userActivity" @model={{this.currentUser}}>- {{d-icon "bars-staggered"}}- <span class="item-label">- {{i18n "user.activity_stream"}}- </span>- </LinkTo>- </li>-- {{#if this.currentUser.can_invite_to_forum}}- <li class="invites">- <LinkTo @route="userInvited" @model={{this.currentUser}}>- {{d-icon "user-plus"}}- <span class="item-label">- {{i18n "user.invited.title"}}- </span>- </LinkTo>- </li>- {{/if}}+ <li class="summary">+ <LinkTo @route="user.summary" @model={{this.currentUser}}>+ {{icon "user"}}+ <span class="item-label">+ {{i18n "user.summary.title"}}+ </span>+ </LinkTo>+ </li>- <li class="drafts">- <LinkTo @route="userActivity.drafts" @model={{this.currentUser}}>- {{d-icon "user_menu.drafts"}}- <span class="item-label">- {{#if this.currentUser.draft_count}}- {{i18n "drafts.label_with_count" count=this.currentUser.draft_count}}- {{else}}- {{i18n "drafts.label"}}- {{/if}}- </span>- </LinkTo>- </li>+ <li class="activity">+ <LinkTo @route="userActivity" @model={{this.currentUser}}>+ {{icon "bars-staggered"}}+ <span class="item-label">+ {{i18n "user.activity_stream"}}+ </span>+ </LinkTo>+ </li>- <li class="preferences">- <LinkTo @route="preferences" @model={{this.currentUser}}>- {{d-icon "gear"}}- <span class="item-label">- {{i18n "user.preferences.title"}}- </span>- </LinkTo>- </li>+ {{#if this.currentUser.can_invite_to_forum}}+ <li class="invites">+ <LinkTo @route="userInvited" @model={{this.currentUser}}>+ {{icon "user-plus"}}+ <span class="item-label">+ {{i18n "user.invited.title"}}+ </span>+ </LinkTo>+ </li>+ {{/if}}- {{#if this.showToggleAnonymousButton}}- <li- class={{if- this.currentUser.is_anonymous- "disable-anonymous"- "enable-anonymous"- }}- >- <DButton- @action={{this.toggleAnonymous}}- class="btn-flat profile-tab-btn"- >- {{#if this.currentUser.is_anonymous}}- {{d-icon "ban"}}+ <li class="drafts">+ <LinkTo @route="userActivity.drafts" @model={{this.currentUser}}>+ {{icon "user_menu.drafts"}}<span class="item-label">- {{i18n "switch_from_anon"}}+ {{#if this.currentUser.draft_count}}+ {{i18n+ "drafts.label_with_count"+ count=this.currentUser.draft_count+ }}+ {{else}}+ {{i18n "drafts.label"}}+ {{/if}}</span>- {{else}}- {{d-icon "user-secret"}}+ </LinkTo>+ </li>++ <li class="preferences">+ <LinkTo @route="preferences" @model={{this.currentUser}}>+ {{icon "gear"}}<span class="item-label">- {{i18n "switch_to_anon"}}+ {{i18n "user.preferences.title"}}</span>- {{/if}}- </DButton>- </li>- {{/if}}+ </LinkTo>+ </li>- {{#each this.extraItems as |item|}}- <li class={{item.className}}>- <a href={{item.href}}>- {{#if item.icon}}- {{d-icon item.icon}}- {{/if}}- <span class="item-label">- {{item.content}}- </span>- </a>- </li>- {{/each}}+ {{#if this.showToggleAnonymousButton}}+ <li+ class={{if+ this.currentUser.is_anonymous+ "disable-anonymous"+ "enable-anonymous"+ }}+ >+ <DButton+ @action={{this.toggleAnonymous}}+ class="btn-flat profile-tab-btn"+ >+ {{#if this.currentUser.is_anonymous}}+ {{icon "ban"}}+ <span class="item-label">+ {{i18n "switch_from_anon"}}+ </span>+ {{else}}+ {{icon "user-secret"}}+ <span class="item-label">+ {{i18n "switch_to_anon"}}+ </span>+ {{/if}}+ </DButton>+ </li>+ {{/if}}- <li class="logout">- <DButton @action={{route-action "logout"}} class="btn-flat profile-tab-btn">- {{d-icon "right-from-bracket"}}- <span class="item-label">- {{i18n "user.log_out"}}- </span>- </DButton>- </li>-</ul>\ No newline at end of file+ {{#each this.extraItems as |item|}}+ <li class={{item.className}}>+ <a href={{item.href}}>+ {{#if item.icon}}+ {{icon item.icon}}+ {{/if}}+ <span class="item-label">+ {{item.content}}+ </span>+ </a>+ </li>+ {{/each}}++ <li class="logout">+ <DButton+ @action={{routeAction "logout"}}+ class="btn-flat profile-tab-btn"+ >+ {{icon "right-from-bracket"}}+ <span class="item-label">+ {{i18n "user.log_out"}}+ </span>+ </DButton>+ </li>+ </ul>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/user-nav.gjs b/app/assets/javascripts/discourse/app/components/user-nav.gjsindex 35ad34f81a0..96e316faa36 100644--- a/app/assets/javascripts/discourse/app/components/user-nav.gjs+++ b/app/assets/javascripts/discourse/app/components/user-nav.gjs@@ -1,89 +1,100 @@-<section class="user-navigation user-navigation-primary">- <HorizontalOverflowNav- @ariaLabel="User primary"- class="main-nav nav user-nav"- >- {{#unless @user.profile_hidden}}- <DNavigationItem @route="user.summary" class="user-nav__summary">- {{d-icon "user"}}- <span>{{i18n "user.summary.title"}}</span>- </DNavigationItem>+import { hash } from "@ember/helper";+import { and } from "truth-helpers";+import DNavigationItem from "discourse/components/d-navigation-item";+import HorizontalOverflowNav from "discourse/components/horizontal-overflow-nav";+import PluginOutlet from "discourse/components/plugin-outlet";+import icon from "discourse/helpers/d-icon";+import { i18n } from "discourse-i18n";- {{#if @showActivityTab}}+const UserNav = <template>+ <section class="user-navigation user-navigation-primary">+ <HorizontalOverflowNav+ @ariaLabel="User primary"+ class="main-nav nav user-nav"+ >+ {{#unless @user.profile_hidden}}+ <DNavigationItem @route="user.summary" class="user-nav__summary">+ {{icon "user"}}+ <span>{{i18n "user.summary.title"}}</span>+ </DNavigationItem>++ {{#if @showActivityTab}}+ <DNavigationItem+ @route="userActivity"+ @ariaCurrentContext="parentNav"+ class="user-nav__activity"+ >+ {{icon "bars-staggered"}}+ <span>{{i18n "user.activity_stream"}}</span>+ </DNavigationItem>+ {{/if}}+ {{/unless}}++ {{#if @showNotificationsTab}}<DNavigationItem- @route="userActivity"+ @route="userNotifications"@ariaCurrentContext="parentNav"- class="user-nav__activity"+ class="user-nav__notifications">- {{d-icon "bars-staggered"}}- <span>{{i18n "user.activity_stream"}}</span>+ {{icon "bell" class="glyph"}}+ <span>{{i18n "user.notifications"}}</span></DNavigationItem>{{/if}}- {{/unless}}- {{#if @showNotificationsTab}}- <DNavigationItem- @route="userNotifications"- @ariaCurrentContext="parentNav"- class="user-nav__notifications"- >- {{d-icon "bell" class="glyph"}}- <span>{{i18n "user.notifications"}}</span>- </DNavigationItem>- {{/if}}-- {{#if @showPrivateMessages}}- <DNavigationItem- @route="userPrivateMessages"- @ariaCurrentContext="parentNav"- class="user-nav__personal-messages"- >- {{d-icon "envelope"}}- <span>{{i18n "user.private_messages"}}</span>- </DNavigationItem>- {{/if}}+ {{#if @showPrivateMessages}}+ <DNavigationItem+ @route="userPrivateMessages"+ @ariaCurrentContext="parentNav"+ class="user-nav__personal-messages"+ >+ {{icon "envelope"}}+ <span>{{i18n "user.private_messages"}}</span>+ </DNavigationItem>+ {{/if}}- {{#if @canInviteToForum}}- <DNavigationItem- @route="userInvited"- @ariaCurrentContext="parentNav"- class="user-nav__invites"- >- {{d-icon "user-plus"}}- <span>{{i18n "user.invited.title"}}</span>- </DNavigationItem>- {{/if}}+ {{#if @canInviteToForum}}+ <DNavigationItem+ @route="userInvited"+ @ariaCurrentContext="parentNav"+ class="user-nav__invites"+ >+ {{icon "user-plus"}}+ <span>{{i18n "user.invited.title"}}</span>+ </DNavigationItem>+ {{/if}}- {{#if @showBadges}}- <DNavigationItem @route="user.badges" class="user-nav__badges">- {{d-icon "certificate"}}- <span>{{i18n "badges.title"}}</span>- </DNavigationItem>- {{/if}}+ {{#if @showBadges}}+ <DNavigationItem @route="user.badges" class="user-nav__badges">+ {{icon "certificate"}}+ <span>{{i18n "badges.title"}}</span>+ </DNavigationItem>+ {{/if}}- <PluginOutlet- @name="user-main-nav"- @connectorTagName="li"- @outletArgs={{hash model=@user}}- />+ <PluginOutlet+ @name="user-main-nav"+ @connectorTagName="li"+ @outletArgs={{hash model=@user}}+ />- {{#if @user.can_edit}}- <DNavigationItem- @route="preferences"- @ariaCurrentContext="parentNav"- class="user-nav__preferences"- >- {{d-icon "gear"}}- <span>{{i18n "user.preferences.title"}}</span>- </DNavigationItem>- {{/if}}- {{#if (and @isMobileView @isStaff)}}- <li class="user-nav__admin">- <a href={{@user.adminPath}}>- {{d-icon "wrench"}}- <span>{{i18n "admin.user.manage_user"}}</span>- </a>- </li>- {{/if}}- </HorizontalOverflowNav>-</section>\ No newline at end of file+ {{#if @user.can_edit}}+ <DNavigationItem+ @route="preferences"+ @ariaCurrentContext="parentNav"+ class="user-nav__preferences"+ >+ {{icon "gear"}}+ <span>{{i18n "user.preferences.title"}}</span>+ </DNavigationItem>+ {{/if}}+ {{#if (and @isMobileView @isStaff)}}+ <li class="user-nav__admin">+ <a href={{@user.adminPath}}>+ {{icon "wrench"}}+ <span>{{i18n "admin.user.manage_user"}}</span>+ </a>+ </li>+ {{/if}}+ </HorizontalOverflowNav>+ </section>+</template>;+export default UserNav;diff --git a/app/assets/javascripts/discourse/app/components/user-notification-schedule.gjs b/app/assets/javascripts/discourse/app/components/user-notification-schedule.gjsindex 85177ccbb8e..a9fe50f4a6e 100644--- a/app/assets/javascripts/discourse/app/components/user-notification-schedule.gjs+++ b/app/assets/javascripts/discourse/app/components/user-notification-schedule.gjs@@ -1,5 +1,7 @@import Component from "@ember/component";import EmberObject, { action } from "@ember/object";+import PreferenceCheckbox from "discourse/components/preference-checkbox";+import UserNotificationScheduleDay from "discourse/components/user-notification-schedule-day";import discourseComputed from "discourse/lib/decorators";import { i18n } from "discourse-i18n";@@ -136,37 +138,39 @@ export default class UserNotificationSchedule extends Component {}return timeOptions;}-}-<div- class="control-group notification-schedule"- data-setting-name="user-notification-schedule"->- <label class="control-label">{{i18n- "user.notification_schedule.title"- }}</label>- <PreferenceCheckbox- @labelKey="user.notification_schedule.label"- @checked={{this.model.user_notification_schedule.enabled}}- />-- {{#if this.model.user_notification_schedule.enabled}}- <div class="instruction">{{i18n "user.notification_schedule.tip"}}</div>-- <table class="notification-schedule-table">- <tbody class="notification-schedule-tbody">- {{#each this.days as |day|}}- <UserNotificationScheduleDay- @day={{day.day}}- @startTimeOptions={{day.startTimeOptions}}- @startTimeValue={{day.startTimeValue}}- @onChangeStartTime={{day.onChangeStartTime}}- @endTimeOptions={{day.endTimeOptions}}- @endTimeValue={{day.endTimeValue}}- @onChangeEndTime={{day.onChangeEndTime}}- />- {{/each}}- </tbody>- </table>- {{/if}}-</div>\ No newline at end of file+ <template>+ <div+ class="control-group notification-schedule"+ data-setting-name="user-notification-schedule"+ >+ <label class="control-label">{{i18n+ "user.notification_schedule.title"+ }}</label>+ <PreferenceCheckbox+ @labelKey="user.notification_schedule.label"+ @checked={{this.model.user_notification_schedule.enabled}}+ />++ {{#if this.model.user_notification_schedule.enabled}}+ <div class="instruction">{{i18n "user.notification_schedule.tip"}}</div>++ <table class="notification-schedule-table">+ <tbody class="notification-schedule-tbody">+ {{#each this.days as |day|}}+ <UserNotificationScheduleDay+ @day={{day.day}}+ @startTimeOptions={{day.startTimeOptions}}+ @startTimeValue={{day.startTimeValue}}+ @onChangeStartTime={{day.onChangeStartTime}}+ @endTimeOptions={{day.endTimeOptions}}+ @endTimeValue={{day.endTimeValue}}+ @onChangeEndTime={{day.onChangeEndTime}}+ />+ {{/each}}+ </tbody>+ </table>+ {{/if}}+ </div>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/user-preferences/user-api-keys.gjs b/app/assets/javascripts/discourse/app/components/user-preferences/user-api-keys.gjsindex 1148d45da1a..875e2d40a86 100644--- a/app/assets/javascripts/discourse/app/components/user-preferences/user-api-keys.gjs+++ b/app/assets/javascripts/discourse/app/components/user-preferences/user-api-keys.gjs@@ -1,47 +1,58 @@-{{#if @model.userApiKeys}}- <div class="control-group pref-user-api-keys">- <label class="control-label pref-user-api-keys__label">{{i18n- "user.apps"- }}</label>+import { fn } from "@ember/helper";+import DButton from "discourse/components/d-button";+import boundDate from "discourse/helpers/bound-date";+import routeAction from "discourse/helpers/route-action";+import { i18n } from "discourse-i18n";- <div class="controls">- {{#each @model.userApiKeys as |key|}}- <div>- <span- class="pref-user-api-keys__application-name"- >{{key.application_name}}</span>+const UserApiKeys = <template>+ {{#if @model.userApiKeys}}+ <div class="control-group pref-user-api-keys">+ <label class="control-label pref-user-api-keys__label">{{i18n+ "user.apps"+ }}</label>- {{#if key.revoked}}- <DButton- @action={{fn (route-action "undoRevokeApiKey") key}}- @label="user.undo_revoke_access"- />- {{else}}- <DButton- @action={{fn (route-action "revokeApiKey") key}}- @label="user.revoke_access"- />- {{/if}}+ <div class="controls">+ {{#each @model.userApiKeys as |key|}}+ <div>+ <span+ class="pref-user-api-keys__application-name"+ >{{key.application_name}}</span>- <p>- <ul class="pref-user-api-keys__scopes-list">- {{#each key.scopes as |scope|}}- <li class="pref-user-api-keys__scopes-list-item">{{scope}}</li>- {{/each}}- </ul>- </p>+ {{#if key.revoked}}+ <DButton+ @action={{fn (routeAction "undoRevokeApiKey") key}}+ @label="user.undo_revoke_access"+ />+ {{else}}+ <DButton+ @action={{fn (routeAction "revokeApiKey") key}}+ @label="user.revoke_access"+ />+ {{/if}}- <p class="pref-user-api-keys__created-at">- <span>{{i18n "user.api_approved"}}</span>- {{bound-date key.created_at}}- </p>+ <p>+ <ul class="pref-user-api-keys__scopes-list">+ {{#each key.scopes as |scope|}}+ <li+ class="pref-user-api-keys__scopes-list-item"+ >{{scope}}</li>+ {{/each}}+ </ul>+ </p>- <p class="pref-user-api-keys__last-used-at">- <span>{{i18n "user.api_last_used_at"}}</span>- {{bound-date key.last_used_at}}- </p>- </div>- {{/each}}+ <p class="pref-user-api-keys__created-at">+ <span>{{i18n "user.api_approved"}}</span>+ {{boundDate key.created_at}}+ </p>++ <p class="pref-user-api-keys__last-used-at">+ <span>{{i18n "user.api_last_used_at"}}</span>+ {{boundDate key.last_used_at}}+ </p>+ </div>+ {{/each}}+ </div></div>- </div>-{{/if}}\ No newline at end of file+ {{/if}}+</template>;+export default UserApiKeys;diff --git a/app/assets/javascripts/discourse/app/components/user-profile-avatar.gjs b/app/assets/javascripts/discourse/app/components/user-profile-avatar.gjsindex 2eb9efefe27..c81894b564d 100644--- a/app/assets/javascripts/discourse/app/components/user-profile-avatar.gjs+++ b/app/assets/javascripts/discourse/app/components/user-profile-avatar.gjs@@ -1,25 +1,31 @@import Component from "@ember/component";+import { hash } from "@ember/helper";+import PluginOutlet from "discourse/components/plugin-outlet";+import UserAvatarFlair from "discourse/components/user-avatar-flair";+import boundAvatar from "discourse/helpers/bound-avatar";-export default class UserProfileAvatar extends Component {}--<PluginOutlet- @name="user-profile-avatar-wrapper"- @outletArgs={{hash user=@user}}->- <div class="user-profile-avatar">+export default class UserProfileAvatar extends Component {+ <template><PluginOutlet- @name="user-profile-avatar-img-wrapper"+ @name="user-profile-avatar-wrapper"@outletArgs={{hash user=@user}}>- {{bound-avatar @user "huge"}}- </PluginOutlet>+ <div class="user-profile-avatar">+ <PluginOutlet+ @name="user-profile-avatar-img-wrapper"+ @outletArgs={{hash user=@user}}+ >+ {{boundAvatar @user "huge"}}+ </PluginOutlet>- <UserAvatarFlair @user={{@user}} />- <div>- <PluginOutlet- @name="user-profile-avatar-flair"- @outletArgs={{hash model=@user}}- />- </div>- </div>-</PluginOutlet>\ No newline at end of file+ <UserAvatarFlair @user={{@user}} />+ <div>+ <PluginOutlet+ @name="user-profile-avatar-flair"+ @outletArgs={{hash model=@user}}+ />+ </div>+ </div>+ </PluginOutlet>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/user-stream-item.gjs b/app/assets/javascripts/discourse/app/components/user-stream-item.gjsindex d417140e6c7..5365c03f4e5 100644--- a/app/assets/javascripts/discourse/app/components/user-stream-item.gjs+++ b/app/assets/javascripts/discourse/app/components/user-stream-item.gjs@@ -1,6 +1,18 @@import Component from "@ember/component";+import { fn, hash } from "@ember/helper";import { computed } from "@ember/object";+import { htmlSafe } from "@ember/template";import { classNameBindings, tagName } from "@ember-decorators/component";+import { or } from "truth-helpers";+import DButton from "discourse/components/d-button";+import ExpandPost from "discourse/components/expand-post";+import PluginOutlet from "discourse/components/plugin-outlet";+import TopicStatus from "discourse/components/topic-status";+import avatar from "discourse/helpers/avatar";+import categoryLink from "discourse/helpers/category-link";+import icon from "discourse/helpers/d-icon";+import formatDate from "discourse/helpers/format-date";+import replaceEmoji from "discourse/helpers/replace-emoji";import { propertyEqual } from "discourse/lib/computed";import discourseComputed from "discourse/lib/decorators";import deprecated from "discourse/lib/deprecated";@@ -50,126 +62,136 @@ export default class UserStreamItem extends Component {userUrl(draftUsername, username) {return userPath((draftUsername || username).toLowerCase());}-}--<PluginOutlet @name="user-stream-item-above" @outletArgs={{hash item=@item}} />--<div class="user-stream-item__header info">- <a- href={{this.userUrl}}- data-user-card={{or @item.draft_username @item.username}}- class="avatar-link"- >- <div class="avatar-wrapper">- {{avatar @item imageSize="large" extraClasses="actor" ignoreTitle="true"}}- </div>- </a>-- <div class="user-stream-item__details">- <div class="stream-topic-title">- <TopicStatus @topic={{@item}} @disableActions={{true}} />- <span class="title">- {{#if @item.postUrl}}- <a href={{@item.postUrl}}>{{replace-emoji @item.title}}</a>- {{else}}- {{replace-emoji @item.title}}- {{/if}}- </span>- </div>- <div class="category">{{category-link @item.category}}</div>- </div>-- {{#if @item.draftType}}- <span class="draft-type">{{html-safe @item.draftType}}</span>- {{else}}- <ExpandPost @item={{@item}} />- {{/if}}-- <div class="user-stream-item__metadata">- <span class="time">{{format-date @item.created_at}}</span>-- {{#if @item.deleted_by}}- <span class="delete-info">- {{d-icon "trash-can"}}- {{avatar- @item.deleted_by- imageSize="tiny"- extraClasses="actor"- ignoreTitle="true"- }}- {{format-date @item.deleted_at leaveAgo="true"}}- </span>- {{/if}}- </div>- <span>+ <template><PluginOutlet- @name="user-stream-item-header"- @connectorTagName="div"+ @name="user-stream-item-above"@outletArgs={{hash item=@item}}/>- </span>-</div>--{{#if this.actionDescription}}- <p class="excerpt">{{this.actionDescription}}</p>-{{/if}}--<p- data-topic-id={{@item.topic_id}}- data-post-id={{@item.post_id}}- data-user-id={{@item.user_id}}- class="excerpt"->- {{~#if @item.expandedExcerpt}}- {{~html-safe @item.expandedExcerpt~}}- {{else}}- {{~html-safe @item.excerpt~}}- {{/if~}}-</p>--{{#each @item.children as |child|}}- {{! DEPRECATED: 'child-actions' class }}- <div class="user-stream-item-actions child-actions">- {{d-icon child.icon class="icon"}}- {{#each child.items as |grandChild|}}++ <div class="user-stream-item__header info"><a- href={{grandChild.userUrl}}- data-user-card={{grandChild.username}}+ href={{this.userUrl}}+ data-user-card={{or @item.draft_username @item.username}}class="avatar-link"><div class="avatar-wrapper">{{avatar- grandChild- imageSize="tiny"+ @item+ imageSize="large"extraClasses="actor"ignoreTitle="true"- avatarTemplatePath="acting_avatar_template"}}</div></a>- {{#if grandChild.edit_reason}}- —- <span class="edit-reason">{{grandChild.edit_reason}}</span>{{/if}}++ <div class="user-stream-item__details">+ <div class="stream-topic-title">+ <TopicStatus @topic={{@item}} @disableActions={{true}} />+ <span class="title">+ {{#if @item.postUrl}}+ <a href={{@item.postUrl}}>{{replaceEmoji @item.title}}</a>+ {{else}}+ {{replaceEmoji @item.title}}+ {{/if}}+ </span>+ </div>+ <div class="category">{{categoryLink @item.category}}</div>+ </div>++ {{#if @item.draftType}}+ <span class="draft-type">{{htmlSafe @item.draftType}}</span>+ {{else}}+ <ExpandPost @item={{@item}} />+ {{/if}}++ <div class="user-stream-item__metadata">+ <span class="time">{{formatDate @item.created_at}}</span>++ {{#if @item.deleted_by}}+ <span class="delete-info">+ {{icon "trash-can"}}+ {{avatar+ @item.deleted_by+ imageSize="tiny"+ extraClasses="actor"+ ignoreTitle="true"+ }}+ {{formatDate @item.deleted_at leaveAgo="true"}}+ </span>+ {{/if}}+ </div>++ <span>+ <PluginOutlet+ @name="user-stream-item-header"+ @connectorTagName="div"+ @outletArgs={{hash item=@item}}+ />+ </span>+ </div>++ {{#if this.actionDescription}}+ <p class="excerpt">{{this.actionDescription}}</p>+ {{/if}}++ <p+ data-topic-id={{@item.topic_id}}+ data-post-id={{@item.post_id}}+ data-user-id={{@item.user_id}}+ class="excerpt"+ >+ {{~#if @item.expandedExcerpt}}+ {{~htmlSafe @item.expandedExcerpt~}}+ {{else}}+ {{~htmlSafe @item.excerpt~}}+ {{/if~}}+ </p>++ {{#each @item.children as |child|}}+ {{! DEPRECATED: 'child-actions' class }}+ <div class="user-stream-item-actions child-actions">+ {{icon child.icon class="icon"}}+ {{#each child.items as |grandChild|}}+ <a+ href={{grandChild.userUrl}}+ data-user-card={{grandChild.username}}+ class="avatar-link"+ >+ <div class="avatar-wrapper">+ {{avatar+ grandChild+ imageSize="tiny"+ extraClasses="actor"+ ignoreTitle="true"+ avatarTemplatePath="acting_avatar_template"+ }}+ </div>+ </a>+ {{#if grandChild.edit_reason}}+ —+ <span class="edit-reason">{{grandChild.edit_reason}}</span>{{/if}}+ {{/each}}+ </div>{{/each}}- </div>-{{/each}}--{{#if @item.editableDraft}}- <div class="user-stream-item-draft-actions">- <DButton- @action={{fn @resumeDraft @item}}- @icon="pencil"- @label="drafts.resume"- class="btn-default resume-draft"- />- <DButton- @action={{fn @removeDraft @item}}- @icon="trash-can"- @title="drafts.remove"- class="btn-danger remove-draft"- />- </div>-{{/if}}-{{yield to="bottom"}}\ No newline at end of file+ {{#if @item.editableDraft}}+ <div class="user-stream-item-draft-actions">+ <DButton+ @action={{fn @resumeDraft @item}}+ @icon="pencil"+ @label="drafts.resume"+ class="btn-default resume-draft"+ />+ <DButton+ @action={{fn @removeDraft @item}}+ @icon="trash-can"+ @title="drafts.remove"+ class="btn-danger remove-draft"+ />+ </div>+ {{/if}}++ {{yield to="bottom"}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/user-summary-category-search.gjs b/app/assets/javascripts/discourse/app/components/user-summary-category-search.gjsindex ba8b90161bb..4afb6128b40 100644--- a/app/assets/javascripts/discourse/app/components/user-summary-category-search.gjs+++ b/app/assets/javascripts/discourse/app/components/user-summary-category-search.gjs@@ -1,4 +1,6 @@import Component from "@ember/component";+import { hash } from "@ember/helper";+import { LinkTo } from "@ember/routing";import { tagName } from "@ember-decorators/component";import discourseComputed from "discourse/lib/decorators";@@ -12,12 +14,14 @@ export default class UserSummaryCategorySearch extends Component {}return query;}-}-{{#if @count}}- <LinkTo @route="full-page-search" @query={{hash q=this.searchParams}}>- {{@count}}- </LinkTo>-{{else}}- –-{{/if}}\ No newline at end of file+ <template>+ {{#if @count}}+ <LinkTo @route="full-page-search" @query={{hash q=this.searchParams}}>+ {{@count}}+ </LinkTo>+ {{else}}+ –+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/user-summary-topic.gjs b/app/assets/javascripts/discourse/app/components/user-summary-topic.gjsindex ebfa8624e36..a896bb9698c 100644--- a/app/assets/javascripts/discourse/app/components/user-summary-topic.gjs+++ b/app/assets/javascripts/discourse/app/components/user-summary-topic.gjs@@ -1,20 +1,30 @@import Component from "@ember/component";+import { hash } from "@ember/helper";+import { htmlSafe } from "@ember/template";import { tagName } from "@ember-decorators/component";+import PluginOutlet from "discourse/components/plugin-outlet";+import icon from "discourse/helpers/d-icon";+import formatDate from "discourse/helpers/format-date";+import number from "discourse/helpers/number";@tagName("li")-export default class UserSummaryTopic extends Component {}--<PluginOutlet- @name="user-summary-topic-wrapper"- @outletArgs={{hash topic=@topic url=@url}}->- <span class="topic-info">- {{format-date @createdAt format="tiny" noTitle="true"}}- {{#if @likes}}- ·- {{d-icon "heart"}} <span class="like-count">{{number @likes}}</span>- {{/if}}- </span>- <br />- <a href={{@url}}>{{html-safe @topic.fancyTitle}}</a>-</PluginOutlet>\ No newline at end of file+export default class UserSummaryTopic extends Component {+ <template>+ <PluginOutlet+ @name="user-summary-topic-wrapper"+ @outletArgs={{hash topic=@topic url=@url}}+ >+ <span class="topic-info">+ {{formatDate @createdAt format="tiny" noTitle="true"}}+ {{#if @likes}}+ ·+ {{icon "heart"}} <span class="like-count">{{number+ @likes+ }}</span>+ {{/if}}+ </span>+ <br />+ <a href={{@url}}>{{htmlSafe @topic.fancyTitle}}</a>+ </PluginOutlet>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/user-summary-topics-list.gjs b/app/assets/javascripts/discourse/app/components/user-summary-topics-list.gjsindex 6e3319050c8..27da7030698 100644--- a/app/assets/javascripts/discourse/app/components/user-summary-topics-list.gjs+++ b/app/assets/javascripts/discourse/app/components/user-summary-topics-list.gjs@@ -1,6 +1,9 @@import Component from "@ember/component";+import { concat } from "@ember/helper";+import { LinkTo } from "@ember/routing";import { tagName } from "@ember-decorators/component";import discourseComputed from "discourse/lib/decorators";+import { i18n } from "discourse-i18n";// should be kept in sync with 'UserSummary::MAX_SUMMARY_RESULTS'const MAX_SUMMARY_RESULTS = 6;@@ -11,25 +14,27 @@ export default class UserSummaryTopicsList extends Component {hasMore(length) {return length >= MAX_SUMMARY_RESULTS;}-}-{{#if @items}}- <ul>- {{#each @items as |item|}}- {{yield item}}- {{/each}}- </ul>- {{#if this.hasMore}}- <p>- <LinkTo- @route={{concat "userActivity." @type}}- @model={{@user}}- class="more"- >- {{i18n (concat "user.summary.more_" @type)}}- </LinkTo>- </p>- {{/if}}-{{else}}- <p>{{i18n (concat "user.summary.no_" @type)}}</p>-{{/if}}\ No newline at end of file+ <template>+ {{#if @items}}+ <ul>+ {{#each @items as |item|}}+ {{yield item}}+ {{/each}}+ </ul>+ {{#if this.hasMore}}+ <p>+ <LinkTo+ @route={{concat "userActivity." @type}}+ @model={{@user}}+ class="more"+ >+ {{i18n (concat "user.summary.more_" @type)}}+ </LinkTo>+ </p>+ {{/if}}+ {{else}}+ <p>{{i18n (concat "user.summary.no_" @type)}}</p>+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/user-summary-user.gjs b/app/assets/javascripts/discourse/app/components/user-summary-user.gjsindex b8263842e3c..d1f45c94745 100644--- a/app/assets/javascripts/discourse/app/components/user-summary-user.gjs+++ b/app/assets/javascripts/discourse/app/components/user-summary-user.gjs@@ -1,10 +1,15 @@import Component from "@ember/component";import { tagName } from "@ember-decorators/component";+import UserInfo from "discourse/components/user-info";+import icon from "discourse/helpers/d-icon";+import number from "discourse/helpers/number";@tagName("li")-export default class UserSummaryUser extends Component {}--<UserInfo @user={{@user}}>- {{d-icon @icon}}- <span class={{@countClass}}>{{number @user.count}}</span>-</UserInfo>\ No newline at end of file+export default class UserSummaryUser extends Component {+ <template>+ <UserInfo @user={{@user}}>+ {{icon @icon}}+ <span class={{@countClass}}>{{number @user.count}}</span>+ </UserInfo>+ </template>+}diff --git a/app/assets/javascripts/discourse/app/components/user-summary-users-list.gjs b/app/assets/javascripts/discourse/app/components/user-summary-users-list.gjsindex f0db0ed5404..eee50832d33 100644--- a/app/assets/javascripts/discourse/app/components/user-summary-users-list.gjs+++ b/app/assets/javascripts/discourse/app/components/user-summary-users-list.gjs@@ -1,13 +1,17 @@import Component from "@ember/component";+import { concat } from "@ember/helper";+import { i18n } from "discourse-i18n";-export default class UserSummaryUsersList extends Component {}--{{#if this.users}}- <ul>- {{#each this.users as |user|}}- {{yield user}}- {{/each}}- </ul>-{{else}}- <p>{{i18n (concat "user.summary." this.none)}}</p>-{{/if}}\ No newline at end of file+export default class UserSummaryUsersList extends Component {+ <template>+ {{#if this.users}}+ <ul>+ {{#each this.users as |user|}}+ {{yield user}}+ {{/each}}+ </ul>+ {{else}}+ <p>{{i18n (concat "user.summary." this.none)}}</p>+ {{/if}}+ </template>+}diff --git a/app/assets/javascripts/discourse/app/templates/about.gjs b/app/assets/javascripts/discourse/app/templates/about.gjsindex 483ba409c21..9a7e6ec8277 100644--- a/app/assets/javascripts/discourse/app/templates/about.gjs+++ b/app/assets/javascripts/discourse/app/templates/about.gjs@@ -1,51 +1,63 @@-<PluginOutlet- @name="about-wrapper"- @outletArgs={{hash- model=this.model- contactInfo=this.contactInfo- faqOverridden=this.faqOverridden- }}->- {{body-class "about-page"}}+import { hash } from "@ember/helper";+import { LinkTo } from "@ember/routing";+import RouteTemplate from "ember-route-template";+import AboutPage from "discourse/components/about-page";+import PluginOutlet from "discourse/components/plugin-outlet";+import bodyClass from "discourse/helpers/body-class";+import { i18n } from "discourse-i18n";- <section>- <div class="container">- <div class="contents clearfix body-page">+export default RouteTemplate(+ <template>+ <PluginOutlet+ @name="about-wrapper"+ @outletArgs={{hash+ }}+ >+ {{bodyClass "about-page"}}- <ul class="nav-pills">- <li class="nav-item-about"><LinkTo- @route="about"- class="active"- >{{i18n "about.simple_title"}}</LinkTo></li>- {{#if this.faqOverridden}}- <li class="nav-item-guidelines"><LinkTo @route="guidelines">{{i18n- "guidelines"- }}</LinkTo></li>- <li class="nav-item-faq"><LinkTo @route="faq">{{i18n- "faq"- }}</LinkTo></li>- {{else if this.renameFaqToGuidelines}}- <li class="nav-item-guidelines"><LinkTo @route="guidelines">{{i18n- "guidelines"- }}</LinkTo></li>- {{else}}- <li class="nav-item-faq"><LinkTo @route="faq">{{i18n- "faq"- }}</LinkTo></li>- {{/if}}- {{#if this.site.tos_url}}- <li class="nav-item-tos"><LinkTo @route="tos">{{i18n- "tos"- }}</LinkTo></li>- {{/if}}- {{#if this.site.privacy_policy_url}}- <li class="nav-item-privacy"><LinkTo @route="privacy">{{i18n- "privacy"- }}</LinkTo></li>- {{/if}}- </ul>- <AboutPage @model={{this.model}} />- </div>- </div>- </section>-</PluginOutlet>\ No newline at end of file+ <section>+ <div class="container">+ <div class="contents clearfix body-page">++ <ul class="nav-pills">+ <li class="nav-item-about"><LinkTo+ @route="about"+ class="active"+ >{{i18n "about.simple_title"}}</LinkTo></li>+ {{#if @controller.faqOverridden}}+ <li class="nav-item-guidelines"><LinkTo+ @route="guidelines"+ >{{i18n "guidelines"}}</LinkTo></li>+ <li class="nav-item-faq"><LinkTo @route="faq">{{i18n+ "faq"+ }}</LinkTo></li>+ {{else if @controller.renameFaqToGuidelines}}+ <li class="nav-item-guidelines"><LinkTo+ @route="guidelines"+ >{{i18n "guidelines"}}</LinkTo></li>+ {{else}}+ <li class="nav-item-faq"><LinkTo @route="faq">{{i18n+ "faq"+ }}</LinkTo></li>+ {{/if}}+ {{#if @controller.site.tos_url}}+ <li class="nav-item-tos"><LinkTo @route="tos">{{i18n+ "tos"+ }}</LinkTo></li>+ {{/if}}+ {{#if @controller.site.privacy_policy_url}}+ <li class="nav-item-privacy"><LinkTo @route="privacy">{{i18n+ "privacy"+ }}</LinkTo></li>+ {{/if}}+ </ul>+ <AboutPage @model={{@controller.model}} />+ </div>+ </div>+ </section>+ </PluginOutlet>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/account-created.gjs b/app/assets/javascripts/discourse/app/templates/account-created.gjsindex 690b02174cb..c7a129093eb 100644--- a/app/assets/javascripts/discourse/app/templates/account-created.gjs+++ b/app/assets/javascripts/discourse/app/templates/account-created.gjs@@ -1,6 +1,15 @@-{{body-class "account-created-page"}}-{{hide-application-header-buttons "search" "login" "signup" "menu"}}-{{hide-application-sidebar}}-<div class="account-created">- {{outlet}}-</div>\ No newline at end of file+import RouteTemplate from "ember-route-template";+import bodyClass from "discourse/helpers/body-class";+import hideApplicationHeaderButtons from "discourse/helpers/hide-application-header-buttons";+import hideApplicationSidebar from "discourse/helpers/hide-application-sidebar";++export default RouteTemplate(+ <template>+ {{bodyClass "account-created-page"}}+ {{hideApplicationHeaderButtons "search" "login" "signup" "menu"}}+ {{hideApplicationSidebar}}+ <div class="account-created">+ {{outlet}}+ </div>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/account-created/edit-email.gjs b/app/assets/javascripts/discourse/app/templates/account-created/edit-email.gjsindex ef9fb83188c..7cecf12c980 100644--- a/app/assets/javascripts/discourse/app/templates/account-created/edit-email.gjs+++ b/app/assets/javascripts/discourse/app/templates/account-created/edit-email.gjs@@ -1,16 +1,29 @@-<SignupProgressBar @step="activate" />-<div class="ac-message">- <ActivationEmailForm- @email={{this.newEmail}}- @updateNewEmail={{this.updateNewEmail}}- />-</div>-<div class="activation-controls">- <DButton- @action={{this.changeEmail}}- @label="login.submit_new_email"- @disabled={{this.submitDisabled}}- class="btn-primary"- />- <DButton @action={{this.cancel}} @label="cancel" class="edit-cancel" />-</div>\ No newline at end of file+import RouteTemplate from "ember-route-template";+import ActivationEmailForm from "discourse/components/activation-email-form";+import DButton from "discourse/components/d-button";+import SignupProgressBar from "discourse/components/signup-progress-bar";++export default RouteTemplate(+ <template>+ <SignupProgressBar @step="activate" />+ <div class="ac-message">+ <ActivationEmailForm+ @email={{@controller.newEmail}}+ @updateNewEmail={{@controller.updateNewEmail}}+ />+ </div>+ <div class="activation-controls">+ <DButton+ @action={{@controller.changeEmail}}+ @label="login.submit_new_email"+ @disabled={{@controller.submitDisabled}}+ class="btn-primary"+ />+ <DButton+ @action={{@controller.cancel}}+ @label="cancel"+ class="edit-cancel"+ />+ </div>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/account-created/index.gjs b/app/assets/javascripts/discourse/app/templates/account-created/index.gjsindex 3f0376e531e..f44b8b7cd2a 100644--- a/app/assets/javascripts/discourse/app/templates/account-created/index.gjs+++ b/app/assets/javascripts/discourse/app/templates/account-created/index.gjs@@ -1,11 +1,21 @@-<SignupProgressBar @step="activate" />-<WelcomeHeader @header={{this.welcomeTitle}} />-<div class="success-info">- {{html-safe this.accountCreated.message}}-</div>-{{#if this.accountCreated.show_controls}}- <ActivationControls- @sendActivationEmail={{action "sendActivationEmail"}}- @editActivationEmail={{action "editActivationEmail"}}- />-{{/if}}\ No newline at end of file+import { htmlSafe } from "@ember/template";+import RouteTemplate from "ember-route-template";+import ActivationControls from "discourse/components/activation-controls";+import SignupProgressBar from "discourse/components/signup-progress-bar";+import WelcomeHeader from "discourse/components/welcome-header";++export default RouteTemplate(+ <template>+ <SignupProgressBar @step="activate" />+ <WelcomeHeader @header={{@controller.welcomeTitle}} />+ <div class="success-info">+ {{htmlSafe @controller.accountCreated.message}}+ </div>+ {{#if @controller.accountCreated.show_controls}}+ <ActivationControls+ @sendActivationEmail={{@controller.sendActivationEmail}}+ @editActivationEmail={{@controller.editActivationEmail}}+ />+ {{/if}}+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/account-created/resent.gjs b/app/assets/javascripts/discourse/app/templates/account-created/resent.gjsindex a5c2f33d60b..428adb05eeb 100644--- a/app/assets/javascripts/discourse/app/templates/account-created/resent.gjs+++ b/app/assets/javascripts/discourse/app/templates/account-created/resent.gjs@@ -1,10 +1,21 @@-<SignupProgressBar @step="activate" />-<div class="ac-message">- {{#if this.email}}- {{html-safe- (i18n "login.sent_activation_email_again" currentEmail=this.email)- }}- {{else}}- {{i18n "login.sent_activation_email_again_generic"}}- {{/if}}-</div>\ No newline at end of file+import { htmlSafe } from "@ember/template";+import RouteTemplate from "ember-route-template";+import SignupProgressBar from "discourse/components/signup-progress-bar";+import { i18n } from "discourse-i18n";++export default RouteTemplate(+ <template>+ <SignupProgressBar @step="activate" />+ <div class="ac-message">+ {{#if @controller.email}}+ {{htmlSafe+ (i18n+ "login.sent_activation_email_again" [email protected]+ )+ }}+ {{else}}+ {{i18n "login.sent_activation_email_again_generic"}}+ {{/if}}+ </div>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/application.gjs b/app/assets/javascripts/discourse/app/templates/application.gjsindex 8dd0ae15587..56eea1e28b8 100644--- a/app/assets/javascripts/discourse/app/templates/application.gjs+++ b/app/assets/javascripts/discourse/app/templates/application.gjs@@ -1,119 +1,160 @@-<DStyles />-<DVirtualHeight />--<DiscourseRoot {{did-insert this.trackDiscoursePainted}}>- {{#if this.showSkipToContent}}- <a href="#main-container" id="skip-link">{{i18n "skip_to_main_content"}}</a>- {{/if}}- <DDocument />- <PageLoadingSlider />- <PluginOutlet- @name="above-site-header"- @connectorTagName="div"- @outletArgs={{hash currentPath=this.router._router.currentPath}}- />-- {{#if this.showSiteHeader}}- <GlimmerSiteHeader- @canSignUp={{this.canSignUp}}- @showCreateAccount={{route-action "showCreateAccount"}}- @showLogin={{route-action "showLogin"}}- @showKeyboard={{route-action "showKeyboardShortcutsHelp"}}- @toggleMobileView={{route-action "toggleMobileView"}}- @logout={{route-action "logout"}}- @sidebarEnabled={{this.sidebarEnabled}}- @showSidebar={{this.showSidebar}}- @toggleSidebar={{this.toggleSidebar}}- />- {{/if}}-- <SoftwareUpdatePrompt />-- {{#if this.siteSettings.enable_offline_indicator}}- <OfflineIndicator />- {{/if}}-- <PluginOutlet- @name="below-site-header"- @connectorTagName="div"- @outletArgs={{hash currentPath=this.router._router.currentPath}}- />-- <div id="main-outlet-wrapper" class="wrap" role="main">- <div class="sidebar-wrapper">- {{! empty div allows for animation }}- {{#if (and this.sidebarEnabled this.showSidebar)}}- <Sidebar @toggleSidebar={{action "toggleSidebar"}} />+import { hash } from "@ember/helper";+import didInsert from "@ember/render-modifiers/modifiers/did-insert";+import DialogHolder from "dialog-holder/components/dialog-holder";+import RouteTemplate from "ember-route-template";+import { and } from "truth-helpers";+import CardContainer from "discourse/components/card-container";+import ComposerContainer from "discourse/components/composer-container";+import CustomHtml from "discourse/components/custom-html";+import DDocument from "discourse/components/d-document";+import DStyles from "discourse/components/d-styles";+import DVirtualHeight from "discourse/components/d-virtual-height";+import DiscourseRoot from "discourse/components/discourse-root";+import FooterNav from "discourse/components/footer-nav";+import GlimmerSiteHeader from "discourse/components/glimmer-site-header";+import GlobalNotice from "discourse/components/global-notice";+import LoadingSliderFallbackSpinner from "discourse/components/loading-slider-fallback-spinner";+import ModalContainer from "discourse/components/modal-container";+import NotificationConsentBanner from "discourse/components/notification-consent-banner";+import OfflineIndicator from "discourse/components/offline-indicator";+import PageLoadingSlider from "discourse/components/page-loading-slider";+import PluginOutlet from "discourse/components/plugin-outlet";+import PoweredByDiscourse from "discourse/components/powered-by-discourse";+import PwaInstallBanner from "discourse/components/pwa-install-banner";+import RenderGlimmerContainer from "discourse/components/render-glimmer-container";+import Sidebar from "discourse/components/sidebar";+import SoftwareUpdatePrompt from "discourse/components/software-update-prompt";+import TopicEntrance from "discourse/components/topic-entrance";+import routeAction from "discourse/helpers/route-action";+import { i18n } from "discourse-i18n";+import DMenus from "float-kit/components/d-menus";+import DToasts from "float-kit/components/d-toasts";+import DTooltips from "float-kit/components/d-tooltips";++export default RouteTemplate(+ <template>+ <DStyles />+ <DVirtualHeight />++ <DiscourseRoot {{didInsert @controller.trackDiscoursePainted}}>+ {{#if @controller.showSkipToContent}}+ <a href="#main-container" id="skip-link">{{i18n+ "skip_to_main_content"+ }}</a>+ {{/if}}+ <DDocument />+ <PageLoadingSlider />+ <PluginOutlet+ @name="above-site-header"+ @connectorTagName="div"+ @outletArgs={{hash [email protected]._router.currentPath}}+ />++ {{#if @controller.showSiteHeader}}+ <GlimmerSiteHeader+ @canSignUp={{@controller.canSignUp}}+ @showCreateAccount={{routeAction "showCreateAccount"}}+ @showLogin={{routeAction "showLogin"}}+ @showKeyboard={{routeAction "showKeyboardShortcutsHelp"}}+ @toggleMobileView={{routeAction "toggleMobileView"}}+ @logout={{routeAction "logout"}}+ @sidebarEnabled={{@controller.sidebarEnabled}}+ @showSidebar={{@controller.showSidebar}}+ @toggleSidebar={{@controller.toggleSidebar}}+ />{{/if}}- </div>- <LoadingSliderFallbackSpinner />+ <SoftwareUpdatePrompt />- <PluginOutlet @name="before-main-outlet" />+ {{#if @controller.siteSettings.enable_offline_indicator}}+ <OfflineIndicator />+ {{/if}}- <div id="main-outlet">- <PluginOutlet @name="above-main-container" @connectorTagName="div" />- <div class="container" id="main-container">- {{#if this.showTop}}- <CustomHtml @name="top" />+ <PluginOutlet+ @name="below-site-header"+ @connectorTagName="div"+ @outletArgs={{hash [email protected]._router.currentPath}}+ />++ <div id="main-outlet-wrapper" class="wrap" role="main">+ <div class="sidebar-wrapper">+ {{! empty div allows for animation }}+ {{#if (and @controller.sidebarEnabled @controller.showSidebar)}}+ <Sidebar @toggleSidebar={{@controller.toggleSidebar}} />+ {{/if}}+ </div>++ <LoadingSliderFallbackSpinner />++ <PluginOutlet @name="before-main-outlet" />++ <div id="main-outlet">+ <PluginOutlet @name="above-main-container" @connectorTagName="div" />+ <div class="container" id="main-container">+ {{#if @controller.showTop}}+ <CustomHtml @name="top" />+ {{/if}}+ <NotificationConsentBanner />+ <PwaInstallBanner />+ <GlobalNotice />+ <PluginOutlet+ @name="top-notices"+ @connectorTagName="div"+ @outletArgs={{hash+ [email protected]._router.currentPath+ }}+ />+ </div>++ {{outlet}}++ <CardContainer />+ <PluginOutlet+ @name="main-outlet-bottom"+ @outletArgs={{hash [email protected]}}+ />+ </div>++ <PluginOutlet @name="after-main-outlet" />++ {{#if @controller.showPoweredBy}}+ <PoweredByDiscourse />{{/if}}- <NotificationConsentBanner />- <PwaInstallBanner />- <GlobalNotice />- <PluginOutlet- @name="top-notices"- @connectorTagName="div"- @outletArgs={{hash currentPath=this.router._router.currentPath}}- /></div>- {{outlet}}-- <CardContainer /><PluginOutlet- @name="main-outlet-bottom"- @outletArgs={{hash showFooter=this.showFooter}}+ @name="above-footer"+ @connectorTagName="div"+ @outletArgs={{hash [email protected]}}+ />+ {{#if @controller.showFooter}}+ <CustomHtml+ @name="footer"+ @triggerAppEvent="true"+ @classNames="custom-footer-content"+ />+ {{/if}}+ <PluginOutlet+ @name="below-footer"+ @connectorTagName="div"+ @outletArgs={{hash [email protected]}}/>- </div>-- <PluginOutlet @name="after-main-outlet" />-- {{#if this.showPoweredBy}}- <PoweredByDiscourse />- {{/if}}- </div>-- <PluginOutlet- @name="above-footer"- @connectorTagName="div"- @outletArgs={{hash showFooter=this.showFooter}}- />- {{#if this.showFooter}}- <CustomHtml- @name="footer"- @triggerAppEvent="true"- @classNames="custom-footer-content"- />- {{/if}}- <PluginOutlet- @name="below-footer"- @connectorTagName="div"- @outletArgs={{hash showFooter=this.showFooter}}- />-- <ModalContainer />- <DialogHolder />- <TopicEntrance />- <ComposerContainer />- <RenderGlimmerContainer />-- {{#if this.showFooterNav}}- <PluginOutlet @name="footer-nav">- <FooterNav />- </PluginOutlet>- {{/if}}-</DiscourseRoot>--<DMenus />-<DTooltips />-<DToasts />\ No newline at end of file++ <ModalContainer />+ <DialogHolder />+ <TopicEntrance />+ <ComposerContainer />+ <RenderGlimmerContainer />++ {{#if @controller.showFooterNav}}+ <PluginOutlet @name="footer-nav">+ <FooterNav />+ </PluginOutlet>+ {{/if}}+ </DiscourseRoot>++ <DMenus />+ <DTooltips />+ <DToasts />+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/badges/index.gjs b/app/assets/javascripts/discourse/app/templates/badges/index.gjsindex abf4c169218..3e40ecb8263 100644--- a/app/assets/javascripts/discourse/app/templates/badges/index.gjs+++ b/app/assets/javascripts/discourse/app/templates/badges/index.gjs@@ -1,26 +1,39 @@-{{body-class "badges-page"}}+import RouteTemplate from "ember-route-template";+import BadgeCard from "discourse/components/badge-card";+import PluginOutlet from "discourse/components/plugin-outlet";+import bodyClass from "discourse/helpers/body-class";+import { i18n } from "discourse-i18n";-<section>- <div class="container badges">- <h1>{{i18n "badges.title"}}</h1>+export default RouteTemplate(+ <template>+ {{bodyClass "badges-page"}}- <span>- <PluginOutlet @name="below-badges-title" @connectorTagName="div" />- </span>+ <section>+ <div class="container badges">+ <h1>{{i18n "badges.title"}}</h1>- <div class="badge-groups">- {{#each this.badgeGroups as |bg|}}- <div class="badge-grouping">- <div class="title">- <h2>{{bg.badgeGrouping.displayName}}</h2>- </div>- <div class="badge-group-list">- {{#each bg.badges as |b|}}- <BadgeCard @badge={{b}} @username={{this.currentUser.username}} />- {{/each}}- </div>+ <span>+ <PluginOutlet @name="below-badges-title" @connectorTagName="div" />+ </span>++ <div class="badge-groups">+ {{#each @controller.badgeGroups as |bg|}}+ <div class="badge-grouping">+ <div class="title">+ <h2>{{bg.badgeGrouping.displayName}}</h2>+ </div>+ <div class="badge-group-list">+ {{#each bg.badges as |b|}}+ <BadgeCard+ @badge={{b}}+ @username={{@controller.currentUser.username}}+ />+ {{/each}}+ </div>+ </div>+ {{/each}}</div>- {{/each}}- </div>- </div>-</section>\ No newline at end of file+ </div>+ </section>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/badges/show.gjs b/app/assets/javascripts/discourse/app/templates/badges/show.gjsindex b64df76694c..da2b8961319 100644--- a/app/assets/javascripts/discourse/app/templates/badges/show.gjs+++ b/app/assets/javascripts/discourse/app/templates/badges/show.gjs@@ -1,99 +1,126 @@-{{#if this.canLoadMore}}- {{hide-application-footer}}-{{/if}}+import { hash } from "@ember/helper";+import { LinkTo } from "@ember/routing";+import { htmlSafe } from "@ember/template";+import RouteTemplate from "ember-route-template";+import BadgeCard from "discourse/components/badge-card";+import BadgeTitle from "discourse/components/badge-title";+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";+import DButton from "discourse/components/d-button";+import LoadMore from "discourse/components/load-more";+import PluginOutlet from "discourse/components/plugin-outlet";+import UserInfo from "discourse/components/user-info";+import formatDate from "discourse/helpers/format-date";+import hideApplicationFooter from "discourse/helpers/hide-application-footer";+import { i18n } from "discourse-i18n";-<div class="container show-badge {{this.model.slug}}">- <h1>- <LinkTo @route="badges.index">{{i18n "badges.title"}}</LinkTo>- /- {{this.model.name}}- </h1>+export default RouteTemplate(+ <template>+ {{#if @controller.canLoadMore}}+ {{hideApplicationFooter}}+ {{/if}}++ <div class="container show-badge {{@controller.model.slug}}">+ <h1>+ <LinkTo @route="badges.index">{{i18n "badges.title"}}</LinkTo>+ /+ {{@controller.model.name}}+ </h1>- <div class="show-badge-details">- <BadgeCard- @badge={{this.model}}- @size="large"- @count={{this.userBadges.grant_count}}- />- <div class="badge-grant-info {{if this.hiddenSetTitle '' 'hidden'}}">- <div>- {{#if this.canSelectTitle}}- <div class="grant-info-item">- {{i18n "badges.allow_title"}}- <DButton- @action={{this.toggleSetUserTitle}}- @icon="pencil"- class="btn-default pad-left"- />+ <div class="show-badge-details">+ <BadgeCard+ @badge={{@controller.model}}+ @size="large"+ @count={{@controller.userBadges.grant_count}}+ />+ <div+ class="badge-grant-info {{if @controller.hiddenSetTitle '' 'hidden'}}"+ >+ <div>+ {{#if @controller.canSelectTitle}}+ <div class="grant-info-item">+ {{i18n "badges.allow_title"}}+ <DButton+ @action={{@controller.toggleSetUserTitle}}+ @icon="pencil"+ class="btn-default pad-left"+ />+ </div>+ {{/if}}+ {{#if @controller.model.multiple_grant}}+ <div class="grant-info-item">+ {{i18n "badges.multiple_grant"}}+ </div>+ {{/if}}</div>- {{/if}}- {{#if this.model.multiple_grant}}- <div class="grant-info-item">- {{i18n "badges.multiple_grant"}}+ </div>++ {{#if @controller.canSelectTitle}}+ <div+ class="badge-set-title+ {{if @controller.hiddenSetTitle 'hidden' ''}}"+ >+ <PluginOutlet+ @name="selectable-user-badges"+ @outletArgs={{hash+ }}+ >+ <BadgeTitle+ @selectableUserBadges={{@controller.selectableUserBadges}}+ @closeAction={{@controller.toggleSetUserTitle}}+ />+ </PluginOutlet></div>{{/if}}</div>- </div>- {{#if this.canSelectTitle}}- <div class="badge-set-title {{if this.hiddenSetTitle 'hidden' ''}}">- <PluginOutlet- @name="selectable-user-badges"- @outletArgs={{hash- selectableUserBadges=this.selectableUserBadges- closeAction=this.toggleSetUserTitle- }}- >- <BadgeTitle- @selectableUserBadges={{this.selectableUserBadges}}- @closeAction={{this.toggleSetUserTitle}}- />- </PluginOutlet>- </div>- {{/if}}- </div>+ {{#if @controller.userBadges}}+ <div class="user-badges {{@controller.model.slug}}">+ <LoadMore @selector=".badge-info" @action={{@controller.loadMore}}>+ <div class="badges-granted">+ {{#each @controller.userBadges as |ub|}}+ <UserInfo+ @user={{ub.user}}+ @size="medium"+ @date={{ub.granted_at}}+ class="badge-info"+ >+ <div class="granted-on">+ {{htmlSafe+ (i18n "badges.granted_on" date=(formatDate ub.granted_at))+ }}+ </div>- {{#if this.userBadges}}- <div class="user-badges {{this.model.slug}}">- <LoadMore @selector=".badge-info" @action={{action "loadMore"}}>- <div class="badges-granted">- {{#each this.userBadges as |ub|}}- <UserInfo- @user={{ub.user}}- @size="medium"- @date={{ub.granted_at}}- class="badge-info"- >- <div class="granted-on">- {{html-safe- (i18n "badges.granted_on" date=(format-date ub.granted_at))- }}- </div>+ {{#if ub.post_number}}+ <a+ class="post-link"+ href="{{ub.topic.url}}/{{ub.post_number}}"+ >{{htmlSafe ub.topic.fancyTitle}}</a>+ {{/if}}+ </UserInfo>+ {{/each}}+ </div>+ </LoadMore>- {{#if ub.post_number}}+ {{#unless @controller.canLoadMore}}+ {{#if @controller.canShowOthers}}+ <div><a- class="post-link"- href="{{ub.topic.url}}/{{ub.post_number}}"- >{{html-safe ub.topic.fancyTitle}}</a>- {{/if}}- </UserInfo>- {{/each}}+ id="show-others-with-badge-link"+ href={{@controller.model.url}}+ class="btn btn-default"+ >{{i18n+ "badges.others_count"+ }}</a>+ </div>+ {{/if}}+ {{/unless}}</div>- </LoadMore>- {{#unless this.canLoadMore}}- {{#if this.canShowOthers}}- <div>- <a- id="show-others-with-badge-link"- href={{this.model.url}}- class="btn btn-default"- >{{i18n "badges.others_count" count=this.othersCount}}</a>- </div>- {{/if}}- {{/unless}}+ <ConditionalLoadingSpinner @condition={{@controller.canLoadMore}} />+ {{/if}}</div>-- <ConditionalLoadingSpinner @condition={{this.canLoadMore}} />- {{/if}}-</div>\ No newline at end of file+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/composer/dominating-topic.gjs b/app/assets/javascripts/discourse/app/templates/composer/dominating-topic.gjsindex f6b7362925b..7ae3513be34 100644--- a/app/assets/javascripts/discourse/app/templates/composer/dominating-topic.gjs+++ b/app/assets/javascripts/discourse/app/templates/composer/dominating-topic.gjs@@ -1,12 +1,24 @@-<ComposerTipCloseButton @action={{fn this.closeMessage this.message}} />+import { fn } from "@ember/helper";+import { htmlSafe } from "@ember/template";+import RouteTemplate from "ember-route-template";+import ComposerTipCloseButton from "discourse/components/composer-tip-close-button";+import DButton from "discourse/components/d-button";-{{html-safe this.message.body}}+export default RouteTemplate(+ <template>+ <ComposerTipCloseButton+ @action={{fn @controller.closeMessage @controller.message}}+ />-{{#if this.currentUser.can_invite_to_forum}}- <DButton- @label="footer_nav.share"- @icon="link"- @action={{this.shareModal}}- class="btn-primary"- />-{{/if}}\ No newline at end of file+ {{htmlSafe @controller.message.body}}++ {{#if @controller.currentUser.can_invite_to_forum}}+ <DButton+ @label="footer_nav.share"+ @icon="link"+ @action={{@controller.shareModal}}+ class="btn-primary"+ />+ {{/if}}+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/composer/education.gjs b/app/assets/javascripts/discourse/app/templates/composer/education.gjsindex 550fbc15b39..5219f15a3f1 100644--- a/app/assets/javascripts/discourse/app/templates/composer/education.gjs+++ b/app/assets/javascripts/discourse/app/templates/composer/education.gjs@@ -1,7 +1,18 @@-<ComposerTipCloseButton @action={{fn this.closeMessage this.message}} />+import { fn } from "@ember/helper";+import { htmlSafe } from "@ember/template";+import RouteTemplate from "ember-route-template";+import ComposerTipCloseButton from "discourse/components/composer-tip-close-button";-{{#if this.message.title}}- <h3>{{this.message.title}}</h3>-{{/if}}+export default RouteTemplate(+ <template>+ <ComposerTipCloseButton+ @action={{fn @controller.closeMessage @controller.message}}+ />-{{html-safe this.message.body}}\ No newline at end of file+ {{#if @controller.message.title}}+ <h3>{{@controller.message.title}}</h3>+ {{/if}}++ {{htmlSafe @controller.message.body}}+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/composer/get-a-room.gjs b/app/assets/javascripts/discourse/app/templates/composer/get-a-room.gjsindex cbf82f6ede6..e6af26897f6 100644--- a/app/assets/javascripts/discourse/app/templates/composer/get-a-room.gjs+++ b/app/assets/javascripts/discourse/app/templates/composer/get-a-room.gjs@@ -1,10 +1,22 @@-<ComposerTipCloseButton @action={{fn this.closeMessage this.message}} />+import { fn } from "@ember/helper";+import { htmlSafe } from "@ember/template";+import RouteTemplate from "ember-route-template";+import ComposerTipCloseButton from "discourse/components/composer-tip-close-button";+import DButton from "discourse/components/d-button";-{{html-safe this.message.body}}+export default RouteTemplate(+ <template>+ <ComposerTipCloseButton+ @action={{fn @controller.closeMessage @controller.message}}+ />-<DButton- @label="user.private_message"- @icon="envelope"- @action={{fn this.switchPM this.message}}- class="btn-primary"-/>\ No newline at end of file+ {{htmlSafe @controller.message.body}}++ <DButton+ @label="user.private_message"+ @icon="envelope"+ @action={{fn @controller.switchPM @controller.message}}+ class="btn-primary"+ />+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/composer/group-mentioned.gjs b/app/assets/javascripts/discourse/app/templates/composer/group-mentioned.gjsindex 501e0991e8b..d7a7637b54c 100644--- a/app/assets/javascripts/discourse/app/templates/composer/group-mentioned.gjs+++ b/app/assets/javascripts/discourse/app/templates/composer/group-mentioned.gjs@@ -1,5 +1,16 @@-<ComposerTipCloseButton @action={{fn this.closeMessage this.message}} />+import { fn } from "@ember/helper";+import { htmlSafe } from "@ember/template";+import RouteTemplate from "ember-route-template";+import ComposerTipCloseButton from "discourse/components/composer-tip-close-button";-<p>- {{html-safe this.message.body}}-</p>\ No newline at end of file+export default RouteTemplate(+ <template>+ <ComposerTipCloseButton+ @action={{fn @controller.closeMessage @controller.message}}+ />++ <p>+ {{htmlSafe @controller.message.body}}+ </p>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/composer/similar-topics.gjs b/app/assets/javascripts/discourse/app/templates/composer/similar-topics.gjsindex 373d6bfafd9..5e15c39fbf7 100644--- a/app/assets/javascripts/discourse/app/templates/composer/similar-topics.gjs+++ b/app/assets/javascripts/discourse/app/templates/composer/similar-topics.gjs@@ -1,14 +1,23 @@-<ComposerTipCloseButton @action={{fn this.closeMessage this.message}} />+import { fn } from "@ember/helper";+import RouteTemplate from "ember-route-template";+import ComposerTipCloseButton from "discourse/components/composer-tip-close-button";+import Topic from "discourse/components/search-menu/results/type/topic";+import { i18n } from "discourse-i18n";-<h3>{{i18n "composer.similar_topics"}}</h3>+export default RouteTemplate(+ <template>+ <ComposerTipCloseButton+ @action={{fn @controller.closeMessage @controller.message}}+ />-<ul class="topics">- {{#each this.message.similarTopics as |topic|}}- <div class="similar-topic">- <SearchMenu::Results::Type::Topic- @result={{topic}}- @withTopicUrl={{true}}- />- </div>- {{/each}}-</ul>\ No newline at end of file+ <h3>{{i18n "composer.similar_topics"}}</h3>++ <ul class="topics">+ {{#each @controller.message.similarTopics as |topic|}}+ <div class="similar-topic">+ <Topic @result={{topic}} @withTopicUrl={{true}} />+ </div>+ {{/each}}+ </ul>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/confirm-new-email.gjs b/app/assets/javascripts/discourse/app/templates/confirm-new-email.gjsindex 274c1e415bd..c08a55823fa 100644--- a/app/assets/javascripts/discourse/app/templates/confirm-new-email.gjs+++ b/app/assets/javascripts/discourse/app/templates/confirm-new-email.gjs@@ -1,18 +1,26 @@-<div id="simple-container">- <div class="confirm-new-email">- <h2>{{i18n "user.change_email.title"}}</h2>- <p>- {{#if this.model.old_email}}- {{i18n "user.change_email.authorizing_new.description"}}- {{else}}- {{i18n "user.change_email.authorizing_new.description_add"}}- {{/if}}- </p>- <p>{{this.model.new_email}}</p>- <DButton- @translatedLabel={{i18n "user.change_email.confirm"}}- class="btn-primary"- @action={{this.confirm}}- />- </div>-</div>\ No newline at end of file+import RouteTemplate from "ember-route-template";+import DButton from "discourse/components/d-button";+import { i18n } from "discourse-i18n";++export default RouteTemplate(+ <template>+ <div id="simple-container">+ <div class="confirm-new-email">+ <h2>{{i18n "user.change_email.title"}}</h2>+ <p>+ {{#if @controller.model.old_email}}+ {{i18n "user.change_email.authorizing_new.description"}}+ {{else}}+ {{i18n "user.change_email.authorizing_new.description_add"}}+ {{/if}}+ </p>+ <p>{{@controller.model.new_email}}</p>+ <DButton+ @translatedLabel={{i18n "user.change_email.confirm"}}+ class="btn-primary"+ @action={{@controller.confirm}}+ />+ </div>+ </div>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/confirm-old-email.gjs b/app/assets/javascripts/discourse/app/templates/confirm-old-email.gjsindex 07f89575adf..be6589b6a04 100644--- a/app/assets/javascripts/discourse/app/templates/confirm-old-email.gjs+++ b/app/assets/javascripts/discourse/app/templates/confirm-old-email.gjs@@ -1,31 +1,39 @@-<div id="simple-container">- <div class="confirm-old-email">- <h2>{{i18n "user.change_email.authorizing_old.title"}}</h2>- <p>- {{#if this.model.old_email}}- {{i18n "user.change_email.authorizing_old.description"}}- {{else}}- {{i18n "user.change_email.authorizing_old.description_add"}}- {{/if}}- </p>- {{#if this.model.old_email}}- <p>- {{i18n- "user.change_email.authorizing_old.old_email"- email=this.model.old_email- }}- </p>- {{/if}}- <p>- {{i18n- "user.change_email.authorizing_old.new_email"- email=this.model.new_email- }}- </p>- <DButton- @translatedLabel={{i18n "user.change_email.confirm"}}- class="btn-primary"- @action={{this.confirm}}- />- </div>-</div>\ No newline at end of file+import RouteTemplate from "ember-route-template";+import DButton from "discourse/components/d-button";+import { i18n } from "discourse-i18n";++export default RouteTemplate(+ <template>+ <div id="simple-container">+ <div class="confirm-old-email">+ <h2>{{i18n "user.change_email.authorizing_old.title"}}</h2>+ <p>+ {{#if @controller.model.old_email}}+ {{i18n "user.change_email.authorizing_old.description"}}+ {{else}}+ {{i18n "user.change_email.authorizing_old.description_add"}}+ {{/if}}+ </p>+ {{#if @controller.model.old_email}}+ <p>+ {{i18n+ "user.change_email.authorizing_old.old_email"+ [email protected]_email+ }}+ </p>+ {{/if}}+ <p>+ {{i18n+ "user.change_email.authorizing_old.new_email"+ [email protected]_email+ }}+ </p>+ <DButton+ @translatedLabel={{i18n "user.change_email.confirm"}}+ class="btn-primary"+ @action={{@controller.confirm}}+ />+ </div>+ </div>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/discovery/categories.gjs b/app/assets/javascripts/discourse/app/templates/discovery/categories.gjsindex 99bc98b2eb2..a4a8ad7e002 100644--- a/app/assets/javascripts/discourse/app/templates/discovery/categories.gjs+++ b/app/assets/javascripts/discourse/app/templates/discovery/categories.gjs@@ -1,52 +1,76 @@-<Discovery::Layout @model={{this.model}}>- <:navigation>- <Discovery::Navigation- @category={{this.model.parentCategory}}- @showCategoryAdmin={{this.model.can_create_category}}- @canCreateTopic={{this.model.can_create_topic}}- @createTopic={{this.createTopic}}- @filterType="categories"- />- </:navigation>- <:list>+import { hash } from "@ember/helper";+import { on } from "@ember/modifier";+import RouteTemplate from "ember-route-template";+import { and } from "truth-helpers";+import CountI18n from "discourse/components/count-i18n";+import CategoriesDisplay from "discourse/components/discovery/categories-display";+import Layout from "discourse/components/discovery/layout";+import Navigation from "discourse/components/discovery/navigation";+import PluginOutlet from "discourse/components/plugin-outlet";+import bodyClass from "discourse/helpers/body-class";+import concatClass from "discourse/helpers/concat-class";- {{body-class "categories-list"}}+export default RouteTemplate(+ <template>+ <Layout @model={{@controller.model}}>+ <:navigation>+ <Navigation+ @category={{@controller.model.parentCategory}}+ @showCategoryAdmin={{@controller.model.can_create_category}}+ @canCreateTopic={{@controller.model.can_create_topic}}+ @createTopic={{@controller.createTopic}}+ @filterType="categories"+ />+ </:navigation>+ <:list>- <div class="contents">- {{#if (and this.topicTrackingState.hasIncoming this.isCategoriesRoute)}}- <div- class={{concat-class "show-more" (if this.hasTopics "has-topics")}}- >- <div- role="button"- class="alert alert-info clickable"- {{on "click" this.showInserted}}- >- <CountI18n- @key="topic_count_"- @suffix={{this.topicTrackingState.filter}}- @count={{this.topicTrackingState.incomingCount}}- />- </div>- </div>- {{/if}}+ {{bodyClass "categories-list"}}++ <div class="contents">+ {{#if+ (and+ @controller.topicTrackingState.hasIncoming+ @controller.isCategoriesRoute+ )+ }}+ <div+ class={{concatClass+ "show-more"+ (if @controller.hasTopics "has-topics")+ }}+ >+ <div+ role="button"+ class="alert alert-info clickable"+ {{on "click" @controller.showInserted}}+ >+ <CountI18n+ @key="topic_count_"+ @suffix={{@controller.topicTrackingState.filter}}+ @count={{@controller.topicTrackingState.incomingCount}}+ />+ </div>+ </div>+ {{/if}}- <Discovery::CategoriesDisplay- @categories={{this.model.categories}}- @topics={{this.model.topics}}- @parentCategory={{this.model.parentCategory}}- @loadMore={{this.model.loadMore}}- @loadingMore={{this.model.isLoading}}- />- </div>+ <CategoriesDisplay+ @categories={{@controller.model.categories}}+ @topics={{@controller.model.topics}}+ @parentCategory={{@controller.model.parentCategory}}+ @loadMore={{@controller.model.loadMore}}+ @loadingMore={{@controller.model.isLoading}}+ />+ </div>- <PluginOutlet- @name="below-discovery-categories"- @connectorTagName="div"- @outletArgs={{hash- categories=this.model.categories- topics=this.model.topics- }}- />- </:list>-</Discovery::Layout>\ No newline at end of file+ <PluginOutlet+ @name="below-discovery-categories"+ @connectorTagName="div"+ @outletArgs={{hash+ }}+ />+ </:list>+ </Layout>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/discovery/custom.gjs b/app/assets/javascripts/discourse/app/templates/discovery/custom.gjsindex cb2c9b74d9e..ccbb88968ce 100644--- a/app/assets/javascripts/discourse/app/templates/discovery/custom.gjs+++ b/app/assets/javascripts/discourse/app/templates/discovery/custom.gjs@@ -1,7 +1,15 @@-<PluginOutlet @name="custom-homepage">- {{#if this.currentUser.admin}}- <p class="alert alert-info">- {{i18n "custom_homepage.admin_message"}}- </p>- {{/if}}-</PluginOutlet>\ No newline at end of file+import RouteTemplate from "ember-route-template";+import PluginOutlet from "discourse/components/plugin-outlet";+import { i18n } from "discourse-i18n";++export default RouteTemplate(+ <template>+ <PluginOutlet @name="custom-homepage">+ {{#if @controller.currentUser.admin}}+ <p class="alert alert-info">+ {{i18n "custom_homepage.admin_message"}}+ </p>+ {{/if}}+ </PluginOutlet>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/discovery/filter.gjs b/app/assets/javascripts/discourse/app/templates/discovery/filter.gjsindex 3c8d025c513..1673cad0db9 100644--- a/app/assets/javascripts/discourse/app/templates/discovery/filter.gjs+++ b/app/assets/javascripts/discourse/app/templates/discovery/filter.gjs@@ -1,20 +1,29 @@-<Discovery::Layout @model={{this.model}}>- <:navigation>- <Discovery::FilterNavigation- @queryString={{this.q}}- @updateTopicsListQueryParams={{this.updateTopicsListQueryParams}}- @canBulkSelect={{this.canBulkSelect}}- @bulkSelectHelper={{this.bulkSelectHelper}}- />- </:navigation>- <:list>- <Discovery::Topics- @period={{this.period}}- @expandAllPinned={{this.expandAllPinned}}- @expandAllGloballyPinned={{this.expandAllGloballyPinned}}- @model={{this.model}}- @canBulkSelect={{this.canBulkSelect}}- @bulkSelectHelper={{this.bulkSelectHelper}}- />- </:list>-</Discovery::Layout>\ No newline at end of file+import RouteTemplate from "ember-route-template";+import FilterNavigation from "discourse/components/discovery/filter-navigation";+import Layout from "discourse/components/discovery/layout";+import Topics from "discourse/components/discovery/topics";++export default RouteTemplate(+ <template>+ <Layout @model={{@controller.model}}>+ <:navigation>+ <FilterNavigation+ @queryString={{@controller.q}}+ @updateTopicsListQueryParams={{@controller.updateTopicsListQueryParams}}+ @canBulkSelect={{@controller.canBulkSelect}}+ @bulkSelectHelper={{@controller.bulkSelectHelper}}+ />+ </:navigation>+ <:list>+ <Topics+ @period={{@controller.period}}+ @expandAllPinned={{@controller.expandAllPinned}}+ @expandAllGloballyPinned={{@controller.expandAllGloballyPinned}}+ @model={{@controller.model}}+ @canBulkSelect={{@controller.canBulkSelect}}+ @bulkSelectHelper={{@controller.bulkSelectHelper}}+ />+ </:list>+ </Layout>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/discovery/list.gjs b/app/assets/javascripts/discourse/app/templates/discovery/list.gjsindex c0f9520c623..cad7d8ca039 100644--- a/app/assets/javascripts/discourse/app/templates/discovery/list.gjs+++ b/app/assets/javascripts/discourse/app/templates/discovery/list.gjs@@ -1,56 +1,71 @@-<Discovery::Layout- @model={{this.model}}- @createTopicDisabled={{this.createTopicDisabled}}->- <:navigation>- <Discovery::Navigation- @category={{this.model.category}}- @tag={{this.model.tag}}- @additionalTags={{this.model.additionalTags}}- @filterType={{this.model.filterType}}- @noSubcategories={{this.model.noSubcategories}}- @canBulkSelect={{this.canBulkSelect}}- @bulkSelectHelper={{this.bulkSelectHelper}}- @createTopic={{this.createTopic}}- @createTopicDisabled={{this.createTopicDisabled}}- @canCreateTopicOnTag={{this.model.canCreateTopicOnTag}}- @toggleTagInfo={{this.toggleTagInfo}}- @tagNotification={{this.model.tagNotification}}- @model={{this.model.list}}- @showDismissRead={{this.showDismissRead}}- @showResetNew={{this.showResetNew}}- @dismissRead={{this.dismissRead}}- @resetNew={{this.resetNew}}- />- </:navigation>+import RouteTemplate from "ember-route-template";+import { and } from "truth-helpers";+import CategoriesDisplay from "discourse/components/discovery/categories-display";+import Layout from "discourse/components/discovery/layout";+import Navigation from "discourse/components/discovery/navigation";+import Topics from "discourse/components/discovery/topics";+import TagInfo from "discourse/components/tag-info";- <:header>- {{#if this.model.subcategoryList}}- <Discovery::CategoriesDisplay- @categories={{this.model.subcategoryList.categories}}- @parentCategory={{this.model.subcategoryList.parentCategory}}- />- {{/if}}- {{#if (and this.showTagInfo this.model.tag)}}- <TagInfo @tag={{this.model.tag}} @list={{this.model.list}} />- {{/if}}- </:header>+export default RouteTemplate(+ <template>+ <Layout+ @model={{@controller.model}}+ @createTopicDisabled={{@controller.createTopicDisabled}}+ >+ <:navigation>+ <Navigation+ @category={{@controller.model.category}}+ @tag={{@controller.model.tag}}+ @additionalTags={{@controller.model.additionalTags}}+ @filterType={{@controller.model.filterType}}+ @noSubcategories={{@controller.model.noSubcategories}}+ @canBulkSelect={{@controller.canBulkSelect}}+ @bulkSelectHelper={{@controller.bulkSelectHelper}}+ @createTopic={{@controller.createTopic}}+ @createTopicDisabled={{@controller.createTopicDisabled}}+ @canCreateTopicOnTag={{@controller.model.canCreateTopicOnTag}}+ @toggleTagInfo={{@controller.toggleTagInfo}}+ @tagNotification={{@controller.model.tagNotification}}+ @model={{@controller.model.list}}+ @showDismissRead={{@controller.showDismissRead}}+ @showResetNew={{@controller.showResetNew}}+ @dismissRead={{@controller.dismissRead}}+ @resetNew={{@controller.resetNew}}+ />+ </:navigation>- <:list>- <Discovery::Topics- @period={{this.model.list.for_period}}- @changePeriod={{this.changePeriod}}- @model={{this.model.list}}- @canBulkSelect={{this.canBulkSelect}}- @bulkSelectHelper={{this.bulkSelectHelper}}- @showDismissRead={{this.showDismissRead}}- @showResetNew={{this.showResetNew}}- @category={{this.model.category}}- @tag={{this.model.tag}}- @changeSort={{this.changeSort}}- @changeNewListSubset={{this.changeNewListSubset}}- @dismissRead={{this.dismissRead}}- @resetNew={{this.resetNew}}- />- </:list>-</Discovery::Layout>\ No newline at end of file+ <:header>+ {{#if @controller.model.subcategoryList}}+ <CategoriesDisplay+ @categories={{@controller.model.subcategoryList.categories}}+ @parentCategory={{@controller.model.subcategoryList.parentCategory}}+ />+ {{/if}}+ {{#if (and @controller.showTagInfo @controller.model.tag)}}+ <TagInfo+ @tag={{@controller.model.tag}}+ @list={{@controller.model.list}}+ />+ {{/if}}+ </:header>++ <:list>+ <Topics+ @period={{@controller.model.list.for_period}}+ @changePeriod={{@controller.changePeriod}}+ @model={{@controller.model.list}}+ @canBulkSelect={{@controller.canBulkSelect}}+ @bulkSelectHelper={{@controller.bulkSelectHelper}}+ @showDismissRead={{@controller.showDismissRead}}+ @showResetNew={{@controller.showResetNew}}+ @category={{@controller.model.category}}+ @tag={{@controller.model.tag}}+ @changeSort={{@controller.changeSort}}+ @changeNewListSubset={{@controller.changeNewListSubset}}+ @dismissRead={{@controller.dismissRead}}+ @resetNew={{@controller.resetNew}}+ />+ </:list>+ </Layout>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/email-login.gjs b/app/assets/javascripts/discourse/app/templates/email-login.gjsindex e72bd177382..0fb0d870e90 100644--- a/app/assets/javascripts/discourse/app/templates/email-login.gjs+++ b/app/assets/javascripts/discourse/app/templates/email-login.gjs@@ -1,69 +1,92 @@-<div class="container email-login clearfix">- <div class="content-wrapper">- <div class="image-wrapper">- <img src={{this.lockImageUrl}} class="password-reset-img" alt="" />- </div>+import { fn } from "@ember/helper";+import { on } from "@ember/modifier";+import { htmlSafe } from "@ember/template";+import RouteTemplate from "ember-route-template";+import DButton from "discourse/components/d-button";+import SecondFactorForm from "discourse/components/second-factor-form";+import SecondFactorInput from "discourse/components/second-factor-input";+import SecurityKeyForm from "discourse/components/security-key-form";+import withEventValue from "discourse/helpers/with-event-value";+import { i18n } from "discourse-i18n";- <form>- {{#if this.model.error}}- <div class="error-info">- {{html-safe this.model.error}}+export default RouteTemplate(+ <template>+ <div class="container email-login clearfix">+ <div class="content-wrapper">+ <div class="image-wrapper">+ <img+ src={{@controller.lockImageUrl}}+ class="password-reset-img"+ alt+ /></div>- {{/if}}- {{#if this.model.can_login}}- <div class="email-login-form">- {{#if this.secondFactorRequired}}- {{#if this.model.security_key_required}}- <SecurityKeyForm- @setShowSecurityKey={{fn- (mut this.model.security_key_required)- }}- @setSecondFactorMethod={{fn (mut this.secondFactorMethod)}}- @backupEnabled={{this.model.backup_codes_enabled}}- @totpEnabled={{this.model.totp_enabled}}- @otherMethodAllowed={{this.secondFactorRequired}}- @action={{this.authenticateSecurityKey}}- />- {{else}}- <SecondFactorForm- @secondFactorMethod={{this.secondFactorMethod}}- @secondFactorToken={{this.secondFactorToken}}- @backupEnabled={{this.model.backup_codes_enabled}}- @totpEnabled={{this.model.totp_enabled}}- @isLogin={{true}}- >- <SecondFactorInput- {{on- "input"- (with-event-value (fn (mut this.secondFactorToken)))- }}- @secondFactorMethod={{this.secondFactorMethod}}- value={{this.secondFactorToken}}- />- </SecondFactorForm>- {{/if}}- {{else}}- <h2>{{i18n- "email_login.confirm_title"- site_name=this.siteSettings.title- }}</h2>- <p>{{i18n- "email_login.logging_in_as"- email=this.model.token_email- }}</p>+ <form>+ {{#if @controller.model.error}}+ <div class="error-info">+ {{htmlSafe @controller.model.error}}+ </div>{{/if}}- {{#unless this.model.security_key_required}}- <DButton- @label="email_login.confirm_button"- @action={{action "finishLogin"}}- type="submit"- class="btn-primary"- />- {{/unless}}- </div>- {{/if}}- </form>- </div>-</div>\ No newline at end of file+ {{#if @controller.model.can_login}}+ <div class="email-login-form">+ {{#if @controller.secondFactorRequired}}+ {{#if @controller.model.security_key_required}}+ <SecurityKeyForm+ @setShowSecurityKey={{fn+ (mut @controller.model.security_key_required)+ }}+ @setSecondFactorMethod={{fn+ (mut @controller.secondFactorMethod)+ }}+ @backupEnabled={{@controller.model.backup_codes_enabled}}+ @totpEnabled={{@controller.model.totp_enabled}}+ @otherMethodAllowed={{@controller.secondFactorRequired}}+ @action={{@controller.authenticateSecurityKey}}+ />+ {{else}}+ <SecondFactorForm+ @secondFactorMethod={{@controller.secondFactorMethod}}+ @secondFactorToken={{@controller.secondFactorToken}}+ @backupEnabled={{@controller.model.backup_codes_enabled}}+ @totpEnabled={{@controller.model.totp_enabled}}+ @isLogin={{true}}+ >+ <SecondFactorInput+ {{on+ "input"+ (withEventValue+ (fn (mut @controller.secondFactorToken))+ )+ }}+ @secondFactorMethod={{@controller.secondFactorMethod}}+ value={{@controller.secondFactorToken}}+ />+ </SecondFactorForm>+ {{/if}}+ {{else}}+ <h2>{{i18n+ "email_login.confirm_title"+ }}</h2>+ <p>{{i18n+ "email_login.logging_in_as"+ [email protected]_email+ }}</p>+ {{/if}}++ {{#unless @controller.model.security_key_required}}+ <DButton+ @label="email_login.confirm_button"+ @action={{@controller.finishLogin}}+ type="submit"+ class="btn-primary"+ />+ {{/unless}}+ </div>+ {{/if}}+ </form>+ </div>+ </div>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/exception.gjs b/app/assets/javascripts/discourse/app/templates/exception.gjsindex 2ee60e9824c..6c38f556720 100644--- a/app/assets/javascripts/discourse/app/templates/exception.gjs+++ b/app/assets/javascripts/discourse/app/templates/exception.gjs@@ -1,37 +1,49 @@-<div class="container">- {{#if (and this.errorHtml this.isForbidden)}}- <div class="not-found">{{html-safe this.errorHtml}}</div>- {{else}}- <div class="error-page">- <div class="face">:(</div>- <div class="reason">{{this.reason}}</div>- {{#if this.requestUrl}}- <div class="url">- {{i18n "errors.prev_page"}}- <a- href={{this.requestUrl}}- data-auto-route="true"- >{{this.requestUrl}}</a>+import { htmlSafe } from "@ember/template";+import RouteTemplate from "ember-route-template";+import { and } from "truth-helpers";+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";+import DButton from "discourse/components/d-button";+import icon from "discourse/helpers/d-icon";+import { i18n } from "discourse-i18n";++export default RouteTemplate(+ <template>+ <div class="container">+ {{#if (and @controller.errorHtml @controller.isForbidden)}}+ <div class="not-found">{{htmlSafe @controller.errorHtml}}</div>+ {{else}}+ <div class="error-page">+ <div class="face">:(</div>+ <div class="reason">{{@controller.reason}}</div>+ {{#if @controller.requestUrl}}+ <div class="url">+ {{i18n "errors.prev_page"}}+ <a+ href={{@controller.requestUrl}}+ data-auto-route="true"+ >{{@controller.requestUrl}}</a>+ </div>+ {{/if}}+ <div class="desc">+ {{#if @controller.networkFixed}}+ {{icon "circle-check"}}+ {{/if}}++ {{@controller.desc}}+ </div>+ <div class="buttons">+ {{#each @controller.enabledButtons as |buttonData|}}+ <DButton+ @icon={{buttonData.icon}}+ @action={{buttonData.action}}+ @label={{buttonData.key}}+ class={{buttonData.classes}}+ />+ {{/each}}+ <ConditionalLoadingSpinner @condition={{@controller.loading}} />+ </div></div>{{/if}}- <div class="desc">- {{#if this.networkFixed}}- {{d-icon "circle-check"}}- {{/if}}-- {{this.desc}}- </div>- <div class="buttons">- {{#each this.enabledButtons as |buttonData|}}- <DButton- @icon={{buttonData.icon}}- @action={{buttonData.action}}- @label={{buttonData.key}}- class={{buttonData.classes}}- />- {{/each}}- <ConditionalLoadingSpinner @condition={{this.loading}} />- </div></div>- {{/if}}-</div>\ No newline at end of file+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/faq.gjs b/app/assets/javascripts/discourse/app/templates/faq.gjsindex dbf2f74fb8f..c6d24b75da9 100644--- a/app/assets/javascripts/discourse/app/templates/faq.gjs+++ b/app/assets/javascripts/discourse/app/templates/faq.gjs@@ -1,11 +1,22 @@-{{body-class (concat "static-" this.model.path)}}+import { concat } from "@ember/helper";+import { htmlSafe } from "@ember/template";+import RouteTemplate from "ember-route-template";+import PluginOutlet from "discourse/components/plugin-outlet";+import WatchRead from "discourse/components/watch-read";+import bodyClass from "discourse/helpers/body-class";-<section class="container">- <WatchRead>- <div class="contents clearfix body-page">- <PluginOutlet @name="above-static" />- {{html-safe this.model.html}}- <PluginOutlet @name="below-static" />- </div>- </WatchRead>-</section>\ No newline at end of file+export default RouteTemplate(+ <template>+ {{bodyClass (concat "static-" @controller.model.path)}}++ <section class="container">+ <WatchRead>+ <div class="contents clearfix body-page">+ <PluginOutlet @name="above-static" />+ {{htmlSafe @controller.model.html}}+ <PluginOutlet @name="below-static" />+ </div>+ </WatchRead>+ </section>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/group-activity-posts.gjs b/app/assets/javascripts/discourse/app/templates/group-activity-posts.gjsindex 58609867019..4f9175a2b5a 100644--- a/app/assets/javascripts/discourse/app/templates/group-activity-posts.gjs+++ b/app/assets/javascripts/discourse/app/templates/group-activity-posts.gjs@@ -1,6 +1,14 @@-<PostList- @posts={{this.model}}- @titlePath="topic_html_title"- @fetchMorePosts={{this.fetchMorePosts}}- @emptyText={{i18n "groups.empty.posts"}}-/>\ No newline at end of file+import RouteTemplate from "ember-route-template";+import PostList from "discourse/components/post-list/index";+import { i18n } from "discourse-i18n";++export default RouteTemplate(+ <template>+ <PostList+ @posts={{@controller.model}}+ @titlePath="topic_html_title"+ @fetchMorePosts={{@controller.fetchMorePosts}}+ @emptyText={{i18n "groups.empty.posts"}}+ />+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/group-activity-topics.gjs b/app/assets/javascripts/discourse/app/templates/group-activity-topics.gjsindex 0225bd07c55..9755fb47785 100644--- a/app/assets/javascripts/discourse/app/templates/group-activity-topics.gjs+++ b/app/assets/javascripts/discourse/app/templates/group-activity-topics.gjs@@ -1,8 +1,17 @@-<LoadMore- @selector=".paginated-topics-list .topic-list tr"- @action={{action "loadMore"}}- class="paginated-topics-list"->- <BasicTopicList @topicList={{this.model}} @showPosters={{true}} />- <ConditionalLoadingSpinner @condition={{this.model.loadingMore}} />-</LoadMore>\ No newline at end of file+import RouteTemplate from "ember-route-template";+import BasicTopicList from "discourse/components/basic-topic-list";+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";+import LoadMore from "discourse/components/load-more";++export default RouteTemplate(+ <template>+ <LoadMore+ @selector=".paginated-topics-list .topic-list tr"+ @action={{@controller.loadMore}}+ class="paginated-topics-list"+ >+ <BasicTopicList @topicList={{@controller.model}} @showPosters={{true}} />+ <ConditionalLoadingSpinner @condition={{@controller.model.loadingMore}} />+ </LoadMore>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/group-index.gjs b/app/assets/javascripts/discourse/app/templates/group-index.gjsindex d9f9753751d..595e0b7e107 100644--- a/app/assets/javascripts/discourse/app/templates/group-index.gjs+++ b/app/assets/javascripts/discourse/app/templates/group-index.gjs@@ -1,253 +1,290 @@-{{#if (or this.loading this.canLoadMore)}}- {{hide-application-footer}}-{{/if}}--<section class="user-content">- <div class="group-members-actions">- {{#if this.canManageGroup}}- <DButton- @icon="list"- @action={{this.toggleBulkSelect}}- @title="topics.bulk.toggle"- class="btn-default bulk-select"- />- {{/if}}+import { Input } from "@ember/component";+import { fn, hash } from "@ember/helper";+import { on } from "@ember/modifier";+import RouteTemplate from "ember-route-template";+import { or } from "truth-helpers";+import BulkGroupMemberDropdown from "discourse/components/bulk-group-member-dropdown";+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";+import DButton from "discourse/components/d-button";+import GroupMemberDropdown from "discourse/components/group-member-dropdown";+import LoadMore from "discourse/components/load-more";+import PluginOutlet from "discourse/components/plugin-outlet";+import ResponsiveTable from "discourse/components/responsive-table";+import TableHeaderToggle from "discourse/components/table-header-toggle";+import TextField from "discourse/components/text-field";+import UserInfo from "discourse/components/user-info";+import boundDate from "discourse/helpers/bound-date";+import icon from "discourse/helpers/d-icon";+import hideApplicationFooter from "discourse/helpers/hide-application-footer";+import routeAction from "discourse/helpers/route-action";+import { i18n } from "discourse-i18n";- {{#if this.model.can_see_members}}- <TextField- @value={{this.filterInput}}- @placeholderKey={{this.filterPlaceholder}}- @autocomplete="off"- class="group-username-filter no-blur"- />+export default RouteTemplate(+ <template>+ {{#if (or @controller.loading @controller.canLoadMore)}}+ {{hideApplicationFooter}}{{/if}}- {{#if this.canManageGroup}}- {{#if this.isBulk}}- <span class="bulk-select-buttons-wrap">- {{#if this.bulkSelection}}- <BulkGroupMemberDropdown- @bulkSelection={{this.bulkSelection}}- @canAdminGroup={{this.model.can_admin_group}}- @canEditGroup={{this.model.can_edit_group}}- @onChange={{action "actOnSelection" this.bulkSelection}}- />-- <DButton- @action={{this.bulkClearAll}}- @label="topics.bulk.clear_all"- @icon="far-square"- class="bulk-select-clear"- />- {{/if}}-+ <section class="user-content">+ <div class="group-members-actions">+ {{#if @controller.canManageGroup}}<DButton- @action={{this.bulkSelectAll}}- @label="topics.bulk.select_all"- @icon="square-check"- class="bulk-select-all"+ @icon="list"+ @action={{@controller.toggleBulkSelect}}+ @title="topics.bulk.toggle"+ class="btn-default bulk-select"/>- </span>- {{/if}}-- <div class="group-members-manage">- <DButton- @icon="plus"- @action={{route-action "showAddMembersModal"}}- @label="groups.manage.add_members"- class="btn-default group-members-add"- />+ {{/if}}- {{#if this.currentUser.can_invite_to_forum}}- <DButton- @icon="plus"- @action={{route-action "showInviteModal"}}- @label="groups.manage.invite_members"- class="btn-default group-members-invite"+ {{#if @controller.model.can_see_members}}+ <TextField+ @value={{@controller.filterInput}}+ @placeholderKey={{@controller.filterPlaceholder}}+ @autocomplete="off"+ class="group-username-filter no-blur"/>{{/if}}- </div>- {{/if}}- </div>-- {{#if this.hasMembers}}- <LoadMore- @selector=".directory-table .directory-table__cell"- @action={{action "loadMore"}}- >- <ResponsiveTable- @className="group-members- {{if this.isBulk 'sticky-header' ''}}- {{if this.canManageGroup 'group-members--can-manage' ''}}"- >- <:header>- <TableHeaderToggle- @onToggle={{this.updateOrder}}- @order={{this.order}}- @asc={{this.asc}}- @field="username_lower"- @labelKey="username"- @automatic={{true}}- @colspan="2"- class="directory-table__column-header--username username"- />- {{#if this.canManageGroup}}- <div- class="directory-table__column-header directory-table__column-header--can-manage"- ></div>+ {{#if @controller.canManageGroup}}+ {{#if @controller.isBulk}}+ <span class="bulk-select-buttons-wrap">+ {{#if @controller.bulkSelection}}+ <BulkGroupMemberDropdown+ @bulkSelection={{@controller.bulkSelection}}+ @canAdminGroup={{@controller.model.can_admin_group}}+ @canEditGroup={{@controller.model.can_edit_group}}+ @onChange={{fn+ @controller.actOnSelection+ @controller.bulkSelection+ }}+ />++ <DButton+ @action={{@controller.bulkClearAll}}+ @label="topics.bulk.clear_all"+ @icon="far-square"+ class="bulk-select-clear"+ />+ {{/if}}++ <DButton+ @action={{@controller.bulkSelectAll}}+ @label="topics.bulk.select_all"+ @icon="square-check"+ class="bulk-select-all"+ />+ </span>{{/if}}- <PluginOutlet- @name="group-index-table-header-after-username"- @outletArgs={{hash group=this.model asc=this.asc order=this.order}}- />+ <div class="group-members-manage">+ <DButton+ @icon="plus"+ @action={{routeAction "showAddMembersModal"}}+ @label="groups.manage.add_members"+ class="btn-default group-members-add"+ />- <TableHeaderToggle- @onToggle={{this.updateOrder}}- @order={{this.order}}- @asc={{this.asc}}- @field="added_at"- @labelKey="groups.member_added"- @automatic={{true}}- class="directory-table__column-header--added"- />- <TableHeaderToggle- @onToggle={{this.updateOrder}}- @order={{this.order}}- @asc={{this.asc}}- @field="last_posted_at"- @labelKey="last_post"- @automatic={{true}}- class="directory-table__column-header--last-posted"- />- <TableHeaderToggle- @onToggle={{this.updateOrder}}- @order={{this.order}}- @asc={{this.asc}}- @field="last_seen_at"- @labelKey="last_seen"- @automatic={{true}}- class="directory-table__column-header--last-seen"- />+ {{#if @controller.currentUser.can_invite_to_forum}}+ <DButton+ @icon="plus"+ @action={{routeAction "showInviteModal"}}+ @label="groups.manage.invite_members"+ class="btn-default group-members-invite"+ />+ {{/if}}+ </div>+ {{/if}}+ </div>- {{#if this.canManageGroup}}- <div- class="directory-table__column-header directory-table__column-header--member-settings"- ></div>- {{/if}}- </:header>-- <:body>- {{#each this.model.members as |m|}}- <div class="directory-table__row">- <div- class="directory-table__cell directory-table__cell--username group-member"- colspan="2"- >- {{#if this.canManageGroup}}- {{#if this.isBulk}}- <Input- @type="checkbox"- class="bulk-select"- {{on "click" (action "selectMember" m)}}- />- {{/if}}- {{/if}}- <UserInfo- @user={{m}}- @skipName={{this.skipName}}- @showStatus={{true}}- @showStatusTooltip={{true}}- />- </div>+ {{#if @controller.hasMembers}}+ <LoadMore+ @selector=".directory-table .directory-table__cell"+ @action={{@controller.loadMore}}+ >+ <ResponsiveTable+ @className="group-members+ {{if @controller.isBulk 'sticky-header' ''}}+ {{if @controller.canManageGroup 'group-members--can-manage' ''}}"+ >+ <:header>+ <TableHeaderToggle+ @onToggle={{@controller.updateOrder}}+ @order={{@controller.order}}+ @asc={{@controller.asc}}+ @field="username_lower"+ @labelKey="username"+ @automatic={{true}}+ @colspan="2"+ class="directory-table__column-header--username username"+ />- {{#if this.canManageGroup}}+ {{#if @controller.canManageGroup}}<div- class="directory-table__cell directory-table__cell--can-manage group-owner"- >- {{#if (or m.owner m.primary)}}- <span class="directory-table__label">- <span>{{i18n "groups.members.status"}}</span>- </span>- {{/if}}- <span class="directory-table__value">- {{#if m.owner}}- {{d-icon "shield-halved"}}- {{i18n "groups.members.owner"}}<br />- {{/if}}- {{#if m.primary}}- {{i18n "groups.members.primary"}}- {{/if}}- </span>-- </div>+ class="directory-table__column-header directory-table__column-header--can-manage"+ ></div>{{/if}}<PluginOutlet- @name="group-index-table-row-after-username"- @outletArgs={{hash member=m}}+ @name="group-index-table-header-after-username"+ @outletArgs={{hash+ }}/>- <div class="directory-table__cell directory-table__cell--added">- <span class="directory-table__label">- <span>{{i18n "groups.member_added"}}</span>- </span>- <span class="directory-table__value">- {{bound-date m.added_at}}- </span>- </div>- <div- class="directory-table__cell{{unless- m.last_posted_at- '--empty'- }}- directory-table__cell--last-posted"- >- {{#if m.last_posted_at}}- <span class="directory-table__label">- <span>{{i18n "last_post"}}</span>- </span>- {{/if}}- <span class="directory-table__value">- {{bound-date m.last_posted_at}}- </span>- </div>- <div- class="directory-table__cell{{unless m.last_seen_at '--empty'}}- directory-table__cell--last-seen"- >- {{#if m.last_seen_at}}- <span class="directory-table__label">- <span>{{i18n "last_seen"}}</span>- </span>- {{/if}}- <span class="directory-table__value">- {{bound-date m.last_seen_at}}- </span>- </div>- {{#if this.canManageGroup}}+ <TableHeaderToggle+ @onToggle={{@controller.updateOrder}}+ @order={{@controller.order}}+ @asc={{@controller.asc}}+ @field="added_at"+ @labelKey="groups.member_added"+ @automatic={{true}}+ class="directory-table__column-header--added"+ />+ <TableHeaderToggle+ @onToggle={{@controller.updateOrder}}+ @order={{@controller.order}}+ @asc={{@controller.asc}}+ @field="last_posted_at"+ @labelKey="last_post"+ @automatic={{true}}+ class="directory-table__column-header--last-posted"+ />+ <TableHeaderToggle+ @onToggle={{@controller.updateOrder}}+ @order={{@controller.order}}+ @asc={{@controller.asc}}+ @field="last_seen_at"+ @labelKey="last_seen"+ @automatic={{true}}+ class="directory-table__column-header--last-seen"+ />++ {{#if @controller.canManageGroup}}<div- class="directory-table__cell directory-table__cell--member-settings member-settings"- >- <GroupMemberDropdown- @member={{m}}- @canAdminGroup={{this.model.can_admin_group}}- @canEditGroup={{this.model.can_edit_group}}- @onChange={{action "actOnGroup" m}}+ class="directory-table__column-header directory-table__column-header--member-settings"+ ></div>+ {{/if}}+ </:header>++ <:body>+ {{#each @controller.model.members as |m|}}+ <div class="directory-table__row">+ <div+ class="directory-table__cell directory-table__cell--username group-member"+ colspan="2"+ >+ {{#if @controller.canManageGroup}}+ {{#if @controller.isBulk}}+ <Input+ @type="checkbox"+ class="bulk-select"+ {{on "click" (fn @controller.selectMember m)}}+ />+ {{/if}}+ {{/if}}+ <UserInfo+ @user={{m}}+ @skipName={{@controller.skipName}}+ @showStatus={{true}}+ @showStatusTooltip={{true}}+ />+ </div>++ {{#if @controller.canManageGroup}}+ <div+ class="directory-table__cell directory-table__cell--can-manage group-owner"+ >+ {{#if (or m.owner m.primary)}}+ <span class="directory-table__label">+ <span>{{i18n "groups.members.status"}}</span>+ </span>+ {{/if}}+ <span class="directory-table__value">+ {{#if m.owner}}+ {{icon "shield-halved"}}+ {{i18n "groups.members.owner"}}<br />+ {{/if}}+ {{#if m.primary}}+ {{i18n "groups.members.primary"}}+ {{/if}}+ </span>++ </div>+ {{/if}}++ <PluginOutlet+ @name="group-index-table-row-after-username"+ @outletArgs={{hash member=m}}/>- {{! group parameter is used by plugins }}++ <div+ class="directory-table__cell directory-table__cell--added"+ >+ <span class="directory-table__label">+ <span>{{i18n "groups.member_added"}}</span>+ </span>+ <span class="directory-table__value">+ {{boundDate m.added_at}}+ </span>+ </div>+ <div+ class="directory-table__cell{{unless+ m.last_posted_at+ '--empty'+ }}+ directory-table__cell--last-posted"+ >+ {{#if m.last_posted_at}}+ <span class="directory-table__label">+ <span>{{i18n "last_post"}}</span>+ </span>+ {{/if}}+ <span class="directory-table__value">+ {{boundDate m.last_posted_at}}+ </span>+ </div>+ <div+ class="directory-table__cell{{unless+ m.last_seen_at+ '--empty'+ }}+ directory-table__cell--last-seen"+ >+ {{#if m.last_seen_at}}+ <span class="directory-table__label">+ <span>{{i18n "last_seen"}}</span>+ </span>+ {{/if}}+ <span class="directory-table__value">+ {{boundDate m.last_seen_at}}+ </span>+ </div>+ {{#if @controller.canManageGroup}}+ <div+ class="directory-table__cell directory-table__cell--member-settings member-settings"+ >+ <GroupMemberDropdown+ @member={{m}}+ @canAdminGroup={{@controller.model.can_admin_group}}+ @canEditGroup={{@controller.model.can_edit_group}}+ @onChange={{fn @controller.actOnGroup m}}+ />+ {{! group parameter is used by plugins }}+ </div>+ {{/if}}</div>- {{/if}}- </div>- {{/each}}- </:body>- </ResponsiveTable>- </LoadMore>-- <ConditionalLoadingSpinner @condition={{this.loading}} />- {{else}}- <br />- <div>{{i18n this.emptyMessageKey}}</div>- {{/if}}-</section>\ No newline at end of file+ {{/each}}+ </:body>+ </ResponsiveTable>+ </LoadMore>++ <ConditionalLoadingSpinner @condition={{@controller.loading}} />+ {{else}}+ <br />+ <div>{{i18n @controller.emptyMessageKey}}</div>+ {{/if}}+ </section>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/group-requests.gjs b/app/assets/javascripts/discourse/app/templates/group-requests.gjsindex 8b0bd306c97..f0398951924 100644--- a/app/assets/javascripts/discourse/app/templates/group-requests.gjs+++ b/app/assets/javascripts/discourse/app/templates/group-requests.gjs@@ -1,98 +1,118 @@-{{#if (or this.loading this.canLoadMore)}}- {{hide-application-footer}}-{{/if}}+import { fn } from "@ember/helper";+import RouteTemplate from "ember-route-template";+import { or } from "truth-helpers";+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";+import DButton from "discourse/components/d-button";+import LoadMore from "discourse/components/load-more";+import ResponsiveTable from "discourse/components/responsive-table";+import TableHeaderToggle from "discourse/components/table-header-toggle";+import TextField from "discourse/components/text-field";+import UserInfo from "discourse/components/user-info";+import boundDate from "discourse/helpers/bound-date";+import hideApplicationFooter from "discourse/helpers/hide-application-footer";+import { i18n } from "discourse-i18n";-<section class="user-content">- <div class="group-members-actions">- <TextField- @value={{this.filterInput}}- @placeholderKey={{this.filterPlaceholder}}- class="group-username-filter no-blur"- />- </div>+export default RouteTemplate(+ <template>+ {{#if (or @controller.loading @controller.canLoadMore)}}+ {{hideApplicationFooter}}+ {{/if}}- {{#if this.hasRequesters}}- <LoadMore- @selector=".directory-table .directory-table__cell"- @action={{action "loadMore"}}- >- <ResponsiveTable @className="group-members group-members__requests">- <:header>- <TableHeaderToggle- @onToggle={{this.updateOrder}}- @order={{this.order}}- @asc={{this.asc}}- @field="username_lower"- @labelKey="username"- @automatic={{true}}- class="username"- />- <TableHeaderToggle- @onToggle={{this.updateOrder}}- @order={{this.order}}- @asc={{this.asc}}- @field="requested_at"- @labelKey="groups.member_requested"- @automatic={{true}}- />- <div- class="directory-table__column-header group-request-reason__column-header"- >{{i18n "groups.requests.reason"}}</div>- <div class="directory-table__column-header"></div>- </:header>- <:body>- {{#each this.model.requesters as |m|}}- <div class="directory-table__row">- <div class="directory-table__cell group-member">- <UserInfo @user={{m}} @skipName={{this.skipName}} />- </div>- <div class="directory-table__cell">- <span class="directory-table__label">- <span>{{i18n "groups.member_requested"}}</span>- </span>- <span class="directory-table__value">- <span>{{bound-date m.requested_at}}</span>- </span>- </div>- <div class="directory-table__cell group-request-reason__content">- <span class="directory-table__label">- <span>{{i18n "groups.requests.reason"}}</span>- </span>- <span class="directory-table__value">- {{m.reason}}- </span>- </div>- <div class="directory-table__cell group-accept-deny-buttons">- {{#if m.request_undone}}- {{i18n "groups.requests.undone"}}- {{else if m.request_accepted}}- {{i18n "groups.requests.accepted"}}- <DButton- @action={{fn (action "undoAcceptRequest") m}}- @label="groups.requests.undo"- />- {{else if m.request_denied}}- {{i18n "groups.requests.denied"}}- {{else}}- <DButton- @action={{fn (action "acceptRequest") m}}- @label="groups.requests.accept"- class="btn-primary"- />- <DButton- @action={{fn (action "denyRequest") m}}- @label="groups.requests.deny"- class="btn-danger"- />- {{/if}}- </div>- </div>- {{/each}}- </:body>- </ResponsiveTable>- </LoadMore>- <ConditionalLoadingSpinner @condition={{this.loading}} />- {{else}}- <div>{{i18n "groups.empty.requests"}}</div>- {{/if}}-</section>\ No newline at end of file+ <section class="user-content">+ <div class="group-members-actions">+ <TextField+ @value={{@controller.filterInput}}+ @placeholderKey={{@controller.filterPlaceholder}}+ class="group-username-filter no-blur"+ />+ </div>++ {{#if @controller.hasRequesters}}+ <LoadMore+ @selector=".directory-table .directory-table__cell"+ @action={{@controller.loadMore}}+ >+ <ResponsiveTable @className="group-members group-members__requests">+ <:header>+ <TableHeaderToggle+ @onToggle={{@controller.updateOrder}}+ @order={{@controller.order}}+ @asc={{@controller.asc}}+ @field="username_lower"+ @labelKey="username"+ @automatic={{true}}+ class="username"+ />+ <TableHeaderToggle+ @onToggle={{@controller.updateOrder}}+ @order={{@controller.order}}+ @asc={{@controller.asc}}+ @field="requested_at"+ @labelKey="groups.member_requested"+ @automatic={{true}}+ />+ <div+ class="directory-table__column-header group-request-reason__column-header"+ >{{i18n "groups.requests.reason"}}</div>+ <div class="directory-table__column-header"></div>+ </:header>+ <:body>+ {{#each @controller.model.requesters as |m|}}+ <div class="directory-table__row">+ <div class="directory-table__cell group-member">+ <UserInfo @user={{m}} @skipName={{@controller.skipName}} />+ </div>+ <div class="directory-table__cell">+ <span class="directory-table__label">+ <span>{{i18n "groups.member_requested"}}</span>+ </span>+ <span class="directory-table__value">+ <span>{{boundDate m.requested_at}}</span>+ </span>+ </div>+ <div+ class="directory-table__cell group-request-reason__content"+ >+ <span class="directory-table__label">+ <span>{{i18n "groups.requests.reason"}}</span>+ </span>+ <span class="directory-table__value">+ {{m.reason}}+ </span>+ </div>+ <div class="directory-table__cell group-accept-deny-buttons">+ {{#if m.request_undone}}+ {{i18n "groups.requests.undone"}}+ {{else if m.request_accepted}}+ {{i18n "groups.requests.accepted"}}+ <DButton+ @action={{fn @controller.undoAcceptRequest m}}+ @label="groups.requests.undo"+ />+ {{else if m.request_denied}}+ {{i18n "groups.requests.denied"}}+ {{else}}+ <DButton+ @action={{fn @controller.acceptRequest m}}+ @label="groups.requests.accept"+ class="btn-primary"+ />+ <DButton+ @action={{fn @controller.denyRequest m}}+ @label="groups.requests.deny"+ class="btn-danger"+ />+ {{/if}}+ </div>+ </div>+ {{/each}}+ </:body>+ </ResponsiveTable>+ </LoadMore>+ <ConditionalLoadingSpinner @condition={{@controller.loading}} />+ {{else}}+ <div>{{i18n "groups.empty.requests"}}</div>+ {{/if}}+ </section>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/group.gjs b/app/assets/javascripts/discourse/app/templates/group.gjsindex 8d552500a80..b884147521c 100644--- a/app/assets/javascripts/discourse/app/templates/group.gjs+++ b/app/assets/javascripts/discourse/app/templates/group.gjs@@ -1,111 +1,135 @@-<span>- <PluginOutlet- @name="before-group-container"- @connectorTagName="div"- @outletArgs={{hash group=this.model}}- />-</span>+import { hash } from "@ember/helper";+import { htmlSafe } from "@ember/template";+import RouteTemplate from "ember-route-template";+import { and, or } from "truth-helpers";+import AvatarFlair from "discourse/components/avatar-flair";+import DButton from "discourse/components/d-button";+import GroupInfo from "discourse/components/group-info";+import GroupMembershipButton from "discourse/components/group-membership-button";+import GroupNavigation from "discourse/components/group-navigation";+import PluginOutlet from "discourse/components/plugin-outlet";+import icon from "discourse/helpers/d-icon";+import routeAction from "discourse/helpers/route-action";+import { i18n } from "discourse-i18n";+import DTooltip from "float-kit/components/d-tooltip";-<div class="container group group-{{this.model.name}}">- {{#if this.showTooltip}}- <div class="group-delete-tooltip">- <p>{{i18n "admin.groups.delete_automatic_group"}}</p>- </div>- {{/if}}+export default RouteTemplate(+ <template>+ <span>+ <PluginOutlet+ @name="before-group-container"+ @connectorTagName="div"+ @outletArgs={{hash [email protected]}}+ />+ </span>- <div class="group-details-container">- <div class="group-info">- {{#if- (or- this.model.flair_icon this.model.flair_url this.model.flair_bg_color- )- }}- <div class="group-avatar-flair">- <AvatarFlair- @flairName={{this.model.name}}- @flairUrl={{or this.model.flair_icon this.model.flair_url}}- @flairBgColor={{this.model.flair_bg_color}}- @flairColor={{this.model.flair_color}}- />+ <div class="container group group-{{@controller.model.name}}">+ {{#if @controller.showTooltip}}+ <div class="group-delete-tooltip">+ <p>{{i18n "admin.groups.delete_automatic_group"}}</p></div>{{/if}}- <div class="group-info-names">- <GroupInfo @group={{this.model}} />+ <div class="group-details-container">+ <div class="group-info">+ {{#if+ (or+ @controller.model.flair_icon+ @controller.model.flair_url+ @controller.model.flair_bg_color+ )+ }}+ <div class="group-avatar-flair">+ <AvatarFlair+ @flairName={{@controller.model.name}}+ @flairUrl={{or+ @controller.model.flair_icon+ @controller.model.flair_url+ }}+ @flairBgColor={{@controller.model.flair_bg_color}}+ @flairColor={{@controller.model.flair_color}}+ />+ </div>+ {{/if}}- {{#if (and this.canManageGroup this.model.automatic)}}- <DTooltip class="group-automatic-tooltip">- <:trigger>- {{d-icon "gear"}}- {{i18n "admin.groups.manage.membership.automatic"}}- </:trigger>- <:content>- {{i18n "admin.groups.manage.membership.automatic_tooltip"}}- </:content>- </DTooltip>- {{/if}}- </div>+ <div class="group-info-names">+ <GroupInfo @group={{@controller.model}} />- <div class="group-details-button">- <GroupMembershipButton- @tagName=""- @model={{this.model}}- @showLogin={{route-action "showLogin"}}- />+ {{#if (and @controller.canManageGroup @controller.model.automatic)}}+ <DTooltip class="group-automatic-tooltip">+ <:trigger>+ {{icon "gear"}}+ {{i18n "admin.groups.manage.membership.automatic"}}+ </:trigger>+ <:content>+ {{i18n "admin.groups.manage.membership.automatic_tooltip"}}+ </:content>+ </DTooltip>+ {{/if}}+ </div>- {{#if this.currentUser.admin}}- {{#if this.model.automatic}}- <DButton- @action={{this.toggleDeleteTooltip}}- @icon="circle-question"- @label="admin.groups.delete"- class="btn-default"- />- {{else}}- <DButton- @action={{this.destroyGroup}}- @disabled={{this.destroying}}- @icon="trash-can"- @label="admin.groups.delete"- class="btn-danger"- data-test-selector="delete-group-button"+ <div class="group-details-button">+ <GroupMembershipButton+ @tagName=""+ @model={{@controller.model}}+ @showLogin={{routeAction "showLogin"}}/>- {{/if}}- {{/if}}- {{#if this.displayGroupMessageButton}}- <DButton- @action={{this.messageGroup}}- @icon="envelope"- @label="groups.message"- class="btn-primary group-message-button"+ {{#if @controller.currentUser.admin}}+ {{#if @controller.model.automatic}}+ <DButton+ @action={{@controller.toggleDeleteTooltip}}+ @icon="circle-question"+ @label="admin.groups.delete"+ class="btn-default"+ />+ {{else}}+ <DButton+ @action={{@controller.destroyGroup}}+ @disabled={{@controller.destroying}}+ @icon="trash-can"+ @label="admin.groups.delete"+ class="btn-danger"+ data-test-selector="delete-group-button"+ />+ {{/if}}+ {{/if}}++ {{#if @controller.displayGroupMessageButton}}+ <DButton+ @action={{@controller.messageGroup}}+ @icon="envelope"+ @label="groups.message"+ class="btn-primary group-message-button"+ />+ {{/if}}+ </div>++ <PluginOutlet+ @name="group-details-after"+ @connectorTagName="div"+ @outletArgs={{hash [email protected]}}/>- {{/if}}- </div>+ </div>- <PluginOutlet- @name="group-details-after"- @connectorTagName="div"- @outletArgs={{hash model=this.model}}- />- </div>+ {{#if @controller.model.bio_cooked}}+ <div class="group-bio">+ {{htmlSafe @controller.model.bio_cooked}}+ </div>+ {{/if}}- {{#if this.model.bio_cooked}}- <div class="group-bio">- {{html-safe this.model.bio_cooked}}</div>- {{/if}}-- </div>- <div class="user-content-wrapper">- <section class="user-primary-navigation">- <GroupNavigation- @group={{this.model}}- @currentPath={{this.currentPath}}- @tabs={{this.tabs}}- />- </section>- {{outlet}}- </div>-</div>\ No newline at end of file+ <div class="user-content-wrapper">+ <section class="user-primary-navigation">+ <GroupNavigation+ @group={{@controller.model}}+ @currentPath={{@controller.currentPath}}+ @tabs={{@controller.tabs}}+ />+ </section>+ {{outlet}}+ </div>+ </div>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/group/activity.gjs b/app/assets/javascripts/discourse/app/templates/group/activity.gjsindex 20da498ef1e..868c0fd3fd0 100644--- a/app/assets/javascripts/discourse/app/templates/group/activity.gjs+++ b/app/assets/javascripts/discourse/app/templates/group/activity.gjs@@ -1,18 +1,33 @@-<section class="user-secondary-navigation">- <HorizontalOverflowNav class="activity-nav">- {{#if this.model.can_see_members}}- <GroupActivityFilter @filter="posts" @categoryId={{this.category_id}} />- <GroupActivityFilter @filter="topics" @categoryId={{this.category_id}} />- {{/if}}- {{#if this.siteSettings.enable_mentions}}- <GroupActivityFilter- @filter="mentions"- @categoryId={{this.category_id}}- />- {{/if}}- <PluginOutlet @name="group-activity-bottom" @connectorTagName="li" />- </HorizontalOverflowNav>-</section>-<section class="user-content" id="user-content">- {{outlet}}-</section>\ No newline at end of file+import RouteTemplate from "ember-route-template";+import GroupActivityFilter from "discourse/components/group-activity-filter";+import HorizontalOverflowNav from "discourse/components/horizontal-overflow-nav";+import PluginOutlet from "discourse/components/plugin-outlet";++export default RouteTemplate(+ <template>+ <section class="user-secondary-navigation">+ <HorizontalOverflowNav class="activity-nav">+ {{#if @controller.model.can_see_members}}+ <GroupActivityFilter+ @filter="posts"+ @categoryId={{@controller.category_id}}+ />+ <GroupActivityFilter+ @filter="topics"+ @categoryId={{@controller.category_id}}+ />+ {{/if}}+ {{#if @controller.siteSettings.enable_mentions}}+ <GroupActivityFilter+ @filter="mentions"+ @categoryId={{@controller.category_id}}+ />+ {{/if}}+ <PluginOutlet @name="group-activity-bottom" @connectorTagName="li" />+ </HorizontalOverflowNav>+ </section>+ <section class="user-content" id="user-content">+ {{outlet}}+ </section>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/group/manage.gjs b/app/assets/javascripts/discourse/app/templates/group/manage.gjsindex 3841fbc501f..c5edb5bc319 100644--- a/app/assets/javascripts/discourse/app/templates/group/manage.gjs+++ b/app/assets/javascripts/discourse/app/templates/group/manage.gjs@@ -1,14 +1,23 @@-<section class="user-secondary-navigation">- <HorizontalOverflowNav class="activity-nav">- {{#each this.tabs as |tab|}}- <li>- <LinkTo @route={{tab.route}} @model={{this.model.name}}>- {{i18n tab.title}}- </LinkTo>- </li>- {{/each}}- </HorizontalOverflowNav>-</section>-<section class="user-content" id="user-content">- {{outlet}}-</section>\ No newline at end of file+import { LinkTo } from "@ember/routing";+import RouteTemplate from "ember-route-template";+import HorizontalOverflowNav from "discourse/components/horizontal-overflow-nav";+import { i18n } from "discourse-i18n";++export default RouteTemplate(+ <template>+ <section class="user-secondary-navigation">+ <HorizontalOverflowNav class="activity-nav">+ {{#each @controller.tabs as |tab|}}+ <li>+ <LinkTo @route={{tab.route}} @model={{@controller.model.name}}>+ {{i18n tab.title}}+ </LinkTo>+ </li>+ {{/each}}+ </HorizontalOverflowNav>+ </section>+ <section class="user-content" id="user-content">+ {{outlet}}+ </section>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/group/manage/email.gjs b/app/assets/javascripts/discourse/app/templates/group/manage/email.gjsindex eb580e33328..9c80c3cf778 100644--- a/app/assets/javascripts/discourse/app/templates/group/manage/email.gjs+++ b/app/assets/javascripts/discourse/app/templates/group/manage/email.gjs@@ -1 +1,6 @@-<GroupManageEmailSettings @group={{this.model}} />\ No newline at end of file+import RouteTemplate from "ember-route-template";+import GroupManageEmailSettings from "discourse/components/group-manage-email-settings";++export default RouteTemplate(+ <template><GroupManageEmailSettings @group={{@controller.model}} /></template>+);diff --git a/app/assets/javascripts/discourse/app/templates/group/manage/interaction.gjs b/app/assets/javascripts/discourse/app/templates/group/manage/interaction.gjsindex 5d33037e8e7..c79d8ff755f 100644--- a/app/assets/javascripts/discourse/app/templates/group/manage/interaction.gjs+++ b/app/assets/javascripts/discourse/app/templates/group/manage/interaction.gjs@@ -1,4 +1,12 @@-<form class="groups-form form-vertical">- <GroupsFormInteractionFields @model={{this.model}} />- <GroupManageSaveButton @model={{this.model}} />-</form>\ No newline at end of file+import RouteTemplate from "ember-route-template";+import GroupManageSaveButton from "discourse/components/group-manage-save-button";+import GroupsFormInteractionFields from "discourse/components/groups-form-interaction-fields";++export default RouteTemplate(+ <template>+ <form class="groups-form form-vertical">+ <GroupsFormInteractionFields @model={{@controller.model}} />+ <GroupManageSaveButton @model={{@controller.model}} />+ </form>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/group/manage/logs.gjs b/app/assets/javascripts/discourse/app/templates/group/manage/logs.gjsindex ddd2a0350bc..b7eff484727 100644--- a/app/assets/javascripts/discourse/app/templates/group/manage/logs.gjs+++ b/app/assets/javascripts/discourse/app/templates/group/manage/logs.gjs@@ -1,54 +1,69 @@-{{#unless this.model.all_loaded}}- {{hide-application-footer}}-{{/unless}}+import RouteTemplate from "ember-route-template";+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";+import GroupManageLogsFilter from "discourse/components/group-manage-logs-filter";+import GroupManageLogsRow from "discourse/components/group-manage-logs-row";+import LoadMore from "discourse/components/load-more";+import hideApplicationFooter from "discourse/helpers/hide-application-footer";+import { i18n } from "discourse-i18n";-{{#if this.model.logs}}- <div class="group-manage-logs-controls">- <GroupManageLogsFilter- @clearFilter={{action "clearFilter"}}- @value={{this.filters.action}}- @type="action"- />- <GroupManageLogsFilter- @clearFilter={{action "clearFilter"}}- @value={{this.filters.acting_user}}- @type="acting_user"- />- <GroupManageLogsFilter- @clearFilter={{action "clearFilter"}}- @value={{this.filters.target_user}}- @type="target_user"- />- <GroupManageLogsFilter- @clearFilter={{action "clearFilter"}}- @value={{this.filters.subject}}- @type="subject"- />- </div>+export default RouteTemplate(+ <template>+ {{#unless @controller.model.all_loaded}}+ {{hideApplicationFooter}}+ {{/unless}}- <LoadMore- @selector=".group-manage-logs .group-manage-logs-row"- @action={{action "loadMore"}}- >- <table class="group-manage-logs">- <thead>- <th>{{i18n "groups.manage.logs.action"}}</th>- <th>{{i18n "groups.manage.logs.acting_user"}}</th>- <th>{{i18n "groups.manage.logs.target_user"}}</th>- <th>{{i18n "groups.manage.logs.subject"}}</th>- <th>{{i18n "groups.manage.logs.when"}}</th>- <th></th>- </thead>+ {{#if @controller.model.logs}}+ <div class="group-manage-logs-controls">+ <GroupManageLogsFilter+ @clearFilter={{@controller.clearFilter}}+ @value={{@controller.filters.action}}+ @type="action"+ />+ <GroupManageLogsFilter+ @clearFilter={{@controller.clearFilter}}+ @value={{@controller.filters.acting_user}}+ @type="acting_user"+ />+ <GroupManageLogsFilter+ @clearFilter={{@controller.clearFilter}}+ @value={{@controller.filters.target_user}}+ @type="target_user"+ />+ <GroupManageLogsFilter+ @clearFilter={{@controller.clearFilter}}+ @value={{@controller.filters.subject}}+ @type="subject"+ />+ </div>- <tbody>- {{#each this.model.logs as |logItem|}}- <GroupManageLogsRow @log={{logItem}} @filters={{this.filters}} />- {{/each}}- </tbody>- </table>- </LoadMore>+ <LoadMore+ @selector=".group-manage-logs .group-manage-logs-row"+ @action={{@controller.loadMore}}+ >+ <table class="group-manage-logs">+ <thead>+ <th>{{i18n "groups.manage.logs.action"}}</th>+ <th>{{i18n "groups.manage.logs.acting_user"}}</th>+ <th>{{i18n "groups.manage.logs.target_user"}}</th>+ <th>{{i18n "groups.manage.logs.subject"}}</th>+ <th>{{i18n "groups.manage.logs.when"}}</th>+ <th></th>+ </thead>- <ConditionalLoadingSpinner @condition={{this.loading}} />-{{else}}- <div>{{i18n "groups.empty.logs"}}</div>-{{/if}}\ No newline at end of file+ <tbody>+ {{#each @controller.model.logs as |logItem|}}+ <GroupManageLogsRow+ @log={{logItem}}+ @filters={{@controller.filters}}+ />+ {{/each}}+ </tbody>+ </table>+ </LoadMore>++ <ConditionalLoadingSpinner @condition={{@controller.loading}} />+ {{else}}+ <div>{{i18n "groups.empty.logs"}}</div>+ {{/if}}+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/group/manage/membership.gjs b/app/assets/javascripts/discourse/app/templates/group/manage/membership.gjsindex 27c1130505c..ef273b51835 100644--- a/app/assets/javascripts/discourse/app/templates/group/manage/membership.gjs+++ b/app/assets/javascripts/discourse/app/templates/group/manage/membership.gjs@@ -1,4 +1,12 @@-<form class="groups-form form-vertical">- <GroupsFormMembershipFields @model={{this.model}} />- <GroupManageSaveButton @model={{this.model}} />-</form>\ No newline at end of file+import RouteTemplate from "ember-route-template";+import GroupManageSaveButton from "discourse/components/group-manage-save-button";+import GroupsFormMembershipFields from "discourse/components/groups-form-membership-fields";++export default RouteTemplate(+ <template>+ <form class="groups-form form-vertical">+ <GroupsFormMembershipFields @model={{@controller.model}} />+ <GroupManageSaveButton @model={{@controller.model}} />+ </form>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/group/manage/profile.gjs b/app/assets/javascripts/discourse/app/templates/group/manage/profile.gjsindex cf104e4864a..f1616bc7dba 100644--- a/app/assets/javascripts/discourse/app/templates/group/manage/profile.gjs+++ b/app/assets/javascripts/discourse/app/templates/group/manage/profile.gjs@@ -1,4 +1,18 @@-<form class="groups-form form-vertical">- <GroupsFormProfileFields @model={{this.model}} @disableSave={{this.saving}} />- <GroupManageSaveButton @model={{this.model}} @saving={{this.saving}} />-</form>\ No newline at end of file+import RouteTemplate from "ember-route-template";+import GroupManageSaveButton from "discourse/components/group-manage-save-button";+import GroupsFormProfileFields from "discourse/components/groups-form-profile-fields";++export default RouteTemplate(+ <template>+ <form class="groups-form form-vertical">+ <GroupsFormProfileFields+ @model={{@controller.model}}+ @disableSave={{@controller.saving}}+ />+ <GroupManageSaveButton+ @model={{@controller.model}}+ @saving={{@controller.saving}}+ />+ </form>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/group/messages.gjs b/app/assets/javascripts/discourse/app/templates/group/messages.gjsindex 754b8ec1588..d3debb7d39d 100644--- a/app/assets/javascripts/discourse/app/templates/group/messages.gjs+++ b/app/assets/javascripts/discourse/app/templates/group/messages.gjs@@ -1,17 +1,32 @@-<section class="user-secondary-navigation">- <HorizontalOverflowNav class="messages-nav">- <li>- <LinkTo @route="group.messages.inbox" @model={{this.model.name}}>- {{i18n "user.messages.inbox"}}- </LinkTo>- </li>- <li>- <LinkTo @route="group.messages.archive" @model={{this.model.name}}>- {{i18n "user.messages.archive"}}- </LinkTo>- </li>- </HorizontalOverflowNav>-</section>-<section class="user-content" id="user-content">- {{outlet}}-</section>\ No newline at end of file+import { LinkTo } from "@ember/routing";+import RouteTemplate from "ember-route-template";+import HorizontalOverflowNav from "discourse/components/horizontal-overflow-nav";+import { i18n } from "discourse-i18n";++export default RouteTemplate(+ <template>+ <section class="user-secondary-navigation">+ <HorizontalOverflowNav class="messages-nav">+ <li>+ <LinkTo+ @route="group.messages.inbox"+ @model={{@controller.model.name}}+ >+ {{i18n "user.messages.inbox"}}+ </LinkTo>+ </li>+ <li>+ <LinkTo+ @route="group.messages.archive"+ @model={{@controller.model.name}}+ >+ {{i18n "user.messages.archive"}}+ </LinkTo>+ </li>+ </HorizontalOverflowNav>+ </section>+ <section class="user-content" id="user-content">+ {{outlet}}+ </section>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/group/permissions.gjs b/app/assets/javascripts/discourse/app/templates/group/permissions.gjsindex fcd231f6b15..5420c74a3af 100644--- a/app/assets/javascripts/discourse/app/templates/group/permissions.gjs+++ b/app/assets/javascripts/discourse/app/templates/group/permissions.gjs@@ -1,19 +1,27 @@-<section class="user-content" id="user-content">- {{#if this.model.permissions}}- <label class="group-category-permissions-desc">- {{i18n "groups.permissions.description"}}- </label>- <table class="group-category-permissions">- <tbody>- {{#each this.model.permissions as |permission|}}- <tr>- <td>{{category-link permission.category}}</td>- <td>{{permission.description}}</td>- </tr>- {{/each}}- </tbody>- </table>- {{else}}- {{i18n "groups.permissions.none"}}- {{/if}}-</section>\ No newline at end of file+import RouteTemplate from "ember-route-template";+import categoryLink from "discourse/helpers/category-link";+import { i18n } from "discourse-i18n";++export default RouteTemplate(+ <template>+ <section class="user-content" id="user-content">+ {{#if @controller.model.permissions}}+ <label class="group-category-permissions-desc">+ {{i18n "groups.permissions.description"}}+ </label>+ <table class="group-category-permissions">+ <tbody>+ {{#each @controller.model.permissions as |permission|}}+ <tr>+ <td>{{categoryLink permission.category}}</td>+ <td>{{permission.description}}</td>+ </tr>+ {{/each}}+ </tbody>+ </table>+ {{else}}+ {{i18n "groups.permissions.none"}}+ {{/if}}+ </section>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/invites.gjs b/app/assets/javascripts/discourse/app/templates/invites.gjsindex e2147cab02d..76ab5bd9893 100644--- a/app/assets/javascripts/discourse/app/templates/invites.gjs+++ b/app/assets/javascripts/discourse/app/templates/invites.gjs@@ -1 +1,3 @@-{{outlet}}\ No newline at end of file+import RouteTemplate from "ember-route-template";++export default RouteTemplate(<template>{{outlet}}</template>);diff --git a/app/assets/javascripts/discourse/app/templates/invites/show.gjs b/app/assets/javascripts/discourse/app/templates/invites/show.gjsindex 205c931f714..79e71527ab3 100644--- a/app/assets/javascripts/discourse/app/templates/invites/show.gjs+++ b/app/assets/javascripts/discourse/app/templates/invites/show.gjs@@ -1,239 +1,281 @@-{{body-class "invite-page"}}-{{hide-application-header-buttons "search" "login" "signup" "menu"}}-{{hide-application-sidebar}}-<section>- <div class="container invites-show clearfix">- {{#unless (or this.externalAuthsOnly this.existingUserId)}}- <SignupProgressBar @step={{if this.successMessage "activate" "signup"}} />- {{/unless}}- <WelcomeHeader @header={{this.welcomeTitle}} />+import { Input } from "@ember/component";+import { on } from "@ember/modifier";+import { htmlSafe } from "@ember/template";+import RouteTemplate from "ember-route-template";+import { and, not, or } from "truth-helpers";+import DButton from "discourse/components/d-button";+import FullnameInput from "discourse/components/fullname-input";+import InputTip from "discourse/components/input-tip";+import LoginButtons from "discourse/components/login-buttons";+import PasswordField from "discourse/components/password-field";+import SignupProgressBar from "discourse/components/signup-progress-bar";+import TogglePasswordMask from "discourse/components/toggle-password-mask";+import UserField from "discourse/components/user-field";+import UserInfo from "discourse/components/user-info";+import WelcomeHeader from "discourse/components/welcome-header";+import bodyClass from "discourse/helpers/body-class";+import icon from "discourse/helpers/d-icon";+import hideApplicationHeaderButtons from "discourse/helpers/hide-application-header-buttons";+import hideApplicationSidebar from "discourse/helpers/hide-application-sidebar";+import routeAction from "discourse/helpers/route-action";+import valueEntered from "discourse/helpers/value-entered";+import { i18n } from "discourse-i18n";- <div class={{if this.successMessage "invite-success" "invite-form"}}>- <div class="col-form">- {{#if this.successMessage}}- <div class="success-info">- <p>{{html-safe this.successMessage}}</p>- </div>- {{else}}- <div class="invited-by">- <p>{{i18n "invites.invited_by"}}</p>- <p>- <UserInfo @user={{this.invitedBy}} />- </p>- </div>+export default RouteTemplate(+ <template>+ {{bodyClass "invite-page"}}+ {{hideApplicationHeaderButtons "search" "login" "signup" "menu"}}+ {{hideApplicationSidebar}}+ <section>+ <div class="container invites-show clearfix">+ {{#unless+ (or @controller.externalAuthsOnly @controller.existingUserId)+ }}+ <SignupProgressBar+ @step={{if @controller.successMessage "activate" "signup"}}+ />+ {{/unless}}+ <WelcomeHeader @header={{@controller.welcomeTitle}} />- {{#if this.associateHtml}}- <p class="create-account-associate-link">- {{html-safe this.associateHtml}}- </p>- {{/if}}+ <div+ class={{if @controller.successMessage "invite-success" "invite-form"}}+ >+ <div class="col-form">+ {{#if @controller.successMessage}}+ <div class="success-info">+ <p>{{htmlSafe @controller.successMessage}}</p>+ </div>+ {{else}}+ <div class="invited-by">+ <p>{{i18n "invites.invited_by"}}</p>+ <p>+ <UserInfo @user={{@controller.invitedBy}} />+ </p>+ </div>- {{#unless this.isInviteLink}}- <p class="email-message">- {{html-safe this.yourEmailMessage}}- {{#if this.showSocialLoginAvailable}}- {{i18n "invites.social_login_available"}}+ {{#if @controller.associateHtml}}+ <p class="create-account-associate-link">+ {{htmlSafe @controller.associateHtml}}+ </p>{{/if}}- </p>- {{/unless}}- {{#if this.externalAuthsOnly}}- {{! authOptions are present once the user has followed the OmniAuth flow (e.g. twitter/google/etc) }}- {{#if this.authOptions}}- {{#unless this.isInviteLink}}- <InputTip- @validation={{this.emailValidation}}- id="account-email-validation"- />+ {{#unless @controller.isInviteLink}}+ <p class="email-message">+ {{htmlSafe @controller.yourEmailMessage}}+ {{#if @controller.showSocialLoginAvailable}}+ {{i18n "invites.social_login_available"}}+ {{/if}}+ </p>{{/unless}}- {{else}}- <LoginButtons- @externalLogin={{action "externalLogin"}}- @context="invite"- />- {{/if}}- {{/if}}-- {{#if this.discourseConnectEnabled}}- <a- class="btn btn-primary discourse-connect raw-link"- href={{this.ssoPath}}- >- {{i18n "continue"}}- </a>- {{/if}}- {{#if this.shouldDisplayForm}}- <form>- {{#if this.isInviteLink}}- <div class="input email-input input-group">- <Input- {{on "focusin" this.scrollInputIntoView}}- @type="email"- @value={{this.email}}- id="new-account-email"- name="email"- class={{value-entered this.email}}- autofocus="autofocus"- disabled={{this.externalAuthsOnly}}- />- <label class="alt-placeholder" for="new-account-email">- {{i18n "user.email.title"}}- </label>- <InputTip- @validation={{this.emailValidation}}- id="account-email-validation"- />- {{#unless this.emailValidation.reason}}- <div class="instructions">- {{i18n "user.email.instructions"}}- </div>+ {{#if @controller.externalAuthsOnly}}+ {{! authOptions are present once the user has followed the OmniAuth flow (e.g. twitter/google/etc) }}+ {{#if @controller.authOptions}}+ {{#unless @controller.isInviteLink}}+ <InputTip+ @validation={{@controller.emailValidation}}+ id="account-email-validation"+ />{{/unless}}- </div>+ {{else}}+ <LoginButtons+ @externalLogin={{@controller.externalLogin}}+ @context="invite"+ />+ {{/if}}{{/if}}- <div class="input username-input input-group">- <input- {{on "focusin" this.scrollInputIntoView}}- {{on "input" this.setAccountUsername}}- type="text"- value={{this.accountUsername}}- class={{value-entered this.accountUsername}}- id="new-account-username"- name="username"- maxlength={{this.maxUsernameLength}}- autocomplete="off"- />- <label class="alt-placeholder" for="new-account-username">- {{i18n "user.username.title"}}- </label>- <InputTip- @validation={{this.usernameValidation}}- id="username-validation"- />- </div>-- {{#if (and this.showFullname this.fullnameRequired)}}- <FullnameInput- @nameValidation={{this.nameValidation}}- @nameTitle={{this.nameTitle}}- @accountName={{this.accountName}}- @nameDisabled={{this.nameDisabled}}- @onFocusIn={{this.scrollInputIntoView}}- class="input name-input input-group name-required"- />+ {{#if @controller.discourseConnectEnabled}}+ <a+ class="btn btn-primary discourse-connect raw-link"+ href={{@controller.ssoPath}}+ >+ {{i18n "continue"}}+ </a>{{/if}}- {{#unless this.externalAuthsOnly}}- <div class="input password-input input-group">- <PasswordField- {{on "focusin" this.scrollInputIntoView}}- @value={{this.accountPassword}}- @capsLockOn={{this.capsLockOn}}- type={{if this.maskPassword "password" "text"}}- autocomplete="new-password"- id="new-account-password"- class={{value-entered this.accountPassword}}- />- <label class="alt-placeholder" for="new-account-password">- {{i18n "invites.password_label"}}- </label>- <TogglePasswordMask- @maskPassword={{this.maskPassword}}- @togglePasswordMask={{this.togglePasswordMask}}- @parentController="invites-show"- />- <div class="create-account__password-info">- <div class="create-account__password-tip-validation">+ {{#if @controller.shouldDisplayForm}}+ <form>+ {{#if @controller.isInviteLink}}+ <div class="input email-input input-group">+ <Input+ {{on "focusin" @controller.scrollInputIntoView}}+ @type="email"+ @value={{@controller.email}}+ id="new-account-email"+ name="email"+ class={{valueEntered @controller.email}}+ autofocus="autofocus"+ disabled={{@controller.externalAuthsOnly}}+ />+ <label class="alt-placeholder" for="new-account-email">+ {{i18n "user.email.title"}}+ </label><InputTip- @validation={{this.passwordValidation}}- id="password-validation"+ @validation={{@controller.emailValidation}}+ id="account-email-validation"/>- <div- class="caps-lock-warning- {{unless this.capsLockOn 'hidden'}}"- >- {{d-icon "triangle-exclamation"}}- {{i18n "login.caps_lock_warning"}}- </div>+ {{#unless @controller.emailValidation.reason}}+ <div class="instructions">+ {{i18n "user.email.instructions"}}+ </div>+ {{/unless}}</div>+ {{/if}}++ <div class="input username-input input-group">+ <input+ {{on "focusin" @controller.scrollInputIntoView}}+ {{on "input" @controller.setAccountUsername}}+ type="text"+ value={{@controller.accountUsername}}+ class={{valueEntered @controller.accountUsername}}+ id="new-account-username"+ name="username"+ maxlength={{@controller.maxUsernameLength}}+ autocomplete="off"+ />+ <label class="alt-placeholder" for="new-account-username">+ {{i18n "user.username.title"}}+ </label>+ <InputTip+ @validation={{@controller.usernameValidation}}+ id="username-validation"+ /></div>- </div>- {{/unless}}- {{#if (and this.showFullname (not this.fullnameRequired))}}- <FullnameInput- @nameValidation={{this.nameValidation}}- @nameTitle={{this.nameTitle}}- @accountName={{this.accountName}}- @nameDisabled={{this.nameDisabled}}- @onFocusIn={{this.scrollInputIntoView}}- class="input name-input input-group"- />- {{/if}}+ {{#if+ (and @controller.showFullname @controller.fullnameRequired)+ }}+ <FullnameInput+ @nameValidation={{@controller.nameValidation}}+ @nameTitle={{@controller.nameTitle}}+ @accountName={{@controller.accountName}}+ @nameDisabled={{@controller.nameDisabled}}+ @onFocusIn={{@controller.scrollInputIntoView}}+ class="input name-input input-group name-required"+ />+ {{/if}}- {{#if this.userFields}}- <div class="user-fields">- {{#each this.userFields as |f|}}- <div class="input-group">- <UserField- {{on "focusin" this.scrollInputIntoView}}- @field={{f.field}}- @value={{f.value}}- class={{value-entered f.value}}+ {{#unless @controller.externalAuthsOnly}}+ <div class="input password-input input-group">+ <PasswordField+ {{on "focusin" @controller.scrollInputIntoView}}+ @value={{@controller.accountPassword}}+ @capsLockOn={{@controller.capsLockOn}}+ type={{if @controller.maskPassword "password" "text"}}+ autocomplete="new-password"+ id="new-account-password"+ class={{valueEntered @controller.accountPassword}}/>+ <label class="alt-placeholder" for="new-account-password">+ {{i18n "invites.password_label"}}+ </label>+ <TogglePasswordMask+ @maskPassword={{@controller.maskPassword}}+ @togglePasswordMask={{@controller.togglePasswordMask}}+ @parentController="invites-show"+ />+ <div class="create-account__password-info">+ <div class="create-account__password-tip-validation">+ <InputTip+ @validation={{@controller.passwordValidation}}+ id="password-validation"+ />+ <div+ class="caps-lock-warning+ {{unless @controller.capsLockOn 'hidden'}}"+ >+ {{icon "triangle-exclamation"}}+ {{i18n "login.caps_lock_warning"}}+ </div>+ </div>+ </div></div>- {{/each}}- </div>- {{/if}}+ {{/unless}}- <div class="invitation-cta">- <DButton- @action={{action "submit"}}- @disabled={{this.submitDisabled}}- @label="invites.accept_invite"- type="submit"- class="btn-primary invitation-cta__accept"- />- <div class="invitation-cta__info">- <span class="invitation-cta__signed-up">{{i18n- "login.previous_sign_up"- }}</span>- <DButton- @action={{route-action "showLogin"}}- @label="log_in"- class="btn-flat invitation-cta__sign-in"- />- </div>- </div>+ {{#if+ (and+ @controller.showFullname+ (not @controller.fullnameRequired)+ )+ }}+ <FullnameInput+ @nameValidation={{@controller.nameValidation}}+ @nameTitle={{@controller.nameTitle}}+ @accountName={{@controller.accountName}}+ @nameDisabled={{@controller.nameDisabled}}+ @onFocusIn={{@controller.scrollInputIntoView}}+ class="input name-input input-group"+ />+ {{/if}}- <div class="disclaimer">- {{html-safe this.disclaimerHtml}}- </div>+ {{#if @controller.userFields}}+ <div class="user-fields">+ {{#each @controller.userFields as |f|}}+ <div class="input-group">+ <UserField+ {{on "focusin" @controller.scrollInputIntoView}}+ @field={{f.field}}+ @value={{f.value}}+ class={{valueEntered f.value}}+ />+ </div>+ {{/each}}+ </div>+ {{/if}}++ <div class="invitation-cta">+ <DButton+ @action={{@controller.submit}}+ @disabled={{@controller.submitDisabled}}+ @label="invites.accept_invite"+ type="submit"+ class="btn-primary invitation-cta__accept"+ />+ <div class="invitation-cta__info">+ <span class="invitation-cta__signed-up">{{i18n+ "login.previous_sign_up"+ }}</span>+ <DButton+ @action={{routeAction "showLogin"}}+ @label="log_in"+ class="btn-flat invitation-cta__sign-in"+ />+ </div>+ </div>++ <div class="disclaimer">+ {{htmlSafe @controller.disclaimerHtml}}+ </div>- {{#if this.errorMessage}}- <br /><br />- <div class="alert alert-error">{{this.errorMessage}}</div>+ {{#if @controller.errorMessage}}+ <br /><br />+ <div+ class="alert alert-error"+ >{{@controller.errorMessage}}</div>+ {{/if}}+ </form>+ {{/if}}+ {{#if @controller.existingUserRedeeming}}+ {{#if @controller.existingUserCanRedeem}}+ <DButton+ @action={{@controller.submit}}+ @disabled={{@controller.submitDisabled}}+ @label="invites.accept_invite"+ type="submit"+ class="btn-primary"+ />+ {{else}}+ <div+ class="alert alert-error"+ >{{@controller.existingUserCanRedeemError}}</div>+ {{/if}}{{/if}}- </form>- {{/if}}- {{#if this.existingUserRedeeming}}- {{#if this.existingUserCanRedeem}}- <DButton- @action={{action "submit"}}- @disabled={{this.submitDisabled}}- @label="invites.accept_invite"- type="submit"- class="btn-primary"- />- {{else}}- <div- class="alert alert-error"- >{{this.existingUserCanRedeemError}}</div>{{/if}}- {{/if}}- {{/if}}+ </div>+ </div></div>- </div>- </div>-</section>\ No newline at end of file+ </section>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/loading.gjs b/app/assets/javascripts/discourse/app/templates/loading.gjsindex 867cde03563..cec4f34356f 100644--- a/app/assets/javascripts/discourse/app/templates/loading.gjs+++ b/app/assets/javascripts/discourse/app/templates/loading.gjs@@ -1,2 +1,10 @@-{{loading-spinner}}-{{hide-application-footer}}\ No newline at end of file+import RouteTemplate from "ember-route-template";+import hideApplicationFooter from "discourse/helpers/hide-application-footer";+import loadingSpinner from "discourse/helpers/loading-spinner";++export default RouteTemplate(+ <template>+ {{loadingSpinner}}+ {{hideApplicationFooter}}+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/login-preferences.gjs b/app/assets/javascripts/discourse/app/templates/login-preferences.gjsindex 2210a9a8ba7..aceb4268535 100644--- a/app/assets/javascripts/discourse/app/templates/login-preferences.gjs+++ b/app/assets/javascripts/discourse/app/templates/login-preferences.gjs@@ -1,11 +1,20 @@-<div class="container">- <h2>{{i18n "login.to_continue"}}</h2>+import RouteTemplate from "ember-route-template";+import DButton from "discourse/components/d-button";+import routeAction from "discourse/helpers/route-action";+import { i18n } from "discourse-i18n";- <p style="margin-top: 1em">{{i18n "login.preferences"}}</p>+export default RouteTemplate(+ <template>+ <div class="container">+ <h2>{{i18n "login.to_continue"}}</h2>- <DButton- @action={{route-action "showLogin"}}- @label="log_in"- class="btn-primary"- />-</div>\ No newline at end of file+ <p style="margin-top: 1em">{{i18n "login.preferences"}}</p>++ <DButton+ @action={{routeAction "showLogin"}}+ @label="log_in"+ class="btn-primary"+ />+ </div>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/login.gjs b/app/assets/javascripts/discourse/app/templates/login.gjsindex 2665ed6529e..6a9d458a154 100644--- a/app/assets/javascripts/discourse/app/templates/login.gjs+++ b/app/assets/javascripts/discourse/app/templates/login.gjs@@ -1,187 +1,224 @@-{{hide-application-header-buttons "search" "login" "signup" "menu"}}-{{hide-application-sidebar}}-{{body-class "login-page"}}+import { hash } from "@ember/helper";+import { htmlSafe } from "@ember/template";+import RouteTemplate from "ember-route-template";+import { and, not, or } from "truth-helpers";+import DButton from "discourse/components/d-button";+import FlashMessage from "discourse/components/flash-message";+import LocalLoginForm from "discourse/components/local-login-form";+import LoginButtons from "discourse/components/login-buttons";+import LoginPageCta from "discourse/components/login-page-cta";+import PluginOutlet from "discourse/components/plugin-outlet";+import WelcomeHeader from "discourse/components/welcome-header";+import bodyClass from "discourse/helpers/body-class";+import concatClass from "discourse/helpers/concat-class";+import hideApplicationHeaderButtons from "discourse/helpers/hide-application-header-buttons";+import hideApplicationSidebar from "discourse/helpers/hide-application-sidebar";+import loadingSpinner from "discourse/helpers/loading-spinner";+import routeAction from "discourse/helpers/route-action";+import { i18n } from "discourse-i18n";-{{#if this.isRedirectingToExternalAuth}}- {{! Hide the login form if the site has only one external }}- {{! authentication method and is being automatically redirected to it }}- {{loading-spinner}}-{{else}}- {{#if- (and- this.siteSettings.full_page_login- (or this.showLogin (not this.siteSettings.login_required))- )- }}- {{! Show the full page login form }}- <div class="login-fullpage">- <FlashMessage @flash={{this.flash}} @type={{this.flashType}} />+export default RouteTemplate(+ <template>+ {{hideApplicationHeaderButtons "search" "login" "signup" "menu"}}+ {{hideApplicationSidebar}}+ {{bodyClass "login-page"}}- <div class={{concat-class "login-body" this.bodyClasses}}>- <PluginOutlet @name="login-before-modal-body" @connectorTagName="div" />+ {{#if @controller.isRedirectingToExternalAuth}}+ {{! Hide the login form if the site has only one external }}+ {{! authentication method and is being automatically redirected to it }}+ {{loadingSpinner}}+ {{else}}+ {{#if+ (and+ @controller.siteSettings.full_page_login+ (or+ @controller.showLogin (not @controller.siteSettings.login_required)+ )+ )+ }}+ {{! Show the full page login form }}+ <div class="login-fullpage">+ <FlashMessage+ @flash={{@controller.flash}}+ @type={{@controller.flashType}}+ />- {{#if this.hasNoLoginOptions}}- <div class={{if this.site.desktopView "login-left-side"}}>- <div class="login-welcome-header no-login-methods-configured">- <h1 class="login-title">{{i18n- "login.no_login_methods.title"- }}</h1>- <img />- <p class="login-subheader">- {{html-safe- (i18n- "login.no_login_methods.description"- (hash adminLoginPath=this.adminLoginPath)- )- }}- </p>- </div>- </div>- {{else}}- {{#if this.site.mobileView}}- <WelcomeHeader @header={{i18n "login.header_title"}}>- <PluginOutlet- @name="login-header-bottom"- @outletArgs={{hash createAccount=this.createAccount}}- />- </WelcomeHeader>- {{#if this.showLoginButtons}}- <LoginButtons- @externalLogin={{this.externalLoginAction}}- @passkeyLogin={{this.passkeyLogin}}- @context="login"- />- {{/if}}- {{/if}}+ <div class={{concatClass "login-body" @controller.bodyClasses}}>+ <PluginOutlet+ @name="login-before-modal-body"+ @connectorTagName="div"+ />- {{#if this.canLoginLocal}}- <div class={{if this.site.desktopView "login-left-side"}}>- {{#if this.site.desktopView}}+ {{#if @controller.hasNoLoginOptions}}+ <div class={{if @controller.site.desktopView "login-left-side"}}>+ <div class="login-welcome-header no-login-methods-configured">+ <h1 class="login-title">{{i18n+ "login.no_login_methods.title"+ }}</h1>+ <img />+ <p class="login-subheader">+ {{htmlSafe+ (i18n+ "login.no_login_methods.description"+ (hash [email protected])+ )+ }}+ </p>+ </div>+ </div>+ {{else}}+ {{#if @controller.site.mobileView}}<WelcomeHeader @header={{i18n "login.header_title"}}><PluginOutlet@name="login-header-bottom"- @outletArgs={{hash createAccount=this.createAccount}}+ @outletArgs={{hash [email protected]}}/></WelcomeHeader>+ {{#if @controller.showLoginButtons}}+ <LoginButtons+ @externalLogin={{@controller.externalLoginAction}}+ @passkeyLogin={{@controller.passkeyLogin}}+ @context="login"+ />+ {{/if}}{{/if}}- <LocalLoginForm- @loginName={{this.loginName}}- @loginNameChanged={{this.loginNameChanged}}- @canLoginLocalWithEmail={{this.canLoginLocalWithEmail}}- @canUsePasskeys={{this.canUsePasskeys}}- @passkeyLogin={{this.passkeyLogin}}- @loginPassword={{this.loginPassword}}- @secondFactorMethod={{this.secondFactorMethod}}- @secondFactorToken={{this.secondFactorToken}}- @backupEnabled={{this.backupEnabled}}- @totpEnabled={{this.totpEnabled}}- @securityKeyAllowedCredentialIds={{this.securityKeyAllowedCredentialIds}}- @securityKeyChallenge={{this.securityKeyChallenge}}- @showSecurityKey={{this.showSecurityKey}}- @otherMethodAllowed={{this.otherMethodAllowed}}- @showSecondFactor={{this.showSecondFactor}}- @handleForgotPassword={{this.handleForgotPassword}}- @login={{this.triggerLogin}}- @flashChanged={{this.flashChanged}}- @flashTypeChanged={{this.flashTypeChanged}}- @securityKeyCredentialChanged={{this.securityKeyCredentialChanged}}- />- {{#if this.site.desktopView}}- <LoginPageCta- @canLoginLocal={{this.canLoginLocal}}- @showSecurityKey={{this.showSecurityKey}}- @login={{this.triggerLogin}}- @loginButtonLabel={{this.loginButtonLabel}}- @loginDisabled={{this.loginDisabled}}- @showSignupLink={{this.showSignupLink}}- @createAccount={{this.createAccount}}- @loggingIn={{this.loggingIn}}- @showSecondFactor={{this.showSecondFactor}}- />++ {{#if @controller.canLoginLocal}}+ <div+ class={{if @controller.site.desktopView "login-left-side"}}+ >+ {{#if @controller.site.desktopView}}+ <WelcomeHeader @header={{i18n "login.header_title"}}>+ <PluginOutlet+ @name="login-header-bottom"+ @outletArgs={{hash+ }}+ />+ </WelcomeHeader>+ {{/if}}+ <LocalLoginForm+ @loginName={{@controller.loginName}}+ @loginNameChanged={{@controller.loginNameChanged}}+ @canLoginLocalWithEmail={{@controller.canLoginLocalWithEmail}}+ @canUsePasskeys={{@controller.canUsePasskeys}}+ @passkeyLogin={{@controller.passkeyLogin}}+ @loginPassword={{@controller.loginPassword}}+ @secondFactorMethod={{@controller.secondFactorMethod}}+ @secondFactorToken={{@controller.secondFactorToken}}+ @backupEnabled={{@controller.backupEnabled}}+ @totpEnabled={{@controller.totpEnabled}}+ @securityKeyAllowedCredentialIds={{@controller.securityKeyAllowedCredentialIds}}+ @securityKeyChallenge={{@controller.securityKeyChallenge}}+ @showSecurityKey={{@controller.showSecurityKey}}+ @otherMethodAllowed={{@controller.otherMethodAllowed}}+ @showSecondFactor={{@controller.showSecondFactor}}+ @handleForgotPassword={{@controller.handleForgotPassword}}+ @login={{@controller.triggerLogin}}+ @flashChanged={{@controller.flashChanged}}+ @flashTypeChanged={{@controller.flashTypeChanged}}+ @securityKeyCredentialChanged={{@controller.securityKeyCredentialChanged}}+ />+ {{#if @controller.site.desktopView}}+ <LoginPageCta+ @canLoginLocal={{@controller.canLoginLocal}}+ @showSecurityKey={{@controller.showSecurityKey}}+ @login={{@controller.triggerLogin}}+ @loginButtonLabel={{@controller.loginButtonLabel}}+ @loginDisabled={{@controller.loginDisabled}}+ @showSignupLink={{@controller.showSignupLink}}+ @createAccount={{@controller.createAccount}}+ @loggingIn={{@controller.loggingIn}}+ @showSecondFactor={{@controller.showSecondFactor}}+ />+ {{/if}}+ </div>{{/if}}- </div>- {{/if}}- {{#if (and this.showLoginButtons this.site.desktopView)}}- {{#unless this.canLoginLocal}}- <div class="login-left-side">- <WelcomeHeader @header={{i18n "login.header_title"}} />- </div>- {{/unless}}- {{#if this.hasAtLeastOneLoginButton}}- <div class="login-right-side">- <LoginButtons- @externalLogin={{this.externalLoginAction}}- @passkeyLogin={{this.passkeyLogin}}- @context="login"- />- </div>+ {{#if+ (and @controller.showLoginButtons @controller.site.desktopView)+ }}+ {{#unless @controller.canLoginLocal}}+ <div class="login-left-side">+ <WelcomeHeader @header={{i18n "login.header_title"}} />+ </div>+ {{/unless}}+ {{#if @controller.hasAtLeastOneLoginButton}}+ <div class="login-right-side">+ <LoginButtons+ @externalLogin={{@controller.externalLoginAction}}+ @passkeyLogin={{@controller.passkeyLogin}}+ @context="login"+ />+ </div>+ {{/if}}+ {{/if}}{{/if}}- {{/if}}- {{/if}}-- {{#if this.site.mobileView}}- {{#unless this.hasNoLoginOptions}}- <LoginPageCta- @canLoginLocal={{this.canLoginLocal}}- @showSecurityKey={{this.showSecurityKey}}- @login={{this.triggerLogin}}- @loginButtonLabel={{this.loginButtonLabel}}- @loginDisabled={{this.loginDisabled}}- @showSignupLink={{this.showSignupLink}}- @createAccount={{this.createAccount}}- @loggingIn={{this.loggingIn}}- @showSecondFactor={{this.showSecondFactor}}- />- {{/unless}}- {{/if}}- </div>- </div>-- {{else}}- {{! Show the login-required splash screen }}- {{body-class "static-login"}}- <section class="container">- <div class="contents clearfix body-page">- <div class="login-welcome">- <PluginOutlet- @name="above-login"- @outletArgs={{hash model=this.model}}- />- <PluginOutlet @name="above-static" />- <div class="login-content">- {{html-safe this.model.html}}+ {{#if @controller.site.mobileView}}+ {{#unless @controller.hasNoLoginOptions}}+ <LoginPageCta+ @canLoginLocal={{@controller.canLoginLocal}}+ @showSecurityKey={{@controller.showSecurityKey}}+ @login={{@controller.triggerLogin}}+ @loginButtonLabel={{@controller.loginButtonLabel}}+ @loginDisabled={{@controller.loginDisabled}}+ @showSignupLink={{@controller.showSignupLink}}+ @createAccount={{@controller.createAccount}}+ @loggingIn={{@controller.loggingIn}}+ @showSecondFactor={{@controller.showSecondFactor}}+ />+ {{/unless}}+ {{/if}}</div>+ </div>- <PluginOutlet @name="below-static" />- <PluginOutlet- @name="below-login"- @outletArgs={{hash model=this.model}}- />+ {{else}}+ {{! Show the login-required splash screen }}+ {{bodyClass "static-login"}}+ <section class="container">+ <div class="contents clearfix body-page">+ <div class="login-welcome">+ <PluginOutlet+ @name="above-login"+ @outletArgs={{hash [email protected]}}+ />+ <PluginOutlet @name="above-static" />++ <div class="login-content">+ {{htmlSafe @controller.model.html}}+ </div>- <div class="body-page-button-container">- {{#if this.application.canSignUp}}- <DButton- @action={{route-action "showCreateAccount"}}- @label="sign_up"- class="btn-primary sign-up-button"+ <PluginOutlet @name="below-static" />+ <PluginOutlet+ @name="below-login"+ @outletArgs={{hash [email protected]}}/>- {{/if}}- <DButton- @action={{if- this.shouldTriggerRouteAction- (route-action "showLogin")- this.showFullPageLogin- }}- @icon="user"- @label="log_in"- class="btn-primary login-button"- />+ <div class="body-page-button-container">+ {{#if @controller.application.canSignUp}}+ <DButton+ @action={{routeAction "showCreateAccount"}}+ @label="sign_up"+ class="btn-primary sign-up-button"+ />+ {{/if}}++ <DButton+ @action={{if+ @controller.shouldTriggerRouteAction+ (routeAction "showLogin")+ @controller.showFullPageLogin+ }}+ @icon="user"+ @label="log_in"+ class="btn-primary login-button"+ />+ </div>+ </div></div>- </div>- </div>- </section>- {{/if}}-{{/if}}\ No newline at end of file+ </section>+ {{/if}}+ {{/if}}+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/password-reset.gjs b/app/assets/javascripts/discourse/app/templates/password-reset.gjsindex 60924fb72a9..730156ee694 100644--- a/app/assets/javascripts/discourse/app/templates/password-reset.gjs+++ b/app/assets/javascripts/discourse/app/templates/password-reset.gjs@@ -1,111 +1,135 @@-{{body-class "password-reset-page"}}-{{hide-application-sidebar}}-{{hide-application-header-buttons "search" "login" "signup" "menu"}}-<div class="container password-reset clearfix">- <form class="change-password-form login-left-side">- {{#if this.successMessage}}- <p>{{this.successMessage}}</p>+import { fn } from "@ember/helper";+import { on } from "@ember/modifier";+import RouteTemplate from "ember-route-template";+import DButton from "discourse/components/d-button";+import InputTip from "discourse/components/input-tip";+import PasswordField from "discourse/components/password-field";+import SecondFactorForm from "discourse/components/second-factor-form";+import SecondFactorInput from "discourse/components/second-factor-input";+import SecurityKeyForm from "discourse/components/security-key-form";+import TogglePasswordMask from "discourse/components/toggle-password-mask";+import bodyClass from "discourse/helpers/body-class";+import icon from "discourse/helpers/d-icon";+import hideApplicationHeaderButtons from "discourse/helpers/hide-application-header-buttons";+import hideApplicationSidebar from "discourse/helpers/hide-application-sidebar";+import withEventValue from "discourse/helpers/with-event-value";+import { i18n } from "discourse-i18n";- {{#if this.requiresApproval}}- <p>{{i18n "login.not_approved"}}</p>- {{else}}- {{#unless this.redirected}}- <a- class="btn"- href={{this.redirectHref}}- {{on "click" this.done}}- >{{this.continueButtonText}}</a>- {{/unless}}- {{/if}}- {{else}}- {{#if this.securityKeyOrSecondFactorRequired}}- <h2>{{i18n "user.change_password.title"}}</h2>- <p>- {{i18n "user.change_password.verify_identity"}}- </p>- {{#if this.errorMessage}}- <div class="alert alert-error">{{this.errorMessage}}</div>- <br />- {{/if}}+export default RouteTemplate(+ <template>+ {{bodyClass "password-reset-page"}}+ {{hideApplicationSidebar}}+ {{hideApplicationHeaderButtons "search" "login" "signup" "menu"}}+ <div class="container password-reset clearfix">+ <form class="change-password-form login-left-side">+ {{#if @controller.successMessage}}+ <p>{{@controller.successMessage}}</p>- {{#if this.displaySecurityKeyForm}}- <SecurityKeyForm- @setSecondFactorMethod={{fn (mut this.selectedSecondFactorMethod)}}- @backupEnabled={{this.backupEnabled}}- @totpEnabled={{this.secondFactorRequired}}- @otherMethodAllowed={{this.otherMethodAllowed}}- @action={{this.authenticateSecurityKey}}- />+ {{#if @controller.requiresApproval}}+ <p>{{i18n "login.not_approved"}}</p>+ {{else}}+ {{#unless @controller.redirected}}+ <a+ class="btn"+ href={{@controller.redirectHref}}+ {{on "click" @controller.done}}+ >{{@controller.continueButtonText}}</a>+ {{/unless}}+ {{/if}}{{else}}- <SecondFactorForm- @secondFactorMethod={{this.selectedSecondFactorMethod}}- @secondFactorToken={{this.secondFactorToken}}- @backupEnabled={{this.backupEnabled}}- @totpEnabled={{this.secondFactorRequired}}- @isLogin={{false}}- >- <SecondFactorInput- {{on- "input"- (with-event-value (fn (mut this.secondFactorToken)))- }}- @secondFactorMethod={{this.selectedSecondFactorMethod}}- value={{this.secondFactorToken}}- id="second-factor"- />- </SecondFactorForm>- {{/if}}-- {{#unless this.displaySecurityKeyForm}}- <DButton- @action={{action "submit"}}- @label="submit"- type="submit"- class="btn-primary"- />- {{/unless}}- {{else}}- <h2>{{i18n "user.change_password.choose_new"}}</h2>- {{#if this.errorMessage}}- <div class="alert alert-error">{{this.errorMessage}}</div>- <br />- {{/if}}+ {{#if @controller.securityKeyOrSecondFactorRequired}}+ <h2>{{i18n "user.change_password.title"}}</h2>+ <p>+ {{i18n "user.change_password.verify_identity"}}+ </p>+ {{#if @controller.errorMessage}}+ <div class="alert alert-error">{{@controller.errorMessage}}</div>+ <br />+ {{/if}}- <div class="input">- <PasswordField- @value={{this.accountPassword}}- @capsLockOn={{this.capsLockOn}}- type={{if this.maskPassword "password" "text"}}- autofocus="autofocus"- autocomplete="new-password"- id="new-account-password"- />- <div class="change-password__password-info">- <div class="change-password_tip-validation">- {{#if this.showPasswordValidation}}- <InputTip @validation={{this.passwordValidation}} />- {{/if}}- <div- class="caps-lock-warning {{unless this.capsLockOn 'hidden'}}"+ {{#if @controller.displaySecurityKeyForm}}+ <SecurityKeyForm+ @setSecondFactorMethod={{fn+ (mut @controller.selectedSecondFactorMethod)+ }}+ @backupEnabled={{@controller.backupEnabled}}+ @totpEnabled={{@controller.secondFactorRequired}}+ @otherMethodAllowed={{@controller.otherMethodAllowed}}+ @action={{@controller.authenticateSecurityKey}}+ />+ {{else}}+ <SecondFactorForm+ @secondFactorMethod={{@controller.selectedSecondFactorMethod}}+ @secondFactorToken={{@controller.secondFactorToken}}+ @backupEnabled={{@controller.backupEnabled}}+ @totpEnabled={{@controller.secondFactorRequired}}+ @isLogin={{false}}>- {{d-icon "triangle-exclamation"}}- {{i18n "login.caps_lock_warning"}}+ <SecondFactorInput+ {{on+ "input"+ (withEventValue (fn (mut @controller.secondFactorToken)))+ }}+ @secondFactorMethod={{@controller.selectedSecondFactorMethod}}+ value={{@controller.secondFactorToken}}+ id="second-factor"+ />+ </SecondFactorForm>+ {{/if}}++ {{#unless @controller.displaySecurityKeyForm}}+ <DButton+ @action={{@controller.submit}}+ @label="submit"+ type="submit"+ class="btn-primary"+ />+ {{/unless}}+ {{else}}+ <h2>{{i18n "user.change_password.choose_new"}}</h2>+ {{#if @controller.errorMessage}}+ <div class="alert alert-error">{{@controller.errorMessage}}</div>+ <br />+ {{/if}}++ <div class="input">+ <PasswordField+ @value={{@controller.accountPassword}}+ @capsLockOn={{@controller.capsLockOn}}+ type={{if @controller.maskPassword "password" "text"}}+ autofocus="autofocus"+ autocomplete="new-password"+ id="new-account-password"+ />+ <div class="change-password__password-info">+ <div class="change-password_tip-validation">+ {{#if @controller.showPasswordValidation}}+ <InputTip @validation={{@controller.passwordValidation}} />+ {{/if}}+ <div+ class="caps-lock-warning+ {{unless @controller.capsLockOn 'hidden'}}"+ >+ {{icon "triangle-exclamation"}}+ {{i18n "login.caps_lock_warning"}}+ </div>+ </div>+ <TogglePasswordMask+ @maskPassword={{@controller.maskPassword}}+ @togglePasswordMask={{@controller.togglePasswordMask}}+ /></div></div>- <TogglePasswordMask- @maskPassword={{this.maskPassword}}- @togglePasswordMask={{this.togglePasswordMask}}- />- </div>- </div>- <DButton- @action={{action "submit"}}- @label="user.change_password.set_password"- type="submit"- class="btn-primary"- />- {{/if}}- {{/if}}- </form>-</div>\ No newline at end of file+ <DButton+ @action={{@controller.submit}}+ @label="user.change_password.set_password"+ type="submit"+ class="btn-primary"+ />+ {{/if}}+ {{/if}}+ </form>+ </div>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/preferences-email.gjs b/app/assets/javascripts/discourse/app/templates/preferences-email.gjsindex 43d3287b798..bce73a15551 100644--- a/app/assets/javascripts/discourse/app/templates/preferences-email.gjs+++ b/app/assets/javascripts/discourse/app/templates/preferences-email.gjs@@ -1,56 +1,73 @@-{{body-class "user-preferences-page"}}+import { LinkTo } from "@ember/routing";+import RouteTemplate from "ember-route-template";+import DButton from "discourse/components/d-button";+import InputTip from "discourse/components/input-tip";+import TextField from "discourse/components/text-field";+import bodyClass from "discourse/helpers/body-class";+import icon from "discourse/helpers/d-icon";+import { i18n } from "discourse-i18n";-<section class="user-content user-preferences solo-preference">- <form class="form-vertical">- {{#if this.success}}- <div class="alert alert-success">{{this.successMessage}}</div>- <LinkTo @route="preferences.account" class="success-back">- {{d-icon "arrow-left"}}- {{i18n "user.change_email.back_to_preferences"}}- </LinkTo>- {{else}}- {{#if this.error}}- <div class="alert alert-error">{{this.errorMessage}}</div>- {{/if}}- <div class="control-group">- <label class="control-label">- {{i18n- (if this.new "user.add_email.title" "user.change_email.title")- }}- </label>- <div class="controls">- <TextField- @value={{this.newEmail}}- @id="change-email"- @classNames="input-xxlarge"- @autofocus="autofocus"- />- <div class="instructions">- {{#if this.taken}}- {{i18n "user.change_email.taken"}}- {{else}}- {{i18n "user.email.instructions"}}- {{/if}}+export default RouteTemplate(+ <template>+ {{bodyClass "user-preferences-page"}}++ <section class="user-content user-preferences solo-preference">+ <form class="form-vertical">+ {{#if @controller.success}}+ <div class="alert alert-success">{{@controller.successMessage}}</div>+ <LinkTo @route="preferences.account" class="success-back">+ {{icon "arrow-left"}}+ {{i18n "user.change_email.back_to_preferences"}}+ </LinkTo>+ {{else}}+ {{#if @controller.error}}+ <div class="alert alert-error">{{@controller.errorMessage}}</div>+ {{/if}}+ <div class="control-group">+ <label class="control-label">+ {{i18n+ (if+ @controller.new+ "user.add_email.title"+ "user.change_email.title"+ )+ }}+ </label>+ <div class="controls">+ <TextField+ @value={{@controller.newEmail}}+ @id="change-email"+ @classNames="input-xxlarge"+ @autofocus="autofocus"+ />+ <div class="instructions">+ {{#if @controller.taken}}+ {{i18n "user.change_email.taken"}}+ {{else}}+ {{i18n "user.email.instructions"}}+ {{/if}}+ </div>+ <InputTip @validation={{@controller.emailValidation}} />+ </div>+ </div>+ <div class="controls save-button">+ <DButton+ @action={{@controller.saveEmail}}+ @disabled={{@controller.saveDisabled}}+ @translatedLabel={{@controller.saveButtonText}}+ type="submit"+ class="btn-primary"+ />+ <LinkTo+ @route="preferences.account"+ @model={{@controller.model.username}}+ class="cancel"+ >+ {{i18n "cancel"}}+ </LinkTo></div>- <InputTip @validation={{this.emailValidation}} />- </div>- </div>- <div class="controls save-button">- <DButton- @action={{action "saveEmail"}}- @disabled={{this.saveDisabled}}- @translatedLabel={{this.saveButtonText}}- type="submit"- class="btn-primary"- />- <LinkTo- @route="preferences.account"- @model={{this.model.username}}- class="cancel"- >- {{i18n "cancel"}}- </LinkTo>- </div>- {{/if}}- </form>-</section>\ No newline at end of file+ {{/if}}+ </form>+ </section>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/preferences-second-factor.gjs b/app/assets/javascripts/discourse/app/templates/preferences-second-factor.gjsindex c8a90d0d9e6..c66df360d9f 100644--- a/app/assets/javascripts/discourse/app/templates/preferences-second-factor.gjs+++ b/app/assets/javascripts/discourse/app/templates/preferences-second-factor.gjs@@ -1,168 +1,185 @@-{{body-class "user-preferences-page"}}+import { LinkTo } from "@ember/routing";+import { htmlSafe } from "@ember/template";+import RouteTemplate from "ember-route-template";+import { and } from "truth-helpers";+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";+import DButton from "discourse/components/d-button";+import SecurityKeyDropdown from "discourse/components/security-key-dropdown";+import TokenBasedAuthDropdown from "discourse/components/token-based-auth-dropdown";+import TwoFactorBackupDropdown from "discourse/components/two-factor-backup-dropdown";+import bodyClass from "discourse/helpers/body-class";+import { i18n } from "discourse-i18n";-<section class="user-content user-preferences solo-preference second-factor">- <ConditionalLoadingSpinner @condition={{this.loading}}>- <form class="form-vertical">- {{#if this.showEnforcedNotice}}- <div class="alert alert-error">- {{i18n "user.second_factor.enforced_notice"}}- </div>- {{/if}}+export default RouteTemplate(+ <template>+ {{bodyClass "user-preferences-page"}}- {{#if this.showEnforcedWithOAuthNotice}}- <div class="alert alert-error">- {{i18n "user.second_factor.enforced_with_oauth_notice"}}- </div>- {{/if}}+ <section+ class="user-content user-preferences solo-preference second-factor"+ >+ <ConditionalLoadingSpinner @condition={{@controller.loading}}>+ <form class="form-vertical">+ {{#if @controller.showEnforcedNotice}}+ <div class="alert alert-error">+ {{i18n "user.second_factor.enforced_notice"}}+ </div>+ {{/if}}- {{#if this.displayOAuthWarning}}- <div class="alert alert-warning">{{i18n- "user.second_factor.oauth_enabled_warning"- }}</div>- {{/if}}+ {{#if @controller.showEnforcedWithOAuthNotice}}+ <div class="alert alert-error">+ {{i18n "user.second_factor.enforced_with_oauth_notice"}}+ </div>+ {{/if}}- {{#if this.errorMessage}}- <div class="alert alert-error">{{this.errorMessage}}</div>- {{/if}}+ {{#if @controller.displayOAuthWarning}}+ <div class="alert alert-warning">{{i18n+ "user.second_factor.oauth_enabled_warning"+ }}</div>+ {{/if}}- <div class="control-group totp">- <div class="controls">- <h2>{{i18n "user.second_factor.totp.title"}}</h2>- {{#each this.totps as |totp|}}- <div class="second-factor-item row">- <div class="details">- {{#if totp.name}}- {{totp.name}}- {{else}}- {{i18n "user.second_factor.totp.default_name"}}- {{/if}}- </div>- {{#if this.isCurrentUser}}- <div class="actions">- <TokenBasedAuthDropdown- @totp={{totp}}- @editSecondFactor={{action "editSecondFactor"}}- @disableSingleSecondFactor={{action- "disableSingleSecondFactor"- }}- />+ {{#if @controller.errorMessage}}+ <div class="alert alert-error">{{@controller.errorMessage}}</div>+ {{/if}}++ <div class="control-group totp">+ <div class="controls">+ <h2>{{i18n "user.second_factor.totp.title"}}</h2>+ {{#each @controller.totps as |totp|}}+ <div class="second-factor-item row">+ <div class="details">+ {{#if totp.name}}+ {{totp.name}}+ {{else}}+ {{i18n "user.second_factor.totp.default_name"}}+ {{/if}}+ </div>+ {{#if @controller.isCurrentUser}}+ <div class="actions">+ <TokenBasedAuthDropdown+ @totp={{totp}}+ @editSecondFactor={{@controller.editSecondFactor}}+ @disableSingleSecondFactor={{action+ @controller.disableSingleSecondFactor+ }}+ />+ </div>+ {{/if}}</div>- {{/if}}+ {{/each}}+ <DButton+ @action={{@controller.createTotp}}+ @icon="plus"+ @disabled={{@controller.loading}}+ @label="user.second_factor.totp.add"+ class="btn-default new-totp"+ /></div>- {{/each}}- <DButton- @action={{action "createTotp"}}- @icon="plus"- @disabled={{this.loading}}- @label="user.second_factor.totp.add"- class="btn-default new-totp"- />- </div>- </div>+ </div>- <div class="control-group security-key">- <div class="controls">- <h2>{{i18n "user.second_factor.security_key.title"}}</h2>- {{#each this.security_keys as |security_key|}}- <div class="second-factor-item row">- <div class="details">- {{#if security_key.name}}- {{security_key.name}}- {{else}}- {{i18n "user.second_factor.security_key.default_name"}}- {{/if}}- </div>+ <div class="control-group security-key">+ <div class="controls">+ <h2>{{i18n "user.second_factor.security_key.title"}}</h2>+ {{#each @controller.security_keys as |security_key|}}+ <div class="second-factor-item row">+ <div class="details">+ {{#if security_key.name}}+ {{security_key.name}}+ {{else}}+ {{i18n "user.second_factor.security_key.default_name"}}+ {{/if}}+ </div>- {{#if this.isCurrentUser}}- <div class="actions">- <SecurityKeyDropdown- @securityKey={{security_key}}- @editSecurityKey={{action "editSecurityKey"}}- @disableSingleSecondFactor={{action- "disableSingleSecondFactor"- }}- />+ {{#if @controller.isCurrentUser}}+ <div class="actions">+ <SecurityKeyDropdown+ @securityKey={{security_key}}+ @editSecurityKey={{@controller.editSecurityKey}}+ @disableSingleSecondFactor={{@controller.disableSingleSecondFactor}}+ />+ </div>+ {{/if}}</div>- {{/if}}+ {{/each}}+ <DButton+ @action={{@controller.createSecurityKey}}+ @icon="plus"+ @disabled={{@controller.loading}}+ @label="user.second_factor.security_key.add"+ class="btn-default new-security-key"+ /></div>- {{/each}}- <DButton- @action={{action "createSecurityKey"}}- @icon="plus"- @disabled={{this.loading}}- @label="user.second_factor.security_key.add"- class="btn-default new-security-key"- />- </div>- </div>+ </div>++ <div class="control-group pref-second-factor-backup">+ <div class="controls pref-second-factor-backup">+ <h2>{{i18n "user.second_factor_backup.title"}}</h2>+ <div class="second-factor-item row">+ {{#if @controller.model.second_factor_enabled}}+ <div class="details">+ {{#if @controller.model.second_factor_backup_enabled}}+ {{htmlSafe+ (i18n+ "user.second_factor_backup.manage"+ [email protected]_factor_remaining_backup_codes+ )+ }}+ {{else}}+ <DButton+ @action={{@controller.editSecondFactorBackup}}+ @icon="plus"+ @disabled={{@controller.loading}}+ @label="user.second_factor_backup.enable_long"+ class="btn-default new-second-factor-backup"+ />+ {{/if}}+ </div>- <div class="control-group pref-second-factor-backup">- <div class="controls pref-second-factor-backup">- <h2>{{i18n "user.second_factor_backup.title"}}</h2>- <div class="second-factor-item row">- {{#if this.model.second_factor_enabled}}- <div class="details">- {{#if this.model.second_factor_backup_enabled}}- {{html-safe- (i18n- "user.second_factor_backup.manage"- count=this.model.second_factor_remaining_backup_codes+ {{#if+ (and+ @controller.model.second_factor_backup_enabled+ @controller.isCurrentUser)}}+ <div class="actions">+ <TwoFactorBackupDropdown+ @secondFactorBackupEnabled={{@controller.model.second_factor_backup_enabled}}+ @editSecondFactorBackup={{@controller.editSecondFactorBackup}}+ @disableSecondFactorBackup={{@controller.disableSecondFactorBackup}}+ />+ </div>+ {{/if}}+{{else}}- <DButton- @action={{action "editSecondFactorBackup"}}- @icon="plus"- @disabled={{this.loading}}- @label="user.second_factor_backup.enable_long"- class="btn-default new-second-factor-backup"- />+ {{i18n "user.second_factor_backup.enable_prerequisites"}}{{/if}}</div>+ </div>+ </div>- {{#if- (and this.model.second_factor_backup_enabled this.isCurrentUser)- }}- <div class="actions">- <TwoFactorBackupDropdown- @secondFactorBackupEnabled={{this.model.second_factor_backup_enabled}}- @editSecondFactorBackup={{action "editSecondFactorBackup"}}- @disableSecondFactorBackup={{action- "disableSecondFactorBackup"- }}+ {{#if @controller.hasSecondFactors}}+ {{#unless @controller.showEnforcedNotice}}+ <div class="control-group pref-second-factor-disable-all">+ <div class="controls -actions">+ <DButton+ @icon="ban"+ @action={{@controller.disableAllSecondFactors}}+ @disabled={{@controller.loading}}+ @label="user.second_factor.disable_all"+ class="btn-danger"/>+ <LinkTo+ @route="preferences.security"+ @model={{@controller.model.username}}+ class="cancel"+ >+ {{i18n "cancel"}}+ </LinkTo></div>- {{/if}}-- {{else}}- {{i18n "user.second_factor_backup.enable_prerequisites"}}- {{/if}}- </div>- </div>- </div>-- {{#if this.hasSecondFactors}}- {{#unless this.showEnforcedNotice}}- <div class="control-group pref-second-factor-disable-all">- <div class="controls -actions">- <DButton- @icon="ban"- @action={{action "disableAllSecondFactors"}}- @disabled={{this.loading}}- @label="user.second_factor.disable_all"- class="btn-danger"- />- <LinkTo- @route="preferences.security"- @model={{this.model.username}}- class="cancel"- >- {{i18n "cancel"}}- </LinkTo>- </div>- </div>- {{/unless}}- {{/if}}- </form>- </ConditionalLoadingSpinner>-</section>\ No newline at end of file+ </div>+ {{/unless}}+ {{/if}}+ </form>+ </ConditionalLoadingSpinner>+ </section>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/preferences.gjs b/app/assets/javascripts/discourse/app/templates/preferences.gjsindex 121210f1d2c..31817f1690d 100644--- a/app/assets/javascripts/discourse/app/templates/preferences.gjs+++ b/app/assets/javascripts/discourse/app/templates/preferences.gjs@@ -1,113 +1,126 @@-{{body-class "user-preferences-page"}}+import { hash } from "@ember/helper";+import RouteTemplate from "ember-route-template";+import DNavigationItem from "discourse/components/d-navigation-item";+import HorizontalOverflowNav from "discourse/components/horizontal-overflow-nav";+import PluginOutlet from "discourse/components/plugin-outlet";+import bodyClass from "discourse/helpers/body-class";+import icon from "discourse/helpers/d-icon";+import { i18n } from "discourse-i18n";-<div class="user-navigation user-navigation-secondary">- <HorizontalOverflowNav @ariaLabel="User secondary - preferences">- <DNavigationItem- @route="preferences.account"- @ariaCurrentContext="subNav"- class="user-nav__preferences-account"- >- {{d-icon "user"}}- <span>{{i18n "user.preferences_nav.account"}}</span>- </DNavigationItem>+export default RouteTemplate(+ <template>+ {{bodyClass "user-preferences-page"}}- <DNavigationItem- @route="preferences.security"- @ariaCurrentContext="subNav"- class="user-nav__preferences-security"- >- {{d-icon "lock"}}- <span>{{i18n "user.preferences_nav.security"}}</span>- </DNavigationItem>+ <div class="user-navigation user-navigation-secondary">+ <HorizontalOverflowNav @ariaLabel="User secondary - preferences">+ <DNavigationItem+ @route="preferences.account"+ @ariaCurrentContext="subNav"+ class="user-nav__preferences-account"+ >+ {{icon "user"}}+ <span>{{i18n "user.preferences_nav.account"}}</span>+ </DNavigationItem>- <DNavigationItem- @route="preferences.profile"- @ariaCurrentContext="subNav"- class="user-nav__preferences-profile"- >- {{d-icon "user"}}- <span>{{i18n "user.preferences_nav.profile"}}</span>- </DNavigationItem>+ <DNavigationItem+ @route="preferences.security"+ @ariaCurrentContext="subNav"+ class="user-nav__preferences-security"+ >+ {{icon "lock"}}+ <span>{{i18n "user.preferences_nav.security"}}</span>+ </DNavigationItem>- <DNavigationItem- @route="preferences.emails"- @ariaCurrentContext="subNav"- class="user-nav__preferences-emails"- >- {{d-icon "envelope"}}- <span>{{i18n "user.preferences_nav.emails"}}</span>- </DNavigationItem>+ <DNavigationItem+ @route="preferences.profile"+ @ariaCurrentContext="subNav"+ class="user-nav__preferences-profile"+ >+ {{icon "user"}}+ <span>{{i18n "user.preferences_nav.profile"}}</span>+ </DNavigationItem>- <DNavigationItem- @route="preferences.notifications"- @ariaCurrentContext="subNav"- class="user-nav__preferences-notifications"- >- {{d-icon "bell"}}- <span>{{i18n "user.preferences_nav.notifications"}}</span>- </DNavigationItem>+ <DNavigationItem+ @route="preferences.emails"+ @ariaCurrentContext="subNav"+ class="user-nav__preferences-emails"+ >+ {{icon "envelope"}}+ <span>{{i18n "user.preferences_nav.emails"}}</span>+ </DNavigationItem>- {{#if this.model.can_change_tracking_preferences}}- <DNavigationItem- @route="preferences.tracking"- @ariaCurrentContext="subNav"- class="user-nav__preferences-tracking"- >- {{d-icon "plus"}}- <span>{{i18n "user.preferences_nav.tracking"}}</span>- </DNavigationItem>- {{/if}}+ <DNavigationItem+ @route="preferences.notifications"+ @ariaCurrentContext="subNav"+ class="user-nav__preferences-notifications"+ >+ {{icon "bell"}}+ <span>{{i18n "user.preferences_nav.notifications"}}</span>+ </DNavigationItem>- <DNavigationItem- @route="preferences.users"- @ariaCurrentContext="subNav"- class="user-nav__preferences-users"- >- {{d-icon "users"}}- <span>{{i18n "user.preferences_nav.users"}}</span>- </DNavigationItem>+ {{#if @controller.model.can_change_tracking_preferences}}+ <DNavigationItem+ @route="preferences.tracking"+ @ariaCurrentContext="subNav"+ class="user-nav__preferences-tracking"+ >+ {{icon "plus"}}+ <span>{{i18n "user.preferences_nav.tracking"}}</span>+ </DNavigationItem>+ {{/if}}- <DNavigationItem- @route="preferences.interface"- @ariaCurrentContext="subNav"- class="user-nav__preferences-interface"- >- {{d-icon "desktop"}}- <span>{{i18n "user.preferences_nav.interface"}}</span>- </DNavigationItem>+ <DNavigationItem+ @route="preferences.users"+ @ariaCurrentContext="subNav"+ class="user-nav__preferences-users"+ >+ {{icon "users"}}+ <span>{{i18n "user.preferences_nav.users"}}</span>+ </DNavigationItem>- <DNavigationItem- @route="preferences.navigation-menu"- @ariaCurrentContext="subNav"- class="user-nav__preferences-navigation-menu"- >- {{d-icon "bars"}}- <span>{{i18n "user.preferences_nav.navigation_menu"}}</span>- </DNavigationItem>+ <DNavigationItem+ @route="preferences.interface"+ @ariaCurrentContext="subNav"+ class="user-nav__preferences-interface"+ >+ {{icon "desktop"}}+ <span>{{i18n "user.preferences_nav.interface"}}</span>+ </DNavigationItem>- <PluginOutlet- @name="user-preferences-nav-under-interface"- @connectorTagName="div"- @outletArgs={{hash model=this.model}}- />- <PluginOutlet- @name="user-preferences-nav"- @connectorTagName="li"- @outletArgs={{hash model=this.model}}- />- </HorizontalOverflowNav>-</div>+ <DNavigationItem+ @route="preferences.navigation-menu"+ @ariaCurrentContext="subNav"+ class="user-nav__preferences-navigation-menu"+ >+ {{icon "bars"}}+ <span>{{i18n "user.preferences_nav.navigation_menu"}}</span>+ </DNavigationItem>-<section class="user-content user-preferences" id="user-content">- <span>- <PluginOutlet- @name="above-user-preferences"- @connectorTagName="div"- @outletArgs={{hash model=this.model}}- />- </span>+ <PluginOutlet+ @name="user-preferences-nav-under-interface"+ @connectorTagName="div"+ @outletArgs={{hash [email protected]}}+ />+ <PluginOutlet+ @name="user-preferences-nav"+ @connectorTagName="li"+ @outletArgs={{hash [email protected]}}+ />+ </HorizontalOverflowNav>+ </div>- <form class="form-vertical">- {{outlet}}- </form>-</section>\ No newline at end of file+ <section class="user-content user-preferences" id="user-content">+ <span>+ <PluginOutlet+ @name="above-user-preferences"+ @connectorTagName="div"+ @outletArgs={{hash [email protected]}}+ />+ </span>++ <form class="form-vertical">+ {{outlet}}+ </form>+ </section>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/preferences/apps.gjs b/app/assets/javascripts/discourse/app/templates/preferences/apps.gjsindex c5dc8752cc8..0774f178017 100644--- a/app/assets/javascripts/discourse/app/templates/preferences/apps.gjs+++ b/app/assets/javascripts/discourse/app/templates/preferences/apps.gjs@@ -1,9 +1,18 @@-<UserPreferences::UserApiKeys @model={{@model}} />+import { hash } from "@ember/helper";+import RouteTemplate from "ember-route-template";+import PluginOutlet from "discourse/components/plugin-outlet";+import UserApiKeys from "discourse/components/user-preferences/user-api-keys";-<span>- <PluginOutlet- @name="user-preferences-apps"- @connectorTagName="div"- @outletArgs={{hash model=this.model}}- />-</span>\ No newline at end of file+export default RouteTemplate(+ <template>+ <UserApiKeys @model={{@model}} />++ <span>+ <PluginOutlet+ @name="user-preferences-apps"+ @connectorTagName="div"+ @outletArgs={{hash [email protected]}}+ />+ </span>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/preferences/categories.gjs b/app/assets/javascripts/discourse/app/templates/preferences/categories.gjsindex c9a5517f73f..9ac4ba51097 100644--- a/app/assets/javascripts/discourse/app/templates/preferences/categories.gjs+++ b/app/assets/javascripts/discourse/app/templates/preferences/categories.gjs@@ -1,18 +1,27 @@-<UserPreferences::Categories- @canSee={{this.canSee}}- @model={{this.model}}- @selectedCategories={{this.selectedCategories}}- @hideMutedTags={{this.hideMutedTags}}- @save={{action "save"}}- @siteSettings={{this.siteSettings}}-/>+import RouteTemplate from "ember-route-template";+import SaveControls from "discourse/components/save-controls";+import Categories from "discourse/components/user-preferences/categories";+import { i18n } from "discourse-i18n";-{{#if this.canSave}}- <SaveControls- @model={{this.model}}- @action={{action "save"}}- @saved={{this.saved}}- />-{{else}}- {{i18n "user.no_category_access"}}-{{/if}}\ No newline at end of file+export default RouteTemplate(+ <template>+ <Categories+ @canSee={{@controller.canSee}}+ @model={{@controller.model}}+ @selectedCategories={{@controller.selectedCategories}}+ @hideMutedTags={{@controller.hideMutedTags}}+ @save={{@controller.save}}+ @siteSettings={{@controller.siteSettings}}+ />++ {{#if @controller.canSave}}+ <SaveControls+ @model={{@controller.model}}+ @action={{@controller.save}}+ @saved={{@controller.saved}}+ />+ {{else}}+ {{i18n "user.no_category_access"}}+ {{/if}}+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/preferences/navigation-menu.gjs b/app/assets/javascripts/discourse/app/templates/preferences/navigation-menu.gjsindex bb8b26b0896..4a16089d949 100644--- a/app/assets/javascripts/discourse/app/templates/preferences/navigation-menu.gjs+++ b/app/assets/javascripts/discourse/app/templates/preferences/navigation-menu.gjs@@ -1,31 +1,40 @@-<div- class="control-group preferences-navigation-menu-navigation"- data-setting-name="user-navigation-menu-navigation"->- <legend class="control-label">{{i18n- "user.experimental_sidebar.navigation_section"- }}</legend>+import RouteTemplate from "ember-route-template";+import PreferenceCheckbox from "discourse/components/preference-checkbox";+import SaveControls from "discourse/components/save-controls";+import { i18n } from "discourse-i18n";- <div class="controls">- <label>{{i18n- "user.experimental_sidebar.navigation_section_instruction"- }}</label>+export default RouteTemplate(+ <template>+ <div+ class="control-group preferences-navigation-menu-navigation"+ data-setting-name="user-navigation-menu-navigation"+ >+ <legend class="control-label">{{i18n+ "user.experimental_sidebar.navigation_section"+ }}</legend>- <PreferenceCheckbox- @labelKey="user.experimental_sidebar.link_to_filtered_list_checkbox_description"- @checked={{this.newSidebarLinkToFilteredList}}- class="pref-link-to-filtered-list"- />- <PreferenceCheckbox- @labelKey="user.experimental_sidebar.show_count_new_items_checkbox_description"- @checked={{this.newSidebarShowCountOfNewItems}}- class="pref-show-count-new-items"- />- </div>-</div>+ <div class="controls">+ <label>{{i18n+ "user.experimental_sidebar.navigation_section_instruction"+ }}</label>-<SaveControls- @model={{this.model}}- @action={{action "save"}}- @saved={{this.saved}}-/>\ No newline at end of file+ <PreferenceCheckbox+ @labelKey="user.experimental_sidebar.link_to_filtered_list_checkbox_description"+ @checked={{@controller.newSidebarLinkToFilteredList}}+ class="pref-link-to-filtered-list"+ />+ <PreferenceCheckbox+ @labelKey="user.experimental_sidebar.show_count_new_items_checkbox_description"+ @checked={{@controller.newSidebarShowCountOfNewItems}}+ class="pref-show-count-new-items"+ />+ </div>+ </div>++ <SaveControls+ @model={{@controller.model}}+ @action={{@controller.save}}+ @saved={{@controller.saved}}+ />+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/preferences/security.gjs b/app/assets/javascripts/discourse/app/templates/preferences/security.gjsindex b9a37a03d28..8d41ad24976 100644--- a/app/assets/javascripts/discourse/app/templates/preferences/security.gjs+++ b/app/assets/javascripts/discourse/app/templates/preferences/security.gjs@@ -1,141 +1,169 @@-{{#if this.canChangePassword}}- <div class="control-group pref-password" data-setting-name="user-password">- <label class="control-label">{{i18n "user.password.title"}}</label>- <div class="controls">- <a href {{on "click" this.changePassword}} class="btn btn-default">- {{d-icon "envelope"}}- {{#if this.model.no_password}}- {{i18n "user.change_password.set_password"}}- {{else}}- {{i18n "user.change_password.action"}}- {{/if}}- </a>-- {{this.passwordProgress}}- </div>- </div>+import { fn, hash } from "@ember/helper";+import { on } from "@ember/modifier";+import { htmlSafe } from "@ember/template";+import RouteTemplate from "ember-route-template";+import AuthTokenDropdown from "discourse/components/auth-token-dropdown";+import DButton from "discourse/components/d-button";+import PluginOutlet from "discourse/components/plugin-outlet";+import UserApiKeys from "discourse/components/user-preferences/user-api-keys";+import UserPasskeys from "discourse/components/user-preferences/user-passkeys";+import icon from "discourse/helpers/d-icon";+import formatDate from "discourse/helpers/format-date";+import { i18n } from "discourse-i18n";- {{#if this.canUsePasskeys}}- <UserPreferences::UserPasskeys @model={{@model}} />- {{/if}}+export default RouteTemplate(+ <template>+ {{#if @controller.canChangePassword}}+ <div+ class="control-group pref-password"+ data-setting-name="user-password"+ >+ <label class="control-label">{{i18n "user.password.title"}}</label>+ <div class="controls">+ <a+ href+ {{on "click" @controller.changePassword}}+ class="btn btn-default"+ >+ {{icon "envelope"}}+ {{#if @controller.model.no_password}}+ {{i18n "user.change_password.set_password"}}+ {{else}}+ {{i18n "user.change_password.action"}}+ {{/if}}+ </a>- {{#if this.isCurrentUser}}- <div- class="control-group pref-second-factor"- data-setting-name="user-second-factor"- >- <label class="control-label">{{i18n "user.second_factor.title"}}</label>- <div class="instructions">- {{i18n "user.second_factor.short_description"}}+ {{@controller.passwordProgress}}+ </div></div>- <div class="controls pref-second-factor">- <DButton- @action={{this.manage2FA}}- @icon="lock"- @label="user.second_factor.enable"- class="btn-default btn-second-factor"- />- </div>- </div>- {{/if}}-{{/if}}+ {{#if @controller.canUsePasskeys}}+ <UserPasskeys @model={{@model}} />+ {{/if}}++ {{#if @controller.isCurrentUser}}+ <div+ class="control-group pref-second-factor"+ data-setting-name="user-second-factor"+ >+ <label class="control-label">{{i18n+ "user.second_factor.title"+ }}</label>+ <div class="instructions">+ {{i18n "user.second_factor.short_description"}}+ </div>-{{#if this.canCheckEmails}}- <div- class="control-group pref-auth-tokens"- data-setting-name="user-auth-tokens"- >- <label class="control-label">{{i18n "user.auth_tokens.title"}}</label>- <div class="instructions">- {{i18n "user.auth_tokens.short_description"}}- </div>- <div class="auth-tokens">- {{#each this.authTokens as |token|}}- <div class="row auth-token">- <div class="auth-token-icon">{{d-icon token.icon}}</div>- {{#unless token.is_active}}- <AuthTokenDropdown- @token={{token}}- @revokeAuthToken={{action "revokeAuthToken"}}- @showToken={{action "showToken"}}+ <div class="controls pref-second-factor">+ <DButton+ @action={{@controller.manage2FA}}+ @icon="lock"+ @label="user.second_factor.enable"+ class="btn-default btn-second-factor"/>- {{/unless}}- <div class="auth-token-first">- {{html-safe- (i18n- "user.auth_tokens.device_location"- device=token.device- ip=token.client_ip- location=token.location- )- }}</div>- <div class="auth-token-second">- {{#if token.is_active}}- {{html-safe- (i18n "user.auth_tokens.browser_active" browser=token.browser)- }}+ </div>+ {{/if}}+ {{/if}}++ {{#if @controller.canCheckEmails}}+ <div+ class="control-group pref-auth-tokens"+ data-setting-name="user-auth-tokens"+ >+ <label class="control-label">{{i18n "user.auth_tokens.title"}}</label>+ <div class="instructions">+ {{i18n "user.auth_tokens.short_description"}}+ </div>+ <div class="auth-tokens">+ {{#each @controller.authTokens as |token|}}+ <div class="row auth-token">+ <div class="auth-token-icon">{{icon token.icon}}</div>+ {{#unless token.is_active}}+ <AuthTokenDropdown+ @token={{token}}+ @revokeAuthToken={{@controller.revokeAuthToken}}+ @showToken={{@controller.showToken}}+ />+ {{/unless}}+ <div class="auth-token-first">+ {{htmlSafe+ (i18n+ "user.auth_tokens.device_location"+ device=token.device+ ip=token.client_ip+ location=token.location+ )+ }}+ </div>+ <div class="auth-token-second">+ {{#if token.is_active}}+ {{htmlSafe+ (i18n+ "user.auth_tokens.browser_active" browser=token.browser+ )+ }}+ {{else}}+ {{htmlSafe+ (i18n+ "user.auth_tokens.browser_last_seen"+ browser=token.browser+ date=(formatDate token.seen_at)+ )+ }}+ {{/if}}+ </div>+ </div>+ {{/each}}+ </div>++ {{#if @controller.canShowAllAuthTokens}}+ <a href {{on "click" @controller.toggleShowAllAuthTokens}}>+ {{#if @controller.showAllAuthTokens}}+ {{icon "caret-up"}}+ <span>{{i18n "user.auth_tokens.show_few"}}</span>{{else}}- {{html-safe- (i18n- "user.auth_tokens.browser_last_seen"- browser=token.browser- date=(format-date token.seen_at)- )- }}+ {{icon "caret-down"}}+ <span>+ {{i18n+ "user.auth_tokens.show_all"+ [email protected]_auth_tokens.length+ }}+ </span>{{/if}}- </div>- </div>- {{/each}}- </div>+ </a>+ {{/if}}- {{#if this.canShowAllAuthTokens}}- <a href {{on "click" this.toggleShowAllAuthTokens}}>- {{#if this.showAllAuthTokens}}- {{d-icon "caret-up"}}- <span>{{i18n "user.auth_tokens.show_few"}}</span>- {{else}}- {{d-icon "caret-down"}}+ <a+ href+ {{on "click" (fn @controller.revokeAuthToken null)}}+ class="pull-right text-danger"+ >+ {{icon "right-from-bracket"}}<span>- {{i18n- "user.auth_tokens.show_all"- count=this.model.user_auth_tokens.length- }}+ {{i18n "user.auth_tokens.log_out_all"}}</span>- {{/if}}- </a>+ </a>+ </div>{{/if}}- <a- href- {{on "click" (fn this.revokeAuthToken null)}}- class="pull-right text-danger"- >- {{d-icon "right-from-bracket"}}- <span>- {{i18n "user.auth_tokens.log_out_all"}}- </span>- </a>- </div>-{{/if}}--<UserPreferences::UserApiKeys @model={{@model}} />+ <UserApiKeys @model={{@model}} />-<span>- <PluginOutlet- @name="user-preferences-security"- @connectorTagName="div"- @outletArgs={{hash model=this.model save=(action "save")}}- />-</span>+ <span>+ <PluginOutlet+ @name="user-preferences-security"+ @connectorTagName="div"+ @outletArgs={{hash [email protected] save=this.save}}+ />+ </span>-<br />+ <br />-<span>- <PluginOutlet- @name="user-custom-controls"- @connectorTagName="div"- @outletArgs={{hash model=this.model}}- />-</span>\ No newline at end of file+ <span>+ <PluginOutlet+ @name="user-custom-controls"+ @connectorTagName="div"+ @outletArgs={{hash [email protected]}}+ />+ </span>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/preferences/tags.gjs b/app/assets/javascripts/discourse/app/templates/preferences/tags.gjsindex bfd94a73caf..c94ab83b10c 100644--- a/app/assets/javascripts/discourse/app/templates/preferences/tags.gjs+++ b/app/assets/javascripts/discourse/app/templates/preferences/tags.gjs@@ -1,12 +1,20 @@-<UserPreferences::Tags- @model={{this.model}}- @selectedTags={{this.selectedTags}}- @save={{action "save"}}- @siteSettings={{this.siteSettings}}-/>+import RouteTemplate from "ember-route-template";+import SaveControls from "discourse/components/save-controls";+import Tags from "discourse/components/user-preferences/tags";-<SaveControls- @model={{this.model}}- @action={{action "save"}}- @saved={{this.saved}}-/>\ No newline at end of file+export default RouteTemplate(+ <template>+ <Tags+ @model={{@controller.model}}+ @selectedTags={{@controller.selectedTags}}+ @save={{@controller.save}}+ @siteSettings={{@controller.siteSettings}}+ />++ <SaveControls+ @model={{@controller.model}}+ @action={{@controller.save}}+ @saved={{@controller.saved}}+ />+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/privacy.gjs b/app/assets/javascripts/discourse/app/templates/privacy.gjsindex 5ac88e0119b..8c919704bd5 100644--- a/app/assets/javascripts/discourse/app/templates/privacy.gjs+++ b/app/assets/javascripts/discourse/app/templates/privacy.gjs@@ -1,9 +1,18 @@-{{body-class "static-privacy"}}+import { htmlSafe } from "@ember/template";+import RouteTemplate from "ember-route-template";+import PluginOutlet from "discourse/components/plugin-outlet";+import bodyClass from "discourse/helpers/body-class";-<section class="container">- <div class="contents clearfix body-page">- <PluginOutlet @name="above-static" />- {{html-safe this.model.html}}- <PluginOutlet @name="below-static" />- </div>-</section>\ No newline at end of file+export default RouteTemplate(+ <template>+ {{bodyClass "static-privacy"}}++ <section class="container">+ <div class="contents clearfix body-page">+ <PluginOutlet @name="above-static" />+ {{htmlSafe @controller.model.html}}+ <PluginOutlet @name="below-static" />+ </div>+ </section>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/review-show.gjs b/app/assets/javascripts/discourse/app/templates/review-show.gjsindex 02c3b01ae31..9e133febde0 100644--- a/app/assets/javascripts/discourse/app/templates/review-show.gjs+++ b/app/assets/javascripts/discourse/app/templates/review-show.gjs@@ -1 +1,6 @@-<ReviewableItem @reviewable={{this.reviewable}} />\ No newline at end of file+import RouteTemplate from "ember-route-template";+import ReviewableItem from "discourse/components/reviewable-item";++export default RouteTemplate(+ <template><ReviewableItem @reviewable={{@controller.reviewable}} /></template>+);diff --git a/app/assets/javascripts/discourse/app/templates/review-topics.gjs b/app/assets/javascripts/discourse/app/templates/review-topics.gjsindex faefc68850e..01c9f09c03e 100644--- a/app/assets/javascripts/discourse/app/templates/review-topics.gjs+++ b/app/assets/javascripts/discourse/app/templates/review-topics.gjs@@ -1,51 +1,67 @@-{{#if this.reviewableTopics}}- <table class="reviewable-topics">- <thead>- <th>{{i18n "review.topics.topic"}} </th>- <th>{{i18n "review.topics.reviewable_count"}}</th>- <th>{{i18n "review.topics.reported_by"}}</th>- <th></th>- </thead>- <tbody>- {{#each this.reviewableTopics as |rt|}}- <tr class="reviewable-topic">- <td class="topic-title">- <div class="combined-title">- <TopicStatus @topic={{rt}} />- <a- href={{rt.relative_url}}- rel="noopener noreferrer"- target="_blank"- >{{replace-emoji rt.title}}</a>- </div>- </td>- <td class="reviewable-count">- {{rt.stats.count}}- </td>- <td class="reported-by">- {{i18n "review.topics.unique_users" count=rt.stats.unique_users}}- </td>- <td class="reviewable-details">- <ReviewableClaimedTopic- @topicId={{rt.id}}- @claimedBy={{rt.claimed_by}}- @onClaim={{fn (mut rt.claimed_by)}}- />- <LinkTo- @route="review.index"- @query={{hash topic_id=rt.id}}- class="btn btn-primary btn-small"- >- {{d-icon "list"}}- <span>{{i18n "review.topics.details"}}</span>- </LinkTo>- </td>- </tr>- {{/each}}- </tbody>- </table>-{{else}}- <div class="no-review">- {{i18n "review.none"}}- </div>-{{/if}}\ No newline at end of file+import { fn, hash } from "@ember/helper";+import { LinkTo } from "@ember/routing";+import RouteTemplate from "ember-route-template";+import ReviewableClaimedTopic from "discourse/components/reviewable-claimed-topic";+import TopicStatus from "discourse/components/topic-status";+import icon from "discourse/helpers/d-icon";+import replaceEmoji from "discourse/helpers/replace-emoji";+import { i18n } from "discourse-i18n";++export default RouteTemplate(+ <template>+ {{#if @controller.reviewableTopics}}+ <table class="reviewable-topics">+ <thead>+ <th>{{i18n "review.topics.topic"}} </th>+ <th>{{i18n "review.topics.reviewable_count"}}</th>+ <th>{{i18n "review.topics.reported_by"}}</th>+ <th></th>+ </thead>+ <tbody>+ {{#each @controller.reviewableTopics as |rt|}}+ <tr class="reviewable-topic">+ <td class="topic-title">+ <div class="combined-title">+ <TopicStatus @topic={{rt}} />+ <a+ href={{rt.relative_url}}+ rel="noopener noreferrer"+ target="_blank"+ >{{replaceEmoji rt.title}}</a>+ </div>+ </td>+ <td class="reviewable-count">+ {{rt.stats.count}}+ </td>+ <td class="reported-by">+ {{i18n+ "review.topics.unique_users"+ count=rt.stats.unique_users+ }}+ </td>+ <td class="reviewable-details">+ <ReviewableClaimedTopic+ @topicId={{rt.id}}+ @claimedBy={{rt.claimed_by}}+ @onClaim={{fn (mut rt.claimed_by)}}+ />+ <LinkTo+ @route="review.index"+ @query={{hash topic_id=rt.id}}+ class="btn btn-primary btn-small"+ >+ {{icon "list"}}+ <span>{{i18n "review.topics.details"}}</span>+ </LinkTo>+ </td>+ </tr>+ {{/each}}+ </tbody>+ </table>+ {{else}}+ <div class="no-review">+ {{i18n "review.none"}}+ </div>+ {{/if}}+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/review.gjs b/app/assets/javascripts/discourse/app/templates/review.gjsindex 282d038f916..0f5b2cffc6d 100644--- a/app/assets/javascripts/discourse/app/templates/review.gjs+++ b/app/assets/javascripts/discourse/app/templates/review.gjs@@ -1,15 +1,22 @@-<div class="reviewable">- <ul class="nav nav-pills reviewable-title">- <NavItem @route="review.index" @label="review.view_all" />- <NavItem @route="review.topics" @label="review.grouped_by_topic" />- {{#if this.currentUser.admin}}- <NavItem- @route="review.settings"- @label="review.settings.title"- @icon="wrench"- />- {{/if}}- </ul>+import RouteTemplate from "ember-route-template";+import NavItem from "discourse/components/nav-item";- {{outlet}}-</div>\ No newline at end of file+export default RouteTemplate(+ <template>+ <div class="reviewable">+ <ul class="nav nav-pills reviewable-title">+ <NavItem @route="review.index" @label="review.view_all" />+ <NavItem @route="review.topics" @label="review.grouped_by_topic" />+ {{#if @controller.currentUser.admin}}+ <NavItem+ @route="review.settings"+ @label="review.settings.title"+ @icon="wrench"+ />+ {{/if}}+ </ul>++ {{outlet}}+ </div>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/second-factor-auth.gjs b/app/assets/javascripts/discourse/app/templates/second-factor-auth.gjsindex 317a8cde9dc..162bb68467c 100644--- a/app/assets/javascripts/discourse/app/templates/second-factor-auth.gjs+++ b/app/assets/javascripts/discourse/app/templates/second-factor-auth.gjs@@ -1,56 +1,75 @@-{{hide-application-sidebar}}+import { fn } from "@ember/helper";+import { on } from "@ember/modifier";+import RouteTemplate from "ember-route-template";+import { gt, or } from "truth-helpers";+import DButton from "discourse/components/d-button";+import SecondFactorInput from "discourse/components/second-factor-input";+import hideApplicationSidebar from "discourse/helpers/hide-application-sidebar";+import withEventValue from "discourse/helpers/with-event-value";+import { i18n } from "discourse-i18n";-{{#if this.message}}- <div class="alert {{this.alertClass}}">{{this.message}}</div>-{{/if}}-{{#unless this.loadError}}- <h3>{{this.secondFactorTitle}}</h3>- {{#if this.customDescription}}- <p class="action-description">{{this.customDescription}}</p>- {{/if}}- <p>{{this.secondFactorDescription}}</p>- {{#if this.showSecurityKeyForm}}- <div id="security-key">- <DButton- @action={{this.authenticateSecurityKey}}- @icon="key"- @label="login.security_key_authenticate"- id="security-key-authenticate-button"- class="btn-large btn-primary"- />- </div>- {{else if (or this.showTotpForm this.showBackupCodesForm)}}- <form class={{this.inputFormClass}}>- <SecondFactorInput- {{on "input" (with-event-value (fn (mut this.secondFactorToken)))}}- @secondFactorMethod={{this.shownSecondFactorMethod}}- value={{this.secondFactorToken}}- />- <DButton- @action={{this.authenticateToken}}- @label="submit"- type="submit"- class="btn-primary"- />- </form>- {{/if}}+export default RouteTemplate(+ <template>+ {{hideApplicationSidebar}}- {{#if this.alternativeMethods.length}}- <p>- {{#each this.alternativeMethods as |method index|}}- {{#if (gt index 0)}}- <span>·</span>- {{/if}}- <span>- <a- href- class="toggle-second-factor-method {{method.class}}"- {{on "click" (fn this.useAnotherMethod method.id)}}- >- {{i18n method.translationKey}}- </a>- </span>- {{/each}}- </p>- {{/if}}-{{/unless}}\ No newline at end of file+ {{#if @controller.message}}+ <div+ class="alert {{@controller.alertClass}}"+ >{{@controller.message}}</div>+ {{/if}}+ {{#unless @controller.loadError}}+ <h3>{{@controller.secondFactorTitle}}</h3>+ {{#if @controller.customDescription}}+ <p class="action-description">{{@controller.customDescription}}</p>+ {{/if}}+ <p>{{@controller.secondFactorDescription}}</p>+ {{#if @controller.showSecurityKeyForm}}+ <div id="security-key">+ <DButton+ @action={{@controller.authenticateSecurityKey}}+ @icon="key"+ @label="login.security_key_authenticate"+ id="security-key-authenticate-button"+ class="btn-large btn-primary"+ />+ </div>+ {{else if (or @controller.showTotpForm @controller.showBackupCodesForm)}}+ <form class={{@controller.inputFormClass}}>+ <SecondFactorInput+ {{on+ "input"+ (withEventValue (fn (mut @controller.secondFactorToken)))+ }}+ @secondFactorMethod={{@controller.shownSecondFactorMethod}}+ value={{@controller.secondFactorToken}}+ />+ <DButton+ @action={{@controller.authenticateToken}}+ @label="submit"+ type="submit"+ class="btn-primary"+ />+ </form>+ {{/if}}++ {{#if @controller.alternativeMethods.length}}+ <p>+ {{#each @controller.alternativeMethods as |method index|}}+ {{#if (gt index 0)}}+ <span>·</span>+ {{/if}}+ <span>+ <a+ href+ class="toggle-second-factor-method {{method.class}}"+ {{on "click" (fn @controller.useAnotherMethod method.id)}}+ >+ {{i18n method.translationKey}}+ </a>+ </span>+ {{/each}}+ </p>+ {{/if}}+ {{/unless}}+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/selected-posts.gjs b/app/assets/javascripts/discourse/app/templates/selected-posts.gjsindex cef7c83d6f4..d55d463e890 100644--- a/app/assets/javascripts/discourse/app/templates/selected-posts.gjs+++ b/app/assets/javascripts/discourse/app/templates/selected-posts.gjs@@ -1,14 +1,21 @@-<SelectedPosts- @selectedPostsCount={{this.selectedPostsCount}}- @canSelectAll={{this.canSelectAll}}- @canDeselectAll={{this.canDeselectAll}}- @canDeleteSelected={{this.canDeleteSelected}}- @canMergeTopic={{this.canMergeTopic}}- @canChangeOwner={{this.canChangeOwner}}- @canMergePosts={{this.canMergePosts}}- @toggleMultiSelect={{action "toggleMultiSelect"}}- @mergePosts={{action "mergePosts"}}- @deleteSelected={{action "deleteSelected"}}- @deselectAll={{action "deselectAll"}}- @selectAll={{action "selectAll"}}-/>\ No newline at end of file+import RouteTemplate from "ember-route-template";+import SelectedPosts from "discourse/components/selected-posts";++export default RouteTemplate(+ <template>+ <SelectedPosts+ @selectedPostsCount={{@controller.selectedPostsCount}}+ @canSelectAll={{@controller.canSelectAll}}+ @canDeselectAll={{@controller.canDeselectAll}}+ @canDeleteSelected={{@controller.canDeleteSelected}}+ @canMergeTopic={{@controller.canMergeTopic}}+ @canChangeOwner={{@controller.canChangeOwner}}+ @canMergePosts={{@controller.canMergePosts}}+ @toggleMultiSelect={{@controller.toggleMultiSelect}}+ @mergePosts={{@controller.mergePosts}}+ @deleteSelected={{@controller.deleteSelected}}+ @deselectAll={{@controller.deselectAll}}+ @selectAll={{@controller.selectAll}}+ />+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/signup.gjs b/app/assets/javascripts/discourse/app/templates/signup.gjsindex 0f7e388c5fd..08b765f6e1b 100644--- a/app/assets/javascripts/discourse/app/templates/signup.gjs+++ b/app/assets/javascripts/discourse/app/templates/signup.gjs@@ -1,298 +1,344 @@-{{! template-lint-disable no-duplicate-id }}-{{hide-application-header-buttons "search" "login" "signup" "menu"}}-{{hide-application-sidebar}}-{{body-class "signup-page"}}+import { Input } from "@ember/component";+import { hash } from "@ember/helper";+import { on } from "@ember/modifier";+import { htmlSafe } from "@ember/template";+import RouteTemplate from "ember-route-template";+import { and, not } from "truth-helpers";+import FlashMessage from "discourse/components/flash-message";+import FullnameInput from "discourse/components/fullname-input";+import HoneypotInput from "discourse/components/honeypot-input";+import InputTip from "discourse/components/input-tip";+import LoginButtons from "discourse/components/login-buttons";+import PasswordField from "discourse/components/password-field";+import PluginOutlet from "discourse/components/plugin-outlet";+import SignupPageCta from "discourse/components/signup-page-cta";+import SignupProgressBar from "discourse/components/signup-progress-bar";+import TogglePasswordMask from "discourse/components/toggle-password-mask";+import UserField from "discourse/components/user-field";+import WelcomeHeader from "discourse/components/welcome-header";+import bodyClass from "discourse/helpers/body-class";+import concatClass from "discourse/helpers/concat-class";+import icon from "discourse/helpers/d-icon";+import hideApplicationHeaderButtons from "discourse/helpers/hide-application-header-buttons";+import hideApplicationSidebar from "discourse/helpers/hide-application-sidebar";+import loadingSpinner from "discourse/helpers/loading-spinner";+import routeAction from "discourse/helpers/route-action";+import valueEntered from "discourse/helpers/value-entered";+import { i18n } from "discourse-i18n";-{{#if this.isRedirectingToExternalAuth}}- {{! Hide the signup form if the site has only one external }}- {{! authentication method and is being automatically redirected to it }}- {{loading-spinner}}-{{else}}- <div class="signup-fullpage">- <FlashMessage @flash={{this.flash}} @type={{this.flashType}} />+export default RouteTemplate(+ <template>+ {{! template-lint-disable no-duplicate-id }}+ {{hideApplicationHeaderButtons "search" "login" "signup" "menu"}}+ {{hideApplicationSidebar}}+ {{bodyClass "signup-page"}}- <div class={{concat-class "signup-body" this.bodyClasses}}>- <PluginOutlet- @name="create-account-before-modal-body"- @connectorTagName="div"- />+ {{#if @controller.isRedirectingToExternalAuth}}+ {{! Hide the signup form if the site has only one external }}+ {{! authentication method and is being automatically redirected to it }}+ {{loadingSpinner}}+ {{else}}+ <div class="signup-fullpage">+ <FlashMessage+ @flash={{@controller.flash}}+ @type={{@controller.flashType}}+ />- <div- class={{concat-class- (if this.site.desktopView "login-left-side")- this.authOptions.auth_provider- }}- >- <SignupProgressBar @step="signup" />- <WelcomeHeader- id="create-account-title"- @header={{i18n "create_account.header_title"}}- >+ <div class={{concatClass "signup-body" @controller.bodyClasses}}><PluginOutlet- @name="create-account-header-bottom"- @outletArgs={{hash showLogin=(route-action "showLogin")}}+ @name="create-account-before-modal-body"+ @connectorTagName="div"/>- </WelcomeHeader>- {{#if this.showCreateForm}}- <form id="login-form">- {{#if this.associateHtml}}- <div class="input-group create-account-associate-link">- <span>{{html-safe this.associateHtml}}</span>- </div>- {{/if}}- <div class="input-group create-account-email">- <Input- {{on "focusout" this.checkEmailAvailability}}- {{on "focusin" this.scrollInputIntoView}}- @type="email"- @value={{this.accountEmail}}- disabled={{this.emailDisabled}}- autofocus="autofocus"- aria-describedby="account-email-validation account-email-validation-more-info"- aria-invalid={{this.emailValidation.failed}}- name="email"- id="new-account-email"- class={{value-entered this.accountEmail}}- />- <label class="alt-placeholder" for="new-account-email">- {{i18n "user.email.title"}}- </label>- {{#if this.showEmailValidation}}- <InputTip- @validation={{this.emailValidation}}- id="account-email-validation"- />- {{else}}- <span class="more-info" id="account-email-validation-more-info">- {{#if this.siteSettings.show_signup_form_email_instructions}}- {{i18n "user.email.instructions"}}- {{/if}}- </span>- {{/if}}- </div>- <div class="input-group create-account__username">- <input- {{on "focusin" this.scrollInputIntoView}}- {{on "input" this.setAccountUsername}}- type="text"- value={{this.accountUsername}}- disabled={{this.usernameDisabled}}- maxlength={{this.maxUsernameLength}}- aria-describedby="username-validation username-validation-more-info"- aria-invalid={{this.usernameValidation.failed}}- autocomplete="off"- name="username"- id="new-account-username"- class={{value-entered this.accountUsername}}+ <div+ class={{concatClass+ (if @controller.site.desktopView "login-left-side")+ @controller.authOptions.auth_provider+ }}+ >+ <SignupProgressBar @step="signup" />+ <WelcomeHeader+ id="create-account-title"+ @header={{i18n "create_account.header_title"}}+ >+ <PluginOutlet+ @name="create-account-header-bottom"+ @outletArgs={{hash showLogin=(routeAction "showLogin")}}/>- <label class="alt-placeholder" for="new-account-username">- {{i18n "user.username.title"}}- </label>+ </WelcomeHeader>+ {{#if @controller.showCreateForm}}+ <form id="login-form">+ {{#if @controller.associateHtml}}+ <div class="input-group create-account-associate-link">+ <span>{{htmlSafe @controller.associateHtml}}</span>+ </div>+ {{/if}}+ <div class="input-group create-account-email">+ <Input+ {{on "focusout" @controller.checkEmailAvailability}}+ {{on "focusin" @controller.scrollInputIntoView}}+ @type="email"+ @value={{@controller.accountEmail}}+ disabled={{@controller.emailDisabled}}+ autofocus="autofocus"+ aria-describedby="account-email-validation account-email-validation-more-info"+ aria-invalid={{@controller.emailValidation.failed}}+ name="email"+ id="new-account-email"+ class={{valueEntered @controller.accountEmail}}+ />+ <label class="alt-placeholder" for="new-account-email">+ {{i18n "user.email.title"}}+ </label>+ {{#if @controller.showEmailValidation}}+ <InputTip+ @validation={{@controller.emailValidation}}+ id="account-email-validation"+ />+ {{else}}+ <span+ class="more-info"+ id="account-email-validation-more-info"+ >+ {{#if+ @controller.siteSettings.show_signup_form_email_instructions+ }}+ {{i18n "user.email.instructions"}}+ {{/if}}+ </span>+ {{/if}}+ </div>- {{#if this.showUsernameInstructions}}- <span class="more-info" id="username-validation-more-info">- {{i18n "user.username.instructions"}}- </span>+ <div class="input-group create-account__username">+ <input+ {{on "focusin" @controller.scrollInputIntoView}}+ {{on "input" @controller.setAccountUsername}}+ type="text"+ value={{@controller.accountUsername}}+ disabled={{@controller.usernameDisabled}}+ maxlength={{@controller.maxUsernameLength}}+ aria-describedby="username-validation username-validation-more-info"+ aria-invalid={{@controller.usernameValidation.failed}}+ autocomplete="off"+ name="username"+ id="new-account-username"+ class={{valueEntered @controller.accountUsername}}+ />+ <label class="alt-placeholder" for="new-account-username">+ {{i18n "user.username.title"}}+ </label>- {{else}}- <InputTip- @validation={{this.usernameValidation}}- id="username-validation"- />- {{/if}}- </div>+ {{#if @controller.showUsernameInstructions}}+ <span class="more-info" id="username-validation-more-info">+ {{i18n "user.username.instructions"}}+ </span>- {{#if (and this.showFullname this.fullnameRequired)}}- <FullnameInput- @nameValidation={{this.nameValidation}}- @nameTitle={{this.nameTitle}}- @accountName={{this.accountName}}- @nameDisabled={{this.nameDisabled}}- @onFocusIn={{this.scrollInputIntoView}}- class="input-group create-account__fullname required"- />- {{/if}}+ {{else}}+ <InputTip+ @validation={{@controller.usernameValidation}}+ id="username-validation"+ />+ {{/if}}+ </div>- <PluginOutlet- @name="create-account-before-password"- @outletArgs={{hash- accountName=this.accountName- accountUsername=this.accountUsername- accountPassword=this.accountPassword- userFields=this.userFields- authOptions=this.authOptions- }}- />+ {{#if+ (and @controller.showFullname @controller.fullnameRequired)+ }}+ <FullnameInput+ @nameValidation={{@controller.nameValidation}}+ @nameTitle={{@controller.nameTitle}}+ @accountName={{@controller.accountName}}+ @nameDisabled={{@controller.nameDisabled}}+ @onFocusIn={{@controller.scrollInputIntoView}}+ class="input-group create-account__fullname required"+ />+ {{/if}}- <div class="input-group create-account__password">- {{#if this.passwordRequired}}- <PasswordField- {{on "focusin" this.scrollInputIntoView}}- @value={{this.accountPassword}}- @capsLockOn={{this.capsLockOn}}- type={{if this.maskPassword "password" "text"}}- autocomplete="current-password"- aria-describedby="password-validation password-validation-more-info"- aria-invalid={{this.passwordValidation.failed}}- id="new-account-password"- class={{value-entered this.accountPassword}}- />- <label class="alt-placeholder" for="new-account-password">- {{i18n "user.password.title"}}- </label>- <TogglePasswordMask- @maskPassword={{this.maskPassword}}- @togglePasswordMask={{this.togglePasswordMask}}+ <PluginOutlet+ @name="create-account-before-password"+ @outletArgs={{hash+ }}/>- <div class="create-account__password-info">- <div class="create-account__password-tip-validation">- {{#if this.showPasswordValidation}}- <InputTip- @validation={{this.passwordValidation}}- id="password-validation"- />- {{else if- this.siteSettings.show_signup_form_password_instructions- }}- <span- class="more-info"- id="password-validation-more-info"- >- {{this.passwordValidationHelper.passwordInstructions}}- </span>- {{/if}}- <div- class={{concat-class- "caps-lock-warning"- (unless this.capsLockOn "hidden")- }}- >- {{d-icon "triangle-exclamation"}}- {{i18n "login.caps_lock_warning"}}++ <div class="input-group create-account__password">+ {{#if @controller.passwordRequired}}+ <PasswordField+ {{on "focusin" @controller.scrollInputIntoView}}+ @value={{@controller.accountPassword}}+ @capsLockOn={{@controller.capsLockOn}}+ type={{if @controller.maskPassword "password" "text"}}+ autocomplete="current-password"+ aria-describedby="password-validation password-validation-more-info"+ aria-invalid={{@controller.passwordValidation.failed}}+ id="new-account-password"+ class={{valueEntered @controller.accountPassword}}+ />+ <label class="alt-placeholder" for="new-account-password">+ {{i18n "user.password.title"}}+ </label>+ <TogglePasswordMask+ @maskPassword={{@controller.maskPassword}}+ @togglePasswordMask={{@controller.togglePasswordMask}}+ />+ <div class="create-account__password-info">+ <div class="create-account__password-tip-validation">+ {{#if @controller.showPasswordValidation}}+ <InputTip+ @validation={{@controller.passwordValidation}}+ id="password-validation"+ />+ {{else if+ @controller.siteSettings.show_signup_form_password_instructions+ }}+ <span+ class="more-info"+ id="password-validation-more-info"+ >+ {{@controller.passwordValidationHelper.passwordInstructions}}+ </span>+ {{/if}}+ <div+ class={{concatClass+ "caps-lock-warning"+ (unless @controller.capsLockOn "hidden")+ }}+ >+ {{icon "triangle-exclamation"}}+ {{i18n "login.caps_lock_warning"}}+ </div>+ </div></div>+ {{/if}}++ <div class="password-confirmation">+ <label for="new-account-password-confirmation">+ {{i18n "user.password_confirmation.title"}}+ </label>+ <HoneypotInput+ @id="new-account-confirmation"+ @autocomplete="new-password"+ @value={{@controller.accountHoneypot}}+ />+ <Input+ @value={{@controller.accountChallenge}}+ id="new-account-challenge"+ /></div></div>- {{/if}}- <div class="password-confirmation">- <label for="new-account-password-confirmation">- {{i18n "user.password_confirmation.title"}}- </label>- <HoneypotInput- @id="new-account-confirmation"- @autocomplete="new-password"- @value={{this.accountHoneypot}}- />- <Input- @value={{this.accountChallenge}}- id="new-account-challenge"- />- </div>- </div>+ {{#if @controller.requireInviteCode}}+ <div class="input-group create-account__invite-code">+ <Input+ {{on "focusin" @controller.scrollInputIntoView}}+ @value={{@controller.inviteCode}}+ id="inviteCode"+ class={{valueEntered @controller.inviteCode}}+ />+ <label class="alt-placeholder" for="invite-code">+ {{i18n "user.invite_code.title"}}+ </label>+ <span class="more-info">+ {{i18n "user.invite_code.instructions"}}+ </span>+ </div>+ {{/if}}- {{#if this.requireInviteCode}}- <div class="input-group create-account__invite-code">- <Input- {{on "focusin" this.scrollInputIntoView}}- @value={{this.inviteCode}}- id="inviteCode"- class={{value-entered this.inviteCode}}+ <PluginOutlet+ @name="create-account-after-password"+ @outletArgs={{hash+ }}/>- <label class="alt-placeholder" for="invite-code">- {{i18n "user.invite_code.title"}}- </label>- <span class="more-info">- {{i18n "user.invite_code.instructions"}}- </span>- </div>- {{/if}}- <PluginOutlet- @name="create-account-after-password"- @outletArgs={{hash- accountName=this.accountName- accountUsername=this.accountUsername- accountPassword=this.accountPassword- userFields=this.userFields- }}- />+ {{#if+ (and+ @controller.showFullname (not @controller.fullnameRequired)+ )+ }}+ <FullnameInput+ @nameValidation={{@controller.nameValidation}}+ @nameTitle={{@controller.nameTitle}}+ @accountName={{@controller.accountName}}+ @nameDisabled={{@controller.nameDisabled}}+ @onFocusIn={{@controller.scrollInputIntoView}}+ class="input-group create-account__fullname"+ />+ {{/if}}- {{#if (and this.showFullname (not this.fullnameRequired))}}- <FullnameInput- @nameValidation={{this.nameValidation}}- @nameTitle={{this.nameTitle}}- @accountName={{this.accountName}}- @nameDisabled={{this.nameDisabled}}- @onFocusIn={{this.scrollInputIntoView}}- class="input-group create-account__fullname"- />+ {{#if @controller.userFields}}+ <div class="user-fields">+ {{#each @controller.userFields as |f|}}+ <div class="input-group">+ <UserField+ {{on "focusin" @controller.scrollInputIntoView}}+ @field={{f.field}}+ @value={{f.value}}+ @validation={{f.validation}}+ class={{valueEntered f.value}}+ />+ </div>+ {{/each}}+ </div>+ {{/if}}++ <PluginOutlet+ @name="create-account-after-user-fields"+ @outletArgs={{hash+ }}+ />+ </form>++ {{#if @controller.site.desktopView}}+ <SignupPageCta+ @formSubmitted={{@controller.formSubmitted}}+ @hasAuthOptions={{@controller.hasAuthOptions}}+ @createAccount={{@controller.createAccount}}+ @submitDisabled={{@controller.submitDisabled}}+ @disclaimerHtml={{@controller.disclaimerHtml}}+ />+ {{/if}}{{/if}}- {{#if this.userFields}}- <div class="user-fields">- {{#each this.userFields as |f|}}- <div class="input-group">- <UserField- {{on "focusin" this.scrollInputIntoView}}- @field={{f.field}}- @value={{f.value}}- @validation={{f.validation}}- class={{value-entered f.value}}- />- </div>- {{/each}}- </div>+ {{#if @controller.skipConfirmation}}+ {{loadingSpinner size="large"}}{{/if}}+ </div>- <PluginOutlet- @name="create-account-after-user-fields"- @outletArgs={{hash- accountName=this.accountName- accountUsername=this.accountUsername- accountPassword=this.accountPassword- userFields=this.userFields- }}- />- </form>+ {{#if @controller.hasAtLeastOneLoginButton}}+ {{#if @controller.site.mobileView}}+ <div class="login-or-separator"><span>+ {{i18n "login.or"}}</span></div>{{/if}}+ <div class="login-right-side">+ <LoginButtons+ @externalLogin={{@controller.externalLogin}}+ @context="create-account"+ />+ </div>+ {{/if}}- {{#if this.site.desktopView}}+ {{#if (and @controller.showCreateForm @controller.site.mobileView)}}<SignupPageCta- @formSubmitted={{this.formSubmitted}}- @hasAuthOptions={{this.hasAuthOptions}}- @createAccount={{this.createAccount}}- @submitDisabled={{this.submitDisabled}}- @disclaimerHtml={{this.disclaimerHtml}}+ @formSubmitted={{@controller.formSubmitted}}+ @hasAuthOptions={{@controller.hasAuthOptions}}+ @createAccount={{@controller.createAccount}}+ @submitDisabled={{@controller.submitDisabled}}+ @disclaimerHtml={{@controller.disclaimerHtml}}/>{{/if}}- {{/if}}-- {{#if this.skipConfirmation}}- {{loading-spinner size="large"}}- {{/if}}- </div>-- {{#if this.hasAtLeastOneLoginButton}}- {{#if this.site.mobileView}}- <div class="login-or-separator"><span>- {{i18n "login.or"}}</span></div>{{/if}}- <div class="login-right-side">- <LoginButtons- @externalLogin={{this.externalLogin}}- @context="create-account"- /></div>- {{/if}}-- {{#if (and this.showCreateForm this.site.mobileView)}}- <SignupPageCta- @formSubmitted={{this.formSubmitted}}- @hasAuthOptions={{this.hasAuthOptions}}- @createAccount={{this.createAccount}}- @submitDisabled={{this.submitDisabled}}- @disclaimerHtml={{this.disclaimerHtml}}- />- {{/if}}- </div>- </div>-{{/if}}\ No newline at end of file+ </div>+ {{/if}}+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/tag-groups-edit.gjs b/app/assets/javascripts/discourse/app/templates/tag-groups-edit.gjsindex 3ecfbea80f1..6e0868a49aa 100644--- a/app/assets/javascripts/discourse/app/templates/tag-groups-edit.gjs+++ b/app/assets/javascripts/discourse/app/templates/tag-groups-edit.gjs@@ -1,4 +1,15 @@-<div class="tag-group-content">- <h3>{{i18n "tagging.groups.edit_title"}}</h3>- <TagGroupsForm @model={{this.model}} @onDestroy={{action "onDestroy"}} />-</div>\ No newline at end of file+import RouteTemplate from "ember-route-template";+import TagGroupsForm from "discourse/components/tag-groups-form";+import { i18n } from "discourse-i18n";++export default RouteTemplate(+ <template>+ <div class="tag-group-content">+ <h3>{{i18n "tagging.groups.edit_title"}}</h3>+ <TagGroupsForm+ @model={{@controller.model}}+ @onDestroy={{@controller.onDestroy}}+ />+ </div>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/tag-groups-index.gjs b/app/assets/javascripts/discourse/app/templates/tag-groups-index.gjsindex 441a399118c..7b922b8b6de 100644--- a/app/assets/javascripts/discourse/app/templates/tag-groups-index.gjs+++ b/app/assets/javascripts/discourse/app/templates/tag-groups-index.gjs@@ -1,20 +1,29 @@-<div class="tag-group-content">- <h3>- {{#if this.model}}- {{i18n "tagging.groups.about_heading"}}- {{else}}- {{i18n "tagging.groups.about_heading_empty"}}- {{/if}}- </h3>- <section class="tag-groups-about">- <p>{{i18n "tagging.groups.about_description"}}</p>- </section>- <section>- {{#unless this.model}}- <LinkTo @route="tagGroups.new" class="btn btn-primary">- {{d-icon "plus"}}- {{i18n "tagging.groups.new"}}- </LinkTo>- {{/unless}}- </section>-</div>\ No newline at end of file+import { LinkTo } from "@ember/routing";+import RouteTemplate from "ember-route-template";+import icon from "discourse/helpers/d-icon";+import { i18n } from "discourse-i18n";++export default RouteTemplate(+ <template>+ <div class="tag-group-content">+ <h3>+ {{#if @controller.model}}+ {{i18n "tagging.groups.about_heading"}}+ {{else}}+ {{i18n "tagging.groups.about_heading_empty"}}+ {{/if}}+ </h3>+ <section class="tag-groups-about">+ <p>{{i18n "tagging.groups.about_description"}}</p>+ </section>+ <section>+ {{#unless @controller.model}}+ <LinkTo @route="tagGroups.new" class="btn btn-primary">+ {{icon "plus"}}+ {{i18n "tagging.groups.new"}}+ </LinkTo>+ {{/unless}}+ </section>+ </div>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/tag-groups-new.gjs b/app/assets/javascripts/discourse/app/templates/tag-groups-new.gjsindex 7a38ce83a5f..d44586f017a 100644--- a/app/assets/javascripts/discourse/app/templates/tag-groups-new.gjs+++ b/app/assets/javascripts/discourse/app/templates/tag-groups-new.gjs@@ -1,4 +1,15 @@-<div class="tag-group-content">- <h3>{{i18n "tagging.groups.new_title"}}</h3>- <TagGroupsForm @model={{this.model}} @onSave={{action "onSave"}} />-</div>\ No newline at end of file+import RouteTemplate from "ember-route-template";+import TagGroupsForm from "discourse/components/tag-groups-form";+import { i18n } from "discourse-i18n";++export default RouteTemplate(+ <template>+ <div class="tag-group-content">+ <h3>{{i18n "tagging.groups.new_title"}}</h3>+ <TagGroupsForm+ @model={{@controller.model}}+ @onSave={{@controller.onSave}}+ />+ </div>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/tag-groups.gjs b/app/assets/javascripts/discourse/app/templates/tag-groups.gjsindex 44ecbd5339d..c8874bb55a8 100644--- a/app/assets/javascripts/discourse/app/templates/tag-groups.gjs+++ b/app/assets/javascripts/discourse/app/templates/tag-groups.gjs@@ -1,37 +1,48 @@-<a class="tag-groups--back" href={{get-url "/tags"}}>- {{d-icon "chevron-left"}}- <span>{{i18n "tagging.groups.back_btn"}}</span>-</a>+import { LinkTo } from "@ember/routing";+import RouteTemplate from "ember-route-template";+import DButton from "discourse/components/d-button";+import icon from "discourse/helpers/d-icon";+import getUrl from "discourse/helpers/get-url";+import { i18n } from "discourse-i18n";-<div class="container tag-groups-container">- <h2>{{i18n "tagging.groups.title"}}</h2>+export default RouteTemplate(+ <template>+ <a class="tag-groups--back" href={{getUrl "/tags"}}>+ {{icon "chevron-left"}}+ <span>{{i18n "tagging.groups.back_btn"}}</span>+ </a>- {{#if this.siteSettings.tagging_enabled}}- {{#if this.model}}- <div class="tag-groups-sidebar content-list">- <ul>- {{#each this.model as |tagGroup|}}- <li>- <LinkTo @route="tagGroups.edit" @model={{tagGroup}}>- {{tagGroup.name}}- </LinkTo>- </li>- {{/each}}- </ul>+ <div class="container tag-groups-container">+ <h2>{{i18n "tagging.groups.title"}}</h2>- <DButton- @action={{action "newTagGroup"}}- @icon="plus"- @label="tagging.groups.new"- class="btn-default"- />- </div>- {{/if}}+ {{#if @controller.siteSettings.tagging_enabled}}+ {{#if @controller.model}}+ <div class="tag-groups-sidebar content-list">+ <ul>+ {{#each @controller.model as |tagGroup|}}+ <li>+ <LinkTo @route="tagGroups.edit" @model={{tagGroup}}>+ {{tagGroup.name}}+ </LinkTo>+ </li>+ {{/each}}+ </ul>- {{outlet}}- {{else}}- <div class="tag-group-content">- <div class="alert info">{{i18n "tagging.groups.disabled"}}</div>+ <DButton+ @action={{@controller.newTagGroup}}+ @icon="plus"+ @label="tagging.groups.new"+ class="btn-default"+ />+ </div>+ {{/if}}++ {{outlet}}+ {{else}}+ <div class="tag-group-content">+ <div class="alert info">{{i18n "tagging.groups.disabled"}}</div>+ </div>+ {{/if}}</div>- {{/if}}-</div>\ No newline at end of file+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/tags.gjs b/app/assets/javascripts/discourse/app/templates/tags.gjsindex e3947aa1710..2efe3c87251 100644--- a/app/assets/javascripts/discourse/app/templates/tags.gjs+++ b/app/assets/javascripts/discourse/app/templates/tags.gjs@@ -1,2 +1,9 @@-{{body-class "tags-page"}}-{{outlet}}\ No newline at end of file+import RouteTemplate from "ember-route-template";+import bodyClass from "discourse/helpers/body-class";++export default RouteTemplate(+ <template>+ {{bodyClass "tags-page"}}+ {{outlet}}+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/tags/index.gjs b/app/assets/javascripts/discourse/app/templates/tags/index.gjsindex f9e7baabca8..8d783f7fdd0 100644--- a/app/assets/javascripts/discourse/app/templates/tags/index.gjs+++ b/app/assets/javascripts/discourse/app/templates/tags/index.gjs@@ -1,64 +1,78 @@-<div class="container">- <DiscourseBanner />-</div>+import { hash } from "@ember/helper";+import { on } from "@ember/modifier";+import RouteTemplate from "ember-route-template";+import DiscourseBanner from "discourse/components/discourse-banner";+import PluginOutlet from "discourse/components/plugin-outlet";+import TagList from "discourse/components/tag-list";+import TagsAdminDropdown from "discourse/components/tags-admin-dropdown";+import { i18n } from "discourse-i18n";-<div class="container tags-index">-- <div class="list-controls">- <div class="container tags-controls">- {{#if this.canAdminTags}}- <TagsAdminDropdown @actionsMapping={{this.actionsMapping}} />- {{/if}}- <h2>{{i18n "tagging.tags"}}</h2>+export default RouteTemplate(+ <template>+ <div class="container">+ <DiscourseBanner /></div>- </div>- <div>- <PluginOutlet- @name="tags-below-title"- @connectorTagName="div"- @outletArgs={{hash model=this.model}}- />- </div>+ <div class="container tags-index">++ <div class="list-controls">+ <div class="container tags-controls">+ {{#if @controller.canAdminTags}}+ <TagsAdminDropdown @actionsMapping={{@controller.actionsMapping}} />+ {{/if}}+ <h2>{{i18n "tagging.tags"}}</h2>+ </div>+ </div>- <div class="tag-sort-options">- {{i18n "tagging.sort_by"}}- <span class="tag-sort-count {{if this.sortedByCount 'active'}}"><a- href- {{on "click" this.sortByCount}}- >{{i18n "tagging.sort_by_count"}}</a></span>- <span class="tag-sort-name {{if this.sortedByName 'active'}}"><a- href- {{on "click" this.sortById}}- >{{i18n "tagging.sort_by_name"}}</a></span>- </div>+ <div>+ <PluginOutlet+ @name="tags-below-title"+ @connectorTagName="div"+ @outletArgs={{hash [email protected]}}+ />+ </div>- <hr />+ <div class="tag-sort-options">+ {{i18n "tagging.sort_by"}}+ <span+ class="tag-sort-count {{if @controller.sortedByCount 'active'}}"+ ><a href {{on "click" @controller.sortByCount}}>{{i18n+ "tagging.sort_by_count"+ }}</a></span>+ <span class="tag-sort-name {{if @controller.sortedByName 'active'}}"><a+ href+ {{on "click" @controller.sortById}}+ >{{i18n "tagging.sort_by_name"}}</a></span>+ </div>- <div class="all-tag-lists">- {{#each this.model.extras.categories as |category|}}- <TagList- @tags={{category.tags}}- @sortProperties={{this.sortProperties}}- @categoryId={{category.id}}- />- {{/each}}+ <hr />- {{#each this.model.extras.tag_groups as |tagGroup|}}- <TagList- @tags={{tagGroup.tags}}- @sortProperties={{this.sortProperties}}- @tagGroupName={{tagGroup.name}}- />- {{/each}}+ <div class="all-tag-lists">+ {{#each @controller.model.extras.categories as |category|}}+ <TagList+ @tags={{category.tags}}+ @sortProperties={{@controller.sortProperties}}+ @categoryId={{category.id}}+ />+ {{/each}}- {{#if this.model}}- <TagList- @tags={{this.model}}- @sortProperties={{this.sortProperties}}- @titleKey={{this.otherTagsTitleKey}}- />- {{/if}}- </div>+ {{#each @controller.model.extras.tag_groups as |tagGroup|}}+ <TagList+ @tags={{tagGroup.tags}}+ @sortProperties={{@controller.sortProperties}}+ @tagGroupName={{tagGroup.name}}+ />+ {{/each}}-</div>\ No newline at end of file+ {{#if @controller.model}}+ <TagList+ @tags={{@controller.model}}+ @sortProperties={{@controller.sortProperties}}+ @titleKey={{@controller.otherTagsTitleKey}}+ />+ {{/if}}+ </div>++ </div>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/tos.gjs b/app/assets/javascripts/discourse/app/templates/tos.gjsindex 8a0b7fda843..336859df9a1 100644--- a/app/assets/javascripts/discourse/app/templates/tos.gjs+++ b/app/assets/javascripts/discourse/app/templates/tos.gjs@@ -1,9 +1,18 @@-{{body-class "static-tos"}}+import { htmlSafe } from "@ember/template";+import RouteTemplate from "ember-route-template";+import PluginOutlet from "discourse/components/plugin-outlet";+import bodyClass from "discourse/helpers/body-class";-<section class="container">- <div class="contents clearfix body-page">- <PluginOutlet @name="above-static" />- {{html-safe this.model.html}}- <PluginOutlet @name="below-static" />- </div>-</section>\ No newline at end of file+export default RouteTemplate(+ <template>+ {{bodyClass "static-tos"}}++ <section class="container">+ <div class="contents clearfix body-page">+ <PluginOutlet @name="above-static" />+ {{htmlSafe @controller.model.html}}+ <PluginOutlet @name="below-static" />+ </div>+ </section>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/unknown.gjs b/app/assets/javascripts/discourse/app/templates/unknown.gjsindex 4a6224cccfa..0c5ad116a2e 100644--- a/app/assets/javascripts/discourse/app/templates/unknown.gjs+++ b/app/assets/javascripts/discourse/app/templates/unknown.gjs@@ -1,3 +1,10 @@-<div class="container">- {{html-safe this.model}}-</div>\ No newline at end of file+import { htmlSafe } from "@ember/template";+import RouteTemplate from "ember-route-template";++export default RouteTemplate(+ <template>+ <div class="container">+ {{htmlSafe @controller.model}}+ </div>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/user-activity-pending.gjs b/app/assets/javascripts/discourse/app/templates/user-activity-pending.gjsindex 8d59a74f391..ffa3b4ecf4b 100644--- a/app/assets/javascripts/discourse/app/templates/user-activity-pending.gjs+++ b/app/assets/javascripts/discourse/app/templates/user-activity-pending.gjs@@ -1,9 +1,16 @@-<ul class="user-stream">- <PostList- @posts={{this.model}}- @urlPath="postUrl"- @showUserInfo={{false}}- @additionalItemClasses="user-stream-item"- class="user-stream"- />-</ul>\ No newline at end of file+import RouteTemplate from "ember-route-template";+import PostList from "discourse/components/post-list/index";++export default RouteTemplate(+ <template>+ <ul class="user-stream">+ <PostList+ @posts={{@controller.model}}+ @urlPath="postUrl"+ @showUserInfo={{false}}+ @additionalItemClasses="user-stream-item"+ class="user-stream"+ />+ </ul>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/user-invited-show.gjs b/app/assets/javascripts/discourse/app/templates/user-invited-show.gjsindex 16ee9709abd..31ae94f12f2 100644--- a/app/assets/javascripts/discourse/app/templates/user-invited-show.gjs+++ b/app/assets/javascripts/discourse/app/templates/user-invited-show.gjs@@ -1,226 +1,253 @@-{{body-class "user-invites-page"}}+import { fn } from "@ember/helper";+import { LinkTo } from "@ember/routing";+import { htmlSafe } from "@ember/template";+import RouteTemplate from "ember-route-template";+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";+import DButton from "discourse/components/d-button";+import LoadMore from "discourse/components/load-more";+import TextField from "discourse/components/text-field";+import avatar from "discourse/helpers/avatar";+import bodyClass from "discourse/helpers/body-class";+import icon from "discourse/helpers/d-icon";+import formatDate from "discourse/helpers/format-date";+import formatDuration from "discourse/helpers/format-duration";+import number from "discourse/helpers/number";+import rawDate from "discourse/helpers/raw-date";+import { i18n } from "discourse-i18n";-{{#if this.canInviteToForum}}- <LoadMore- @id="user-content"- @selector=".user-invite-list tr"- @action={{action "loadMore"}}- class="user-content"- >- <section class="user-additional-controls">- {{#if this.showSearch}}- <div class="user-invite-search">- <form><TextField- @value={{this.searchTerm}}- @placeholderKey="user.invited.search"- /></form>- </div>- {{/if}}- <section class="user-invite-buttons">- <DButton- @icon="plus"- @action={{this.createInvite}}- @label="user.invited.create"- class="btn-default invite-button"- />- {{#if this.canBulkInvite}}- {{#if this.siteSettings.allow_bulk_invite}}- {{#if this.site.desktopView}}- <DButton- @icon="upload"- @action={{this.createInviteCsv}}- @label="user.invited.bulk_invite.text"- class="btn-default"- />- {{/if}}+export default RouteTemplate(+ <template>+ {{bodyClass "user-invites-page"}}++ {{#if @controller.canInviteToForum}}+ <LoadMore+ @id="user-content"+ @selector=".user-invite-list tr"+ @action={{@controller.loadMore}}+ class="user-content"+ >+ <section class="user-additional-controls">+ {{#if @controller.showSearch}}+ <div class="user-invite-search">+ <form><TextField+ @value={{@controller.searchTerm}}+ @placeholderKey="user.invited.search"+ /></form>+ </div>{{/if}}- {{/if}}- {{#if this.showBulkActionButtons}}- {{#if this.inviteExpired}}- {{#if this.removedAll}}- <span class="removed-all">- {{i18n "user.invited.removed_all"}}- </span>- {{else}}- <DButton- @icon="xmark"- @action={{this.destroyAllExpired}}- @label="user.invited.remove_all"- />+ <section class="user-invite-buttons">+ <DButton+ @icon="plus"+ @action={{@controller.createInvite}}+ @label="user.invited.create"+ class="btn-default invite-button"+ />+ {{#if @controller.canBulkInvite}}+ {{#if @controller.siteSettings.allow_bulk_invite}}+ {{#if @controller.site.desktopView}}+ <DButton+ @icon="upload"+ @action={{@controller.createInviteCsv}}+ @label="user.invited.bulk_invite.text"+ class="btn-default"+ />+ {{/if}}+ {{/if}}{{/if}}- {{/if}}+ {{#if @controller.showBulkActionButtons}}+ {{#if @controller.inviteExpired}}+ {{#if @controller.removedAll}}+ <span class="removed-all">+ {{i18n "user.invited.removed_all"}}+ </span>+ {{else}}+ <DButton+ @icon="xmark"+ @action={{@controller.destroyAllExpired}}+ @label="user.invited.remove_all"+ />+ {{/if}}+ {{/if}}- {{#if this.invitePending}}- {{#if this.reinvitedAll}}- <span class="reinvited-all">- <DButton- @icon="check"- @disabled={{true}}- @label="user.invited.reinvited_all"- />- </span>- {{else if this.hasEmailInvites}}- <DButton- @icon="arrows-rotate"- @action={{this.reinviteAll}}- @label="user.invited.reinvite_all"- class="btn-default"- />- {{/if}}- {{/if}}- {{/if}}- </section>- </section>- <section>- {{#if this.model.invites}}- {{#if this.inviteRedeemed}}- <table class="table user-invite-list">- <thead>- <tr>- <th>{{i18n "user.invited.user"}}</th>- <th>{{i18n "user.invited.redeemed_at"}}</th>- {{#if this.model.can_see_invite_details}}- <th>{{i18n "user.last_seen"}}</th>- <th>{{i18n "user.invited.topics_entered"}}</th>- <th>{{i18n "user.invited.posts_read_count"}}</th>- <th>{{i18n "user.invited.time_read"}}</th>- <th>{{i18n "user.invited.days_visited"}}</th>- <th>{{i18n "user.invited.invited_via"}}</th>+ {{#if @controller.invitePending}}+ {{#if @controller.reinvitedAll}}+ <span class="reinvited-all">+ <DButton+ @icon="check"+ @disabled={{true}}+ @label="user.invited.reinvited_all"+ />+ </span>+ {{else if @controller.hasEmailInvites}}+ <DButton+ @icon="arrows-rotate"+ @action={{@controller.reinviteAll}}+ @label="user.invited.reinvite_all"+ class="btn-default"+ />{{/if}}- </tr>- </thead>- <tbody>- {{#each this.model.invites as |invite|}}- <tr>- <td>- <LinkTo @route="user" @model={{invite.user}}>{{avatar- invite.user- imageSize="tiny"- }}</LinkTo>- <LinkTo- @route="user"- @model={{invite.user}}- >{{invite.user.username}}</LinkTo>- </td>- <td>{{format-date invite.redeemed_at}}</td>- {{#if this.model.can_see_invite_details}}- <td>{{format-date invite.user.last_seen_at}}</td>- <td>{{number invite.user.topics_entered}}</td>- <td>{{number invite.user.posts_read_count}}</td>- <td>{{format-duration invite.user.time_read}}</td>- <td>- <span- title={{i18n "user.invited.days_visited"}}- >{{html-safe invite.user.days_visited}}</span>- /- <span- title={{i18n "user.invited.account_age_days"}}- >{{html-safe invite.user.days_since_created}}</span>- </td>- <td>{{html-safe invite.invite_source}}</td>- {{/if}}- </tr>- {{/each}}- </tbody>- </table>- {{else}}- <table class="table user-invite-list">- <thead>- <tr>- <th>{{i18n "user.invited.invited_via"}}</th>- <th>{{i18n "user.invited.sent"}}</th>- <th>{{i18n "user.invited.expires_at"}}</th>- <th></th>- </tr>- </thead>- <tbody>- {{#each this.model.invites as |invite|}}- <tr>- <td class="invite-type">- <div class="label">{{i18n "user.invited.invited_via"}}</div>- {{#if invite.email}}- {{d-icon "envelope"}}- {{invite.email}}- {{else}}- {{d-icon "link"}}- {{i18n- "user.invited.invited_via_link"- key=invite.shortKey- count=invite.redemption_count- max=invite.max_redemptions_allowed- }}+ {{/if}}+ {{/if}}+ </section>+ </section>+ <section>+ {{#if @controller.model.invites}}+ {{#if @controller.inviteRedeemed}}+ <table class="table user-invite-list">+ <thead>+ <tr>+ <th>{{i18n "user.invited.user"}}</th>+ <th>{{i18n "user.invited.redeemed_at"}}</th>+ {{#if @controller.model.can_see_invite_details}}+ <th>{{i18n "user.last_seen"}}</th>+ <th>{{i18n "user.invited.topics_entered"}}</th>+ <th>{{i18n "user.invited.posts_read_count"}}</th>+ <th>{{i18n "user.invited.time_read"}}</th>+ <th>{{i18n "user.invited.days_visited"}}</th>+ <th>{{i18n "user.invited.invited_via"}}</th>{{/if}}-- {{#each invite.groups as |g|}}- <p class="invite-extra"><a href="/g/{{g.name}}">{{d-icon- "users"+ </tr>+ </thead>+ <tbody>+ {{#each @controller.model.invites as |invite|}}+ <tr>+ <td>+ <LinkTo @route="user" @model={{invite.user}}>{{avatar+ invite.user+ imageSize="tiny"+ }}</LinkTo>+ <LinkTo+ @route="user"+ @model={{invite.user}}+ >{{invite.user.username}}</LinkTo>+ </td>+ <td>{{formatDate invite.redeemed_at}}</td>+ {{#if @controller.model.can_see_invite_details}}+ <td>{{formatDate invite.user.last_seen_at}}</td>+ <td>{{number invite.user.topics_entered}}</td>+ <td>{{number invite.user.posts_read_count}}</td>+ <td>{{formatDuration invite.user.time_read}}</td>+ <td>+ <span+ title={{i18n "user.invited.days_visited"}}+ >{{htmlSafe invite.user.days_visited}}</span>+ /+ <span+ title={{i18n "user.invited.account_age_days"}}+ >{{htmlSafe invite.user.days_since_created}}</span>+ </td>+ <td>{{htmlSafe invite.invite_source}}</td>+ {{/if}}+ </tr>+ {{/each}}+ </tbody>+ </table>+ {{else}}+ <table class="table user-invite-list">+ <thead>+ <tr>+ <th>{{i18n "user.invited.invited_via"}}</th>+ <th>{{i18n "user.invited.sent"}}</th>+ <th>{{i18n "user.invited.expires_at"}}</th>+ <th></th>+ </tr>+ </thead>+ <tbody>+ {{#each @controller.model.invites as |invite|}}+ <tr>+ <td class="invite-type">+ <div class="label">{{i18n+ "user.invited.invited_via"+ }}</div>+ {{#if invite.email}}+ {{icon "envelope"}}+ {{invite.email}}+ {{else}}+ {{icon "link"}}+ {{i18n+ "user.invited.invited_via_link"+ key=invite.shortKey+ count=invite.redemption_count+ max=invite.max_redemptions_allowed}}- {{g.name}}</a></p>- {{/each}}+ {{/if}}- {{#if invite.topic}}- <p class="invite-extra"><a- href={{invite.topic.url}}- >{{d-icon "file"}} {{invite.topic.title}}</a></p>- {{/if}}- </td>+ {{#each invite.groups as |g|}}+ <p class="invite-extra"><a href="/g/{{g.name}}">{{icon+ "users"+ }}+ {{g.name}}</a></p>+ {{/each}}- <td class="invite-updated-at">- <div class="label">{{i18n "user.invited.sent"}}</div>- {{format-date invite.updated_at}}- </td>+ {{#if invite.topic}}+ <p class="invite-extra"><a+ href={{invite.topic.url}}+ >{{icon "file"}} {{invite.topic.title}}</a></p>+ {{/if}}+ </td>- <td class="invite-expires-at">- <div class="label">{{i18n "user.invited.expires_at"}}</div>- {{#if this.inviteExpired}}- {{raw-date invite.expires_at}}- {{else if invite.expired}}- {{i18n "user.invited.expired"}}- {{else}}- {{raw-date invite.expires_at}}- {{/if}}- </td>+ <td class="invite-updated-at">+ <div class="label">{{i18n "user.invited.sent"}}</div>+ {{formatDate invite.updated_at}}+ </td>++ <td class="invite-expires-at">+ <div class="label">{{i18n+ "user.invited.expires_at"+ }}</div>+ {{#if @controller.inviteExpired}}+ {{rawDate invite.expires_at}}+ {{else if invite.expired}}+ {{i18n "user.invited.expired"}}+ {{else}}+ {{rawDate invite.expires_at}}+ {{/if}}+ </td>- {{#if invite.can_delete_invite}}- <td class="invite-actions">- <DButton- @icon="pencil"- @action={{fn this.editInvite invite}}- @title="user.invited.edit"- class="btn-default"- />- <DButton- @icon="trash-can"- @action={{fn this.destroyInvite invite}}- @title={{if- invite.destroyed- "user.invited.removed"- "user.invited.remove"- }}- class="cancel"- />- </td>- {{/if}}- </tr>- {{/each}}- </tbody>- </table>- {{/if}}+ {{#if invite.can_delete_invite}}+ <td class="invite-actions">+ <DButton+ @icon="pencil"+ @action={{fn @controller.editInvite invite}}+ @title="user.invited.edit"+ class="btn-default"+ />+ <DButton+ @icon="trash-can"+ @action={{fn @controller.destroyInvite invite}}+ @title={{if+ invite.destroyed+ "user.invited.removed"+ "user.invited.remove"+ }}+ class="cancel"+ />+ </td>+ {{/if}}+ </tr>+ {{/each}}+ </tbody>+ </table>+ {{/if}}- <ConditionalLoadingSpinner @condition={{this.invitesLoading}} />- {{else}}- <div class="user-invite-none">- {{#if this.canBulkInvite}}- {{html-safe (i18n "user.invited.bulk_invite.none")}}+ <ConditionalLoadingSpinner+ @condition={{@controller.invitesLoading}}+ />{{else}}- {{i18n "user.invited.none"}}+ <div class="user-invite-none">+ {{#if @controller.canBulkInvite}}+ {{htmlSafe (i18n "user.invited.bulk_invite.none")}}+ {{else}}+ {{i18n "user.invited.none"}}+ {{/if}}+ </div>{{/if}}- </div>- {{/if}}- </section>- </LoadMore>-{{else}}- <div class="alert alert-error invite-error">- {{this.model.error}}- </div>-{{/if}}\ No newline at end of file+ </section>+ </LoadMore>+ {{else}}+ <div class="alert alert-error invite-error">+ {{@controller.model.error}}+ </div>+ {{/if}}+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/user-invited.gjs b/app/assets/javascripts/discourse/app/templates/user-invited.gjsindex 426bca100e6..f9a2d97363f 100644--- a/app/assets/javascripts/discourse/app/templates/user-invited.gjs+++ b/app/assets/javascripts/discourse/app/templates/user-invited.gjs@@ -1,25 +1,34 @@-{{#if this.can_see_invite_details}}- {{body-class "user-invites-page"}}+import RouteTemplate from "ember-route-template";+import HorizontalOverflowNav from "discourse/components/horizontal-overflow-nav";+import NavItem from "discourse/components/nav-item";+import bodyClass from "discourse/helpers/body-class";- <div class="user-navigation user-navigation-secondary">- <HorizontalOverflowNav @ariaLabel="User secondary - invites">- <NavItem- @route="userInvited.show"- @routeParam="pending"- @i18nLabel={{this.pendingLabel}}- />- <NavItem- @route="userInvited.show"- @routeParam="expired"- @i18nLabel={{this.expiredLabel}}- />- <NavItem- @route="userInvited.show"- @routeParam="redeemed"- @i18nLabel={{this.redeemedLabel}}- />- </HorizontalOverflowNav>- </div>-{{/if}}+export default RouteTemplate(+ <template>+ {{#if @controller.can_see_invite_details}}+ {{bodyClass "user-invites-page"}}-{{outlet}}\ No newline at end of file+ <div class="user-navigation user-navigation-secondary">+ <HorizontalOverflowNav @ariaLabel="User secondary - invites">+ <NavItem+ @route="userInvited.show"+ @routeParam="pending"+ @i18nLabel={{@controller.pendingLabel}}+ />+ <NavItem+ @route="userInvited.show"+ @routeParam="expired"+ @i18nLabel={{@controller.expiredLabel}}+ />+ <NavItem+ @route="userInvited.show"+ @routeParam="redeemed"+ @i18nLabel={{@controller.redeemedLabel}}+ />+ </HorizontalOverflowNav>+ </div>+ {{/if}}++ {{outlet}}+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/user-private-messages-group.gjs b/app/assets/javascripts/discourse/app/templates/user-private-messages-group.gjsindex 59ae664ed5d..41cd7f5a0fd 100644--- a/app/assets/javascripts/discourse/app/templates/user-private-messages-group.gjs+++ b/app/assets/javascripts/discourse/app/templates/user-private-messages-group.gjs@@ -1,51 +1,62 @@-<UserNav::MessagesSecondaryNav>+import RouteTemplate from "ember-route-template";+import DNavigationItem from "discourse/components/d-navigation-item";+import GroupNotificationsTracking from "discourse/components/group-notifications-tracking";+import MessagesSecondaryNav from "discourse/components/user-nav/messages-secondary-nav";+import icon from "discourse/helpers/d-icon";+import { i18n } from "discourse-i18n";- <DNavigationItem- @route="userPrivateMessages.group.index"- @ariaCurrentContext="subNav"- class="user-nav__messages-group-latest"- >- {{d-icon "envelope"}}- <span>{{i18n "categories.latest"}}</span>- </DNavigationItem>+export default RouteTemplate(+ <template>+ <MessagesSecondaryNav>- {{#if this.viewingSelf}}- <DNavigationItem- @route="userPrivateMessages.group.new"- @ariaCurrentContext="subNav"- class="user-nav__messages-group-new"- >- {{d-icon "circle-exclamation"}}- <span>{{this.newLinkText}}</span>- </DNavigationItem>+ <DNavigationItem+ @route="userPrivateMessages.group.index"+ @ariaCurrentContext="subNav"+ class="user-nav__messages-group-latest"+ >+ {{icon "envelope"}}+ <span>{{i18n "categories.latest"}}</span>+ </DNavigationItem>- <DNavigationItem- @route="userPrivateMessages.group.unread"- @ariaCurrentContext="subNav"- class="user-nav__messages-group-unread"- >- {{d-icon "circle-plus"}}- <span>{{this.unreadLinkText}}</span>- </DNavigationItem>+ {{#if @controller.viewingSelf}}+ <DNavigationItem+ @route="userPrivateMessages.group.new"+ @ariaCurrentContext="subNav"+ class="user-nav__messages-group-new"+ >+ {{icon "circle-exclamation"}}+ <span>{{@controller.newLinkText}}</span>+ </DNavigationItem>- <DNavigationItem- @route="userPrivateMessages.group.archive"- @ariaCurrentContext="subNav"- class="user-nav__messages-group-archive"- >- {{d-icon "box-archive"}}- <span>{{i18n "user.messages.archive"}}</span>- </DNavigationItem>- {{/if}}-</UserNav::MessagesSecondaryNav>+ <DNavigationItem+ @route="userPrivateMessages.group.unread"+ @ariaCurrentContext="subNav"+ class="user-nav__messages-group-unread"+ >+ {{icon "circle-plus"}}+ <span>{{@controller.unreadLinkText}}</span>+ </DNavigationItem>-{{#in-element this.navigationControlsButton}}- <GroupNotificationsTracking- @levelId={{this.group.group_user.notification_level}}- @onChange={{this.changeGroupNotificationLevel}}- />-{{/in-element}}+ <DNavigationItem+ @route="userPrivateMessages.group.archive"+ @ariaCurrentContext="subNav"+ class="user-nav__messages-group-archive"+ >+ {{icon "box-archive"}}+ <span>{{i18n "user.messages.archive"}}</span>+ </DNavigationItem>+ {{/if}}+ </MessagesSecondaryNav>-<div class="group-messages group-{{this.group.name}}">- {{outlet}}-</div>\ No newline at end of file+ {{#in-element @controller.navigationControlsButton}}+ <GroupNotificationsTracking+ @levelId={{@controller.group.group_user.notification_level}}+ @onChange={{@controller.changeGroupNotificationLevel}}+ />+ {{/in-element}}++ <div class="group-messages group-{{@controller.group.name}}">+ {{outlet}}+ </div>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/user-private-messages-tags-index.gjs b/app/assets/javascripts/discourse/app/templates/user-private-messages-tags-index.gjsindex 7bfc64bbd38..63f1b190a5f 100644--- a/app/assets/javascripts/discourse/app/templates/user-private-messages-tags-index.gjs+++ b/app/assets/javascripts/discourse/app/templates/user-private-messages-tags-index.gjs@@ -1,31 +1,40 @@-<div class="list-controls">- <div class="container">- <h2>{{i18n "tagging.tags"}}</h2>- </div>-</div>+import { on } from "@ember/modifier";+import RouteTemplate from "ember-route-template";+import TagList from "discourse/components/tag-list";+import { i18n } from "discourse-i18n";-<div class="tag-sort-options">- {{i18n "tagging.sort_by"}}- <span class="tag-sort-count {{if this.sortedByCount 'active'}}">- <a href {{on "click" this.sortByCount}}>- {{i18n "tagging.sort_by_count"}}- </a>- </span>- <span class="tag-sort-name {{if this.sortedByName 'active'}}">- <a href {{on "click" this.sortById}}>- {{i18n "tagging.sort_by_name"}}- </a>- </span>-</div>+export default RouteTemplate(+ <template>+ <div class="list-controls">+ <div class="container">+ <h2>{{i18n "tagging.tags"}}</h2>+ </div>+ </div>-<hr />+ <div class="tag-sort-options">+ {{i18n "tagging.sort_by"}}+ <span class="tag-sort-count {{if @controller.sortedByCount 'active'}}">+ <a href {{on "click" @controller.sortByCount}}>+ {{i18n "tagging.sort_by_count"}}+ </a>+ </span>+ <span class="tag-sort-name {{if @controller.sortedByName 'active'}}">+ <a href {{on "click" @controller.sortById}}>+ {{i18n "tagging.sort_by_name"}}+ </a>+ </span>+ </div>-{{#if this.model}}- <TagList- @tags={{this.model}}- @sortProperties={{this.sortProperties}}- @titleKey="tagging.all_tags"- @isPrivateMessage={{true}}- @tagsForUser={{this.tagsForUser}}- />-{{/if}}\ No newline at end of file+ <hr />++ {{#if @controller.model}}+ <TagList+ @tags={{@controller.model}}+ @sortProperties={{@controller.sortProperties}}+ @titleKey="tagging.all_tags"+ @isPrivateMessage={{true}}+ @tagsForUser={{@controller.tagsForUser}}+ />+ {{/if}}+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/user-private-messages-tags.gjs b/app/assets/javascripts/discourse/app/templates/user-private-messages-tags.gjsindex 7c608ebbf2a..d15dd59e9ef 100644--- a/app/assets/javascripts/discourse/app/templates/user-private-messages-tags.gjs+++ b/app/assets/javascripts/discourse/app/templates/user-private-messages-tags.gjs@@ -1,18 +1,31 @@-<UserNav::MessagesSecondaryNav>- <li class="tags">- <LinkTo @route="userPrivateMessages.tags.index">- {{d-icon "tag"}}- <span>{{i18n "user.messages.all_tags"}}</span>- </LinkTo>- </li>+import { LinkTo } from "@ember/routing";+import RouteTemplate from "ember-route-template";+import MessagesSecondaryNav from "discourse/components/user-nav/messages-secondary-nav";+import icon from "discourse/helpers/d-icon";+import { i18n } from "discourse-i18n";- {{#if this.tagName}}- <li class="archive">- <LinkTo @route="userPrivateMessages.tags.show" @model={{this.tagName}}>- {{this.tagName}}- </LinkTo>- </li>- {{/if}}-</UserNav::MessagesSecondaryNav>+export default RouteTemplate(+ <template>+ <MessagesSecondaryNav>+ <li class="tags">+ <LinkTo @route="userPrivateMessages.tags.index">+ {{icon "tag"}}+ <span>{{i18n "user.messages.all_tags"}}</span>+ </LinkTo>+ </li>-{{outlet}}\ No newline at end of file+ {{#if @controller.tagName}}+ <li class="archive">+ <LinkTo+ @route="userPrivateMessages.tags.show"+ @model={{@controller.tagName}}+ >+ {{@controller.tagName}}+ </LinkTo>+ </li>+ {{/if}}+ </MessagesSecondaryNav>++ {{outlet}}+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/user-private-messages-user.gjs b/app/assets/javascripts/discourse/app/templates/user-private-messages-user.gjsindex 1fefc8319dc..6074039b57e 100644--- a/app/assets/javascripts/discourse/app/templates/user-private-messages-user.gjs+++ b/app/assets/javascripts/discourse/app/templates/user-private-messages-user.gjs@@ -1,58 +1,69 @@-{{#if this.showWarningsWarning}}- <div class="alert alert-info">{{html-safe- (i18n "admin.user.warnings_list_warning")- }}</div>-{{/if}}--<UserNav::MessagesSecondaryNav>- <DNavigationItem- @route="userPrivateMessages.user.index"- @ariaCurrentContext="subNav"- class="user-nav__messages-latest"- >- {{d-icon "envelope"}}- <span>{{i18n "categories.latest"}}</span>- </DNavigationItem>-- <DNavigationItem- @route="userPrivateMessages.user.sent"- @ariaCurrentContext="subNav"- class="user-nav__messages-sent"- >- {{d-icon "reply"}}- <span>{{i18n "user.messages.sent"}}</span>- </DNavigationItem>-- {{#if this.viewingSelf}}- <DNavigationItem- @route="userPrivateMessages.user.new"- @ariaCurrentContext="subNav"- class="user-nav__messages-new"- >- {{d-icon "circle-exclamation"}}- <span>{{this.newLinkText}}</span>- </DNavigationItem>-- <DNavigationItem- @route="userPrivateMessages.user.unread"- @ariaCurrentContext="subNav"- class="user-nav__messages-unread"- >- {{d-icon "circle-plus"}}- <span>{{this.unreadLinkText}}</span>- </DNavigationItem>-- {{/if}}-- <DNavigationItem- @route="userPrivateMessages.user.archive"- @ariaCurrentContext="subNav"- class="user-nav__messages-archive"- >- {{d-icon "box-archive"}}- <span>{{i18n "user.messages.archive"}}</span>- </DNavigationItem>--</UserNav::MessagesSecondaryNav>--{{outlet}}\ No newline at end of file+import { htmlSafe } from "@ember/template";+import RouteTemplate from "ember-route-template";+import DNavigationItem from "discourse/components/d-navigation-item";+import MessagesSecondaryNav from "discourse/components/user-nav/messages-secondary-nav";+import icon from "discourse/helpers/d-icon";+import { i18n } from "discourse-i18n";++export default RouteTemplate(+ <template>+ {{#if @controller.showWarningsWarning}}+ <div class="alert alert-info">{{htmlSafe+ (i18n "admin.user.warnings_list_warning")+ }}</div>+ {{/if}}++ <MessagesSecondaryNav>+ <DNavigationItem+ @route="userPrivateMessages.user.index"+ @ariaCurrentContext="subNav"+ class="user-nav__messages-latest"+ >+ {{icon "envelope"}}+ <span>{{i18n "categories.latest"}}</span>+ </DNavigationItem>++ <DNavigationItem+ @route="userPrivateMessages.user.sent"+ @ariaCurrentContext="subNav"+ class="user-nav__messages-sent"+ >+ {{icon "reply"}}+ <span>{{i18n "user.messages.sent"}}</span>+ </DNavigationItem>++ {{#if @controller.viewingSelf}}+ <DNavigationItem+ @route="userPrivateMessages.user.new"+ @ariaCurrentContext="subNav"+ class="user-nav__messages-new"+ >+ {{icon "circle-exclamation"}}+ <span>{{@controller.newLinkText}}</span>+ </DNavigationItem>++ <DNavigationItem+ @route="userPrivateMessages.user.unread"+ @ariaCurrentContext="subNav"+ class="user-nav__messages-unread"+ >+ {{icon "circle-plus"}}+ <span>{{@controller.unreadLinkText}}</span>+ </DNavigationItem>++ {{/if}}++ <DNavigationItem+ @route="userPrivateMessages.user.archive"+ @ariaCurrentContext="subNav"+ class="user-nav__messages-archive"+ >+ {{icon "box-archive"}}+ <span>{{i18n "user.messages.archive"}}</span>+ </DNavigationItem>++ </MessagesSecondaryNav>++ {{outlet}}+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/user-topics-list.gjs b/app/assets/javascripts/discourse/app/templates/user-topics-list.gjsindex 4c27fa277af..737c9268fc9 100644--- a/app/assets/javascripts/discourse/app/templates/user-topics-list.gjs+++ b/app/assets/javascripts/discourse/app/templates/user-topics-list.gjs@@ -1,77 +1,99 @@-{{#if this.model.canLoadMore}}- {{hide-application-footer}}-{{/if}}+import { on } from "@ember/modifier";+import RouteTemplate from "ember-route-template";+import { or } from "truth-helpers";+import BasicTopicList from "discourse/components/basic-topic-list";+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";+import CountI18n from "discourse/components/count-i18n";+import EmptyState from "discourse/components/empty-state";+import LoadMore from "discourse/components/load-more";+import TopicDismissButtons from "discourse/components/topic-dismiss-buttons";+import hideApplicationFooter from "discourse/helpers/hide-application-footer";+import loadingSpinner from "discourse/helpers/loading-spinner";+import routeAction from "discourse/helpers/route-action";-{{#if this.noContent}}- <EmptyState- @title={{this.model.emptyState.title}}- @body={{this.model.emptyState.body}}- />-{{else}}- <LoadMore- @selector=".paginated-topics-list .topic-list .topic-list-item"- @action={{action "loadMore"}}- class="paginated-topics-list"- >- <TopicDismissButtons- @position="top"- @selectedTopics={{this.bulkSelectHelper.selected}}- @model={{this.model}}- @showResetNew={{this.showResetNew}}- @showDismissRead={{this.showDismissRead}}- @resetNew={{action "resetNew"}}- @dismissRead={{if- this.showDismissRead- (route-action "dismissReadTopics")- }}- />-- {{#if (or this.model.loadingBefore this.incomingCount)}}- <div class="show-mores">- <a- tabindex="0"- href- {{on "click" this.showInserted}}- class="alert alert-info clickable- {{if this.model.loadingBefore 'loading'}}"- >- <CountI18n- @key="topic_count_latest"- @count={{or this.model.loadingBefore this.incomingCount}}- />- {{#if @model.loadingBefore}}- {{loading-spinner size="small"}}- {{/if}}- </a>- </div>+export default RouteTemplate(+ <template>+ {{#if @controller.model.canLoadMore}}+ {{hideApplicationFooter}}{{/if}}- <BasicTopicList- @topicList={{this.model}}- @hideCategory={{this.hideCategory}}- @showPosters={{this.showPosters}}- @tagsForUser={{this.tagsForUser}}- @canBulkSelect={{this.canBulkSelect}}- @bulkSelectHelper={{this.bulkSelectHelper}}- @changeSort={{this.changeSort}}- @order={{this.order}}- @ascending={{this.ascending}}- @focusLastVisitedTopic={{true}}- />+ {{#if @controller.noContent}}+ <EmptyState+ @title={{@controller.model.emptyState.title}}+ @body={{@controller.model.emptyState.body}}+ />+ {{else}}+ <LoadMore+ @selector=".paginated-topics-list .topic-list .topic-list-item"+ @action={{@controller.loadMore}}+ class="paginated-topics-list"+ >+ <TopicDismissButtons+ @position="top"+ @selectedTopics={{@controller.bulkSelectHelper.selected}}+ @model={{@controller.model}}+ @showResetNew={{@controller.showResetNew}}+ @showDismissRead={{@controller.showDismissRead}}+ @resetNew={{@controller.resetNew}}+ @dismissRead={{if+ @controller.showDismissRead+ (routeAction "dismissReadTopics")+ }}+ />++ {{#if (or @controller.model.loadingBefore @controller.incomingCount)}}+ <div class="show-mores">+ <a+ tabindex="0"+ href+ {{on "click" @controller.showInserted}}+ class="alert alert-info clickable+ {{if @controller.model.loadingBefore 'loading'}}"+ >+ <CountI18n+ @key="topic_count_latest"+ @count={{or+ @controller.model.loadingBefore+ @controller.incomingCount+ }}+ />+ {{#if @model.loadingBefore}}+ {{loadingSpinner size="small"}}+ {{/if}}+ </a>+ </div>+ {{/if}}- <TopicDismissButtons- @position="bottom"- @selectedTopics={{this.bulkSelectHelper.selected}}- @model={{this.model}}- @showResetNew={{this.showResetNew}}- @showDismissRead={{this.showDismissRead}}- @resetNew={{action "resetNew"}}- @dismissRead={{if- this.showDismissRead- (route-action "dismissReadTopics")- }}- />+ <BasicTopicList+ @topicList={{@controller.model}}+ @hideCategory={{@controller.hideCategory}}+ @showPosters={{@controller.showPosters}}+ @tagsForUser={{@controller.tagsForUser}}+ @canBulkSelect={{@controller.canBulkSelect}}+ @bulkSelectHelper={{@controller.bulkSelectHelper}}+ @changeSort={{@controller.changeSort}}+ @order={{@controller.order}}+ @ascending={{@controller.ascending}}+ @focusLastVisitedTopic={{true}}+ />- <ConditionalLoadingSpinner @condition={{this.model.loadingMore}} />- </LoadMore>-{{/if}}\ No newline at end of file+ <TopicDismissButtons+ @position="bottom"+ @selectedTopics={{@controller.bulkSelectHelper.selected}}+ @model={{@controller.model}}+ @showResetNew={{@controller.showResetNew}}+ @showDismissRead={{@controller.showDismissRead}}+ @resetNew={{@controller.resetNew}}+ @dismissRead={{if+ @controller.showDismissRead+ (routeAction "dismissReadTopics")+ }}+ />++ <ConditionalLoadingSpinner+ @condition={{@controller.model.loadingMore}}+ />+ </LoadMore>+ {{/if}}+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/user/activity.gjs b/app/assets/javascripts/discourse/app/templates/user/activity.gjsindex ae2375d1643..155d37e3a90 100644--- a/app/assets/javascripts/discourse/app/templates/user/activity.gjs+++ b/app/assets/javascripts/discourse/app/templates/user/activity.gjs@@ -1,95 +1,109 @@-{{body-class "user-activity-page"}}-<PluginOutlet @name="user-activity-navigation-wrapper">- <div class="user-navigation user-navigation-secondary">- <HorizontalOverflowNav @ariaLabel="User secondary - activity">- <DNavigationItem- @route="userActivity.index"- @ariaCurrentContext="subNav"- class="user-nav__activity-all"- >- {{d-icon "bars-staggered"}}- <span>{{i18n "user.filters.all"}}</span>- </DNavigationItem>+import { hash } from "@ember/helper";+import RouteTemplate from "ember-route-template";+import { gt } from "truth-helpers";+import DNavigationItem from "discourse/components/d-navigation-item";+import HorizontalOverflowNav from "discourse/components/horizontal-overflow-nav";+import PluginOutlet from "discourse/components/plugin-outlet";+import bodyClass from "discourse/helpers/body-class";+import icon from "discourse/helpers/d-icon";+import { i18n } from "discourse-i18n";- <DNavigationItem- @route="userActivity.topics"- @ariaCurrentContext="subNav"- class="user-nav__activity-topics"- >- {{d-icon "list-ul"}}- <span>{{i18n "user_action_groups.4"}}</span>- </DNavigationItem>- <DNavigationItem- @route="userActivity.replies"- @ariaCurrentContext="subNav"- class="user-nav__activity-replies"- >- {{d-icon "reply"}}- <span>{{i18n "user_action_groups.5"}}</span>- </DNavigationItem>+export default RouteTemplate(+ <template>+ {{bodyClass "user-activity-page"}}+ <PluginOutlet @name="user-activity-navigation-wrapper">+ <div class="user-navigation user-navigation-secondary">+ <HorizontalOverflowNav @ariaLabel="User secondary - activity">+ <DNavigationItem+ @route="userActivity.index"+ @ariaCurrentContext="subNav"+ class="user-nav__activity-all"+ >+ {{icon "bars-staggered"}}+ <span>{{i18n "user.filters.all"}}</span>+ </DNavigationItem>- {{#if this.user.showRead}}- <DNavigationItem- @route="userActivity.read"- @ariaCurrentContext="subNav"- class="user-nav__activity-read"- title={{i18n "user.read_help"}}- >- {{d-icon "clock-rotate-left"}}- <span>{{i18n "user.read"}}</span>- </DNavigationItem>- {{/if}}+ <DNavigationItem+ @route="userActivity.topics"+ @ariaCurrentContext="subNav"+ class="user-nav__activity-topics"+ >+ {{icon "list-ul"}}+ <span>{{i18n "user_action_groups.4"}}</span>+ </DNavigationItem>+ <DNavigationItem+ @route="userActivity.replies"+ @ariaCurrentContext="subNav"+ class="user-nav__activity-replies"+ >+ {{icon "reply"}}+ <span>{{i18n "user_action_groups.5"}}</span>+ </DNavigationItem>- {{#if this.user.showDrafts}}- <DNavigationItem- @route="userActivity.drafts"- @ariaCurrentContext="subNav"- class="user-nav__activity-drafts"- >- {{d-icon "pencil"}}- <span>{{this.draftLabel}}</span>- </DNavigationItem>- {{/if}}+ {{#if @controller.user.showRead}}+ <DNavigationItem+ @route="userActivity.read"+ @ariaCurrentContext="subNav"+ class="user-nav__activity-read"+ title={{i18n "user.read_help"}}+ >+ {{icon "clock-rotate-left"}}+ <span>{{i18n "user.read"}}</span>+ </DNavigationItem>+ {{/if}}- {{#if (gt this.model.pending_posts_count 0)}}- <DNavigationItem- @route="userActivity.pending"- @ariaCurrentContext="subNav"- class="user-nav__activity-pending"- >- {{d-icon "clock"}}- <span>{{this.pendingLabel}}</span>- </DNavigationItem>- {{/if}}+ {{#if @controller.user.showDrafts}}+ <DNavigationItem+ @route="userActivity.drafts"+ @ariaCurrentContext="subNav"+ class="user-nav__activity-drafts"+ >+ {{icon "pencil"}}+ <span>{{@controller.draftLabel}}</span>+ </DNavigationItem>+ {{/if}}- <DNavigationItem- @route="userActivity.likesGiven"- @ariaCurrentContext="subNav"- class="user-nav__activity-likes"- >- {{d-icon "heart"}}- <span>{{i18n "user_action_groups.1"}}</span>- </DNavigationItem>+ {{#if (gt @controller.model.pending_posts_count 0)}}+ <DNavigationItem+ @route="userActivity.pending"+ @ariaCurrentContext="subNav"+ class="user-nav__activity-pending"+ >+ {{icon "clock"}}+ <span>{{@controller.pendingLabel}}</span>+ </DNavigationItem>+ {{/if}}- {{#if this.user.showBookmarks}}- <DNavigationItem- @route="userActivity.bookmarks"- @ariaCurrentContext="subNav"- class="user-nav__activity-bookmarks"- >- {{d-icon "bookmark"}}- <span>{{i18n "user_action_groups.3"}}</span>- </DNavigationItem>- {{/if}}+ <DNavigationItem+ @route="userActivity.likesGiven"+ @ariaCurrentContext="subNav"+ class="user-nav__activity-likes"+ >+ {{icon "heart"}}+ <span>{{i18n "user_action_groups.1"}}</span>+ </DNavigationItem>- <PluginOutlet- @name="user-activity-bottom"- @connectorTagName="li"- @outletArgs={{hash model=this.model}}- />- </HorizontalOverflowNav>- </div>-</PluginOutlet>-<section class="user-content" id="user-content">- {{outlet}}-</section>\ No newline at end of file+ {{#if @controller.user.showBookmarks}}+ <DNavigationItem+ @route="userActivity.bookmarks"+ @ariaCurrentContext="subNav"+ class="user-nav__activity-bookmarks"+ >+ {{icon "bookmark"}}+ <span>{{i18n "user_action_groups.3"}}</span>+ </DNavigationItem>+ {{/if}}++ <PluginOutlet+ @name="user-activity-bottom"+ @connectorTagName="li"+ @outletArgs={{hash [email protected]}}+ />+ </HorizontalOverflowNav>+ </div>+ </PluginOutlet>+ <section class="user-content" id="user-content">+ {{outlet}}+ </section>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/user/badges.gjs b/app/assets/javascripts/discourse/app/templates/user/badges.gjsindex c24c32ad1a3..c13ed5236dd 100644--- a/app/assets/javascripts/discourse/app/templates/user/badges.gjs+++ b/app/assets/javascripts/discourse/app/templates/user/badges.gjs@@ -1,43 +1,54 @@-{{body-class "user-badges-page"}}+import { fn, hash } from "@ember/helper";+import RouteTemplate from "ember-route-template";+import BadgeCard from "discourse/components/badge-card";+import PluginOutlet from "discourse/components/plugin-outlet";+import bodyClass from "discourse/helpers/body-class";+import { i18n } from "discourse-i18n";-<section class="user-content" id="user-content">- <PluginOutlet- @name="user-badges-content"- @outletArgs={{hash- sortedBadges=this.sortedBadges- maxFavBadges=this.siteSettings.max_favorite_badges- favoriteBadges=this.favoriteBadges- canFavoriteMoreBadges=this.canFavoriteMoreBadges- favorite=this.favorite- }}- >- {{#if this.siteSettings.max_favorite_badges}}- <p class="favorite-count">- {{i18n- "badges.favorite_count"- count=this.favoriteBadges.length- max=this.siteSettings.max_favorite_badges- }}- </p>- {{/if}}+export default RouteTemplate(+ <template>+ {{bodyClass "user-badges-page"}}- <div class="badge-group-list">- {{#each this.sortedBadges as |ub|}}- <BadgeCard- @badge={{ub.badge}}- @count={{ub.count}}- @canFavorite={{ub.can_favorite}}- @isFavorite={{ub.is_favorite}}- @username={{this.username}}- @canFavoriteMoreBadges={{this.canFavoriteMoreBadges}}- @onFavoriteClick={{action "favorite" ub}}- @filterUser="true"- />- {{/each}}+ <section class="user-content" id="user-content"><PluginOutlet- @name="after-user-profile-badges"- @outletArgs={{hash user=this.user.model}}- />- </div>- </PluginOutlet>-</section>\ No newline at end of file+ @name="user-badges-content"+ @outletArgs={{hash+ [email protected]_favorite_badges+ }}+ >+ {{#if @controller.siteSettings.max_favorite_badges}}+ <p class="favorite-count">+ {{i18n+ "badges.favorite_count"+ [email protected]_favorite_badges+ }}+ </p>+ {{/if}}++ <div class="badge-group-list">+ {{#each @controller.sortedBadges as |ub|}}+ <BadgeCard+ @badge={{ub.badge}}+ @count={{ub.count}}+ @canFavorite={{ub.can_favorite}}+ @isFavorite={{ub.is_favorite}}+ @username={{@controller.username}}+ @canFavoriteMoreBadges={{@controller.canFavoriteMoreBadges}}+ @onFavoriteClick={{fn @controller.favorite ub}}+ @filterUser="true"+ />+ {{/each}}+ <PluginOutlet+ @name="after-user-profile-badges"+ @outletArgs={{hash [email protected]}}+ />+ </div>+ </PluginOutlet>+ </section>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/user/bookmarks.gjs b/app/assets/javascripts/discourse/app/templates/user/bookmarks.gjsindex ad6fd9208fd..073bc526520 100644--- a/app/assets/javascripts/discourse/app/templates/user/bookmarks.gjs+++ b/app/assets/javascripts/discourse/app/templates/user/bookmarks.gjs@@ -1,43 +1,59 @@-{{body-class "user-activity-bookmarks-page"}}+import { Input } from "@ember/component";+import RouteTemplate from "ember-route-template";+import BookmarkList from "discourse/components/bookmark-list";+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";+import DButton from "discourse/components/d-button";+import EmptyState from "discourse/components/empty-state";+import PluginOutlet from "discourse/components/plugin-outlet";+import bodyClass from "discourse/helpers/body-class";+import { i18n } from "discourse-i18n";-<ConditionalLoadingSpinner @condition={{this.loading}}>- <PluginOutlet @name="above-user-bookmarks" @connectorTagName="div" />+export default RouteTemplate(+ <template>+ {{bodyClass "user-activity-bookmarks-page"}}- {{#if this.permissionDenied}}- <div class="alert alert-info">{{i18n- "bookmarks.list_permission_denied"- }}</div>- {{else if this.userDoesNotHaveBookmarks}}- <EmptyState- @title={{i18n "user.no_bookmarks_title"}}- @body={{this.emptyStateBody}}- />- {{else}}- <div class="inline-form full-width bookmark-search-form">- <Input- @type="text"- @value={{this.searchTerm}}- placeholder={{i18n "bookmarks.search_placeholder"}}- @enter={{this.search}}- id="bookmark-search"- autocomplete="off"- />- <DButton- @action={{this.search}}- @icon="magnifying-glass"- class="btn-primary"- />- </div>- {{#if this.nothingFound}}- <div class="alert alert-info">{{i18n "user.no_bookmarks_search"}}</div>- {{else}}- <BookmarkList- @bulkSelectHelper={{this.bulkSelectHelper}}- @loadMore={{action "loadMore"}}- @reload={{action "reload"}}- @loadingMore={{this.loadingMore}}- @content={{this.model.bookmarks}}- />- {{/if}}- {{/if}}-</ConditionalLoadingSpinner>\ No newline at end of file+ <ConditionalLoadingSpinner @condition={{@controller.loading}}>+ <PluginOutlet @name="above-user-bookmarks" @connectorTagName="div" />++ {{#if @controller.permissionDenied}}+ <div class="alert alert-info">{{i18n+ "bookmarks.list_permission_denied"+ }}</div>+ {{else if @controller.userDoesNotHaveBookmarks}}+ <EmptyState+ @title={{i18n "user.no_bookmarks_title"}}+ @body={{@controller.emptyStateBody}}+ />+ {{else}}+ <div class="inline-form full-width bookmark-search-form">+ <Input+ @type="text"+ @value={{@controller.searchTerm}}+ placeholder={{i18n "bookmarks.search_placeholder"}}+ @enter={{@controller.search}}+ id="bookmark-search"+ autocomplete="off"+ />+ <DButton+ @action={{@controller.search}}+ @icon="magnifying-glass"+ class="btn-primary"+ />+ </div>+ {{#if @controller.nothingFound}}+ <div class="alert alert-info">{{i18n+ "user.no_bookmarks_search"+ }}</div>+ {{else}}+ <BookmarkList+ @bulkSelectHelper={{@controller.bulkSelectHelper}}+ @loadMore={{@controller.loadMore}}+ @reload={{@controller.reload}}+ @loadingMore={{@controller.loadingMore}}+ @content={{@controller.model.bookmarks}}+ />+ {{/if}}+ {{/if}}+ </ConditionalLoadingSpinner>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/user/messages.gjs b/app/assets/javascripts/discourse/app/templates/user/messages.gjsindex 8a8d11ac17f..0293de985f5 100644--- a/app/assets/javascripts/discourse/app/templates/user/messages.gjs+++ b/app/assets/javascripts/discourse/app/templates/user/messages.gjs@@ -1,51 +1,67 @@-{{body-class "user-messages-page"}}--<PluginOutlet- @name="user-messages-above-navigation"- @outletArgs={{hash model=this.model}}-/>--<div class="user-navigation user-navigation-secondary">- <ol class="category-breadcrumb">- <li>- <UserNav::MessagesDropdown- @content={{this.messagesDropdownContent}}- @value={{this.messagesDropdownValue}}- @onChange={{this.onMessagesDropdownChange}}- />- </li>- </ol>-- <HorizontalOverflowNav- @ariaLabel="User secondary - messages"- id="user-navigation-secondary__horizontal-nav"- class="messages-nav"- />-- <div class="navigation-controls">- {{#if this.site.mobileView}}- {{#if this.currentUser.admin}}- <BulkSelectToggle @bulkSelectHelper={{this.bulkSelectHelper}} />- {{/if}}- {{/if}}-- <span id="navigation-controls__button"></span>-- {{#if this.showNewPM}}- <DButton- @action={{route-action "composePrivateMessage"}}- @icon="envelope"- @label="user.new_private_message"- class="btn-primary new-private-message"- />- {{/if}}+import { hash } from "@ember/helper";+import RouteTemplate from "ember-route-template";+import BulkSelectToggle from "discourse/components/bulk-select-toggle";+import DButton from "discourse/components/d-button";+import HorizontalOverflowNav from "discourse/components/horizontal-overflow-nav";+import PluginOutlet from "discourse/components/plugin-outlet";+import MessagesDropdown from "discourse/components/user-nav/messages-dropdown";+import bodyClass from "discourse/helpers/body-class";+import routeAction from "discourse/helpers/route-action";++export default RouteTemplate(+ <template>+ {{bodyClass "user-messages-page"}}+<PluginOutlet- @name="user-messages-controls-bottom"- @outletArgs={{hash showNewPM=this.showNewPM}}+ @name="user-messages-above-navigation"+ @outletArgs={{hash [email protected]}}/>- </div>-</div>-<section class="user-content" id="user-content">- {{outlet}}-</section>\ No newline at end of file+ <div class="user-navigation user-navigation-secondary">+ <ol class="category-breadcrumb">+ <li>+ <MessagesDropdown+ @content={{@controller.messagesDropdownContent}}+ @value={{@controller.messagesDropdownValue}}+ @onChange={{@controller.onMessagesDropdownChange}}+ />+ </li>+ </ol>++ <HorizontalOverflowNav+ @ariaLabel="User secondary - messages"+ id="user-navigation-secondary__horizontal-nav"+ class="messages-nav"+ />++ <div class="navigation-controls">+ {{#if @controller.site.mobileView}}+ {{#if @controller.currentUser.admin}}+ <BulkSelectToggle+ @bulkSelectHelper={{@controller.bulkSelectHelper}}+ />+ {{/if}}+ {{/if}}++ <span id="navigation-controls__button"></span>++ {{#if @controller.showNewPM}}+ <DButton+ @action={{routeAction "composePrivateMessage"}}+ @icon="envelope"+ @label="user.new_private_message"+ class="btn-primary new-private-message"+ />+ {{/if}}+ <PluginOutlet+ @name="user-messages-controls-bottom"+ @outletArgs={{hash [email protected]}}+ />+ </div>+ </div>++ <section class="user-content" id="user-content">+ {{outlet}}+ </section>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/user/notifications.gjs b/app/assets/javascripts/discourse/app/templates/user/notifications.gjsindex f46d401df98..9baf0d841a6 100644--- a/app/assets/javascripts/discourse/app/templates/user/notifications.gjs+++ b/app/assets/javascripts/discourse/app/templates/user/notifications.gjs@@ -1,96 +1,115 @@-{{#if this.model.canLoadMore}}- {{hide-application-footer}}-{{/if}}+import { hash } from "@ember/helper";+import RouteTemplate from "ember-route-template";+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";+import DButton from "discourse/components/d-button";+import DNavigationItem from "discourse/components/d-navigation-item";+import HorizontalOverflowNav from "discourse/components/horizontal-overflow-nav";+import LoadMore from "discourse/components/load-more";+import PluginOutlet from "discourse/components/plugin-outlet";+import bodyClass from "discourse/helpers/body-class";+import icon from "discourse/helpers/d-icon";+import hideApplicationFooter from "discourse/helpers/hide-application-footer";+import { i18n } from "discourse-i18n";-{{body-class "user-notifications-page"}}+export default RouteTemplate(+ <template>+ {{#if @controller.model.canLoadMore}}+ {{hideApplicationFooter}}+ {{/if}}-<div class="user-navigation user-navigation-secondary">- <HorizontalOverflowNav @ariaLabel="User secondary - notifications">- <DNavigationItem- @route="userNotifications.index"- @ariaCurrentContext="subNav"- class="user-nav__notifications-all"- >- {{d-icon "bell"}}- <span>{{i18n "user.filters.all"}}</span>- </DNavigationItem>+ {{bodyClass "user-notifications-page"}}- <DNavigationItem- @route="userNotifications.responses"- @ariaCurrentContext="subNav"- class="user-nav__notifications-responses"- >- {{d-icon "reply"}}- <span>{{i18n "user_action_groups.5"}}</span>- </DNavigationItem>+ <div class="user-navigation user-navigation-secondary">+ <HorizontalOverflowNav @ariaLabel="User secondary - notifications">+ <DNavigationItem+ @route="userNotifications.index"+ @ariaCurrentContext="subNav"+ class="user-nav__notifications-all"+ >+ {{icon "bell"}}+ <span>{{i18n "user.filters.all"}}</span>+ </DNavigationItem>- <DNavigationItem- @route="userNotifications.likesReceived"- @ariaCurrentContext="subNav"- class="user-nav__notifications-likes"- >- {{d-icon "heart"}}- <span>{{i18n "user_action_groups.2"}}</span>- </DNavigationItem>+ <DNavigationItem+ @route="userNotifications.responses"+ @ariaCurrentContext="subNav"+ class="user-nav__notifications-responses"+ >+ {{icon "reply"}}+ <span>{{i18n "user_action_groups.5"}}</span>+ </DNavigationItem>- {{#if this.siteSettings.enable_mentions}}- <DNavigationItem- @route="userNotifications.mentions"- @ariaCurrentContext="subNav"- class="user-nav__notifications-mentions"- >- {{d-icon "at"}}- <span>{{i18n "user_action_groups.7"}}</span>- </DNavigationItem>- {{/if}}+ <DNavigationItem+ @route="userNotifications.likesReceived"+ @ariaCurrentContext="subNav"+ class="user-nav__notifications-likes"+ >+ {{icon "heart"}}+ <span>{{i18n "user_action_groups.2"}}</span>+ </DNavigationItem>- <DNavigationItem- @route="userNotifications.edits"- @ariaCurrentContext="subNav"- class="user-nav__notifications-edits"- >- {{d-icon "pencil"}}- <span>{{i18n "user_action_groups.11"}}</span>- </DNavigationItem>+ {{#if @controller.siteSettings.enable_mentions}}+ <DNavigationItem+ @route="userNotifications.mentions"+ @ariaCurrentContext="subNav"+ class="user-nav__notifications-mentions"+ >+ {{icon "at"}}+ <span>{{i18n "user_action_groups.7"}}</span>+ </DNavigationItem>+ {{/if}}- <DNavigationItem- @route="userNotifications.links"- @ariaCurrentContext="subNav"- class="user-nav__notifications-links"- >- {{d-icon "link"}}- <span>{{i18n "user_action_groups.17"}}</span>- </DNavigationItem>+ <DNavigationItem+ @route="userNotifications.edits"+ @ariaCurrentContext="subNav"+ class="user-nav__notifications-edits"+ >+ {{icon "pencil"}}+ <span>{{i18n "user_action_groups.11"}}</span>+ </DNavigationItem>- <PluginOutlet- @name="user-notifications-bottom"- @connectorTagName="li"- @outletArgs={{hash model=this.model}}- />+ <DNavigationItem+ @route="userNotifications.links"+ @ariaCurrentContext="subNav"+ class="user-nav__notifications-links"+ >+ {{icon "link"}}+ <span>{{i18n "user_action_groups.17"}}</span>+ </DNavigationItem>- </HorizontalOverflowNav>+ <PluginOutlet+ @name="user-notifications-bottom"+ @connectorTagName="li"+ @outletArgs={{hash [email protected]}}+ />- {{#if this.model}}- <div class="navigation-controls">- <DButton- @title="user.dismiss_notifications_tooltip"- @action={{action "resetNew"}}- @label="user.dismiss_notifications"- @icon="check"- @disabled={{this.allNotificationsRead}}- class="btn-default dismiss-notifications"- />+ </HorizontalOverflowNav>++ {{#if @controller.model}}+ <div class="navigation-controls">+ <DButton+ @title="user.dismiss_notifications_tooltip"+ @action={{@controller.resetNew}}+ @label="user.dismiss_notifications"+ @icon="check"+ @disabled={{@controller.allNotificationsRead}}+ class="btn-default dismiss-notifications"+ />+ </div>+ {{/if}}</div>- {{/if}}-</div>-<section class="user-content" id="user-content">- <LoadMore- @selector=".user-stream .notification"- @action={{action "loadMore"}}- class="notification-history user-stream"- >- {{outlet}}- <ConditionalLoadingSpinner @condition={{this.model.loadingMore}} />- </LoadMore>-</section>\ No newline at end of file+ <section class="user-content" id="user-content">+ <LoadMore+ @selector=".user-stream .notification"+ @action={{@controller.loadMore}}+ class="notification-history user-stream"+ >+ {{outlet}}+ <ConditionalLoadingSpinner+ @condition={{@controller.model.loadingMore}}+ />+ </LoadMore>+ </section>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/user/posts.gjs b/app/assets/javascripts/discourse/app/templates/user/posts.gjsindex 5068aff9f17..7a47f227f78 100644--- a/app/assets/javascripts/discourse/app/templates/user/posts.gjs+++ b/app/assets/javascripts/discourse/app/templates/user/posts.gjs@@ -1 +1,6 @@-<UserStream @stream={{this.model}} />\ No newline at end of file+import RouteTemplate from "ember-route-template";+import UserStream from "discourse/components/user-stream";++export default RouteTemplate(+ <template><UserStream @stream={{@controller.model}} /></template>+);diff --git a/app/assets/javascripts/discourse/app/templates/user/profile-hidden.gjs b/app/assets/javascripts/discourse/app/templates/user/profile-hidden.gjsindex 9e53099d0ff..08bf58cbb2b 100644--- a/app/assets/javascripts/discourse/app/templates/user/profile-hidden.gjs+++ b/app/assets/javascripts/discourse/app/templates/user/profile-hidden.gjs@@ -1 +1,8 @@-<p class="user-profile-hidden">{{i18n "user.profile_hidden"}}</p>\ No newline at end of file+import RouteTemplate from "ember-route-template";+import { i18n } from "discourse-i18n";++export default RouteTemplate(+ <template>+ <p class="user-profile-hidden">{{i18n "user.profile_hidden"}}</p>+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/user/stream.gjs b/app/assets/javascripts/discourse/app/templates/user/stream.gjsindex c035790268d..bf3cc8b3363 100644--- a/app/assets/javascripts/discourse/app/templates/user/stream.gjs+++ b/app/assets/javascripts/discourse/app/templates/user/stream.gjs@@ -1,8 +1,16 @@-{{#if this.model.stream.noContent}}- <EmptyState- @title={{this.model.emptyState.title}}- @body={{this.model.emptyState.body}}- />-{{/if}}+import RouteTemplate from "ember-route-template";+import EmptyState from "discourse/components/empty-state";+import UserStream from "discourse/components/user-stream";-<UserStream @stream={{this.model.stream}} />\ No newline at end of file+export default RouteTemplate(+ <template>+ {{#if @controller.model.stream.noContent}}+ <EmptyState+ @title={{@controller.model.emptyState.title}}+ @body={{@controller.model.emptyState.body}}+ />+ {{/if}}++ <UserStream @stream={{@controller.model.stream}} />+ </template>+);diff --git a/app/assets/javascripts/discourse/app/templates/user/summary.gjs b/app/assets/javascripts/discourse/app/templates/user/summary.gjsindex 58acce735e4..049a6e87fef 100644--- a/app/assets/javascripts/discourse/app/templates/user/summary.gjs+++ b/app/assets/javascripts/discourse/app/templates/user/summary.gjs@@ -1,338 +1,380 @@-{{body-class "user-summary-page"}}+import { hash } from "@ember/helper";+import { LinkTo } from "@ember/routing";+import { htmlSafe } from "@ember/template";+import RouteTemplate from "ember-route-template";+import BadgeCard from "discourse/components/badge-card";+import PluginOutlet from "discourse/components/plugin-outlet";+import UserStat from "discourse/components/user-stat";+import UserSummaryCategorySearch from "discourse/components/user-summary-category-search";+import UserSummarySection from "discourse/components/user-summary-section";+import UserSummaryTopic from "discourse/components/user-summary-topic";+import UserSummaryTopicsList from "discourse/components/user-summary-topics-list";+import UserSummaryUser from "discourse/components/user-summary-user";+import UserSummaryUsersList from "discourse/components/user-summary-users-list";+import bodyClass from "discourse/helpers/body-class";+import categoryLink from "discourse/helpers/category-link";+import shortenUrl from "discourse/helpers/shorten-url";+import { i18n } from "discourse-i18n";-<div class="user-content" id="user-content">- <PluginOutlet- @name="above-user-summary-stats"- @outletArgs={{hash model=this.model user=this.user}}- />- {{#if this.model.can_see_summary_stats}}- <div class="top-section stats-section">- <h3 class="stats-title">{{i18n "user.summary.stats"}}</h3>- <ul>- <li class="stats-days-visited">- <UserStat- @value={{this.model.days_visited}}- @label="user.summary.days_visited"- />- </li>- <li class="stats-time-read">- <UserStat- @value={{this.timeRead}}- @label="user.summary.time_read"- @rawTitle={{i18n- "user.summary.time_read_title"- duration=this.timeReadMedium- }}- @type="string"- />- </li>- {{#if this.showRecentTimeRead}}- <li class="stats-recent-read">- <UserStat- @value={{this.recentTimeRead}}- @label="user.summary.recent_time_read"- @rawTitle={{i18n- "user.summary.recent_time_read_title"- duration=this.recentTimeReadMedium- }}- @type="string"- />- </li>- {{/if}}- <li class="stats-topics-entered">- <UserStat- @value={{this.model.topics_entered}}- @label="user.summary.topics_entered"- />- </li>- <li class="stats-posts-read">- <UserStat- @value={{this.model.posts_read_count}}- @label="user.summary.posts_read"- />- </li>- {{#if this.model.can_see_user_actions}}- <li class="stats-likes-given linked-stat">- <LinkTo @route="userActivity.likesGiven">+export default RouteTemplate(+ <template>+ {{bodyClass "user-summary-page"}}++ <div class="user-content" id="user-content">+ <PluginOutlet+ @name="above-user-summary-stats"+ @outletArgs={{hash [email protected] [email protected]}}+ />+ {{#if @controller.model.can_see_summary_stats}}+ <div class="top-section stats-section">+ <h3 class="stats-title">{{i18n "user.summary.stats"}}</h3>+ <ul>+ <li class="stats-days-visited"><UserStat- @value={{this.model.likes_given}}- @icon="heart"- @label="user.summary.likes_given"+ @value={{@controller.model.days_visited}}+ @label="user.summary.days_visited"/>- </LinkTo>- </li>- {{else}}- <li class="stats-likes-given">- <UserStat- @value={{this.model.likes_given}}- @icon="heart"- @label="user.summary.likes_given"- />- </li>- {{/if}}- <li class="stats-likes-received">- <UserStat- @value={{this.model.likes_received}}- @icon="heart"- @label="user.summary.likes_received"- />- </li>- {{#if this.model.bookmark_count}}- {{#if this.model.can_see_user_actions}}- <li class="stats-bookmark-count linked-stat">- <LinkTo @route="userActivity.bookmarks">+ </li>+ <li class="stats-time-read">+ <UserStat+ @value={{@controller.timeRead}}+ @label="user.summary.time_read"+ @rawTitle={{i18n+ "user.summary.time_read_title"+ }}+ @type="string"+ />+ </li>+ {{#if @controller.showRecentTimeRead}}+ <li class="stats-recent-read"><UserStat- @value={{this.model.bookmark_count}}- @label="user.summary.bookmark_count"+ @value={{@controller.recentTimeRead}}+ @label="user.summary.recent_time_read"+ @rawTitle={{i18n+ "user.summary.recent_time_read_title"+ }}+ @type="string"/>- </LinkTo>- </li>- {{else}}- <li class="stats-bookmark-count">+ </li>+ {{/if}}+ <li class="stats-topics-entered"><UserStat- @value={{this.model.bookmark_count}}- @label="user.summary.bookmark_count"+ @value={{@controller.model.topics_entered}}+ @label="user.summary.topics_entered"/></li>- {{/if}}- {{/if}}- {{#if this.model.can_see_user_actions}}- <li class="stats-topic-count linked-stat">- <LinkTo @route="userActivity.topics">+ <li class="stats-posts-read"><UserStat- @value={{this.model.topic_count}}- @label="user.summary.topic_count"+ @value={{@controller.model.posts_read_count}}+ @label="user.summary.posts_read"/>- </LinkTo>- </li>- {{else}}- <li class="stats-topic-count">- <UserStat- @value={{this.model.topic_count}}- @label="user.summary.topic_count"- />- </li>- {{/if}}- {{#if this.model.can_see_user_actions}}- <li class="stats-post-count linked-stat">- <LinkTo @route="userActivity.replies">+ </li>+ {{#if @controller.model.can_see_user_actions}}+ <li class="stats-likes-given linked-stat">+ <LinkTo @route="userActivity.likesGiven">+ <UserStat+ @value={{@controller.model.likes_given}}+ @icon="heart"+ @label="user.summary.likes_given"+ />+ </LinkTo>+ </li>+ {{else}}+ <li class="stats-likes-given">+ <UserStat+ @value={{@controller.model.likes_given}}+ @icon="heart"+ @label="user.summary.likes_given"+ />+ </li>+ {{/if}}+ <li class="stats-likes-received"><UserStat- @value={{this.model.post_count}}- @label="user.summary.post_count"+ @value={{@controller.model.likes_received}}+ @icon="heart"+ @label="user.summary.likes_received"/>- </LinkTo>- </li>- {{else}}- <li class="stats-post-count">- <UserStat- @value={{this.model.post_count}}- @label="user.summary.post_count"+ </li>+ {{#if @controller.model.bookmark_count}}+ {{#if @controller.model.can_see_user_actions}}+ <li class="stats-bookmark-count linked-stat">+ <LinkTo @route="userActivity.bookmarks">+ <UserStat+ @value={{@controller.model.bookmark_count}}+ @label="user.summary.bookmark_count"+ />+ </LinkTo>+ </li>+ {{else}}+ <li class="stats-bookmark-count">+ <UserStat+ @value={{@controller.model.bookmark_count}}+ @label="user.summary.bookmark_count"+ />+ </li>+ {{/if}}+ {{/if}}+ {{#if @controller.model.can_see_user_actions}}+ <li class="stats-topic-count linked-stat">+ <LinkTo @route="userActivity.topics">+ <UserStat+ @value={{@controller.model.topic_count}}+ @label="user.summary.topic_count"+ />+ </LinkTo>+ </li>+ {{else}}+ <li class="stats-topic-count">+ <UserStat+ @value={{@controller.model.topic_count}}+ @label="user.summary.topic_count"+ />+ </li>+ {{/if}}+ {{#if @controller.model.can_see_user_actions}}+ <li class="stats-post-count linked-stat">+ <LinkTo @route="userActivity.replies">+ <UserStat+ @value={{@controller.model.post_count}}+ @label="user.summary.post_count"+ />+ </LinkTo>+ </li>+ {{else}}+ <li class="stats-post-count">+ <UserStat+ @value={{@controller.model.post_count}}+ @label="user.summary.post_count"+ />+ </li>+ {{/if}}+ <PluginOutlet+ @name="user-summary-stat"+ @connectorTagName="li"+ @outletArgs={{hash [email protected] [email protected]}}/>- </li>- {{/if}}- <PluginOutlet- @name="user-summary-stat"- @connectorTagName="li"- @outletArgs={{hash model=this.model user=this.user}}- />- </ul>- </div>- {{/if}}+ </ul>+ </div>+ {{/if}}- <PluginOutlet- @name="below-user-summary-stats"- @outletArgs={{hash model=this.model user=this.user}}- />+ <PluginOutlet+ @name="below-user-summary-stats"+ @outletArgs={{hash [email protected] [email protected]}}+ />- <div class="top-section replies-and-topics-section">- <UserSummarySection @title="top_replies" class="replies-section pull-left">- <UserSummaryTopicsList- @type="replies"- @items={{this.model.replies}}- @user={{this.user}}- as |reply|- >- <UserSummaryTopic- @createdAt={{reply.createdAt}}- @topic={{reply.topic}}- @likes={{reply.like_count}}- @url={{reply.url}}- />- </UserSummaryTopicsList>- </UserSummarySection>+ <div class="top-section replies-and-topics-section">+ <UserSummarySection+ @title="top_replies"+ class="replies-section pull-left"+ >+ <UserSummaryTopicsList+ @type="replies"+ @items={{@controller.model.replies}}+ @user={{@controller.user}}+ as |reply|+ >+ <UserSummaryTopic+ @createdAt={{reply.createdAt}}+ @topic={{reply.topic}}+ @likes={{reply.like_count}}+ @url={{reply.url}}+ />+ </UserSummaryTopicsList>+ </UserSummarySection>- <UserSummarySection @title="top_topics" class="topics-section pull-right">- <UserSummaryTopicsList- @type="topics"- @items={{this.model.topics}}- @user={{this.user}}- as |topic|- >- <UserSummaryTopic- @createdAt={{topic.created_at}}- @topic={{topic}}- @likes={{topic.like_count}}- @url={{topic.url}}- />- </UserSummaryTopicsList>- </UserSummarySection>- </div>+ <UserSummarySection+ @title="top_topics"+ class="topics-section pull-right"+ >+ <UserSummaryTopicsList+ @type="topics"+ @items={{@controller.model.topics}}+ @user={{@controller.user}}+ as |topic|+ >+ <UserSummaryTopic+ @createdAt={{topic.created_at}}+ @topic={{topic}}+ @likes={{topic.like_count}}+ @url={{topic.url}}+ />+ </UserSummaryTopicsList>+ </UserSummarySection>+ </div>- <div class="top-section links-and-replied-to-section">- <UserSummarySection @title="top_links" class="links-section pull-left">- {{#if this.model.links.length}}- <ul>- {{#each this.model.links as |link|}}- <li>- {{! template-lint-disable link-rel-noopener }}- <a- class="domain"- href={{link.url}}- title={{link.title}}- rel="noopener {{unless- this.user.removeNoFollow- 'nofollow ugc'- }}"- target="_blank"- data-clicks={{link.clicks}}- aria-label={{i18n "topic_map.clicks" count=link.clicks}}- >- {{shorten-url link.url}}- </a>- {{! template-lint-enable link-rel-noopener }}- <br />+ <div class="top-section links-and-replied-to-section">+ <UserSummarySection @title="top_links" class="links-section pull-left">+ {{#if @controller.model.links.length}}+ <ul>+ {{#each @controller.model.links as |link|}}+ <li>+ {{! template-lint-disable link-rel-noopener }}+ <a+ class="domain"+ href={{link.url}}+ title={{link.title}}+ rel="noopener {{unless+ @controller.user.removeNoFollow+ 'nofollow ugc'+ }}"+ target="_blank"+ data-clicks={{link.clicks}}+ aria-label={{i18n "topic_map.clicks" count=link.clicks}}+ >+ {{shortenUrl link.url}}+ </a>+ {{! template-lint-enable link-rel-noopener }}+ <br />- <a href={{link.post_url}}>- {{html-safe link.topic.fancyTitle}}- </a>- </li>- {{/each}}- </ul>- {{else}}- <p>{{i18n "user.summary.no_links"}}</p>- {{/if}}- </UserSummarySection>+ <a href={{link.post_url}}>+ {{htmlSafe link.topic.fancyTitle}}+ </a>+ </li>+ {{/each}}+ </ul>+ {{else}}+ <p>{{i18n "user.summary.no_links"}}</p>+ {{/if}}+ </UserSummarySection>- <UserSummarySection- @title="most_replied_to_users"- class="summary-user-list replied-section pull-right"- >- <UserSummaryUsersList- @none="no_replies"- @users={{this.model.most_replied_to_users}}- as |user|- >- <UserSummaryUser @user={{user}} @icon="reply" @countClass="replies" />- </UserSummaryUsersList>- </UserSummarySection>- </div>+ <UserSummarySection+ @title="most_replied_to_users"+ class="summary-user-list replied-section pull-right"+ >+ <UserSummaryUsersList+ @none="no_replies"+ @users={{@controller.model.most_replied_to_users}}+ as |user|+ >+ <UserSummaryUser+ @user={{user}}+ @icon="reply"+ @countClass="replies"+ />+ </UserSummaryUsersList>+ </UserSummarySection>+ </div>- <div class="top-section most-liked-section">- <UserSummarySection- @title="most_liked_by"- class="summary-user-list liked-by-section pull-left"- >- <UserSummaryUsersList- @none="no_likes"- @users={{this.model.most_liked_by_users}}- as |user|- >- <UserSummaryUser @user={{user}} @icon="heart" @countClass="likes" />- </UserSummaryUsersList>- </UserSummarySection>+ <div class="top-section most-liked-section">+ <UserSummarySection+ @title="most_liked_by"+ class="summary-user-list liked-by-section pull-left"+ >+ <UserSummaryUsersList+ @none="no_likes"+ @users={{@controller.model.most_liked_by_users}}+ as |user|+ >+ <UserSummaryUser @user={{user}} @icon="heart" @countClass="likes" />+ </UserSummaryUsersList>+ </UserSummarySection>- <UserSummarySection- @title="most_liked_users"- class="summary-user-list liked-section pull-right"- >- <UserSummaryUsersList- @none="no_likes"- @users={{this.model.most_liked_users}}- as |user|- >- <UserSummaryUser @user={{user}} @icon="heart" @countClass="likes" />- </UserSummaryUsersList>- </UserSummarySection>- </div>+ <UserSummarySection+ @title="most_liked_users"+ class="summary-user-list liked-section pull-right"+ >+ <UserSummaryUsersList+ @none="no_likes"+ @users={{@controller.model.most_liked_users}}+ as |user|+ >+ <UserSummaryUser @user={{user}} @icon="heart" @countClass="likes" />+ </UserSummaryUsersList>+ </UserSummarySection>+ </div>- {{#if this.model.top_categories.length}}- <div class="top-section top-categories-section">- <UserSummarySection- @title="top_categories"- class="summary-category-list pull-left"- >- <table>- <thead>- <th class="category-link"></th>- <th class="topic-count">{{i18n "user.summary.topics"}}</th>- <th class="reply-count">{{i18n "user.summary.replies"}}</th>- </thead>- <tbody>- {{#each this.model.top_categories as |category|}}- <tr>- <PluginOutlet- @name="user-summary-top-category-row"- @outletArgs={{hash category=category user=this.user}}- >- <td class="category-link">- {{category-link- category- allowUncategorized="true"- hideParent=false- }}- </td>- <td class="topic-count">- <UserSummaryCategorySearch- @user={{this.user}}- @category={{category}}- @searchOnlyFirstPosts={{true}}- @count={{category.topic_count}}- />- </td>- <td class="reply-count">- <UserSummaryCategorySearch- @user={{this.user}}- @category={{category}}- @searchOnlyFirstPosts={{false}}- @count={{category.post_count}}- />- </td>- </PluginOutlet>- </tr>- {{/each}}- </tbody>- </table>- </UserSummarySection>- </div>- {{/if}}-- {{#if this.siteSettings.enable_badges}}- <div class="top-section badges-section">- <h3 class="stats-title">{{i18n "user.summary.top_badges"}}</h3>-- {{#if this.model.badges}}- <div class="badge-group-list">- {{#each this.model.badges as |badge|}}- <BadgeCard- @badge={{badge}}- @count={{badge.count}}- @username={{this.user.username_lower}}- />- {{/each}}- <PluginOutlet- @name="after-user-summary-badges"- @outletArgs={{hash model=this.model user=this.user}}- />+ {{#if @controller.model.top_categories.length}}+ <div class="top-section top-categories-section">+ <UserSummarySection+ @title="top_categories"+ class="summary-category-list pull-left"+ >+ <table>+ <thead>+ <th class="category-link"></th>+ <th class="topic-count">{{i18n "user.summary.topics"}}</th>+ <th class="reply-count">{{i18n "user.summary.replies"}}</th>+ </thead>+ <tbody>+ {{#each @controller.model.top_categories as |category|}}+ <tr>+ <PluginOutlet+ @name="user-summary-top-category-row"+ @outletArgs={{hash+ category=category+ }}+ >+ <td class="category-link">+ {{categoryLink+ category+ allowUncategorized="true"+ hideParent=false+ }}+ </td>+ <td class="topic-count">+ <UserSummaryCategorySearch+ @user={{@controller.user}}+ @category={{category}}+ @searchOnlyFirstPosts={{true}}+ @count={{category.topic_count}}+ />+ </td>+ <td class="reply-count">+ <UserSummaryCategorySearch+ @user={{@controller.user}}+ @category={{category}}+ @searchOnlyFirstPosts={{false}}+ @count={{category.post_count}}+ />+ </td>+ </PluginOutlet>+ </tr>+ {{/each}}+ </tbody>+ </table>+ </UserSummarySection></div>- {{else}}- <p>{{i18n "user.summary.no_badges"}}</p>{{/if}}- {{#if this.moreBadges}}- <LinkTo @route="user.badges" @model={{this.user}} class="more">- {{i18n "user.summary.more_badges"}}- </LinkTo>+ {{#if @controller.siteSettings.enable_badges}}+ <div class="top-section badges-section">+ <h3 class="stats-title">{{i18n "user.summary.top_badges"}}</h3>++ {{#if @controller.model.badges}}+ <div class="badge-group-list">+ {{#each @controller.model.badges as |badge|}}+ <BadgeCard+ @badge={{badge}}+ @count={{badge.count}}+ @username={{@controller.user.username_lower}}+ />+ {{/each}}+ <PluginOutlet+ @name="after-user-summary-badges"+ @outletArgs={{hash+ }}+ />+ </div>+ {{else}}+ <p>{{i18n "user.summary.no_badges"}}</p>+ {{/if}}++ {{#if @controller.moreBadges}}+ <LinkTo+ @route="user.badges"+ @model={{@controller.user}}+ class="more"+ >+ {{i18n "user.summary.more_badges"}}+ </LinkTo>+ {{/if}}+ </div>{{/if}}</div>- {{/if}}-</div>\ No newline at end of file+ </template>+);diff --git a/app/assets/javascripts/discourse/tests/addons/truth-helpers/integration/helpers/includes-test.gjs b/app/assets/javascripts/discourse/tests/addons/truth-helpers/integration/helpers/includes-test.gjsindex 3d1f005930b..a536d85613e 100644--- a/app/assets/javascripts/discourse/tests/addons/truth-helpers/integration/helpers/includes-test.gjs+++ b/app/assets/javascripts/discourse/tests/addons/truth-helpers/integration/helpers/includes-test.gjs@@ -1,7 +1,7 @@import { render } from "@ember/test-helpers";import { module, test } from "qunit";+import { includes } from "truth-helpers";import { setupRenderingTest } from "discourse/tests/helpers/component-test";-import includes from "truth-helpers/helpers/includes";module("Addons | truth-helpers | Integration | includes", function (hooks) {setupRenderingTest(hooks);diff --git a/app/assets/javascripts/discourse/tests/integration/helpers/html-safe-test.gjs b/app/assets/javascripts/discourse/tests/integration/helpers/html-safe-test.gjsindex 08d72d33b07..a34988fac56 100644--- a/app/assets/javascripts/discourse/tests/integration/helpers/html-safe-test.gjs+++ b/app/assets/javascripts/discourse/tests/integration/helpers/html-safe-test.gjs@@ -1,6 +1,6 @@+import { htmlSafe } from "@ember/template";import { render } from "@ember/test-helpers";import { module, test } from "qunit";-import htmlSafe from "discourse/helpers/html-safe";import { setupRenderingTest } from "discourse/tests/helpers/component-test";module("Integration | Helper | html-safe", function (hooks) {diff --git a/app/assets/javascripts/discourse/tests/integration/helpers/replace-emoji-test.gjs b/app/assets/javascripts/discourse/tests/integration/helpers/replace-emoji-test.gjsindex 2ba97c93040..b9a74c088c1 100644--- a/app/assets/javascripts/discourse/tests/integration/helpers/replace-emoji-test.gjs+++ b/app/assets/javascripts/discourse/tests/integration/helpers/replace-emoji-test.gjs@@ -1,6 +1,6 @@+import { htmlSafe } from "@ember/template";import { render } from "@ember/test-helpers";import { module, test } from "qunit";-import htmlSafe from "discourse/helpers/html-safe";import replaceEmoji from "discourse/helpers/replace-emoji";import { setupRenderingTest } from "discourse/tests/helpers/component-test";diff --git a/app/assets/javascripts/float-kit/addon/components/d-float-body.gjs b/app/assets/javascripts/float-kit/addon/components/d-float-body.gjsindex 6d61a80edbe..bd87fbebbe5 100644--- a/app/assets/javascripts/float-kit/addon/components/d-float-body.gjs+++ b/app/assets/javascripts/float-kit/addon/components/d-float-body.gjs@@ -2,6 +2,7 @@ import Component from "@glimmer/component";import { concat, fn, hash } from "@ember/helper";import { htmlSafe } from "@ember/template";import { modifier as modifierFn } from "ember-modifier";+import { and } from "truth-helpers";import concatClass from "discourse/helpers/concat-class";import closeOnClickOutside from "discourse/modifiers/close-on-click-outside";import TrapTab from "discourse/modifiers/trap-tab";@@ -9,7 +10,6 @@ import DFloatPortal from "float-kit/components/d-float-portal";import { getScrollParent } from "float-kit/lib/get-scroll-parent";import FloatKitApplyFloatingUi from "float-kit/modifiers/apply-floating-ui";import FloatKitCloseOnEscape from "float-kit/modifiers/close-on-escape";-import and from "truth-helpers/helpers/and";export default class DFloatBody extends Component {closeOnScroll = modifierFn(() => {diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/thread/header.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/thread/header.gjsindex ef3543b3143..236f0809851 100644--- a/plugins/chat/assets/javascripts/discourse/components/chat/thread/header.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/chat/thread/header.gjs@@ -1,12 +1,11 @@import Component from "@glimmer/component";import { on } from "@ember/modifier";import { service } from "@ember/service";-import { or } from "truth-helpers";+import { and, or } from "truth-helpers";import icon from "discourse/helpers/d-icon";import noop from "discourse/helpers/noop";import replaceEmoji from "discourse/helpers/replace-emoji";import { i18n } from "discourse-i18n";-import and from "truth-helpers/helpers/and";import ThreadSettingsModal from "discourse/plugins/chat/discourse/components/chat/modal/thread-settings";import Navbar from "discourse/plugins/chat/discourse/components/chat/navbar";import ChatThreadHeaderUnreadIndicator from "discourse/plugins/chat/discourse/components/chat/thread/header-unread-indicator";