mirror of
https://github.com/DRYTRIX/TimeTracker.git
synced 2026-02-19 20:18:42 -06:00
Refactored the existing calendar API endpoint to properly display calendar
events, tasks, and time entries with distinct visual representations.
Changes:
- Updated /api/calendar/events endpoint in api.py to use new
CalendarEvent.get_events_in_range() method that fetches all three item types
- Fixed user_id bug where it was defaulting to None instead of current_user.id
- Modified API response format to include all items in unified 'events' array
with item_type field ('event', 'task', 'time_entry') for differentiation
- Updated calendar.js to parse unified response format and filter items by type
- Added visual distinctions:
* Tasks: 📋 emoji, orange (#f59e0b) color, clickable
* Time entries: ⏱ emoji, project-based colors, non-clickable
* Calendar events: 📅 emoji, custom colors, clickable
- Fixed task detail route from /tasks/view/{id} to /tasks/{id}
- Updated all calendar view renderers (month, week, day) to use correct
data structure with extendedProps
- Added cache-busting to calendar.js (v7) and calendar.css (v2)
- Preserved backward compatibility with existing calendar filtering
(project_id, task_id, tags)
The calendar now correctly displays all time tracking data in a unified view
with proper visual hierarchy and interaction patterns.
Fixes: Calendar not showing tasks and time entries
Related: Calendar/Agenda Support feature implementation
69 lines
1.8 KiB
Python
69 lines
1.8 KiB
Python
from .user import User
|
|
from .project import Project
|
|
from .time_entry import TimeEntry
|
|
from .task import Task
|
|
from .settings import Settings
|
|
from .invoice import Invoice, InvoiceItem
|
|
from .invoice_template import InvoiceTemplate
|
|
from .currency import Currency, ExchangeRate
|
|
from .tax_rule import TaxRule
|
|
from .payments import Payment, CreditNote, InvoiceReminderSchedule
|
|
from .reporting import SavedReportView, ReportEmailSchedule
|
|
from .client import Client
|
|
from .task_activity import TaskActivity
|
|
from .extra_good import ExtraGood
|
|
from .comment import Comment
|
|
from .focus_session import FocusSession
|
|
from .recurring_block import RecurringBlock
|
|
from .rate_override import RateOverride
|
|
from .saved_filter import SavedFilter
|
|
from .project_cost import ProjectCost
|
|
from .kanban_column import KanbanColumn
|
|
from .time_entry_template import TimeEntryTemplate
|
|
from .activity import Activity
|
|
from .user_favorite_project import UserFavoriteProject
|
|
from .client_note import ClientNote
|
|
from .weekly_time_goal import WeeklyTimeGoal
|
|
from .expense import Expense
|
|
from .permission import Permission, Role
|
|
from .api_token import ApiToken
|
|
from .calendar_event import CalendarEvent
|
|
|
|
__all__ = [
|
|
"User",
|
|
"Project",
|
|
"TimeEntry",
|
|
"Task",
|
|
"Settings",
|
|
"Invoice",
|
|
"InvoiceItem",
|
|
"Client",
|
|
"TaskActivity",
|
|
"Comment",
|
|
"FocusSession",
|
|
"RecurringBlock",
|
|
"RateOverride",
|
|
"SavedFilter",
|
|
"ProjectCost",
|
|
"InvoiceTemplate",
|
|
"Currency",
|
|
"ExchangeRate",
|
|
"TaxRule",
|
|
"Payment",
|
|
"CreditNote",
|
|
"InvoiceReminderSchedule",
|
|
"SavedReportView",
|
|
"ReportEmailSchedule",
|
|
"KanbanColumn",
|
|
"TimeEntryTemplate",
|
|
"Activity",
|
|
"UserFavoriteProject",
|
|
"ClientNote",
|
|
"WeeklyTimeGoal",
|
|
"Expense",
|
|
"Permission",
|
|
"Role",
|
|
"ApiToken",
|
|
"CalendarEvent",
|
|
]
|