Skip to content

Commit

Permalink
Wizard: Add restart button
Browse files Browse the repository at this point in the history
refs #9658
  • Loading branch information
N-o-X committed Dec 21, 2016
1 parent 361bfc5 commit 9b82ff1
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
10 changes: 10 additions & 0 deletions modules/setup/application/controllers/IndexController.php
Expand Up @@ -46,4 +46,14 @@ public function indexAction()

$this->view->wizard = $wizard;
}

/**
* Reset session and restart the wizard
*/
public function restartAction()
{
$wizard = new WebWizard();
$wizard->clearSession();
$this->redirectNow('setup');
}
}
20 changes: 20 additions & 0 deletions modules/setup/application/views/scripts/index/index.phtml
Expand Up @@ -133,6 +133,26 @@ if ($notifications->hasMessages()) {
</tr></tbody></table>
</div>
</div>
<?php
if ($currentPos > 2) {
$restartFormWidth = (3 + 3) * 10;
} else {
$restartFormWidth = $currentPos * 10 + 5;
}
?>
<?php
if ($currentPos !== count($pages) && $currentPos !== 0) {
?>
<div id="setup-restart-wrapper" style="overflow: hidden">
<form id="setup-restart-form" name="setup-restart-form" title="<?= $this->translate('Restart the setup'); ?>" method="post" action="<?= $this->href('setup/index/restart'); ?>" class="restart-form" style="width: <?= $restartFormWidth; ?>%">
<button id="setup-restart-button" name="setup-restart-button" type="submit" class="restart-button">
<?= $this->icon('reply-all'); ?>
</button>
</form>
</div>
<?php
}
?>
</div>
<div class="setup-content">
<?php if ($finished): ?>
Expand Down
24 changes: 23 additions & 1 deletion public/css/icinga/setup.less
Expand Up @@ -20,6 +20,28 @@
float: left;
}

.restart-form {
margin: 0em;
padding: 0em;
float: left;

.restart-button {
float: right;
background: none;
border: none;
color: #ffffff;
cursor: pointer;
outline: none;
font-size: 1.4em;
margin-right: -0.60em;
-moz-transform: scale(1, -1);
-webkit-transform: scale(1, -1);
-o-transform: scale(1, -1);
-ms-transform: scale(1, -1);
transform: scale(1, -1);
}
}

.progress-bar {
overflow: hidden;
padding-top: 1em;
Expand All @@ -36,7 +58,7 @@
}

table {
margin-top: 0.7em;
margin-top: 0.3em;

td {
padding: 0;
Expand Down

0 comments on commit 9b82ff1

Please sign in to comment.