Adjust the wizard's progress bar

Moved the "Modules" step to the left and removed the "Summary" step.

refs #8191
This commit is contained in:
Johannes Meyer 2015-01-20 17:33:29 +01:00
parent 2288e2a687
commit 095d9437b8
1 changed files with 19 additions and 26 deletions

View File

@ -4,7 +4,7 @@ use Icinga\Web\Notification;
$pages = $wizard->getPages();
$finished = isset($success);
$configPages = array_slice($pages, 2, count($pages) - 4, true);
$configPages = array_slice($pages, 3, count($pages) - 1, true);
$currentPos = array_search($wizard->getCurrentPage(), $pages, true);
list($configPagesLeft, $configPagesRight) = array_chunk($configPages, count($configPages) / 2, true);
@ -41,19 +41,32 @@ if ($notifications->hasMessages()) {
</tr></tbody></table>
</div>
<div class="step" style="width: 10%;">
<h1><?= mt('setup', 'Requirements', 'setup.progress'); ?></h1>
<h1><?= $this->translate('Modules', 'setup.progress'); ?></h1>
<?php $stateClass = $finished || $currentPos > 1 ? ' complete' : (
$maxProgress > 1 ? ' visited' : (
$currentPos === 1 ? ' active' : ''
)
); ?>
<table><tbody><tr>
<td class="left"><div class="line left<?= $stateClass; ?>"></div></td>
<td class="middle"><div class="bubble <?= $stateClass; ?>"></div></td>
<td class="right"><div class="line right <?= $stateClass; ?>"></div></td>
</tr></tbody></table>
</div>
<div class="step" style="width: 10%;">
<h1><?= mt('setup', 'Requirements', 'setup.progress'); ?></h1>
<?php $stateClass = $finished || $currentPos > 2 ? ' complete' : (
$maxProgress > 2 ? ' visited' : (
$currentPos === 2 ? ' active' : ''
)
); ?>
<table><tbody><tr>
<td class="left"><div class="line left<?= $stateClass; ?>"></div></td>
<td class="middle"><div class="bubble<?= $stateClass; ?>"></div></td>
<td class="right"><div class="line right<?= $stateClass; ?>"></div></td>
</tr></tbody></table>
</div>
<div class="step" style="width: 50%;">
<div class="step" style="width: 60%;">
<h1><?= mt('setup', 'Configuration', 'setup.progress'); ?></h1>
<table><tbody><tr>
<td class="left">
@ -64,7 +77,7 @@ if ($notifications->hasMessages()) {
?>
<?php foreach ($configPagesLeft as $pos => $page): ?>
<?php $stateClass = $finished || $pos < $currentPos ? ' complete' : (
$pos < $maxProgress ? ' visited' : ($currentPos > 1 ? ' active' : '')
$pos < $maxProgress ? ' visited' : ($currentPos > 2 ? ' active' : '')
); ?>
<?php if ($page === $firstPage): ?>
<div class="line left<?= $stateClass; ?>" style="float: left; width: <?= $lineWidth; ?>%; margin-right: 0"></div>
@ -78,7 +91,7 @@ if ($notifications->hasMessages()) {
<td class="middle">
<div class="bubble<?= array_key_exists($currentPos, $configPagesLeft) ? (
key($configPagesRight) <= $maxProgress ? ' visited' : ' active') : (
$finished || $currentPos > 1 ? ' complete' : (
$finished || $currentPos > 2 ? ' complete' : (
key($configPagesRight) < $maxProgress ? ' visited' : ''
)
); ?>"></div>
@ -91,7 +104,7 @@ if ($notifications->hasMessages()) {
?>
<?php foreach ($configPagesRight as $pos => $page): ?>
<?php $stateClass = $finished || $pos < $currentPos ? ' complete' : (
$pos < $maxProgress ? ' visited' : ($currentPos > 1 ? ' active' : '')
$pos < $maxProgress ? ' visited' : ($currentPos > 2 ? ' active' : '')
); ?>
<?php if ($page === $firstPage): ?>
<div class="line<?= $stateClass; ?>" style="float: left; width: <?= $lineWidth; ?>%; margin-left: -0.1em;"></div>
@ -104,26 +117,6 @@ if ($notifications->hasMessages()) {
</td>
</tr></tbody></table>
</div>
<div class="step" style="width: 10%;">
<h1><?= mt('setup', 'Modules', 'setup.progress'); ?></h1>
<?php $stateClass = $finished || $currentPos > count($pages) - 2 ? ' complete' : (
$maxProgress > count($pages) - 2 ? ' visited' : ($currentPos === count($pages) - 2 ? ' active' : '')
); ?>
<table><tbody><tr>
<td class="left"><div class="line left<?= $stateClass; ?>"></div></td>
<td class="middle"><div class="bubble<?= $stateClass; ?>"></div></td>
<td class="right"><div class="line right<?= $stateClass; ?>"></div></td>
</tr></tbody></table>
</div>
<div class="step" style="width: 10%;">
<h1><?= mt('setup', 'Summary', 'setup.progress'); ?></h1>
<?php $stateClass = $finished ? ' complete' : ($currentPos === count($pages) - 1 ? ' active' : ''); ?>
<table><tbody><tr>
<td class="left"><div class="line left<?= $stateClass; ?>"></div></td>
<td class="middle"><div class="bubble<?= $stateClass; ?>"></div></td>
<td class="right"><div class="line right<?= $stateClass; ?>"></div></td>
</tr></tbody></table>
</div>
<div class="step" style="width: 10%;">
<h1><?= mt('setup', 'Finish', 'setup.progress'); ?></h1>
<?php $stateClass = $finished ? ' active' : ''; ?>