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 @@
-
-
- = t('All files have been uploaded successfully.') ?>
- = $this->url->link(t('View uploaded files'), 'ProjectOverviewController', 'show', array('project_id' => $project['id'])) ?>
-
-
-
-
-
-
-
+= $this->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.'),
+)) ?>
-
-
- = t('or') ?>
- = $this->url->link(t('cancel'), 'ProjectOverviewController', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
-
+= $this->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 @@
= t('Do you really want to remove this file: "%s"?', $this->text->e($file['name'])) ?>
-
- = $this->url->link(t('Yes'), 'ProjectFileController', 'remove', array('project_id' => $project['id'], 'file_id' => $file['id']), true, 'btn btn-red') ?>
- = t('or') ?>
- = $this->url->link(t('cancel'), 'ProjectOverviewController', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
-
+ = $this->modal->confirmButtons(
+ 'ProjectFileController',
+ 'remove',
+ array('project_id' => $project['id'], 'file_id' => $file['id'])
+ ) ?>
--
cgit v1.2.3