Commit Graph

1998 Commits

Author SHA1 Message Date
95b7aedcf3 fix: Poprawiono wyświetlanie pełnych nazw użytkowników w Analytics (word-wrap) 2026-01-14 06:26:04 +01:00
85231ad299 fix: Zwiększono szerokość kolumny użytkownika w Analytics (280px) 2026-01-14 06:23:50 +01:00
028dfb3f05 fix: Naprawiono ucinanie nazw użytkowników w Analytics 2026-01-14 06:20:30 +01:00
5cc3d291ff fix: Naprawiono błąd dzielenia None w analityce użytkowników 2026-01-14 06:00:07 +01:00
d82dc0caec feat: Add user edit functionality in admin panel
- Add /admin/users/<id>/update endpoint to update name, email, phone
- Add edit button with pencil icon to users table
- Add edit modal with form fields
- Add JavaScript functions for edit modal handling
2026-01-13 21:17:34 +01:00
6b7046bf49 feat: Add user analytics link to admin menu 2026-01-13 19:47:42 +01:00
f3433d28f5 fix: Add CSRF exempt for analytics API endpoints 2026-01-13 19:46:29 +01:00
986fa457cc fix: Correct redirect endpoint in analytics error handler 2026-01-13 19:43:26 +01:00
cddbf11e3b fix: Correct back link endpoint in analytics dashboard 2026-01-13 19:42:32 +01:00
a148d464af feat: Add user analytics panel (/admin/analytics)
- Track user sessions, page views, clicks
- Measure engagement score and session duration
- Device breakdown (desktop/mobile/tablet)
- User rankings by activity
- Popular pages statistics
- Recent sessions feed
- SQL migration for analytics tables
- JavaScript tracker for frontend events

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 19:40:37 +01:00
847ec1f12f fix: Correct JSON path for SEO audit scores in batch progress
Frontend was reading data.data.seo_score but API returns
data.seo_audit.pagespeed.seo_score. Fixed path to show
actual scores instead of dashes in batch audit progress.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 19:07:19 +01:00
ab668acf84 fix: Increase SEO audit rate limit from 10/hour to 200/hour
Batch SEO audit was stopping after 10 companies due to
restrictive rate limit. Increased to 200/hour to allow
full batch processing of all companies.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 19:00:53 +01:00
feb57e001b fix: Increase login rate limit from 5/hour to 30/minute - critical fix for user access 2026-01-13 18:52:35 +01:00
153b0489d8 debug: Add permission check logging for AI enrichment 2026-01-13 18:48:01 +01:00
cf31842287 feat: Add web search to AI enrichment
- Search Brave API for company news and web results
- Fetch company website content with BeautifulSoup
- Combine all sources (database, Brave, website) in AI prompt
- Return source usage info in API response
2026-01-13 18:36:52 +01:00
fdbe2d461b fix: Add missing time module import for AI enrichment 2026-01-13 18:32:41 +01:00
be57f1ba04 fix: Remove non-existent Company attributes (keywords, usp, values)
- keywords, usp fields don't exist in Company model
- values -> core_values
2026-01-13 18:30:36 +01:00
a4515aca74 fix: Correct Company model attribute names in AI enrichment endpoint
- services_text -> services relationship or services_offered
- competencies_text -> competencies relationship
- pkd_text -> pkd_description
- certifications field properly handled as relationship
2026-01-13 18:28:48 +01:00
59c50e0267 fix: Handle None values in SEO audit result extraction
Bug: When page fetch fails (SSL error), result['onpage'] is None.
Using dict.get('key', {}) returns None when key exists with None value.

Fix: Use 'or {}' pattern to handle both missing keys and None values.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 18:20:19 +01:00
d722fdb71e feat: Add detailed progress modal for AI enrichment
- New modal with animated progress bar and percentage
- Step-by-step log showing:
  - Initialization
  - Data collection
  - AI prompt preparation
  - Gemini API call
  - Response parsing
  - Results summary (services, USPs, tags, etc.)
