aboutsummaryrefslogtreecommitdiff
path: root/views/list/item.php
blob: 577d56eacb1c45f42a50c48902e47006e15a1d19 (plain) (blame)
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
<section class="list" onclick="window.location.href = '/list/<?= $list->LID ?>'">
    <section>
        <div class="heading">
            <h2>
                <?= $list->Name ?>
            </h2>
            <a href="<?= '/user/' . $user->Username ?>" class="float-right">
                <?= $user->Username ?>
            </a>
        </div>
        <p>
            <?= $list->Description ?>
        </p>
    </section>
    <section name="itemButton" hidden>
        <?php if ($user !== null && $user->UID === $list->AuthorUID): ?>
            <form action="/list/update" method="GET">
                <input type="hidden" name="lid" value="<?= $list->LID ?>">
                <button title="Edit the list!"><?php include $VIEWS_DIR . '/img/edit.svg' ?></button>
            </form>
        <?php endif; ?>
        <?php if ($user !== null && ($user->UID === $list->AuthorUID || $user->Role === 'Admin')): ?>
            <form action="/list/delete" method="GET">
                <input type="hidden" name="lid" value="<?= $list->LID ?>">
                <button title="Delete the list!"><?php include $VIEWS_DIR . '/img/delete.svg' ?></button>
            </form>
        <?php endif; ?>
    </section>
</section>