mirror of
https://github.com/svemagie/blog-eleventy-indiekit.git
synced 2026-04-02 16:44:56 +02:00
fix: reply buttons on dynamic webmentions + owner comment form
- Add .wm-reply-btn button and .wm-owner-reply-slot to dynamically created reply elements (parity with build-time Nunjucks template) - Extract wireReplyButtons() so buttons are wired both on owner:detected and after dynamic replies are appended (fixes timing gap) - Use data-wired attribute to prevent double-wiring - Show comment form for site owner (isOwner) not just IndieAuth users - Fix "Signed in as" display to use ownerProfile when user is null Confab-Link: http://localhost:8080/sessions/184584f4-67e1-485a-aba8-02ac34a600fe
This commit is contained in:
@@ -46,12 +46,13 @@
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{# Comment form (shown when authenticated) #}
|
||||
<div x-show="user" x-cloak>
|
||||
{# Comment form (shown when authenticated via IndieAuth OR as site owner) #}
|
||||
<div x-show="user || isOwner" x-cloak>
|
||||
<div class="flex items-center gap-2 mb-3 text-sm text-surface-600 dark:text-surface-400">
|
||||
<span>Signed in as</span>
|
||||
<a x-bind:href="user?.url" class="font-medium hover:underline" x-text="user?.name || user?.url" target="_blank" rel="noopener"></a>
|
||||
<button x-on:click="signOut()" class="text-xs underline hover:no-underline">Sign out</button>
|
||||
<a x-bind:href="user?.url || ownerProfile?.url" class="font-medium hover:underline"
|
||||
x-text="user?.name || ownerProfile?.name || user?.url || 'Owner'" target="_blank" rel="noopener"></a>
|
||||
<button x-show="user" x-on:click="signOut()" class="text-xs underline hover:no-underline">Sign out</button>
|
||||
</div>
|
||||
|
||||
<form x-on:submit.prevent="submitComment()">
|
||||
|
||||
Reference in New Issue
Block a user