{% extends "base.html" %} {% block title %}Social Media Analytics - Norda Biznes Partner{% endblock %} {% block extra_css %} {% endblock %} {% block content %}

Social Media Analytics

Pelny przeglad kont social media firm czlonkowskich

{{ companies_with_sm }}
Firm z Social Media
{{ companies_without_sm|length }}
Firm BEZ Social Media
{% for stat in platform_stats %}
{{ stat.companies }}
{{ stat.platform|title }}
{% endfor %}
{{ fresh_30d }}
Zweryfikowane < 30 dni
{{ stale_90d }}
Nieaktualne > 90 dni

Kombinacje platform Social Media

{% for combo, companies in platform_combos.items() %}

{% for platform in combo.split(', ') %} {{ platform|upper }} {% endfor %} {{ companies|length }}

{% for company in companies %} {{ company.name }} {% endfor %}
{% endfor %}

Analiza szczegolowa

Tylko Facebook {{ only_facebook|length }}

{% for c in only_facebook %} {{ c.name }} {% endfor %}

Tylko LinkedIn {{ only_linkedin|length }}

{% for c in only_linkedin %} {{ c.name }} {% endfor %}

Tylko Instagram {{ only_instagram|length }}

{% for c in only_instagram %} {{ c.name }} {% endfor %}

Wszystkie glowne (FB+LI+IG) {{ has_all_major|length }}

{% for c in has_all_major %} {{ c.name }} {% endfor %}

Firmy bez danych Social Media ({{ companies_without_sm|length }})

Te firmy wymagaja uzupelnienia danych o kontach social media.

{% for c in companies_without_sm|sort(attribute='name') %} {{ c.name }} {% endfor %}

Wszystkie wpisy Social Media

Filtruj platformy:
{% for entry in all_entries %} {% set sm = entry[0] %} {% endfor %}
Firma Platforma URL Zrodlo Zweryfikowano Status
{{ entry.company_name }} {{ sm.platform|upper }} {{ sm.url[:50] }}{% if sm.url|length > 50 %}...{% endif %} {{ sm.source or '-' }} {% set days_ago = (now - sm.verified_at).days if sm.verified_at else 999 %} {{ sm.verified_at.strftime('%Y-%m-%d') if sm.verified_at else '-' }} {% if sm.is_valid %}OK{% else %}Nieaktywny{% endif %}
{% endblock %} {% block extra_js %} const now = new Date(); // Active platform filters (empty = all) let activeFilters = new Set(); function showTab(tabName, clickedBtn) { // Hide all tabs document.querySelectorAll('.tab-content').forEach(el => el.classList.remove('active')); document.querySelectorAll('.tab').forEach(el => el.classList.remove('active')); // Show selected tab document.getElementById('tab-' + tabName).classList.add('active'); if (clickedBtn) clickedBtn.classList.add('active'); } function toggleFilter(platform, btn) { const allBtn = document.querySelector('.filter-btn[data-platform="all"]'); if (platform === 'all') { // Clear all filters, show everything activeFilters.clear(); document.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active')); allBtn.classList.add('active'); } else { // Toggle specific platform allBtn.classList.remove('active'); if (activeFilters.has(platform)) { activeFilters.delete(platform); btn.classList.remove('active'); } else { activeFilters.add(platform); btn.classList.add('active'); } // If no filters active, activate "all" if (activeFilters.size === 0) { allBtn.classList.add('active'); } } applyFilters(); } function applyFilters() { const table = document.getElementById('sm-table'); if (!table) return; const rows = table.querySelectorAll('tbody tr'); let visibleCount = 0; rows.forEach(row => { const platform = row.dataset.platform; if (activeFilters.size === 0 || activeFilters.has(platform)) { row.classList.remove('hidden-row'); visibleCount++; } else { row.classList.add('hidden-row'); } }); // Update count display const countEl = document.getElementById('filter-count'); if (countEl) { if (activeFilters.size === 0) { countEl.textContent = ''; } else { countEl.textContent = `Pokazano: ${visibleCount} z ${rows.length}`; } } } {% endblock %}