report_html.php 1.29 KB
Newer Older
1
<?php
pana1990 committed
2

3
use yii\helpers\Html;
pana1990 committed
4

5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
?><!doctype html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>Translation report</title>

        <style>
            .diff ins {
                background: #cfc;
                text-decoration: none;
            }

            .diff del {
                background: #ffe6cc;
                text-decoration: none;
            }

            .ok {
                color: #99cc32;
            }

            .errors {
                color: #cc5129;
            }
        </style>
    </head>
    <body>
pana1990 committed
32
        <h1><?= Html::encode($title) ?></h1>
33 34

        <ul>
pana1990 committed
35 36
            <li><strong>Source:</strong> <?= Html::encode($sourcePath) ?></li>
            <li><strong>Translation:</strong> <?= Html::encode($translationPath) ?></li>
37 38
        </ul>

pana1990 committed
39 40 41 42
        <?php foreach($results as $name => $result): ?>
            <h2 class="<?= empty($result['errors']) ? 'ok' : 'errors' ?>"><?= $name ?></h2>
            <?php foreach($result['errors'] as $error): ?>
                <p><?= Html::encode($error) ?></p>
43
            <?php endforeach ?>
pana1990 committed
44 45 46
            <?php if (!empty($result['diff'])): ?>
                <code class="diff"><pre><?= $this->context->highlightDiff($result['diff']) ?></pre></code>
            <?php endif ?>
47 48 49
        <?php endforeach ?>
    </body>
</html>