diff options
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/menu_button.php | 2 | ||||
| -rw-r--r-- | templates/note.php | 23 |
2 files changed, 22 insertions, 3 deletions
diff --git a/templates/menu_button.php b/templates/menu_button.php index da47569..4d5dc48 100644 --- a/templates/menu_button.php +++ b/templates/menu_button.php @@ -4,7 +4,7 @@ set menu to next .popupMenu toggle @hidden on menu measure me then set pos to it - set menu.style.top to `${scrollY + pos.top}px` + set menu.style.top to `${(scrollY + pos.top) - 8}px` set menu.style.right to `${(scrollX + innerWidth) - pos.right}px` on click from elsewhere set @hidden of next .popupMenu to false "></button> diff --git a/templates/note.php b/templates/note.php index 4cdcd94..19a1895 100644 --- a/templates/note.php +++ b/templates/note.php @@ -15,6 +15,7 @@ if ($user != null) { $interactions = $note->getInteractionsWithAuthor($user->actor); $interKinds = array_map(fn($inter) => $inter->kind, $interactions); } +$pathToSelf = '/@/' . $note->author->getFullHandle() . '/note/' . $note->id; ?> <article class="note <?= ($selected ?? false) ? 'selected' : '' ?>"> @@ -33,8 +34,7 @@ if ($user != null) { <?php endif; ?> @<?= htmlspecialchars($note->author->getFullHandle()) ?> </span> - <a class="timestamp" - href="/@/<?= htmlspecialchars($note->author->getFullHandle()) ?>/note/<?= $note->id ?>"> + <a class="timestamp" href="<?= htmlspecialchars($pathToSelf) ?>"> <?= format_datetime($note->created, $prefs?->get('locale.timezone')) . (isset($note->modified) && $note->modified != $note->created ? ' (' . format_datetime($note->modified, $prefs?->get('locale.timezone')) . ')' @@ -126,6 +126,17 @@ if ($user != null) { global $note; $user = UserAccount::findByCurrentSession(); ?> + <li> + <button data-share-url="<?= htmlspecialchars($note->uri) ?>" _=" + on click + set url to my @data-share-url + js(url) + navigator.share({ url: url }) + end" type="button"> + <span class="material-symbols share"></span> + <span><?= __('action.share') ?></span> + </button> + </li> <?php if ($note->author->isLocal && ($note->author == $user?->actor || $user?->isAdmin)): ?> <li> <button hx-delete="/fragment/note/<?= $note->id ?>" @@ -136,6 +147,14 @@ if ($user != null) { </button> </li> <?php endif; ?> + <?php if (!$note->author->isLocal): ?> + <li> + <a target="_blank" href="<?= htmlspecialchars($note->uri) ?>" rel="nofollow noreferrer"> + <span class="material-symbols open-in-new"></span> + <span><?= __('note.openRemote') ?></span> + </a> + </li> + <?php endif; ?> <?php }); ?> </div> </div> |
