Commit graph

26 commits

Author SHA1 Message Date
ijuanes
6282bb9789 fix(i18n): use babel.locale_selector instead of babel.localeselector for Flask-Babel 4.0.0
- Flask-Babel 4.0.0 changed the API
- @babel.localeselector -> @babel.locale_selector
- Remove redundant request import in context processor
- All tests still pass
2026-06-20 10:01:38 +01:00
ijuanes
34dd3ca937 feat(i18n): add Spanish localization support with Flask-Babel
- Add Flask-Babel for internationalization
- Configure app for Spanish (default) and English
- Add language switcher in navigation
- Wrap all UI text in templates with gettext()
- Create translation directory structure
- Add complete Spanish translations (58 strings)
- Add English translations (template)
- Compile .po to .mo files
- Add extract_translations.py script for future updates
- Add compile_translations.py script

Spanish is now the default language, with English available via ?lang=en

Translated strings include:
- Navigation (Home, Add Tablet, Add User, etc.)
- User Loans interface (Search, Filter, Status, etc.)
- Table headers (User, Tablet, Serial Number, etc.)
- Buttons (Loan, Return, Search, etc.)
- Messages (No users found, No active loans, etc.)
- All UI text across all templates
2026-06-20 09:58:13 +01:00
ijuanes
db7e9591e1 fix(ui): handle None result from COUNT query when no users match criteria
- Fix TypeError when cursor.fetchone() returns None
- Handle empty result sets gracefully
- Ensure pagination works with zero results
2026-06-20 08:55:18 +01:00
ijuanes
f5bbb93d59 fix(ui): fix user_loans SQL query with HAVING clause for status filter
- Fix COUNT() misuse in SQLite subquery
- Use HAVING clause for aggregate function filtering (with_loans, no_loans)
- Properly count distinct users for pagination
- Maintain all search and pagination functionality
2026-06-20 08:53:55 +01:00
ijuanes
c9f3382c7c feat(ui): implement HTMX + Tailwind frontend revamp
- Add Tailwind CSS via CDN for modern styling
- Add HTMX for AJAX functionality without full page reloads
- Revamp user_loans interface with:
  - Real-time search (debounced 500ms)
  - Status filtering (all users, with loans, no loans)
  - Pagination (20 users per page)
  - Responsive table design
  - Clean, modern UI with Tailwind classes
- Create user_loans_detail.html for individual user loan history
- Update index.html with Tailwind styling
- Update base.html with Tailwind + HTMX setup
- Add components/user_loans_results.html for HTMX partial updates
- Update app.py user_loans route to support search, filter, pagination
- Add user_loans_detail route for detailed user view

This addresses the issues:
- Navigation overflow (fixed with responsive Tailwind classes)
- Basic look (modern, professional UI)
- User loans UX (fast search, filtering, pagination for 500+ users)
2026-06-20 08:38:42 +01:00
ijuanes
e70738c792 merge: bring master changes to develop branch
This merge brings all recent changes from master to develop:
- Responsive CSS for mobile accessibility
- Navigation overflow fix
- CLI deprecation
- Comprehensive unit test suite (46 tests)
- Documentation (RESPONSIVE_CSS.md, CLI_VS_WEB.md, FRONTEND_OPTIONS.md, MIGRATION_TO_POSTGRES.md)
- Spanish translation requirement note
- Updated README.md and RUNNING.md
- Updated pyproject.toml with pytest config
2026-06-20 08:15:51 +01:00
ijuanes
f08c823dc1 docs: update CLI_VS_WEB.md with deprecation notice
- Add deprecation notice at top of document
- Mark CLI as deprecated throughout
- Add migration path for existing CLI users
- Document database compatibility notes
- Recommend web interface for all operations
2026-06-20 08:05:05 +01:00
ijuanes
ab7b466ce4 deprecate: mark CLI as deprecated, recommend web interface
- Add DEPRECATED notice to minimal_app.py docstring
- Add deprecation warning at startup
- Update README.md to mark CLI as deprecated
- Remove CLI from Quick Start, promote web interface
- Note limited functionality in CLI description

