mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 18:52:45 +08:00
UX: Move Admin Guide link to URL (#22789)
Co-authored-by: David Taylor <david@taylorhq.com> Co-authored-by: Jarek Radosz <jradosz@gmail.com>
This commit is contained in:
parent
6e8e3c3151
commit
a68752df25
|
@ -5,12 +5,7 @@
|
|||
{{did-insert this.setupUserTip}}
|
||||
>
|
||||
{{#if this.showUserTip}}
|
||||
<UserTip
|
||||
@id="admin_guide"
|
||||
@buttonLabel="user_tips.admin_guide.button"
|
||||
@buttonIcon="link"
|
||||
@onDismiss={{this.routeToAdminGuide}}
|
||||
/>
|
||||
<UserTip @id="admin_guide" @content={{this.userTipContent}} />
|
||||
{{else}}
|
||||
<DTooltip @theme="user-tip" @arrow={{true}}>
|
||||
<div class="user-tip__container">
|
||||
|
@ -18,7 +13,7 @@
|
|||
{{i18n "user_tips.admin_guide.title"}}
|
||||
</div>
|
||||
<div class="user-tip__content">
|
||||
{{i18n "user_tips.admin_guide.content"}}
|
||||
{{i18n "user_tips.admin_guide.content_no_url"}}
|
||||
</div>
|
||||
</div>
|
||||
</DTooltip>
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import getURL from "discourse-common/lib/get-url";
|
||||
import { action } from "@ember/object";
|
||||
import { inject as service } from "@ember/service";
|
||||
import Component from "@glimmer/component";
|
||||
import { tracked } from "@glimmer/tracking";
|
||||
import I18n from "I18n";
|
||||
import DiscourseURL from "discourse/lib/url";
|
||||
|
||||
export default class BootstrapModeNotice extends Component {
|
||||
|
@ -22,4 +24,14 @@ export default class BootstrapModeNotice extends Component {
|
|||
`/t/-/${this.siteSettings.admin_quick_start_topic_id}`
|
||||
);
|
||||
}
|
||||
|
||||
get adminGuideUrl() {
|
||||
return getURL(`/t/-/${this.siteSettings.admin_quick_start_topic_id}`);
|
||||
}
|
||||
|
||||
get userTipContent() {
|
||||
return I18n.t("user_tips.admin_guide.content", {
|
||||
admin_guide_url: this.adminGuideUrl,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,8 @@ export default class UserTip extends Component {
|
|||
this.currentUser.showUserTip({
|
||||
id,
|
||||
titleText: I18n.t(`user_tips.${id}.title`),
|
||||
contentText: content || I18n.t(`user_tips.${id}.content`),
|
||||
contentHtml: content,
|
||||
contentText: I18n.t(`user_tips.${id}.content`),
|
||||
buttonLabel,
|
||||
buttonIcon,
|
||||
reference:
|
||||
|
|
|
@ -90,7 +90,9 @@ export function showUserTip(options) {
|
|||
options.content ||
|
||||
`<div class='user-tip__container'>
|
||||
<div class='user-tip__title'>${escape(options.titleText)}</div>
|
||||
<div class='user-tip__content'>${escape(options.contentText)}</div>
|
||||
<div class='user-tip__content'>${
|
||||
options.contentHtml || escape(options.contentText)
|
||||
}</div>
|
||||
<div class='user-tip__buttons'>
|
||||
<button class="btn btn-primary">${buttonText}</button>
|
||||
</div>
|
||||
|
|
|
@ -45,6 +45,11 @@
|
|||
|
||||
&__content {
|
||||
margin-top: 0.25em;
|
||||
|
||||
a {
|
||||
color: var(--secondary);
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
&__buttons {
|
||||
|
|
|
@ -1933,8 +1933,8 @@ en:
|
|||
|
||||
admin_guide:
|
||||
title: "Welcome to your new site!"
|
||||
content: "Read the admin guide to continue building your site and community."
|
||||
button: "Let's go!"
|
||||
content: "<a href='%{admin_guide_url}'>Read the admin guide</a> to continue building your site and community."
|
||||
content_no_url: "Read the admin guide to continue building your site and community."
|
||||
|
||||
loading: "Loading..."
|
||||
errors:
|
||||
|
|
Loading…
Reference in New Issue
Block a user