diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-05-20 12:51:05 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-05-20 12:51:05 -0400 |
commit | 8d69c49da595c60dae51c77d48f397ab97fdf318 (patch) | |
tree | 7fba4edb18c5c4c161e76828d5847733aca8d27b /app/Template/plugin | |
parent | cbf896e74e666f102f475787202d3402f229a919 (diff) |
Manage plugins from the user interface and from the command line
Diffstat (limited to 'app/Template/plugin')
-rw-r--r-- | app/Template/plugin/directory.php | 65 | ||||
-rw-r--r-- | app/Template/plugin/remove.php | 13 | ||||
-rw-r--r-- | app/Template/plugin/show.php | 22 |
3 files changed, 74 insertions, 26 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 ?> diff --git a/app/Template/plugin/remove.php b/app/Template/plugin/remove.php new file mode 100644 index 00000000..bd8f4eb8 --- /dev/null +++ b/app/Template/plugin/remove.php @@ -0,0 +1,13 @@ +<div class="page-header"> + <h2><?= t('Remove plugin') ?></h2> +</div> + +<div class="confirm"> + <p class="alert alert-info"><?= t('Do you really want to remove this plugin: "%s"?', $plugin->getPluginName()) ?></p> + + <div class="form-actions"> + <?= $this->url->link(t('Yes'), 'PluginController', 'uninstall', array('pluginId' => $plugin_id), true, 'btn btn-red') ?> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'PluginController', 'show', array(), false, 'close-popover') ?> + </div> +</div> diff --git a/app/Template/plugin/show.php b/app/Template/plugin/show.php index 8358fb2a..9c3d6d20 100644 --- a/app/Template/plugin/show.php +++ b/app/Template/plugin/show.php @@ -5,15 +5,17 @@ <?php if (empty($plugins)): ?> <p class="alert"><?= t('There is no plugin loaded.') ?></p> <?php else: ?> - <table class="table-stripped"> + <table> <tr> - <th class="column-20"><?= t('Name') ?></th> - <th class="column-20"><?= t('Author') ?></th> + <th class="column-35"><?= t('Name') ?></th> + <th class="column-30"><?= t('Author') ?></th> <th class="column-10"><?= t('Version') ?></th> - <th><?= t('Description') ?></th> + <?php if ($is_configured): ?> + <th><?= t('Action') ?></th> + <?php endif ?> </tr> - <?php foreach ($plugins as $plugin): ?> + <?php foreach ($plugins as $pluginFolder => $plugin): ?> <tr> <td> <?php if ($plugin->getPluginHomepage()): ?> @@ -24,7 +26,15 @@ </td> <td><?= $this->text->e($plugin->getPluginAuthor()) ?></td> <td><?= $this->text->e($plugin->getPluginVersion()) ?></td> - <td><?= $this->text->e($plugin->getPluginDescription()) ?></td> + <?php if ($is_configured): ?> + <td> + <i class="fa fa-trash-o fa-fw" aria-hidden="true"></i> + <?= $this->url->link(t('Uninstall'), 'PluginController', 'confirm', array('pluginId' => $pluginFolder), false, 'popover') ?> + </td> + <?php endif ?> + </tr> + <tr> + <td colspan="<?= $is_configured ? 4 : 3 ?>"><?= $this->text->e($plugin->getPluginDescription()) ?></td> </tr> <?php endforeach ?> </table> |