aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/note/attachment_pill.php
blob: 6fff74d3a9872d3561f40ba5c99de0654e40a7fd (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
<?php
$type ??= 'add';
?>

<?php if ($type == 'add'): ?>

    <button id="writeNoteAttachmentPillAdder" type="button" class="inlinePill" type="button"
        _="on click set f to #noteAttachmentFile then f.click()">
        <span class="pillIcon material-symbols add"></span>
        <span class="pillText"><?= __('writeNote.attachments.add.action') ?></span>
    </button>

<?php elseif ($type == 'file'): ?>

    <button class="inlinePill" type="button" _="on click remove me">
        <span class="pillIcon material-symbols attach-file"></span>
        <span class="pillText"><?= $name ?></span>
        <input type="hidden" name="attachments[]" value="<?= $oid ?>">
        <input type="hidden" name="altTexts[]" value="<?= $name ?>">
        <span class="pillIcon material-symbols close-small"></span>
    </button>

<?php elseif ($type == 'image'): ?>

    <div class="inlinePill imageAttachmentPill">
        <div class="row pillInfo">
            <span class="pillIcon material-symbols attach-file"></span>
            <span class="pillText"><?= $name ?></span>
        </div>
        <img src="<?= $href ?>">
        <input type="hidden" name="attachments[]" value="<?= $oid ?>">
        <div class="row">
            <label for="altText-<?= $oid ?>"><?= __('writeNote.attachments.altText.label') ?></label>
            <textarea id="altText-<?= $oid ?>" name="altTexts[]"></textarea>
        </div>
        <div class="row">
            <button type="button" class="secondary" _="on click remove closest .inlinePill">
                <span class="material-symbols close-small"></span>
                <?= __('writeNote.attachments.remove.action') ?>
            </button>
        </div>
    </div>

<?php endif; ?>