- Cancel button with AbortController support
- Success/error states with appropriate icons
- Footer with "Close" and "Refresh page" buttons

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 18:12:04 +01:00
35d53665e3 feat: Add AI enrichment button on company profile
- Add "Wzbogac dane AI" button visible to all users
- Button enabled only for admins and company owners
- New API endpoint POST /api/company/<id>/enrich-ai
- Integrates with Gemini AI to generate:
  - Business summary
  - Services list
  - Target market
  - Unique selling points
  - Company values
  - Certifications
  - Industry tags
- Rate limited to 5 requests/hour per user
- Results saved to CompanyAIInsights table

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 18:07:52 +01:00
a916b297c7 feat: Add progress bar for batch SEO audit
- Progress section with bar and percentage
- Real-time log showing each company being processed
- Score display with color indicators (🟢🟡🔴)
- Cancel button to stop audit mid-process
- Summary at the end with success/failed/skipped counts
- 500ms delay between requests to avoid API overload

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 17:55:17 +01:00
0d2b26031d fix: Extract all PKD codes from KRS PDF (not just main one)
- Rewrite PKD extraction to find all codes in the section
- Primary regex finds PKD section first, then extracts codes
- Fallback regex for edge cases
- Deduplicate PKD codes (same code may appear in different 'wpis')
- Clean up multi-line descriptions
- LENAP now shows 33 PKD codes (was showing only 1)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 17:51:31 +01:00
5ded53a2c0 feat: Display all PKD codes on company detail page
- Show all PKD codes from KRS audit (not just main one)
- Primary PKD highlighted with 'GŁÓWNY' badge
- Secondary PKDs listed below with descriptions
- Fallback to CEIDG data if no KRS audit data
- Shows source (eKRS or CEIDG) and total count

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 17:46:35 +01:00
4e4b3f4ef0 feat: Add sortable columns and PKD display in KRS Audit panel
- All columns now sortable (click header to sort asc/desc)
- PKD codes displayed with primary code highlighted (★)
- Show first 2 PKD codes, click '+N more' for tooltip with all
- Backend returns full PKD codes list instead of just count

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 17:28:09 +01:00
bd23238c1a fix: Increase rate limit and add missing fields to KRS audit API
- Increase rate limit from 20/hour to 200/hour for batch operations
- Add nip, regon, liczba_udzialow, prokurenci_count to API response

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 17:16:16 +01:00
b26dafa0f1 fix: Fix company name selector in batch audit 2026-01-13 17:12:55 +01:00
492a7ea0eb feat: Improve batch KRS audit with detailed progress
- Process companies one by one with real-time progress
- Show detailed info for each company:
  - NIP, REGON
  - Kapitał, udziały
  - Zarząd, wspólnicy, prokurenci
  - PKD count
- Add data-company-id attribute to table rows
- Style improvements for log entries

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 17:11:06 +01:00
a2f9025aad feat: Add progress bar with stages for single KRS audit
Shows visual progress:
- Wyszukiwanie pliku PDF
- Pobieranie danych z PDF
- Parsowanie odpisu KRS
- Zapisywanie do bazy
- Wyniki z szczegółami

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 17:07:37 +01:00
fa8645dc26 fix: Handle date objects in JSON serialization for KRS audit
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 17:05:14 +01:00
3069a232ca fix: Convert Decimal to float for JSONB serialization in KRS audit
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 17:01:02 +01:00
a909af4754 fix: Add missing Path import for KRS audit
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 16:57:58 +01:00
f323b9a90d fix: Add KRS Audit link to admin menu
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 16:50:51 +01:00
de52e6991c feat: Add KRS Audit panel with full PDF parsing
- New admin panel /admin/krs-audit for KRS data extraction
- Full PDF parser extracting: company data, capital, shares, PKD codes,
  management board, shareholders, procurators, financial reports
