After refactoring to blueprints, templates still used bare endpoint names
(e.g., url_for('admin_zopk')) instead of prefixed names (e.g.,
url_for('admin.admin_zopk')). While most worked via backward-compat aliases,
api_zopk_search_news was missing from the alias list causing 500 on /admin/zopk.
Fixed 19 template files and added missing alias for api_zopk_search_news.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add user/company/model/custom date range filters to AI usage dashboard
- Add model breakdown section showing per-model usage and costs
- Add company detail page (/admin/ai-usage/company/<id>) with per-user stats
- Add CSV export endpoint respecting all active filters
- Remove unused model-comparison page from navigation and imports
- Remove 20-item limit on user/company rankings (show all)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Allow company owners/employees to edit marketing fields (descriptions,
services, contacts, social media) directly without admin intervention.
Legal fields (NIP, KRS, name) remain admin-only. Per-tab permission
checks with delegated permissions support.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add @rada_member_required decorator for access control
- Add BoardDocument model for storing protocols and documents
- Create document upload service (PDF, DOCX, DOC up to 50MB)
- Add /rada/ blueprint with list, upload, download endpoints
- Add "Rada" link in navigation (visible only for board members)
- Add "Rada" badge and toggle button in admin user management
- Create SQL migration to set up board_documents table and assign
is_rada_member=True to 16 board members by email
Storage: /data/board-docs/ (outside webroot for security)
Access: is_rada_member=True OR role >= OFFICE_MANAGER
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Benefit and BenefitClick models for tracking affiliate offers
- Create /korzysci blueprint with admin-only access (test mode)
- Add admin panel at /admin/benefits for managing offers
- Include WisprFlow as first benefit with branded link ref.wisprflow.ai/norda
- Add QR code support for printed materials
- Track clicks with user attribution and analytics
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement full online membership application workflow:
- 3-step wizard form with KRS/CEIDG auto-fill
- Admin panel for application review (approve/reject/request changes)
- Company data update requests for existing members
- Dashboard CTA for users without company
- API endpoints for NIP lookup and draft management
New files:
- database/migrations/042_membership_applications.sql
- blueprints/membership/ (routes, templates)
- blueprints/admin/routes_membership.py
- blueprints/api/routes_membership.py
- templates/membership/ and templates/admin/membership*.html
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
New admin features:
- Analytics dashboard with stats, charts (Chart.js), user rankings
- CSV export of forum activity with date range
- Topic category move functionality
- Merge multiple topics into one
- Admin search across all posts (including deleted)
- User activity log with stats
New endpoints:
- GET /admin/forum/analytics
- GET /admin/forum/export-activity
- POST /admin/forum/topic/<id>/move
- POST /admin/forum/merge-topics
- GET /admin/forum/search
- GET /admin/forum/user/<id>/activity
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Created blueprints/admin/routes_krs_api.py with 3 routes:
- /admin/krs-api/audit (POST)
- /admin/krs-api/audit/batch (POST)
- /admin/krs-api/pdf/<company_id>
- Updated templates to use new URL paths
- Added endpoint aliases for backward compatibility
- Removed ~420 lines from app.py (8150 -> 7729)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Created blueprints/public/routes_zopk.py with 3 public routes:
- /zopk (zopk_index)
- /zopk/projekty/<slug> (zopk_project_detail)
- /zopk/aktualnosci (zopk_news_list)
- Added endpoint aliases for backward compatibility
- Removed ZOPK public routes from app.py
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Templates use url_for('admin_zopk') but blueprint endpoints are
'admin.admin_zopk'. Added aliases in blueprints/__init__.py.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Created routes_model_comparison.py with model comparison functionality
- Updated base.html to use full blueprint name
- Added aliases for backward compatibility
- Commented old routes in app.py with _old_ prefix
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Added admin_ai_usage and admin_ai_usage_user to routes_analytics.py
- Updated templates to use full blueprint names (admin.admin_ai_usage)
- Added aliases for backward compatibility
- Commented old routes in app.py with _old_ prefix
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create new blueprints/admin/routes_analytics.py (~350 lines)
- Move admin_analytics and admin_analytics_export routes
- Update templates to use full blueprint names
- Add endpoint aliases for backward compatibility
Phase 6.2b - Analytics dashboard
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add api_ai_learning_status and api_chat_stats to routes_insights.py
- Update chat_analytics template to use new API path
- Add endpoint aliases for backward compatibility
Phase 6.2b - AI API routes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create new blueprints/admin/routes_insights.py
- Move 5 insights routes (dashboard + API endpoints)
- Update template to use new /admin/insights-api/* paths
- Add endpoint aliases for backward compatibility
Phase 6.2b - Insights routes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create new blueprints/admin/routes_announcements.py
- Move 6 announcements routes to blueprint
- Update templates to use full blueprint names
- Add endpoint aliases for backward compatibility
Phase 6.2d - Announcements routes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Move IT audit dashboard route to blueprints/admin/routes_audits.py
- Add ITAudit, ITCollaborationMatch imports
- Update base.html template to use full blueprint name
- Add endpoint alias for backward compatibility
Phase 6.2f continued
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Move routes from app.py to blueprints/admin/routes_audits.py
- Add endpoint aliases for backward compatibility
- Update base.html template to use full blueprint names
- Comment old routes in app.py with _old_ prefix
Phase 6.2f of blueprint migration
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Przeniesiono 2 trasy do blueprints/admin/routes_social.py:
- admin_social_media (analytics dashboard)
- admin_social_audit (audit dashboard)
Zaktualizowano szablony:
- base.html, dashboard.html, social_audit_dashboard.html
Dodano aliasy dla kompatybilności wstecznej.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Przeniesiono 9 tras do blueprints/admin/routes_status.py:
- admin_status, api_admin_status
- admin_health, api_admin_health
- debug_panel
- api_get_logs, api_logs_stream, api_clear_logs, api_test_log
Zaktualizowano szablony na pełne nazwy blueprintów:
- base.html: admin.admin_status, admin.admin_health
- health_dashboard.html: admin.admin_status
Dodano aliasy dla kompatybilności wstecznej.
Stare trasy w app.py oznaczone jako _old_* (do usunięcia po weryfikacji).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Dodano aliasy w blueprints/__init__.py dla admin_seo i admin_gbp_audit
- Poprawiono url_for('chat_analytics') na url_for('chat.chat_analytics')
(trasa już jest w blueprincie chat)
Minimalne, bezpieczne zmiany zgodne z metodologią.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Nowy blueprint /edukacja z materiałami szkoleniowymi
- Link "Edukacja" w menu (tylko dla zalogowanych)
- Strona placeholder z listą przyszłych materiałów
- Dostęp wymaga logowania (@login_required)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>