aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/attachment_pill.php
diff options
context:
space:
mode:
authorwinter2025-02-06 20:54:52 +0000
committerwinter2025-02-06 20:54:52 +0000
commit27c2a1df69001f979ad9ed5ffbac06fc106b9e30 (patch)
tree5f22e3ae15797d3add4659dd70e8d78917c4a9f6 /templates/attachment_pill.php
parent0c9c33d2f626c235ef24d9fabc723be11cd6088b (diff)
allow writing alt text on image attachments
Diffstat (limited to 'templates/attachment_pill.php')
-rw-r--r--templates/attachment_pill.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/templates/attachment_pill.php b/templates/attachment_pill.php
index 76fc590..6fff74d 100644
--- a/templates/attachment_pill.php
+++ b/templates/attachment_pill.php
@@ -16,7 +16,29 @@ $type ??= 'add';
<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; ?> \ No newline at end of file