From 3833c12ccce59bcc49c4cfa892401973558f604d Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Mon, 2 Jan 2017 17:01:27 -0500 Subject: Refactoring/rewrite of modal boxes handling --- app/Template/project_file/create.php | 43 +++++++++++++----------------------- app/Template/project_file/remove.php | 10 ++++----- 2 files changed, 20 insertions(+), 33 deletions(-) (limited to 'app/Template/project_file') diff --git a/app/Template/project_file/create.php b/app/Template/project_file/create.php index e262799b..de35f87c 100644 --- a/app/Template/project_file/create.php +++ b/app/Template/project_file/create.php @@ -1,33 +1,20 @@ - - - -
-
- -
-
- - +app->component('file-upload', array( + 'maxSize' => $max_size, + 'url' => $this->url->to('ProjectFileController', 'save', array('project_id' => $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.'), +)) ?> -
- - - url->link(t('cancel'), 'ProjectOverviewController', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> -
+modal->submitButtons(array( + 'submitLabel' => t('Upload files'), + 'disabled' => true, +)) ?> diff --git a/app/Template/project_file/remove.php b/app/Template/project_file/remove.php index 0517a9e7..043b8fc8 100644 --- a/app/Template/project_file/remove.php +++ b/app/Template/project_file/remove.php @@ -7,9 +7,9 @@ text->e($file['name'])) ?>

-
- url->link(t('Yes'), 'ProjectFileController', 'remove', array('project_id' => $project['id'], 'file_id' => $file['id']), true, 'btn btn-red') ?> - - url->link(t('cancel'), 'ProjectOverviewController', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> -
+ modal->confirmButtons( + 'ProjectFileController', + 'remove', + array('project_id' => $project['id'], 'file_id' => $file['id']) + ) ?> -- cgit v1.2.3