{% extends "base.html" %} {% load static %} {% block title %}Publish Schedule: {{ schedule.name }}{% endblock %} {% block css %} {% endblock %} {% block content %}

Publish Schedule

{{ schedule.name }}

{{ schedule.start_date|date:"M d, Y" }} - {{ schedule.end_date|date:"M d, Y" }}

Draft

Publish Checklist

Publishing this schedule will make it visible to all employees and send notifications. Please review the checklist below before proceeding.
Schedule Period
{% if schedule.start_date and schedule.end_date %} Complete {% else %} Incomplete {% endif %}

{% if schedule.start_date and schedule.end_date %} Schedule covers {{ schedule.start_date|date:"M d, Y" }} to {{ schedule.end_date|date:"M d, Y" }} ({{ schedule.duration }} days). {% else %} Schedule period is not properly defined. Please update the schedule with valid start and end dates. {% endif %}

Shift Assignments
{% if assignment_count > 0 %} {{ assignment_count }} Assignments {% else %} No Assignments {% endif %}

{% if assignment_count > 0 %} Schedule has {{ assignment_count }} shift assignments for {{ employee_count }} employees. {% else %} No shift assignments have been created for this schedule. Employees will see an empty schedule. {% endif %}

Department Coverage
{{ coverage_percentage }}% Coverage

{% if coverage_percentage >= 90 %} Excellent coverage! {{ employee_count }} out of {{ total_employees }} employees in the department have been scheduled. {% elif coverage_percentage >= 70 %} Moderate coverage. {{ employee_count }} out of {{ total_employees }} employees in the department have been scheduled. {% else %} Low coverage. Only {{ employee_count }} out of {{ total_employees }} employees in the department have been scheduled. {% endif %}

Schedule Conflicts
{% if conflict_count == 0 %} No Conflicts {% else %} {{ conflict_count }} Conflicts {% endif %}

{% if conflict_count == 0 %} No scheduling conflicts detected. All shifts are properly assigned without overlaps. {% else %} {{ conflict_count }} scheduling conflicts detected. Please resolve these conflicts before publishing. View Conflicts {% endif %}

Hours Distribution
{{ hours_distribution|title }}

{% if hours_distribution == 'balanced' %} Hours are well distributed among employees. Average: {{ avg_hours_per_employee|floatformat:1 }} hours per employee. {% elif hours_distribution == 'moderate' %} Hours distribution could be improved. Some employees have significantly more hours than others. {% else %} Unbalanced hours distribution. There is a large disparity in assigned hours between employees. {% endif %}

{% csrf_token %}
Notification Options
Notification Preview

Subject: New Schedule Published: {{ schedule.name }}

Dear [Employee Name],

A new work schedule has been published for the period {{ schedule.start_date|date:"M d, Y" }} to {{ schedule.end_date|date:"M d, Y" }}.

Please log in to the system to view your assigned shifts.

Thank you,
{{ request.user.get_full_name }}

Confirmation
Cancel
Schedule Summary
Department: {% if schedule.department %} {{ schedule.department.name }} {% else %} All Departments {% endif %}
Period: {{ schedule.start_date|date:"M d, Y" }} - {{ schedule.end_date|date:"M d, Y" }}
Duration: {{ schedule.duration }} days
Total Assignments: {{ assignment_count }}
Employees Scheduled: {{ employee_count }} of {{ total_employees }}
Total Hours: {{ total_hours }} hours
Avg Hours/Employee: {{ avg_hours_per_employee|floatformat:1 }} hours
Publishing Guidelines
Important: Once published, the schedule will be visible to all employees.
  • Ensure all shifts are properly assigned
  • Verify there are no scheduling conflicts
  • Check that all required positions are covered
  • Confirm compliance with labor regulations
  • Review employee time-off requests
Tip: You can still make changes to the schedule after publishing, but employees will be notified of any changes that affect them.
{% endblock %} {% block js %} {% endblock %}