diff options
| author | winter | 2025-03-30 19:00:19 +0100 |
|---|---|---|
| committer | winter | 2025-03-30 19:00:19 +0100 |
| commit | cd10f94269d7dcdd93df9fcda142a1e5a4441ae9 (patch) | |
| tree | 75a00ef94c94259d3e6308d67e491b3800b47d89 /templates/interaction_button.php | |
| parent | c26a1dca22fcced7b9cd37ace7a20ae71491fd66 (diff) | |
implement basic interaction controls
Diffstat (limited to 'templates/interaction_button.php')
| -rw-r--r-- | templates/interaction_button.php | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/templates/interaction_button.php b/templates/interaction_button.php deleted file mode 100644 index 2b4fb82..0000000 --- a/templates/interaction_button.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -$active = $active ?? false; -$tooltip = match ($action) { - 'like' => __('note.action.like'), - 'dislike' => __('note.action.dislike'), - 'reshare' => __('note.action.reshare') -}; -$icon = match ($action) { - 'like' => $active ? 'favorite' : 'favorite-outline', - 'dislike' => $active ? 'heart-broken' : 'heart-broken-outline', - 'reshare' => $active ? 'repeat-on' : 'repeat' -}; -$id = "interactButton-$action-$note->id"; -?> -<div class="interactButtonContainer <?= $action . ($active ? ' active' : '') ?>"> - <button title="<?= $tooltip ?>" class="material-symbols <?= $icon ?>" - hx-post="<?= "/fragment/note/$note->id/$action" ?>" hx-swap="outerHTML" - hx-target="closest .interactButtonContainer" hx-disabled-elt="this" id="<?= $id ?>" - _="on htmx:afterOnLoad trigger update on #liveTimelineUpdater" <?= ($disabled ?? false) ? 'disabled' : '' ?>> - </button> - <label for="<?= $id ?>" class="interactionCount"><?= $count ?? '' ?></label> -</div>
\ No newline at end of file |