The CLI (minimal_app.py) is now officially deprecated. Users should
use the full-featured web interface (app.py) instead.
2026-06-20 08:03:58 +01:00
ijuanes
e789201942 docs: add CLI vs Web functionality comparison
- Document all differences between CLI and web versions
- Identify missing features in CLI (email, phone, notes fields)
- List database schema mismatches
- Provide code changes required to sync CLI with web
- Include migration strategy and recommendations
2026-06-20 07:51:35 +01:00
ijuanes
5d66ffa1a6 docs(ui): document navigation overflow fix in RESPONSIVE_CSS.md
- Add section for navigation overflow on zoom bug and fix
- Document symptoms, changes, and results
- Keep documentation up to date with all fixes
2026-06-20 01:42:29 +01:00
ijuanes
26b77cf0e9 fix(ui): prevent navigation overflow on zoom and small screens
- Add overflow-x: hidden to body to prevent horizontal scroll on zoom
- Add overflow: hidden to .container to prevent margin overflow
- Ensure .nav a has flex: 1 1 auto and min-width: 120px for proper wrapping
- Fixes issue where navigation buttons overflow through right margin when zoomed in

This ensures the navigation bar wraps properly and doesn't cause horizontal
scrolling or overflow issues on any screen size or zoom level.
2026-06-20 01:41:28 +01:00
ijuanes
3e2e440d06 docs: add Spanish translation requirement note to RESPONSIVE_CSS.md
- Add TOP PRIORITY section for Spanish translation
- Document scope: all templates need translation
- List all files to translate with status
- Provide 3 approach options (direct, Flask-Babel, macros)
- Include English-Spanish translation table
- Note: Do not change code yet - documentation only
- Mark as high priority for future work
2026-06-20 01:32:48 +01:00
ijuanes
dea2f23524 docs(ui): update RESPONSIVE_CSS.md with bug fix documentation
- Document the missing </style> tag bug and fix
- Update file counts and line changes
- Add commit information section
- Reorganize for better readability
2026-06-20 01:28:24 +01:00
ijuanes
28232dbaf9 fix(ui): add missing </style> tag in base.html
The responsive CSS addition was missing the closing </style> tag,
which caused the main page to render as blank. This fix restores
the proper HTML structure.
2026-06-20 01:27:17 +01:00
ijuanes
927c323a6e feat(ui): add responsive CSS for mobile accessibility
- Add mobile-first responsive CSS to base.html
- Wrap all tables in .table-container for horizontal scrolling on mobile
- Add breakpoints for phones (576px), tablets (768px), desktops (992px, 1200px)
- Improve mobile navigation (vertical stack) and form layouts (full-width)
- Add print styles for clean printing
- Update project_management.html editor for mobile
- Document all changes in docs/RESPONSIVE_CSS.md

No backend or JavaScript changes - pure CSS solution.
For 5 internal technical users, this is simpler and more appropriate than
HTMX or SPA approaches. Solves mobile accessibility issue with minimal changes.
2026-06-20 01:20:39 +01:00
ijuanes
531b3a9048 docs: add separated frontend architecture options for mobile support
- Create docs/FRONTEND_OPTIONS.md with comprehensive analysis
- Explore 4 options for separated frontend:
  1. SPA with REST API (React/Vue/Svelte)
  2. Hybrid approach (mobile SPA + desktop server templates)
  3. HTMX for lightweight dynamic UI
  4. Native mobile app (React Native/Flutter/Capacitor)
- Include comparison matrix with pros/cons
- Provide implementation examples for each option
- Add responsive design guidelines
- Include API endpoints specification
- Recommend phased implementation roadmap
- No code changes - documentation only

