Add file attachements to projects
This commit is contained in:
8
app/Template/project_overview/columns.php
Normal file
8
app/Template/project_overview/columns.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<div class="project-overview-columns">
|
||||
<?php foreach ($project['columns'] as $column): ?>
|
||||
<div class="project-overview-column">
|
||||
<strong title="<?= t('Task count') ?>"><?= $column['nb_tasks'] ?></strong><br>
|
||||
<span><?= $this->e($column['title']) ?></span>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
8
app/Template/project_overview/description.php
Normal file
8
app/Template/project_overview/description.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php if (! empty($project['description'])): ?>
|
||||
<div class="page-header">
|
||||
<h2><?= $this->e($project['name']) ?></h2>
|
||||
</div>
|
||||
<article class="markdown">
|
||||
<?= $this->text->markdown($project['description']) ?>
|
||||
</article>
|
||||
<?php endif ?>
|
||||
92
app/Template/project_overview/files.php
Normal file
92
app/Template/project_overview/files.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Attachments') ?></h2>
|
||||
<?php if ($this->user->hasProjectAccess('ProjectFile', 'create', $project['id'])): ?>
|
||||
<ul>
|
||||
<li>
|
||||
<i class="fa fa-plus fa-fw"></i>
|
||||
<?= $this->url->link(t('Upload a file'), 'ProjectFile', 'create', array('project_id' => $project['id']), false, 'popover') ?>
|
||||
</li>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
|
||||
<?php if (empty($files) && empty($images)): ?>
|
||||
<p class="alert"><?= t('There is no attachment at the moment.') ?></p>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (! empty($images)): ?>
|
||||
<div class="file-thumbnails">
|
||||
<?php foreach ($images as $file): ?>
|
||||
<div class="file-thumbnail">
|
||||
<a href="<?= $this->url->href('FileViewer', 'show', array('project_id' => $project['id'], 'file_id' => $file['id'])) ?>" class="popover"><img src="<?= $this->url->href('FileViewer', 'thumbnail', array('file_id' => $file['id'], 'project_id' => $project['id'])) ?>" title="<?= $this->e($file['name']) ?>" alt="<?= $this->e($file['name']) ?>"></a>
|
||||
<div class="file-thumbnail-content">
|
||||
<div class="file-thumbnail-title">
|
||||
<div class="dropdown">
|
||||
<a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->e($file['name']) ?> <i class="fa fa-caret-down"></i></a>
|
||||
<ul>
|
||||
<?php if ($this->user->hasProjectAccess('ProjectFile', 'remove', $project['id'])): ?>
|
||||
<li>
|
||||
<i class="fa fa-trash fa-fw"></i>
|
||||
<?= $this->url->link(t('Remove'), 'ProjectFile', 'confirm', array('project_id' => $project['id'], 'file_id' => $file['id']), false, 'popover') ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<li>
|
||||
<i class="fa fa-download fa-fw"></i>
|
||||
<?= $this->url->link(t('Download'), 'FileViewer', 'download', array('project_id' => $project['id'], 'file_id' => $file['id'])) ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="file-thumbnail-description">
|
||||
<span class="tooltip" title='<?= t('Uploaded: %s', $this->dt->datetime($file['date'])).'<br>'.t('Size: %s', $this->text->bytes($file['size'])) ?>'>
|
||||
<i class="fa fa-info-circle"></i>
|
||||
</span>
|
||||
<?= t('Uploaded by %s', $file['user_name'] ?: $file['username']) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (! empty($files)): ?>
|
||||
<table class="table-stripped">
|
||||
<tr>
|
||||
<th><?= t('Filename') ?></th>
|
||||
<th><?= t('Creator') ?></th>
|
||||
<th><?= t('Date') ?></th>
|
||||
<th><?= t('Size') ?></th>
|
||||
</tr>
|
||||
<?php foreach ($files as $file): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<i class="fa <?= $this->file->icon($file['name']) ?> fa-fw"></i>
|
||||
<div class="dropdown">
|
||||
<a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->e($file['name']) ?> <i class="fa fa-caret-down"></i></a>
|
||||
<ul>
|
||||
<?php if ($this->user->hasProjectAccess('ProjectFile', 'remove', $project['id'])): ?>
|
||||
<li>
|
||||
<i class="fa fa-trash fa-fw"></i>
|
||||
<?= $this->url->link(t('Remove'), 'ProjectFile', 'confirm', array('project_id' => $project['id'], 'file_id' => $file['id']), false, 'popover') ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<li>
|
||||
<i class="fa fa-download fa-fw"></i>
|
||||
<?= $this->url->link(t('Download'), 'FileViewer', 'download', array('project_id' => $project['id'], 'file_id' => $file['id'])) ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->e($file['user_name'] ?: $file['username']) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->dt->date($file['date']) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->text->bytes($file['size']) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</table>
|
||||
<?php endif ?>
|
||||
35
app/Template/project_overview/information.php
Normal file
35
app/Template/project_overview/information.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Information') ?></h2>
|
||||
</div>
|
||||
<div class="listing">
|
||||
<ul>
|
||||
<?php if ($project['owner_id'] > 0): ?>
|
||||
<li><?= t('Project owner: ') ?><strong><?= $this->e($project['owner_name'] ?: $project['owner_username']) ?></strong></li>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (! empty($users)): ?>
|
||||
<?php foreach ($roles as $role => $role_name): ?>
|
||||
<?php if (isset($users[$role])): ?>
|
||||
<li>
|
||||
<?= $role_name ?>:
|
||||
<strong><?= implode(', ', $users[$role]) ?></strong>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($project['start_date']): ?>
|
||||
<li><?= t('Start date: ').$this->dt->date($project['start_date']) ?></li>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($project['end_date']): ?>
|
||||
<li><?= t('End date: ').$this->dt->date($project['end_date']) ?></li>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($project['is_public']): ?>
|
||||
<li><i class="fa fa-share-alt"></i> <?= $this->url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?></li>
|
||||
<li><i class="fa fa-rss-square"></i> <?= $this->url->link(t('RSS feed'), 'feed', 'project', array('token' => $project['token']), false, '', '', true) ?></li>
|
||||
<li><i class="fa fa-calendar"></i> <?= $this->url->link(t('iCal feed'), 'ical', 'project', array('token' => $project['token'])) ?></li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -4,60 +4,10 @@
|
||||
'filters' => $filters,
|
||||
)) ?>
|
||||
|
||||
<div class="project-overview-columns">
|
||||
<?php foreach ($project['columns'] as $column): ?>
|
||||
<div class="project-overview-column">
|
||||
<strong title="<?= t('Task count') ?>"><?= $column['nb_tasks'] ?></strong><br>
|
||||
<span><?= $this->e($column['title']) ?></span>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
|
||||
<?php if (! empty($project['description'])): ?>
|
||||
<div class="page-header">
|
||||
<h2><?= $this->e($project['name']) ?></h2>
|
||||
</div>
|
||||
<article class="markdown">
|
||||
<?= $this->text->markdown($project['description']) ?>
|
||||
</article>
|
||||
<?php endif ?>
|
||||
|
||||
<div class="page-header">
|
||||
<h2><?= t('Information') ?></h2>
|
||||
</div>
|
||||
<div class="listing">
|
||||
<ul>
|
||||
|
||||
<?php if ($project['owner_id'] > 0): ?>
|
||||
<li><?= t('Project owner: ') ?><strong><?= $this->e($project['owner_name'] ?: $project['owner_username']) ?></strong></li>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (! empty($users)): ?>
|
||||
<?php foreach ($roles as $role => $role_name): ?>
|
||||
<?php if (isset($users[$role])): ?>
|
||||
<li>
|
||||
<?= $role_name ?>:
|
||||
<strong><?= implode(', ', $users[$role]) ?></strong>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($project['start_date']): ?>
|
||||
<li><?= t('Start date: ').$this->dt->date($project['start_date']) ?></li>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($project['end_date']): ?>
|
||||
<li><?= t('End date: ').$this->dt->date($project['end_date']) ?></li>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($project['is_public']): ?>
|
||||
<li><i class="fa fa-share-alt"></i> <?= $this->url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?></li>
|
||||
<li><i class="fa fa-rss-square"></i> <?= $this->url->link(t('RSS feed'), 'feed', 'project', array('token' => $project['token']), false, '', '', true) ?></li>
|
||||
<li><i class="fa fa-calendar"></i> <?= $this->url->link(t('iCal feed'), 'ical', 'project', array('token' => $project['token'])) ?></li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?= $this->render('project_overview/columns', array('project' => $project)) ?>
|
||||
<?= $this->render('project_overview/description', array('project' => $project)) ?>
|
||||
<?= $this->render('project_overview/files', array('project' => $project, 'images' => $images, 'files' => $files)) ?>
|
||||
<?= $this->render('project_overview/information', array('project' => $project, 'users' => $users, 'roles' => $roles)) ?>
|
||||
|
||||
<div class="page-header">
|
||||
<h2><?= t('Last activity') ?></h2>
|
||||
|
||||
Reference in New Issue
Block a user