Commit Graph

4 Commits

Author SHA1 Message Date
Dries Peeters 90dde470da style: standardize code formatting and normalize line endings
- Normalize line endings from CRLF to LF across all files to match .editorconfig
- Standardize quote style from single quotes to double quotes
- Normalize whitespace and formatting throughout codebase
- Apply consistent code style across 372 files including:
  * Application code (models, routes, services, utils)
  * Test files
  * Configuration files
  * CI/CD workflows

This ensures consistency with the project's .editorconfig settings and
improves code maintainability.
2025-11-28 20:05:37 +01:00
Dries Peeters 89141108d9 Fix: Add missing timeago template filter causing 500 error
The Time Entry Templates page (/templates) was throwing a 500 error
when displaying templates with usage data. The templates referenced
a 'timeago' Jinja2 filter that was never registered.

Changes:
- Added timeago filter to app/utils/template_filters.py
  - Converts datetime to human-readable relative time (e.g., "2 hours ago")
  - Handles None, naive/aware datetimes, and future dates gracefully
  - Provides appropriate granularity from seconds to years
  - Uses proper singular/plural forms

- Added 11 comprehensive unit tests in tests/test_utils.py
  - Tests for None values, all time ranges, edge cases
  - Tests for naive datetimes and future dates
  - Tests for singular/plural formatting

- Added smoke test in tests/test_time_entry_templates.py
  - Specifically tests templates with usage_count and last_used_at
  - Ensures the filter renders correctly in the template

The filter is used in:
- app/templates/time_entry_templates/list.html (line 96)
- app/templates/time_entry_templates/edit.html (line 140)

Fixes #151
2025-10-25 06:53:13 +02:00
Dries Peeters ede8baa1ee yet another testing update 2025-10-10 13:33:49 +02:00
Dries Peeters 113a57d2eb testing updates 2025-10-10 11:37:23 +02:00