summaryrefslogtreecommitdiff
path: root/app/Template/plugin/directory.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Template/plugin/directory.php')
-rw-r--r--app/Template/plugin/directory.php65
1 files changed, 45 insertions, 20 deletions
diff --git a/app/Template/plugin/directory.php b/app/Template/plugin/directory.php
index 82b9a441..b6c6734c 100644
--- a/app/Template/plugin/directory.php
+++ b/app/Template/plugin/directory.php
@@ -2,29 +2,54 @@
<h2><?= t('Plugin Directory') ?></h2>
</div>
-<?php if (empty($plugins)): ?>
+<?php if (! $is_configured): ?>
+<p class="alert alert-error">
+ <?= t('Your Kanboard instance is not configured to install plugins from the user interface.') ?>
+</p>
+<?php endif ?>
+
+<?php if (empty($available_plugins)): ?>
<p class="alert"><?= t('There is no plugin available.') ?></p>
<?php else: ?>
- <table class="table-stripped">
+ <?php foreach ($available_plugins as $plugin): ?>
+ <table>
<tr>
- <th class="column-20"><?= t('Name') ?></th>
- <th class="column-20"><?= t('Author') ?></th>
- <th class="column-10"><?= t('Version') ?></th>
- <th><?= t('Description') ?></th>
- <th><?= t('Action') ?></th>
+ <th colspan="3">
+ <a href="<?= $plugin['homepage'] ?>" target="_blank" rel="noreferrer"><?= $this->text->e($plugin['title']) ?></a>
+ </th>
+ </tr>
+ <tr>
+ <td class="column-40">
+ <?= $this->text->e($plugin['author']) ?>
+ </td>
+ <td class="column-30">
+ <?= $this->text->e($plugin['version']) ?>
+ </td>
+ <td>
+ <?php if ($is_configured): ?>
+ <?php if (! isset($installed_plugins[$plugin['title']])): ?>
+ <i class="fa fa-cloud-download fa-fw" aria-hidden="true"></i>
+ <?= $this->url->link(t('Install'), 'PluginController', 'install', array('archive_url' => urlencode($plugin['download'])), true) ?>
+ <?php elseif ($installed_plugins[$plugin['title']] < $plugin['version']): ?>
+ <i class="fa fa-refresh fa-fw" aria-hidden="true"></i>
+ <?= $this->url->link(t('Update'), 'PluginController', 'update', array('archive_url' => urlencode($plugin['download'])), true) ?>
+ <?php else: ?>
+ <i class="fa fa-check-circle-o" aria-hidden="true"></i>
+ <?= t('Up to date') ?>
+ <?php endif ?>
+ <?php else: ?>
+ <i class="fa fa-ban fa-fw" aria-hidden="true"></i>
+ <?= t('Not available') ?>
+ <?php endif ?>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="3">
+ <div class="markdown">
+ <?= $this->text->markdown($plugin['description']) ?>
+ </div>
+ </td>
</tr>
-
- <?php foreach ($plugins as $plugin): ?>
- <tr>
- <td>
- <a href="<?= $plugin['homepage'] ?>" target="_blank" rel="noreferrer"><?= $this->text->e($plugin['title']) ?></a>
- </td>
- <td><?= $this->text->e($plugin['author']) ?></td>
- <td><?= $this->text->e($plugin['version']) ?></td>
- <td><?= $this->text->e($plugin['description']) ?></td>
- <td>
- </td>
- </tr>
- <?php endforeach ?>
</table>
+ <?php endforeach ?>
<?php endif ?>