{% set page_group = "admin" %} {% include 'components/head.html' %} {# SweetAlert for notifications #} {# Event Management Styles #}
{% include 'components/nav-account.html' %}
{% include 'components/alerts.html' %}
{# ================================================================ PAGE HEADER ================================================================ #}
Back to Events

{% if event.color %} {% endif %} {{ event.name }}

{% if event.eventType == 'season' %} {% elseif event.eventType == 'holiday' %} {% elseif event.eventType == 'sale' %} {% else %} {% endif %} {{ event.eventType|capitalize }} {% if event.status == 'active' %} {% elseif event.status == 'scheduled' %} {% elseif event.status == 'draft' %} {% elseif event.status == 'completed' %} {% elseif event.status == 'cancelled' %} {% endif %} {{ event.status|capitalize }} {% if event.phase %} {{ event.phase|replace({'_': ' '})|title }} {% endif %} {% if event.isRecurring %} Recurring {% endif %}
{% if canManage %} {% if event.status == 'draft' %} Edit {% elseif event.status == 'scheduled' %} Edit {% elseif event.status == 'active' %} {% endif %} {% endif %} Duplicate {% if canViewReports %} Report {% endif %}
{# ================================================================ MAIN CONTENT GRID ================================================================ #}
{# Left Column: Event Info #}
{# Summary Card #}

Event Details

{{ event.description|default('No description provided')|nl2br }}

{% if event.startDate and event.endDate %} {{ event.startDate|date('F j, Y') }} - {{ event.endDate|date('F j, Y') }} {% else %} Dates not set {% endif %}

{{ event.year|default('N/A') }}

{{ event.buildUpDays|default(0) }} day{{ event.buildUpDays != 1 ? 's' : '' }} before event

{{ event.windDownDays|default(0) }} day{{ event.windDownDays != 1 ? 's' : '' }} after event

{# Phase Timeline Visual #}

Event Timeline

{% if event.startDate and event.endDate %}
{% if event.buildUpDays > 0 %} {{ event.startDate|date_modify("-" ~ event.buildUpDays ~ " days")|date('M j') }} {% else %} {{ event.startDate|date('M j') }} {% endif %} {% if event.windDownDays > 0 %} {{ event.endDate|date_modify("+" ~ event.windDownDays ~ " days")|date('M j, Y') }} {% else %} {{ event.endDate|date('M j, Y') }} {% endif %}
{# Timeline segments will be positioned via JavaScript #} {% set totalDays = event.buildUpDays + ((event.endDate|date('U') - event.startDate|date('U')) / 86400)|round + event.windDownDays + 1 %} {% set buildUpPercent = totalDays > 0 ? (event.buildUpDays / totalDays * 100) : 0 %} {% set mainEventDays = ((event.endDate|date('U') - event.startDate|date('U')) / 86400)|round + 1 %} {% set mainEventPercent = totalDays > 0 ? (mainEventDays / totalDays * 100) : 100 %} {% set windDownPercent = totalDays > 0 ? (event.windDownDays / totalDays * 100) : 0 %} {% if event.buildUpDays > 0 %}
Build-up
{% endif %}
Main Event
{% if event.windDownDays > 0 %}
Wind-down
{% endif %} {# Today marker - positioned via JavaScript #}
{% if event.buildUpDays > 0 %}
Build-up ({{ event.buildUpDays }} days)
{% endif %}
Main Event ({{ mainEventDays }} days)
{% if event.windDownDays > 0 %}
Wind-down ({{ event.windDownDays }} days)
{% endif %}
{% else %}

Timeline will be available once event dates are set.

{% endif %}
{# Integrations Section #}

Integrations ({{ integrations|length }})

{% if canManage and event.status != 'completed' and event.status != 'cancelled' %} {% endif %}
{% if integrations|length > 0 %}
{% for integration in integrations %} {# Determine if integration needs setup (no config or empty config) #} {% set needsSetup = (integration.configuration is not defined or integration.configuration is empty) and integration.status == 'pending' %} {% set isNew = integration.isNew|default(false) %}
{% if integration.integrationType == 'digital_signage' or integration.integrationType == 'signage' %} {% elseif integration.integrationType == 'comeback_cash' or integration.integrationType == 'comeback-cash' %} {% elseif integration.integrationType == 'task' or integration.integrationType == 'tasks' %} {% elseif integration.integrationType == 'note' or integration.integrationType == 'notes' %} {% elseif integration.integrationType == 'sms_trigger' %} {% elseif integration.integrationType == 'backstock' %} {% else %} {% endif %}
{{ integration.integrationType|replace({'_': ' '})|title }}
{% if isNew %} New {% endif %} {% if needsSetup %} Setup Required {% endif %} {{ integration.status|default('pending')|capitalize }}
{% if canManage %}
{% if event.status != 'active' and event.status != 'completed' %} {% endif %}
{% endif %}
{% if integration.configSummary is defined or integration.recordCount is defined %}
{% if integration.recordCount is defined %}
Records {{ integration.recordCount }}
{% endif %} {% if integration.configSummary is defined %}
Config {{ integration.configSummary }}
{% endif %} {% if integration.lastRunAt is defined and integration.lastRunAt %}
Last Run {{ integration.lastRunAt|date('M j, g:ia') }}
{% endif %}
{% elseif needsSetup %}
Click to configure this integration
{% endif %}
{% endfor %}
{% else %}

No integrations configured for this event.

{% if canManage and event.status == 'draft' %} Add Integrations {% endif %} {% endif %}
{# Right Column: Activity & Meta #}
{# Quick Stats #}

Quick Stats

{{ integrations|length }} Integrations
{{ event.year|default('--') }} Year
{% if event.startDate and event.endDate %}
{{ ((event.endDate|date('U') - event.startDate|date('U')) / 86400)|round + 1 }} Event Days
{{ event.buildUpDays + event.windDownDays }} Buffer Days
{% endif %}
{# Audit Log #}

Activity Log

{% if auditLog is defined and auditLog|length > 0 %} {% for entry in auditLog %}
{{ entry.action }}
{{ entry.employeeName|default('System') }} {{ entry.createdAt|date('M j, g:ia') }}
{% endfor %} {% else %}

No activity recorded yet.

{% endif %}
{# Meta Info #}

Event Info

Event ID
#{{ event.id }}
Created
{{ event.createdAt|date('M j, Y g:ia') }}
Last Updated
{{ event.updatedAt|date('M j, Y g:ia') }}
{% if event.createdBy %}
Created By
{{ event.createdByName|default('User #' ~ event.createdBy) }}
{% endif %} {% if event.templateId %}
Template
Template #{{ event.templateId }}
{% endif %} {% if event.sourceEventId %}
Duplicated From
Event #{{ event.sourceEventId }}
{% endif %} {% if event.archivedAt %}
Archived
{{ event.archivedAt|date('M j, Y g:ia') }}
{% endif %}
{# End Detail Page #}
{# End Dashboard #} {% include 'components/footer.html' %}
{# ================================================================ JAVASCRIPT ================================================================ #} {% if canManage %} {# Integration Wizard Scripts #} {# Register wizards with the detail page #} {# Integration Type Picker Modal HTML #}
{% endif %}