{% extends "base.html" %} {% from "components/ui.html" import page_header, empty_state %} {% block title %}{{ _('Calendar Integrations') }} - {{ app_name }}{% endblock %} {% block content %} {% set breadcrumbs = [ {'text': 'Calendar', 'url': url_for('calendar.view_calendar')}, {'text': 'Integrations'} ] %} {{ page_header( icon_class='fas fa-calendar-alt', title_text='Calendar Integrations', subtitle_text='Sync your calendar with time entries', breadcrumbs=breadcrumbs, actions_html='Connect Google Calendar' ) }}
{% if integrations %}
{% for integration in integrations %}

{% if integration.provider == 'google' or integration.provider == 'google_calendar' %} Google Calendar {% elif integration.provider == 'outlook' or integration.provider == 'outlook_calendar' %} Outlook Calendar {% else %} {{ integration.provider|title|replace('_', ' ') }} Calendar {% endif %}

{% if integration.is_active %} {{ _('Active') }} {% else %} {{ _('Inactive') }} {% endif %}
{% if integration.calendar_name %}

{{ integration.calendar_name }}

{% elif integration.config and integration.config.get('calendar_id') %}

{{ integration.config.get('calendar_id') }}

{% endif %} {% if integration.last_sync_at %}

{{ _('Last synced') }}: {{ integration.last_sync_at.strftime('%Y-%m-%d %H:%M') }} {% if integration.last_sync_status %} {{ integration.last_sync_status|title }} {% endif %}

{% endif %}
{% if integration.provider in ['google_calendar', 'outlook_calendar'] %} {% endif %} {% if integration.is_active %}
{% endif %}
{% endfor %}
{% else %} {{ empty_state( 'fas fa-calendar-alt', _('No Calendar Integrations'), _('Connect your calendar to automatically sync time entries and events.'), actions_html='' + _('Connect Google Calendar') + '' ) }} {% endif %}

{{ _('How Calendar Integration Works') }}

{% endblock %}