mirror of
https://github.com/discourse/discourse.git
synced 2024-12-13 09:16:13 +08:00
45ae9d9bab
This commit makes some visual tweaks to the admin panel plugin list, and introduces functional 'toggle switches' for admins to enable/disable plugins more easily. Co-authored-by: Jordan Vidrine <jordan@jordanvidrine.com>
90 lines
2.6 KiB
Handlebars
90 lines
2.6 KiB
Handlebars
{{#if this.model.length}}
|
|
<h3>{{i18n "admin.plugins.installed"}}</h3>
|
|
|
|
<table class="admin-plugins grid">
|
|
<thead>
|
|
<tr>
|
|
<th></th>
|
|
<th>{{i18n "admin.plugins.name"}}</th>
|
|
<th>{{i18n "admin.plugins.version"}}</th>
|
|
<th>{{i18n "admin.plugins.enabled"}}</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{#each this.model as |plugin|}}
|
|
<tr data-plugin-name={{plugin.name}}>
|
|
<td>
|
|
{{#if plugin.is_official}}
|
|
{{d-icon
|
|
"check-circle"
|
|
title="admin.plugins.official"
|
|
class="admin-plugins-official-badge"
|
|
}}
|
|
{{/if}}
|
|
</td>
|
|
|
|
<td class="plugin-name">
|
|
<div class="name">
|
|
{{#if plugin.url}}
|
|
<a
|
|
href={{plugin.url}}
|
|
rel="noopener noreferrer"
|
|
target="_blank"
|
|
>{{plugin.name}} {{d-icon "external-link-alt"}}</a>
|
|
{{else}}
|
|
{{plugin.name}}
|
|
{{/if}}
|
|
</div>
|
|
<div class="about">
|
|
{{plugin.about}}
|
|
</div>
|
|
</td>
|
|
<td class="version">
|
|
<div class="label">{{i18n "admin.plugins.version"}}</div>
|
|
{{plugin.version}}<br />
|
|
<PluginCommitHash @plugin={{plugin}} />
|
|
</td>
|
|
<td class="col-enabled">
|
|
<div class="label">{{i18n "admin.plugins.enabled"}}</div>
|
|
{{#if plugin.enabled_setting}}
|
|
<DToggleSwitch
|
|
@state={{plugin.enabled}}
|
|
{{on "click" (fn this.togglePluginEnabled plugin)}}
|
|
/>
|
|
{{else}}
|
|
<DToggleSwitch @state={{plugin.enabled}} disabled={{true}} />
|
|
{{/if}}
|
|
</td>
|
|
<td class="settings">
|
|
{{#if this.currentUser.admin}}
|
|
{{#if plugin.has_settings}}
|
|
<DButton
|
|
@class="btn-default"
|
|
@action={{route-action "showSettings"}}
|
|
@actionParam={{plugin}}
|
|
@icon="cog"
|
|
@label="admin.plugins.change_settings_short"
|
|
/>
|
|
{{/if}}
|
|
{{/if}}
|
|
</td>
|
|
</tr>
|
|
{{/each}}
|
|
</tbody>
|
|
</table>
|
|
{{else}}
|
|
<p>{{i18n "admin.plugins.none_installed"}}</p>
|
|
{{/if}}
|
|
|
|
<p class="admin-plugins-howto"><a
|
|
href="https://meta.discourse.org/t/install-a-plugin/19157"
|
|
>{{i18n "admin.plugins.howto"}}</a></p>
|
|
|
|
<span>
|
|
<PluginOutlet
|
|
@name="admin-below-plugins-index"
|
|
@connectorTagName="div"
|
|
@outletArgs={{hash model=this.model}}
|
|
/>
|
|
</span> |