feat: improve admin pricing modal quote count display to show period and total counts
This commit is contained in:
@@ -591,8 +591,21 @@ async function fetchPreview() {
|
||||
document.getElementById('modal-new-price').textContent =
|
||||
data.new_price ? '$' + parseFloat(data.new_price).toFixed(2) : '—';
|
||||
|
||||
// Update quote count
|
||||
document.getElementById('modal-quote-count').textContent = data.quote_count || 0;
|
||||
// Update quote count with new format "N (всего: M)"
|
||||
let quoteCountText = '';
|
||||
if (data.quote_count_period !== undefined && data.quote_count_total !== undefined) {
|
||||
if (data.quote_count_period === data.quote_count_total) {
|
||||
// If period count equals total count, just show the total
|
||||
quoteCountText = data.quote_count_total;
|
||||
} else {
|
||||
// Show both counts in format "N (всего: M)"
|
||||
quoteCountText = data.quote_count_period + ' (всего: ' + data.quote_count_total + ')';
|
||||
}
|
||||
} else {
|
||||
// Fallback for older API responses
|
||||
quoteCountText = data.quote_count || 0;
|
||||
}
|
||||
document.getElementById('modal-quote-count').textContent = quoteCountText;
|
||||
}
|
||||
} catch(e) {
|
||||
console.error('Preview fetch error:', e);
|
||||
|
||||
Reference in New Issue
Block a user