Commit Graph

430 Commits

Author SHA1 Message Date
22ff4d901a docs: Add Polish category translation to release notes v1.14.0
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 11:46:03 +01:00
66fe43081e fix: Add Polish characters to release notes v1.11.0-v1.14.0
- Fix missing Polish diacritics (ą, ę, ó, ś, ć, ł, ż, ź)
- Affected versions: v1.11.0, v1.12.0, v1.13.0, v1.14.0

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 11:40:38 +01:00
c4d6f12840 fix: Translate Google Place types to Polish in GBP audit
- Add comprehensive GOOGLE_TYPES_PL dictionary with 200+ type translations
- Update _check_categories() to use Polish translations
- Fallback to formatted English if translation not available
- Categories like "car_repair" now display as "Warsztat samochodowy"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 10:22:39 +01:00
f28ea804d2 docs: Add release notes v1.14.0 - Audit improvements
New features:
- GBP audit: Educational section explaining Google Business Profile
- GBP audit: Direct link to Google Maps business listing
- GBP audit: Full audit with Places API for 40 companies
- Clickable audit banners linking to detail pages
- Inline audit sections on company profile

Improvements:
- Unified 5-level color scale for all audits
- Social Media score as percentage
- URL normalization for company websites

Fixes:
- ZOPK stakeholder duplicates removed
- Unique constraint to prevent future duplicates
- SEO score consistency between views

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 10:05:49 +01:00
df9ac2a1e5 feat: Add educational section about Google Business Profile to GBP audit page
Explains the relationship between:
- Google Search Knowledge Panel
- Google Maps business listing
- Google Business Profile management

Helps business owners understand that both views show the same data
and how to manage their profile at business.google.com

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 10:01:52 +01:00
c3d86c996a fix: Add unique constraint on ZOPKStakeholder.name to prevent duplicates
- Added UniqueConstraint on 'name' column
- Constraint already applied to production database
- Prevents duplicate stakeholder entries in the future

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 09:52:33 +01:00
6f17ef5dfd fix: Generate Google Maps URL from place_id when google_maps_url is missing
- Template now uses google_place_id to generate Maps URL if google_maps_url is empty
- gbp_audit_service.py now copies google_maps_url from website_analysis

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 23:41:44 +01:00
772d4e7453 feat: Add link to Google Business Profile from GBP audit page
Adds 'Zobacz wizytowke Google' button in header-actions section
that links directly to the company's Google Business Profile.
Button only shows when google_maps_url is available.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 23:37:48 +01:00
b06db9cb60 fix: Update CSS classes to match unified color scale
Updated CSS class definitions in all 4 audit templates to use
the same 5-level color scale as inline styles:
- .score-excellent: #10b981 (green, 90-100%)
- .score-good: #84cc16 (lime, 70-89%)
- .score-average: #f59e0b (amber, 50-69%)
- .score-needs-work: #f97316 (orange, 30-49%)
- .score-poor: #ef4444 (red, 0-29%)

