{% extends 'base.html' %} {% comment %} iCal Token Management — Phase 20. One-page UI for the per-user iCal access token. Operators paste ``subscription_url`` into their calendar app (Outlook → Add Calendar → Subscribe from web; Google Calendar → Other calendars → From URL; iCloud → File → New Calendar Subscription) and contract renewal dates appear as all-day events in their personal calendar. Why a separate page (not a profile-extension): Nautobot has no first-class user-profile extension hook in 3.1.1. A standalone URL is the cleanest pattern; it's reachable from the contracts nav and bookmarkable. Context (from views/ical.py ICalTokenManageView): token — ICalAccessToken instance for the current user subscription_url — absolute URL including ?token= ical_url — absolute URL of the feed without a token (session-auth path) created — True if the token was auto-created on this request just_regenerated — True if a POST action just rotated/deleted-and-recreated {% endcomment %} {% block title %}iCal Subscription{% endblock %} {% block content %}

iCal Subscription

Subscribe to a calendar feed of contract renewal dates so they appear in Outlook, Google Calendar, iCloud, or any other client that speaks RFC 5545.

{% if just_regenerated %} {% elif created %} {% endif %}
Your subscription URL

Paste this URL into your calendar client's "Subscribe to calendar" dialog. Keep it private — anyone with this URL can see your contracts' end dates.

Token administration
Token ID
{{ token.id }}
Created
{{ token.created }}
Last used
{% if token.last_used_at %}{{ token.last_used_at }}{% else %}never{% endif %}

{% csrf_token %}

Regenerating rotates the secret. Any calendar clients using the old URL will stop syncing until you update them.

Alternative: session-authenticated URL

If your calendar client carries Django session cookies (rare), you can subscribe without the token: {{ ical_url }}.

Most calendar apps don't carry browser cookies, so the token URL above is the recommended path.

{% endblock %}