- API endpoints for single/batch audits and PDF download
- Company profile shows "Odpis PDF" button and last audit date
- Database migration for krs_audits, company_pkd, company_financial_reports

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 16:46:54 +01:00
11c49ad937 refactor: Reorder company profile sections
Move sections to new order:
1. Zarząd i Wspólnicy (people info first)
2. Właściciel JDG
3. Informacje prawne i biznesowe
4. Dane kontaktowe (contact info last)
5. Social Media

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 16:20:51 +01:00
abe1cd38a1 feat: Add PKD codes and CEIDG owner data to company profiles
- Add pkd_code, pkd_description columns for business activity classification
- Add business_start_date column from CEIDG
- Add owner_first_name, owner_last_name for JDG companies
- Create import script scripts/import_ceidg_to_db.py
- Add PKD card display in company profile template
- Add owner section for JDG companies without KRS
- Track SQL migrations in git (database/migrations/*.sql)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 16:07:03 +01:00
93695209d0 feat: Green badge for verified persons, blue for unverified
- Verified (has person_id): green background, clickable
- Unverified (no person_id): blue background, not clickable

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 15:09:51 +01:00
f174f4d4da feat: Link Users to Persons (KRS data)
- Add person_id column to users table
- Template shows person profile link when person_id exists
- Add script to match and link users to persons by name

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 15:07:02 +01:00
1207a188f5 feat: Make person badge clickable (links to company profile)
- Person with company: both badges link to company profile
- Person without company: non-clickable badge
- Added hover effects for person badge

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 15:03:11 +01:00
6593236547 fix: Use correct endpoint company_detail_by_slug
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 15:00:55 +01:00
158c305f09 feat: Clickable attendee badges in calendar events
- Person badge: blue background with user icon
- Company badge: red/pink background, clickable link to company profile
- Hover effects on company badge
- Applied system-wide to all calendar events

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 14:57:11 +01:00
709c20c48e fix: AI response precision and list formatting
- Add explicit instruction to give EXACT number requested
- Change list format to single-line items (prevents numbering reset)
- Show correct vs incorrect format examples in prompt

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 14:55:06 +01:00
d3f773c403 feat: Improve AI response formatting and NordaGPT minimize
- 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>
2026-01-13 14:51:45 +01:00
91e42dd668 fix: Make entire NordaGPT banner clickable with hover effect
- Entire banner is now clickable (onclick on div)
- Added hover effect (translateY, shadow, brightness)
- Changed input/button to spans for cleaner click handling
- Fixed title element ID reference

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 14:41:50 +01:00
e87c0556f8 fix: Use correct API endpoints for NordaGPT chat
- Step 1: POST /api/chat/start to create conversation
- Step 2: POST /api/chat/<id>/message to send messages
- Fixed response field from 'response' to 'message'

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 14:40:42 +01:00
f84f821f3c feat: Add NordaGPT chat banner on homepage
- Purple-themed banner similar to event banner style
- Click to expand to fullscreen chat modal
- Minimize button returns to banner (shows "Chat aktywny")
- Close button resets chat
- Uses existing /api/chat endpoint
- Typing indicator animation
- Link/email auto-linking in responses
- Escape key minimizes, click outside minimizes
- Only visible for authenticated users

Also includes SEO audits in AI context (from previous work)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 14:38:56 +01:00
3bcff9a2d3 feat: Add SEO audits (PageSpeed) to AI chat context
- Import CompanyWebsiteAnalysis model
- Query PageSpeed scores: SEO, performance, accessibility, best practices
- Add SEO audits description to system prompt
- Include website URLs and profile links
- AI can now answer questions about website SEO scores

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 14:33:12 +01:00
1894272670 fix: Handle Markdown link syntax in AI chat responses
- 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>
2026-01-13 14:19:18 +01:00
c0fa157c09 feat: Add links to AI chat context (GBP, social media, company profiles)
- GBP audits: added maps_url (Google Maps) and profile_url
- Social Media: added url field for each platform
- Companies: added profile link to nordabiznes.pl
- Updated AI instructions to always include links in responses

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 14:05:00 +01:00
83b52a1b24 feat: Add clickable email addresses and fix URL trailing punctuation in AI chat
- 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>
2026-01-13 13:41:23 +01:00