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
Production moved from on-prem VM 249 (10.22.68.249) to OVH VPS (57.128.200.27, inpi-vps-waw01). Updated ALL documentation, slash commands, memory files, architecture docs, and deploy procedures. Added |local_time Jinja filter (UTC→Europe/Warsaw) and converted 155 .strftime() calls across 71 templates so timestamps display in Polish timezone regardless of server timezone. Also includes: created_by_id tracking, abort import fix, ICS calendar fix for missing end times, Pros Poland data cleanup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5432 lines
340 KiB
HTML
Executable File
5432 lines
340 KiB
HTML
Executable File
{% extends "base.html" %}
|
||
|
||
{% block title %}{{ company.name }} - Norda Biznes Partner{% endblock %}
|
||
|
||
{% block extra_css %}
|
||
<style>
|
||
.company-header {
|
||
background: white;
|
||
padding: var(--spacing-2xl);
|
||
border-radius: var(--radius-xl);
|
||
box-shadow: var(--shadow-lg);
|
||
margin-bottom: var(--spacing-xl);
|
||
}
|
||
|
||
.company-category-badge {
|
||
display: inline-block;
|
||
padding: var(--spacing-xs) var(--spacing-md);
|
||
background: var(--primary);
|
||
color: white;
|
||
border-radius: var(--radius);
|
||
font-size: var(--font-size-sm);
|
||
margin-bottom: var(--spacing-md);
|
||
}
|
||
|
||
.company-logo-header {
|
||
width: 240px;
|
||
height: 240px;
|
||
background: var(--background);
|
||
border-radius: var(--radius-lg);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
overflow: hidden;
|
||
box-shadow: var(--shadow);
|
||
margin-bottom: var(--spacing-md);
|
||
}
|
||
|
||
.company-logo-header.dark-bg {
|
||
background: #1a1a2e;
|
||
}
|
||
|
||
.company-logo-header img {
|
||
max-width: 90%;
|
||
max-height: 90%;
|
||
object-fit: contain;
|
||
}
|
||
|
||
.company-name {
|
||
font-size: var(--font-size-3xl);
|
||
color: var(--text-primary);
|
||
margin-bottom: var(--spacing-md);
|
||
}
|
||
|
||
.company-description {
|
||
font-size: var(--font-size-lg);
|
||
color: var(--text-secondary);
|
||
line-height: 1.8;
|
||
margin-bottom: var(--spacing-xl);
|
||
}
|
||
|
||
.contact-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||
gap: var(--spacing-md);
|
||
padding: var(--spacing-lg);
|
||
background: var(--background);
|
||
border-radius: var(--radius-lg);
|
||
}
|
||
|
||
.contact-item {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: var(--spacing-sm);
|
||
font-size: var(--font-size-base);
|
||
}
|
||
|
||
.contact-item svg {
|
||
color: var(--primary);
|
||
}
|
||
|
||
.contact-item a {
|
||
color: var(--primary);
|
||
text-decoration: none;
|
||
}
|
||
|
||
.contact-item a:hover {
|
||
text-decoration: underline;
|
||
}
|
||
|
||
.company-section {
|
||
background: white;
|
||
padding: var(--spacing-xl);
|
||
border-radius: var(--radius-xl);
|
||
box-shadow: var(--shadow);
|
||
margin-bottom: var(--spacing-xl);
|
||
}
|
||
|
||
.company-section.audit-collapsed .section-title {
|
||
cursor: pointer;
|
||
user-select: none;
|
||
display: flex;
|
||
align-items: center;
|
||
margin-bottom: 0;
|
||
}
|
||
|
||
.company-section.audit-collapsed .section-title::after {
|
||
content: '▼';
|
||
margin-left: auto;
|
||
font-size: 12px;
|
||
color: var(--text-secondary);
|
||
transition: transform 0.2s;
|
||
}
|
||
|
||
.company-section.audit-collapsed.audit-open .section-title::after {
|
||
transform: rotate(180deg);
|
||
}
|
||
|
||
.company-section.audit-collapsed .audit-body {
|
||
display: none;
|
||
margin-top: var(--spacing-md);
|
||
}
|
||
|
||
.company-section.audit-collapsed.audit-open .audit-body {
|
||
display: block;
|
||
}
|
||
|
||
.company-section.section-hidden {
|
||
opacity: 0.6;
|
||
border: 2px dashed var(--warning-color, #f59e0b);
|
||
}
|
||
.hidden-section-badge {
|
||
background: var(--warning-color, #f59e0b);
|
||
color: white;
|
||
padding: 4px 12px;
|
||
border-radius: var(--radius, 0.5rem);
|
||
font-size: 0.85rem;
|
||
margin-bottom: var(--spacing-sm, 8px);
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
}
|
||
.hidden-section-badge i { font-size: 0.9rem; }
|
||
|
||
.section-title {
|
||
font-size: var(--font-size-2xl);
|
||
color: var(--text-primary);
|
||
margin-bottom: var(--spacing-lg);
|
||
padding-bottom: var(--spacing-md);
|
||
border-bottom: 2px solid var(--border);
|
||
}
|
||
|
||
.info-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||
gap: var(--spacing-lg);
|
||
}
|
||
|
||
.info-item {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: var(--spacing-xs);
|
||
}
|
||
|
||
.info-label {
|
||
font-size: var(--font-size-sm);
|
||
color: var(--text-secondary);
|
||
text-transform: uppercase;
|
||
letter-spacing: 0.05em;
|
||
}
|
||
|
||
.info-value {
|
||
font-size: var(--font-size-lg);
|
||
font-weight: 600;
|
||
color: var(--text-primary);
|
||
}
|
||
|
||
.tags-container {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: var(--spacing-sm);
|
||
}
|
||
|
||
.tag {
|
||
padding: var(--spacing-xs) var(--spacing-md);
|
||
background: var(--background);
|
||
border: 1px solid var(--border);
|
||
border-radius: var(--radius);
|
||
font-size: var(--font-size-sm);
|
||
color: var(--text-secondary);
|
||
}
|
||
|
||
.tag.primary {
|
||
background: var(--primary);
|
||
color: white;
|
||
border-color: var(--primary);
|
||
}
|
||
|
||
.back-link {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: var(--spacing-sm);
|
||
color: var(--text-secondary);
|
||
text-decoration: none;
|
||
margin-bottom: var(--spacing-lg);
|
||
transition: var(--transition);
|
||
}
|
||
|
||
.back-link:hover {
|
||
color: var(--primary);
|
||
}
|
||
|
||
|
||
/* AI Enrichment Button */
|
||
.ai-enrich-btn {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: var(--spacing-sm);
|
||
padding: var(--spacing-sm) var(--spacing-lg);
|
||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||
color: white;
|
||
border: none;
|
||
border-radius: var(--radius);
|
||
font-size: var(--font-size-sm);
|
||
font-weight: 600;
|
||
cursor: pointer;
|
||
transition: all 0.3s ease;
|
||
}
|
||
|
||
.ai-enrich-btn:hover:not(:disabled) {
|
||
transform: translateY(-2px);
|
||
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
|
||
}
|
||
|
||
.ai-enrich-btn:disabled {
|
||
background: #ccc;
|
||
cursor: not-allowed;
|
||
opacity: 0.7;
|
||
}
|
||
|
||
/* Registry Enrichment Button */
|
||
.registry-enrich-btn {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: var(--spacing-sm);
|
||
padding: var(--spacing-sm) var(--spacing-lg);
|
||
background: linear-gradient(135deg, #0d9488 0%, #065f46 100%);
|
||
color: white;
|
||
border: none;
|
||
border-radius: var(--radius);
|
||
font-size: var(--font-size-sm);
|
||
font-weight: 600;
|
||
cursor: pointer;
|
||
transition: all 0.3s ease;
|
||
}
|
||
|
||
.registry-enrich-btn:hover:not(:disabled) {
|
||
transform: translateY(-2px);
|
||
box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
|
||
}
|
||
|
||
.registry-enrich-btn:disabled {
|
||
background: #ccc;
|
||
cursor: not-allowed;
|
||
opacity: 0.7;
|
||
}
|
||
|
||
.registry-enrich-btn .spinner {
|
||
display: none;
|
||
width: 14px;
|
||
height: 14px;
|
||
border: 2px solid rgba(255,255,255,0.3);
|
||
border-top-color: white;
|
||
border-radius: 50%;
|
||
animation: spin 0.8s linear infinite;
|
||
}
|
||
|
||
.registry-enrich-btn.loading .spinner { display: inline-block; }
|
||
.registry-enrich-btn.loading .btn-text { display: none; }
|
||
|
||
/* Logo Fetch Button */
|
||
.logo-fetch-btn {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: var(--spacing-sm);
|
||
padding: var(--spacing-sm) var(--spacing-lg);
|
||
background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
|
||
color: white;
|
||
border: none;
|
||
border-radius: var(--radius);
|
||
font-size: var(--font-size-sm);
|
||
font-weight: 600;
|
||
cursor: pointer;
|
||
transition: all 0.3s ease;
|
||
}
|
||
.logo-fetch-btn:hover:not(:disabled) {
|
||
transform: translateY(-2px);
|
||
box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
|
||
}
|
||
.logo-fetch-btn:disabled {
|
||
background: #ccc;
|
||
cursor: not-allowed;
|
||
opacity: 0.7;
|
||
}
|
||
.logo-fetch-btn .spinner {
|
||
display: none;
|
||
width: 14px;
|
||
height: 14px;
|
||
border: 2px solid rgba(255,255,255,0.3);
|
||
border-top-color: white;
|
||
border-radius: 50%;
|
||
animation: spin 0.8s linear infinite;
|
||
}
|
||
.logo-fetch-btn.loading .spinner { display: inline-block; }
|
||
.logo-fetch-btn.loading .btn-text { display: none; }
|
||
|
||
/* Logo Loading Overlay */
|
||
.logo-loading-overlay {
|
||
display: none;
|
||
position: fixed;
|
||
top: 0; left: 0; right: 0; bottom: 0;
|
||
background: rgba(0, 0, 0, 0.6);
|
||
z-index: 2000;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
.logo-loading-overlay.active {
|
||
display: flex;
|
||
}
|
||
.logo-loading-content {
|
||
background: white;
|
||
border-radius: var(--radius-xl);
|
||
padding: var(--spacing-2xl);
|
||
max-width: 500px;
|
||
width: 90%;
|
||
box-shadow: 0 20px 60px rgba(0,0,0,0.3);
|
||
}
|
||
.logo-loading-header {
|
||
text-align: center;
|
||
margin-bottom: var(--spacing-xl);
|
||
}
|
||
.logo-loading-header h3 {
|
||
font-size: var(--font-size-xl);
|
||
color: var(--text-primary);
|
||
margin: 0 0 var(--spacing-xs) 0;
|
||
}
|
||
.logo-loading-header p {
|
||
color: var(--text-secondary);
|
||
font-size: var(--font-size-sm);
|
||
margin: 0;
|
||
}
|
||
.logo-steps {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: var(--spacing-md);
|
||
}
|
||
.logo-step {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: var(--spacing-md);
|
||
padding: var(--spacing-sm) 0;
|
||
}
|
||
.logo-step-icon {
|
||
width: 28px;
|
||
height: 28px;
|
||
flex-shrink: 0;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
.logo-step-icon svg { width: 20px; height: 20px; }
|
||
.logo-step-icon.pending svg { color: #d1d5db; }
|
||
.logo-step-icon.in_progress svg { color: #f59e0b; animation: spin 1s linear infinite; }
|
||
.logo-step-icon.complete svg { color: #10b981; }
|
||
.logo-step-icon.error svg { color: #ef4444; }
|
||
.logo-step-icon.missing svg { color: #6b7280; }
|
||
.logo-step-icon.skipped svg { color: #9ca3af; }
|
||
|
||
/* Logo Gallery Modal */
|
||
.logo-gallery-overlay {
|
||
display: none;
|
||
position: fixed;
|
||
top: 0; left: 0; right: 0; bottom: 0;
|
||
background: rgba(0, 0, 0, 0.6);
|
||
z-index: 2100;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
.logo-gallery-overlay.active { display: flex; }
|
||
.logo-gallery-content {
|
||
background: white;
|
||
border-radius: var(--radius-xl);
|
||
padding: var(--spacing-2xl);
|
||
max-width: 700px;
|
||
width: 90%;
|
||
max-height: 85vh;
|
||
overflow-y: auto;
|
||
box-shadow: 0 20px 60px rgba(0,0,0,0.3);
|
||
}
|
||
.logo-gallery-content h3 {
|
||
text-align: center;
|
||
margin: 0 0 4px 0;
|
||
font-size: var(--font-size-xl);
|
||
color: var(--text-primary);
|
||
}
|
||
.logo-gallery-content .gallery-subtitle {
|
||
text-align: center;
|
||
color: var(--text-secondary);
|
||
font-size: var(--font-size-sm);
|
||
margin-bottom: var(--spacing-lg);
|
||
}
|
||
.logo-gallery-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
|
||
gap: var(--spacing-md);
|
||
margin-bottom: var(--spacing-xl);
|
||
}
|
||
.logo-gallery-item {
|
||
text-align: center;
|
||
cursor: pointer;
|
||
padding: var(--spacing-sm);
|
||
border-radius: var(--radius-lg);
|
||
border: 3px solid transparent;
|
||
transition: all 0.2s ease;
|
||
background: white;
|
||
}
|
||
.logo-gallery-item:hover { border-color: #e5e7eb; background: #fafafa; }
|
||
.logo-gallery-item.selected { border-color: #f59e0b; background: #fffbeb; }
|
||
.logo-gallery-item.current { border-color: #10b981; background: #ecfdf5; }
|
||
.logo-gallery-item .gallery-img {
|
||
width: 120px;
|
||
height: 120px;
|
||
margin: 0 auto var(--spacing-xs);
|
||
background: white;
|
||
border-radius: var(--radius);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
overflow: hidden;
|
||
border: 1px solid #e5e7eb;
|
||
}
|
||
.logo-gallery-item .gallery-img img {
|
||
max-width: 90%;
|
||
max-height: 90%;
|
||
object-fit: contain;
|
||
}
|
||
.logo-gallery-item .gallery-label {
|
||
font-size: 11px;
|
||
color: var(--text-secondary);
|
||
line-height: 1.3;
|
||
}
|
||
.logo-gallery-item .gallery-badge {
|
||
display: inline-block;
|
||
font-size: 10px;
|
||
padding: 1px 6px;
|
||
border-radius: 10px;
|
||
margin-top: 2px;
|
||
}
|
||
.logo-gallery-item.current .gallery-badge {
|
||
background: #d1fae5;
|
||
color: #065f46;
|
||
}
|
||
.logo-gallery-item.recommended { border-color: #f59e0b; }
|
||
.logo-gallery-item.recommended .gallery-badge.badge-recommended {
|
||
background: #fef3c7;
|
||
color: #92400e;
|
||
}
|
||
.logo-gallery-item .gallery-size {
|
||
font-size: 10px;
|
||
color: #9ca3af;
|
||
}
|
||
.logo-gallery-actions {
|
||
display: flex;
|
||
gap: var(--spacing-md);
|
||
justify-content: center;
|
||
}
|
||
.logo-gallery-actions button {
|
||
padding: var(--spacing-sm) var(--spacing-xl);
|
||
border: none;
|
||
border-radius: var(--radius);
|
||
font-size: var(--font-size-sm);
|
||
font-weight: 600;
|
||
cursor: pointer;
|
||
transition: all 0.2s ease;
|
||
}
|
||
.logo-gallery-actions .btn-cancel-gallery {
|
||
background: var(--background);
|
||
color: var(--text-primary);
|
||
border: 1px solid var(--border);
|
||
}
|
||
.logo-gallery-actions .btn-cancel-gallery:hover { background: var(--border); }
|
||
.logo-gallery-actions .btn-confirm-gallery {
|
||
background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
|
||
color: white;
|
||
}
|
||
.logo-gallery-actions .btn-confirm-gallery:hover {
|
||
box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
|
||
}
|
||
.logo-gallery-actions .btn-confirm-gallery:disabled {
|
||
opacity: 0.5;
|
||
cursor: not-allowed;
|
||
box-shadow: none;
|
||
}
|
||
|
||
.logo-step-text {
|
||
font-size: var(--font-size-sm);
|
||
color: var(--text-secondary);
|
||
}
|
||
.logo-step.active .logo-step-text { color: var(--text-primary); font-weight: 500; }
|
||
.logo-step.done .logo-step-text { color: var(--text-secondary); }
|
||
|
||
/* AI Progress Modal */
|
||
.ai-progress-modal {
|
||
display: none;
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
background: rgba(0, 0, 0, 0.6);
|
||
z-index: 2000;
|
||
align-items: center;
|
||
justify-content: center;
|
||
backdrop-filter: blur(4px);
|
||
}
|
||
|
||
.ai-progress-modal.active {
|
||
display: flex;
|
||
}
|
||
|
||
.ai-progress-content {
|
||
background: white;
|
||
border-radius: var(--radius-xl);
|
||
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
|
||
width: 90%;
|
||
max-width: 600px;
|
||
max-height: 85vh;
|
||
overflow-y: auto;
|
||
display: flex;
|
||
flex-direction: column;
|
||
animation: modalSlideIn 0.3s ease;
|
||
}
|
||
|
||
@keyframes modalSlideIn {
|
||
from { transform: translateY(-30px); opacity: 0; }
|
||
to { transform: translateY(0); opacity: 1; }
|
||
}
|
||
|
||
.ai-progress-header {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
padding: var(--spacing-lg) var(--spacing-xl);
|
||
border-bottom: 1px solid var(--border);
|
||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||
color: white;
|
||
}
|
||
|
||
.ai-progress-header h3 {
|
||
margin: 0;
|
||
font-size: var(--font-size-xl);
|
||
display: flex;
|
||
align-items: center;
|
||
gap: var(--spacing-sm);
|
||
}
|
||
|
||
.ai-progress-header .spinner-icon {
|
||
width: 24px;
|
||
height: 24px;
|
||
border: 3px solid rgba(255,255,255,0.3);
|
||
border-top-color: white;
|
||
border-radius: 50%;
|
||
animation: spin 0.8s linear infinite;
|
||
}
|
||
|
||
.ai-cancel-btn {
|
||
padding: var(--spacing-sm) var(--spacing-lg);
|
||
background: rgba(255,255,255,0.2);
|
||
color: white;
|
||
border: 1px solid rgba(255,255,255,0.3);
|
||
border-radius: var(--radius);
|
||
cursor: pointer;
|
||
font-weight: 600;
|
||
transition: all 0.2s;
|
||
}
|
||
|
||
.ai-cancel-btn:hover {
|
||
background: rgba(255,255,255,0.3);
|
||
}
|
||
|
||
.ai-progress-body {
|
||
padding: var(--spacing-xl);
|
||
}
|
||
|
||
.ai-progress-bar-container {
|
||
margin-bottom: var(--spacing-lg);
|
||
}
|
||
|
||
.ai-progress-bar-bg {
|
||
height: 28px;
|
||
background: var(--background);
|
||
border-radius: 14px;
|
||
overflow: hidden;
|
||
position: relative;
|
||
}
|
||
|
||
.ai-progress-bar {
|
||
height: 100%;
|
||
background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
|
||
border-radius: 14px;
|
||
transition: width 0.3s ease;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
min-width: 50px;
|
||
}
|
||
|
||
.ai-progress-bar span {
|
||
color: white;
|
||
font-weight: 700;
|
||
font-size: var(--font-size-sm);
|
||
text-shadow: 0 1px 2px rgba(0,0,0,0.3);
|
||
}
|
||
|
||
.ai-progress-status {
|
||
font-size: var(--font-size-base);
|
||
color: var(--text-secondary);
|
||
margin-bottom: var(--spacing-lg);
|
||
display: flex;
|
||
align-items: center;
|
||
gap: var(--spacing-sm);
|
||
}
|
||
|
||
.ai-progress-status .status-icon {
|
||
font-size: 1.2em;
|
||
}
|
||
|
||
.ai-progress-log {
|
||
background: var(--background);
|
||
border-radius: var(--radius-lg);
|
||
padding: var(--spacing-lg);
|
||
max-height: 300px;
|
||
overflow-y: auto;
|
||
font-family: monospace;
|
||
font-size: var(--font-size-sm);
|
||
}
|
||
|
||
.ai-log-entry {
|
||
padding: var(--spacing-sm) 0;
|
||
border-bottom: 1px solid var(--border);
|
||
display: flex;
|
||
align-items: flex-start;
|
||
gap: var(--spacing-sm);
|
||
}
|
||
|
||
.ai-log-entry:last-child {
|
||
border-bottom: none;
|
||
}
|
||
|
||
.ai-log-entry.step {
|
||
color: var(--text-primary);
|
||
font-weight: 600;
|
||
}
|
||
|
||
.ai-log-entry.success {
|
||
color: var(--success);
|
||
}
|
||
|
||
.ai-log-entry.error {
|
||
color: var(--error);
|
||
}
|
||
|
||
.ai-log-entry.info {
|
||
color: var(--text-secondary);
|
||
padding-left: var(--spacing-lg);
|
||
}
|
||
|
||
.ai-log-icon {
|
||
flex-shrink: 0;
|
||
width: 20px;
|
||
text-align: center;
|
||
}
|
||
|
||
.ai-progress-footer {
|
||
padding: var(--spacing-lg) var(--spacing-xl);
|
||
border-top: 1px solid var(--border);
|
||
background: var(--background);
|
||
display: flex;
|
||
justify-content: flex-end;
|
||
gap: var(--spacing-md);
|
||
position: sticky;
|
||
bottom: 0;
|
||
border-radius: 0 0 var(--radius-xl) var(--radius-xl);
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.ai-progress-footer .btn {
|
||
padding: var(--spacing-sm) var(--spacing-xl);
|
||
}
|
||
|
||
@keyframes spin {
|
||
to { transform: rotate(360deg); }
|
||
}
|
||
|
||
@keyframes pulse {
|
||
0%, 100% { opacity: 1; }
|
||
50% { opacity: 0.5; }
|
||
}
|
||
|
||
.ai-analyzing {
|
||
animation: pulse 1.5s ease-in-out infinite;
|
||
}
|
||
|
||
|
||
/* Contact Bar - Quick Access */
|
||
.contact-bar {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
align-items: center;
|
||
gap: var(--spacing-md);
|
||
padding: var(--spacing-lg);
|
||
background: white;
|
||
border-radius: var(--radius-xl);
|
||
box-shadow: var(--shadow);
|
||
margin-bottom: var(--spacing-xl);
|
||
}
|
||
|
||
.contact-bar-item {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: var(--spacing-sm);
|
||
padding: var(--spacing-sm) var(--spacing-md);
|
||
background: var(--background);
|
||
border-radius: var(--radius);
|
||
font-size: var(--font-size-base);
|
||
color: var(--text-secondary);
|
||
text-decoration: none;
|
||
transition: var(--transition);
|
||
border: 1px solid var(--border);
|
||
}
|
||
|
||
.contact-bar-item:hover {
|
||
background: var(--primary);
|
||
color: white;
|
||
border-color: var(--primary);
|
||
}
|
||
|
||
.contact-bar-item.disabled {
|
||
opacity: 0.5;
|
||
cursor: default;
|
||
pointer-events: none;
|
||
}
|
||
|
||
.contact-bar-item svg {
|
||
width: 18px;
|
||
height: 18px;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
/* Social Media Colors */
|
||
.contact-bar-item.social-facebook { color: #1877f2; border-color: #1877f2; }
|
||
.contact-bar-item.social-facebook:hover { background: #1877f2; color: white; }
|
||
|
||
.contact-bar-item.social-instagram { color: #e4405f; border-color: #e4405f; }
|
||
.contact-bar-item.social-instagram:hover { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); color: white; border-color: #e4405f; }
|
||
|
||
.contact-bar-item.social-linkedin { color: #0a66c2; border-color: #0a66c2; }
|
||
.contact-bar-item.social-linkedin:hover { background: #0a66c2; color: white; }
|
||
|
||
.contact-bar-item.social-youtube { color: #ff0000; border-color: #ff0000; }
|
||
.contact-bar-item.social-youtube:hover { background: #ff0000; color: white; }
|
||
|
||
.contact-bar-item.social-twitter { color: #000000; border-color: #000000; }
|
||
.contact-bar-item.social-twitter:hover { background: #000000; color: white; }
|
||
|
||
.contact-bar-item.social-tiktok { color: #000000; border-color: #000000; }
|
||
.contact-bar-item.social-tiktok:hover { background: #000000; color: white; }
|
||
|
||
/* Website type colors (driven by --wb-color CSS variable) */
|
||
.contact-bar-item.contact-bar-website {
|
||
color: var(--wb-color, #3b82f6);
|
||
border-color: var(--wb-color, #3b82f6);
|
||
}
|
||
.contact-bar-item.contact-bar-website:hover {
|
||
background: var(--wb-color, #3b82f6);
|
||
color: white;
|
||
border-color: var(--wb-color, #3b82f6);
|
||
}
|
||
|
||
/* GBP Audit link - styled as action button */
|
||
.contact-bar-item.gbp-audit { color: #4285f4; border-color: #4285f4; background: rgba(66, 133, 244, 0.05); }
|
||
.contact-bar-item.gbp-audit:hover { background: #4285f4; color: white; }
|
||
|
||
/* SEO Audit link - styled as action button */
|
||
.contact-bar-item.seo-audit { color: #16a34a; border-color: #16a34a; background: rgba(22, 163, 74, 0.05); }
|
||
.contact-bar-item.seo-audit:hover { background: #16a34a; color: white; }
|
||
|
||
/* Social Media Audit link - styled as action button */
|
||
.contact-bar-item.social-audit { color: #a855f7; border-color: #a855f7; background: rgba(168, 85, 247, 0.05); }
|
||
.contact-bar-item.social-audit:hover { background: #a855f7; color: white; }
|
||
|
||
/* IT Infrastructure Audit link - styled as action button (teal/cyan) */
|
||
.contact-bar-item.it-audit { color: #0891b2; border-color: #0891b2; background: rgba(8, 145, 178, 0.05); }
|
||
.contact-bar-item.it-audit:hover { background: #0891b2; color: white; }
|
||
|
||
@media (max-width: 768px) {
|
||
.contact-bar {
|
||
justify-content: center;
|
||
}
|
||
|
||
.contact-bar-item {
|
||
flex: 1 1 calc(50% - var(--spacing-md));
|
||
justify-content: center;
|
||
min-width: 140px;
|
||
}
|
||
}
|
||
|
||
/* SEO Section Responsive Styles */
|
||
@media (max-width: 1024px) {
|
||
#seo-metrics [style*="grid-template-columns: repeat(4"] {
|
||
grid-template-columns: repeat(2, 1fr) !important;
|
||
}
|
||
}
|
||
|
||
@media (max-width: 640px) {
|
||
#seo-metrics [style*="grid-template-columns: repeat(4"],
|
||
#seo-metrics [style*="grid-template-columns: repeat(3"],
|
||
#seo-metrics [style*="grid-template-columns: repeat(2"] {
|
||
grid-template-columns: 1fr !important;
|
||
}
|
||
}
|
||
|
||
/* Founding history sections */
|
||
.founding-history-content {
|
||
line-height: 1.6;
|
||
color: var(--text-secondary);
|
||
}
|
||
|
||
.history-sections {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: var(--spacing-sm);
|
||
}
|
||
|
||
.history-section {
|
||
padding: var(--spacing-md);
|
||
border-radius: var(--radius);
|
||
background: var(--background);
|
||
border: 1px solid var(--border);
|
||
}
|
||
|
||
.history-section-header {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: var(--spacing-sm);
|
||
margin-bottom: var(--spacing-sm);
|
||
}
|
||
|
||
.history-section-icon {
|
||
width: 28px;
|
||
height: 28px;
|
||
border-radius: 6px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
font-size: 14px;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.history-section-title {
|
||
font-weight: 600;
|
||
font-size: var(--font-size-sm);
|
||
color: var(--text-primary);
|
||
}
|
||
|
||
.history-list {
|
||
margin: 0;
|
||
padding-left: 1.2rem;
|
||
list-style: none;
|
||
}
|
||
|
||
.history-list li {
|
||
position: relative;
|
||
padding: 3px 0;
|
||
font-size: var(--font-size-sm);
|
||
color: var(--text-secondary);
|
||
line-height: 1.5;
|
||
}
|
||
|
||
.history-list li::before {
|
||
content: '';
|
||
position: absolute;
|
||
left: -1rem;
|
||
top: 11px;
|
||
width: 5px;
|
||
height: 5px;
|
||
border-radius: 50%;
|
||
background: #d1d5db;
|
||
}
|
||
|
||
.history-list li strong {
|
||
color: var(--text-primary);
|
||
font-weight: 500;
|
||
}
|
||
|
||
.history-text {
|
||
margin: var(--spacing-xs) 0 0;
|
||
font-size: var(--font-size-sm);
|
||
color: var(--text-secondary);
|
||
line-height: 1.6;
|
||
}
|
||
</style>
|
||
{% endblock %}
|
||
|
||
{% block content %}
|
||
<div style="display: flex; gap: var(--spacing-md, 16px); flex-wrap: wrap;">
|
||
<a href="{{ url_for('index') }}" class="back-link">
|
||
<svg width="20" height="20" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path d="M19 12H5M12 19l-7-7 7-7"/>
|
||
</svg>
|
||
Powrót do katalogu
|
||
</a>
|
||
{% if current_user.is_authenticated %}
|
||
<a href="{{ url_for('public.dashboard') }}" class="back-link">
|
||
<svg width="20" height="20" fill="none" stroke="currentColor" stroke-width="2">
|
||
<rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/>
|
||
</svg>
|
||
Mój pulpit
|
||
</a>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<div class="company-header">
|
||
<div class="company-logo-header {{ 'dark-bg' if company.logo_dark_bg else '' }}">
|
||
<img src="{{ url_for('static', filename='img/companies/' ~ company.slug ~ '.webp') }}"
|
||
alt="{{ company.name }}"
|
||
onerror="if(!this.dataset.triedSvg){this.dataset.triedSvg='1';this.src=this.src.replace('.webp','.svg')}else{this.parentElement.style.display='none'}">
|
||
</div>
|
||
|
||
{% if company.category %}
|
||
<span class="company-category-badge">{{ company.category.name }}</span>
|
||
{% endif %}
|
||
|
||
{# Badge jakości usunięty - zbędny i mylący dla użytkowników #}
|
||
|
||
<h1 class="company-name">{{ company.name }}</h1>
|
||
|
||
<!-- AI Enrichment Button + Edit Profile (hidden for guests) -->
|
||
{% if not is_guest %}
|
||
{% if can_enrich and profile_missing %}
|
||
<div style="margin: var(--spacing-md) 0 var(--spacing-xs) 0; font-size: 13px; color: var(--text-secondary);">
|
||
<div style="display: flex; align-items: center; gap: 8px; margin-bottom: 4px;">
|
||
<span style="font-weight: 600;">Profil {{ ((profile_filled / profile_total) * 100)|int }}%</span>
|
||
<div style="flex: 1; max-width: 120px; height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden;">
|
||
<div style="width: {{ ((profile_filled / profile_total) * 100)|int }}%; height: 100%; background: {% if profile_filled == profile_total %}#10b981{% elif profile_filled >= profile_total / 2 %}#f59e0b{% else %}#ef4444{% endif %}; border-radius: 3px;"></div>
|
||
</div>
|
||
</div>
|
||
<span style="font-size: 12px;">Brakuje: {{ profile_missing|join(', ') }}</span>
|
||
</div>
|
||
{% endif %}
|
||
<div style="margin: var(--spacing-xs) 0 var(--spacing-md) 0; display: flex; gap: var(--spacing-sm); flex-wrap: wrap; align-items: center;">
|
||
{% if can_edit_profile %}
|
||
<a href="{{ url_for('company_edit', company_id=company.id) }}" class="ai-enrich-btn" style="text-decoration: none;">
|
||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/>
|
||
<path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/>
|
||
</svg>
|
||
Edytuj profil
|
||
</a>
|
||
{% elif company_managers %}
|
||
<button type="button" class="ai-enrich-btn" onclick="document.getElementById('editPermissionModal').classList.add('active')">
|
||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/>
|
||
<path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/>
|
||
</svg>
|
||
Edytuj profil
|
||
</button>
|
||
{% endif %}
|
||
{% if can_enrich and profile_missing %}
|
||
<button
|
||
id="aiEnrichBtn"
|
||
class="ai-enrich-btn"
|
||
data-company-id="{{ company.id }}"
|
||
data-mode="fill"
|
||
title="Wypełni tylko puste pola — istniejące dane nie zostaną zmienione."
|
||
{% if not can_enrich %}disabled{% endif %}
|
||
>
|
||
<span class="spinner"></span>
|
||
<svg class="btn-text" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path d="M12 2L2 7l10 5 10-5-10-5z"/>
|
||
<path d="M2 17l10 5 10-5"/>
|
||
<path d="M2 12l10 5 10-5"/>
|
||
</svg>
|
||
<span class="btn-text">Uzupełnij brakujące</span>
|
||
</button>
|
||
{% endif %}
|
||
{% if can_enrich %}
|
||
<button
|
||
id="aiEnrichFullBtn"
|
||
class="ai-enrich-btn"
|
||
data-company-id="{{ company.id }}"
|
||
data-mode="full"
|
||
style="background: linear-gradient(135deg, #475569 0%, #334155 100%);"
|
||
title="Porówna istniejące dane z nowymi źródłami — pokażemy różnice do akceptacji."
|
||
{% if not can_enrich %}disabled{% endif %}
|
||
>
|
||
<span class="spinner"></span>
|
||
<svg class="btn-text" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path d="M12 2L2 7l10 5 10-5-10-5z"/>
|
||
<path d="M2 17l10 5 10-5"/>
|
||
<path d="M2 12l10 5 10-5"/>
|
||
</svg>
|
||
<span class="btn-text">Sprawdź aktualizacje</span>
|
||
</button>
|
||
{% endif %}
|
||
{% if is_admin %}
|
||
<button
|
||
id="registryEnrichBtn"
|
||
class="registry-enrich-btn"
|
||
data-company-id="{{ company.id }}"
|
||
data-nip="{{ effective_nip or company.nip or '' }}"
|
||
data-krs="{{ company.krs or '' }}"
|
||
>
|
||
<span class="spinner"></span>
|
||
<svg class="btn-text" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path d="M4 7V4h16v3"/>
|
||
<path d="M9 20h6"/>
|
||
<path d="M12 4v16"/>
|
||
<rect x="2" y="7" width="20" height="6" rx="1"/>
|
||
</svg>
|
||
<span class="btn-text">Pobierz dane urzędowe</span>
|
||
</button>
|
||
{% endif %}
|
||
{% if can_edit_profile or is_admin %}
|
||
<button
|
||
id="logoFetchBtn"
|
||
class="logo-fetch-btn"
|
||
data-company-id="{{ company.id }}"
|
||
{% if not company.website %}disabled title="Firma nie ma strony WWW"{% endif %}
|
||
>
|
||
<span class="spinner"></span>
|
||
<svg class="btn-text" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"/>
|
||
<circle cx="8.5" cy="8.5" r="1.5"/>
|
||
<polyline points="21 15 16 10 5 21"/>
|
||
</svg>
|
||
<span class="btn-text">Pobierz logo</span>
|
||
</button>
|
||
{% endif %}
|
||
{% if not can_enrich %}
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary); margin-left: var(--spacing-sm);">
|
||
(tylko admin lub wlasciciel)
|
||
</span>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}{# not is_guest #}
|
||
|
||
{% if company.description_short %}
|
||
<p class="company-description">{{ company.description_short }}</p>
|
||
{% endif %}
|
||
|
||
</div>
|
||
|
||
{% if is_guest %}
|
||
{# ===== GUEST VIEW: limited company profile with membership CTA ===== #}
|
||
<div style="margin-top: var(--spacing-xl); padding: var(--spacing-xl); background: linear-gradient(135deg, #f0f9ff, #eff6ff); border: 2px solid #93c5fd; border-radius: var(--radius-lg); text-align: center;">
|
||
<div style="font-size: 2.5em; margin-bottom: var(--spacing-md);">🔒</div>
|
||
<h2 style="color: #1e40af; margin-bottom: var(--spacing-sm);">Pełne informacje o firmie dostępne dla członków Izby</h2>
|
||
<p style="color: var(--text-secondary); max-width: 500px; margin: 0 auto var(--spacing-lg); line-height: 1.6;">
|
||
Aby zobaczyć dane kontaktowe, osoby w firmie, usługi, rekomendacje i więcej — złóż deklarację członkowską i dołącz do Izby Norda Biznes.
|
||
</p>
|
||
<a href="{{ url_for('membership.apply') }}" class="btn btn-primary" style="font-size: var(--font-size-lg); padding: var(--spacing-sm) var(--spacing-xl);">
|
||
Złóż deklarację członkowską →
|
||
</a>
|
||
</div>
|
||
{% else %}
|
||
{# ===== FULL MEMBER VIEW ===== #}
|
||
|
||
{% if company.address_street or company.address_city %}
|
||
{% set full_addr = ((company.address_street ~ ', ') if company.address_street else '') ~ ((company.address_postal ~ ' ') if company.address_postal else '') ~ (company.address_city or '') %}
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-sm); margin-bottom: var(--spacing-md); padding: var(--spacing-sm) var(--spacing-md); background: var(--surface); border: 1px solid var(--border-color, #e5e7eb); border-radius: var(--radius); font-size: var(--font-size-sm);">
|
||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="var(--primary)" stroke-width="2" style="flex-shrink: 0;">
|
||
<path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/>
|
||
<circle cx="12" cy="10" r="3"/>
|
||
</svg>
|
||
<a href="https://www.google.com/maps/search/?api=1&query={{ full_addr|urlencode }}" target="_blank" rel="noopener" style="color: var(--text-primary); text-decoration: none;" onmouseover="this.style.textDecoration='underline'" onmouseout="this.style.textDecoration='none'">
|
||
{{ full_addr }}
|
||
</a>
|
||
<a href="https://www.google.com/maps/search/?api=1&query={{ full_addr|urlencode }}" target="_blank" rel="noopener" style="margin-left: auto; color: var(--primary); font-weight: 500; text-decoration: none; font-size: var(--font-size-xs); white-space: nowrap;" onmouseover="this.style.textDecoration='underline'" onmouseout="this.style.textDecoration='none'">Pokaż na mapie →</a>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Convert social_media list to dict for contact bar -->
|
||
{% set sm_bar = {} %}
|
||
{% if social_media %}
|
||
{% for sm in social_media %}
|
||
{% if sm.is_valid != false %}
|
||
{% set _ = sm_bar.update({sm.platform: sm}) %}
|
||
{% endif %}
|
||
{% endfor %}
|
||
{% endif %}
|
||
|
||
<!-- PASEK KONTAKTOWY - szybki dostep -->
|
||
{# Website type config: color, label, tooltip, icon #}
|
||
{% set wtype_config = {
|
||
'website': {'color': '#3b82f6', 'icon': 'globe', 'default_label': 'WWW', 'tooltip': 'Strona internetowa firmy'},
|
||
'store': {'color': '#10b981', 'icon': 'cart', 'default_label': 'Sklep', 'tooltip': 'Sklep internetowy'},
|
||
'booking': {'color': '#8b5cf6', 'icon': 'calendar', 'default_label': 'Rezerwacje', 'tooltip': 'System rezerwacji'},
|
||
'blog': {'color': '#f59e0b', 'icon': 'pencil', 'default_label': 'Blog', 'tooltip': 'Blog / Aktualności'},
|
||
'portfolio': {'color': '#ec4899', 'icon': 'image', 'default_label': 'Portfolio', 'tooltip': 'Portfolio'},
|
||
'other': {'color': '#64748b', 'icon': 'globe', 'default_label': 'WWW', 'tooltip': 'Strona internetowa'}
|
||
} %}
|
||
<div class="contact-bar">
|
||
{% if company.websites %}
|
||
{% for w in company.websites %}
|
||
{% set cfg = wtype_config.get(w.website_type or 'website', wtype_config['website']) %}
|
||
<a href="{{ w.url|ensure_url }}" class="contact-bar-item contact-bar-website" target="_blank" rel="noopener noreferrer"
|
||
style="--wb-color: {{ cfg.color }};"
|
||
title="{{ w.label ~ ' — ' ~ w.url|replace('https://', '')|replace('http://', '')|replace('www.', '') if w.label else cfg.tooltip ~ ' — ' ~ w.url|replace('https://', '')|replace('http://', '')|replace('www.', '') }}">
|
||
{% if cfg.icon == 'cart' %}
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/><path d="M1 1h4l2.68 13.39a2 2 0 002 1.61h9.72a2 2 0 002-1.61L23 6H6"/></svg>
|
||
{% elif cfg.icon == 'calendar' %}
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
|
||
{% elif cfg.icon == 'pencil' %}
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 20h9"/><path d="M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4L16.5 3.5z"/></svg>
|
||
{% elif cfg.icon == 'image' %}
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>
|
||
{% else %}
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>
|
||
{% endif %}
|
||
<span>{{ w.label if w.label else cfg.default_label }}</span>
|
||
</a>
|
||
{% endfor %}
|
||
{% elif company.website %}
|
||
<a href="{{ company.website|ensure_url }}" class="contact-bar-item" target="_blank" rel="noopener noreferrer"
|
||
title="Strona internetowa firmy — {{ company.website|replace('https://', '')|replace('http://', '')|replace('www.', '') }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<circle cx="12" cy="12" r="10"/>
|
||
<path d="M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>
|
||
</svg>
|
||
<span>WWW</span>
|
||
</a>
|
||
{% else %}
|
||
<span class="contact-bar-item disabled">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<circle cx="12" cy="12" r="10"/>
|
||
<path d="M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>
|
||
</svg>
|
||
<span>Brak WWW</span>
|
||
</span>
|
||
{% endif %}
|
||
|
||
{% if company.email %}
|
||
<a href="mailto:{{ company.email }}" class="contact-bar-item">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/>
|
||
<polyline points="22,6 12,13 2,6"/>
|
||
</svg>
|
||
<span>Email</span>
|
||
</a>
|
||
{% else %}
|
||
<span class="contact-bar-item disabled">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/>
|
||
<polyline points="22,6 12,13 2,6"/>
|
||
</svg>
|
||
<span>Brak email</span>
|
||
</span>
|
||
{% endif %}
|
||
|
||
{% if company.phone %}
|
||
<a href="tel:{{ company.phone }}" class="contact-bar-item">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"/>
|
||
</svg>
|
||
<span>Telefon</span>
|
||
</a>
|
||
{% else %}
|
||
<span class="contact-bar-item disabled">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"/>
|
||
</svg>
|
||
<span>Brak telefonu</span>
|
||
</span>
|
||
{% endif %}
|
||
|
||
{% if company.address_city %}
|
||
{% set full_address = ((company.address_street ~ ', ') if company.address_street else '') ~ ((company.address_postal ~ ' ') if company.address_postal else '') ~ company.address_city %}
|
||
<a href="https://www.google.com/maps/search/?api=1&query={{ full_address|urlencode }}" target="_blank" rel="noopener" class="contact-bar-item" title="{{ full_address }}">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/>
|
||
<circle cx="12" cy="10" r="3"/>
|
||
</svg>
|
||
<span>{{ company.address_city }}</span>
|
||
</a>
|
||
{% else %}
|
||
<span class="contact-bar-item disabled">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/>
|
||
<circle cx="12" cy="10" r="3"/>
|
||
</svg>
|
||
<span>Brak lokalizacji</span>
|
||
</span>
|
||
{% endif %}
|
||
|
||
<!-- Social Media buttons - only show if company has profile -->
|
||
{% if sm_bar.get('facebook') %}
|
||
<a href="{{ sm_bar.facebook.url }}" class="contact-bar-item social-facebook" target="_blank" rel="noopener noreferrer" title="Facebook">
|
||
<svg viewBox="0 0 24 24" fill="currentColor">
|
||
<path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/>
|
||
</svg>
|
||
<span>Facebook</span>
|
||
</a>
|
||
{% endif %}
|
||
|
||
{% if sm_bar.get('instagram') %}
|
||
<a href="{{ sm_bar.instagram.url }}" class="contact-bar-item social-instagram" target="_blank" rel="noopener noreferrer" title="Instagram">
|
||
<svg viewBox="0 0 24 24" fill="currentColor">
|
||
<path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z"/>
|
||
</svg>
|
||
<span>Instagram</span>
|
||
</a>
|
||
{% endif %}
|
||
|
||
{% if sm_bar.get('linkedin') %}
|
||
<a href="{{ sm_bar.linkedin.url }}" class="contact-bar-item social-linkedin" target="_blank" rel="noopener noreferrer" title="LinkedIn">
|
||
<svg viewBox="0 0 24 24" fill="currentColor">
|
||
<path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/>
|
||
</svg>
|
||
<span>LinkedIn</span>
|
||
</a>
|
||
{% endif %}
|
||
|
||
{% if sm_bar.get('youtube') %}
|
||
<a href="{{ sm_bar.youtube.url }}" class="contact-bar-item social-youtube" target="_blank" rel="noopener noreferrer" title="YouTube">
|
||
<svg viewBox="0 0 24 24" fill="currentColor">
|
||
<path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/>
|
||
</svg>
|
||
<span>YouTube</span>
|
||
</a>
|
||
{% endif %}
|
||
|
||
{% if sm_bar.get('twitter') %}
|
||
<a href="{{ sm_bar.twitter.url }}" class="contact-bar-item social-twitter" target="_blank" rel="noopener noreferrer" title="X (Twitter)">
|
||
<svg viewBox="0 0 24 24" fill="currentColor">
|
||
<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>
|
||
</svg>
|
||
<span>X</span>
|
||
</a>
|
||
{% endif %}
|
||
|
||
{% if sm_bar.get('tiktok') %}
|
||
<a href="{{ sm_bar.tiktok.url }}" class="contact-bar-item social-tiktok" target="_blank" rel="noopener noreferrer" title="TikTok">
|
||
<svg viewBox="0 0 24 24" fill="currentColor">
|
||
<path d="M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"/>
|
||
</svg>
|
||
<span>TikTok</span>
|
||
</a>
|
||
{% endif %}
|
||
|
||
</div>
|
||
|
||
{# Audit links - separate row, visible only to authorized users #}
|
||
{% if is_audit_owner %}
|
||
<div class="contact-bar" style="margin-top: var(--spacing-sm, 8px);">
|
||
<a href="{{ url_for('gbp_audit_dashboard', slug=company.slug) }}" class="contact-bar-item gbp-audit" title="Audyt Google Business Profile">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
||
</svg>
|
||
<span>Audyt GBP</span>
|
||
</a>
|
||
<a href="{{ url_for('seo_audit_dashboard', slug=company.slug) }}" class="contact-bar-item seo-audit" title="Audyt SEO strony WWW">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
|
||
</svg>
|
||
<span>Audyt SEO</span>
|
||
</a>
|
||
<a href="{{ url_for('social_audit_dashboard', slug=company.slug) }}" class="contact-bar-item social-audit" title="Audyt Social Media">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path stroke-linecap="round" stroke-linejoin="round" d="M17 8h2a2 2 0 012 2v6a2 2 0 01-2 2h-2v4l-4-4H9a1.994 1.994 0 01-1.414-.586m0 0L11 14h4a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2v4l.586-.586z"/>
|
||
</svg>
|
||
<span>Audyt Social</span>
|
||
</a>
|
||
<a href="{{ url_for('it_audit_form', company_id=company.id) }}" class="contact-bar-item it-audit" title="Audyt Infrastruktury IT">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path stroke-linecap="round" stroke-linejoin="round" d="M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"/>
|
||
</svg>
|
||
<span>Audyt IT</span>
|
||
</a>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Godziny otwarcia z Google Business Profile -->
|
||
{% if website_analysis and website_analysis.google_opening_hours and website_analysis.google_opening_hours.weekday_text %}
|
||
{% set day_translations = {
|
||
'Monday': 'Poniedziałek',
|
||
'Tuesday': 'Wtorek',
|
||
'Wednesday': 'Środa',
|
||
'Thursday': 'Czwartek',
|
||
'Friday': 'Piątek',
|
||
'Saturday': 'Sobota',
|
||
'Sunday': 'Niedziela'
|
||
} %}
|
||
<div class="company-section">
|
||
<h2 class="section-title">Godziny otwarcia</h2>
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 1px solid var(--border);">
|
||
<div style="display: flex; align-items: flex-start; gap: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, #10b981, #059669); display: flex; align-items: center; justify-content: center; flex-shrink: 0;">
|
||
<svg width="24" height="24" fill="none" stroke="white" stroke-width="2" viewBox="0 0 24 24">
|
||
<circle cx="12" cy="12" r="10"/>
|
||
<polyline points="12 6 12 12 16 14"/>
|
||
</svg>
|
||
</div>
|
||
<div style="flex: 1;">
|
||
<div style="display: grid; gap: 4px;">
|
||
{% for line in website_analysis.google_opening_hours.weekday_text %}
|
||
{% set parts = line.split(': ', 1) %}
|
||
{% set day_en = parts[0] if parts|length > 1 else '' %}
|
||
{% set hours_text = parts[1] if parts|length > 1 else line %}
|
||
{% set day_pl = day_translations.get(day_en, day_en) %}
|
||
{% set is_closed = 'Closed' in hours_text %}
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: 6px 0; {% if not loop.last %}border-bottom: 1px solid var(--border);{% endif %}">
|
||
<span style="font-weight: 600; color: var(--text-primary); min-width: 120px;">{{ day_pl }}</span>
|
||
<span style="color: {% if is_closed %}#ef4444{% else %}var(--text-secondary){% endif %};">
|
||
{% if is_closed %}Zamknięte{% else %}{{ hours_text }}{% endif %}
|
||
</span>
|
||
</div>
|
||
{% endfor %}
|
||
</div>
|
||
{% if website_analysis.google_opening_hours.periods %}
|
||
<div id="openNowStatus" style="margin-top: var(--spacing-sm); padding-top: var(--spacing-sm); border-top: 1px solid var(--border);"></div>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- O firmie - Single Description (prioritized sources) -->
|
||
{% set about_description = company.description_full or (ai_insights.business_summary if ai_insights else none) or (website_analysis.content_summary if website_analysis else none) %}
|
||
{% set _about_hidden = company.is_section_hidden('about') %}
|
||
{% if about_description and (not _about_hidden or can_edit_profile or is_admin) %}
|
||
<div class="company-section {% if _about_hidden %}section-hidden{% endif %}">
|
||
{% if _about_hidden %}
|
||
<div class="hidden-section-badge"><i class="fas fa-eye-slash"></i> Ukryta — niewidoczna dla odwiedzających</div>
|
||
{% endif %}
|
||
<h2 class="section-title">O firmie</h2>
|
||
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 1px solid var(--border);">
|
||
<div style="display: flex; align-items: flex-start; gap: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, var(--primary), #6366f1); display: flex; align-items: center; justify-content: center; flex-shrink: 0;">
|
||
<svg width="24" height="24" fill="white" viewBox="0 0 24 24">
|
||
<path d="M12 7V3H2v18h20V7H12zM6 19H4v-2h2v2zm0-4H4v-2h2v2zm0-4H4V9h2v2zm0-4H4V5h2v2zm4 12H8v-2h2v2zm0-4H8v-2h2v2zm0-4H8V9h2v2zm0-4H8V5h2v2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8v10zm-2-8h-2v2h2v-2zm0 4h-2v2h2v-2z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="flex: 1; line-height: 1.8; color: var(--text-secondary);">
|
||
{{ about_description | safe }}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
{% if company.founding_history %}
|
||
<div style="margin-top: var(--spacing-lg); background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 1px solid var(--border);">
|
||
<div style="display: flex; align-items: flex-start; gap: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, #f59e0b, #d97706); display: flex; align-items: center; justify-content: center; flex-shrink: 0;">
|
||
<svg width="24" height="24" fill="white" viewBox="0 0 24 24"><path d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" fill="none" stroke="white" stroke-width="2"/></svg>
|
||
</div>
|
||
<div style="flex: 1;">
|
||
<h3 style="font-size: var(--font-size-base); font-weight: 600; color: var(--text-primary); margin: 0 0 var(--spacing-sm);">Historia i doświadczenie</h3>
|
||
<div class="founding-history-content">{{ company.founding_history | format_history }}</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
{% if company.core_values %}
|
||
<div style="margin-top: var(--spacing-lg); background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 1px solid var(--border);">
|
||
<div style="display: flex; align-items: flex-start; gap: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, #10b981, #059669); display: flex; align-items: center; justify-content: center; flex-shrink: 0;">
|
||
<svg width="24" height="24" fill="white" viewBox="0 0 24 24"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" fill="none" stroke="white" stroke-width="2"/></svg>
|
||
</div>
|
||
<div style="flex: 1;">
|
||
<h3 style="font-size: var(--font-size-base); font-weight: 600; color: var(--text-primary); margin: 0 0 var(--spacing-sm);">Wartości i misja</h3>
|
||
<div style="line-height: 1.8; color: var(--text-secondary);">{{ company.core_values | safe }}</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Usługi i kompetencje - Combined Section -->
|
||
{% set www_services = website_analysis.services_extracted if website_analysis and website_analysis.services_extracted else [] %}
|
||
{% set www_keywords = website_analysis.main_keywords if website_analysis and website_analysis.main_keywords else [] %}
|
||
|
||
{% set _services_hidden = company.is_section_hidden('services') %}
|
||
{% if (www_services or www_keywords or company.services or company.competencies or company.services_offered or company.technologies_used) and (not _services_hidden or can_edit_profile or is_admin) %}
|
||
<div class="company-section {% if _services_hidden %}section-hidden{% endif %}">
|
||
{% if _services_hidden %}
|
||
<div class="hidden-section-badge"><i class="fas fa-eye-slash"></i> Ukryta — niewidoczna dla odwiedzających</div>
|
||
{% endif %}
|
||
<h2 class="section-title">Usługi i kompetencje</h2>
|
||
|
||
{# Services description (text field from company edit) #}
|
||
{% if company.services_offered %}
|
||
<div style="margin-bottom: var(--spacing-lg); background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 1px solid var(--border);">
|
||
<div style="display: flex; align-items: flex-start; gap: var(--spacing-md);">
|
||
<div style="width: 32px; height: 32px; border-radius: 8px; background: #2E4872; display: flex; align-items: center; justify-content: center; flex-shrink: 0;">
|
||
<svg width="16" height="16" fill="white" viewBox="0 0 24 24"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z" fill="none" stroke="white" stroke-width="2"/></svg>
|
||
</div>
|
||
<div style="flex: 1; line-height: 1.8; color: var(--text-secondary);">{{ company.services_offered | safe }}</div>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
{# Technologies #}
|
||
{% if company.technologies_used %}
|
||
<div style="margin-bottom: var(--spacing-lg); background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 1px solid var(--border);">
|
||
<div style="display: flex; align-items: flex-start; gap: var(--spacing-md);">
|
||
<div style="width: 32px; height: 32px; border-radius: 8px; background: #6366f1; display: flex; align-items: center; justify-content: center; flex-shrink: 0;">
|
||
<svg width="16" height="16" fill="none" stroke="white" stroke-width="2" viewBox="0 0 24 24"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>
|
||
</div>
|
||
<div style="flex: 1;">
|
||
<h3 style="font-size: var(--font-size-sm); font-weight: 600; color: var(--text-primary); margin: 0 0 var(--spacing-xs);">Technologie i specjalizacje</h3>
|
||
<div style="line-height: 1.8; color: var(--text-secondary);">{{ company.technologies_used }}</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
{# Operational area & languages - compact row #}
|
||
{% if company.operational_area or company.languages_offered %}
|
||
<div style="margin-bottom: var(--spacing-lg); display: flex; gap: var(--spacing-md); flex-wrap: wrap;">
|
||
{% if company.operational_area %}
|
||
<div style="flex: 1; min-width: 200px; background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-md) var(--spacing-lg); border: 1px solid var(--border); display: flex; align-items: center; gap: var(--spacing-sm);">
|
||
<svg width="18" height="18" fill="none" stroke="var(--primary)" stroke-width="2" viewBox="0 0 24 24"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z"/><circle cx="12" cy="10" r="3"/></svg>
|
||
<div>
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-secondary); font-weight: 500;">Obszar działania</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-primary);">{{ company.operational_area }}</div>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
{% if company.languages_offered %}
|
||
<div style="flex: 1; min-width: 200px; background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-md) var(--spacing-lg); border: 1px solid var(--border); display: flex; align-items: center; gap: var(--spacing-sm);">
|
||
<svg width="18" height="18" fill="none" stroke="var(--primary)" stroke-width="2" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><path d="M2 12h20M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10A15.3 15.3 0 0112 2z"/></svg>
|
||
<div>
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-secondary); font-weight: 500;">Języki obsługi</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-primary);">{{ company.languages_offered }}</div>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
|
||
{# Company services from database #}
|
||
{% if company.services %}
|
||
<div style="margin-bottom: var(--spacing-lg);">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-sm); margin-bottom: var(--spacing-md);">
|
||
<div style="width: 32px; height: 32px; border-radius: 8px; background: #10b981; display: flex; align-items: center; justify-content: center;">
|
||
<svg width="16" height="16" fill="white" viewBox="0 0 24 24">
|
||
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
|
||
</svg>
|
||
</div>
|
||
<h3 style="font-size: var(--font-size-base); font-weight: 600; color: var(--text-primary); margin: 0;">Usługi</h3>
|
||
</div>
|
||
<div class="tags-container">
|
||
{% for cs in company.services %}
|
||
{% if cs.service %}
|
||
<span class="tag {% if cs.is_primary %}primary{% endif %}">{{ cs.service.name }}</span>
|
||
{% endif %}
|
||
{% endfor %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
{# Company competencies from database #}
|
||
{% if company.competencies %}
|
||
<div style="margin-bottom: var(--spacing-lg);">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-sm); margin-bottom: var(--spacing-md);">
|
||
<div style="width: 32px; height: 32px; border-radius: 8px; background: #6366f1; display: flex; align-items: center; justify-content: center;">
|
||
<svg width="16" height="16" fill="white" viewBox="0 0 24 24">
|
||
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/>
|
||
</svg>
|
||
</div>
|
||
<h3 style="font-size: var(--font-size-base); font-weight: 600; color: var(--text-primary); margin: 0;">Kompetencje</h3>
|
||
</div>
|
||
<div class="tags-container">
|
||
{% for cc in company.competencies %}
|
||
{% if cc.competency %}
|
||
<span class="tag">{{ cc.competency.name }}</span>
|
||
{% endif %}
|
||
{% endfor %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
{# Data from company website #}
|
||
{% if www_services or www_keywords %}
|
||
<div style="margin-top: var(--spacing-lg); padding-top: var(--spacing-lg); border-top: 1px solid var(--border);">
|
||
<div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--spacing-md);">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-sm);">
|
||
<div style="width: 32px; height: 32px; border-radius: 8px; background: #64748b; display: flex; align-items: center; justify-content: center;">
|
||
<svg width="16" height="16" fill="white" viewBox="0 0 24 24">
|
||
<circle cx="12" cy="12" r="10" fill="none" stroke="white" stroke-width="2"/>
|
||
<path d="M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" fill="none" stroke="white" stroke-width="2"/>
|
||
</svg>
|
||
</div>
|
||
<h3 style="font-size: var(--font-size-base); font-weight: 600; color: var(--text-primary); margin: 0;">Ze strony www firmy</h3>
|
||
</div>
|
||
{% if website_content and website_content.url %}
|
||
<a href="{{ website_content.url }}" target="_blank" rel="noopener noreferrer" style="font-size: var(--font-size-xs); color: var(--text-secondary); text-decoration: none;">
|
||
{{ website_content.url|replace('https://', '')|replace('http://', '')|truncate(30) }} →
|
||
</a>
|
||
{% endif %}
|
||
</div>
|
||
{% set max_svc = 15 %}
|
||
{% set max_kw = 10 %}
|
||
<div class="tags-container" id="wwwTagsVisible">
|
||
{% for service in www_services[:max_svc] %}
|
||
<span class="tag" style="background: #e2e8f0; color: #475569;">{{ service }}</span>
|
||
{% endfor %}
|
||
{% for keyword in www_keywords[:max_kw] %}
|
||
<span class="tag" style="background: #f1f5f9; color: #64748b; border: 1px dashed #cbd5e1;">{{ keyword }}</span>
|
||
{% endfor %}
|
||
{% if www_services|length > max_svc or www_keywords|length > max_kw %}
|
||
{% set extra_svc = www_services|length - max_svc if www_services|length > max_svc else 0 %}
|
||
{% set extra_kw = www_keywords|length - max_kw if www_keywords|length > max_kw else 0 %}
|
||
<button class="tag" style="background: #dbeafe; color: #1d4ed8; border: none; cursor: pointer; font-weight: 600;" onclick="document.getElementById('wwwTagsVisible').style.display='none';document.getElementById('wwwTagsAll').style.display='flex';">
|
||
+ jeszcze {{ extra_svc + extra_kw }}
|
||
</button>
|
||
{% endif %}
|
||
</div>
|
||
{% if www_services|length > max_svc or www_keywords|length > max_kw %}
|
||
<div class="tags-container" id="wwwTagsAll" style="display: none;">
|
||
{% for service in www_services %}
|
||
<span class="tag" style="background: #e2e8f0; color: #475569;">{{ service }}</span>
|
||
{% endfor %}
|
||
{% for keyword in www_keywords %}
|
||
<span class="tag" style="background: #f1f5f9; color: #64748b; border: 1px dashed #cbd5e1;">{{ keyword }}</span>
|
||
{% endfor %}
|
||
<button class="tag" style="background: #dbeafe; color: #1d4ed8; border: none; cursor: pointer; font-weight: 600;" onclick="document.getElementById('wwwTagsAll').style.display='none';document.getElementById('wwwTagsVisible').style.display='flex';">
|
||
zwiń
|
||
</button>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Zarząd i Wspólnicy Section (ukryte dla firm z danymi KRS API - dane są w sekcji "Dane z rejestrów urzędowych") -->
|
||
{% set _board_hidden = company.is_section_hidden('board') %}
|
||
{% if people and not (company.krs and company.data_source == 'KRS API') and (not _board_hidden or can_edit_profile or is_admin) %}
|
||
<div class="company-section {% if _board_hidden %}section-hidden{% endif %}">
|
||
{% if _board_hidden %}
|
||
<div class="hidden-section-badge"><i class="fas fa-eye-slash"></i> Ukryta — niewidoczna dla odwiedzających</div>
|
||
{% endif %}
|
||
<h2 class="section-title">Zarząd i Wspólnicy</h2>
|
||
|
||
{% set role_colors = {'zarzad': '#e74c3c', 'wspolnik': '#2ecc71', 'prokurent': '#f39c12', 'wlasciciel_jdg': '#9b59b6'} %}
|
||
{% set role_icons = {'zarzad': 'briefcase', 'wspolnik': 'users', 'prokurent': 'file-signature', 'wlasciciel_jdg': 'user-tie'} %}
|
||
{% set role_names = {'zarzad': 'Zarząd', 'wspolnik': 'Wspólnicy', 'prokurent': 'Prokurenci', 'wlasciciel_jdg': 'Właściciel JDG'} %}
|
||
|
||
{# Group people by role_category #}
|
||
{% set grouped = {} %}
|
||
{% for cp in people %}
|
||
{% if cp.role_category not in grouped %}
|
||
{% set _ = grouped.update({cp.role_category: []}) %}
|
||
{% endif %}
|
||
{% set _ = grouped[cp.role_category].append(cp) %}
|
||
{% endfor %}
|
||
|
||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--spacing-lg);">
|
||
{% for category in ['zarzad', 'wspolnik', 'prokurent', 'wlasciciel_jdg'] %}
|
||
{% if category in grouped %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid {{ role_colors[category] }};">
|
||
<h3 style="margin: 0 0 var(--spacing-md) 0; font-size: var(--font-size-lg); color: {{ role_colors[category] }}; display: flex; align-items: center; gap: var(--spacing-sm);">
|
||
{% if category == 'zarzad' %}
|
||
<svg width="20" height="20" fill="currentColor" viewBox="0 0 24 24"><path d="M20 7h-4V4c0-1.1-.9-2-2-2h-4c-1.1 0-2 .9-2 2v3H4c-1.1 0-2 .9-2 2v11c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2zM10 4h4v3h-4V4z"/></svg>
|
||
{% elif category == 'wspolnik' %}
|
||
<svg width="20" height="20" fill="currentColor" viewBox="0 0 24 24"><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></svg>
|
||
{% elif category == 'prokurent' %}
|
||
<svg width="20" height="20" fill="currentColor" viewBox="0 0 24 24"><path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-1 7V3.5L18.5 9H13z"/></svg>
|
||
{% else %}
|
||
<svg width="20" height="20" fill="currentColor" viewBox="0 0 24 24"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>
|
||
{% endif %}
|
||
{{ role_names[category] }}
|
||
</h3>
|
||
|
||
{% for cp in grouped[category] %}
|
||
<a href="{{ url_for('person_detail', person_id=cp.person.id) }}" style="display: block; padding: var(--spacing-sm) 0; {% if not loop.last %}border-bottom: 1px solid var(--border);{% endif %} text-decoration: none; transition: background 0.2s; margin: 0 calc(-1 * var(--spacing-sm)); padding-left: var(--spacing-sm); padding-right: var(--spacing-sm); border-radius: var(--radius);" onmouseover="this.style.background='var(--border)'" onmouseout="this.style.background='transparent'">
|
||
<div style="font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: var(--spacing-xs);">
|
||
{{ cp.person.imiona }} {{ cp.person.nazwisko }}
|
||
<svg width="14" height="14" fill="none" stroke="var(--text-secondary)" viewBox="0 0 24 24" style="opacity: 0.5;">
|
||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
|
||
</svg>
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary);">
|
||
{{ cp.role }}
|
||
{% if cp.shares_percent %}
|
||
<span style="margin-left: var(--spacing-sm); background: {{ role_colors[category] }}20; color: {{ role_colors[category] }}; padding: 2px 8px; border-radius: 4px; font-weight: 500;">
|
||
{{ '{:.2f}'.format(cp.shares_percent) }}% udziałów
|
||
</span>
|
||
{% endif %}
|
||
</div>
|
||
</a>
|
||
{% endfor %}
|
||
|
||
{# Source attribution for this category #}
|
||
{% set first_cp = grouped[category][0] %}
|
||
{% if first_cp.source %}
|
||
<div style="margin-top: var(--spacing-md); padding-top: var(--spacing-sm); border-top: 1px dashed var(--border); font-size: var(--font-size-xs); color: var(--text-secondary);">
|
||
Źródło: <strong style="color: {% if 'ekrs' in first_cp.source %}#10b981{% elif 'dane.biznes' in first_cp.source %}#3b82f6{% else %}#6b7280{% endif %};">
|
||
{% if 'ekrs' in first_cp.source %}ekrs.ms.gov.pl (KRS){% elif 'dane.biznes' in first_cp.source %}dane.biznes.gov.pl (CEIDG){% else %}{{ first_cp.source }}{% endif %}
|
||
</strong>
|
||
{% if first_cp.fetched_at %}
|
||
· Pobrano: {{ first_cp.fetched_at|local_time('%Y-%m-%d') }}
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
{% endfor %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Właściciel JDG Section (for sole proprietorships without KRS) -->
|
||
{% set _owner_hidden = company.is_section_hidden('owner_info') %}
|
||
{% if company.owner_first_name and not company.krs and not people and (not _owner_hidden or can_edit_profile or is_admin) %}
|
||
<div class="company-section {% if _owner_hidden %}section-hidden{% endif %}">
|
||
{% if _owner_hidden %}
|
||
<div class="hidden-section-badge"><i class="fas fa-eye-slash"></i> Ukryta — niewidoczna dla odwiedzających</div>
|
||
{% endif %}
|
||
<h2 class="section-title">Właściciel</h2>
|
||
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-lg); padding: var(--spacing-lg); background: var(--background); border-radius: var(--radius-lg); border-left: 4px solid #9b59b6;">
|
||
<div style="width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, #9b59b6, #3498db); display: flex; align-items: center; justify-content: center; flex-shrink: 0;">
|
||
<svg width="32" height="32" fill="white" viewBox="0 0 24 24">
|
||
<path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/>
|
||
</svg>
|
||
</div>
|
||
<div>
|
||
<div style="font-weight: 700; font-size: var(--font-size-xl); color: var(--text-primary);">
|
||
{{ company.owner_first_name }} {{ company.owner_last_name }}
|
||
</div>
|
||
<div style="font-size: var(--font-size-base); color: var(--text-secondary); margin-top: 4px;">
|
||
Właściciel jednoosobowej działalności gospodarczej
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-muted); margin-top: var(--spacing-md);">
|
||
Źródło: <a href="https://dane.biznes.gov.pl" target="_blank" style="color: #9b59b6;">CEIDG</a> • Dane publiczne
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Powiązania z projektami ZOPK -->
|
||
{% if zopk_links %}
|
||
<div class="company-section" style="background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%); border: 1px solid #bbf7d0;">
|
||
<h2 class="section-title" style="color: #059669;">Zielony Okręg Przemysłowy Kaszubia</h2>
|
||
<p style="font-size: var(--font-size-sm); color: var(--text-secondary); margin-bottom: var(--spacing-md);">
|
||
Projekty strategiczne, w których ta firma może uczestniczyć jako dostawca lub partner
|
||
</p>
|
||
<div style="display: grid; gap: var(--spacing-md);">
|
||
{% for link in zopk_links %}
|
||
<div style="display: flex; gap: var(--spacing-md); padding: var(--spacing-md); background: white; border-radius: var(--radius); border: 1px solid #d1fae5;">
|
||
<div style="flex-shrink: 0; width: 48px; height: 48px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
|
||
{% if link.project.project_type == 'energy' %}background: #fef3c7;{% elif link.project.project_type == 'technology' %}background: #dbeafe;{% elif link.project.project_type == 'defense' %}background: #fce7f3;{% else %}background: #f3f4f6;{% endif %}">
|
||
{% if link.project.project_type == 'energy' %}⚡{% elif link.project.project_type == 'technology' %}💻{% elif link.project.project_type == 'defense' %}🛡️{% else %}🏗️{% endif %}
|
||
</div>
|
||
<div style="flex: 1; min-width: 0;">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-sm); margin-bottom: 4px; flex-wrap: wrap;">
|
||
<strong style="color: var(--text-primary);">{{ link.project.name }}</strong>
|
||
<span style="font-size: 11px; padding: 1px 8px; border-radius: 4px; background: #d1fae5; color: #065f46; font-weight: 600;">
|
||
{% if link.link_type == 'potential_supplier' %}potencjalny dostawca{% elif link.link_type == 'partner' %}partner{% elif link.link_type == 'beneficiary' %}beneficjent{% else %}{{ link.link_type }}{% endif %}
|
||
</span>
|
||
</div>
|
||
{% if link.collaboration_description %}
|
||
<p style="font-size: var(--font-size-sm); color: var(--text-secondary); margin: 0; line-height: 1.5;">
|
||
{{ link.collaboration_description }}
|
||
</p>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
{% endfor %}
|
||
</div>
|
||
<div style="text-align: center; margin-top: var(--spacing-md);">
|
||
<a href="{{ url_for('public.zopk_index') }}" style="font-size: var(--font-size-sm); color: #059669; text-decoration: none;">
|
||
Dowiedz się więcej o ZOPK →
|
||
</a>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Osoby kontaktowe w firmie (portal users linked to company) -->
|
||
{% set _contacts_hidden = company.is_section_hidden('company_users') %}
|
||
{% if company_users and (not _contacts_hidden or can_edit_profile or is_admin) %}
|
||
<div class="company-section {% if _contacts_hidden %}section-hidden{% endif %}">
|
||
{% if _contacts_hidden %}
|
||
<div class="hidden-section-badge"><i class="fas fa-eye-slash"></i> Ukryta — niewidoczna dla odwiedzających</div>
|
||
{% endif %}
|
||
<h2 class="section-title">Osoby kontaktowe</h2>
|
||
|
||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--spacing-md);">
|
||
{% for uc in company_users %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--spacing-sm);">
|
||
{# Name + role header #}
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-sm); flex-wrap: wrap;">
|
||
<a href="{{ url_for('public.user_profile', user_id=uc.user.id) }}" style="width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #3b82f6, #8b5cf6); display: flex; align-items: center; justify-content: center; flex-shrink: 0; text-decoration: none; color: white; overflow: hidden;">
|
||
{% if uc.user.avatar_path %}
|
||
<img src="{{ url_for('static', filename=uc.user.avatar_path) }}" style="width: 100%; height: 100%; object-fit: cover;">
|
||
{% else %}
|
||
<svg width="20" height="20" fill="white" viewBox="0 0 24 24"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>
|
||
{% endif %}
|
||
</a>
|
||
<div style="flex: 1; min-width: 0;">
|
||
<a href="{{ url_for('public.user_profile', user_id=uc.user.id) }}" style="font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; text-decoration: none;" onmouseover="this.style.textDecoration='underline'" onmouseout="this.style.textDecoration='none'">
|
||
{{ uc.user.name or 'Użytkownik' }}
|
||
</a>
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-xs); flex-wrap: wrap; margin-top: 2px;">
|
||
{% if uc.role == 'MANAGER' %}
|
||
<span style="font-size: 11px; background: #dbeafe; color: #1d4ed8; padding: 2px 8px; border-radius: 4px; font-weight: 600;">Zarządzający</span>
|
||
{% elif uc.role == 'OWNER' %}
|
||
<span style="font-size: 11px; background: #fef3c7; color: #92400e; padding: 2px 8px; border-radius: 4px; font-weight: 600;">Właściciel</span>
|
||
{% elif uc.role == 'EMPLOYEE' %}
|
||
<span style="font-size: 11px; background: #f3f4f6; color: #4b5563; padding: 2px 8px; border-radius: 4px; font-weight: 600;">Pracownik</span>
|
||
{% endif %}
|
||
{% if uc.user.chamber_role_label %}
|
||
{% set _cr = uc.user.chamber_role %}
|
||
<span style="font-size: 11px; background: {{ '#fef3c7' if _cr == 'prezes' else '#dbeafe' if _cr == 'wiceprezes' else '#f3e8ff' if _cr == 'komisja_rewizyjna' else '#f3f4f6' if _cr == 'sad_kolezenski' else '#ecfdf5' }}; color: {{ '#92400e' if _cr == 'prezes' else '#1d4ed8' if _cr == 'wiceprezes' else '#6b21a8' if _cr == 'komisja_rewizyjna' else '#4b5563' if _cr == 'sad_kolezenski' else '#065f46' }}; padding: 2px 8px; border-radius: 4px; font-weight: 600;">{{ uc.user.chamber_role_label }}</span>
|
||
{% endif %}
|
||
{% if uc.user.is_norda_member %}
|
||
<span style="font-size: 11px; background: #ecfdf5; color: #065f46; padding: 2px 8px; border-radius: 4px; font-weight: 600;">Norda</span>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
{# Phone (text info) #}
|
||
{% if uc.user.phone and uc.user.privacy_show_phone != False %}
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-xs); font-size: var(--font-size-sm); color: var(--text-secondary);">
|
||
<svg width="14" height="14" fill="currentColor" viewBox="0 0 24 24"><path d="M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z"/></svg>
|
||
<a href="tel:{{ uc.user.phone }}" style="color: var(--text-secondary); text-decoration: none;">{{ uc.user.phone }}</a>
|
||
</div>
|
||
{% endif %}
|
||
|
||
{# Action buttons #}
|
||
<div style="display: flex; flex-direction: column; gap: var(--spacing-xs); margin-top: auto;">
|
||
{% if uc.user.email and uc.user.privacy_show_email != False %}
|
||
<a href="mailto:{{ uc.user.email }}" style="display: flex; align-items: center; gap: var(--spacing-sm); padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--border); text-decoration: none; color: var(--text-primary); font-size: var(--font-size-sm); transition: all 0.2s;" onmouseover="this.style.borderColor='var(--primary)';this.style.background='#f0f7ff'" onmouseout="this.style.borderColor='var(--border)';this.style.background='transparent'">
|
||
<svg width="16" height="16" fill="#6b7280" viewBox="0 0 24 24" style="flex-shrink: 0;"><path d="M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>
|
||
<div style="min-width: 0;">
|
||
<div style="font-weight: 500; color: var(--text-primary);">Wyślij e-mail</div>
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">{{ uc.user.email }}</div>
|
||
</div>
|
||
</a>
|
||
{% endif %}
|
||
<a href="{{ url_for('messages.messages_new', to=uc.user.id, company=company.id) }}" style="display: flex; align-items: center; gap: var(--spacing-sm); padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--primary); text-decoration: none; color: var(--text-primary); font-size: var(--font-size-sm); transition: all 0.2s; background: #f0f7ff;" onmouseover="this.style.background='var(--primary)';this.querySelector('.pm-label').style.color='white';this.querySelector('.pm-desc').style.color='rgba(255,255,255,0.8)';this.querySelector('svg').style.fill='white'" onmouseout="this.style.background='#f0f7ff';this.querySelector('.pm-label').style.color='var(--text-primary)';this.querySelector('.pm-desc').style.color='var(--text-muted)';this.querySelector('svg').style.fill='var(--primary)'">
|
||
<svg width="16" height="16" fill="var(--primary)" viewBox="0 0 24 24" style="flex-shrink: 0;"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"/></svg>
|
||
<div style="min-width: 0;">
|
||
<div class="pm-label" style="font-weight: 500; color: var(--text-primary);">Wiadomość prywatna</div>
|
||
<div class="pm-desc" style="font-size: var(--font-size-xs); color: var(--text-muted);">na portalu Norda Biznes</div>
|
||
</div>
|
||
</a>
|
||
</div>
|
||
|
||
{# Contact preferences #}
|
||
{% if uc.user.contact_prefer_email or uc.user.contact_prefer_phone or uc.user.contact_prefer_portal or uc.user.contact_note %}
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-muted); padding-top: var(--spacing-xs); border-top: 1px solid var(--border);">
|
||
{% if uc.user.contact_prefer_email or uc.user.contact_prefer_phone or uc.user.contact_prefer_portal %}
|
||
Preferuje kontakt:
|
||
{% if uc.user.contact_prefer_email %}email{% endif %}{% if uc.user.contact_prefer_phone %}{% if uc.user.contact_prefer_email %}, {% endif %}telefon{% endif %}{% if uc.user.contact_prefer_portal %}{% if uc.user.contact_prefer_email or uc.user.contact_prefer_phone %}, {% endif %}portal{% endif %}
|
||
{% endif %}
|
||
{% if uc.user.contact_note %}
|
||
<div style="font-style: italic; margin-top: 2px;">{{ uc.user.contact_note }}</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endfor %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- ============================================================ -->
|
||
<!-- DANE Z REJESTRÓW URZĘDOWYCH (CEIDG / KRS) -->
|
||
<!-- ============================================================ -->
|
||
{% set _registry_hidden = company.is_section_hidden('registry') %}
|
||
{% if (company.ceidg_id or (company.krs and company.data_source == 'KRS API')) and (not _registry_hidden or can_edit_profile or is_admin) %}
|
||
<div class="company-section {% if _registry_hidden %}section-hidden{% endif %}">
|
||
{% if _registry_hidden %}
|
||
<div class="hidden-section-badge"><i class="fas fa-eye-slash"></i> Ukryta — niewidoczna dla odwiedzających</div>
|
||
{% endif %}
|
||
<h2 class="section-title">
|
||
Dane z rejestrów urzędowych
|
||
{% if company.ceidg_id %}
|
||
<span style="background: #059669; color: white; font-size: 11px; padding: 4px 10px; border-radius: 20px; margin-left: 12px; font-weight: 600;">CEIDG</span>
|
||
{% elif company.krs and company.data_source == 'KRS API' %}
|
||
<span style="background: #2563eb; color: white; font-size: 11px; padding: 4px 10px; border-radius: 20px; margin-left: 12px; font-weight: 600;">KRS</span>
|
||
{% endif %}
|
||
</h2>
|
||
|
||
<!-- Source Info Banner -->
|
||
<div style="background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%); border: 1px solid #86efac; border-radius: var(--radius-lg); padding: var(--spacing-md); margin-bottom: var(--spacing-lg); display: flex; align-items: center; gap: var(--spacing-md); flex-wrap: wrap;">
|
||
<svg width="20" height="20" fill="#059669" viewBox="0 0 24 24">
|
||
<path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm-2 16l-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9l-8 8z"/>
|
||
</svg>
|
||
<div style="flex: 1;">
|
||
<div style="font-size: var(--font-size-sm); color: #166534; font-weight: 600;">
|
||
{% if company.ceidg_id %}
|
||
Dane pobrane z Centralnej Ewidencji i Informacji o Działalności Gospodarczej (CEIDG)
|
||
{% else %}
|
||
Dane pobrane z Krajowego Rejestru Sądowego (KRS)
|
||
{% endif %}
|
||
</div>
|
||
<div style="font-size: var(--font-size-xs); color: #15803d; margin-top: 2px;">
|
||
{% if company.ceidg_fetched_at %}
|
||
Pobrano: {{ company.ceidg_fetched_at|local_time('%d.%m.%Y %H:%M') }} •
|
||
{% elif company.krs_fetched_at %}
|
||
Pobrano: {{ company.krs_fetched_at|local_time('%d.%m.%Y %H:%M') }} •
|
||
{% elif company.last_verified_at %}
|
||
Zweryfikowano: {{ company.last_verified_at|local_time('%d.%m.%Y %H:%M') }} •
|
||
{% endif %}
|
||
{% if company.ceidg_id %}
|
||
ID: {{ company.ceidg_id[:8] }}...
|
||
{% elif company.krs %}
|
||
KRS: {{ company.krs }}
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
<a href="{% if company.ceidg_id %}https://aplikacja.ceidg.gov.pl/ceidg/ceidg.public.ui/SearchDetails.aspx?Id={{ company.ceidg_id }}{% else %}https://ekrs.ms.gov.pl/web/wyszukiwarka-krs/strona-glowna/index.html{% endif %}"
|
||
target="_blank"
|
||
style="background: white; border: 1px solid #86efac; color: #166534; padding: 6px 12px; border-radius: var(--radius); font-size: var(--font-size-sm); text-decoration: none; font-weight: 500;">
|
||
Sprawdź w rejestrze →
|
||
</a>
|
||
</div>
|
||
|
||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--spacing-lg);">
|
||
|
||
<!-- ===== DANE CEIDG ===== -->
|
||
{% if company.ceidg_id %}
|
||
|
||
<!-- Status CEIDG -->
|
||
{% if company.ceidg_status and (not company.is_section_hidden('registry.ceidg_status') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid {% if company.ceidg_status == 'AKTYWNY' %}#22c55e{% elif company.ceidg_status == 'ZAWIESZONY' %}#f59e0b{% else %}#ef4444{% endif %}; {% if company.is_section_hidden('registry.ceidg_status') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;">Status działalności</div>
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: {% if company.ceidg_status == 'AKTYWNY' %}#22c55e{% elif company.ceidg_status == 'ZAWIESZONY' %}#f59e0b{% else %}#ef4444{% endif %}; margin-top: 4px;">
|
||
{{ company.ceidg_status }}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Właściciel JDG -->
|
||
{% if company.owner_first_name and (not company.is_section_hidden('registry.ceidg_owner') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #8b5cf6; {% if company.is_section_hidden('registry.ceidg_owner') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;">Właściciel</div>
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: #8b5cf6; margin-top: 4px;">
|
||
{{ company.owner_first_name }} {{ company.owner_last_name }}
|
||
</div>
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 4px;">Jednoosobowa działalność gospodarcza</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Data rozpoczęcia -->
|
||
{% if company.business_start_date and (not company.is_section_hidden('registry.ceidg_start_date') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #059669; {% if company.is_section_hidden('registry.ceidg_start_date') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;">Data rozpoczęcia działalności</div>
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: #059669; margin-top: 4px;">
|
||
{{ company.business_start_date.strftime('%d.%m.%Y') }}
|
||
</div>
|
||
{% set years_active = ((now.date() - company.business_start_date).days / 365.25)|int %}
|
||
{% if years_active > 0 %}
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 4px;">{{ years_active }} lat na rynku</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- PKD główny -->
|
||
{% if company.pkd_code and (not company.is_section_hidden('registry.ceidg_pkd') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #7c3aed; {% if company.is_section_hidden('registry.ceidg_pkd') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;">PKD główny</div>
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: #7c3aed; font-family: monospace; margin-top: 4px;">
|
||
{{ company.pkd_code }}
|
||
</div>
|
||
{% if company.pkd_description %}
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); margin-top: 4px;">{{ company.pkd_description }}</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Dane kontaktowe z CEIDG (jeśli są w raw_data) -->
|
||
{% if company.ceidg_raw_data %}
|
||
{% set raw = company.ceidg_raw_data %}
|
||
|
||
{% if (raw.email or raw.telefon or raw.www) and (not company.is_section_hidden('registry.ceidg_contacts') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #0ea5e9; grid-column: span 2; {% if company.is_section_hidden('registry.ceidg_contacts') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--spacing-md);">Dane kontaktowe z CEIDG</div>
|
||
<div style="display: flex; flex-wrap: wrap; gap: var(--spacing-lg);">
|
||
{% if raw.email %}
|
||
<div>
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-muted);">Email</div>
|
||
<a href="mailto:{{ raw.email }}" style="color: #0ea5e9; font-weight: 600;">{{ raw.email }}</a>
|
||
</div>
|
||
{% endif %}
|
||
{% if raw.telefon %}
|
||
<div>
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-muted);">Telefon</div>
|
||
<a href="tel:{{ raw.telefon }}" style="color: #0ea5e9; font-weight: 600;">{{ raw.telefon }}</a>
|
||
</div>
|
||
{% endif %}
|
||
{% if raw.www %}
|
||
<div>
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-muted);">Strona WWW</div>
|
||
<a href="https://{{ raw.www }}" target="_blank" style="color: #0ea5e9; font-weight: 600;">{{ raw.www }}</a>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Wszystkie PKD z CEIDG -->
|
||
{% if raw.pkd and raw.pkd|length > 1 and (not company.is_section_hidden('registry.ceidg_pkd') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #a855f7; grid-column: span 2; {% if company.is_section_hidden('registry.ceidg_pkd') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--spacing-md);">
|
||
Wszystkie kody PKD ({{ raw.pkd|length }})
|
||
</div>
|
||
<div style="display: flex; flex-wrap: wrap; gap: var(--spacing-sm); max-height: 200px; overflow-y: auto;">
|
||
{% for pkd in raw.pkd %}
|
||
<span style="background: {% if pkd.kod == company.pkd_code %}#7c3aed; color: white;{% else %}var(--surface); color: var(--text-secondary);{% endif %} padding: 4px 10px; border-radius: var(--radius); font-size: var(--font-size-sm); border: 1px solid var(--border);" title="{{ pkd.nazwa }}">
|
||
{{ pkd.kod }}{% if pkd.kod == company.pkd_code %} ★{% endif %}
|
||
</span>
|
||
{% endfor %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Zarządca sukcesyjny -->
|
||
{% if raw.zarzadcaSukcesyjny and (not company.is_section_hidden('registry.ceidg_succession') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #f59e0b; {% if company.is_section_hidden('registry.ceidg_succession') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;">Zarządca sukcesyjny</div>
|
||
<div style="font-size: var(--font-size-lg); font-weight: 600; color: #f59e0b; margin-top: 4px;">
|
||
{{ raw.zarzadcaSukcesyjny.imie }} {{ raw.zarzadcaSukcesyjny.nazwisko }}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Dodatkowe adresy działalności -->
|
||
{% if raw.adresyDzialalnosciDodatkowe and raw.adresyDzialalnosciDodatkowe|length > 0 and (not company.is_section_hidden('registry.ceidg_locations') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #64748b; grid-column: span 2; {% if company.is_section_hidden('registry.ceidg_locations') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--spacing-md);">
|
||
Dodatkowe miejsca działalności ({{ raw.adresyDzialalnosciDodatkowe|length }})
|
||
</div>
|
||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--spacing-md);">
|
||
{% for addr in raw.adresyDzialalnosciDodatkowe %}
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-primary);">
|
||
<strong>{{ addr.opisNietypowegoMiejsca|default('Lokalizacja') }}</strong><br>
|
||
{{ addr.ulica }} {{ addr.budynek }}{% if addr.lokal %}/{{ addr.lokal }}{% endif %}<br>
|
||
{{ addr.kod }} {{ addr.miasto }}
|
||
</div>
|
||
{% endfor %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
{% endif %}
|
||
|
||
{% endif %}
|
||
<!-- ===== KONIEC DANE CEIDG ===== -->
|
||
|
||
<!-- ===== DANE KRS ===== -->
|
||
{% if company.krs and company.data_source == 'KRS API' and not company.ceidg_id %}
|
||
{% set krs = company.krs_raw_data or {} %}
|
||
|
||
<!-- Forma prawna -->
|
||
{% if company.legal_form and (not company.is_section_hidden('registry.krs_legal_form') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #2563eb; {% if company.is_section_hidden('registry.krs_legal_form') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;">Forma prawna</div>
|
||
<div style="font-size: var(--font-size-lg); font-weight: 700; color: #2563eb; margin-top: 4px;">
|
||
{{ company.legal_form }}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Kapitał zakładowy -->
|
||
{% if company.capital_amount and (not company.is_section_hidden('registry.krs_capital') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #22c55e; {% if company.is_section_hidden('registry.krs_capital') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;">Kapitał zakładowy</div>
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: #22c55e; margin-top: 4px;">
|
||
{{ '{:,.2f}'.format(company.capital_amount).replace(',', ' ') }} PLN
|
||
</div>
|
||
{% if krs.kapital and krs.kapital.waluta %}
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 4px;">Waluta: {{ krs.kapital.waluta }}</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Numer KRS -->
|
||
{% if not company.is_section_hidden('registry.krs_identity') or can_edit_profile or is_admin %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #6366f1; {% if company.is_section_hidden('registry.krs_identity') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;">Numer KRS</div>
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: #6366f1; font-family: monospace; margin-top: 4px;">
|
||
{{ company.krs }}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- NIP z KRS -->
|
||
{% if krs.nip and (not company.is_section_hidden('registry.krs_identity') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #3b82f6; {% if company.is_section_hidden('registry.krs_identity') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;">NIP</div>
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: #3b82f6; font-family: monospace; margin-top: 4px;">
|
||
{{ krs.nip[:3] }}-{{ krs.nip[3:6] }}-{{ krs.nip[6:8] }}-{{ krs.nip[8:] }}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- REGON z KRS -->
|
||
{% if krs.regon and (not company.is_section_hidden('registry.krs_identity') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #0891b2; {% if company.is_section_hidden('registry.krs_identity') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;">REGON</div>
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: #0891b2; font-family: monospace; margin-top: 4px;">
|
||
{{ krs.regon }}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Data rejestracji w KRS -->
|
||
{% if (company.krs_registration_date or (krs.daty and krs.daty.rejestracji)) and (not company.is_section_hidden('registry.krs_identity') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #059669; {% if company.is_section_hidden('registry.krs_identity') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;">Data rejestracji w KRS</div>
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: #059669; margin-top: 4px;">
|
||
{% if company.krs_registration_date %}
|
||
{{ company.krs_registration_date.strftime('%d.%m.%Y') }}
|
||
{% else %}
|
||
{{ krs.daty.rejestracji }}
|
||
{% endif %}
|
||
</div>
|
||
{% if company.krs_registration_date %}
|
||
{% set years_active = ((now.date() - company.krs_registration_date).days / 365.25)|int %}
|
||
{% if years_active > 0 %}
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 4px;">{{ years_active }} lat działalności</div>
|
||
{% endif %}
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Dane kontaktowe (z KRS + telefon z bazy) -->
|
||
{% if ((krs.kontakt_krs and (krs.kontakt_krs.email or krs.kontakt_krs.www or krs.kontakt_krs.adres_epuap)) or company.phone) and (not company.is_section_hidden('registry.krs_contacts') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #10b981; grid-column: span 2; {% if company.is_section_hidden('registry.krs_contacts') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--spacing-md);">Dane kontaktowe</div>
|
||
<div style="display: flex; flex-wrap: wrap; gap: var(--spacing-lg);">
|
||
{% if company.phone %}
|
||
<div>
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-muted);">Telefon</div>
|
||
<a href="tel:{{ company.phone }}" style="color: #10b981; font-weight: 600; font-size: var(--font-size-lg);">{{ company.phone }}</a>
|
||
</div>
|
||
{% endif %}
|
||
{% if krs.kontakt_krs and krs.kontakt_krs.email %}
|
||
<div>
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-muted);">Email <span style="color: #059669; font-size: 9px;">(KRS)</span></div>
|
||
<a href="mailto:{{ krs.kontakt_krs.email }}" style="color: #10b981; font-weight: 600;">{{ krs.kontakt_krs.email }}</a>
|
||
</div>
|
||
{% endif %}
|
||
{% if krs.kontakt_krs and krs.kontakt_krs.www %}
|
||
<div>
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-muted);">Strona WWW <span style="color: #059669; font-size: 9px;">(KRS)</span></div>
|
||
<a href="https://{{ krs.kontakt_krs.www|lower }}" target="_blank" style="color: #10b981; font-weight: 600;">{{ krs.kontakt_krs.www }}</a>
|
||
</div>
|
||
{% endif %}
|
||
{% if krs.kontakt_krs and krs.kontakt_krs.adres_epuap %}
|
||
<div>
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-muted);">Adres ePUAP (BAE)</div>
|
||
<span style="font-family: monospace; font-size: var(--font-size-sm); color: var(--text-secondary);">{{ krs.kontakt_krs.adres_epuap }}</span>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Umowa spółki -->
|
||
{% if krs.umowa_spolki and (krs.umowa_spolki.data_umowy or krs.umowa_spolki.czas_trwania) and (not company.is_section_hidden('registry.krs_agreement') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #7c3aed; grid-column: span 2; {% if company.is_section_hidden('registry.krs_agreement') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--spacing-md);">Umowa spółki</div>
|
||
<div style="display: flex; flex-wrap: wrap; gap: var(--spacing-lg);">
|
||
{% if krs.umowa_spolki.data_umowy %}
|
||
<div>
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-muted);">Data zawarcia/zmiany umowy</div>
|
||
<div style="font-weight: 600; color: #7c3aed;">{{ krs.umowa_spolki.data_umowy }}</div>
|
||
</div>
|
||
{% endif %}
|
||
{% if krs.umowa_spolki.czas_trwania %}
|
||
<div>
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-muted);">Czas trwania spółki</div>
|
||
<div style="font-weight: 600; color: var(--text-primary);">{{ krs.umowa_spolki.czas_trwania }}</div>
|
||
</div>
|
||
{% endif %}
|
||
{% if krs.umowa_spolki.informacja_o_udzialach %}
|
||
<div>
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-muted);">Informacja o udziałach</div>
|
||
<div style="font-weight: 600; color: var(--text-primary);">{{ krs.umowa_spolki.informacja_o_udzialach }}</div>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Sposób reprezentacji -->
|
||
{% if (company.krs_representation or krs.sposob_reprezentacji) and (not company.is_section_hidden('registry.krs_representation') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #8b5cf6; grid-column: span 2; {% if company.is_section_hidden('registry.krs_representation') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--spacing-sm);">
|
||
{% if krs.nazwa_organu %}{{ krs.nazwa_organu }} - {% endif %}Sposób reprezentacji
|
||
</div>
|
||
<div style="font-size: var(--font-size-base); color: var(--text-primary); line-height: 1.6;">
|
||
{{ company.krs_representation or krs.sposob_reprezentacji }}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Zarząd -->
|
||
{% if krs.zarzad and krs.zarzad|length > 0 and (not company.is_section_hidden('registry.krs_board') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #0ea5e9; grid-column: span 2; {% if company.is_section_hidden('registry.krs_board') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--spacing-md);">
|
||
Zarząd ({{ krs.zarzad|length }} {{ 'osoba' if krs.zarzad|length == 1 else 'osoby' if krs.zarzad|length < 5 else 'osób' }})
|
||
</div>
|
||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--spacing-md);">
|
||
{% for osoba in krs.zarzad %}
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-sm); padding: var(--spacing-sm); background: var(--surface); border-radius: var(--radius);">
|
||
<div style="width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%); display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: var(--font-size-sm);">
|
||
{{ osoba.imie[0] if osoba.imie else '?' }}{{ osoba.nazwisko[0] if osoba.nazwisko else '' }}
|
||
</div>
|
||
<div>
|
||
<div style="font-weight: 600; color: var(--text-primary);">
|
||
{{ osoba.imie }} {% if osoba.imie_drugie %}{{ osoba.imie_drugie }} {% endif %}{{ osoba.nazwisko }}
|
||
</div>
|
||
{% if osoba.funkcja %}
|
||
<div style="font-size: var(--font-size-xs); color: #0ea5e9; font-weight: 500;">{{ osoba.funkcja }}</div>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
{% endfor %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Wspólnicy -->
|
||
{% if krs.wspolnicy and krs.wspolnicy|length > 0 and (not company.is_section_hidden('registry.krs_partners') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #f59e0b; grid-column: span 2; {% if company.is_section_hidden('registry.krs_partners') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--spacing-md);">
|
||
Wspólnicy ({{ krs.wspolnicy|length }})
|
||
</div>
|
||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--spacing-md);">
|
||
{% for wspolnik in krs.wspolnicy %}
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-sm); padding: var(--spacing-sm); background: var(--surface); border-radius: var(--radius);">
|
||
<div style="width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: var(--font-size-sm);">
|
||
{{ wspolnik.imie[0] if wspolnik.imie else '?' }}{{ wspolnik.nazwisko[0] if wspolnik.nazwisko else '' }}
|
||
</div>
|
||
<div style="flex: 1;">
|
||
<div style="font-weight: 600; color: var(--text-primary);">
|
||
{{ wspolnik.imie }} {{ wspolnik.nazwisko }}
|
||
</div>
|
||
{% if wspolnik.udzialy %}
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-muted);">
|
||
Udziały: {{ wspolnik.udzialy }}
|
||
{% if wspolnik.calosc_udzialow %}<span style="color: #f59e0b; font-weight: 600;">(100%)</span>{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
{% endfor %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Przedmiot działalności (PKD) -->
|
||
{% if company.krs_activities and company.krs_activities|length > 0 and (not company.is_section_hidden('registry.krs_activities') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #a855f7; grid-column: span 2; {% if company.is_section_hidden('registry.krs_activities') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--spacing-md);">
|
||
Przedmiot działalności z KRS ({{ company.krs_activities|length }} PKD)
|
||
</div>
|
||
<div style="display: flex; flex-wrap: wrap; gap: var(--spacing-sm); max-height: 200px; overflow-y: auto;">
|
||
{% for pkd in company.krs_activities %}
|
||
<span style="background: var(--surface); color: var(--text-secondary); padding: 4px 10px; border-radius: var(--radius); font-size: var(--font-size-sm); border: 1px solid var(--border);">
|
||
{{ pkd }}
|
||
</span>
|
||
{% endfor %}
|
||
</div>
|
||
</div>
|
||
{% elif krs.przedmiot_dzialalnosci and krs.przedmiot_dzialalnosci|length > 0 and (not company.is_section_hidden('registry.krs_activities') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #a855f7; grid-column: span 2; {% if company.is_section_hidden('registry.krs_activities') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--spacing-md);">
|
||
Przedmiot działalności z KRS ({{ krs.przedmiot_dzialalnosci|length }} PKD)
|
||
</div>
|
||
<div style="display: flex; flex-direction: column; gap: var(--spacing-sm); max-height: 250px; overflow-y: auto;">
|
||
{% for pkd in krs.przedmiot_dzialalnosci %}
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-sm); padding: var(--spacing-sm); background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);">
|
||
<span style="font-family: monospace; font-weight: 700; color: {% if pkd.glowna %}#a855f7{% else %}var(--text-secondary){% endif %}; min-width: 70px;">
|
||
{{ pkd.kod if pkd.kod else pkd }}{% if pkd.glowna %} ★{% endif %}
|
||
</span>
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-primary);">
|
||
{{ pkd.opis if pkd.opis else '' }}{% if pkd.glowna %} <em style="color: #a855f7;">(główna)</em>{% endif %}
|
||
</span>
|
||
</div>
|
||
{% endfor %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Sprawozdania finansowe -->
|
||
{% if krs.sprawozdania_finansowe and krs.sprawozdania_finansowe|length > 0 and (not company.is_section_hidden('registry.krs_financials') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #14b8a6; grid-column: span 2; {% if company.is_section_hidden('registry.krs_financials') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--spacing-md);">
|
||
Sprawozdania finansowe ({{ krs.sprawozdania_finansowe|length }})
|
||
</div>
|
||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--spacing-md);">
|
||
{% for sf in krs.sprawozdania_finansowe %}
|
||
<div style="padding: var(--spacing-sm); background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);">
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-muted);">Złożono: {{ sf.data_zlozenia }}</div>
|
||
<div style="font-size: var(--font-size-sm); font-weight: 600; color: #14b8a6; margin-top: 2px;">{{ sf.za_okres }}</div>
|
||
</div>
|
||
{% endfor %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Adres z KRS -->
|
||
{% if krs.adres and (krs.adres.ulica or krs.adres.miejscowosc) and (not company.is_section_hidden('registry.krs_address') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #64748b; {% if company.is_section_hidden('registry.krs_address') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--spacing-sm);">Adres siedziby z KRS</div>
|
||
<div style="font-size: var(--font-size-base); color: var(--text-primary);">
|
||
{% if krs.adres.ulica %}{{ krs.adres.ulica }}{% endif %}
|
||
{% if krs.adres.nr_domu %} {{ krs.adres.nr_domu }}{% endif %}
|
||
{% if krs.adres.nr_lokalu %}/{{ krs.adres.nr_lokalu }}{% endif %}<br>
|
||
{% if krs.adres.kod_pocztowy %}{{ krs.adres.kod_pocztowy }} {% endif %}{{ krs.adres.miejscowosc or '' }}
|
||
</div>
|
||
{% if krs.adres.powiat or krs.adres.wojewodztwo %}
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 4px;">
|
||
{% if krs.adres.powiat %}pow. {{ krs.adres.powiat }}, {% endif %}woj. {{ krs.adres.wojewodztwo or '' }}
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- OPP Status -->
|
||
{% if krs.czy_opp and (not company.is_section_hidden('registry.krs_register') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #ec4899; {% if company.is_section_hidden('registry.krs_register') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;">Status OPP</div>
|
||
<div style="font-size: var(--font-size-lg); font-weight: 700; color: #ec4899; margin-top: 4px;">
|
||
Organizacja Pożytku Publicznego
|
||
</div>
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 4px;">Można przekazać 1,5% podatku</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Dane sądu rejestrowego -->
|
||
{% if krs.rejestr and (krs.rejestr.sygnatura_akt or krs.rejestr.sad_rejestrowy or krs.rejestr.dzien_konczacy_rok_obrotowy) and (not company.is_section_hidden('registry.krs_register') or can_edit_profile or is_admin) %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #78716c; {% if company.is_section_hidden('registry.krs_register') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--spacing-sm);">Dane rejestrowe</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-muted);">
|
||
{% if krs.rejestr.sygnatura_akt %}
|
||
<div>Sygnatura akt: <strong style="font-family: monospace;">{{ krs.rejestr.sygnatura_akt }}</strong></div>
|
||
{% endif %}
|
||
{% if krs.rejestr.sad_rejestrowy %}
|
||
<div>Sąd dokonujący wpisu: <strong>{{ krs.rejestr.sad_rejestrowy }}</strong></div>
|
||
{% endif %}
|
||
{% if krs.rejestr.dzien_konczacy_rok_obrotowy %}
|
||
<div>Dzień kończący rok obrotowy: <strong>{{ krs.rejestr.dzien_konczacy_rok_obrotowy }}</strong></div>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Metadane KRS -->
|
||
{% if krs.metadata or krs.daty %}
|
||
{% if not company.is_section_hidden('registry.krs_register') or can_edit_profile or is_admin %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border-left: 4px solid #94a3b8; {% if company.is_section_hidden('registry.krs_register') %}opacity: 0.5; border: 2px dashed #f59e0b;{% endif %}">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--spacing-sm);">Informacje o odpisie KRS</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-muted);">
|
||
{% if krs.metadata %}
|
||
{% if krs.metadata.stan_z_dnia %}<div>Stan na dzień: <strong>{{ krs.metadata.stan_z_dnia }}</strong></div>{% endif %}
|
||
{% if krs.metadata.data_odpisu %}<div>Data odpisu: <strong>{{ krs.metadata.data_odpisu }}</strong></div>{% endif %}
|
||
{% endif %}
|
||
{% if krs.daty %}
|
||
{% if krs.daty.ostatniego_wpisu %}<div>Ostatni wpis: <strong>{{ krs.daty.ostatniego_wpisu }}</strong>{% if krs.daty.numer_ostatniego_wpisu %} (nr {{ krs.daty.numer_ostatniego_wpisu }}){% endif %}</div>{% endif %}
|
||
{% endif %}
|
||
{% if company.krs_fetched_at %}
|
||
<div style="margin-top: var(--spacing-sm); padding-top: var(--spacing-sm); border-top: 1px solid var(--border);">
|
||
Pobrano z API: <strong>{{ company.krs_fetched_at|local_time('%d.%m.%Y %H:%M') }}</strong>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
{% endif %}
|
||
|
||
{% endif %}
|
||
<!-- ===== KONIEC DANE KRS ===== -->
|
||
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
<!-- ============================================================ -->
|
||
<!-- KONIEC: DANE Z REJESTRÓW URZĘDOWYCH -->
|
||
<!-- ============================================================ -->
|
||
|
||
<!-- Legacy: Legal & Business Info - Card Based (ukryte dla firm z danymi z rejestrów - CEIDG lub KRS API) -->
|
||
{% set _legal_hidden = company.is_section_hidden('legal') %}
|
||
{% if not (company.krs and company.data_source == 'KRS API') and not company.ceidg_id and (not _legal_hidden or can_edit_profile or is_admin) %}
|
||
<div class="company-section {% if _legal_hidden %}section-hidden{% endif %}">
|
||
{% if _legal_hidden %}
|
||
<div class="hidden-section-badge"><i class="fas fa-eye-slash"></i> Ukryta — niewidoczna dla odwiedzających</div>
|
||
{% endif %}
|
||
<h2 class="section-title">Informacje prawne i biznesowe</h2>
|
||
|
||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--spacing-lg);">
|
||
|
||
<!-- Legal Name Card (full width) -->
|
||
{% if company.legal_name %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid #10b981; grid-column: span 2;">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #10b981; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M12 7V3H2v18h20V7H12zM6 19H4v-2h2v2zm0-4H4v-2h2v2zm0-4H4V9h2v2zm0-4H4V5h2v2zm4 12H8v-2h2v2zm0-4H8v-2h2v2zm0-4H8V9h2v2zm0-4H8V5h2v2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8v10zm-2-8h-2v2h2v-2zm0 4h-2v2h2v-2z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="flex: 1;">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;">Pełna nazwa prawna</div>
|
||
<div style="font-size: var(--font-size-lg); font-weight: 600; color: var(--text-primary);">{{ company.legal_name }}</div>
|
||
</div>
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); padding-left: 60px; margin-top: var(--spacing-sm);">
|
||
Źródło: <strong style="color: #10b981;">Rejestr KRS</strong>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Legal Form Card -->
|
||
{# Determine legal form from database or infer from name/KRS #}
|
||
{% set legal_form = company.legal_form %}
|
||
{% if not legal_form %}
|
||
{% if 'sp. z o.o' in company.name|lower or 'spółka z ograniczoną odpowiedzialnością' in company.name|lower %}
|
||
{% set legal_form = 'Spółka z ograniczoną odpowiedzialnością (sp. z o.o.)' %}
|
||
{% elif 's.a.' in company.name|lower or 'spółka akcyjna' in company.name|lower %}
|
||
{% set legal_form = 'Spółka akcyjna (S.A.)' %}
|
||
{% elif 'sp.j.' in company.name|lower or 'spółka jawna' in company.name|lower %}
|
||
{% set legal_form = 'Spółka jawna (sp.j.)' %}
|
||
{% elif 'sp.k.' in company.name|lower or 'spółka komandytowa' in company.name|lower %}
|
||
{% set legal_form = 'Spółka komandytowa (sp.k.)' %}
|
||
{% elif 'sp.p.' in company.name|lower or 'spółka partnerska' in company.name|lower %}
|
||
{% set legal_form = 'Spółka partnerska (sp.p.)' %}
|
||
{% elif company.krs %}
|
||
{% set legal_form = 'Spółka prawa handlowego' %}
|
||
{% else %}
|
||
{% set legal_form = 'Jednoosobowa działalność gospodarcza (JDG)' %}
|
||
{% endif %}
|
||
{% endif %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid #06b6d4;">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #06b6d4; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M20 6h-4V4c0-1.11-.89-2-2-2h-4c-1.11 0-2 .89-2 2v2H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-6 0h-4V4h4v2z"/>
|
||
</svg>
|
||
</div>
|
||
<div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;">Forma prawna</div>
|
||
<div style="font-size: var(--font-size-lg); font-weight: 600; color: #06b6d4;">{{ legal_form }}</div>
|
||
</div>
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); padding-left: 60px; margin-top: var(--spacing-sm);">
|
||
{% if company.legal_form %}
|
||
Źródło: <strong style="color: #10b981;">Dane zweryfikowane</strong>
|
||
{% elif company.krs %}
|
||
Źródło: <strong style="color: #f59e0b;">Ustalono z KRS/nazwy</strong>
|
||
{% else %}
|
||
Źródło: <strong style="color: #f59e0b;">Ustalono automatycznie</strong>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
|
||
<!-- NIP Card -->
|
||
{% set display_nip = effective_nip or company.nip %}
|
||
{% if display_nip %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid #3b82f6;">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #3b82f6; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"/>
|
||
</svg>
|
||
</div>
|
||
<div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;">NIP</div>
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: #3b82f6; font-family: monospace;">{{ display_nip[:3] }}-{{ display_nip[3:6] }}-{{ display_nip[6:8] }}-{{ display_nip[8:] }}</div>
|
||
</div>
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); padding-left: 60px; margin-top: var(--spacing-sm);">
|
||
{% if not company.nip and company.parent_company_id %}
|
||
NIP firmy nadrzędnej
|
||
{% else %}
|
||
Źródło: <strong style="color: #10b981;">Rejestr KRS</strong>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- REGON Card -->
|
||
{% if company.regon %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid #8b5cf6;">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #8b5cf6; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-5 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"/>
|
||
</svg>
|
||
</div>
|
||
<div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;">REGON</div>
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: #8b5cf6; font-family: monospace;">{{ company.regon }}</div>
|
||
</div>
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); padding-left: 60px; margin-top: var(--spacing-sm);">
|
||
Źródło: <strong style="color: #10b981;">GUS REGON</strong>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- KRS Card -->
|
||
{% if company.krs %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid #ef4444;">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md); flex-wrap: wrap;">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #ef4444; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11v8.8z"/>
|
||
</svg>
|
||
</div>
|
||
<div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;">KRS</div>
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: #ef4444; font-family: monospace;">{{ company.krs }}</div>
|
||
</div>
|
||
{% if company.krs_pdf_path %}
|
||
<div style="margin-left: auto;">
|
||
<a href="/admin/krs-api/pdf/{{ company.id }}" target="_blank" rel="noopener noreferrer"
|
||
style="padding: 8px 16px; background: #ef4444; color: white; border-radius: var(--radius); text-decoration: none; font-size: var(--font-size-sm); font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;"
|
||
title="Pobierz odpis pełny KRS w formacie PDF">
|
||
<svg width="16" height="16" fill="currentColor" viewBox="0 0 24 24"><path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20M10,13H7V11H10V13M14,13H11V11H14V13M10,16H7V14H10V16M14,16H11V14H14V16Z"/></svg>
|
||
Odpis PDF
|
||
</a>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); padding-left: 60px; margin-top: var(--spacing-sm);">
|
||
Źródło: <strong style="color: #10b981;">Krajowy Rejestr Sądowy</strong>
|
||
{% if company.krs_last_audit_at %}
|
||
<span style="margin-left: var(--spacing-md); color: #6366f1;">
|
||
<svg width="12" height="12" fill="currentColor" viewBox="0 0 24 24" style="vertical-align: middle;"><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"/></svg>
|
||
Audyt KRS: {{ company.krs_last_audit_at|local_time('%d.%m.%Y') }}
|
||
</span>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Year Established Card -->
|
||
{% if company.year_established %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid #f59e0b;">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #f59e0b; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11zM9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm-8 4H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2z"/>
|
||
</svg>
|
||
</div>
|
||
<div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;">Rok założenia</div>
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: #f59e0b;">{{ company.year_established }}</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary);">{{ 2025 - company.year_established }} lat na rynku</div>
|
||
</div>
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); padding-left: 60px; margin-top: var(--spacing-sm);">
|
||
Źródło: <strong style="color: #10b981;">Rejestr KRS</strong>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Business Start Date Card (from CEIDG) -->
|
||
{% if company.business_start_date %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid #059669;">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #059669; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"/>
|
||
</svg>
|
||
</div>
|
||
<div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;">Data rozpoczęcia</div>
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: #059669;">{{ company.business_start_date.strftime('%d.%m.%Y') }}</div>
|
||
</div>
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); padding-left: 60px; margin-top: var(--spacing-sm);">
|
||
Źródło: <a href="https://dane.biznes.gov.pl" target="_blank" style="color: #059669; font-weight: bold;">CEIDG</a>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Member Since Card (Norda Biznes membership) -->
|
||
{% if company.member_since %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid #10b981;">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #10b981; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>
|
||
</svg>
|
||
</div>
|
||
<div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;">Członek Izby NORDA od</div>
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: #10b981;">{{ company.member_since.strftime('%d.%m.%Y') }}</div>
|
||
{% set years_member = ((now.date() - company.member_since).days / 365.25)|int %}
|
||
{% if years_member > 0 %}
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary);">{{ years_member }} lat w Izbie</div>
|
||
{% endif %}
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-muted); margin-top: var(--spacing-xs);">Źródło: <strong style="color: #10b981;">Izba NORDA</strong></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- PKD Card (from KRS/CEIDG) -->
|
||
{% if pkd_codes or company.pkd_code %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid #7c3aed;">
|
||
<div style="display: flex; align-items: flex-start; gap: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #7c3aed; color: white; flex-shrink: 0;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-5 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="flex: 1;">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--spacing-sm);">PKD - Przedmiot działalności</div>
|
||
|
||
{% if pkd_codes %}
|
||
<!-- PKD codes from KRS audit -->
|
||
{% for pkd in pkd_codes %}
|
||
<div style="{% if pkd.is_primary %}margin-bottom: var(--spacing-md); padding-bottom: var(--spacing-md); border-bottom: 1px solid var(--border);{% elif not loop.last %}margin-bottom: var(--spacing-sm);{% endif %}">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-sm);">
|
||
{% if pkd.is_primary %}
|
||
<span style="background: #7c3aed; color: white; font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 600;">GŁÓWNY</span>
|
||
{% endif %}
|
||
<span style="font-size: {% if pkd.is_primary %}var(--font-size-xl){% else %}var(--font-size-base){% endif %}; font-weight: {% if pkd.is_primary %}700{% else %}600{% endif %}; color: {% if pkd.is_primary %}#7c3aed{% else %}var(--text-primary){% endif %}; font-family: monospace;">{{ pkd.pkd_code }}</span>
|
||
</div>
|
||
{% if pkd.pkd_description %}
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); margin-top: 4px; {% if not pkd.is_primary %}padding-left: 0;{% endif %}">{{ pkd.pkd_description }}</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endfor %}
|
||
{% else %}
|
||
<!-- Fallback to company.pkd_code (from CEIDG) -->
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: #7c3aed; font-family: monospace;">{{ company.pkd_code }}</div>
|
||
{% if company.pkd_description %}
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); margin-top: 4px;">{{ company.pkd_description }}</div>
|
||
{% endif %}
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); padding-left: 60px; margin-top: var(--spacing-sm);">
|
||
Źródło: {% if pkd_codes %}<a href="https://ekrs.ms.gov.pl" target="_blank" style="color: #7c3aed; font-weight: bold;">eKRS</a>{% else %}<a href="https://dane.biznes.gov.pl" target="_blank" style="color: #7c3aed; font-weight: bold;">CEIDG</a>{% endif %}
|
||
{% if pkd_codes %}<span style="margin-left: var(--spacing-sm); color: var(--text-muted);">({{ pkd_codes|length }} {% if pkd_codes|length == 1 %}kod{% elif pkd_codes|length < 5 %}kody{% else %}kodów{% endif %})</span>{% endif %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Employees Count Card -->
|
||
{% if company.employees_count or company.employee_count_range %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid #06b6d4;">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #06b6d4; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/>
|
||
</svg>
|
||
</div>
|
||
<div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;">Liczba pracowników</div>
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: #06b6d4;">
|
||
{% if company.employees_count %}{{ company.employees_count }}{% else %}{{ company.employee_count_range }}{% endif %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); padding-left: 60px; margin-top: var(--spacing-sm);">
|
||
Źródło: <strong style="color: #667eea;">Dane deklarowane</strong>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Capital Card -->
|
||
{% if company.capital_amount %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid #22c55e;">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #22c55e; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4z"/>
|
||
</svg>
|
||
</div>
|
||
<div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;">Kapitał zakładowy</div>
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: #22c55e;">{{ '{:,.2f}'.format(company.capital_amount).replace(',', ' ') }} PLN</div>
|
||
</div>
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); padding-left: 60px; margin-top: var(--spacing-sm);">
|
||
Źródło: <strong style="color: #10b981;">Rejestr KRS</strong>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
{# Koniec warunku: not (company.krs and company.data_source == 'KRS API') and not company.ceidg_id #}
|
||
|
||
<!-- Contact Information - Card Based (ukryte dla firm z danymi z rejestrów - CEIDG lub KRS API) -->
|
||
{% set _contact_hidden = company.is_section_hidden('contact') %}
|
||
{% if not (company.krs and company.data_source == 'KRS API') and not company.ceidg_id and (not _contact_hidden or can_edit_profile or is_admin) %}
|
||
<div class="company-section {% if _contact_hidden %}section-hidden{% endif %}">
|
||
{% if _contact_hidden %}
|
||
<div class="hidden-section-badge"><i class="fas fa-eye-slash"></i> Ukryta — niewidoczna dla odwiedzających</div>
|
||
{% endif %}
|
||
<h2 class="section-title">Dane kontaktowe</h2>
|
||
|
||
{% set source_names = {'website': 'Strona WWW', 'krs': 'Rejestr KRS', 'google_business': 'Google Business', 'facebook': 'Facebook', 'manual': 'Wprowadzono ręcznie', 'brave_search': 'Wyszukiwarka', 'ceidg': 'CEIDG', 'norda_biznes': 'Norda Biznes', 'website_scrape': 'Strona WWW (auto)'} %}
|
||
{% set source_colors = {'website': '#3b82f6', 'krs': '#10b981', 'google_business': '#f59e0b', 'facebook': '#1877f2', 'manual': '#6366f1', 'brave_search': '#ef4444', 'ceidg': '#10b981', 'norda_biznes': '#667eea', 'website_scrape': '#06b6d4'} %}
|
||
|
||
{# Collect all known phones for deduplication #}
|
||
{% set known_phones = [] %}
|
||
{% set phones_from_contacts = contacts|selectattr('contact_type', 'equalto', 'phone')|list if contacts else [] %}
|
||
{% for c in phones_from_contacts %}{% set _ = known_phones.append(c.value|replace(' ', '')|replace('+48', '')|replace('-', '')) %}{% endfor %}
|
||
{% if company.phone %}{% set _ = known_phones.append(company.phone|replace(' ', '')|replace('+48', '')|replace('-', '')) %}{% endif %}
|
||
|
||
{# Collect all known emails for deduplication #}
|
||
{% set known_emails = [] %}
|
||
{% set emails_from_contacts = contacts|selectattr('contact_type', 'equalto', 'email')|list if contacts else [] %}
|
||
{% for c in emails_from_contacts %}{% set _ = known_emails.append(c.value|lower) %}{% endfor %}
|
||
{% if company.email %}{% set _ = known_emails.append(company.email|lower) %}{% endif %}
|
||
|
||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--spacing-lg);">
|
||
|
||
<!-- Phone Cards from contacts table -->
|
||
{% set phones = contacts|selectattr('contact_type', 'equalto', 'phone')|list if contacts else [] %}
|
||
{% if phones %}
|
||
{% for contact in phones %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid {% if contact.is_primary %}#10b981{% else %}#e5e7eb{% endif %};">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md); margin-bottom: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: {% if contact.is_primary %}#10b981{% else %}#3b82f6{% endif %}; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M20.01 15.38c-1.23 0-2.42-.2-3.53-.56a.977.977 0 0 0-1.01.24l-1.57 1.97c-2.83-1.35-5.48-3.9-6.89-6.83l1.95-1.66c.27-.28.35-.67.24-1.02-.37-1.11-.56-2.3-.56-3.53 0-.54-.45-.99-.99-.99H4.19C3.65 3 3 3.24 3 3.99 3 13.28 10.73 21 20.01 21c.71 0 .99-.63.99-1.18v-3.45c0-.54-.45-.99-.99-.99z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="flex: 1;">
|
||
<div style="font-weight: 600; color: var(--text-primary);">
|
||
Telefon{% if contact.purpose %} - {{ contact.purpose }}{% endif %}
|
||
</div>
|
||
<a href="tel:{{ contact.value }}" style="color: {% if contact.is_primary %}#10b981{% else %}#3b82f6{% endif %}; font-size: var(--font-size-lg); text-decoration: none;">
|
||
{{ contact.value }}
|
||
</a>
|
||
</div>
|
||
{% if contact.is_primary %}
|
||
<span style="padding: 4px 8px; background: #dcfce7; color: #166534; border-radius: 4px; font-size: 11px; font-weight: 600;">GŁÓWNY</span>
|
||
{% endif %}
|
||
</div>
|
||
{% if contact.source %}
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); padding-left: 60px;">
|
||
<span style="display: inline-flex; align-items: center; gap: 4px;">
|
||
<svg width="12" height="12" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/></svg>
|
||
Źródło: <strong style="color: {{ source_colors.get(contact.source, '#6b7280') }};">{{ source_names.get(contact.source, contact.source) }}</strong>
|
||
</span>
|
||
{% if contact.source_date %}
|
||
<span style="margin-left: 8px;">({{ contact.source_date|local_time('%d.%m.%Y') }})</span>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endfor %}
|
||
{% endif %}
|
||
|
||
<!-- Additional phones from website scraping (deduplicated) -->
|
||
{% if website_content and website_content.phone_numbers %}
|
||
{% for phone in website_content.phone_numbers %}
|
||
{% set phone_normalized = phone|replace(' ', '')|replace('+48', '')|replace('-', '') %}
|
||
{% if phone_normalized not in known_phones %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid #06b6d4;">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md); margin-bottom: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #06b6d4; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M20.01 15.38c-1.23 0-2.42-.2-3.53-.56a.977.977 0 0 0-1.01.24l-1.57 1.97c-2.83-1.35-5.48-3.9-6.89-6.83l1.95-1.66c.27-.28.35-.67.24-1.02-.37-1.11-.56-2.3-.56-3.53 0-.54-.45-.99-.99-.99H4.19C3.65 3 3 3.24 3 3.99 3 13.28 10.73 21 20.01 21c.71 0 .99-.63.99-1.18v-3.45c0-.54-.45-.99-.99-.99z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="flex: 1;">
|
||
<div style="font-weight: 600; color: var(--text-primary);">Telefon</div>
|
||
<a href="tel:{{ phone }}" style="color: #06b6d4; font-size: var(--font-size-lg); text-decoration: none;">{{ phone }}</a>
|
||
</div>
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); padding-left: 60px;">
|
||
Źródło: <strong style="color: #06b6d4;">Strona WWW (auto)</strong>
|
||
{% if website_content.scraped_at %}
|
||
<span style="margin-left: 8px;">({{ website_content.scraped_at|local_time('%d.%m.%Y') }})</span>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
{% endfor %}
|
||
{% endif %}
|
||
|
||
<!-- Fallback: Phone from company record (if not in contacts) -->
|
||
{% if company.phone %}
|
||
{% set phone_normalized = company.phone|replace(' ', '')|replace('+48', '')|replace('-', '') %}
|
||
{% set phone_in_contacts = phone_normalized in known_phones %}
|
||
{% if not phone_in_contacts %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid #10b981;">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md); margin-bottom: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #10b981; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M20.01 15.38c-1.23 0-2.42-.2-3.53-.56a.977.977 0 0 0-1.01.24l-1.57 1.97c-2.83-1.35-5.48-3.9-6.89-6.83l1.95-1.66c.27-.28.35-.67.24-1.02-.37-1.11-.56-2.3-.56-3.53 0-.54-.45-.99-.99-.99H4.19C3.65 3 3 3.24 3 3.99 3 13.28 10.73 21 20.01 21c.71 0 .99-.63.99-1.18v-3.45c0-.54-.45-.99-.99-.99z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="flex: 1;">
|
||
<div style="font-weight: 600; color: var(--text-primary);">Telefon</div>
|
||
<a href="tel:{{ company.phone }}" style="color: #10b981; font-size: var(--font-size-lg); text-decoration: none;">
|
||
{{ company.phone }}
|
||
</a>
|
||
</div>
|
||
<span style="padding: 4px 8px; background: #dcfce7; color: #166534; border-radius: 4px; font-size: 11px; font-weight: 600;">GŁÓWNY</span>
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); padding-left: 60px;">
|
||
Źródło: <strong style="color: #667eea;">Dane firmy</strong>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
{% endif %}
|
||
|
||
<!-- Email Cards from contacts table -->
|
||
{% set emails = contacts|selectattr('contact_type', 'equalto', 'email')|list if contacts else [] %}
|
||
{% if emails %}
|
||
{% for contact in emails %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid {% if contact.is_primary %}#10b981{% else %}#e5e7eb{% endif %};">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md); margin-bottom: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: {% if contact.is_primary %}#10b981{% else %}#ef4444{% endif %}; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="flex: 1; overflow: hidden;">
|
||
<div style="font-weight: 600; color: var(--text-primary);">
|
||
Email{% if contact.purpose %} - {{ contact.purpose }}{% endif %}
|
||
</div>
|
||
<a href="mailto:{{ contact.value }}" style="color: {% if contact.is_primary %}#10b981{% else %}#ef4444{% endif %}; font-size: var(--font-size-base); text-decoration: none; word-break: break-all;">
|
||
{{ contact.value }}
|
||
</a>
|
||
</div>
|
||
{% if contact.is_primary %}
|
||
<span style="padding: 4px 8px; background: #dcfce7; color: #166534; border-radius: 4px; font-size: 11px; font-weight: 600;">GŁÓWNY</span>
|
||
{% endif %}
|
||
</div>
|
||
{% if contact.source %}
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); padding-left: 60px;">
|
||
<span style="display: inline-flex; align-items: center; gap: 4px;">
|
||
<svg width="12" height="12" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/></svg>
|
||
Źródło: <strong style="color: {{ source_colors.get(contact.source, '#6b7280') }};">{{ source_names.get(contact.source, contact.source) }}</strong>
|
||
</span>
|
||
{% if contact.source_date %}
|
||
<span style="margin-left: 8px;">({{ contact.source_date|local_time('%d.%m.%Y') }})</span>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endfor %}
|
||
{% endif %}
|
||
|
||
<!-- Additional emails from website scraping (deduplicated) -->
|
||
{% if website_content and website_content.email_addresses %}
|
||
{% for email in website_content.email_addresses %}
|
||
{% if email|lower not in known_emails %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid #06b6d4;">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md); margin-bottom: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #06b6d4; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="flex: 1; overflow: hidden;">
|
||
<div style="font-weight: 600; color: var(--text-primary);">Email</div>
|
||
<a href="mailto:{{ email }}" style="color: #06b6d4; font-size: var(--font-size-base); text-decoration: none; word-break: break-all;">{{ email }}</a>
|
||
</div>
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); padding-left: 60px;">
|
||
Źródło: <strong style="color: #06b6d4;">Strona WWW (auto)</strong>
|
||
{% if website_content.scraped_at %}
|
||
<span style="margin-left: 8px;">({{ website_content.scraped_at|local_time('%d.%m.%Y') }})</span>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
{% endfor %}
|
||
{% endif %}
|
||
|
||
<!-- Fallback: Email from company record (if not in contacts) -->
|
||
{% if company.email %}
|
||
{% set email_in_contacts = emails_from_contacts|selectattr('value', 'equalto', company.email)|list|length > 0 if emails_from_contacts else false %}
|
||
{% if not email_in_contacts %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid #10b981;">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md); margin-bottom: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #10b981; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="flex: 1; overflow: hidden;">
|
||
<div style="font-weight: 600; color: var(--text-primary);">Email</div>
|
||
<a href="mailto:{{ company.email }}" style="color: #10b981; font-size: var(--font-size-base); text-decoration: none; word-break: break-all;">
|
||
{{ company.email }}
|
||
</a>
|
||
</div>
|
||
<span style="padding: 4px 8px; background: #dcfce7; color: #166534; border-radius: 4px; font-size: 11px; font-weight: 600;">GŁÓWNY</span>
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); padding-left: 60px;">
|
||
Źródło: <strong style="color: #667eea;">Dane firmy</strong>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
{% endif %}
|
||
|
||
<!-- Address Card (full address - header only shows city) -->
|
||
{% if company.address_full or company.address_street %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid #8b5cf6;">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md); margin-bottom: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #8b5cf6; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="flex: 1;">
|
||
<div style="font-weight: 600; color: var(--text-primary);">Adres siedziby</div>
|
||
<div style="color: #8b5cf6; font-size: var(--font-size-base);">
|
||
{% if company.address_full %}
|
||
{{ company.address_full }}
|
||
{% else %}
|
||
{{ company.address_street }}, {{ company.address_postal }} {{ company.address_city }}
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); padding-left: 60px;">
|
||
Źródło: <strong style="color: #10b981;">Rejestr KRS</strong>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
{# Koniec warunku: not (company.krs and company.data_source == 'KRS API') and not company.ceidg_id dla sekcji "Dane kontaktowe" #}
|
||
|
||
<!-- Social Media Section - Always show all platforms -->
|
||
{% set _social_hidden = company.is_section_hidden('social_media') %}
|
||
{% if not _social_hidden or can_edit_profile or is_admin %}
|
||
<div class="company-section {% if _social_hidden %}section-hidden{% endif %}">
|
||
{% if _social_hidden %}
|
||
<div class="hidden-section-badge"><i class="fas fa-eye-slash"></i> Ukryta — niewidoczna dla odwiedzających</div>
|
||
{% endif %}
|
||
<h2 class="section-title">Social Media</h2>
|
||
|
||
{% set platforms = ['facebook', 'instagram', 'youtube', 'linkedin', 'tiktok', 'twitter'] %}
|
||
{% set platform_names = {'facebook': 'Facebook', 'instagram': 'Instagram', 'youtube': 'YouTube', 'linkedin': 'LinkedIn', 'tiktok': 'TikTok', 'twitter': 'X (Twitter)'} %}
|
||
{% set platform_colors = {'facebook': '#1877f2', 'instagram': '#E4405F', 'youtube': '#ff0000', 'linkedin': '#0a66c2', 'tiktok': '#000000', 'twitter': '#000000'} %}
|
||
|
||
<!-- Convert social_media list to dict for easy lookup -->
|
||
{% set sm_dict = {} %}
|
||
{% if social_media %}
|
||
{% for sm in social_media %}
|
||
{% set _ = sm_dict.update({sm.platform: sm}) %}
|
||
{% endfor %}
|
||
{% endif %}
|
||
|
||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--spacing-lg);">
|
||
{% for platform in platforms %}
|
||
{% set sm = sm_dict.get(platform) %}
|
||
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid {% if sm %}{{ platform_colors[platform] }}{% else %}#e5e7eb{% endif %};">
|
||
<!-- Platform Header -->
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md); margin-bottom: var(--spacing-md);">
|
||
<!-- Icon -->
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
|
||
background: {% if sm %}{{ platform_colors[platform] }}{% else %}#f3f4f6{% endif %}; color: {% if sm %}white{% else %}#9ca3af{% endif %};">
|
||
{% if platform == 'facebook' %}
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24"><path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/></svg>
|
||
{% elif platform == 'instagram' %}
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"/></svg>
|
||
{% elif platform == 'youtube' %}
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24"><path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/></svg>
|
||
{% elif platform == 'linkedin' %}
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24"><path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/></svg>
|
||
{% elif platform == 'tiktok' %}
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24"><path d="M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"/></svg>
|
||
{% elif platform == 'twitter' %}
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<!-- Platform Name & Status -->
|
||
<div style="flex: 1;">
|
||
<div style="font-weight: 600; font-size: var(--font-size-lg); color: var(--text-primary);">
|
||
{{ platform_names[platform] }}
|
||
</div>
|
||
{% if sm %}
|
||
<div style="color: var(--success, #10b981); font-size: var(--font-size-sm); display: flex; align-items: center; gap: 4px;">
|
||
<svg width="14" height="14" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/></svg>
|
||
Aktywny profil
|
||
</div>
|
||
{% if sm.source == 'facebook_api' %}
|
||
<div style="color: #1877f2; font-size: var(--font-size-xs); display: flex; align-items: center; gap: 4px; margin-top: 2px;">
|
||
<svg width="12" height="12" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M6.267 3.455a3.066 3.066 0 001.745-.723 3.066 3.066 0 013.976 0 3.066 3.066 0 001.745.723 3.066 3.066 0 012.812 2.812c.051.643.304 1.254.723 1.745a3.066 3.066 0 010 3.976 3.066 3.066 0 00-.723 1.745 3.066 3.066 0 01-2.812 2.812 3.066 3.066 0 00-1.745.723 3.066 3.066 0 01-3.976 0 3.066 3.066 0 00-1.745-.723 3.066 3.066 0 01-2.812-2.812 3.066 3.066 0 00-.723-1.745 3.066 3.066 0 010-3.976 3.066 3.066 0 00.723-1.745 3.066 3.066 0 012.812-2.812zm7.44 5.252a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/></svg>
|
||
Dane z Facebook API
|
||
</div>
|
||
{% endif %}
|
||
{% if platform == 'linkedin' and (can_edit_profile or is_admin) %}
|
||
{% if '/in/' in sm.url %}
|
||
<div style="color: #d97706; font-size: var(--font-size-xs); display: flex; align-items: center; gap: 4px; margin-top: 2px;">
|
||
<i class="fas fa-user" style="font-size: 10px;"></i> Profil osobisty
|
||
</div>
|
||
{% elif '/company/' in sm.url %}
|
||
<div style="color: #0a66c2; font-size: var(--font-size-xs); display: flex; align-items: center; gap: 4px; margin-top: 2px;">
|
||
<i class="fas fa-building" style="font-size: 10px;"></i> Profil firmowy
|
||
</div>
|
||
{% endif %}
|
||
{% endif %}
|
||
{% else %}
|
||
<div style="color: #dc2626; font-size: var(--font-size-sm); display: flex; align-items: center; gap: 4px;">
|
||
<svg width="14" height="14" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"/></svg>
|
||
Brak profilu
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
|
||
{% if sm %}
|
||
<!-- Profile Details -->
|
||
<div style="background: white; border-radius: var(--radius); padding: var(--spacing-md); margin-bottom: var(--spacing-md);">
|
||
{% if sm.page_name %}
|
||
<div style="margin-bottom: var(--spacing-sm);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Nazwa profilu:</span>
|
||
<div style="font-weight: 500; color: var(--text-primary);">{{ sm.page_name }}</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<div style="margin-bottom: var(--spacing-sm);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Link:</span>
|
||
<div style="font-size: var(--font-size-sm); word-break: break-all;">
|
||
<a href="{{ sm.url }}" target="_blank" rel="noopener noreferrer" style="color: {{ platform_colors[platform] }}; text-decoration: none;">
|
||
{{ sm.url|replace('https://', '')|replace('http://', '')|truncate(40) }}
|
||
</a>
|
||
</div>
|
||
</div>
|
||
|
||
{% if sm.source == 'facebook_api' and sm.content_types %}
|
||
{% set fb_extra = sm.content_types %}
|
||
{% if fb_extra.get('category') %}
|
||
<div style="margin-bottom: var(--spacing-sm);">
|
||
<span style="display: inline-block; font-size: var(--font-size-xs); padding: 2px 8px; background: #f0f0ff; color: #4b5563; border-radius: 10px;">{{ fb_extra['category'] }}</span>
|
||
</div>
|
||
{% endif %}
|
||
{% endif %}
|
||
|
||
{% if sm.profile_description %}
|
||
<div style="margin-bottom: var(--spacing-sm); padding: var(--spacing-sm); background: #f8fafc; border-left: 3px solid #cbd5e1; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;">
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-secondary); line-height: 1.5;">{{ sm.profile_description|truncate(150) }}</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
{% if sm.source == 'facebook_api' and sm.content_types %}
|
||
{% set fb_extra = sm.content_types %}
|
||
{% if fb_extra.get('phone') or fb_extra.get('website') or fb_extra.get('address') %}
|
||
<div style="display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--spacing-sm);">
|
||
{% if fb_extra.get('phone') %}
|
||
<span style="display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-secondary); background: #f3f4f6; padding: 2px 8px; border-radius: 10px;">
|
||
<svg width="11" height="11" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"/></svg>
|
||
{{ fb_extra['phone'] }}
|
||
</span>
|
||
{% endif %}
|
||
{% if fb_extra.get('website') %}
|
||
<a href="{{ fb_extra['website'] }}" target="_blank" rel="noopener" style="display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--primary); background: #f3f4f6; padding: 2px 8px; border-radius: 10px; text-decoration: none;">
|
||
<svg width="11" height="11" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9"/></svg>
|
||
{{ fb_extra['website']|replace('https://', '')|replace('http://', '')|truncate(25) }}
|
||
</a>
|
||
{% endif %}
|
||
{% if fb_extra.get('address') %}
|
||
<span style="display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-secondary); background: #f3f4f6; padding: 2px 8px; border-radius: 10px;">
|
||
<svg width="11" height="11" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z"/></svg>
|
||
{{ fb_extra['address']|truncate(30) }}
|
||
</span>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
{% endif %}
|
||
|
||
{% if sm.source == 'facebook_api' and sm.profile_completeness_score is not none %}
|
||
<div style="margin-bottom: var(--spacing-sm);">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-sm);">
|
||
<span style="font-size: 11px; color: var(--text-secondary); white-space: nowrap;">Profil</span>
|
||
<div style="flex: 1; height: 4px; background: #e5e7eb; border-radius: 2px; overflow: hidden;">
|
||
<div style="height: 100%; width: {{ sm.profile_completeness_score }}%; background: {% if sm.profile_completeness_score >= 75 %}#10b981{% elif sm.profile_completeness_score >= 50 %}#f59e0b{% else %}#ef4444{% endif %}; border-radius: 2px;"></div>
|
||
</div>
|
||
<span style="font-size: 11px; font-weight: 600; color: var(--text-secondary);">{{ sm.profile_completeness_score }}%</span>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
{% if sm.followers_count %}
|
||
<div style="display: flex; gap: var(--spacing-lg); margin-top: var(--spacing-md); padding-top: var(--spacing-md); border-top: 1px solid var(--border);">
|
||
<div style="text-align: center;">
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: {{ platform_colors[platform] }};">
|
||
{{ sm.followers_count|default(0) }}
|
||
</div>
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-secondary);">
|
||
{% if platform == 'youtube' %}Subskrybentów{% else %}Obserwujących{% endif %}
|
||
</div>
|
||
</div>
|
||
{% if sm.engagement_rate %}
|
||
<div style="text-align: center;">
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: #10b981;">
|
||
{{ sm.engagement_rate }}%
|
||
</div>
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-secondary);">Engagement</div>
|
||
</div>
|
||
{% endif %}
|
||
{% if sm.total_posts %}
|
||
<div style="text-align: center;">
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: var(--text-primary);">
|
||
{{ sm.total_posts }}
|
||
</div>
|
||
<div style="font-size: var(--font-size-xs); color: var(--text-secondary);">
|
||
{% if platform == 'youtube' %}Filmów{% else %}Postów{% endif %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<!-- Refresh button for Facebook API connected profiles -->
|
||
{% if sm.source == 'facebook_api' and (can_edit_profile or is_admin) %}
|
||
<button onclick="syncFacebookData({{ company.id }}, this)" style="display: block; width: 100%; text-align: center; padding: var(--spacing-xs) var(--spacing-md);
|
||
background: transparent; color: #1877f2; border: 1px solid #1877f2; border-radius: var(--radius);
|
||
font-size: var(--font-size-xs); cursor: pointer; margin-bottom: var(--spacing-xs);
|
||
transition: background 0.2s;">
|
||
<svg width="14" height="14" fill="currentColor" viewBox="0 0 20 20" style="vertical-align: middle; margin-right: 4px;"><path fill-rule="evenodd" d="M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z" clip-rule="evenodd"/></svg>
|
||
Odśwież dane z API
|
||
</button>
|
||
{% endif %}
|
||
|
||
<!-- Visit Button -->
|
||
<a href="{{ sm.url }}" target="_blank" rel="noopener noreferrer"
|
||
style="display: block; text-align: center; padding: var(--spacing-sm) var(--spacing-md);
|
||
background: {{ platform_colors[platform] }}; color: white; border-radius: var(--radius);
|
||
text-decoration: none; font-weight: 500; font-size: var(--font-size-sm);
|
||
transition: opacity 0.2s;">
|
||
Odwiedź profil
|
||
</a>
|
||
|
||
{% if platform == 'linkedin' and '/in/' in sm.url and (can_edit_profile or is_admin) %}
|
||
<!-- LinkedIn personal profile recommendation -->
|
||
<div style="margin-top: var(--spacing-sm); padding: var(--spacing-sm) var(--spacing-md);
|
||
background: #fef3c7; border: 1px solid #f59e0b; border-radius: var(--radius);
|
||
font-size: var(--font-size-xs); color: #92400e; line-height: 1.4;">
|
||
<i class="fas fa-info-circle" style="margin-right: 4px;"></i>
|
||
To jest profil osobisty{% if sm.page_name %} ({{ sm.page_name }}){% endif %}, nie strona firmowa.
|
||
Rozważ utworzenie <a href="https://www.linkedin.com/company/setup/new/" target="_blank" rel="noopener noreferrer"
|
||
style="color: #92400e; font-weight: 600; text-decoration: underline;">LinkedIn Company Page</a>
|
||
dla lepszej widoczności firmy.
|
||
</div>
|
||
{% endif %}
|
||
{% else %}
|
||
<!-- No Profile Message -->
|
||
<div style="text-align: center; padding: var(--spacing-lg); color: var(--text-secondary);">
|
||
<div style="font-size: 48px; margin-bottom: var(--spacing-sm); opacity: 0.3;">
|
||
<svg width="48" height="48" fill="currentColor" viewBox="0 0 20 20" style="color: #dc2626;"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"/></svg>
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm);">
|
||
Firma nie posiada profilu na {{ platform_names[platform] }}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endfor %}
|
||
</div>
|
||
</div>
|
||
{% endif %}{# social_media visibility #}
|
||
|
||
{# ======================================================================
|
||
REKOMENDACJE - TYMCZASOWO UKRYTE
|
||
Powód: Oczekiwanie na akceptację zarządu Norda (trwają rozmowy)
|
||
Data ukrycia: 2026-02-01
|
||
Aby włączyć: zmień "False" na "True" w linii poniżej
|
||
====================================================================== #}
|
||
{% set _recommendations_hidden = company.is_section_hidden('recommendations') %}
|
||
{% if False and (not _recommendations_hidden or can_edit_profile or is_admin) %} {# REKOMENDACJE DISABLED - zmień False na True aby włączyć #}
|
||
<!-- Recommendations Section -->
|
||
<div class="company-section {% if _recommendations_hidden %}section-hidden{% endif %}">
|
||
{% if _recommendations_hidden %}
|
||
<div class="hidden-section-badge"><i class="fas fa-eye-slash"></i> Ukryta — niewidoczna dla odwiedzających</div>
|
||
{% endif %}
|
||
<h2 class="section-title">⭐ REKOMENDACJE {% if recommendations %}({{ recommendations|length }} rekomendacji){% endif %}</h2>
|
||
|
||
{% if current_user.is_authenticated %}
|
||
<!-- Add Recommendation Button -->
|
||
<div style="margin-bottom: var(--spacing-lg);">
|
||
<a href="{{ url_for('company_recommend', slug=company.slug) }}"
|
||
style="display: inline-flex; align-items: center; gap: var(--spacing-sm); padding: var(--spacing-md) var(--spacing-lg);
|
||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border-radius: var(--radius);
|
||
text-decoration: none; font-weight: 600; font-size: var(--font-size-base); transition: opacity 0.2s;">
|
||
<svg width="20" height="20" fill="currentColor" viewBox="0 0 20 20">
|
||
<path fill-rule="evenodd" d="M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z" clip-rule="evenodd"/>
|
||
</svg>
|
||
Dodaj rekomendację
|
||
</a>
|
||
</div>
|
||
{% endif %}
|
||
|
||
{% if recommendations %}
|
||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: var(--spacing-lg);">
|
||
{% for rec in recommendations %}
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-xl); border: 2px solid #e5e7eb;">
|
||
<!-- Recommender Header -->
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md); margin-bottom: var(--spacing-lg); padding-bottom: var(--spacing-md); border-bottom: 2px solid var(--border);">
|
||
<div style="width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
|
||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; font-weight: 700; font-size: var(--font-size-lg);">
|
||
{{ rec.user.first_name[0] if rec.user.first_name else rec.user.email[0].upper() }}
|
||
</div>
|
||
<div style="flex: 1;">
|
||
<div style="font-weight: 600; font-size: var(--font-size-lg); color: var(--text-primary);">
|
||
{{ rec.user.first_name }} {{ rec.user.last_name }}
|
||
</div>
|
||
{% if rec.user.company %}
|
||
<a href="{{ url_for('company_detail_by_slug', slug=rec.user.company.slug) }}"
|
||
style="color: var(--primary); font-size: var(--font-size-sm); text-decoration: none;">
|
||
{{ rec.user.company.name }}
|
||
</a>
|
||
{% endif %}
|
||
</div>
|
||
<div style="text-align: right; font-size: var(--font-size-sm); color: var(--text-secondary);">
|
||
{{ rec.created_at|local_time('%d.%m.%Y') }}
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Service Category (if provided) -->
|
||
{% if rec.service_category %}
|
||
<div style="margin-bottom: var(--spacing-md);">
|
||
<span style="display: inline-block; padding: 4px 12px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||
color: white; border-radius: var(--radius); font-size: var(--font-size-sm); font-weight: 500;">
|
||
{{ rec.service_category }}
|
||
</span>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Recommendation Text -->
|
||
<div style="margin-bottom: var(--spacing-lg); line-height: 1.6; color: var(--text-primary); font-size: var(--font-size-base);">
|
||
{{ rec.recommendation_text }}
|
||
</div>
|
||
|
||
<!-- Contact Information (if enabled) -->
|
||
{% if rec.show_contact %}
|
||
<div style="background: white; border-radius: var(--radius); padding: var(--spacing-md); margin-bottom: var(--spacing-md);">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); margin-bottom: var(--spacing-sm); font-weight: 600;">
|
||
Kontakt z rekomendującym:
|
||
</div>
|
||
<div style="display: flex; flex-direction: column; gap: var(--spacing-xs);">
|
||
{% if rec.user.email %}
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-sm);">
|
||
<svg width="16" height="16" fill="#3b82f6" viewBox="0 0 20 20">
|
||
<path d="M2.003 5.884L10 9.882l7.997-3.998A2 2 0 0016 4H4a2 2 0 00-1.997 1.884z"/>
|
||
<path d="M18 8.118l-8 4-8-4V14a2 2 0 002 2h12a2 2 0 002-2V8.118z"/>
|
||
</svg>
|
||
<a href="mailto:{{ rec.user.email }}" style="color: var(--primary); text-decoration: none; font-size: var(--font-size-sm);">
|
||
{{ rec.user.email }}
|
||
</a>
|
||
</div>
|
||
{% endif %}
|
||
{% if rec.user.phone %}
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-sm);">
|
||
<svg width="16" height="16" fill="#10b981" viewBox="0 0 20 20">
|
||
<path d="M2 3a1 1 0 011-1h2.153a1 1 0 01.986.836l.74 4.435a1 1 0 01-.54 1.06l-1.548.773a11.037 11.037 0 006.105 6.105l.774-1.548a1 1 0 011.059-.54l4.435.74a1 1 0 01.836.986V17a1 1 0 01-1 1h-2C7.82 18 2 12.18 2 5V3z"/>
|
||
</svg>
|
||
<a href="tel:{{ rec.user.phone }}" style="color: #10b981; text-decoration: none; font-size: var(--font-size-sm);">
|
||
{{ rec.user.phone }}
|
||
</a>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Edit/Delete buttons for own recommendations -->
|
||
{% if current_user.is_authenticated and current_user.id == rec.user_id %}
|
||
<div style="display: flex; gap: var(--spacing-sm); margin-top: var(--spacing-md); padding-top: var(--spacing-md); border-top: 1px solid var(--border);">
|
||
<button onclick="editRecommendation({{ rec.id }})"
|
||
style="flex: 1; padding: var(--spacing-sm); background: var(--primary); color: white; border: none;
|
||
border-radius: var(--radius); cursor: pointer; font-size: var(--font-size-sm); font-weight: 500;">
|
||
Edytuj
|
||
</button>
|
||
<button onclick="deleteRecommendation({{ rec.id }})"
|
||
style="flex: 1; padding: var(--spacing-sm); background: #dc2626; color: white; border: none;
|
||
border-radius: var(--radius); cursor: pointer; font-size: var(--font-size-sm); font-weight: 500;">
|
||
Usuń
|
||
</button>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endfor %}
|
||
</div>
|
||
{% else %}
|
||
<!-- Empty State -->
|
||
<div style="text-align: center; padding: var(--spacing-2xl); background: var(--background); border-radius: var(--radius-lg); border: 2px dashed var(--border);">
|
||
<div style="font-size: 64px; margin-bottom: var(--spacing-md); opacity: 0.3;">⭐</div>
|
||
<div style="font-size: var(--font-size-lg); color: var(--text-secondary); font-weight: 500;">
|
||
Brak rekomendacji. Bądź pierwszy!
|
||
</div>
|
||
{% if current_user.is_authenticated %}
|
||
<a href="{{ url_for('company_recommend', slug=company.slug) }}"
|
||
style="display: inline-flex; align-items: center; gap: var(--spacing-sm); padding: var(--spacing-md) var(--spacing-lg);
|
||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border-radius: var(--radius);
|
||
text-decoration: none; font-weight: 600; font-size: var(--font-size-base); margin-top: var(--spacing-md);">
|
||
<svg width="20" height="20" fill="currentColor" viewBox="0 0 20 20">
|
||
<path fill-rule="evenodd" d="M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z" clip-rule="evenodd"/>
|
||
</svg>
|
||
Dodaj pierwszą rekomendację
|
||
</a>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %} {# END REKOMENDACJE DISABLED #}
|
||
|
||
<!-- Macro: Audit cards for a single website analysis -->
|
||
{% macro audit_cards(wa) %}
|
||
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--spacing-lg); margin-bottom: var(--spacing-xl);">
|
||
|
||
<!-- SSL Certificate Card -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid {% if wa.has_ssl %}#10b981{% else %}#dc2626{% endif %};">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md); margin-bottom: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
|
||
background: {% if wa.has_ssl %}#10b981{% else %}#dc2626{% endif %}; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/>
|
||
</svg>
|
||
</div>
|
||
<div>
|
||
<div style="font-weight: 600; color: var(--text-primary);">Certyfikat SSL</div>
|
||
{% if wa.has_ssl %}
|
||
<div style="color: #10b981; font-size: var(--font-size-sm);">Aktywny</div>
|
||
{% else %}
|
||
<div style="color: #dc2626; font-size: var(--font-size-sm);">Brak</div>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
{% if wa.has_ssl %}
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); padding-left: 60px;">
|
||
{% if wa.ssl_issuer %}
|
||
<div style="margin-bottom: 2px;">Wystawca: <strong>{{ wa.ssl_issuer }}</strong></div>
|
||
{% endif %}
|
||
{% if wa.ssl_expires_at %}
|
||
<div>Ważny do {{ wa.ssl_expires_at|local_time('%d.%m.%Y') }}</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<!-- Mobile Responsive Card -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid {% if wa.is_mobile_friendly %}#10b981{% else %}#f59e0b{% endif %};">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md); margin-bottom: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
|
||
background: {% if wa.is_mobile_friendly %}#10b981{% else %}#f59e0b{% endif %}; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M17 1.01L7 1c-1.1 0-2 .9-2 2v18c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-1.99-2-1.99zM17 19H7V5h10v14z"/>
|
||
</svg>
|
||
</div>
|
||
<div>
|
||
<div style="font-weight: 600; color: var(--text-primary);">Wersja mobilna</div>
|
||
{% if wa.is_mobile_friendly %}
|
||
<div style="color: #10b981; font-size: var(--font-size-sm);">Responsywna</div>
|
||
{% else %}
|
||
<div style="color: #f59e0b; font-size: var(--font-size-sm);">Brak</div>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Load Time Card -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid {% if wa.load_time_ms and wa.load_time_ms < 1000 %}#10b981{% elif wa.load_time_ms and wa.load_time_ms < 2000 %}#22c55e{% elif wa.load_time_ms and wa.load_time_ms < 3000 %}#84cc16{% elif wa.load_time_ms and wa.load_time_ms < 4000 %}#f59e0b{% elif wa.load_time_ms %}#dc2626{% else %}#e5e7eb{% endif %};">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md); margin-bottom: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
|
||
background: {% if wa.load_time_ms and wa.load_time_ms < 1000 %}#10b981{% elif wa.load_time_ms and wa.load_time_ms < 2000 %}#22c55e{% elif wa.load_time_ms and wa.load_time_ms < 3000 %}#84cc16{% elif wa.load_time_ms and wa.load_time_ms < 4000 %}#f59e0b{% elif wa.load_time_ms %}#dc2626{% else %}#9ca3af{% endif %}; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"/>
|
||
</svg>
|
||
</div>
|
||
<div>
|
||
<div style="font-weight: 600; color: var(--text-primary);">Czas ładowania</div>
|
||
{% if wa.load_time_ms %}
|
||
<div style="color: {% if wa.load_time_ms < 1000 %}#10b981{% elif wa.load_time_ms < 2000 %}#22c55e{% elif wa.load_time_ms < 3000 %}#84cc16{% elif wa.load_time_ms < 4000 %}#f59e0b{% else %}#dc2626{% endif %}; font-size: var(--font-size-sm);">
|
||
{{ (wa.load_time_ms / 1000)|round(2) }}s
|
||
</div>
|
||
{% else %}
|
||
<div style="color: #9ca3af; font-size: var(--font-size-sm);">Brak danych</div>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
{% if wa.load_time_ms %}
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); padding-left: 60px;">
|
||
{% if wa.load_time_ms < 500 %}
|
||
<span style="color: #10b981;">Doskonały</span> - błyskawicznie
|
||
{% elif wa.load_time_ms < 1000 %}
|
||
<span style="color: #10b981;">Bardzo dobry</span> - poniżej 1s
|
||
{% elif wa.load_time_ms < 2000 %}
|
||
<span style="color: #22c55e;">Dobry</span> - akceptowalny
|
||
{% elif wa.load_time_ms < 3000 %}
|
||
<span style="color: #84cc16;">Przeciętny</span> - do poprawy
|
||
{% elif wa.load_time_ms < 4000 %}
|
||
<span style="color: #f59e0b;">Wolny</span> - wymaga optymalizacji
|
||
{% else %}
|
||
<span style="color: #dc2626;">Bardzo wolny</span> - krytyczny
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<!-- CMS/Technology Card -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid {% if wa.cms_detected %}#10b981{% else %}#e5e7eb{% endif %};">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md); margin-bottom: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
|
||
background: {% if wa.cms_detected %}#10b981{% else %}#9ca3af{% endif %}; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"/>
|
||
</svg>
|
||
</div>
|
||
<div>
|
||
<div style="font-weight: 600; color: var(--text-primary);">Technologia / CMS</div>
|
||
{% if wa.cms_detected %}
|
||
<div style="color: #10b981; font-size: var(--font-size-sm);">{{ wa.cms_detected }}</div>
|
||
{% else %}
|
||
<div style="color: #9ca3af; font-size: var(--font-size-sm);">Nieznany</div>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Hosting Card -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid {% if wa.hosting_provider %}#3b82f6{% else %}#e5e7eb{% endif %};">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md); margin-bottom: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
|
||
background: {% if wa.hosting_provider %}#3b82f6{% else %}#9ca3af{% endif %}; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M2 9h20v12H2V9zm2 2v8h16v-8H4zm6 2h4v4h-4v-4zM2 3h20v4H2V3z"/>
|
||
</svg>
|
||
</div>
|
||
<div>
|
||
<div style="font-weight: 600; color: var(--text-primary);">Hosting</div>
|
||
{% if wa.hosting_provider %}
|
||
<div style="color: #3b82f6; font-size: var(--font-size-sm);">{{ wa.hosting_provider }}</div>
|
||
{% else %}
|
||
<div style="color: #9ca3af; font-size: var(--font-size-sm);">Nieznany</div>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Server Card -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid {% if wa.server_software %}#8b5cf6{% else %}#e5e7eb{% endif %};">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md); margin-bottom: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
|
||
background: {% if wa.server_software %}#8b5cf6{% else %}#9ca3af{% endif %}; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M20 13H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1zM7 19c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zM20 3H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zM7 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"/>
|
||
</svg>
|
||
</div>
|
||
<div>
|
||
<div style="font-weight: 600; color: var(--text-primary);">Serwer</div>
|
||
{% if wa.server_software %}
|
||
<div style="color: #8b5cf6; font-size: var(--font-size-sm);">{{ wa.server_software }}</div>
|
||
{% else %}
|
||
<div style="color: #9ca3af; font-size: var(--font-size-sm);">Nieznany</div>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Website Author Card - Full Width -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid {% if wa.site_author %}#6366f1{% else %}#e5e7eb{% endif %}; grid-column: span 2;">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
|
||
background: {% if wa.site_author %}#6366f1{% else %}#9ca3af{% endif %}; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="flex: 1;">
|
||
<div style="font-weight: 600; color: var(--text-primary);">Wykonawca strony</div>
|
||
{% if wa.site_author %}
|
||
<div style="color: #6366f1; font-size: var(--font-size-sm);">{{ wa.site_author }}</div>
|
||
{% else %}
|
||
<div style="color: #9ca3af; font-size: var(--font-size-sm);">Nieznany</div>
|
||
{% endif %}
|
||
</div>
|
||
{% if wa.site_author %}
|
||
{% set author_text = wa.site_author %}
|
||
{% set extracted_domain = namespace(value='') %}
|
||
{% for word in author_text.replace('/', ' ').replace('–', ' ').replace('-', ' ').replace(',', ' ').split() %}
|
||
{% set word_lower = word|lower|trim %}
|
||
{% if extracted_domain.value == '' and (word_lower.endswith('.pl') or word_lower.endswith('.com') or word_lower.endswith('.eu') or word_lower.endswith('.net') or word_lower.endswith('.org')) %}
|
||
{% set extracted_domain.value = word_lower %}
|
||
{% endif %}
|
||
{% endfor %}
|
||
{% if extracted_domain.value %}
|
||
{% set author_url = 'https://' ~ extracted_domain.value %}
|
||
<a href="{{ author_url }}" target="_blank" rel="noopener noreferrer"
|
||
style="padding: var(--spacing-xs) var(--spacing-md); background: #6366f1; color: white; border-radius: var(--radius);
|
||
text-decoration: none; font-size: var(--font-size-sm); white-space: nowrap;">
|
||
Odwiedź
|
||
</a>
|
||
{% endif %}
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
{% endmacro %}
|
||
|
||
<!-- Unified Website Section -->
|
||
{% set primary_website = company.websites|selectattr('is_primary')|first if company.websites else none %}
|
||
{% set primary_url = primary_website.url if primary_website else company.website %}
|
||
{% set _website_hidden = company.is_section_hidden('website') %}
|
||
{% if not _website_hidden or can_edit_profile or is_admin %}
|
||
{% if primary_url and (website_analysis or company.websites) %}
|
||
<div class="company-section {% if _website_hidden %}section-hidden{% endif %}">
|
||
{% if _website_hidden %}
|
||
<div class="hidden-section-badge"><i class="fas fa-eye-slash"></i> Ukryta — niewidoczna dla odwiedzających</div>
|
||
{% endif %}
|
||
<h2 class="section-title">Strona WWW</h2>
|
||
|
||
<!-- Website banners with per-site audit cards -->
|
||
{% for w in (company.websites if company.websites else []) %}
|
||
{% set cfg = wtype_config.get(w.website_type or 'website', wtype_config['website']) %}
|
||
{% set banner_label = cfg.tooltip ~ (' — ' ~ w.label if w.label else '') %}
|
||
<div style="margin-bottom: var(--spacing-md); padding: {{ 'var(--spacing-lg)' if w.is_primary else 'var(--spacing-md) var(--spacing-lg)' }}; background: linear-gradient(135deg, {{ cfg.color }}, {{ cfg.color }}dd); border-radius: var(--radius-lg); display: flex; align-items: center; gap: var(--spacing-md);">
|
||
<div style="width: {{ '56px' if w.is_primary else '40px' }}; height: {{ '56px' if w.is_primary else '40px' }}; border-radius: {{ '12px' if w.is_primary else '10px' }}; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center;">
|
||
{% if cfg.icon == 'cart' %}
|
||
<svg width="{{ '28' if w.is_primary else '20' }}" height="{{ '28' if w.is_primary else '20' }}" fill="none" stroke="white" stroke-width="2" viewBox="0 0 24 24"><circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/><path d="M1 1h4l2.68 13.39a2 2 0 002 1.61h9.72a2 2 0 002-1.61L23 6H6"/></svg>
|
||
{% elif cfg.icon == 'calendar' %}
|
||
<svg width="{{ '28' if w.is_primary else '20' }}" height="{{ '28' if w.is_primary else '20' }}" fill="none" stroke="white" stroke-width="2" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
|
||
{% elif cfg.icon == 'pencil' %}
|
||
<svg width="{{ '28' if w.is_primary else '20' }}" height="{{ '28' if w.is_primary else '20' }}" fill="none" stroke="white" stroke-width="2" viewBox="0 0 24 24"><path d="M12 20h9"/><path d="M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4L16.5 3.5z"/></svg>
|
||
{% elif cfg.icon == 'image' %}
|
||
<svg width="{{ '28' if w.is_primary else '20' }}" height="{{ '28' if w.is_primary else '20' }}" fill="none" stroke="white" stroke-width="2" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>
|
||
{% else %}
|
||
<svg width="{{ '28' if w.is_primary else '20' }}" height="{{ '28' if w.is_primary else '20' }}" fill="white" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" fill="none" stroke="white" stroke-width="2"/><path d="M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" fill="none" stroke="white" stroke-width="2"/></svg>
|
||
{% endif %}
|
||
</div>
|
||
<div style="flex: 1;">
|
||
<div style="font-size: var(--font-size-sm); color: rgba(255,255,255,0.8); margin-bottom: 4px;">{{ banner_label }}</div>
|
||
<a href="{{ w.url|ensure_url }}" target="_blank" rel="noopener noreferrer"
|
||
style="font-size: {{ 'var(--font-size-xl)' if w.is_primary else 'var(--font-size-lg)' }}; font-weight: 600; color: white; text-decoration: none; display: flex; align-items: center; gap: var(--spacing-sm);">
|
||
{{ w.url|replace('https://', '')|replace('http://', '')|replace('www.', '') }}
|
||
<svg width="{{ '20' if w.is_primary else '16' }}" height="{{ '20' if w.is_primary else '16' }}" fill="white" viewBox="0 0 24 24" style="opacity: 0.8;">
|
||
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"/>
|
||
</svg>
|
||
</a>
|
||
</div>
|
||
<a href="{{ w.url|ensure_url }}" target="_blank" rel="noopener noreferrer"
|
||
style="padding: var(--spacing-sm) var(--spacing-lg); background: white; color: {{ cfg.color }}; border-radius: var(--radius); text-decoration: none; font-weight: 600; font-size: var(--font-size-sm);">
|
||
{{ 'Odwiedź stronę' if w.is_primary else 'Odwiedź' }}
|
||
</a>
|
||
</div>
|
||
|
||
{# Per-website audit cards #}
|
||
{% set wa = analyses_by_website.get(w.id) if analyses_by_website else none %}
|
||
{% if wa %}
|
||
{{ audit_cards(wa) }}
|
||
{% else %}
|
||
<div style="margin-bottom: var(--spacing-xl); padding: var(--spacing-lg); background: var(--background); border-radius: var(--radius-lg); border: 1px dashed #d1d5db; text-align: center; color: var(--text-secondary); font-size: var(--font-size-sm);">
|
||
<svg width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" style="vertical-align: middle; margin-right: 6px; opacity: 0.5;"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4M12 8h.01"/></svg>
|
||
Audyt tej strony nie został jeszcze przeprowadzony.
|
||
</div>
|
||
{% endif %}
|
||
|
||
{% endfor %}
|
||
{% if not company.websites and primary_url %}
|
||
<!-- Fallback for companies without relationship data -->
|
||
<div style="margin-bottom: var(--spacing-md); padding: var(--spacing-lg); background: linear-gradient(135deg, #3b82f6, #1d4ed8); border-radius: var(--radius-lg); display: flex; align-items: center; gap: var(--spacing-md);">
|
||
<div style="width: 56px; height: 56px; border-radius: 12px; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center;">
|
||
<svg width="28" height="28" fill="white" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" fill="none" stroke="white" stroke-width="2"/><path d="M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" fill="none" stroke="white" stroke-width="2"/></svg>
|
||
</div>
|
||
<div style="flex: 1;">
|
||
<div style="font-size: var(--font-size-sm); color: rgba(255,255,255,0.8); margin-bottom: 4px;">Adres strony</div>
|
||
<a href="{{ primary_url|ensure_url }}" target="_blank" rel="noopener noreferrer"
|
||
style="font-size: var(--font-size-xl); font-weight: 600; color: white; text-decoration: none; display: flex; align-items: center; gap: var(--spacing-sm);">
|
||
{{ primary_url|replace('https://', '')|replace('http://', '')|replace('www.', '') }}
|
||
<svg width="20" height="20" fill="white" viewBox="0 0 24 24" style="opacity: 0.8;"><path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"/></svg>
|
||
</a>
|
||
</div>
|
||
<a href="{{ primary_url|ensure_url }}" target="_blank" rel="noopener noreferrer"
|
||
style="padding: var(--spacing-sm) var(--spacing-lg); background: white; color: #1d4ed8; border-radius: var(--radius); text-decoration: none; font-weight: 600; font-size: var(--font-size-sm);">
|
||
Odwiedź stronę
|
||
</a>
|
||
</div>
|
||
{# Fallback: show audit cards from primary website_analysis #}
|
||
{% if website_analysis %}
|
||
{{ audit_cards(website_analysis) }}
|
||
{% endif %}
|
||
{% endif %}
|
||
|
||
<!-- Google Rating Card (company-level, not per-website) -->
|
||
{% if website_analysis and website_analysis.google_rating %}
|
||
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--spacing-lg);">
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 2px solid #f59e0b;">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-md);">
|
||
<div style="width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
|
||
background: #f59e0b; color: white;">
|
||
<svg width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/>
|
||
</svg>
|
||
</div>
|
||
<div>
|
||
<div style="font-weight: 600; color: var(--text-primary);">Ocena Google</div>
|
||
<div style="color: #f59e0b; font-size: var(--font-size-sm);">
|
||
{{ website_analysis.google_rating }}/5
|
||
{% if website_analysis.google_reviews_count %}({{ website_analysis.google_reviews_count }} opinii){% endif %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
</div>
|
||
{% elif company.website %}
|
||
<!-- Website URL only (no analysis yet) -->
|
||
<div class="company-section {% if _website_hidden %}section-hidden{% endif %}">
|
||
{% if _website_hidden %}
|
||
<div class="hidden-section-badge"><i class="fas fa-eye-slash"></i> Ukryta — niewidoczna dla odwiedzających</div>
|
||
{% endif %}
|
||
<h2 class="section-title">Strona WWW</h2>
|
||
<div style="padding: var(--spacing-lg); background: linear-gradient(135deg, #3b82f6, #1d4ed8); border-radius: var(--radius-lg); display: flex; align-items: center; gap: var(--spacing-md);">
|
||
<div style="width: 56px; height: 56px; border-radius: 12px; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center;">
|
||
<svg width="28" height="28" fill="white" viewBox="0 0 24 24">
|
||
<circle cx="12" cy="12" r="10" fill="none" stroke="white" stroke-width="2"/>
|
||
<path d="M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" fill="none" stroke="white" stroke-width="2"/>
|
||
</svg>
|
||
</div>
|
||
<div style="flex: 1;">
|
||
<div style="font-size: var(--font-size-sm); color: rgba(255,255,255,0.8); margin-bottom: 4px;">Adres strony</div>
|
||
<a href="{{ company.website|ensure_url }}" target="_blank" rel="noopener noreferrer"
|
||
style="font-size: var(--font-size-xl); font-weight: 600; color: white; text-decoration: none; display: flex; align-items: center; gap: var(--spacing-sm);">
|
||
{{ company.website|replace('https://', '')|replace('http://', '')|replace('www.', '') }}
|
||
<svg width="20" height="20" fill="white" viewBox="0 0 24 24" style="opacity: 0.8;">
|
||
<path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"/>
|
||
</svg>
|
||
</a>
|
||
</div>
|
||
<a href="{{ company.website|ensure_url }}" target="_blank" rel="noopener noreferrer"
|
||
style="padding: var(--spacing-sm) var(--spacing-lg); background: white; color: #1d4ed8; border-radius: var(--radius); text-decoration: none; font-weight: 600; font-size: var(--font-size-sm);">
|
||
Odwiedź stronę
|
||
</a>
|
||
</div>
|
||
</div>
|
||
{% else %}
|
||
<!-- No Website Section -->
|
||
<div class="company-section {% if _website_hidden %}section-hidden{% endif %}">
|
||
{% if _website_hidden %}
|
||
<div class="hidden-section-badge"><i class="fas fa-eye-slash"></i> Ukryta — niewidoczna dla odwiedzających</div>
|
||
{% endif %}
|
||
<h2 class="section-title">Strona WWW</h2>
|
||
<div style="display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--spacing-xl); text-align: center;">
|
||
<div style="width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, #f3f4f6, #e5e7eb); display: flex; align-items: center; justify-content: center; margin-bottom: var(--spacing-lg);">
|
||
<svg width="40" height="40" fill="none" stroke="#9ca3af" stroke-width="2" viewBox="0 0 24 24">
|
||
<circle cx="12" cy="12" r="10"/>
|
||
<path d="M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>
|
||
<line x1="4" y1="4" x2="20" y2="20" stroke="#dc2626" stroke-width="2.5"/>
|
||
</svg>
|
||
</div>
|
||
<div style="font-size: var(--font-size-lg); font-weight: 600; color: var(--text-secondary); margin-bottom: var(--spacing-sm);">
|
||
Brak strony internetowej
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); max-width: 400px; line-height: 1.6;">
|
||
Ta firma nie posiada jeszcze strony internetowej lub jej adres nie jest znany.
|
||
{% if company.phone or company.email %}
|
||
Skontaktuj się bezpośrednio używając danych kontaktowych podanych powyżej.
|
||
{% endif %}
|
||
</div>
|
||
<div style="margin-top: var(--spacing-lg); padding: var(--spacing-md) var(--spacing-lg); background: #fef3c7; border-radius: var(--radius); border: 1px solid #f59e0b;">
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-sm); color: #92400e; font-size: var(--font-size-sm);">
|
||
<svg width="16" height="16" fill="currentColor" viewBox="0 0 20 20">
|
||
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/>
|
||
</svg>
|
||
<span>Jeśli znasz adres strony tej firmy, poinformuj nas przez formularz kontaktowy.</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
{% endif %}{# website visibility #}
|
||
|
||
<!-- SEO Metrics Section - Only show if SEO audit was performed -->
|
||
{% set _seo_hidden = company.is_section_hidden('seo_audit') %}
|
||
{% if website_analysis and website_analysis.seo_audited_at and is_audit_owner and (not _seo_hidden or can_edit_profile or is_admin) %}
|
||
<div class="company-section {% if _seo_hidden %}section-hidden{% endif %}" id="seo-metrics">
|
||
{% if _seo_hidden %}
|
||
<div class="hidden-section-badge"><i class="fas fa-eye-slash"></i> Ukryta — niewidoczna dla odwiedzających</div>
|
||
{% endif %}
|
||
<h2 class="section-title">
|
||
Analiza SEO
|
||
<span style="font-size: var(--font-size-sm); font-weight: normal; color: var(--text-secondary); margin-left: var(--spacing-sm);">
|
||
({{ website_analysis.seo_audited_at|local_time('%d.%m.%Y') }})
|
||
</span>
|
||
</h2>
|
||
|
||
<!-- Overall SEO Score Banner - Clickable link to detailed audit -->
|
||
{% set overall_score = website_analysis.seo_overall_score or website_analysis.pagespeed_seo_score %}
|
||
{% if overall_score is not none %}
|
||
{# Unified 5-level color scale: 0-29 red, 30-49 orange, 50-69 amber, 70-89 lime, 90-100 green #}
|
||
<a href="{{ url_for('seo_audit_dashboard', slug=company.slug) }}" style="text-decoration: none; display: block; margin-bottom: var(--spacing-lg); padding: var(--spacing-lg); border-radius: var(--radius-lg); display: flex; align-items: center; gap: var(--spacing-lg); cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
|
||
background: linear-gradient(135deg, {% if overall_score >= 90 %}#10b981, #059669{% elif overall_score >= 70 %}#84cc16, #65a30d{% elif overall_score >= 50 %}#f59e0b, #d97706{% elif overall_score >= 30 %}#f97316, #ea580c{% else %}#ef4444, #dc2626{% endif %});"
|
||
onmouseover="this.style.transform='translateY(-2px)'; this.style.boxShadow='0 8px 25px rgba(0,0,0,0.15)';"
|
||
onmouseout="this.style.transform='translateY(0)'; this.style.boxShadow='none';">
|
||
<div style="width: 80px; height: 80px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; flex-shrink: 0;">
|
||
<span style="font-size: 32px; font-weight: 700; color: white;">{{ overall_score }}</span>
|
||
</div>
|
||
<div style="flex: 1; color: white;">
|
||
<div style="font-size: var(--font-size-xl); font-weight: 600; margin-bottom: 4px;">
|
||
{% if overall_score >= 90 %}Doskonały wynik SEO{% elif overall_score >= 70 %}Dobry wynik SEO{% elif overall_score >= 50 %}Przeciętny wynik SEO{% elif overall_score >= 30 %}Wynik SEO wymaga poprawy{% else %}Słaby wynik SEO{% endif %}
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); opacity: 0.9;">
|
||
{% if overall_score >= 90 %}Strona jest bardzo dobrze zoptymalizowana{% elif overall_score >= 70 %}Strona jest dobrze zoptymalizowana{% elif overall_score >= 50 %}Strona wymaga optymalizacji w kilku obszarach{% elif overall_score >= 30 %}Strona wymaga znaczącej optymalizacji{% else %}Strona wymaga pilnej optymalizacji SEO{% endif %}
|
||
</div>
|
||
</div>
|
||
<div style="color: white; opacity: 0.7;">
|
||
<svg width="24" height="24" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M9 18l6-6-6-6"/></svg>
|
||
</div>
|
||
</a>
|
||
{% endif %}
|
||
|
||
<!-- PageSpeed Scores Grid -->
|
||
<div style="display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--spacing-md); margin-bottom: var(--spacing-lg);">
|
||
<!-- SEO Score -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); text-align: center;
|
||
border: 2px solid {% if website_analysis.pagespeed_seo_score and website_analysis.pagespeed_seo_score >= 90 %}#10b981{% elif website_analysis.pagespeed_seo_score and website_analysis.pagespeed_seo_score >= 50 %}#f59e0b{% elif website_analysis.pagespeed_seo_score %}#ef4444{% else %}#e5e7eb{% endif %};">
|
||
<div style="width: 48px; height: 48px; border-radius: 50%; margin: 0 auto var(--spacing-sm);
|
||
background: {% if website_analysis.pagespeed_seo_score and website_analysis.pagespeed_seo_score >= 90 %}#dcfce7{% elif website_analysis.pagespeed_seo_score and website_analysis.pagespeed_seo_score >= 50 %}#fef3c7{% elif website_analysis.pagespeed_seo_score %}#fee2e2{% else %}#f3f4f6{% endif %};
|
||
display: flex; align-items: center; justify-content: center;">
|
||
<svg width="24" height="24" fill="{% if website_analysis.pagespeed_seo_score and website_analysis.pagespeed_seo_score >= 90 %}#166534{% elif website_analysis.pagespeed_seo_score and website_analysis.pagespeed_seo_score >= 50 %}#92400e{% elif website_analysis.pagespeed_seo_score %}#991b1b{% else %}#9ca3af{% endif %}" viewBox="0 0 24 24">
|
||
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="font-size: 28px; font-weight: 700; color: {% if website_analysis.pagespeed_seo_score and website_analysis.pagespeed_seo_score >= 90 %}#166534{% elif website_analysis.pagespeed_seo_score and website_analysis.pagespeed_seo_score >= 50 %}#92400e{% elif website_analysis.pagespeed_seo_score %}#991b1b{% else %}#9ca3af{% endif %};">
|
||
{% if website_analysis.pagespeed_seo_score is not none %}{{ website_analysis.pagespeed_seo_score }}{% else %}-{% endif %}
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); font-weight: 500;">SEO</div>
|
||
</div>
|
||
|
||
<!-- Performance Score -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); text-align: center;
|
||
border: 2px solid {% if website_analysis.pagespeed_performance_score and website_analysis.pagespeed_performance_score >= 90 %}#10b981{% elif website_analysis.pagespeed_performance_score and website_analysis.pagespeed_performance_score >= 50 %}#f59e0b{% elif website_analysis.pagespeed_performance_score %}#ef4444{% else %}#e5e7eb{% endif %};">
|
||
<div style="width: 48px; height: 48px; border-radius: 50%; margin: 0 auto var(--spacing-sm);
|
||
background: {% if website_analysis.pagespeed_performance_score and website_analysis.pagespeed_performance_score >= 90 %}#dcfce7{% elif website_analysis.pagespeed_performance_score and website_analysis.pagespeed_performance_score >= 50 %}#fef3c7{% elif website_analysis.pagespeed_performance_score %}#fee2e2{% else %}#f3f4f6{% endif %};
|
||
display: flex; align-items: center; justify-content: center;">
|
||
<svg width="24" height="24" fill="{% if website_analysis.pagespeed_performance_score and website_analysis.pagespeed_performance_score >= 90 %}#166534{% elif website_analysis.pagespeed_performance_score and website_analysis.pagespeed_performance_score >= 50 %}#92400e{% elif website_analysis.pagespeed_performance_score %}#991b1b{% else %}#9ca3af{% endif %}" viewBox="0 0 24 24">
|
||
<path d="M13 2.05v2.02c3.95.49 7 3.85 7 7.93 0 3.21-1.92 6-4.72 7.28L13 17v5h5l-1.22-1.22C19.91 19.07 22 15.76 22 12c0-5.18-3.95-9.45-9-9.95zM11 2.05C5.94 2.55 2 6.81 2 12c0 3.76 2.09 7.07 5.22 8.78L6 22h5v-5l-2.28 2.28C6.92 18 5 15.21 5 12c0-4.08 3.05-7.44 7-7.93V2.05z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="font-size: 28px; font-weight: 700; color: {% if website_analysis.pagespeed_performance_score and website_analysis.pagespeed_performance_score >= 90 %}#166534{% elif website_analysis.pagespeed_performance_score and website_analysis.pagespeed_performance_score >= 50 %}#92400e{% elif website_analysis.pagespeed_performance_score %}#991b1b{% else %}#9ca3af{% endif %};">
|
||
{% if website_analysis.pagespeed_performance_score is not none %}{{ website_analysis.pagespeed_performance_score }}{% else %}-{% endif %}
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); font-weight: 500;">Wydajność</div>
|
||
</div>
|
||
|
||
<!-- Accessibility Score -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); text-align: center;
|
||
border: 2px solid {% if website_analysis.pagespeed_accessibility_score and website_analysis.pagespeed_accessibility_score >= 90 %}#10b981{% elif website_analysis.pagespeed_accessibility_score and website_analysis.pagespeed_accessibility_score >= 50 %}#f59e0b{% elif website_analysis.pagespeed_accessibility_score %}#ef4444{% else %}#e5e7eb{% endif %};">
|
||
<div style="width: 48px; height: 48px; border-radius: 50%; margin: 0 auto var(--spacing-sm);
|
||
background: {% if website_analysis.pagespeed_accessibility_score and website_analysis.pagespeed_accessibility_score >= 90 %}#dcfce7{% elif website_analysis.pagespeed_accessibility_score and website_analysis.pagespeed_accessibility_score >= 50 %}#fef3c7{% elif website_analysis.pagespeed_accessibility_score %}#fee2e2{% else %}#f3f4f6{% endif %};
|
||
display: flex; align-items: center; justify-content: center;">
|
||
<svg width="24" height="24" fill="{% if website_analysis.pagespeed_accessibility_score and website_analysis.pagespeed_accessibility_score >= 90 %}#166534{% elif website_analysis.pagespeed_accessibility_score and website_analysis.pagespeed_accessibility_score >= 50 %}#92400e{% elif website_analysis.pagespeed_accessibility_score %}#991b1b{% else %}#9ca3af{% endif %}" viewBox="0 0 24 24">
|
||
<path d="M12 2c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm9 7h-6v13h-2v-6h-2v6H9V9H3V7h18v2z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="font-size: 28px; font-weight: 700; color: {% if website_analysis.pagespeed_accessibility_score and website_analysis.pagespeed_accessibility_score >= 90 %}#166534{% elif website_analysis.pagespeed_accessibility_score and website_analysis.pagespeed_accessibility_score >= 50 %}#92400e{% elif website_analysis.pagespeed_accessibility_score %}#991b1b{% else %}#9ca3af{% endif %};">
|
||
{% if website_analysis.pagespeed_accessibility_score is not none %}{{ website_analysis.pagespeed_accessibility_score }}{% else %}-{% endif %}
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); font-weight: 500;">Dostępność</div>
|
||
</div>
|
||
|
||
<!-- Best Practices Score -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); text-align: center;
|
||
border: 2px solid {% if website_analysis.pagespeed_best_practices_score and website_analysis.pagespeed_best_practices_score >= 90 %}#10b981{% elif website_analysis.pagespeed_best_practices_score and website_analysis.pagespeed_best_practices_score >= 50 %}#f59e0b{% elif website_analysis.pagespeed_best_practices_score %}#ef4444{% else %}#e5e7eb{% endif %};">
|
||
<div style="width: 48px; height: 48px; border-radius: 50%; margin: 0 auto var(--spacing-sm);
|
||
background: {% if website_analysis.pagespeed_best_practices_score and website_analysis.pagespeed_best_practices_score >= 90 %}#dcfce7{% elif website_analysis.pagespeed_best_practices_score and website_analysis.pagespeed_best_practices_score >= 50 %}#fef3c7{% elif website_analysis.pagespeed_best_practices_score %}#fee2e2{% else %}#f3f4f6{% endif %};
|
||
display: flex; align-items: center; justify-content: center;">
|
||
<svg width="24" height="24" fill="{% if website_analysis.pagespeed_best_practices_score and website_analysis.pagespeed_best_practices_score >= 90 %}#166534{% elif website_analysis.pagespeed_best_practices_score and website_analysis.pagespeed_best_practices_score >= 50 %}#92400e{% elif website_analysis.pagespeed_best_practices_score %}#991b1b{% else %}#9ca3af{% endif %}" viewBox="0 0 24 24">
|
||
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="font-size: 28px; font-weight: 700; color: {% if website_analysis.pagespeed_best_practices_score and website_analysis.pagespeed_best_practices_score >= 90 %}#166534{% elif website_analysis.pagespeed_best_practices_score and website_analysis.pagespeed_best_practices_score >= 50 %}#92400e{% elif website_analysis.pagespeed_best_practices_score %}#991b1b{% else %}#9ca3af{% endif %};">
|
||
{% if website_analysis.pagespeed_best_practices_score is not none %}{{ website_analysis.pagespeed_best_practices_score }}{% else %}-{% endif %}
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); font-weight: 500;">Best Practices</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- On-Page SEO & Technical Details -->
|
||
<div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--spacing-lg);">
|
||
<!-- On-Page SEO Card -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 1px solid var(--border);">
|
||
<h3 style="font-size: var(--font-size-base); font-weight: 600; color: var(--text-primary); margin-bottom: var(--spacing-md); display: flex; align-items: center; gap: var(--spacing-sm);">
|
||
<svg width="20" height="20" fill="var(--primary)" viewBox="0 0 24 24">
|
||
<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-5 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"/>
|
||
</svg>
|
||
SEO On-Page
|
||
</h3>
|
||
|
||
<div style="display: grid; gap: var(--spacing-sm);">
|
||
<!-- Meta Title -->
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Meta Title</span>
|
||
{% if website_analysis.meta_title %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">OK</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #fee2e2; color: #991b1b; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Brak</span>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<!-- Meta Description -->
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Meta Description</span>
|
||
{% if website_analysis.meta_description %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">OK</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #fee2e2; color: #991b1b; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Brak</span>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<!-- H1 Count -->
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Nagłówki H1</span>
|
||
{% if website_analysis.h1_count is not none %}
|
||
<span style="padding: 2px 8px; background: {% if website_analysis.h1_count == 1 %}#dcfce7; color: #166534{% elif website_analysis.h1_count == 0 %}#fee2e2; color: #991b1b{% else %}#fef3c7; color: #92400e{% endif %}; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">
|
||
{{ website_analysis.h1_count }}{% if website_analysis.h1_count == 1 %} (OK){% elif website_analysis.h1_count == 0 %} (Brak){% else %} (Za dużo){% endif %}
|
||
</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #f3f4f6; color: #9ca3af; border-radius: var(--radius-sm); font-size: 12px;">-</span>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<!-- Images without Alt -->
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Obrazy bez Alt</span>
|
||
{% if website_analysis.images_without_alt is not none %}
|
||
<span style="padding: 2px 8px; background: {% if website_analysis.images_without_alt == 0 %}#dcfce7; color: #166534{% elif website_analysis.images_without_alt <= 3 %}#fef3c7; color: #92400e{% else %}#fee2e2; color: #991b1b{% endif %}; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">
|
||
{{ website_analysis.images_without_alt }}{% if website_analysis.images_without_alt == 0 %} (OK){% endif %}
|
||
</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #f3f4f6; color: #9ca3af; border-radius: var(--radius-sm); font-size: 12px;">-</span>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<!-- Internal Links -->
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Linki wewnętrzne</span>
|
||
{% if website_analysis.internal_links_count is not none %}
|
||
<span style="padding: 2px 8px; background: #dbeafe; color: #1e40af; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">{{ website_analysis.internal_links_count }}</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #f3f4f6; color: #9ca3af; border-radius: var(--radius-sm); font-size: 12px;">-</span>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<!-- External Links -->
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Linki zewnętrzne</span>
|
||
{% if website_analysis.external_links_count is not none %}
|
||
<span style="padding: 2px 8px; background: #e0e7ff; color: #3730a3; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">{{ website_analysis.external_links_count }}</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #f3f4f6; color: #9ca3af; border-radius: var(--radius-sm); font-size: 12px;">-</span>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Technical SEO Card -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 1px solid var(--border);">
|
||
<h3 style="font-size: var(--font-size-base); font-weight: 600; color: var(--text-primary); margin-bottom: var(--spacing-md); display: flex; align-items: center; gap: var(--spacing-sm);">
|
||
<svg width="20" height="20" fill="var(--primary)" viewBox="0 0 24 24">
|
||
<path d="M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"/>
|
||
</svg>
|
||
SEO Techniczny
|
||
</h3>
|
||
|
||
<div style="display: grid; gap: var(--spacing-sm);">
|
||
<!-- Canonical URL -->
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Canonical URL</span>
|
||
{% if website_analysis.has_canonical %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">OK</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #fef3c7; color: #92400e; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Brak</span>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<!-- Indexable -->
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Indeksowanie</span>
|
||
{% if website_analysis.is_indexable or website_analysis.is_indexable is none %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Dozwolone</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #fee2e2; color: #991b1b; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Zablokowane</span>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<!-- Structured Data -->
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Dane strukturalne</span>
|
||
{% if website_analysis.has_structured_data %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">OK</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #fef3c7; color: #92400e; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Brak</span>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<!-- Open Graph -->
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Open Graph</span>
|
||
{% if website_analysis.has_og_tags %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">OK</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #fef3c7; color: #92400e; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Brak</span>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<!-- Viewport -->
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Viewport (mobile)</span>
|
||
{% if website_analysis.viewport_configured %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">OK</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #fee2e2; color: #991b1b; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Brak</span>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<!-- HTML Lang -->
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Język strony</span>
|
||
{% if website_analysis.html_lang %}
|
||
<span style="padding: 2px 8px; background: #dbeafe; color: #1e40af; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">{{ website_analysis.html_lang }}</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #fef3c7; color: #92400e; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Brak</span>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Core Web Vitals (if available) -->
|
||
{% if website_analysis.largest_contentful_paint_ms or website_analysis.cumulative_layout_shift is not none %}
|
||
<div style="margin-top: var(--spacing-lg); padding-top: var(--spacing-lg); border-top: 1px solid var(--border);">
|
||
<h3 style="font-size: var(--font-size-base); font-weight: 600; color: var(--text-primary); margin-bottom: var(--spacing-md); display: flex; align-items: center; gap: var(--spacing-sm);">
|
||
<svg width="20" height="20" fill="var(--primary)" viewBox="0 0 24 24">
|
||
<path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"/>
|
||
</svg>
|
||
Core Web Vitals
|
||
</h3>
|
||
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--spacing-md);">
|
||
<!-- LCP -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-md); text-align: center;
|
||
border: 2px solid {% if website_analysis.largest_contentful_paint_ms and website_analysis.largest_contentful_paint_ms <= 2500 %}#10b981{% elif website_analysis.largest_contentful_paint_ms and website_analysis.largest_contentful_paint_ms <= 4000 %}#f59e0b{% elif website_analysis.largest_contentful_paint_ms %}#ef4444{% else %}#e5e7eb{% endif %};">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); margin-bottom: var(--spacing-xs);">LCP</div>
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: {% if website_analysis.largest_contentful_paint_ms and website_analysis.largest_contentful_paint_ms <= 2500 %}#166534{% elif website_analysis.largest_contentful_paint_ms and website_analysis.largest_contentful_paint_ms <= 4000 %}#92400e{% elif website_analysis.largest_contentful_paint_ms %}#991b1b{% else %}#9ca3af{% endif %};">
|
||
{% if website_analysis.largest_contentful_paint_ms is not none %}{{ (website_analysis.largest_contentful_paint_ms / 1000)|round(1) }}s{% else %}-{% endif %}
|
||
</div>
|
||
<div style="font-size: 11px; color: var(--text-secondary);">Largest Contentful Paint</div>
|
||
</div>
|
||
|
||
<!-- INP (zastąpił FID w marcu 2024) -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-md); text-align: center;
|
||
border: 2px solid {% if website_analysis.first_input_delay_ms and website_analysis.first_input_delay_ms <= 200 %}#10b981{% elif website_analysis.first_input_delay_ms and website_analysis.first_input_delay_ms <= 500 %}#f59e0b{% elif website_analysis.first_input_delay_ms %}#ef4444{% else %}#e5e7eb{% endif %};">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); margin-bottom: var(--spacing-xs);">INP</div>
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: {% if website_analysis.first_input_delay_ms and website_analysis.first_input_delay_ms <= 200 %}#166534{% elif website_analysis.first_input_delay_ms and website_analysis.first_input_delay_ms <= 500 %}#92400e{% elif website_analysis.first_input_delay_ms %}#991b1b{% else %}#9ca3af{% endif %};">
|
||
{% if website_analysis.first_input_delay_ms is not none %}{{ website_analysis.first_input_delay_ms }}ms{% else %}-{% endif %}
|
||
</div>
|
||
<div style="font-size: 11px; color: var(--text-secondary);">Interaction to Next Paint</div>
|
||
</div>
|
||
|
||
<!-- CLS -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-md); text-align: center;
|
||
border: 2px solid {% if website_analysis.cumulative_layout_shift is not none and website_analysis.cumulative_layout_shift <= 0.1 %}#10b981{% elif website_analysis.cumulative_layout_shift is not none and website_analysis.cumulative_layout_shift <= 0.25 %}#f59e0b{% elif website_analysis.cumulative_layout_shift is not none %}#ef4444{% else %}#e5e7eb{% endif %};">
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); margin-bottom: var(--spacing-xs);">CLS</div>
|
||
<div style="font-size: var(--font-size-xl); font-weight: 700; color: {% if website_analysis.cumulative_layout_shift is not none and website_analysis.cumulative_layout_shift <= 0.1 %}#166534{% elif website_analysis.cumulative_layout_shift is not none and website_analysis.cumulative_layout_shift <= 0.25 %}#92400e{% elif website_analysis.cumulative_layout_shift is not none %}#991b1b{% else %}#9ca3af{% endif %};">
|
||
{% if website_analysis.cumulative_layout_shift is not none %}{{ website_analysis.cumulative_layout_shift|round(3) }}{% else %}-{% endif %}
|
||
</div>
|
||
<div style="font-size: 11px; color: var(--text-secondary);">Cumulative Layout Shift</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Structured Data Types (if available) -->
|
||
{% if website_analysis.structured_data_types and website_analysis.structured_data_types|length > 0 %}
|
||
<div style="margin-top: var(--spacing-lg); padding-top: var(--spacing-lg); border-top: 1px solid var(--border);">
|
||
<h3 style="font-size: var(--font-size-base); font-weight: 600; color: var(--text-primary); margin-bottom: var(--spacing-md);">
|
||
Wykryte dane strukturalne (Schema.org)
|
||
</h3>
|
||
<div style="display: flex; flex-wrap: wrap; gap: var(--spacing-sm);">
|
||
{% for schema_type in website_analysis.structured_data_types %}
|
||
<span style="padding: 6px 12px; background: #e0e7ff; color: #3730a3; border-radius: 20px; font-size: var(--font-size-sm); font-weight: 500;">
|
||
{{ schema_type }}
|
||
</span>
|
||
{% endfor %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Score Legend -->
|
||
<div style="margin-top: var(--spacing-lg); padding: var(--spacing-md); background: #f8fafc; border-radius: var(--radius); font-size: var(--font-size-sm); color: var(--text-secondary);">
|
||
<strong>Legenda:</strong>
|
||
<span style="display: inline-flex; align-items: center; gap: 4px; margin-left: var(--spacing-md);">
|
||
<span style="width: 12px; height: 12px; background: #dcfce7; border: 1px solid #166534; border-radius: 2px;"></span>
|
||
90-100 (dobry)
|
||
</span>
|
||
<span style="display: inline-flex; align-items: center; gap: 4px; margin-left: var(--spacing-md);">
|
||
<span style="width: 12px; height: 12px; background: #fef3c7; border: 1px solid #92400e; border-radius: 2px;"></span>
|
||
50-89 (średni)
|
||
</span>
|
||
<span style="display: inline-flex; align-items: center; gap: 4px; margin-left: var(--spacing-md);">
|
||
<span style="width: 12px; height: 12px; background: #fee2e2; border: 1px solid #991b1b; border-radius: 2px;"></span>
|
||
0-49 (słaby)
|
||
</span>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- GBP Audit Section - Only show if GBP audit was performed -->
|
||
{% set _gbp_hidden = company.is_section_hidden('gbp_audit') %}
|
||
{% if gbp_audit and gbp_audit.completeness_score is not none and is_audit_owner and (not _gbp_hidden or can_edit_profile or is_admin) %}
|
||
<div class="company-section {% if _gbp_hidden %}section-hidden{% endif %}" id="gbp-audit">
|
||
{% if _gbp_hidden %}
|
||
<div class="hidden-section-badge"><i class="fas fa-eye-slash"></i> Ukryta — niewidoczna dla odwiedzających</div>
|
||
{% endif %}
|
||
<h2 class="section-title">
|
||
Audyt Google Business Profile
|
||
<span style="font-size: var(--font-size-sm); font-weight: normal; color: var(--text-secondary); margin-left: var(--spacing-sm);">
|
||
({{ gbp_audit.audit_date|local_time('%d.%m.%Y') }})
|
||
</span>
|
||
</h2>
|
||
|
||
<!-- GBP Score Banner - Clickable link to detailed audit -->
|
||
{# Unified 5-level color scale: 0-29 red, 30-49 orange, 50-69 amber, 70-89 lime, 90-100 green #}
|
||
<a href="{{ url_for('gbp_audit_dashboard', slug=company.slug) }}" style="text-decoration: none; display: block; margin-bottom: var(--spacing-lg); padding: var(--spacing-lg); border-radius: var(--radius-lg); display: flex; align-items: center; gap: var(--spacing-lg); cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
|
||
background: linear-gradient(135deg, {% if gbp_audit.completeness_score >= 90 %}#10b981, #059669{% elif gbp_audit.completeness_score >= 70 %}#84cc16, #65a30d{% elif gbp_audit.completeness_score >= 50 %}#f59e0b, #d97706{% elif gbp_audit.completeness_score >= 30 %}#f97316, #ea580c{% else %}#ef4444, #dc2626{% endif %});"
|
||
onmouseover="this.style.transform='translateY(-2px)'; this.style.boxShadow='0 8px 25px rgba(0,0,0,0.15)';"
|
||
onmouseout="this.style.transform='translateY(0)'; this.style.boxShadow='none';">
|
||
<div style="width: 80px; height: 80px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; flex-shrink: 0;">
|
||
<span style="font-size: 32px; font-weight: 700; color: white;">{{ gbp_audit.completeness_score }}</span>
|
||
</div>
|
||
<div style="flex: 1; color: white;">
|
||
<div style="font-size: var(--font-size-xl); font-weight: 600; margin-bottom: 4px;">
|
||
{% if gbp_audit.completeness_score >= 90 %}Doskonały profil GBP{% elif gbp_audit.completeness_score >= 70 %}Dobry profil GBP{% elif gbp_audit.completeness_score >= 50 %}Przeciętny profil GBP{% elif gbp_audit.completeness_score >= 30 %}Profil GBP wymaga uzupełnienia{% else %}Słaby profil GBP{% endif %}
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); opacity: 0.9;">
|
||
{% if gbp_audit.completeness_score >= 90 %}Profil Google Business jest kompletny i dobrze zoptymalizowany{% elif gbp_audit.completeness_score >= 70 %}Profil jest dobrze uzupełniony{% elif gbp_audit.completeness_score >= 50 %}Profil wymaga uzupełnienia kilku informacji{% elif gbp_audit.completeness_score >= 30 %}Profil wymaga znaczącego uzupełnienia{% else %}Profil wymaga pilnego uzupełnienia{% endif %}
|
||
</div>
|
||
</div>
|
||
<div style="color: white; opacity: 0.7;">
|
||
<svg width="24" height="24" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M9 18l6-6-6-6"/></svg>
|
||
</div>
|
||
</a>
|
||
|
||
<!-- GBP Stats Grid -->
|
||
<div style="display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--spacing-md); margin-bottom: var(--spacing-lg);">
|
||
<!-- Reviews -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); text-align: center; border: 2px solid #e5e7eb;">
|
||
<div style="width: 48px; height: 48px; border-radius: 50%; margin: 0 auto var(--spacing-sm); background: #fef3c7; display: flex; align-items: center; justify-content: center;">
|
||
<svg width="24" height="24" fill="#92400e" viewBox="0 0 24 24">
|
||
<path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="font-size: 28px; font-weight: 700; color: #92400e;">
|
||
{% if gbp_audit.review_count is not none %}{{ gbp_audit.review_count }}{% else %}-{% endif %}
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); font-weight: 500;">Opinii</div>
|
||
</div>
|
||
|
||
<!-- Rating -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); text-align: center;
|
||
border: 2px solid {% if gbp_audit.average_rating and gbp_audit.average_rating|float >= 4.5 %}#10b981{% elif gbp_audit.average_rating and gbp_audit.average_rating|float >= 3.5 %}#f59e0b{% elif gbp_audit.average_rating %}#ef4444{% else %}#e5e7eb{% endif %};">
|
||
<div style="width: 48px; height: 48px; border-radius: 50%; margin: 0 auto var(--spacing-sm);
|
||
background: {% if gbp_audit.average_rating and gbp_audit.average_rating|float >= 4.5 %}#dcfce7{% elif gbp_audit.average_rating and gbp_audit.average_rating|float >= 3.5 %}#fef3c7{% elif gbp_audit.average_rating %}#fee2e2{% else %}#f3f4f6{% endif %};
|
||
display: flex; align-items: center; justify-content: center;">
|
||
<svg width="24" height="24" fill="{% if gbp_audit.average_rating and gbp_audit.average_rating|float >= 4.5 %}#166534{% elif gbp_audit.average_rating and gbp_audit.average_rating|float >= 3.5 %}#92400e{% elif gbp_audit.average_rating %}#991b1b{% else %}#9ca3af{% endif %}" viewBox="0 0 24 24">
|
||
<path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="font-size: 28px; font-weight: 700; color: {% if gbp_audit.average_rating and gbp_audit.average_rating|float >= 4.5 %}#166534{% elif gbp_audit.average_rating and gbp_audit.average_rating|float >= 3.5 %}#92400e{% elif gbp_audit.average_rating %}#991b1b{% else %}#9ca3af{% endif %};">
|
||
{% if gbp_audit.average_rating is not none %}{{ gbp_audit.average_rating|round(1) }}{% else %}-{% endif %}
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); font-weight: 500;">Średnia ocen</div>
|
||
</div>
|
||
|
||
<!-- Photos -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); text-align: center; border: 2px solid #e5e7eb;">
|
||
<div style="width: 48px; height: 48px; border-radius: 50%; margin: 0 auto var(--spacing-sm); background: #dbeafe; display: flex; align-items: center; justify-content: center;">
|
||
<svg width="24" height="24" fill="#1e40af" viewBox="0 0 24 24">
|
||
<path d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="font-size: 28px; font-weight: 700; color: #1e40af;">
|
||
{% if gbp_audit.photo_count is not none %}{{ gbp_audit.photo_count }}{% else %}-{% endif %}
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); font-weight: 500;">Zdjęć</div>
|
||
</div>
|
||
|
||
<!-- Completeness -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); text-align: center;
|
||
border: 2px solid {% if gbp_audit.completeness_score >= 90 %}#10b981{% elif gbp_audit.completeness_score >= 50 %}#f59e0b{% else %}#ef4444{% endif %};">
|
||
<div style="width: 48px; height: 48px; border-radius: 50%; margin: 0 auto var(--spacing-sm);
|
||
background: {% if gbp_audit.completeness_score >= 90 %}#dcfce7{% elif gbp_audit.completeness_score >= 50 %}#fef3c7{% else %}#fee2e2{% endif %};
|
||
display: flex; align-items: center; justify-content: center;">
|
||
<svg width="24" height="24" fill="{% if gbp_audit.completeness_score >= 90 %}#166534{% elif gbp_audit.completeness_score >= 50 %}#92400e{% else %}#991b1b{% endif %}" viewBox="0 0 24 24">
|
||
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="font-size: 28px; font-weight: 700; color: {% if gbp_audit.completeness_score >= 90 %}#166534{% elif gbp_audit.completeness_score >= 50 %}#92400e{% else %}#991b1b{% endif %};">
|
||
{{ gbp_audit.completeness_score }}%
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); font-weight: 500;">Kompletność</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Profile Checklist -->
|
||
<div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--spacing-lg);">
|
||
<!-- Basic Info -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 1px solid var(--border);">
|
||
<h3 style="font-size: var(--font-size-base); font-weight: 600; color: var(--text-primary); margin-bottom: var(--spacing-md); display: flex; align-items: center; gap: var(--spacing-sm);">
|
||
<svg width="20" height="20" fill="var(--primary)" viewBox="0 0 24 24">
|
||
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/>
|
||
</svg>
|
||
Informacje podstawowe
|
||
</h3>
|
||
<div style="display: grid; gap: var(--spacing-sm);">
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Nazwa firmy</span>
|
||
{% if gbp_audit.has_name %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">OK</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #fee2e2; color: #991b1b; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Brak</span>
|
||
{% endif %}
|
||
</div>
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Adres</span>
|
||
{% if gbp_audit.has_address %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">OK</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #fee2e2; color: #991b1b; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Brak</span>
|
||
{% endif %}
|
||
</div>
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Telefon</span>
|
||
{% if gbp_audit.has_phone %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">OK</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #fee2e2; color: #991b1b; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Brak</span>
|
||
{% endif %}
|
||
</div>
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Strona www</span>
|
||
{% if gbp_audit.has_website %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">OK</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #fee2e2; color: #991b1b; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Brak</span>
|
||
{% endif %}
|
||
</div>
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Godziny otwarcia</span>
|
||
{% if gbp_audit.has_hours %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">OK</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #fee2e2; color: #991b1b; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Brak</span>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Content & Engagement -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 1px solid var(--border);">
|
||
<h3 style="font-size: var(--font-size-base); font-weight: 600; color: var(--text-primary); margin-bottom: var(--spacing-md); display: flex; align-items: center; gap: var(--spacing-sm);">
|
||
<svg width="20" height="20" fill="var(--primary)" viewBox="0 0 24 24">
|
||
<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-5 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"/>
|
||
</svg>
|
||
Treści i zaangażowanie
|
||
</h3>
|
||
<div style="display: grid; gap: var(--spacing-sm);">
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Opis firmy</span>
|
||
{% if gbp_audit.has_description %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">OK</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #fee2e2; color: #991b1b; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Brak</span>
|
||
{% endif %}
|
||
</div>
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Kategorie</span>
|
||
{% if gbp_audit.has_categories %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">OK</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #fee2e2; color: #991b1b; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Brak</span>
|
||
{% endif %}
|
||
</div>
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Usługi/produkty</span>
|
||
{% if gbp_audit.has_services %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">OK</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #fef3c7; color: #92400e; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Brak</span>
|
||
{% endif %}
|
||
</div>
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Zdjęcia</span>
|
||
{% if gbp_audit.has_photos %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">{{ gbp_audit.photo_count or 'OK' }}</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #fee2e2; color: #991b1b; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Brak</span>
|
||
{% endif %}
|
||
</div>
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Opinie klientów</span>
|
||
{% if gbp_audit.has_reviews %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">{{ gbp_audit.review_count }}</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #fef3c7; color: #92400e; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Brak</span>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
{% if gbp_audit.google_maps_url %}
|
||
<div style="margin-top: var(--spacing-lg); text-align: center;">
|
||
<a href="{{ gbp_audit.google_maps_url }}" target="_blank" rel="noopener" style="display: inline-flex; align-items: center; gap: var(--spacing-sm); padding: var(--spacing-sm) var(--spacing-lg); background: var(--primary); color: white; text-decoration: none; border-radius: var(--radius); font-weight: 500;">
|
||
<svg width="18" height="18" fill="currentColor" viewBox="0 0 24 24">
|
||
<path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/>
|
||
</svg>
|
||
Zobacz w Google Maps
|
||
</a>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Social Media Audit Section -->
|
||
{% set _social_audit_hidden = company.is_section_hidden('social_audit') %}
|
||
{% if social_media and social_media|length > 0 and is_audit_owner and (not _social_audit_hidden or can_edit_profile or is_admin) %}
|
||
<div class="company-section {% if _social_audit_hidden %}section-hidden{% endif %}" id="social-media-audit">
|
||
{% if _social_audit_hidden %}
|
||
<div class="hidden-section-badge"><i class="fas fa-eye-slash"></i> Ukryta — niewidoczna dla odwiedzających</div>
|
||
{% endif %}
|
||
<h2 class="section-title">
|
||
Audyt Social Media
|
||
</h2>
|
||
|
||
<!-- Social Media Summary Banner - Clickable link to detailed audit -->
|
||
{% set active_platforms = social_media|selectattr('is_valid', 'equalto', true)|list|length %}
|
||
{% set total_platforms = 6 %}
|
||
{% set social_score = ((active_platforms / total_platforms) * 100)|int %}
|
||
{% set total_followers = social_media|selectattr('followers_count')|sum(attribute='followers_count') %}
|
||
{# Unified 5-level color scale: 0-29 red, 30-49 orange, 50-69 amber, 70-89 lime, 90-100 green #}
|
||
<a href="{{ url_for('social_audit_dashboard', slug=company.slug) }}" style="text-decoration: none; display: block; margin-bottom: var(--spacing-lg); padding: var(--spacing-lg); border-radius: var(--radius-lg); display: flex; align-items: center; gap: var(--spacing-lg); cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
|
||
background: linear-gradient(135deg, {% if social_score >= 90 %}#10b981, #059669{% elif social_score >= 70 %}#84cc16, #65a30d{% elif social_score >= 50 %}#f59e0b, #d97706{% elif social_score >= 30 %}#f97316, #ea580c{% else %}#ef4444, #dc2626{% endif %});"
|
||
onmouseover="this.style.transform='translateY(-2px)'; this.style.boxShadow='0 8px 25px rgba(0,0,0,0.15)';"
|
||
onmouseout="this.style.transform='translateY(0)'; this.style.boxShadow='none';">
|
||
<div style="width: 80px; height: 80px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; flex-shrink: 0;">
|
||
<span style="font-size: 32px; font-weight: 700; color: white;">{{ social_score }}</span>
|
||
</div>
|
||
<div style="flex: 1; color: white;">
|
||
<div style="font-size: var(--font-size-xl); font-weight: 600; margin-bottom: 4px;">
|
||
{% if social_score >= 90 %}Doskonała obecność w Social Media{% elif social_score >= 70 %}Dobra obecność w Social Media{% elif social_score >= 50 %}Przeciętna obecność w Social Media{% elif social_score >= 30 %}Obecność wymaga rozbudowy{% else %}Słaba obecność w Social Media{% endif %}
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); opacity: 0.9;">
|
||
{{ active_platforms }}/{{ total_platforms }} platform · {{ social_score }}%
|
||
{% if total_followers > 0 %} · {{ "{:,}".format(total_followers|int).replace(",", " ") }} obserwujących{% endif %}
|
||
</div>
|
||
</div>
|
||
<div style="color: white; opacity: 0.7;">
|
||
<svg width="24" height="24" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M9 18l6-6-6-6"/></svg>
|
||
</div>
|
||
</a>
|
||
|
||
<!-- Social Media Platforms Grid -->
|
||
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--spacing-md);">
|
||
{% set platform_icons = {
|
||
'facebook': {'icon': '<path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/>', 'color': '#1877F2'},
|
||
'instagram': {'icon': '<path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"/>', 'color': '#E4405F'},
|
||
'linkedin': {'icon': '<path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/>', 'color': '#0A66C2'},
|
||
'youtube': {'icon': '<path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/>', 'color': '#FF0000'},
|
||
'twitter': {'icon': '<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>', 'color': '#000000'},
|
||
'tiktok': {'icon': '<path d="M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"/>', 'color': '#000000'}
|
||
} %}
|
||
|
||
{% for sm in social_media %}
|
||
<a href="{{ sm.url }}" target="_blank" rel="noopener" style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); text-align: center; border: 1px solid var(--border); text-decoration: none; color: inherit; transition: var(--transition);">
|
||
<div style="width: 48px; height: 48px; border-radius: 50%; margin: 0 auto var(--spacing-sm); background: {{ platform_icons[sm.platform]['color'] if sm.platform in platform_icons else 'var(--primary)' }}20; display: flex; align-items: center; justify-content: center;">
|
||
<svg width="24" height="24" fill="{{ platform_icons[sm.platform]['color'] if sm.platform in platform_icons else 'var(--primary)' }}" viewBox="0 0 24 24">
|
||
{{ platform_icons[sm.platform]['icon']|safe if sm.platform in platform_icons else '<circle cx="12" cy="12" r="10"/>' }}
|
||
</svg>
|
||
</div>
|
||
<div style="font-size: var(--font-size-base); font-weight: 600; color: var(--text-primary); margin-bottom: 2px; text-transform: capitalize;">{{ sm.platform }}</div>
|
||
{% if sm.followers_count %}
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary);">{{ "{:,}".format(sm.followers_count|int).replace(",", " ") }} obserwujących</div>
|
||
{% elif sm.page_name %}
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary);">{{ sm.page_name|truncate(20) }}</div>
|
||
{% else %}
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-muted);">Aktywny profil</div>
|
||
{% endif %}
|
||
{% if sm.check_status == 'needs_verification' %}
|
||
<span style="display: inline-block; margin-top: var(--spacing-xs); padding: 2px 8px; background: #fef3c7; color: #92400e; border-radius: var(--radius-sm); font-size: 11px; font-weight: 500;">Do weryfikacji</span>
|
||
{% elif sm.is_valid %}
|
||
<span style="display: inline-block; margin-top: var(--spacing-xs); padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 11px; font-weight: 500;">Zweryfikowany</span>
|
||
{% endif %}
|
||
</a>
|
||
{% endfor %}
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- IT Audit Section - Only show if IT audit was performed -->
|
||
{% set _it_hidden = company.is_section_hidden('it_audit') %}
|
||
{% if it_audit and it_audit.overall_score is not none and is_audit_owner and (not _it_hidden or can_edit_profile or is_admin) %}
|
||
<div class="company-section {% if _it_hidden %}section-hidden{% endif %}" id="it-audit">
|
||
{% if _it_hidden %}
|
||
<div class="hidden-section-badge"><i class="fas fa-eye-slash"></i> Ukryta — niewidoczna dla odwiedzających</div>
|
||
{% endif %}
|
||
<h2 class="section-title">
|
||
Audyt IT
|
||
<span style="font-size: var(--font-size-sm); font-weight: normal; color: var(--text-secondary); margin-left: var(--spacing-sm);">
|
||
({{ it_audit.audit_date|local_time('%d.%m.%Y') }})
|
||
</span>
|
||
</h2>
|
||
|
||
<!-- IT Score Banner - Clickable link to detailed audit -->
|
||
{# Unified 5-level color scale: 0-29 red, 30-49 orange, 50-69 amber, 70-89 lime, 90-100 green #}
|
||
<a href="{{ url_for('it_audit_dashboard', slug=company.slug) }}" style="text-decoration: none; display: block; margin-bottom: var(--spacing-lg); padding: var(--spacing-lg); border-radius: var(--radius-lg); display: flex; align-items: center; gap: var(--spacing-lg); cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
|
||
background: linear-gradient(135deg, {% if it_audit.overall_score >= 90 %}#10b981, #059669{% elif it_audit.overall_score >= 70 %}#84cc16, #65a30d{% elif it_audit.overall_score >= 50 %}#f59e0b, #d97706{% elif it_audit.overall_score >= 30 %}#f97316, #ea580c{% else %}#ef4444, #dc2626{% endif %});"
|
||
onmouseover="this.style.transform='translateY(-2px)'; this.style.boxShadow='0 8px 25px rgba(0,0,0,0.15)';"
|
||
onmouseout="this.style.transform='translateY(0)'; this.style.boxShadow='none';">
|
||
<div style="width: 80px; height: 80px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; flex-shrink: 0;">
|
||
<span style="font-size: 32px; font-weight: 700; color: white;">{{ it_audit.overall_score }}</span>
|
||
</div>
|
||
<div style="flex: 1; color: white;">
|
||
<div style="font-size: var(--font-size-xl); font-weight: 600; margin-bottom: 4px;">
|
||
{% if it_audit.overall_score >= 90 %}Doskonała infrastruktura IT{% elif it_audit.overall_score >= 70 %}Dobra infrastruktura IT{% elif it_audit.overall_score >= 50 %}Przeciętna infrastruktura IT{% elif it_audit.overall_score >= 30 %}Infrastruktura IT wymaga rozwoju{% else %}Słaba infrastruktura IT{% endif %}
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); opacity: 0.9;">
|
||
{% if it_audit.overall_score >= 90 %}Nowoczesna i dobrze zabezpieczona infrastruktura{% elif it_audit.overall_score >= 70 %}Infrastruktura na dobrym poziomie{% elif it_audit.overall_score >= 50 %}Infrastruktura wymaga modernizacji{% elif it_audit.overall_score >= 30 %}Infrastruktura wymaga znaczącej rozbudowy{% else %}Infrastruktura wymaga pilnej modernizacji{% endif %}
|
||
</div>
|
||
</div>
|
||
<div style="color: white; opacity: 0.7;">
|
||
<svg width="24" height="24" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M9 18l6-6-6-6"/></svg>
|
||
</div>
|
||
</a>
|
||
|
||
<!-- IT Scores Grid -->
|
||
<div style="display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--spacing-md); margin-bottom: var(--spacing-lg);">
|
||
<!-- Overall Score -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); text-align: center;
|
||
border: 2px solid {% if it_audit.overall_score >= 90 %}#10b981{% elif it_audit.overall_score >= 50 %}#6366f1{% else %}#f59e0b{% endif %};">
|
||
<div style="width: 48px; height: 48px; border-radius: 50%; margin: 0 auto var(--spacing-sm);
|
||
background: {% if it_audit.overall_score >= 90 %}#dcfce7{% elif it_audit.overall_score >= 50 %}#e0e7ff{% else %}#fef3c7{% endif %};
|
||
display: flex; align-items: center; justify-content: center;">
|
||
<svg width="24" height="24" fill="{% if it_audit.overall_score >= 90 %}#166534{% elif it_audit.overall_score >= 50 %}#4338ca{% else %}#92400e{% endif %}" viewBox="0 0 24 24">
|
||
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="font-size: 28px; font-weight: 700; color: {% if it_audit.overall_score >= 90 %}#166534{% elif it_audit.overall_score >= 50 %}#4338ca{% else %}#92400e{% endif %};">
|
||
{{ it_audit.overall_score }}
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); font-weight: 500;">Ogólny wynik</div>
|
||
</div>
|
||
|
||
<!-- Security Score -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); text-align: center;
|
||
border: 2px solid {% if it_audit.security_score and it_audit.security_score >= 90 %}#10b981{% elif it_audit.security_score and it_audit.security_score >= 50 %}#f59e0b{% elif it_audit.security_score %}#ef4444{% else %}#e5e7eb{% endif %};">
|
||
<div style="width: 48px; height: 48px; border-radius: 50%; margin: 0 auto var(--spacing-sm);
|
||
background: {% if it_audit.security_score and it_audit.security_score >= 90 %}#dcfce7{% elif it_audit.security_score and it_audit.security_score >= 50 %}#fef3c7{% elif it_audit.security_score %}#fee2e2{% else %}#f3f4f6{% endif %};
|
||
display: flex; align-items: center; justify-content: center;">
|
||
<svg width="24" height="24" fill="{% if it_audit.security_score and it_audit.security_score >= 90 %}#166534{% elif it_audit.security_score and it_audit.security_score >= 50 %}#92400e{% elif it_audit.security_score %}#991b1b{% else %}#9ca3af{% endif %}" viewBox="0 0 24 24">
|
||
<path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11v8.8z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="font-size: 28px; font-weight: 700; color: {% if it_audit.security_score and it_audit.security_score >= 90 %}#166534{% elif it_audit.security_score and it_audit.security_score >= 50 %}#92400e{% elif it_audit.security_score %}#991b1b{% else %}#9ca3af{% endif %};">
|
||
{% if it_audit.security_score is not none %}{{ it_audit.security_score }}{% else %}-{% endif %}
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); font-weight: 500;">Bezpieczeństwo</div>
|
||
</div>
|
||
|
||
<!-- Collaboration Score -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); text-align: center;
|
||
border: 2px solid {% if it_audit.collaboration_score and it_audit.collaboration_score >= 90 %}#10b981{% elif it_audit.collaboration_score and it_audit.collaboration_score >= 50 %}#3b82f6{% elif it_audit.collaboration_score %}#f59e0b{% else %}#e5e7eb{% endif %};">
|
||
<div style="width: 48px; height: 48px; border-radius: 50%; margin: 0 auto var(--spacing-sm);
|
||
background: {% if it_audit.collaboration_score and it_audit.collaboration_score >= 90 %}#dcfce7{% elif it_audit.collaboration_score and it_audit.collaboration_score >= 50 %}#dbeafe{% elif it_audit.collaboration_score %}#fef3c7{% else %}#f3f4f6{% endif %};
|
||
display: flex; align-items: center; justify-content: center;">
|
||
<svg width="24" height="24" fill="{% if it_audit.collaboration_score and it_audit.collaboration_score >= 90 %}#166534{% elif it_audit.collaboration_score and it_audit.collaboration_score >= 50 %}#1e40af{% elif it_audit.collaboration_score %}#92400e{% else %}#9ca3af{% endif %}" viewBox="0 0 24 24">
|
||
<path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="font-size: 28px; font-weight: 700; color: {% if it_audit.collaboration_score and it_audit.collaboration_score >= 90 %}#166534{% elif it_audit.collaboration_score and it_audit.collaboration_score >= 50 %}#1e40af{% elif it_audit.collaboration_score %}#92400e{% else %}#9ca3af{% endif %};">
|
||
{% if it_audit.collaboration_score is not none %}{{ it_audit.collaboration_score }}{% else %}-{% endif %}
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); font-weight: 500;">Współpraca</div>
|
||
</div>
|
||
|
||
<!-- Maturity Level -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); text-align: center; border: 2px solid #e5e7eb;">
|
||
<div style="width: 48px; height: 48px; border-radius: 50%; margin: 0 auto var(--spacing-sm); background: #f3f4f6; display: flex; align-items: center; justify-content: center;">
|
||
<svg width="24" height="24" fill="#6b7280" viewBox="0 0 24 24">
|
||
<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 14l-5-5 1.41-1.41L12 14.17l4.59-4.58L18 11l-6 6z"/>
|
||
</svg>
|
||
</div>
|
||
<div style="font-size: 18px; font-weight: 700; color: var(--text-primary);">
|
||
{% if it_audit.maturity_level == 'advanced' %}Zaawansowany{% elif it_audit.maturity_level == 'established' %}Rozwinięty{% elif it_audit.maturity_level == 'developing' %}Rozwijający{% else %}Podstawowy{% endif %}
|
||
</div>
|
||
<div style="font-size: var(--font-size-sm); color: var(--text-secondary); font-weight: 500;">Poziom dojrzałości</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- IT Capabilities Grid -->
|
||
<div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--spacing-lg);">
|
||
<!-- Cloud & Identity -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 1px solid var(--border);">
|
||
<h3 style="font-size: var(--font-size-base); font-weight: 600; color: var(--text-primary); margin-bottom: var(--spacing-md); display: flex; align-items: center; gap: var(--spacing-sm);">
|
||
<svg width="20" height="20" fill="var(--primary)" viewBox="0 0 24 24">
|
||
<path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z"/>
|
||
</svg>
|
||
Chmura i tożsamość
|
||
</h3>
|
||
<div style="display: grid; gap: var(--spacing-sm);">
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Microsoft 365</span>
|
||
{% if it_audit.has_m365 %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Tak</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #f3f4f6; color: #9ca3af; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Nie</span>
|
||
{% endif %}
|
||
</div>
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Azure AD / Entra ID</span>
|
||
{% if it_audit.has_azure_ad %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Tak</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #f3f4f6; color: #9ca3af; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Nie</span>
|
||
{% endif %}
|
||
</div>
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">Google Workspace</span>
|
||
{% if it_audit.has_google_workspace %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Tak</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #f3f4f6; color: #9ca3af; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Nie</span>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Security -->
|
||
<div style="background: var(--background); border-radius: var(--radius-lg); padding: var(--spacing-lg); border: 1px solid var(--border);">
|
||
<h3 style="font-size: var(--font-size-base); font-weight: 600; color: var(--text-primary); margin-bottom: var(--spacing-md); display: flex; align-items: center; gap: var(--spacing-sm);">
|
||
<svg width="20" height="20" fill="var(--primary)" viewBox="0 0 24 24">
|
||
<path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4z"/>
|
||
</svg>
|
||
Bezpieczeństwo
|
||
</h3>
|
||
<div style="display: grid; gap: var(--spacing-sm);">
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">MFA (2FA)</span>
|
||
{% if it_audit.has_mfa %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Tak</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #fee2e2; color: #991b1b; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Nie</span>
|
||
{% endif %}
|
||
</div>
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">VPN</span>
|
||
{% if it_audit.has_vpn %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Tak</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #f3f4f6; color: #9ca3af; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Nie</span>
|
||
{% endif %}
|
||
</div>
|
||
<div style="display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-sm); background: white; border-radius: var(--radius);">
|
||
<span style="font-size: var(--font-size-sm); color: var(--text-secondary);">EDR</span>
|
||
{% if it_audit.has_edr %}
|
||
<span style="padding: 2px 8px; background: #dcfce7; color: #166534; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Tak</span>
|
||
{% else %}
|
||
<span style="padding: 2px 8px; background: #fef3c7; color: #92400e; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500;">Nie</span>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
{# Company Events - UKRYTE (2026-01-11) - do przywrócenia w przyszłości
|
||
{% set _news_hidden = company.is_section_hidden('news') %}
|
||
{% if events and (not _news_hidden or can_edit_profile or is_admin) %}
|
||
<div class="company-section {% if _news_hidden %}section-hidden{% endif %}">
|
||
{% if _news_hidden %}
|
||
<div class="hidden-section-badge"><i class="fas fa-eye-slash"></i> Ukryta — niewidoczna dla odwiedzających</div>
|
||
{% endif %}
|
||
<h2 class="section-title">
|
||
Aktualności i wydarzenia
|
||
<a href="{{ url_for('events', company=company.id) }}" style="float: right; font-size: var(--font-size-sm); color: var(--primary); text-decoration: none; font-weight: normal;">
|
||
Zobacz wszystkie →
|
||
</a>
|
||
</h2>
|
||
|
||
{% for event in events %}
|
||
<div style="padding: var(--spacing-lg); background: var(--background); border-radius: var(--radius-lg); margin-bottom: var(--spacing-md); {% if loop.last %}margin-bottom: 0;{% endif %}">
|
||
<div style="margin-bottom: var(--spacing-sm);">
|
||
<span class="tag {% if event.event_type == 'product_launch' %}primary{% endif %}" style="font-size: var(--font-size-sm);">
|
||
{% if event.event_type == 'product_launch' %}📦 Nowy produkt{% endif %}
|
||
{% if event.event_type == 'company_milestone' %}🏆 Kamień milowy{% endif %}
|
||
{% if event.event_type == 'company_news' %}📰 Aktualność{% endif %}
|
||
{% if event.event_type == 'education_event' %}🎓 Szkolenie{% endif %}
|
||
{% if event.event_type == 'company_info' %}ℹ️ Informacja{% endif %}
|
||
{% if event.event_type == 'financial_report' %}💰 Raport finansowy{% endif %}
|
||
{% if event.event_type == 'contract_win' %}🤝 Nowy kontrakt{% endif %}
|
||
{% if event.event_type == 'event' %}📅 Wydarzenie{% endif %}
|
||
</span>
|
||
</div>
|
||
|
||
<h3 style="font-size: var(--font-size-lg); font-weight: 600; color: var(--text-primary); margin-bottom: var(--spacing-sm);">
|
||
{{ event.title }}
|
||
</h3>
|
||
|
||
<p style="color: var(--text-secondary); line-height: 1.6; margin-bottom: var(--spacing-md);">
|
||
{{ event.description|truncate(200) if event.description|length > 200 else event.description }}
|
||
</p>
|
||
|
||
<div style="display: flex; gap: var(--spacing-lg); font-size: var(--font-size-sm); color: var(--text-secondary);">
|
||
{% if event.event_date %}
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-xs);">
|
||
<svg width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
|
||
<rect x="2" y="3" width="12" height="12" rx="2"/>
|
||
<path d="M2 7h12M6 3v2M10 3v2"/>
|
||
</svg>
|
||
{{ event.event_date.strftime('%d.%m.%Y') }}
|
||
</div>
|
||
{% endif %}
|
||
|
||
{% if event.source_url %}
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-xs);">
|
||
<svg width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
|
||
<path d="M8 2l4 4-4 4M2 6h10"/>
|
||
</svg>
|
||
<a href="{{ event.source_url }}" target="_blank" rel="noopener noreferrer" style="color: var(--primary); text-decoration: none;">
|
||
Źródło
|
||
</a>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
{% endfor %}
|
||
</div>
|
||
{% endif %}
|
||
#}
|
||
|
||
<!-- Edit Permission Modal (for employees) -->
|
||
{% if company_managers is defined and company_managers %}
|
||
<div class="modal-overlay" id="editPermissionModal">
|
||
<div class="modal" style="max-width: 480px; background: var(--surface); border-radius: var(--radius-lg); padding: var(--spacing-xl);">
|
||
<div style="text-align: center; margin-bottom: var(--spacing-lg);">
|
||
<div style="font-size: 3em; margin-bottom: var(--spacing-md);">🔒</div>
|
||
<h3 style="margin-bottom: var(--spacing-sm);">Edycja wymaga uprawnień</h3>
|
||
<p style="color: var(--text-secondary);">
|
||
Edycja profilu firmy jest dostępna dla kadry zarządzającej.
|
||
Skontaktuj się z odpowiednią osobą:
|
||
</p>
|
||
</div>
|
||
<div style="margin-bottom: var(--spacing-lg);">
|
||
{% for mgr in company_managers %}
|
||
<div style="display: flex; align-items: center; gap: var(--spacing-sm); padding: var(--spacing-sm) var(--spacing-md); background: var(--background); border-radius: var(--radius); margin-bottom: var(--spacing-xs);">
|
||
<svg width="20" height="20" fill="none" stroke="var(--primary)" stroke-width="2" viewBox="0 0 24 24">
|
||
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/>
|
||
<circle cx="12" cy="7" r="4"/>
|
||
</svg>
|
||
<div>
|
||
<div style="font-weight: 600;">{{ mgr.name or 'Brak imienia' }}</div>
|
||
{% if mgr.email %}
|
||
<a href="mailto:{{ mgr.email }}" style="font-size: 0.85rem; color: var(--primary);">{{ mgr.email }}</a>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
{% endfor %}
|
||
</div>
|
||
<div style="text-align: center;">
|
||
<button type="button" class="btn btn-primary"
|
||
onclick="document.getElementById('editPermissionModal').classList.remove('active')">
|
||
Rozumiem
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<!-- Universal Confirm Modal -->
|
||
<div class="modal-overlay" id="confirmModal">
|
||
<div class="modal" style="max-width: 420px; background: var(--surface); border-radius: var(--radius-lg); padding: var(--spacing-xl);">
|
||
<div style="text-align: center; margin-bottom: var(--spacing-lg);">
|
||
<div class="modal-icon" id="confirmModalIcon" style="font-size: 3em; margin-bottom: var(--spacing-md);">❓</div>
|
||
<h3 id="confirmModalTitle" style="margin-bottom: var(--spacing-sm);">Potwierdzenie</h3>
|
||
<p class="modal-description" id="confirmModalMessage" style="color: var(--text-secondary);"></p>
|
||
</div>
|
||
<div class="modal-actions" style="display: flex; gap: var(--spacing-sm); justify-content: center;">
|
||
<button type="button" class="btn btn-secondary" id="confirmModalCancel">Anuluj</button>
|
||
<button type="button" class="btn btn-primary" id="confirmModalOk">OK</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- AI Progress Modal -->
|
||
<div id="aiProgressModal" class="ai-progress-modal">
|
||
<div class="ai-progress-content">
|
||
<div class="ai-progress-header">
|
||
<h3>
|
||
<div class="spinner-icon" id="aiSpinner"></div>
|
||
<span id="aiModalTitle">Wzbogacanie danych AI...</span>
|
||
</h3>
|
||
<button class="ai-cancel-btn" id="aiCancelBtn" onclick="cancelAiEnrichment()">Anuluj</button>
|
||
</div>
|
||
<div class="ai-progress-body">
|
||
<div class="ai-progress-bar-container">
|
||
<div class="ai-progress-bar-bg">
|
||
<div class="ai-progress-bar" id="aiProgressBar" style="width: 0%">
|
||
<span id="aiProgressPercent">0%</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="ai-progress-status" id="aiProgressStatus">
|
||
<span class="status-icon">⏳</span>
|
||
<span id="aiStatusText">Przygotowywanie...</span>
|
||
</div>
|
||
<div class="ai-progress-log" id="aiProgressLog">
|
||
<!-- Log entries will be added here -->
|
||
</div>
|
||
</div>
|
||
<div class="ai-progress-footer" id="aiProgressFooter" style="display: none;">
|
||
<button class="btn btn-secondary" onclick="closeAiModal()">Zamknij</button>
|
||
<button class="btn btn-primary" onclick="window.location.reload()">Odswiez strone</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Logo Gallery Modal -->
|
||
<div class="logo-gallery-overlay" id="logoGalleryOverlay">
|
||
<div class="logo-gallery-content">
|
||
<h3>Wybierz logo</h3>
|
||
<p class="gallery-subtitle">Kliknij na logo, które chcesz użyć dla firmy</p>
|
||
<div class="logo-gallery-grid" id="logoGalleryGrid">
|
||
<!-- Dynamically populated by JS -->
|
||
</div>
|
||
<div class="logo-gallery-actions">
|
||
<button class="btn-cancel-gallery" id="logoGalleryCancel">Anuluj</button>
|
||
<button class="btn-confirm-gallery" id="logoGalleryConfirm" disabled>Użyj wybranego</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Logo Fetch Progress Overlay -->
|
||
<div class="logo-loading-overlay" id="logoLoadingOverlay">
|
||
<div class="logo-loading-content">
|
||
<div class="logo-loading-header">
|
||
<h3>Pobieranie logo firmy</h3>
|
||
<p>{{ company.name }}</p>
|
||
</div>
|
||
<div class="logo-steps">
|
||
<div class="logo-step" id="logoStep_fetch_website">
|
||
<div class="logo-step-icon pending" id="logoStepIcon_fetch_website">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/></svg>
|
||
</div>
|
||
<span class="logo-step-text" id="logoStepText_fetch_website">Sprawdzam stronę WWW firmy...</span>
|
||
</div>
|
||
<div class="logo-step" id="logoStep_meta_tags">
|
||
<div class="logo-step-icon pending" id="logoStepIcon_meta_tags">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/></svg>
|
||
</div>
|
||
<span class="logo-step-text" id="logoStepText_meta_tags">Szukam meta tagów (og:image, favicon)...</span>
|
||
</div>
|
||
<div class="logo-step" id="logoStep_scan_images">
|
||
<div class="logo-step-icon pending" id="logoStepIcon_scan_images">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/></svg>
|
||
</div>
|
||
<span class="logo-step-text" id="logoStepText_scan_images">Analizuję obrazy na stronie...</span>
|
||
</div>
|
||
<div class="logo-step" id="logoStep_download">
|
||
<div class="logo-step-icon pending" id="logoStepIcon_download">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/></svg>
|
||
</div>
|
||
<span class="logo-step-text" id="logoStepText_download">Pobieram i konwertuję obrazy...</span>
|
||
</div>
|
||
<div class="logo-step" id="logoStep_save">
|
||
<div class="logo-step-icon pending" id="logoStepIcon_save">
|
||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/></svg>
|
||
</div>
|
||
<span class="logo-step-text" id="logoStepText_save">Zapisuję logo firmy...</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="toastContainer" style="position: fixed; top: 80px; right: 20px; z-index: 1100; display: flex; flex-direction: column; gap: 10px;"></div>
|
||
|
||
<style>
|
||
.modal-overlay#editPermissionModal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1050; align-items: center; justify-content: center; }
|
||
.modal-overlay#editPermissionModal.active { display: flex; }
|
||
.modal-overlay#confirmModal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1050; align-items: center; justify-content: center; }
|
||
.modal-overlay#confirmModal.active { display: flex; }
|
||
.toast { padding: 12px 20px; border-radius: var(--radius); background: var(--surface); border-left: 4px solid var(--primary); box-shadow: 0 4px 12px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 10px; animation: toastIn 0.3s ease; }
|
||
.toast.success { border-left-color: var(--success); }
|
||
.toast.error { border-left-color: var(--error); }
|
||
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
|
||
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }
|
||
</style>
|
||
|
||
<script>
|
||
let confirmResolve = null;
|
||
|
||
function showConfirm(message, options = {}) {
|
||
return new Promise(resolve => {
|
||
confirmResolve = resolve;
|
||
document.getElementById('confirmModalIcon').textContent = options.icon || '❓';
|
||
document.getElementById('confirmModalTitle').textContent = options.title || 'Potwierdzenie';
|
||
document.getElementById('confirmModalMessage').innerHTML = message;
|
||
document.getElementById('confirmModalOk').textContent = options.okText || 'OK';
|
||
document.getElementById('confirmModalOk').className = 'btn ' + (options.okClass || 'btn-primary');
|
||
document.getElementById('confirmModal').classList.add('active');
|
||
});
|
||
}
|
||
|
||
function closeConfirm(result) {
|
||
document.getElementById('confirmModal').classList.remove('active');
|
||
if (confirmResolve) { confirmResolve(result); confirmResolve = null; }
|
||
}
|
||
|
||
document.getElementById('confirmModalOk').addEventListener('click', () => closeConfirm(true));
|
||
document.getElementById('confirmModalCancel').addEventListener('click', () => closeConfirm(false));
|
||
document.getElementById('confirmModal').addEventListener('click', e => { if (e.target.id === 'confirmModal') closeConfirm(false); });
|
||
|
||
// Edit Permission Modal - close on backdrop click
|
||
(function() {
|
||
var epm = document.getElementById('editPermissionModal');
|
||
if (epm) epm.addEventListener('click', function(e) { if (e.target === epm) epm.classList.remove('active'); });
|
||
})();
|
||
|
||
function showToast(message, type = 'info', duration = 4000) {
|
||
const container = document.getElementById('toastContainer');
|
||
const icons = { success: '✓', error: '✕', warning: '⚠', info: 'ℹ' };
|
||
const toast = document.createElement('div');
|
||
toast.className = `toast ${type}`;
|
||
toast.innerHTML = `<span style="font-size:1.2em">${icons[type]||'ℹ'}</span><span>${message}</span>`;
|
||
container.appendChild(toast);
|
||
setTimeout(() => { toast.style.animation = 'toastOut 0.3s ease forwards'; setTimeout(() => toast.remove(), 300); }, duration);
|
||
}
|
||
|
||
// Edit recommendation
|
||
function editRecommendation(recId) {
|
||
window.location.href = `/api/recommendations/${recId}/edit`;
|
||
}
|
||
|
||
// Delete recommendation
|
||
async function deleteRecommendation(recId) {
|
||
const confirmed = await showConfirm('Czy na pewno chcesz usunąć tę rekomendację?', {
|
||
icon: '🗑️',
|
||
title: 'Usuwanie rekomendacji',
|
||
okText: 'Usuń',
|
||
okClass: 'btn-danger'
|
||
});
|
||
if (!confirmed) return;
|
||
|
||
try {
|
||
const response = await fetch(`/api/recommendations/${recId}/delete`, {
|
||
method: 'DELETE',
|
||
headers: {
|
||
'Content-Type': 'application/json',
|
||
},
|
||
credentials: 'same-origin'
|
||
});
|
||
const data = await response.json();
|
||
if (data.success) {
|
||
showToast('Rekomendacja została usunięta', 'success');
|
||
setTimeout(() => window.location.reload(), 1500);
|
||
} else {
|
||
showToast('Błąd: ' + (data.error || 'Nie udało się usunąć rekomendacji.'), 'error');
|
||
}
|
||
} catch (error) {
|
||
console.error('Error:', error);
|
||
showToast('Wystąpił błąd podczas usuwania rekomendacji.', 'error');
|
||
}
|
||
}
|
||
|
||
// === AI ENRICHMENT ===
|
||
let aiEnrichmentCancelled = false;
|
||
let aiEnrichmentController = null;
|
||
|
||
function openAiModal() {
|
||
document.getElementById('aiProgressModal').classList.add('active');
|
||
document.getElementById('aiProgressBar').style.width = '0%';
|
||
document.getElementById('aiProgressPercent').textContent = '0%';
|
||
document.getElementById('aiProgressLog').innerHTML = '';
|
||
document.getElementById('aiProgressFooter').style.display = 'none';
|
||
document.getElementById('aiCancelBtn').style.display = 'block';
|
||
document.getElementById('aiSpinner').style.display = 'block';
|
||
document.getElementById('aiModalTitle').textContent = 'Wzbogacanie danych AI...';
|
||
aiEnrichmentCancelled = false;
|
||
}
|
||
|
||
function closeAiModal() {
|
||
document.getElementById('aiProgressModal').classList.remove('active');
|
||
}
|
||
|
||
function cancelAiEnrichment() {
|
||
aiEnrichmentCancelled = true;
|
||
if (aiEnrichmentController) {
|
||
aiEnrichmentController.abort();
|
||
}
|
||
addAiLogEntry('Anulowano przez uzytkownika', 'error', '✕');
|
||
finishAiEnrichment(false);
|
||
}
|
||
|
||
function updateAiProgress(percent, status) {
|
||
document.getElementById('aiProgressBar').style.width = `${percent}%`;
|
||
document.getElementById('aiProgressPercent').textContent = `${percent}%`;
|
||
if (status) {
|
||
document.getElementById('aiStatusText').textContent = status;
|
||
}
|
||
}
|
||
|
||
function addAiLogEntry(message, type = 'info', icon = null) {
|
||
const log = document.getElementById('aiProgressLog');
|
||
const entry = document.createElement('div');
|
||
entry.className = `ai-log-entry ${type}`;
|
||
|
||
const icons = {
|
||
step: '▶',
|
||
success: '✓',
|
||
error: '✕',
|
||
info: '•'
|
||
};
|
||
|
||
entry.innerHTML = `
|
||
<span class="ai-log-icon">${icon || icons[type] || '•'}</span>
|
||
<span>${message}</span>
|
||
`;
|
||
log.appendChild(entry);
|
||
log.scrollTop = log.scrollHeight;
|
||
}
|
||
|
||
function finishAiEnrichment(success) {
|
||
document.getElementById('aiCancelBtn').style.display = 'none';
|
||
document.getElementById('aiSpinner').style.display = 'none';
|
||
document.getElementById('aiProgressFooter').style.display = 'flex';
|
||
|
||
if (success) {
|
||
document.getElementById('aiModalTitle').textContent = 'Wzbogacanie zakonczone!';
|
||
updateAiProgress(100, 'Zakonczone pomyslnie');
|
||
document.querySelector('#aiProgressStatus .status-icon').textContent = '✓';
|
||
} else {
|
||
document.getElementById('aiModalTitle').textContent = 'Wystapil blad';
|
||
document.querySelector('#aiProgressStatus .status-icon').textContent = '✕';
|
||
}
|
||
}
|
||
|
||
function showProposalApprovalButtons(companyId, proposalId, proposedData, currentData) {
|
||
// Update modal title
|
||
document.getElementById('aiModalTitle').textContent = aiEnrichMode === 'fill'
|
||
? 'Znalezione brakujące informacje'
|
||
: 'Znalezione informacje — wybierz co dodać';
|
||
document.getElementById('aiCancelBtn').style.display = 'none';
|
||
document.getElementById('aiSpinner').style.display = 'none';
|
||
|
||
// Hide the technical log, show review panel instead
|
||
var logContainer = document.getElementById('aiLogContainer');
|
||
if (logContainer) logContainer.style.display = 'none';
|
||
var progressBar = document.querySelector('.ai-progress-bar');
|
||
if (progressBar) progressBar.style.display = 'none';
|
||
|
||
// Field labels in Polish
|
||
var fieldLabels = {
|
||
'business_summary': 'Opis firmy',
|
||
'services_list': 'Usługi',
|
||
'target_market': 'Grupa docelowa',
|
||
'unique_selling_points': 'Wyróżniki firmy',
|
||
'company_values': 'Wartości firmy',
|
||
'certifications': 'Certyfikaty',
|
||
'industry_tags': 'Tagi branżowe',
|
||
'recent_news': 'Ostatnie wiadomości',
|
||
'suggested_category': 'Sugerowana kategoria'
|
||
};
|
||
|
||
// Helper: format value for display
|
||
function formatVal(val) {
|
||
if (!val) return '';
|
||
if (Array.isArray(val)) return val.join(', ');
|
||
return String(val);
|
||
}
|
||
|
||
// Build review panel with current vs proposed comparison
|
||
var reviewHtml = '<div style="max-height: 50vh; overflow-y: auto; padding: 0 4px;">';
|
||
var fieldCount = 0;
|
||
|
||
for (var key in fieldLabels) {
|
||
var newVal = formatVal(proposedData[key]);
|
||
if (!newVal.trim()) continue;
|
||
|
||
var curVal = formatVal(currentData[key]);
|
||
var isNew = !curVal.trim();
|
||
var isChanged = curVal.trim() && curVal.trim() !== newVal.trim();
|
||
var isSame = curVal.trim() === newVal.trim();
|
||
|
||
if (isSame) continue; // Skip unchanged fields
|
||
|
||
// In "fill" mode, skip fields that already have data
|
||
if (aiEnrichMode === 'fill' && !isNew) continue;
|
||
|
||
fieldCount++;
|
||
|
||
var statusBadge = isNew
|
||
? '<span style="display:inline-block;padding:1px 6px;background:#dcfce7;color:#166534;border-radius:4px;font-size:11px;font-weight:600;margin-left:6px;">NOWE</span>'
|
||
: '<span style="display:inline-block;padding:1px 6px;background:#fef3c7;color:#92400e;border-radius:4px;font-size:11px;font-weight:600;margin-left:6px;">ZMIANA</span>';
|
||
|
||
var currentHtml = '';
|
||
if (!isNew && curVal) {
|
||
currentHtml = '<div style="font-size:12px; color:#991b1b; background:#fef2f2; padding:6px 8px; border-radius:4px; margin-bottom:4px; border-left:3px solid #fca5a5;">' +
|
||
'<span style="font-weight:600; color:#7f1d1d;">Obecne:</span> ' +
|
||
curVal.substring(0, 200) + (curVal.length > 200 ? '...' : '') +
|
||
'</div>';
|
||
}
|
||
|
||
var proposedHtml = '<div style="font-size:13px; color:#166534; background:#f0fdf4; padding:6px 8px; border-radius:4px; border-left:3px solid #86efac;">' +
|
||
'<span style="font-weight:600; color:#14532d;">Propozycja:</span> ' +
|
||
newVal.substring(0, 300) + (newVal.length > 300 ? '...' : '') +
|
||
'</div>';
|
||
|
||
reviewHtml += '<label style="display:flex; gap:10px; padding:12px; margin-bottom:8px; background:#f9fafb; border:1px solid #e5e7eb; border-radius:8px; cursor:pointer; align-items:flex-start; line-height:1.5;">' +
|
||
'<input type="checkbox" ' + (isNew ? 'checked' : '') + ' data-field="' + key + '" style="margin-top:4px; width:18px; height:18px; flex-shrink:0;">' +
|
||
'<div style="flex:1; min-width:0;">' +
|
||
'<div style="font-weight:600; font-size:13px; color:#1f2937; margin-bottom:4px;">' + fieldLabels[key] + statusBadge + '</div>' +
|
||
currentHtml +
|
||
proposedHtml +
|
||
'</div>' +
|
||
'</label>';
|
||
}
|
||
|
||
if (fieldCount === 0) {
|
||
reviewHtml += '<p style="text-align:center; color:#64748b; padding:20px;">Nie znaleziono nowych informacji do dodania. Profil firmy jest aktualny.</p>';
|
||
}
|
||
|
||
reviewHtml += '</div>';
|
||
|
||
// Insert review panel before footer
|
||
var footer = document.getElementById('aiProgressFooter');
|
||
var reviewDiv = document.createElement('div');
|
||
reviewDiv.id = 'aiReviewPanel';
|
||
reviewDiv.innerHTML = reviewHtml;
|
||
footer.parentElement.insertBefore(reviewDiv, footer);
|
||
|
||
// Show action buttons
|
||
footer.style.display = 'flex';
|
||
if (fieldCount > 0) {
|
||
footer.innerHTML = '<div style="display:flex; gap:var(--spacing-md); width:100%; justify-content:center; flex-wrap:wrap; padding-top:12px; border-top:1px solid #e5e7eb;">' +
|
||
'<button id="approveProposalBtn" class="btn btn-success" style="padding:12px 24px; font-weight:600;">Zapisz wybrane (' + fieldCount + ')</button>' +
|
||
'<button id="rejectProposalBtn" class="btn btn-danger" style="padding:12px 24px; font-weight:600;">Odrzuć wszystko</button>' +
|
||
'</div>';
|
||
} else {
|
||
footer.innerHTML = '<div style="text-align:center; padding:12px;"><button onclick="closeAiModal()" class="btn btn-outline" style="padding:12px 24px;">Zamknij</button></div>';
|
||
return;
|
||
}
|
||
|
||
// Update counter when checkboxes change
|
||
var checkboxes = reviewDiv.querySelectorAll('input[type="checkbox"]');
|
||
checkboxes.forEach(function(cb) {
|
||
cb.addEventListener('change', function() {
|
||
var checked = reviewDiv.querySelectorAll('input[type="checkbox"]:checked').length;
|
||
var btn = document.getElementById('approveProposalBtn');
|
||
if (btn) {
|
||
btn.textContent = 'Zapisz wybrane (' + checked + ')';
|
||
btn.disabled = checked === 0;
|
||
}
|
||
});
|
||
});
|
||
|
||
// Handle approval (only selected fields)
|
||
document.getElementById('approveProposalBtn').addEventListener('click', async () => {
|
||
var selectedFields = [];
|
||
reviewDiv.querySelectorAll('input[type="checkbox"]:checked').forEach(function(cb) {
|
||
selectedFields.push(cb.dataset.field);
|
||
});
|
||
|
||
if (selectedFields.length === 0) return;
|
||
|
||
var btn = document.getElementById('approveProposalBtn');
|
||
btn.disabled = true;
|
||
btn.textContent = 'Zapisywanie...';
|
||
|
||
try {
|
||
const response = await fetch(`/api/company/${companyId}/proposals/${proposalId}/approve`, {
|
||
method: 'POST',
|
||
headers: {
|
||
'Content-Type': 'application/json',
|
||
'X-CSRFToken': '{{ csrf_token() }}'
|
||
},
|
||
body: JSON.stringify({ fields: selectedFields })
|
||
});
|
||
const data = await response.json();
|
||
|
||
if (data.success) {
|
||
footer.innerHTML = '<div style="text-align:center; color:#10b981; font-weight:600; padding:12px;">Dane zostały dodane do profilu firmy<br><small style="font-weight:normal;">Strona się odświeży...</small></div>';
|
||
setTimeout(() => location.reload(), 2000);
|
||
} else {
|
||
btn.disabled = false;
|
||
btn.textContent = 'Zapisz wybrane (' + selectedFields.length + ')';
|
||
}
|
||
} catch (error) {
|
||
btn.disabled = false;
|
||
btn.textContent = 'Zapisz wybrane (' + selectedFields.length + ')';
|
||
}
|
||
});
|
||
|
||
// Handle rejection
|
||
document.getElementById('rejectProposalBtn').addEventListener('click', async () => {
|
||
var btn = document.getElementById('rejectProposalBtn');
|
||
btn.disabled = true;
|
||
btn.textContent = 'Odrzucanie...';
|
||
|
||
try {
|
||
const response = await fetch(`/api/company/${companyId}/proposals/${proposalId}/reject`, {
|
||
method: 'POST',
|
||
headers: {
|
||
'Content-Type': 'application/json',
|
||
'X-CSRFToken': '{{ csrf_token() }}'
|
||
},
|
||
body: JSON.stringify({})
|
||
});
|
||
const data = await response.json();
|
||
|
||
if (data.success) {
|
||
footer.innerHTML = '<div style="text-align:center; color:#ef4444; padding:12px;">Propozycja odrzucona<br><small>Możesz spróbować ponownie później</small></div>';
|
||
setTimeout(() => closeAiModal(), 2000);
|
||
} else {
|
||
btn.disabled = false;
|
||
btn.textContent = 'Odrzuć wszystko';
|
||
}
|
||
} catch (error) {
|
||
addAiLogEntry('Błąd połączenia: ' + error.message, 'error');
|
||
btn.disabled = false;
|
||
btn.textContent = '✕ Odrzuć propozycję';
|
||
}
|
||
});
|
||
}
|
||
|
||
var aiEnrichMode = 'full'; // 'fill' or 'full'
|
||
|
||
document.addEventListener('DOMContentLoaded', function() {
|
||
// Bind both buttons to the same flow
|
||
['aiEnrichBtn', 'aiEnrichFullBtn'].forEach(function(btnId) {
|
||
var btn = document.getElementById(btnId);
|
||
if (btn && !btn.disabled) {
|
||
btn.addEventListener('click', function() { startAiEnrich(this); });
|
||
}
|
||
});
|
||
});
|
||
|
||
async function startAiEnrich(triggerBtn) {
|
||
const companyId = triggerBtn.dataset.companyId;
|
||
aiEnrichMode = triggerBtn.dataset.mode || 'full';
|
||
const companyName = '{{ company.name }}';
|
||
|
||
// Open modal
|
||
openAiModal();
|
||
|
||
// Step 1: Initialize
|
||
updateAiProgress(5, 'Inicjalizacja...');
|
||
addAiLogEntry(`Szukam informacji o: ${companyName}`, 'step');
|
||
await sleep(300);
|
||
|
||
if (aiEnrichmentCancelled) return;
|
||
|
||
updateAiProgress(15, 'Przeszukuję internet...');
|
||
addAiLogEntry('Sprawdzam stronę WWW firmy i wyniki wyszukiwania', 'info');
|
||
await sleep(400);
|
||
|
||
if (aiEnrichmentCancelled) return;
|
||
|
||
updateAiProgress(30, 'Analizuję znalezione dane...');
|
||
addAiLogEntry('Przygotowuję dane do analizy przez AI', 'info');
|
||
await sleep(300);
|
||
|
||
if (aiEnrichmentCancelled) return;
|
||
|
||
updateAiProgress(40, 'AI analizuje informacje...');
|
||
addAiLogEntry('To może potrwać do 30 sekund...', 'info');
|
||
|
||
try {
|
||
aiEnrichmentController = new AbortController();
|
||
|
||
updateAiProgress(50, 'AI analizuje informacje...');
|
||
|
||
const response = await fetch(`/api/company/${companyId}/enrich-ai`, {
|
||
method: 'POST',
|
||
headers: {
|
||
'Content-Type': 'application/json',
|
||
'X-CSRFToken': '{{ csrf_token() }}'
|
||
},
|
||
signal: aiEnrichmentController.signal
|
||
});
|
||
|
||
if (aiEnrichmentCancelled) return;
|
||
|
||
updateAiProgress(70, 'Przetwarzanie odpowiedzi...');
|
||
addAiLogEntry('Odpowiedz otrzymana, przetwarzanie...', 'info');
|
||
|
||
const data = await response.json();
|
||
|
||
if (data.success) {
|
||
updateAiProgress(100, 'Gotowe!');
|
||
addAiLogEntry('Znaleziono informacje — przygotowuję podgląd...', 'step');
|
||
await sleep(500);
|
||
|
||
const insights = data.proposed_data;
|
||
const proposalId = data.proposal_id;
|
||
const currentData = data.current_data || {};
|
||
|
||
// Show review panel with checkboxes
|
||
showProposalApprovalButtons(companyId, proposalId, insights, currentData);
|
||
return;
|
||
} else {
|
||
addAiLogEntry('Blad: ' + (data.error || 'Nieznany blad'), 'error');
|
||
finishAiEnrichment(false);
|
||
}
|
||
} catch (error) {
|
||
if (error.name === 'AbortError') {
|
||
// Already handled in cancelAiEnrichment
|
||
return;
|
||
}
|
||
console.error('AI enrichment error:', error);
|
||
addAiLogEntry('Blad polaczenia: ' + error.message, 'error');
|
||
finishAiEnrichment(false);
|
||
}
|
||
}
|
||
|
||
// Registry enrichment button handler
|
||
const registryEnrichBtn = document.getElementById('registryEnrichBtn');
|
||
if (registryEnrichBtn) {
|
||
registryEnrichBtn.addEventListener('click', async function() {
|
||
const companyId = this.dataset.companyId;
|
||
const nip = this.dataset.nip;
|
||
const krs = this.dataset.krs;
|
||
|
||
// Show what will be fetched
|
||
let sourceInfo = '';
|
||
if (krs) {
|
||
sourceInfo = `KRS: ${krs}`;
|
||
} else if (nip) {
|
||
sourceInfo = `NIP: ${nip} (szukam w Białej Liście / CEIDG)`;
|
||
} else {
|
||
sourceInfo = 'brak NIP i KRS';
|
||
}
|
||
|
||
this.classList.add('loading');
|
||
this.disabled = true;
|
||
|
||
try {
|
||
const response = await fetch(`/api/company/${companyId}/enrich-registry`, {
|
||
method: 'POST',
|
||
headers: {
|
||
'Content-Type': 'application/json',
|
||
'X-CSRFToken': '{{ csrf_token() }}'
|
||
}
|
||
});
|
||
|
||
const data = await response.json();
|
||
|
||
if (data.success) {
|
||
// Show success flash
|
||
const flash = document.createElement('div');
|
||
flash.style.cssText = 'position:fixed;top:20px;left:50%;transform:translateX(-50%);background:#065f46;color:white;padding:16px 24px;border-radius:8px;z-index:9999;font-size:14px;max-width:600px;box-shadow:0 4px 12px rgba(0,0,0,0.3);';
|
||
flash.innerHTML = `<strong>Pobrano dane z ${data.source}</strong><br>${data.message}`;
|
||
document.body.appendChild(flash);
|
||
|
||
setTimeout(() => {
|
||
flash.remove();
|
||
window.location.reload();
|
||
}, 3000);
|
||
} else {
|
||
// Show error flash
|
||
const flash = document.createElement('div');
|
||
flash.style.cssText = 'position:fixed;top:20px;left:50%;transform:translateX(-50%);background:#991b1b;color:white;padding:16px 24px;border-radius:8px;z-index:9999;font-size:14px;max-width:600px;box-shadow:0 4px 12px rgba(0,0,0,0.3);cursor:pointer;';
|
||
flash.innerHTML = `<strong>Błąd</strong><br>${data.error}`;
|
||
flash.onclick = () => flash.remove();
|
||
document.body.appendChild(flash);
|
||
|
||
setTimeout(() => flash.remove(), 5000);
|
||
|
||
this.classList.remove('loading');
|
||
this.disabled = false;
|
||
}
|
||
} catch (error) {
|
||
console.error('Registry enrichment error:', error);
|
||
const flash = document.createElement('div');
|
||
flash.style.cssText = 'position:fixed;top:20px;left:50%;transform:translateX(-50%);background:#991b1b;color:white;padding:16px 24px;border-radius:8px;z-index:9999;font-size:14px;max-width:600px;box-shadow:0 4px 12px rgba(0,0,0,0.3);cursor:pointer;';
|
||
flash.innerHTML = '<strong>Błąd połączenia</strong><br>Nie udało się połączyć z serwerem';
|
||
flash.onclick = () => flash.remove();
|
||
document.body.appendChild(flash);
|
||
|
||
setTimeout(() => flash.remove(), 5000);
|
||
|
||
this.classList.remove('loading');
|
||
this.disabled = false;
|
||
}
|
||
});
|
||
}
|
||
|
||
function sleep(ms) {
|
||
return new Promise(resolve => setTimeout(resolve, ms));
|
||
}
|
||
|
||
// ============================================================
|
||
// Logo Fetch Handler
|
||
// ============================================================
|
||
const LOGO_STEP_ICONS = {
|
||
pending: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/></svg>',
|
||
in_progress: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><path d="M12 2a10 10 0 0 1 10 10"/></svg>',
|
||
complete: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><polyline points="22 4 12 14.01 9 11.01"/></svg>',
|
||
error: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>',
|
||
missing: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="8" y1="12" x2="16" y2="12"/></svg>',
|
||
skipped: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="8" y1="12" x2="16" y2="12"/></svg>'
|
||
};
|
||
|
||
function updateLogoStep(stepId, status, message) {
|
||
const iconEl = document.getElementById('logoStepIcon_' + stepId);
|
||
const textEl = document.getElementById('logoStepText_' + stepId);
|
||
const stepEl = document.getElementById('logoStep_' + stepId);
|
||
if (!iconEl) return;
|
||
iconEl.className = 'logo-step-icon ' + status;
|
||
iconEl.innerHTML = LOGO_STEP_ICONS[status] || LOGO_STEP_ICONS.pending;
|
||
if (message) textEl.textContent = message;
|
||
if (status === 'in_progress') stepEl.classList.add('active');
|
||
else stepEl.classList.remove('active');
|
||
if (status === 'complete' || status === 'error' || status === 'missing' || status === 'skipped') stepEl.classList.add('done');
|
||
}
|
||
|
||
(function() {
|
||
})();
|
||
|
||
(function() {
|
||
const logoBtn = document.getElementById('logoFetchBtn');
|
||
if (!logoBtn) return;
|
||
|
||
const csrfToken = document.querySelector('meta[name="csrf-token"]')?.content || '';
|
||
const companyId = logoBtn.dataset.companyId;
|
||
const slug = '{{ company.slug }}';
|
||
let selectedIndex = null;
|
||
|
||
async function animateSteps(data) {
|
||
const stepOrder = ['fetch_website', 'meta_tags', 'scan_images', 'download', 'save'];
|
||
const stepsMap = {};
|
||
if (data.steps) data.steps.forEach(s => { stepsMap[s.step] = s; });
|
||
|
||
for (let i = 0; i < stepOrder.length; i++) {
|
||
const sid = stepOrder[i];
|
||
const stepData = stepsMap[sid];
|
||
if (stepData) {
|
||
updateLogoStep(sid, 'in_progress', stepData.message);
|
||
await sleep(300);
|
||
updateLogoStep(sid, stepData.status, stepData.message);
|
||
} else {
|
||
updateLogoStep(sid, 'skipped', null);
|
||
}
|
||
await sleep(300);
|
||
}
|
||
}
|
||
|
||
async function sendLogoAction(action, extra) {
|
||
const body = { action, ...extra };
|
||
const resp = await fetch(`/api/company/${companyId}/fetch-logo`, {
|
||
method: 'POST',
|
||
headers: { 'Content-Type': 'application/json', 'X-CSRFToken': csrfToken },
|
||
body: JSON.stringify(body)
|
||
});
|
||
return resp.json();
|
||
}
|
||
|
||
function buildGallery(candidates, existingLogoExt, recommendedIndex) {
|
||
const grid = document.getElementById('logoGalleryGrid');
|
||
grid.innerHTML = '';
|
||
selectedIndex = null;
|
||
const cacheBust = '?t=' + Date.now();
|
||
|
||
// Show existing logo first if exists
|
||
if (existingLogoExt) {
|
||
const item = document.createElement('div');
|
||
item.className = 'logo-gallery-item current';
|
||
item.dataset.index = 'current';
|
||
item.innerHTML = `
|
||
<div class="gallery-img">
|
||
<img src="/static/img/companies/${slug}.${existingLogoExt}${cacheBust}" alt="Obecne logo">
|
||
</div>
|
||
<div class="gallery-label">Obecne logo</div>
|
||
<span class="gallery-badge">obecne</span>
|
||
`;
|
||
grid.appendChild(item);
|
||
}
|
||
|
||
// Show candidates
|
||
candidates.forEach(c => {
|
||
const item = document.createElement('div');
|
||
const isRecommended = (recommendedIndex !== null && c.index === recommendedIndex);
|
||
item.className = 'logo-gallery-item' + (isRecommended ? ' recommended' : '');
|
||
item.dataset.index = c.index;
|
||
const dims = c.width ? `${c.width}x${c.height}` : 'SVG';
|
||
const recBadge = isRecommended ? '<span class="gallery-badge badge-recommended">rekomendowane</span>' : '';
|
||
item.innerHTML = `
|
||
<div class="gallery-img">
|
||
<img src="/static/img/companies/${c.filename}${cacheBust}" alt="${c.label}">
|
||
</div>
|
||
<div class="gallery-label">${c.label}</div>
|
||
<div class="gallery-size">${dims}</div>
|
||
${recBadge}
|
||
`;
|
||
item.addEventListener('click', () => selectCandidate(item, c.index));
|
||
grid.appendChild(item);
|
||
});
|
||
|
||
document.getElementById('logoGalleryConfirm').disabled = true;
|
||
}
|
||
|
||
function selectCandidate(item, index) {
|
||
// Deselect all
|
||
document.querySelectorAll('.logo-gallery-item').forEach(el => el.classList.remove('selected'));
|
||
// Select clicked (unless it's the current logo)
|
||
if (item.dataset.index === 'current') return;
|
||
item.classList.add('selected');
|
||
selectedIndex = index;
|
||
document.getElementById('logoGalleryConfirm').disabled = false;
|
||
}
|
||
|
||
logoBtn.addEventListener('click', async function() {
|
||
const overlay = document.getElementById('logoLoadingOverlay');
|
||
|
||
// Reset steps
|
||
['fetch_website', 'meta_tags', 'scan_images', 'download', 'save'].forEach(s => {
|
||
updateLogoStep(s, 'pending', null);
|
||
const el = document.getElementById('logoStep_' + s);
|
||
if (el) el.classList.remove('active', 'done');
|
||
});
|
||
|
||
overlay.classList.add('active');
|
||
this.classList.add('loading');
|
||
this.disabled = true;
|
||
updateLogoStep('fetch_website', 'in_progress', 'Sprawdzam stronę WWW firmy...');
|
||
|
||
try {
|
||
const data = await sendLogoAction('fetch');
|
||
await animateSteps(data);
|
||
await sleep(1500);
|
||
overlay.classList.remove('active');
|
||
|
||
if (!data.success) {
|
||
showToast(data.message || data.error || 'Nie udało się pobrać logo', 'error', 5000);
|
||
this.classList.remove('loading');
|
||
this.disabled = false;
|
||
return;
|
||
}
|
||
|
||
// Show gallery with all candidates
|
||
buildGallery(data.candidates, data.existing_logo_ext, data.recommended_index);
|
||
document.getElementById('logoGalleryOverlay').classList.add('active');
|
||
|
||
} catch (error) {
|
||
console.error('Logo fetch error:', error);
|
||
overlay.classList.remove('active');
|
||
showToast('Błąd połączenia z serwerem', 'error', 5000);
|
||
this.classList.remove('loading');
|
||
this.disabled = false;
|
||
}
|
||
});
|
||
|
||
// Gallery: Cancel
|
||
document.getElementById('logoGalleryCancel').addEventListener('click', async function() {
|
||
await sendLogoAction('cancel');
|
||
document.getElementById('logoGalleryOverlay').classList.remove('active');
|
||
showToast('Anulowano', 'info', 2000);
|
||
logoBtn.classList.remove('loading');
|
||
logoBtn.disabled = false;
|
||
});
|
||
|
||
// Gallery: Confirm
|
||
document.getElementById('logoGalleryConfirm').addEventListener('click', async function() {
|
||
if (selectedIndex === null) return;
|
||
this.disabled = true;
|
||
this.textContent = 'Zapisuję...';
|
||
await sendLogoAction('confirm', { index: selectedIndex });
|
||
document.getElementById('logoGalleryOverlay').classList.remove('active');
|
||
showToast('Logo zapisane!', 'success', 3000);
|
||
await sleep(2000);
|
||
window.location.reload();
|
||
});
|
||
|
||
// Close gallery on backdrop click
|
||
document.getElementById('logoGalleryOverlay').addEventListener('click', function(e) {
|
||
if (e.target === this) {
|
||
sendLogoAction('cancel');
|
||
this.classList.remove('active');
|
||
logoBtn.classList.remove('loading');
|
||
logoBtn.disabled = false;
|
||
}
|
||
});
|
||
})();
|
||
</script>
|
||
|
||
<script>
|
||
function syncFacebookData(companyId, btn) {
|
||
btn.disabled = true;
|
||
btn.textContent = 'Synchronizuję...';
|
||
fetch('/api/oauth/meta/sync-facebook', {
|
||
method: 'POST',
|
||
headers: {'Content-Type': 'application/json', 'X-CSRFToken': document.querySelector('meta[name=csrf-token]')?.content || ''},
|
||
body: JSON.stringify({company_id: companyId})
|
||
})
|
||
.then(r => r.json())
|
||
.then(data => {
|
||
if (data.success) {
|
||
btn.textContent = 'Zaktualizowano!';
|
||
btn.style.background = '#10b981';
|
||
btn.style.color = 'white';
|
||
btn.style.borderColor = '#10b981';
|
||
setTimeout(() => location.reload(), 1000);
|
||
} else {
|
||
btn.textContent = data.message || 'Błąd synchronizacji';
|
||
btn.style.borderColor = '#dc2626';
|
||
btn.style.color = '#dc2626';
|
||
setTimeout(() => {
|
||
btn.textContent = 'Odśwież dane z API';
|
||
btn.disabled = false;
|
||
btn.style.borderColor = '#1877f2';
|
||
btn.style.color = '#1877f2';
|
||
}, 3000);
|
||
}
|
||
})
|
||
.catch(() => {
|
||
btn.textContent = 'Błąd połączenia';
|
||
btn.disabled = false;
|
||
setTimeout(() => { btn.textContent = 'Odśwież dane z API'; }, 2000);
|
||
});
|
||
}
|
||
|
||
// Dynamic open/closed status based on client's local time
|
||
(function() {
|
||
var el = document.getElementById('openNowStatus');
|
||
if (!el) return;
|
||
var periods = {{ (website_analysis.google_opening_hours.periods if website_analysis and website_analysis.google_opening_hours and website_analysis.google_opening_hours.periods else [])|tojson }};
|
||
function checkOpen() {
|
||
var now = new Date();
|
||
var day = now.getDay(); // 0=Sunday, 1=Monday, ...
|
||
var hhmm = now.getHours() * 100 + now.getMinutes();
|
||
var isOpen = false;
|
||
for (var i = 0; i < periods.length; i++) {
|
||
var p = periods[i];
|
||
if (p.open && p.close && p.open.day === day) {
|
||
var openTime = p.open.time ? parseInt(p.open.time, 10) : (p.open.hour || 0) * 100 + (p.open.minute || 0);
|
||
var closeTime = p.close.time ? parseInt(p.close.time, 10) : (p.close.hour || 0) * 100 + (p.close.minute || 0);
|
||
if (hhmm >= openTime && hhmm < closeTime) {
|
||
isOpen = true;
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
var color = isOpen ? '#10b981' : '#ef4444';
|
||
var label = isOpen ? 'Teraz otwarte' : 'Teraz zamknięte';
|
||
el.innerHTML = '<span style="display:inline-flex;align-items:center;gap:6px;color:' + color + ';font-weight:600;font-size:var(--font-size-sm);">'
|
||
+ '<span style="width:8px;height:8px;border-radius:50%;background:' + color + ';display:inline-block;"></span>'
|
||
+ label + '</span>';
|
||
}
|
||
checkOpen();
|
||
setInterval(checkOpen, 60000);
|
||
})();
|
||
</script>
|
||
|
||
<!-- Collapsible audit sections: Strona WWW, Audyt Google Business Profile, Audyt IT -->
|
||
<script>
|
||
(function() {
|
||
var companyId = {{ company.id }};
|
||
var titlesToCollapse = ['Strona WWW', 'Audyt Google Business Profile', 'Audyt IT', 'Analiza SEO', 'Audyt Social Media', 'Social Media'];
|
||
document.querySelectorAll('.company-section .section-title').forEach(function(title) {
|
||
var titleText = title.childNodes[0].textContent.trim();
|
||
if (titlesToCollapse.indexOf(titleText) === -1) return;
|
||
|
||
var section = title.closest('.company-section');
|
||
var storageKey = 'audit_' + companyId + '_' + titleText.replace(/\s+/g, '_');
|
||
|
||
// Wrap everything after title in audit-body div
|
||
var body = document.createElement('div');
|
||
body.className = 'audit-body';
|
||
var sibling = title.nextSibling;
|
||
while (sibling) {
|
||
var next = sibling.nextSibling;
|
||
body.appendChild(sibling);
|
||
sibling = next;
|
||
}
|
||
section.appendChild(body);
|
||
|
||
// Default: collapsed. Only open if explicitly saved as open for THIS company
|
||
section.classList.add('audit-collapsed');
|
||
if (localStorage.getItem(storageKey) === 'open') {
|
||
section.classList.add('audit-open');
|
||
}
|
||
|
||
// Click handler
|
||
title.addEventListener('click', function() {
|
||
section.classList.toggle('audit-open');
|
||
localStorage.setItem(storageKey, section.classList.contains('audit-open') ? 'open' : 'closed');
|
||
});
|
||
});
|
||
})();
|
||
</script>
|
||
|
||
{% endif %}{# end is_guest else #}
|
||
{% endblock %}
|