diff options
Diffstat (limited to 'app/Template/task_file')
-rw-r--r-- | app/Template/task_file/create.php | 43 | ||||
-rw-r--r-- | app/Template/task_file/files.php | 14 | ||||
-rw-r--r-- | app/Template/task_file/images.php | 20 | ||||
-rw-r--r-- | app/Template/task_file/remove.php | 10 | ||||
-rw-r--r-- | app/Template/task_file/screenshot.php | 10 |
5 files changed, 45 insertions, 52 deletions
diff --git a/app/Template/task_file/create.php b/app/Template/task_file/create.php index e05cf829..eebb08eb 100644 --- a/app/Template/task_file/create.php +++ b/app/Template/task_file/create.php @@ -1,33 +1,20 @@ <div class="page-header"> <h2><?= t('Attach a document') ?></h2> </div> -<div id="file-done" style="display:none"> - <p class="alert alert-success"> - <?= t('All files have been uploaded successfully.') ?> - <?= $this->url->link(t('View uploaded files'), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> - </p> -</div> - -<div id="file-error-max-size" style="display:none"> - <p class="alert alert-error"> - <?= t('The maximum allowed file size is %sB.', $this->text->bytes($max_size)) ?> - <a href="#" id="file-browser"><?= t('Choose files again') ?></a> - </p> -</div> -<div - id="file-dropzone" - data-max-size="<?= $max_size ?>" - data-url="<?= $this->url->href('TaskFileController', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"> - <div id="file-dropzone-inner"> - <?= t('Drag and drop your files here') ?> <?= t('or') ?> <a href="#" id="file-browser"><?= t('choose files') ?></a> - </div> -</div> - -<input type="file" name="files[]" multiple style="display:none" id="file-form-element"> +<?= $this->app->component('file-upload', array( + 'maxSize' => $max_size, + 'url' => $this->url->to('TaskFileController', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), + 'labelDropzone' => t('Drag and drop your files here'), + 'labelOr' => t('or'), + 'labelChooseFiles' => t('choose files'), + 'labelOversize' => t('The maximum allowed file size is %sB.', $this->text->bytes($max_size)), + 'labelSuccess' => t('All files have been uploaded successfully.'), + 'labelCloseSuccess' => t('Close this window'), + 'labelUploadError' => t('Unable to upload this file.'), +)) ?> -<div class="form-actions"> - <input type="submit" value="<?= t('Upload files') ?>" class="btn btn-blue" id="file-upload-button" disabled> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> -</div> +<?= $this->modal->submitButtons(array( + 'submitLabel' => t('Upload files'), + 'disabled' => true, +)) ?> diff --git a/app/Template/task_file/files.php b/app/Template/task_file/files.php index 7ca59b1c..28633dc4 100644 --- a/app/Template/task_file/files.php +++ b/app/Template/task_file/files.php @@ -1,5 +1,5 @@ <?php if (! empty($files)): ?> - <table class="table-stripped table-small"> + <table class="table-striped table-scrolling"> <tr> <th><?= t('Filename') ?></th> <th><?= t('Creator') ?></th> @@ -15,18 +15,20 @@ <ul> <?php if ($this->file->getPreviewType($file['name']) !== null): ?> <li> + <?= $this->modal->large('eye', t('View file'), 'FileViewerController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> + </li> + <?php elseif ($this->file->getBrowserViewType($file['name']) !== null): ?> + <li> <i class="fa fa-eye fa-fw"></i> - <?= $this->url->link(t('View file'), 'FileViewerController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?> + <?= $this->url->link(t('View file'), 'FileViewerController', 'browser', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, '', '', true) ?> </li> <?php endif ?> <li> - <i class="fa fa-download fa-fw"></i> - <?= $this->url->link(t('Download'), 'FileViewerController', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> + <?= $this->url->icon('download', t('Download'), 'FileViewerController', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> </li> <?php if ($this->user->hasProjectAccess('TaskFileController', 'remove', $task['project_id'])): ?> <li> - <i class="fa fa-trash fa-fw"></i> - <?= $this->url->link(t('Remove'), 'TaskFileController', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?> + <?= $this->modal->confirm('trash-o', t('Remove'), 'TaskFileController', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> </li> <?php endif ?> </ul> diff --git a/app/Template/task_file/images.php b/app/Template/task_file/images.php index 81c33151..2143455d 100644 --- a/app/Template/task_file/images.php +++ b/app/Template/task_file/images.php @@ -2,20 +2,28 @@ <div class="file-thumbnails"> <?php foreach ($images as $file): ?> <div class="file-thumbnail"> - <a href="<?= $this->url->href('FileViewerController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>" class="popover"><img src="<?= $this->url->href('FileViewerController', 'thumbnail', array('file_id' => $file['id'], 'project_id' => $task['project_id'], 'task_id' => $file['task_id'])) ?>" title="<?= $this->text->e($file['name']) ?>" alt="<?= $this->text->e($file['name']) ?>"></a> + <?= $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' => $task['project_id'], 'task_id' => $task['id'])), + 'thumbnail' => $this->url->to('FileViewerController', 'thumbnail', array('file_id' => 'FILE_ID', 'project_id' => $task['project_id'], 'task_id' => $task['id'])), + 'download' => $this->url->to('FileViewerController', 'download', array('file_id' => 'FILE_ID', 'project_id' => $task['project_id'], 'task_id' => $task['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> + <a href="#" class="dropdown-menu dropdown-menu-link-text" title="<?= $this->text->e($file['name']) ?>"><?= $this->text->e($file['name']) ?> <i class="fa fa-caret-down"></i></a> <ul> <li> - <i class="fa fa-download fa-fw"></i> - <?= $this->url->link(t('Download'), 'FileViewerController', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> + <?= $this->url->icon('download', t('Download'), 'FileViewerController', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> </li> <?php if ($this->user->hasProjectAccess('TaskFileController', 'remove', $task['project_id'])): ?> <li> - <i class="fa fa-trash fa-fw"></i> - <?= $this->url->link(t('Remove'), 'TaskFileController', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?> + <?= $this->modal->confirm('trash-o', t('Remove'), 'TaskFileController', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?> </li> <?php endif ?> </ul> diff --git a/app/Template/task_file/remove.php b/app/Template/task_file/remove.php index 42894f05..e7ffe560 100644 --- a/app/Template/task_file/remove.php +++ b/app/Template/task_file/remove.php @@ -7,9 +7,9 @@ <?= t('Do you really want to remove this file: "%s"?', $this->text->e($file['name'])) ?> </p> - <div class="form-actions"> - <?= $this->url->link(t('Yes'), 'TaskFileController', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), true, 'btn btn-red') ?> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> - </div> + <?= $this->modal->confirmButtons( + 'TaskFileController', + 'remove', + array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']) + ) ?> </div> diff --git a/app/Template/task_file/screenshot.php b/app/Template/task_file/screenshot.php index 6300159f..dad8c233 100644 --- a/app/Template/task_file/screenshot.php +++ b/app/Template/task_file/screenshot.php @@ -6,14 +6,10 @@ <p id="screenshot-inner"><?= t('Take a screenshot and press CTRL+V or ⌘+V to paste here.') ?></p> </div> -<form class="popover-form" action="<?= $this->url->href('TaskFileController', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" method="post"> - <input type="hidden" name="screenshot"/> +<form action="<?= $this->url->href('TaskFileController', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" method="post"> <?= $this->form->csrf() ?> - <div class="form-actions"> - <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?> - </div> + <?= $this->app->component('screenshot') ?> + <?= $this->modal->submitButtons() ?> </form> <p class="alert alert-info"><?= t('This feature does not work with all browsers.') ?></p> |