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