Replace browser prompt()-based editing with proper Bootstrap 5 modal
dialogs for testimonials, services, FAQs, and leads. This provides
better UX with form validation, structured input fields, and i18n
support (ES/RU) instead of raw prompt dialogs.
- Add testimonialModal, serviceModal, faqModal, leadModal to admin.html
- Add show*/save* methods in admin.js for each entity type
- Wire leads.html 'Add lead' button to leadModal
- Add modal JS modules (FAQModal, LeadModal, ServiceModal)
- Add unit and e2e tests for modals and API client
1. Replace serveStatic with Bun.file() to fix Content-Length: 0 bug
that caused Nginx to wait 12-30s per file.
2. Add section loader (spinner + 'Cargando...') while sections load.
3. Add AbortController to cancel previous fetch when switching menus.
4. Add credentials: 'same-origin' to ensure cookies are sent.
5. Add error handling for empty responses and HTTP errors.
Fixes: admin panel empty sections, 30s menu load, DOMException aborts.
Refs: production server tenerifeprop.es
- admin.html: removed conflicting inline script, added api.js + admin.js
- admin.js: dynamic section loader with fetch, init navigates to hash
- api.js: credentials: 'include' for all admin requests
- propertyModal: added name attributes to all form fields, saveProperty onclick handler
- server/index.ts: added POST /api/analytics/event with daily aggregation
- server/validation.ts: removed min(6) from password for 401 on invalid credentials
- capability-index.yaml: added 11 MCP capability routes
- docker-compose-mcp.yml: created for MCP servers
- Removed duplicate main-wrapper div that caused large gap
- Changed topbar from sticky to fixed position
- Topbar now stays at top across all section loads
- Added margin-top to page-content to account for fixed topbar
- Updated sidebar toggle to also move topbar position
- Layout: sidebar (fixed) | topbar (fixed) | content (scrollable)
- Removed invalid chart.min.css link (Chart.js 4.x has no separate CSS)
- Fixed DataTables initialization:
- leadsTable: 7 columns, sort by date (column 3), no pagination
- fullLeadsTable: 10 columns, sort by date (column 6), with pagination
- Tables initialized separately to avoid column index mismatch
- Fixed Uncaught TypeError: aDataSort undefined
- Added overflow-x: hidden to .page-content
- Added max-width: 100% and overflow-x: hidden to .page-section
- This prevents FAQ accordion from overflowing outside content area
- FAQ now properly contained within right content panel
- Removed all custom .accordion styles that were causing layout issues
- FAQ now uses Bootstrap 5 default accordion styling
- Structure matches original exactly (no extra wrappers)
- FAQ is inside page-content > section-faq > accordion
- 5 FAQ questions with proper formatting
- No overflow issues with default Bootstrap styles
- Removed row > col-12 > card wrapper that was causing FAQ to overflow
- FAQ accordion now directly inside section, matching original structure
- Same pattern as Services section (direct children of section)
- Maintained 5 FAQ questions with proper styling
- Added card wrapper with proper padding for FAQ accordion
- Added 3 more FAQ questions (total 5):
- ¿Necesito cuenta bancaria española?
- ¿Cuánto tiempo tarda el proceso de compra?
- ¿Qué es el NIE y cómo lo obtengo?
- Added proper accordion styles:
- Rounded corners with box-shadow
- Proper spacing and colors
- Hover states for buttons
- Primary color for expanded items
- Centered accordion content
- Added fw-medium class to question text
- Added event.stopPropagation() to action buttons
- leadsTable (dashboard): 6 columns, sort by date (column 3)
- fullLeadsTable (leads section): 9 columns with checkbox, sort by date (column 6)
- Fixed JavaScript error from wrong column index
- Added separate initialization for each table
- Fixed DataTables order column index (was 6, table has 6 columns 0-5)
- Changed order to [[3, 'desc']] for date column
- Removed invalid chart.min.css link (Chart.js 4.x has no separate CSS)
- Changed loadDashboardData call to window.loadDashboardData
- Changed 'let charts = {}' to 'window.charts = {}'
- Replaced all 'charts.' references with 'window.charts.'
- This fixes charts not updating because the variable was scoped inside jQuery ready
- Now loadDashboardData can access charts after auth check
- Add propertyTypes to analytics/charts endpoint
- Make loadDashboardData globally accessible
- Call loadDashboardData after auth check
- Charts now properly update with real data:
- Performance chart (views/leads per month)
- Leads status chart
- Property types by city chart
- Traffic sources chart
- Top 5 properties chart
- Replace all /login.html redirects with /login in admin.html
- Remove /login.html route from server
- Update dashboard charts to load real data from API
- Add initCharts() and loadDashboardData() functions
- Remove static chart data and use dynamic API data
- Update stats counters to animate with real values
- Change redirect from /login.html to /login in admin.html
- Add /login.html route in server for backward compatibility
- Both /login and /login.html now serve the same login page
The HTML files had malformed footer with duplicate script tags:
- </html> followed by empty <script></script> and navigation.js
- navigation.js exports switchLanguage with location.reload()
- This overwrites the inline switchLanguage function
- On page load, switchLanguage() → location.reload() → infinite loop
Removed duplicate footer from all HTML files.
- Restored full inline styles (~3100 lines CSS) that were lost during CSS extraction
- Removed malformed outer HTML wrapper
- Cleaned up indentation and formatting
- All styles now embedded directly in HTML for proper rendering
- Button styles, navbar, hero section, all components restored
- Fixed MIME type errors for CSS/JS in property/admin pages by adding redirect routes
- Updated HTML files to use absolute paths (/css/, /js/) instead of relative (css/, js/)
- Added redirect handlers for SPA static files to main static folders
- Preserved SPA functionality while fixing styling issues
- Set up project architecture with TypeScript types
- Create property, user, lead, and content type definitions
- Add i18n translations (ES, RU)
- Add sample JSON data for properties and leads
- Create comprehensive architecture documentation
- Set up package.json with Bun + Hono stack