Commit graph

10 commits

Author SHA1 Message Date
ijuanes
2959cd5299 Student data import implementation: added tables, migration, import script, tests, and documentation. 2026-06-23 19:57:49 +01:00
ijuanes
2248237c79 fix(i18n): enable translations in all templates and implement cookie-based language persistence
- Add _() translation function to add_tablet.html, add_user.html, loan_tablet.html
- Add _() translation function to add_non_loanable_device.html, edit_non_loanable_device.html
- Add _() translation function to history.html, non_loanable_devices.html, project_management.html
- Update app.py to use cookie-based language persistence with 1-year expiry
- Add /set_language endpoint to handle language switching with cookie + session
- Update language switcher in base.html to use new endpoint
- Set Spanish (es) as default language for internal app
- Import make_response and session from Flask
2026-06-20 13:14:41 +01:00
ijuanes
49e4562d31 fix(i18n): define get_locale function before passing to Babel constructor
- Flask-Babel 4.0.0 requires locale_selector function to be defined first
- Move function definition before Babel initialization
- All tests still pass
2026-06-20 10:04:53 +01:00
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
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
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