Commit 45690928 authored by Robert Lyon's avatar Robert Lyon

Bug 1363753: tidying up file extract page

Supressing form error and styling the error message / form button

behatnotneeded

Change-Id: I4d627bcd45afc028cd0b85159f5c57e2a5037709
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 0ef385ef
......@@ -77,6 +77,7 @@ if ($zipinfo) {
// no institution quotas yet
$quotaallowed = true;
}
$message = $quotaerror = false;
if ($quotaallowed) {
$name = $file->unzip_directory_name();
$message = get_string('fileswillbeextractedintofolder', 'artefact.file', $name['fullname']);
......@@ -95,6 +96,7 @@ if ($zipinfo) {
),
'submit' => array(
'type' => 'submitcancel',
'class' => 'btn btn-success',
'value' => array(get_string('Decompress', 'artefact.file'), get_string('cancel')),
'goto' => $goto,
)
......@@ -102,7 +104,8 @@ if ($zipinfo) {
));
}
else {
$message = get_string('insufficientquotaforunzip', 'artefact.file');
$form = '';
$quotaerror = '<div class="error alert alert-danger">' . get_string('insufficientquotaforunzip', 'artefact.file') . "</div>";
}
}
......@@ -110,6 +113,7 @@ $smarty = smarty(array(), array(), array(), $smartyconfig);
$smarty->assign('file', $file);
$smarty->assign('zipinfo', $zipinfo);
$smarty->assign('message', $message);
$smarty->assign('quotaerror', $quotaerror);
$smarty->assign('form', $form);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->display('artefact:file:extract.tpl');
......
......@@ -304,7 +304,7 @@ $string['createdtwothings'] = 'Created %s and %s.';
$string['filesextractedfromarchive'] = 'Files extracted from archive';
$string['filesextractedfromziparchive'] = 'Files extracted from Zip archive';
$string['fileswillbeextractedintofolder'] = 'Files will be extracted into %s';
$string['insufficientquotaforunzip'] = 'Your remaining file quota is too small to unzip this file.';
$string['insufficientquotaforunzip'] = 'Your remaining file quota is too small to unzip this file. You can either delete files to free up space or contact your administrator to have your quota increased.';
$string['invalidarchive'] = 'Error reading archive file.';
$string['pleasewaitwhileyourfilesarebeingunzipped'] = 'Please wait while your files are being unzipped.';
$string['spacerequired'] = 'Space required';
......
......@@ -9,7 +9,13 @@
<span><strong>{str tag=spacerequired section=artefact.file}:</strong> {$zipinfo->displaysize}</span>
</p>
{/if}
<p>{$message}</p>
<div class="mtl-md mbl-md">
{if $quotaerror}
{$quotaerror|safe}
{else}
{$message}
{/if}
</div>
{if $zipinfo}
{$form|safe}
<p>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment