fix w sugestiach
This commit is contained in:
4
app.py
4
app.py
@@ -2900,6 +2900,7 @@ def list_products():
|
||||
|
||||
|
||||
query_string = urlencode({k: v for k, v in request.args.items() if k != "page"})
|
||||
synced_names = set(suggestions_dict.keys())
|
||||
|
||||
return render_template(
|
||||
"admin/list_products.html",
|
||||
@@ -2912,7 +2913,8 @@ def list_products():
|
||||
total_pages=total_pages,
|
||||
query_string=query_string,
|
||||
total_items=total_items,
|
||||
usage_counts=usage_counts
|
||||
usage_counts=usage_counts,
|
||||
synced_names=synced_names
|
||||
)
|
||||
|
||||
|
||||
|
@@ -38,13 +38,14 @@
|
||||
</td>
|
||||
<td><span class="badge bg-secondary">{{ usage_counts.get(item.name.lower(), 0) }}</span></td>
|
||||
<td>
|
||||
{% set suggestion = suggestions_dict.get(item.name.lower()) %}
|
||||
{% set clean_name = item.name | replace('\xa0', ' ') | trim | lower %}
|
||||
{% set suggestion = suggestions_dict.get(clean_name) %}
|
||||
{% if suggestion %}
|
||||
✅ Istnieje (ID: {{ suggestion.id }})
|
||||
<button class="btn btn-sm btn-outline-danger ms-1 delete-suggestion-btn"
|
||||
<button class="btn btn-sm btn-outline-light ms-1 delete-suggestion-btn"
|
||||
data-suggestion-id="{{ suggestion.id }}">🗑️ Usuń</button>
|
||||
{% else %}
|
||||
<button class="btn btn-sm btn-outline-primary sync-btn" data-item-id="{{ item.id }}">🔄
|
||||
<button class="btn btn-sm btn-outline-light sync-btn" data-item-id="{{ item.id }}">🔄
|
||||
Synchronizuj</button>
|
||||
{% endif %}
|
||||
</td>
|
||||
@@ -84,7 +85,7 @@
|
||||
<td>{{ suggestion.id }}</td>
|
||||
<td class="fw-bold"><span class="badge bg-primary">{{ suggestion.name }}</span></td>
|
||||
<td>
|
||||
<button class="btn btn-sm btn-outline-danger delete-suggestion-btn"
|
||||
<button class="btn btn-sm btn-outline-light delete-suggestion-btn"
|
||||
data-suggestion-id="{{ suggestion.id }}">🗑️ Usuń</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
Reference in New Issue
Block a user