UX: Add an icon to indicate if a plugin is official.

https://meta.discourse.org/t/improving-admin-plugins/84585
This commit is contained in:
Guo Xiang Tan 2018-04-06 10:54:58 +08:00
parent eb755dd2a7
commit 2ddcdf8704
5 changed files with 20 additions and 3 deletions

View File

@ -29,6 +29,12 @@
{{else}}
{{plugin.name}}
{{/if}}
{{#if plugin.is_official}}
{{d-icon "check-circle"
title="admin.plugins.official"
class="admin-plugins-official-badge"}}
{{/if}}
</td>
<td>{{plugin.version}}</td>
<td class="col-enabled">
@ -58,4 +64,3 @@
{{/if}}
<p><a href="https://meta.discourse.org/t/install-a-plugin/19157">{{i18n "admin.plugins.howto"}}</a></p>

View File

@ -1327,6 +1327,10 @@ table.api-keys {
width: 20px;
}
.admin-plugins-official-badge {
color: $success;
}
// Backups
// --------------------------------------------------

View File

@ -5,7 +5,8 @@ class AdminPluginSerializer < ApplicationSerializer
:url,
:admin_route,
:enabled,
:enabled_setting
:enabled_setting,
:is_official
def id
object.metadata.name
@ -51,4 +52,8 @@ class AdminPluginSerializer < ApplicationSerializer
def include_admin_route?
admin_route.present?
end
def is_official
Plugin::Metadata::OFFICIAL_PLUGINS.include?(object.name)
end
end

View File

@ -2981,6 +2981,7 @@ en:
change_settings: "Change Settings"
change_settings_short: "Settings"
howto: "How do I install plugins?"
official: "Offical Plugin"
backups:
title: "Backups"

View File

@ -33,7 +33,9 @@ class Plugin::Metadata
"discourse-translator",
"discourse-patreon",
"discourse-prometheus",
"discourse-assign"
"discourse-assign",
"discourse-narrative-bot",
"discourse-presence"
])
FIELDS ||= [:name, :about, :version, :authors, :url, :required_version]