discourse/app/assets/javascripts/admin/addon/templates/plugins-index.hbs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

93 lines
2.8 KiB
Handlebars
Raw Normal View History

{{#if this.model.length}}
<h3>{{i18n "admin.plugins.installed"}}</h3>
2018-07-03 11:14:53 +08:00
<table class="admin-plugins grid">
2015-05-14 00:13:25 +08:00
<thead>
<tr>
<th></th>
2015-05-14 00:13:25 +08:00
<th>{{i18n "admin.plugins.name"}}</th>
<th>{{i18n "admin.plugins.version"}}</th>
<th>{{i18n "admin.plugins.enabled"}}</th>
<th></th>
2015-05-14 00:13:25 +08:00
</tr>
</thead>
<tbody>
{{#each this.model as |plugin|}}
<tr data-plugin-name={{plugin.name}}>
<td>
{{#if plugin.isOfficial}}
{{d-icon
"check-circle"
title="admin.plugins.official"
class="admin-plugins-official-badge"
}}
{{/if}}
</td>
2018-07-03 11:14:53 +08:00
<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>
2018-07-03 11:14:53 +08:00
<td class="version">
<div class="label">{{i18n "admin.plugins.version"}}</div>
{{plugin.version}}<br />
<PluginCommitHash @plugin={{plugin}} />
2018-07-03 11:14:53 +08:00
</td>
<td class="col-enabled">
2018-07-03 11:14:53 +08:00
<div class="label">{{i18n "admin.plugins.enabled"}}</div>
{{#if plugin.enabledSetting}}
<DToggleSwitch
@state={{plugin.enabled}}
{{on "click" (fn this.togglePluginEnabled plugin)}}
/>
{{else}}
<DToggleSwitch @state={{plugin.enabled}} disabled={{true}} />
{{/if}}
</td>
2018-07-03 11:14:53 +08:00
<td class="settings">
{{#if this.currentUser.admin}}
{{#if plugin.hasSettings}}
<LinkTo
class="btn-default btn btn-icon-text"
@route="adminSiteSettingsCategory"
@model={{plugin.settingCategoryName}}
@query={{hash filter=(concat "plugin:" plugin.name)}}
data-plugin-setting-button={{plugin.name}}
>
{{d-icon "cog"}}
{{i18n "admin.plugins.change_settings_short"}}
</LinkTo>
{{/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>