This addresses mobile responsiveness while keeping backend intact.
2026-06-18 12:13:59 +01:00
ijuanes
1ad0e8bf13 docs: add PostgreSQL migration guide for future scalability
- Add section 9 to TECHNICAL_SPECIFICATIONS.md with:
  - Migration criteria (DB size, connections, users, transactions)
  - Proposed repository pattern architecture
  - Migration steps overview
  - Benefits of PostgreSQL

- Create docs/MIGRATION_TO_POSTGRES.md with comprehensive guide:
  - When to migrate (detailed thresholds)
  - Architecture overview (repository pattern)
  - Step-by-step migration process (10 steps)
  - Complete code examples:
    * Base repository interfaces
    * SQLite implementation
    * PostgreSQL implementation
    * Repository factory
    * Migration script
  - Docker Compose configuration
  - Rollback plan
  - Monitoring and maintenance
  - Performance optimization
  - Troubleshooting guide

This enables future migration when database grows beyond SQLite capabilities.
2026-06-17 17:22:50 +01:00
ijuanes
85978a710f docs: add testing documentation to README and RUNNING.md
- Add Testing section to README with:
  - How to run tests
  - Test structure overview
  - Key edge cases covered
  - Test configuration notes
- Add Running Tests section to RUNNING.md
- Document the 46 unit tests available
2026-06-17 17:10:12 +01:00
ijuanes
83ac67fea2 test: add comprehensive unit test suite
- Add tests/ directory with pytest configuration
- Add conftest.py with database fixtures (test_db, sample data)
- Add test_core.py: 21 tests for core operations (tablet, user, loan CRUD)
- Add test_edge_cases.py: 14 tests for edge cases (duplicates, invalid IDs, etc.)
- Add test_minimal_app.py: 11 tests for actual application functions
- Update pyproject.toml with pytest and coverage configuration
- Total: 46 tests covering core functionality and edge cases

Tests cover:
- Tablet CRUD operations
- User CRUD operations
- Loan/return workflows
- Duplicate prevention (serial numbers, identifications)
- Invalid ID handling
- Already loaned device prevention
- Non-existent loan handling
- Multiple loans per user (one-to-many relationship)
- Non-loanable device CRUD operations

To run: python3 -m pytest tests/ -v
2026-06-17 17:07:20 +01:00
ijuanes
3039363b6b Merge feature/user-loans-search: Non-loanable device management 2026-06-09 23:54:44 +01:00
ijuanes
d3d1fb1b32 feat(non-loanable-devices): implement non-loanable device management
- Add non_loanable_devices table to database schema
- Add web interface routes: /non_loanable_devices, /add_non_loanable_device, /edit_non_loanable_device, /delete_non_loanable_device
- Add CLI menu options 8-10 for non-loanable device management
- Add templates for non-loanable device CRUD operations
- Update README.md with new feature documentation
- Update REQUIREMENTS.md marking non-loanable devices as implemented
- Add gestiontablets.sh script

Implements: #porDefinir Registrar nuevos dispositivos no prestables
2026-06-09 23:54:38 +01:00
ijuanes
ac73e5dc93 docs: add technical specifications document
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-04 23:00:14 +01:00
ijuanes
5fd3aaf4c5 docs: add Spanish requirements document (platform/language agnostic)
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-04 10:12:18 +01:00
ijuanes
e9862f3d8d docs: add version control section to README
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-04 01:00:49 +01:00
ijuanes
ec79bc2ca3 feat(loans): add search and expandable past loans to user loans view
- Add search box to filter by user name, ID, tablet brand/model/serial
- Split loans into Current Loans (always visible) and Past Loans (collapsible)
- Past loans toggle with ▶/▼ indicator showing count
- All searchable data embedded in data-search attributes

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-04 01:00:17 +01:00
ijuanes
8a8d2f02fa Initial commit: Tablet lending system with user-tablet many-to-many relationship
- Database schema: tablets, users, loans (junction table)
- CLI app: minimal_app.py
- Web apps: app.py (Flask), simple_app.py (http.server)
- Features: loan management, search, user loans view, project notes
- Git structure: CONTRIBUTING.md, .gitignore

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-03 10:43:17 +01:00