- HIGH: Fix SQL injection in ZOPK knowledge service (3 functions) — replace f-strings with parameterized queries
- MEDIUM: Sanitize tsquery/LIKE input in SearchService to prevent injection
- MEDIUM: Add @login_required + @role_required(ADMIN) to /health/full endpoint
- MEDIUM: Add @role_required(ADMIN) to ZOPK knowledge search API
- MEDIUM: Add bleach HTML sanitization on write for announcements, events, board proceedings (stored XSS via |safe)
- MEDIUM: Remove partial API key from Gemini service logs
- MEDIUM: Remove @csrf.exempt from chat endpoints, add X-CSRFToken headers in JS
- MEDIUM: Add missing CSRF tokens to 3 POST forms (data_request, benefits_form, benefits_list)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace ~170 manual `if not current_user.is_admin` checks with:
- @role_required(SystemRole.ADMIN) for user management, security, ZOPK
- @role_required(SystemRole.OFFICE_MANAGER) for content management
- current_user.can_access_admin_panel() for admin UI access
- current_user.can_moderate_forum() for forum moderation
- current_user.can_edit_company(id) for company permissions
Add @office_manager_required decorator shortcut.
Add SQL migration to sync existing users' role field.
Role hierarchy: UNAFFILIATED(10) < MEMBER(20) < EMPLOYEE(30) < MANAGER(40) < OFFICE_MANAGER(50) < ADMIN(100)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Added CSS variable --header-height (109px for admin, 73px for regular users)
- Fixed chat container height calculation to account for admin bar
- Fixed mobile sidebar position
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixes issue where chat input field was cut off at the bottom of the screen.
Added safe-area-inset-bottom support for iOS devices.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Zmiana nazwy: "Norda Biznes Hub" → "Norda Biznes Partner"
- Aktualizacja modelu AI: Gemini 2.0 Flash → Gemini 3 Flash
- Zachowano historyczne odniesienia w timeline i dokumentacji
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Flash is free and fast - best default for users
- Prevents accidental Pro usage and costs
- Users can still switch to Pro manually if needed
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Created nordagpt-icon.svg combining Norda compass + INPI circuit motif
- Navy blue background with green AI chip center
- Yellow north indicator (Norda brand color)
- Updated header icon from robot emoji to new SVG
- Updated empty state icon
- Changed example questions to be more relevant:
- 'Szukam partnera do projektu budowlanego'
- 'Kto w Izbie zajmuje się marketingiem?'
- 'Poleć firmę z dobrymi opiniami Google'
- 'Co nowego na forum?'
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Show both models (Flash free, Pro premium) with visual distinction
- Add pricing section with costs and limits
- Update history timeline with today's changes
- Update benefits section with current features
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- costUsd was a string, causing 'toFixed is not a function' error
- Added parseFloat() for cost and parseInt() for latency
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- GOOGLE_GEMINI_API_KEY_FREE: klucz Free tier dla Flash (darmowy)
- GOOGLE_GEMINI_API_KEY: klucz Paid tier dla Pro (płatny)
- GeminiService automatycznie wybiera klucz na podstawie modelu
- Flash pricing ustawiony na $0.00 (Free tier)
- UI pokazuje Flash jako "Darmowy"
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
UI:
- Dropdown wyboru modelu: Flash (szybki, $0.05) vs Pro (analiza, $0.20)
- Wyświetlanie kosztu miesięcznego w headerze
- Badge odpowiedzi pokazuje: model, czas, koszt
Backend:
- Endpoint /api/chat/settings obsługuje model i monthly_cost
- NordaBizChatEngine przyjmuje parametr model
- Koszt zapisywany w tech_info odpowiedzi
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano style CSS dla forum-link (fiolet), news-link (zieleń), b2b-link (żółty)
- formatMessage() obsługuje teraz linki wewnętrzne (/forum/, /news/, /b2b/)
- Badge thinking pokazuje opis jakościowy (np. "dogłębna analiza z weryfikacją")
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Changed AI model from Gemini 2.5 Flash-Lite to Gemini 3 Flash Preview
- Added Gemini 3 models (3-flash, 3-pro) to GEMINI_MODELS config
- Updated GEMINI_PRICING with current 2026 prices
- Updated chat UI: badge, model info modal, specs, timeline
- Benefits: 7x better reasoning, thinking mode, 78% SWE-bench
Cost estimate: ~$40/month at 1000x current usage (Tier 1)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano stałą globalną COMPANY_COUNT_MARKETING w app.py
- Dodano do context_processor jako COMPANY_COUNT
- Zaktualizowano szablony: index.html, chat.html, landing.html, release_notes
- Jedno miejsce do zmiany gdy Izba zaktualizuje cel
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Landing page i chat timeline - cel marketingowy 150 podmiotów
zamiast dynamicznej liczby z bazy (111).
Zmieniono również terminologię:
- "firm członkowskich" → "podmiotów gospodarczych"
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano person_id i profile URL do kontekstu osób w chatbocie
- Zaktualizowano system prompt: OBOWIĄZKOWE linki dla firm i osób
- Dodano CSS dla linków do osób (zielony badge)
- Rozszerzono JavaScript o wykrywanie linków /osoba/
Kolory badge:
- 🏢 Firmy: pomarańczowy (#c2410c)
- 👤 Osoby: zielony (#047857)
- 🔗 Zewnętrzne: niebieski (#1d4ed8)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano overflow: hidden na html i body
- Ukrycie footer na stronie chatu (display: none)
- max-height na main dla pewności
- height: 100% na container
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Nadpisanie .container dla chatu (100% szerokości)
- Main z flex i overflow: hidden
- chat-main z height: 100% i max-height: 100%
- scrollToBottom z requestAnimationFrame dla pewności
- Struktura jak w ChatGPT/Claude
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Użycie scrollIntoView({ block: 'end' }) na ostatniej wiadomości
- Lepsze zachowanie - scroll do widocznego elementu
- Smooth scroll dla lepszego UX
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano flex-shrink: 0 do .chat-header i .chat-input-area
- Dodano overflow: hidden do .chat-main
- Dodano min-height: 0 do .chat-messages (kluczowe dla flexbox overflow)
- Teraz header i input zawsze widoczne, tylko wiadomości się scrollują
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Linki do firm (nordabiznes.pl/company/): pomarańczowe badge'y
- Linki zewnętrzne (www, social, maps): niebieskie badge'y
- JavaScript wykrywa typ linku po URL i dodaje klasę CSS
- Hover effect z cieniem i lekkim uniesieniem
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Linki jako zaokrąglone badge'y z kolorowym tłem
- 4 kolory w rotacji: pomarańczowy, zielony, żółty, różowy
- Delikatny hover effect (ciemniejsze tło)
- Padding i border-radius dla lepszej widoczności
- Białe tło dla linków w wiadomościach użytkownika
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Backend (nordabiz_chat.py):
- Dodano instrukcję w system prompt wymagającą linków markdown
- Nazwy firm: [Firma](URL) - klikalne linki do profilu
- Nazwy osób: **Imię Nazwisko** (link do firmy)
Frontend (chat.html):
- Nowe style dla linków w wiadomościach
- Fioletowy kolor (#7c3aed) dla linków AI
- Hover effect z podkreśleniem
- Oddzielne style dla linków w wiadomościach użytkownika
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Przycisk ▶️ w headerze chatu obok badge'a modelu
- Modal z 40-sekundowym tutorialem wideo z polskim narratorem
- Poster (miniaturka) wideo
- Sekcja "Szybkie wskazówki" pod odtwarzaczem
- Responsywny design dla mobile
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Nowy model ExternalContact z pełnymi danymi kontaktowymi, social media, related_links (JSONB)
- Migracja SQL 020_external_contacts.sql z full-text search
- Routes: /kontakty (lista), /kontakty/dodaj, /kontakty/<id>, /kontakty/<id>/edytuj
- Szablony: lista z filtrami, karta szczegółów, formularz CRUD
- Nawigacja: link "Kontakty zewnętrzne" w dropdown Społeczność
- Poprawka: aktualizacja liczby firm z 80 na 111
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Dodano position: relative i z-index: 50 do .chat-header, aby elementy
dropdown menu użytkownika (z-index: 200) były wyświetlane nad paskiem NordaGPT.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Added regex to convert [text](url) markdown links to <a> tags
- Updated raw URL regex with lookbehind/lookahead to avoid duplicate links
- Links now display as clickable text instead of raw markdown syntax
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Changed AI model from Gemini 2.0 Flash to Gemini 2.5 Flash-Lite
- Added info button next to model badge in chat header
- Created modal with technical specs and development history timeline
- Benefits: 8x longer responses (65k tokens), 4x daily limit (1000 RPD)
- Model remains FREE (Free Tier)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Element emptyState może nie istnieć po załadowaniu poprzedniej rozmowy.
Dodano sprawdzenie if (emptyState) przed ustawieniem style.display.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano API /api/chat/conversations (lista konwersacji użytkownika)
- Dodano API DELETE /api/chat/<id>/delete (usuwanie konwersacji)
- Przebudowano chat.html z sidebarem historii (styl ChatGPT)
- Sidebar z listą konwersacji, przyciski "Nowa rozmowa" i usuwania
- Responsywny design dla mobile (toggle sidebar)
- Integracja ze stylem NordaGPT (purple gradient header)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add comprehensive formatting instructions to AI system prompt
- Update linkifyText() and linkifyNordaGPT() to parse markdown:
- **bold** to <strong>
- Newlines to <br>
- Numbered lists (1. 2. 3.) to <ol>
- Bullet lists (- *) to <ul>
- Add CSS styles for AI response lists
- Fix NordaGPT minimize: banner now pulses and shows active state
- Banner button changes to "Wznów chat" when minimized
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Parse [text](url) Markdown links before plain URL conversion
- Use placeholder approach for cross-browser compatibility
- Prevents double-linkification of URLs in Markdown format
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Email addresses now become mailto: links
- URLs properly strip trailing punctuation (comma, period, etc.)
- Both link types handle trailing punctuation gracefully
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add linkifyText() function to convert URLs to anchor tags
- Apply linkification only to assistant messages (safe XSS handling)
- Add CSS styling for links: blue color, underline, hover effect
- Links open in new tab with noopener noreferrer
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Import Person, CompanyPerson, CompanySocialMedia, GBPAudit models
- Add company people (zarząd, wspólnicy, prokurenci) grouped by company
- Add social media profiles (platform + followers) grouped by company
- Add latest GBP audit scores (completeness, reviews, rating)
- Update system prompt with Stage 3 data descriptions
- Add new prompts for people lookup and GBP audit queries
- Update suggestion chips: "Kto jest prezesem?", "Google opinie?", "Fanów FB?"
AI chat now has access to:
- 80 companies + services + competencies
- Recommendations, News (Stage 1)
- Calendar events, B2B classifieds, Forum topics (Stage 2)
- KRS people, Social Media, GBP audits (Stage 3)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Import Classified, NordaEvent, ForumTopic models
- Add upcoming events (next 60 days) to AI context
- Add active B2B classifieds (non-test) to AI context
- Add recent forum topics (non-test) to AI context
- Update system prompt with new data source descriptions
- Add JSON serialization for all Stage 2 data
- Update suggestion chips: "Kiedy następne spotkanie?", "Kto szuka usług IT?"
AI chat now has access to:
- 80 companies + services + competencies
- Recommendations, News (Stage 1)
- Calendar events, B2B classifieds, Forum topics (Stage 2)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add CompanyRecommendation and ZOPKNews imports to nordabiz_chat.py
- Fetch approved recommendations (last 20) in conversation context
- Fetch approved news from last 30 days (last 10) in context
- Serialize recommendations and news to JSON in AI prompt
- Update system prompt with data format descriptions
- Update chat template header description
- Add new suggestion chips: "Kto poleca firmę..." and "Co słychać..."
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>