category changes
This commit is contained in:
parent
38ef6cb4d1
commit
54ffc41d46
|
|
@ -796,6 +796,7 @@
|
|||
<th style="padding: 12px; text-align: left; font-weight: 600; color: #333;">Status</th>
|
||||
<th style="padding: 12px; text-align: left; font-weight: 600; color: #333;">Root Category</th>
|
||||
<th style="padding: 12px; text-align: left; font-weight: 600; color: #333;">Path</th>
|
||||
<th style="padding: 12px; text-align: left; font-weight: 600; color: #333;">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="m2-categories-not-in-m1-tbody">
|
||||
|
|
@ -820,6 +821,14 @@
|
|||
@endif
|
||||
</td>
|
||||
<td style="padding: 10px 12px; font-size: 0.9em; color: #666;">{{ $category->path ?? 'N/A' }}</td>
|
||||
<td style="padding: 10px 12px;">
|
||||
<button
|
||||
class="tree-delete-btn"
|
||||
onclick="showDeleteConfirmPopup(this, {{ $category->entity_id }}, '{{ addslashes($category->name ?? 'Unnamed Category') }}', 'm2', false, 0)"
|
||||
title="Delete this category">
|
||||
Delete
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
|
@ -2247,6 +2256,12 @@ function refreshM2CategoriesNotInM1() {
|
|||
rootCategoryHtml = '<span style="color: #999;">N/A</span>';
|
||||
}
|
||||
|
||||
// Escape category name for use in JavaScript string
|
||||
const categoryNameEscaped = (category.name || 'Unnamed Category')
|
||||
.replace(/\\/g, '\\\\')
|
||||
.replace(/'/g, "\\'")
|
||||
.replace(/"/g, '\\"');
|
||||
|
||||
row.innerHTML = `
|
||||
<td style="padding: 10px 12px;">${category.entity_id}</td>
|
||||
<td style="padding: 10px 12px; font-weight: 500;">${category.name || 'Unnamed Category'}</td>
|
||||
|
|
@ -2256,6 +2271,14 @@ function refreshM2CategoriesNotInM1() {
|
|||
</td>
|
||||
<td style="padding: 10px 12px;">${rootCategoryHtml}</td>
|
||||
<td style="padding: 10px 12px; font-size: 0.9em; color: #666;">${category.path || 'N/A'}</td>
|
||||
<td style="padding: 10px 12px;">
|
||||
<button
|
||||
class="tree-delete-btn"
|
||||
onclick="showDeleteConfirmPopup(this, ${category.entity_id}, '${categoryNameEscaped}', 'm2', false, 0)"
|
||||
title="Delete this category">
|
||||
Delete
|
||||
</button>
|
||||
</td>
|
||||
`;
|
||||
|
||||
tbody.appendChild(row);
|
||||
|
|
|
|||
Loading…
Reference in New Issue