fix: replace problematic code copy buttons with static pre blocks

Multi-line template literals in HTML attributes cause Alpine.js parsing
errors. Replaced @click="copyCode(...)" with static <pre><code> blocks.
Also simplified the x-text expression to use template literals.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-24 21:48:46 +01:00
parent 526c20afb8
commit 3cd4781724

View File

@@ -2612,7 +2612,7 @@ goToPage(n) { if (n !== '...' && n >= 1 && n <= this.totalPages) { this.paginati
</div>
<div class="ml-4 flex-1">
<h3 class="text-lg font-semibold text-gray-900 dark:text-white">Remove Platform</h3>
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400" x-text="'Are you sure you want to remove \"' + dynamicItemName + '\" from this admin?'"></p>
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400" x-text="`Are you sure you want to remove '${dynamicItemName}' from this admin?`"></p>
</div>
</div>
<div class="mt-6 flex justify-end gap-3">
@@ -2627,7 +2627,7 @@ goToPage(n) { if (n !== '...' && n >= 1 && n <= this.totalPages) { this.paginati
<div class="space-y-4">
<div>
<p class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Static Message (confirm_modal):</p>
<button @click="copyCode(`{% raw %}{% from 'shared/macros/modals.html' import confirm_modal %}
<pre class="bg-gray-100 dark:bg-gray-700 p-3 rounded-lg text-xs overflow-x-auto"><code>{% raw %}{% from 'shared/macros/modals.html' import confirm_modal %}
{{ confirm_modal(
'deleteConfirm',
@@ -2638,28 +2638,22 @@ goToPage(n) { if (n !== '...' && n >= 1 && n <= this.totalPages) { this.paginati
'Delete',
'Cancel',
'danger'
) }}{% endraw %}`)" class="text-sm text-purple-600 hover:text-purple-700 dark:text-purple-400 flex items-center">
<span x-html="$icon('duplicate', 'w-4 h-4 mr-1')"></span>
Copy Code
</button>
) }}{% endraw %}</code></pre>
</div>
<div>
<p class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Dynamic Message (confirm_modal_dynamic):</p>
<button @click="copyCode(`{% raw %}{% from 'shared/macros/modals.html' import confirm_modal_dynamic %}
<pre class="bg-gray-100 dark:bg-gray-700 p-3 rounded-lg text-xs overflow-x-auto"><code>{% raw %}{% from 'shared/macros/modals.html' import confirm_modal_dynamic %}
{{ confirm_modal_dynamic(
'removePlatformModal',
'Remove Platform',
\"'Are you sure you want to remove \"' + (platformToRemove?.name || '') + '\" from this admin?'\",
'confirmRemovePlatform()',
'showRemovePlatformModal',
"'Are you sure you want to remove \"' + (item?.name || '') + '\" ?'",
'confirmRemove()',
'showConfirmModal',
'Remove',
'Cancel',
'warning'
) }}{% endraw %}`)" class="text-sm text-purple-600 hover:text-purple-700 dark:text-purple-400 flex items-center">
<span x-html="$icon('duplicate', 'w-4 h-4 mr-1')"></span>
Copy Code
</button>
) }}{% endraw %}</code></pre>
</div>
</div>