Skip to content
Snippets Groups Projects
index.php 2.37 KiB
Newer Older
<?php
/**
 * @var Migration[] $migrations
 * @var WebMigrateController $controller
 * @var string $target
 * @var string $branch
 * @var Migrator $migrator
 * @var int $offset
 * @var array $backlinks
 * @var array $descendants
 */
?>
<? if (count($migrations) === 0): ?>
    <?= MessageBox::info(_('Ihr System befindet sich auf dem aktuellen Stand.'))->hideClose() ?>
<? else: ?>
<form method="post" action="<?= $controller->link_for('migrate') ?>">
    <?= CSRFProtection::tokenTag() ?>
    <? if (isset($target)): ?>
        <input type="hidden" name="target" value="<?= htmlReady($target) ?>">
    <? endif ?>
    <input type="hidden" name="branch" value="<?= htmlReady($branch) ?>">

    <table class="default" id="migration-list">
        <caption>
            <?= _('Die hier aufgeführten Anpassungen werden beim Klick auf "Starten" ausgeführt:') ?>
        </caption>
        <colgroup>
            <col style="width: 24px">
            <col style="width: 120px">
            <col>
            <col>
        </colgroup>
        <thead>
            <tr>
                <th></th>
                <th><?= _('Nr.') ?></th>
                <th><?= _('Name') ?></th>
                <th><?= _('Beschreibung') ?></th>
            </tr>
        </thead>
        <tbody>
        <? foreach ($migrations as $number => $migration): ?>
            <? $version = $migrator->migrationBranchAndVersion($number) ?>
                    <? if ($version[0] === $branch): ?>
                        <input type="radio" name="target" value="<?= $version[1] + $offset ?>">
                    <? endif ?>
                </td>
                <td>
                    <?= htmlReady($number) ?>
                </td>
                <td>
Jan-Hendrik Willms's avatar
Jan-Hendrik Willms committed
                    <?= htmlReady($migration->getName()) ?>
                </td>
                <td>
                <? if ($migration->description()): ?>
                    <?= htmlReady($migration->description()) ?>
                <? else: ?>
                    <em><?= _('keine Beschreibung vorhanden') ?></em>
                <? endif ?>
                </td>
            </tr>
        <? endforeach; ?>
        </tbody>
        <tfoot>
            <tr>
                <td colspan="4">
                    <?= Studip\Button::createAccept(_('Starten'), 'start')?>
                </td>
            </tr>
        </tfoot>
    </table>
</form>
<? endif ?>