feat(admin): Add recommendations column to social audit dashboard
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions

Shows per-company recommendations: missing platforms, Facebook numeric
ID warning, etc. Color-coded by severity in a new "Zalecenia" column.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Maciej Pienczyn 2026-02-06 18:09:36 +01:00
parent d9322294be
commit 51b9176c10
2 changed files with 32 additions and 1 deletions

View File

@ -188,6 +188,23 @@ def admin_social_audit():
verified_dates = [p.get('verified_at') for p in sm_data.values() if p.get('verified_at')]
last_verified = max(verified_dates) if verified_dates else None
# Generate recommendations
recommendations = []
if not sm_data:
recommendations.append('Brak profili social media')
else:
fb = sm_data.get('facebook')
if not fb:
recommendations.append('Brak Facebook')
elif fb.get('url') and 'profile.php?id=' in fb['url']:
recommendations.append('Facebook: zmien adres na nazwe firmy')
if 'instagram' not in sm_data:
recommendations.append('Brak Instagram')
if 'linkedin' not in sm_data:
recommendations.append('Brak LinkedIn')
if 'youtube' not in sm_data:
recommendations.append('Brak YouTube')
companies.append({
'id': row.id,
'name': row.name,
@ -203,7 +220,8 @@ def admin_social_audit():
'has_linkedin': 'linkedin' in sm_data,
'has_youtube': 'youtube' in sm_data,
'has_twitter': 'twitter' in sm_data,
'has_tiktok': 'tiktok' in sm_data
'has_tiktok': 'tiktok' in sm_data,
'recommendations': recommendations
})
# Platform statistics

View File

@ -607,6 +607,7 @@
<th data-sort="followers">
Obserwujacy <span class="sort-icon"></span>
</th>
<th class="hide-mobile">Zalecenia</th>
<th data-sort="date" class="hide-mobile">
Weryfikacja <span class="sort-icon"></span>
</th>
@ -664,6 +665,18 @@
<span class="text-muted">-</span>
{% endif %}
</td>
<td class="hide-mobile" style="font-size: 11px; max-width: 200px;">
{% if company.recommendations %}
{% for rec in company.recommendations %}
<div style="padding: 2px 0; color: {{ '#991b1b' if 'Brak profili' in rec else ('#b45309' if 'zmien' in rec else '#6b7280') }};">
{% if 'zmien' in rec %}&#9888;{% elif 'Brak profili' in rec %}&#10060;{% else %}&#8226;{% endif %}
{{ rec }}
</div>
{% endfor %}
{% else %}
<span style="color: #059669;">&#10003; OK</span>
{% endif %}
</td>
<td class="date-cell hide-mobile">
{% if company.last_verified %}
{% set days_ago = (now - company.last_verified).days %}