discourse/app/assets/javascripts/admin/addon/templates/plugins-index.gjs
Kris 2d111e2a9a
UX: show all preinstalled plugins and label them as such (#33681)
Instead of listing the redundant commit hash, this now shows
"preinstalled" for the relevant components and links to
https://meta.discourse.org/t/bundling-more-popular-plugins-with-discourse-core/373574.
This is accomplished by checking the URL of the plugin for
`"/discourse/discourse/tree/main/plugins/"` which indicates it's part of
the core Discourse repo.

I've also removed the `hide_plugin` flag from existing preinstalled
plugins. Now Discourse admins will have more clarity into what's
included.

I also made some minor layout adjustments: 
* Larger click area for "how to install a plugin" banner
* Moved "Learn more" into a separate line for consistent positioning

Before:
<img width="2182" height="1192" alt="image"
src="https://github.com/user-attachments/assets/b2943a7f-5212-4abd-8b80-d0d071378f06"
/>


After:
<img width="2226" height="1184" alt="image"
src="https://github.com/user-attachments/assets/0846a2c9-fc1b-435c-b51f-b966af5ade09"
/>
2025-07-17 15:11:52 -04:00

72 lines
2.5 KiB
Text
Vendored

import RouteTemplate from "ember-route-template";
import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";
import DPageHeader from "discourse/components/d-page-header";
import NavItem from "discourse/components/nav-item";
import PluginOutlet from "discourse/components/plugin-outlet";
import icon from "discourse/helpers/d-icon";
import lazyHash from "discourse/helpers/lazy-hash";
import { i18n } from "discourse-i18n";
import AdminPluginsList from "admin/components/admin-plugins-list";
export default RouteTemplate(
<template>
<div class="admin-plugins-list-container">
<DPageHeader
@titleLabel={{i18n "admin.config.plugins.title"}}
@descriptionLabel={{i18n "admin.config.plugins.header_description"}}
@learnMoreUrl="https://www.discourse.org/plugins"
>
<:breadcrumbs>
<DBreadcrumbsItem @path="/admin" @label={{i18n "admin_title"}} />
<DBreadcrumbsItem
@path="/admin/plugins"
@label={{i18n "admin.plugins.title"}}
/>
</:breadcrumbs>
<:tabs>
<NavItem @route="adminPlugins.index" @label="admin.plugins.title" />
{{#each @controller.adminRoutes as |route|}}
{{#if route.use_new_show_route}}
<NavItem
@route={{route.full_location}}
@label={{route.label}}
@routeParam={{route.location}}
@class="admin-plugin-tab-nav-item"
data-plugin-nav-tab-id={{route.plugin_id}}
/>
{{else}}
<NavItem
@route={{route.full_location}}
@label={{route.label}}
@class="admin-plugin-tab-nav-item"
data-plugin-nav-tab-id={{route.plugin_id}}
/>
{{/if}}
{{/each}}
</:tabs>
</DPageHeader>
<div class="alert alert-info admin-plugins-howto">
<a href="https://meta.discourse.org/t/install-a-plugin/19157">
{{icon "circle-info"}}
{{i18n "admin.plugins.howto"}}
</a>
</div>
{{#if @controller.model.length}}
<AdminPluginsList @plugins={{@controller.model}} />
{{else}}
<p>{{i18n "admin.plugins.none_installed"}}</p>
{{/if}}
<span>
<PluginOutlet
@name="admin-below-plugins-index"
@connectorTagName="div"
@outletArgs={{lazyHash model=@controller.model}}
/>
</span>
</div>
</template>
);