-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create ProjectCoverimageModel.php * Create ProjectCoverimageController.php * Create images.php * Create overview.php * Update Plugin.php * Update Plugin.php * Update overview.php * Update overview.php * Update ProjectCoverimageModel.php * Update ProjectCoverimageModel.php * Update Plugin.php * Update Plugin.php * Update Plugin.php * Update Plugin.php * Update overview.php * Update images.php * Update overview.php * Update overview.php * Update overview.php * Update overview.php * Create project_title.php * Update Plugin.php * Update project_title.php * Update overview.php * Update README.md * Update ProjectCoverimageController.php * Update overview.php * Update project_title.php * Update overview.php * Update overview.php * Update project_title.php * Update images.php * Update images.php
- Loading branch information
Showing
7 changed files
with
264 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace Kanboard\Plugin\Coverimage\Controller; | ||
|
||
use Kanboard\Controller\BaseController; | ||
|
||
/** | ||
* Coverimage | ||
* | ||
* @package controller | ||
* @author creecros | ||
*/ | ||
class ProjectCoverimageController extends BaseController { | ||
|
||
public function set() { | ||
$project = $this->getProject(); | ||
$file = $this->getFile(); | ||
|
||
$this->projectCoverimageModel->setCoverimage($project['id'], $file['id']); | ||
|
||
$this->flash->success(t('Coverimage set.')); | ||
|
||
$this->response->redirect($this->helper->url->to('ProjectViewController', 'show', array('project_id' => $project['id'])), true); | ||
} | ||
|
||
public function remove() { | ||
$project = $this->getProject(); | ||
$file = $this->getFile(); | ||
|
||
$this->projectCoverimageModel->removeCoverimage($project['id']); | ||
|
||
$this->flash->success(t('Coverimage removed.')); | ||
|
||
$this->response->redirect($this->helper->url->to('ProjectViewController', 'show', array('project_id' => $project['id'])), true); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace Kanboard\Plugin\Coverimage\Model; | ||
|
||
use Kanboard\Model\ProjectFileModel; | ||
|
||
class ProjectCoverimageModel extends ProjectFileModel { | ||
|
||
public function setCoverimage($project_id, $image_id) { | ||
|
||
$this->projectMetadataModel->save($project_id, array('prjcoverimage' => $image_id)); | ||
} | ||
|
||
public function removeCoverimage($project_id) { | ||
|
||
$this->projectMetadataModel->remove($project_id, 'prjcoverimage'); | ||
} | ||
|
||
public function getCoverimage($project_id) { | ||
|
||
$id = $this->projectMetadataModel->get($project_id, 'prjcoverimage'); | ||
if (!$id) | ||
return(null); | ||
return $this->getById($id); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<div class="filter-box margin-bottom"> | ||
<form method="get" action="<?= $this->url->dir() ?>" class="search"> | ||
<?= $this->form->hidden('controller', array('controller' => 'SearchController')) ?> | ||
<?= $this->form->hidden('action', array('action' => 'index')) ?> | ||
|
||
<div class="input-addon"> | ||
<?= $this->form->text('search', array(), array(), array('placeholder="'.t('Search').'"'), 'input-addon-field') ?> | ||
<div class="input-addon-item"> | ||
<?= $this->render('app/filters_helper') ?> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
|
||
<?php if (! $project_paginator->isEmpty()): ?> | ||
<div class="table-list"> | ||
<?= $this->render('project_list/header', array('paginator' => $project_paginator)) ?> | ||
<?php foreach ($project_paginator->getCollection() as $project): ?> | ||
<div class="table-list-row table-border-left"> | ||
<div> | ||
<?php | ||
$file = $this->task->projectCoverimageModel->getCoverimage($project['id']); | ||
if(isset($file)){ | ||
?> | ||
<span class="avatar avatar-20 avatar-inline"> | ||
<img src="<?= $this->url->href('FileViewerController', 'thumbnail', array('file_id' => $file['id'], 'project_id' => $project['id'])) ?>" title="<?= $this->text->e($file['name']) ?>" alt="<?= $this->text->e($file['name']) ?>" vspace="5" hspace="3" height="25"> | ||
</span> | ||
<?php | ||
} | ||
?> | ||
<?php if ($this->user->hasProjectAccess('ProjectViewController', 'show', $project['id'])): ?> | ||
<?= $this->render('project/dropdown', array('project' => $project)) ?> | ||
<?php else: ?> | ||
<strong><?= '#'.$project['id'] ?></strong> | ||
<?php endif ?> | ||
|
||
<span class="table-list-title <?= $project['is_active'] == 0 ? 'status-closed' : '' ?>"> | ||
<?= $this->url->link($this->text->e($project['name']), 'BoardViewController', 'show', array('project_id' => $project['id'])) ?> | ||
</span> | ||
|
||
<?php if ($project['is_private']): ?> | ||
<i class="fa fa-lock fa-fw" title="<?= t('Private project') ?>"></i> | ||
<?php endif ?> | ||
</div> | ||
<div class="table-list-details"> | ||
<?php foreach ($project['columns'] as $column): ?> | ||
<strong title="<?= t('Task count') ?>"><?= $column['nb_open_tasks'] ?></strong> | ||
<small><?= $this->text->e($column['title']) ?></small> | ||
<?php endforeach ?> | ||
</div> | ||
</div> | ||
<?php endforeach ?> | ||
</div> | ||
|
||
<?= $project_paginator ?> | ||
<?php endif ?> | ||
|
||
<?php if (empty($overview_paginator)): ?> | ||
<p class="alert"><?= t('There is nothing assigned to you.') ?></p> | ||
<?php else: ?> | ||
<?php foreach ($overview_paginator as $result): ?> | ||
<?php if (! $result['paginator']->isEmpty()): ?> | ||
<div class="page-header"> | ||
<h2 id="project-tasks-<?= $result['project_id'] ?>"><?= $this->url->link($this->text->e($result['project_name']), 'BoardViewController', 'show', array('project_id' => $result['project_id'])) ?></h2> | ||
</div> | ||
|
||
<div class="table-list"> | ||
<?= $this->render('task_list/header', array( | ||
'paginator' => $result['paginator'], | ||
)) ?> | ||
|
||
<?php foreach ($result['paginator']->getCollection() as $task): ?> | ||
<div class="table-list-row color-<?= $task['color_id'] ?>"> | ||
<?= $this->render('task_list/task_title', array( | ||
'task' => $task, | ||
'redirect' => 'dashboard', | ||
)) ?> | ||
|
||
<?= $this->render('task_list/task_details', array( | ||
'task' => $task, | ||
)) ?> | ||
|
||
<?= $this->render('task_list/task_avatars', array( | ||
'task' => $task, | ||
)) ?> | ||
|
||
<?= $this->render('task_list/task_icons', array( | ||
'task' => $task, | ||
)) ?> | ||
|
||
<?= $this->render('task_list/task_subtasks', array( | ||
'task' => $task, | ||
'user_id' => $user['id'], | ||
)) ?> | ||
|
||
<?= $this->hook->render('template:dashboard:task:footer', array('task' => $task)) ?> | ||
</div> | ||
<?php endforeach ?> | ||
</div> | ||
|
||
<?= $result['paginator'] ?> | ||
<?php endif ?> | ||
<?php endforeach ?> | ||
<?php endif ?> | ||
|
||
<?= $this->hook->render('template:dashboard:show', array('user' => $user)) ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<div> | ||
<?php | ||
$file = $this->task->projectCoverimageModel->getCoverimage($project['id']); | ||
if(isset($file)){ | ||
?> | ||
<span class="avatar avatar-20 avatar-inline"> | ||
<img src="<?= $this->url->href('FileViewerController', 'thumbnail', array('file_id' => $file['id'], 'project_id' => $project['id'])) ?>" title="<?= $this->text->e($file['name']) ?>" alt="<?= $this->text->e($file['name']) ?>" vspace="5" hspace="3" height="25"> | ||
</span> | ||
<?php | ||
} | ||
?> | ||
<?php if ($this->user->hasProjectAccess('ProjectViewController', 'show', $project['id'])): ?> | ||
<?= $this->render('project/dropdown', array('project' => $project)) ?> | ||
<?php else: ?> | ||
<strong><?= '#'.$project['id'] ?></strong> | ||
<?php endif ?> | ||
|
||
<span class="table-list-title <?= $project['is_active'] == 0 ? 'status-closed' : '' ?>"> | ||
<?= $this->url->link($this->text->e($project['name']), 'BoardViewController', 'show', array('project_id' => $project['id'])) ?> | ||
</span> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php if (! empty($images)): ?> | ||
<div class="file-thumbnails"> | ||
<?php foreach ($images as $file): ?> | ||
<div class="file-thumbnail"> | ||
<?= $this->app->component('image-slideshow', array( | ||
'images' => $images, | ||
'image' => $file, | ||
'regex' => 'FILE_ID', | ||
'url' => array( | ||
'image' => $this->url->to('FileViewerController', 'image', array('file_id' => 'FILE_ID', 'project_id' => $project['id'])), | ||
'thumbnail' => $this->url->to('FileViewerController', 'thumbnail', array('file_id' => 'FILE_ID', 'project_id' => $project['id'])), | ||
'download' => $this->url->to('FileViewerController', 'download', array('file_id' => 'FILE_ID', 'project_id' => $project['id'])), | ||
) | ||
)) ?> | ||
<?php | ||
$coverimage = $this->task->projectCoverimageModel->getCoverimage($project['id']); | ||
?> | ||
|
||
<div class="file-thumbnail-content"> | ||
<div class="file-thumbnail-title"> | ||
<div class="dropdown"> | ||
<a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->text->e($file['name']) ?> <i class="fa fa-caret-down"></i></a> | ||
<ul> | ||
<li> | ||
<?= $this->url->icon('external-link', t('View file'), 'FileViewerController', 'image', array('project_id' => $project['id'], 'file_id' => $file['id']), false, '', '', true) ?> | ||
</li> | ||
<li> | ||
<?= $this->url->icon('download', t('Download'), 'FileViewerController', 'download', array('project_id' => $project['id'], 'file_id' => $file['id'])) ?> | ||
</li> | ||
<?php if ($this->user->hasProjectAccess('ProjectFileController', 'remove', $project['id'])): ?> | ||
<li> | ||
<?= $this->modal->confirm('trash-o', t('Remove'), 'ProjectFileController', 'confirm', array('project_id' => $project['id'], 'file_id' => $file['id'])) ?> | ||
</li> | ||
<?php endif ?> | ||
<li> | ||
<i class="fa fa-newspaper-o fa-fw"></i> | ||
<?php if($file['id'] != $coverimage['id']){ ?> | ||
<?= $this->url->link(t('set as coverimage'), 'ProjectCoverimageController', 'set', array('plugin' => 'coverimage', 'project_id' => $project['id'], 'file_id' => $file['id'])) ?> | ||
<?php } else { ?> | ||
<?= $this->url->link(t('remove coverimage'), 'ProjectCoverimageController', 'remove', array('plugin' => 'coverimage', 'project_id' => $project['id'], 'file_id' => $file['id'])) ?> | ||
<?php } ?> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
<div class="file-thumbnail-description"> | ||
<?= $this->app->tooltipMarkdown(t('Uploaded: %s', $this->dt->datetime($file['date']))."\n\n".t('Size: %s', $this->text->bytes($file['size']))) ?> | ||
<?php if (! empty($file['user_id'])): ?> | ||
<?= t('Uploaded by %s', $file['user_name'] ?: $file['username']) ?> | ||
<?php else: ?> | ||
<?= t('Uploaded: %s', $this->dt->datetime($file['date'])) ?> | ||
<?php endif ?> | ||
</div> | ||
</div> | ||
</div> | ||
<?php endforeach ?> | ||
</div> | ||
<?php endif ?> | ||
|