Refactoring/rewrite of modal boxes handling

This commit is contained in:
Frederic Guillot
2017-01-02 17:01:27 -05:00
parent d49ce63e51
commit 3833c12ccc
173 changed files with 1526 additions and 1654 deletions

View File

@@ -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>
<?= $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
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">
<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,
)) ?>