Skip to content

Commit

Permalink
Responsive version + Gantt compatibility + update theme + adding colo…
Browse files Browse the repository at this point in the history
…r filter in board view
  • Loading branch information
JB committed Nov 5, 2019
1 parent 4c8ec53 commit 4973e60
Show file tree
Hide file tree
Showing 13 changed files with 254 additions and 145 deletions.
38 changes: 38 additions & 0 deletions MyUrlHelper.php
@@ -0,0 +1,38 @@
<?php

namespace Kanboard\Plugin\Greenwing;

use Kanboard\Core\Base;

/**
* Url Helper
*
* @package helper
* @author Frederic Guillot
*/
class MyUrlHelper extends Base
{

/**
* Link element with icon
*
* @access public
* @param string $icon Icon name
* @param string $label Link label
* @param string $controller Controller name
* @param string $action Action name
* @param array $params Url parameters
* @param boolean $csrf Add a CSRF token
* @param string $class CSS class attribute
* @param string $title Link title
* @param boolean $newTab Open the link in a new tab
* @param string $anchor Link Anchor
* @param bool $absolute
* @return string
*/
public function icon($icon, $label, $controller, $action, array $params = array(), $csrf = false, $class = '', $title = '', $newTab = false, $anchor = '', $absolute = false)
{
$html = '<i class="fa fa-fw fa-'.$icon.'" aria-hidden="true"></i><span>'.$label.'</span>';
return $this->helper->url->link($html, $controller, $action, $params, $csrf, $class, $title, $newTab, $anchor, $absolute);
}
}
7 changes: 5 additions & 2 deletions Plugin.php
Expand Up @@ -42,6 +42,8 @@ public function initialize() {
$this->template->setTemplateOverride( 'password_reset/create', 'Greenwing:password_reset' );
$this->template->setTemplateOverride( 'project_header/search', 'Greenwing:search' );
$this->template->setTemplateOverride( 'board/view_private', 'Greenwing:view_private' );
$this->template->setTemplateOverride( 'project_header/views', 'Greenwing:project_header/views' );
$this->template->setTemplateOverride( 'plugin/show', 'Greenwing:plugin/show' );

$this->container['colorModel'] = $this->container->factory( function ( $c ) {
return new ColorModel( $c );
Expand All @@ -55,6 +57,7 @@ public function initialize() {
$this->helper->register( 'myAvatarHelper', '\Kanboard\Plugin\Greenwing\MyAvatarHelper' );
$this->helper->register( 'myFormHelper', '\Kanboard\Plugin\Greenwing\MyFormHelper' );
$this->helper->register( 'myProjectHeaderHelper', '\Kanboard\Plugin\Greenwing\MyProjectHeaderHelper' );
$this->helper->register( 'myUrlHelper', '\Kanboard\Plugin\Greenwing\MyUrlHelper' );

$this->setContentSecurityPolicy( array( 'font-src' => "'self' fonts.gstatic.com" ) );

Expand All @@ -72,11 +75,11 @@ public function getPluginAuthor() {
}

public function getPluginVersion() {
return '1.0.0';
return '1.2.0';
}

public function getPluginHomepage() {
return 'https://github.com/.../...';
return 'https://github.com/Confexion/Greenwing';
}

public function getPluginDescription() {
Expand Down
Empty file added Template/header.php
Empty file.
80 changes: 80 additions & 0 deletions Template/plugin/show.php
@@ -0,0 +1,80 @@
<?php if (! empty($incompatible_plugins)): ?>
<div class="page-header">
<h2><?= t('Incompatible Plugins') ?></h2>
</div>
<table>
<tr>
<th class="column-35"><?= t('Name') ?></th>
<th class="column-25"><?= t('Author') ?></th>
<th class="column-10"><?= t('Version') ?></th>
<th class="column-12"><?= t('Compatibility') ?></th>
<?php if ($is_configured): ?>
<th><?= t('Action') ?></th>
<?php endif ?>
</tr>

<?php foreach ($incompatible_plugins as $pluginFolder => $plugin): ?>
<tr>
<td>
<?php if ($plugin->getPluginHomepage()): ?>
<a href="<?= $plugin->getPluginHomepage() ?>" target="_blank" rel="noreferrer"><?= $this->text->e($plugin->getPluginName()) ?></a>
<?php else: ?>
<?= $this->text->e($plugin->getPluginName()) ?>
<?php endif ?>
</td>
<td><?= $this->text->e($plugin->getPluginAuthor()) ?></td>
<td><?= $this->text->e($plugin->getPluginVersion()) ?></td>
<td><?= $this->text->e($plugin->getCompatibleVersion()) ?></td>
<?php if ($is_configured): ?>
<td>
<?= $this->modal->confirm('trash-o', t('Uninstall'), 'PluginController', 'confirm', array('pluginId' => $pluginFolder)) ?>
</td>
<?php endif ?>
</tr>
<tr>
<td colspan="<?= $is_configured ? 6 : 5 ?>"><?= $this->text->e($plugin->getPluginDescription()) ?></td>
</tr>
<?php endforeach ?>
</table>
<?php endif ?>

<div class="page-header">
<h2><?= t('Installed Plugins') ?></h2>
</div>

<?php if (empty($plugins)): ?>
<p class="alert"><?= t('There is no plugin loaded.') ?></p>
<?php else: ?>
<table class="table-scrolling">
<tr>
<th class="column-35"><?= t('Name') ?></th>
<th class="column-30"><?= t('Author') ?></th>
<th class="column-10"><?= t('Version') ?></th>
<?php if ($is_configured): ?>
<th><?= t('Action') ?></th>
<?php endif ?>
</tr>

<?php foreach ($plugins as $pluginFolder => $plugin): ?>
<tr>
<td>
<?php if ($plugin->getPluginHomepage()): ?>
<a href="<?= $plugin->getPluginHomepage() ?>" target="_blank" rel="noreferrer"><?= $this->text->e($plugin->getPluginName()) ?></a>
<?php else: ?>
<?= $this->text->e($plugin->getPluginName()) ?>
<?php endif ?>
</td>
<td><?= $this->text->e($plugin->getPluginAuthor()) ?></td>
<td><?= $this->text->e($plugin->getPluginVersion()) ?></td>
<?php if ($is_configured): ?>
<td>
<?= $this->modal->confirm('trash-o', t('Uninstall'), 'PluginController', 'confirm', array('pluginId' => $pluginFolder)) ?>
</td>
<?php endif ?>
</tr>
<tr>
<td colspan="<?= $is_configured ? 4 : 3 ?>"><?= $this->text->e($plugin->getPluginDescription()) ?></td>
</tr>
<?php endforeach ?>
</table>
<?php endif ?>
23 changes: 12 additions & 11 deletions Template/project_header.php
Expand Up @@ -9,16 +9,17 @@
<div class="views-switcher-component">
<?= $this->render('project_header/views', array('project' => $project, 'filters' => $filters)) ?>
</div>
<div class="filter-box-component">
<?= $this->render('project_header/search', array(
'project' => $project,
'filters' => $filters,
'custom_filters_list' => isset($custom_filters_list) ? $custom_filters_list : array(),
'users_list' => isset($users_list) ? $users_list : array(),
'colors_list' => isset($colors_list) ? $colors_list : array(),
'categories_list' => isset($categories_list) ? $categories_list : array(),
)) ?>
</div>

<?php if (strpos($_SERVER["QUERY_STRING"], 'TaskViewController') === false): ?>
<div class="filter-box-component">
<?= $this->render('project_header/search', array(
'project' => $project,
'filters' => $filters,
'custom_filters_list' => isset($custom_filters_list) ? $custom_filters_list : array(),
'users_list' => isset($users_list) ? $users_list : array(),
'colors_list' => isset($colors_list) ? $colors_list : array(),
'categories_list' => isset($categories_list) ? $categories_list : array(),
)) ?>
</div>
<?php endif ?>
<?= $this->hook->render('template:project:header:after', array('project' => $project)) ?>
</div>
13 changes: 13 additions & 0 deletions Template/project_header/views.php
@@ -0,0 +1,13 @@
<ul class="views">
<li <?= $this->app->checkMenuSelection('ProjectOverviewController') ?>>
<?= $this->myUrlHelper->icon('eye', t('Overview'), 'ProjectOverviewController', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-overview', t('Keyboard shortcut: "%s"', 'v o')) ?>
</li>
<li <?= $this->app->checkMenuSelection('BoardViewController') ?>>
<?= $this->myUrlHelper->icon('th', t('Board'), 'BoardViewController', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-board', t('Keyboard shortcut: "%s"', 'v b')) ?>
</li>
<li <?= $this->app->checkMenuSelection('TaskListController') ?>>
<?= $this->myUrlHelper->icon('list', t('List'), 'TaskListController', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-listing', t('Keyboard shortcut: "%s"', 'v l')) ?>
</li>

<?= $this->hook->render('template:project-header:view-switcher', array('project' => $project, 'filters' => $filters)) ?>
</ul>

0 comments on commit 4973e60

Please sign in to comment.