This ensures consistency between company profile banners
and detailed audit page score circles/text.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 23:28:30 +01:00
18939afc7e feat: Unified 5-level color scale for all audits
Implemented consistent color scale across all audit types:
- 90-100%: Green (#10b981) - Doskonaly
- 70-89%: Lime (#84cc16) - Dobry
- 50-69%: Amber (#f59e0b) - Przecietny
- 30-49%: Orange (#f97316) - Wymaga poprawy
- 0-29%: Red (#ef4444) - Slaby

Updated files:
- company_detail.html: All 4 audit banners (SEO, GBP, Social, IT)
- seo_audit.html: Score circle colors
- gbp_audit.html: Score circle colors
- social_audit.html: Score circle colors
- it_audit.html: Score circle colors

This ensures visual consistency between company profile cards
and detailed audit pages.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 23:24:06 +01:00
337994ed3a fix: Social Media score as percentage, SEO score consistency
- Changed Social Media audit banner to show percentage score (e.g., 16%)
  instead of platform count, matching the detailed audit page
- Fixed SEO score inconsistency by sorting website_analysis query by
  seo_audited_at desc (same as seo_audit_dashboard)
- Both audit sections on company profile now show same values as
  their detailed pages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 23:18:50 +01:00
1fd056255d feat: Make audit score banners clickable links to detailed pages
- GBP Audit banner links to /audit/gbp/<slug>
- SEO Audit banner links to /audit/seo/<slug>
- Social Media banner links to /audit/social/<slug>
- IT Audit banner links to /audit/it/<slug>
- Added hover effects and chevron icon for visual feedback

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 23:14:40 +01:00
986360f7d5 feat: Add URL normalization and inline audit sections
- Add normalize_social_url() function to database.py to prevent
  www vs non-www duplicates in social media records
- Update update_social_media.py to normalize URLs before insert
- Update social_media_audit.py to normalize URLs before insert
- Add inline GBP Audit section to company profile
- Add inline Social Media Audit section to company profile
- Add inline IT Audit section to company profile

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 23:07:03 +01:00
91fea3ba2c security: Fix critical vulnerabilities in ZOP Kaszubia module
- Fix XSS: innerHTML → textContent for modal messages
- Fix XSS: Safe DOM element creation for toast notifications
- Add project_id validation in admin_zopk_news_add
- Add URL protocol validation (allow only http/https)
- Hide exception details from API responses (log instead)
- Add rate limiting (60/min) on public ZOPK routes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 21:07:13 +01:00
9a527febf3 fix: Use direct color values for action buttons (--danger was undefined) 2026-01-11 15:56:46 +01:00
bf7cb6a76b fix: Add table wrapper for horizontal scroll - show Odrzuć button 2026-01-11 15:52:34 +01:00
26e6658e6d fix: Ensure Odrzuć button is visible in ZOP Kaszubia news table 2026-01-11 15:49:30 +01:00
c9bde4f67d docs: Update release notes - ZOP Kaszubia rename 2026-01-11 15:45:18 +01:00
200987b295 refactor: Rename ZOPK to ZOP Kaszubia in user-facing text
- Update navigation menu labels
- Update page titles and headings
- Update modal texts and notifications
- Keep internal class names (ZOPKNews, etc.) unchanged

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 15:41:18 +01:00
95fd89575d chore: Add KRS PDFs and CEIDG JSON to gitignore 2026-01-11 15:36:15 +01:00
c67b6dcab3 docs: Update release notes v1.13.0 - logos and hidden events
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 15:34:24 +01:00
3f9273cff6 feat: Add company logos to search results, hide events section
- Add company logo display in search results cards
- Make logo clickable (links to company profile)
- Temporarily hide "Aktualności i wydarzenia" section on company profiles
- Add scripts for KRS PDF download/parsing and CEIDG API

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 15:32:53 +01:00
3e8700f98f docs: Add v1.13.0 release notes - Mapa Powiazan and person profiles
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 15:24:43 +01:00
3052f8dd5b fix: Import or_ and func from sqlalchemy in person search 2026-01-11 15:19:01 +01:00
6e133686b7 feat: Add person search to main search - partial name matching
- Search people by imiona/nazwisko with partial match (ILIKE)
- Display person cards with avatar, name, company count
- Show "Znaleziono X firm i Y osób"
- People section appears above companies if matches found

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 15:17:50 +01:00
4705f67d71 feat: Make person names clickable in company Zarząd i Wspólnicy section
Links to /osoba/<id> profile page with hover effect and chevron icon

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 15:15:38 +01:00
7b870b76ec fix: Count unique companies not roles in person profile subtitle
"Powiazany z 6 firmami (9 rol)" instead of "Powiazany z 9 firmami"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 15:08:22 +01:00
b70477553f fix: Use User.name instead of User.full_name in person detail
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 14:17:09 +01:00
807e554832 feat: Person profile page and improved tooltip
- New /osoba/<id> route for person detail page
- Shows company roles with links to company pages
- Displays portal data (email, phone) if user has account
- Tooltip shows all company connections (no "4 wiecej" limit)
- Click on person node navigates to profile instead of filtering

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 14:16:05 +01:00
b29071ab84 fix: Correct company count in connections map - count unique companies not roles
- API: Count unique company_ids instead of all roles
- Tooltip: Show "X firmami (Y ról)" to distinguish companies from roles
- Bogdan Łaga has 6 unique companies with 9 roles (was showing 9 companies)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 14:13:56 +01:00
c7a46c5ada feat: Add /api/connections endpoint and people in company detail
- API endpoint for connections graph visualization
- Include Person/CompanyPerson data in company profile
- Support for Zarząd, Wspólnicy, Prokurenci, JDG relationships

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 14:10:04 +01:00
99b44d6ccd feat: Mapa Powiązań - modal fullscreen z filtrami i licznikami
- Fullscreen modal z panelem filtrów (zamiast osobnej strony)
- Filtry węzłów: Firmy, Osoby (checkboxy)
- Filtry powiązań: Zarząd, Wspólnicy, Prokurenci, JDG (checkboxy)
- Liczniki przy każdym filtrze (aktualizowane na bieżąco)
- Wyszukiwarka z autocomplete
- Etykiety ukryte domyślnie, widoczne przy hover
- D3.js v7 do wizualizacji grafu

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 14:09:08 +01:00
7761dcbaf3 fix: Add missing Polish diacritics in forum templates
Fixed missing Polish characters (ą, ć, ę, ł, ń, ó, ś, ź, ż) in:
- index.html: tematów, Przypięty, Zamknięty, wyświetleń, Bądź, Utwórz
- new_topic.html: Utwórz, dyskusję, członkami, zwięźle, znaków, szczegółów, Treść, Załącznik, Przeciągnij, Możesz, wkleić, Usuń
- topic.html: Przypięty, Zamknięty, wyświetleń, Bądź, zamknięty, można, dodawać, odpowiedź, Wyślij, Przeciągnij, plików, możesz, wkleić, Usuń, duży

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 11:14:14 +01:00
13ee367509 feat: AI learning from feedback + v1.12.0
AI Learning System:
- Add FeedbackLearningService for few-shot learning from user feedback
- Integrate learning context into chat prompts (nordabiz_chat.py)
- Add seed examples for cold start (when insufficient real feedback)
- Add /api/admin/ai-learning-status endpoint
- Add learning status section to chat analytics panel

Other Changes:
- Update release notes to v1.12.0
- Remove old password references from documentation (CLAUDE.md)
- Fix password masking in run_migration.py (use regex for any password)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 10:51:08 +01:00
6e00291a88 feat: AI usage user details + styled modals across app
- Add /admin/ai-usage/user/<id> route for detailed AI usage per user
- Add ai_usage_user.html template with stats, usage breakdown, logs
- Make user names clickable in AI usage dashboard ranking
- Replace all native browser dialogs (alert, confirm) with styled modals/toasts:
  - admin/fees.html, forum.html, recommendations.html, announcements.html, debug.html
  - calendar/admin.html, event.html
  - company_detail.html, company/recommend.html
  - forum/new_topic.html, topic.html
  - classifieds/view.html
  - auth/reset_password.html

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 10:30:35 +01:00
421d7c8e89 fix: Pass user_id to Gemini for AI cost tracking
ZOPK news evaluation now properly attributes AI token usage
to the user who triggered the evaluation. This enables:
- Per-user cost tracking in AI monitoring dashboard
- User rankings by AI token consumption
- Company-level cost aggregation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 09:41:34 +01:00
b21b3739d7 fix: Strip HTML tags from news description display
Use Jinja2 striptags filter to remove HTML from news.description
before displaying in ZOPK news cards. Prevents raw HTML like
<a href="..."> from showing as text.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 09:39:08 +01:00
e8f479ff2f feat: Replace native dialogs with styled modals in ZOPK admin
- Add universal confirm/alert modal system with custom styling
- Add toast notifications for success/error feedback
- Replace all confirm(), alert(), prompt() with showConfirm/showToast
- Support for custom icons, titles, input fields
- Matches existing UI design patterns

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 09:17:45 +01:00
538957875d fix: Use User.name instead of first_name/last_name
User model has single 'name' field, not separate first/last name fields.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 08:57:31 +01:00
684235ad2a fix: AI monitoring dashboard bug fixes
- Fix type_labels keys to match actual feature names (ai_chat, zopk_news_evaluation)
- Fix SQLAlchemy query syntax (remove invalid .options())
- Add null safety for daily_history values in template

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 08:55:59 +01:00
3e77ffd206 feat: Add user/company rankings and period filters to AI dashboard
- Add period filter buttons (day/week/month/all)
- Add user ranking table with name, company, requests, tokens, cost
- Add company ranking table with unique users and costs
- Show user names in recent logs
- Add all-time statistics
- Rankings filtered by selected period

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 08:35:00 +01:00
3bbe2a36dd feat: Add Monitoring AI link to admin menu
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 08:25:36 +01:00
18ac0218d0 fix: Correct dashboard endpoint name in AI usage template
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 08:22:25 +01:00
bfe1cd897c feat: Add AI usage monitoring dashboard
- Add AIUsageLog, AIUsageDaily, AIRateLimit models to database.py
- Update gemini_service.py to log to new AIUsageLog table
- Create /admin/ai-usage dashboard with stats and charts
- Show daily/weekly/monthly requests, tokens, costs
- Track usage by type (chat, news_evaluation, etc.)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 08:21:07 +01:00
340e39515f feat: Add AI usage tracking migration
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 08:17:06 +01:00
3934cdf0ee fix: Improve AI evaluation UX - auto-reload and clear messaging
- Add auto-reload after successful evaluation (2s delay)
- Show 'Odświeżam stronę za 2 sekundy...' message
- Change button text to 'AI pracuje...' during processing
- Update progress text to 'AI dodaje gwiazdki...'
- Fix error state button labels to include AI prefix
- Ensures user knows what's happening at all times

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 08:10:15 +01:00
6ab71ea54b fix: Make AI usage explicit in button labels
- Change 'Oceń X nowych' to 'AI: Oceń X'
- Change 'Dodaj gwiazdki' to 'AI: Dodaj gwiazdki'
- Add 🤖 icon to both buttons
- Add tooltips explaining Gemini AI will be used
- Critical for transparency when AI is involved

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 08:04:17 +01:00
5924f4d298 fix: Clarify AI evaluation button - show count of unevaluated items
- Change label from 'Oceń przez AI' to 'Oceń X nowych'
- Add tooltip explaining what the button does
- Makes it clear that only unevaluated items will be processed

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 08:03:20 +01:00
56da154442 fix: Make 'Nieocenione' filter clickable in ZOPK dashboard
- Change info-only div to clickable link with warning style
- Add ai_not_evaluated filter to show items where ai_relevant is NULL
- Consistent UX with other filter cards

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 08:01:39 +01:00
87d18b65ed feat: Add re-evaluation function for 1-5 star scores
- Add reevaluate_news_without_score() to upgrade old binary evals to stars
- Add /admin/zopk/news/reevaluate-scores endpoint
- Add ai_missing_score stat to dashboard
- Add 'Dodaj gwiazdki' button in dashboard UI
- JS function with progress modal and auto-reload

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 07:53:58 +01:00