aboutsummaryrefslogtreecommitdiff
path: root/app/views/admin/licenses/index.php
blob: ee545ce5fda5dd9a1f3f32e82945822a7788d1b0 (plain)
1
2
3
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<table class="default">
    <caption>
        <?= _("Lizenzen") ?>
    </caption>
    <thead>
        <tr>
            <th></th>
            <th><?= _("SPDX-Lizenzkürzel") ?></th>
            <th><?= _("Name") ?></th>
            <th class="actions"><?= _("Aktion") ?></th>
        </tr>
    </thead>
    <tbody>
        <? foreach ($licenses as $license) : ?>
        <tr>
            <td>
                <?= LicenseAvatar::getAvatar($license['identifier'])->getImageTag(Avatar::MEDIUM) ?>
            </td>
            <td><?= htmlReady($license['identifier']) ?></td>
            <td>
                <? if ($license['link']) : ?>
                <a href="<?= htmlReady($license['link']) ?>">
                <? endif ?>
                <?= htmlReady($license['name']) ?>
                <? if ($license['link']) : ?>
                </a>
                <? endif ?>
            </td>
            <td class="actions">
                <a href="<?= $controller->link_for("admin/licenses/edit", ['identifier' => $license['identifier']]) ?>" data-dialog>
                    <?= Icon::create("edit", "clickable")->asImg(20, ['class' => "text-bottom"]) ?>
                </a>
                <form action="<?= $controller->link_for("admin/licenses/delete", ['identifier' => $license->getId()]) ?>"
                      method="post"
                      data-confirm="<?= _("Wirklich löschen?") ?>"
                      class="inline">
                    <?= Icon::create("trash", "clickable")->asInput(20) ?>
                </form>
            </td>
        </tr>
        <? endforeach ?>
    </tbody>
</table>

<?

$actions = new ActionsWidget();
$actions->addLink(
    _("Lizenz erzeugen"),
    $controller->url_for("admin/licenses/edit"),
    Icon::create("add", "clickable"),
    ['data-dialog' => 1]
);
Sidebar::Get()->addWidget($actions);