| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242 |
- {% load static %}
- {% load custom_tags %}
- {% load bootstrap5 %}
- <!DOCTYPE html>
- <html lang="de">
- <head>
- <meta charset="UTF-8">
- <title>Dienstplan</title>
- <link rel="icon" href="{% static 'favicon.png' %}">
- {% bootstrap_css %}
- <style>
- body {
- font-family: Tahoma, sans-serif;
- margin: 0;
- padding: 0;
- font-size: 10px; /* Set the base font size */
- }
- .shift-none {
- background-color: white !important;
- text-align: center !important;
- {% if user.is_authenticated %}
- cursor: pointer !important;
- {% endif %}
- }
- .shift-vacation {
- background-color: blue !important;
- color: white !important;
- text-align: center;
- }
- .shift-sick {
- background-color: yellow !important;
- text-align: center;
- }
- .shift-other {
- background-color: gray !important;
- color: white !important;
- text-align: center;
- }
- .buttons-container {
- display: flex;
- justify-content: space-between;
- padding: 10px;
- background-color: #f8f9fa;
- border-bottom: 1px solid #dee2e6;
- }
- .container-fluid {
- padding-top: 10px; /* Reduce the padding to remove extra space */
- }
- a {
- color: black;
- text-decoration: none;
- }
- a:hover {
- color: black;
- }
- .employee-name {
- text-align: left;
- font-weight: bold;
- width: 150px; /* Set a fixed width for the employee column */
- }
- .day-name {
- text-align: center;
- width: 150px; /* Set a fixed width for the employee column */
- }
- .table th, .table td {
- vertical-align: middle;
- width: 100px; /* Set a fixed width for all other columns */
- padding: 4px; /* Reduce padding to decrease row height */
- line-height: 1.2; /* Adjust line height to decrease row height */
- }
- .custom-heading {
- margin: 0; /* Remove margin to eliminate extra space */
- }
- @media print {
- .btn {
- display: none; /* Hide the buttons when printing */
- }
- }
- </style>
- </head>
- <body>
- <div class="container-fluid">
- <table class="table">
- <tr>
- <td><a href="?start_date={{ previous_week }}" class="btn btn-primary text-start">Eine Woche zurück</a></td>
- <td><a href="/" class="btn btn-primary">Aktuelle Woche</a></td>
- <td><h4 class="custom-heading text-center">Dienstplan für KW {{ calendar_week }}</h4></td>
- <td><h4><form method="post" name='nextdate' action="/" style="display: inline;">
- {% csrf_token %}
- <input type="date" name="nextdate" value="" >
- <a href="#" onclick="document.forms[0].submit();return false;">Datum öffnen</a>
- </form></h4></td>
- <td class="text-end">{% if user.is_authenticated %}
- <form method="post" action="{% url 'logout' %}" style="display: inline;">
- {% csrf_token %}
- <button type="submit" class="btn btn-secondary">Logout</button>
- </form>
- {% else %}
- <a href="/login/" class="btn btn-secondary">Login</a>
- {% endif %}</td>
- <td class="text-end"><a href="?start_date={{ next_week }}" class="btn btn-primary">Eine Woche vorwärts</a></td>
- </tr>
- </table>
- {% if user.is_authenticated %}
- <div class="table-responsive">
- <table class="table table-bordered table-striped table-hover w-100">
- <thead class="table-dark">
- <tr>
- <th class="employee-name">Veranstaltungen</th>
- {% for day, date in days_with_dates %}
- <th class="day-name">{{ day }} {{ date }}</th>
- {% endfor %}
- </tr>
- </thead>
- <tbody>
- {% for location, events in events_by_location.items %}
- <tr>
- <td class="employee-name">{{ location.name }}</td>
- {% for day, date in days_with_dates %}
- {% with event=events|get_item:forloop.counter0 %}
- {% if event == None %}
- {% if user.is_authenticated %}
- <td class="shift-none" onclick="window.location.href='{% url 'create_event' %}?date={{ date }}'">--</td>
- {% else %}
- <td class="shift-none">--</td>
- {% endif %}
- {% else %}
- <td class="shift-none" {% if user.is_superuser %} onclick="window.location.href='{% url 'edit_event' pk=event.id %}'" {% endif %} data-bs-toggle="tooltip" data-bs-placement="top" data-bs-html="true" title="Name: {{ event.name }}<br> Location: {{ event.location }}<br> Belegung: {{ event.belegung }}<br> PAX: {{ event.pax }}<br> CVD: {{ event.cvd }}<br> CVT: {{ event.cvt }}<br> Info: {{ event.info }}">
- {% if event.name %}
- {{ event.name }}
- {% else %}
- F
- {% endif %}
- </td>
- {% endif %}
- {% endwith %}
- {% endfor %}
- </tr>
- {% endfor %}
- <tr>
- <td class="employee-name">Reinigung</td>
- {% for day in range_days %}
- {% if reinigungs_by_date|default_if_none:None %}
- {% if reinigungs_by_date|get_item:day %}
- {% with reinigung=reinigungs_by_date|get_item:day %}
- <td class="shift-none" {% if user.is_superuser %} onclick="window.location.href='{% url 'edit_reinigung' pk=reinigung.id %}'" {% endif %}>
- {{ reinigung.auftrag }}
- </td>
- {% endwith %}
- {% else %}
- <td class="shift-none" {% if user.is_superuser %} onclick="window.location.href='{% url 'create_reinigung' %}?date={{ date }}'" {% endif %}>--</td>
- {% endif %}
- {% else %}
- <td class="shift-none" {% if user.is_superuser %} onclick="window.location.href='{% url 'create_reinigung' %}?date={{ date }}'" {% endif %}>--</td>
- {% endif %}
- {% endfor %}
- </tr>
- <tr>
- <td class="employee-name">Helfer</td>
- {% for day in range_days %}
- {% if helpers_by_date|default_if_none:None %}
- {% if helpers_by_date|get_item:day %}
- {% with helper=helpers_by_date|get_item:day %}
- <td class="shift-none" {% if user.is_superuser %} onclick="window.location.href='{% url 'edit_helper' pk=helper.id %}'" {% endif %}>
- {{ helper.ben }}/{{ helper.best }}
- </td>
- {% endwith %}
- {% else %}
- <td class="shift-none" {% if user.is_superuser %} onclick="window.location.href='{% url 'create_helper' %}?date={{ date }}'" {% endif %}>--</td>
- {% endif %}
- {% else %}
- <td class="shift-none" {% if user.is_superuser %} onclick="window.location.href='{% url 'create_helper' %}?date={{ date }}'" {% endif %}>--</td>
- {% endif %}
- {% endfor %}
- </tr>
- </tbody>
- <tbody>
- <tr class="table-dark">
- <th class="employee-name">Mitarbeiter</th>
- {% for day, date in days_with_dates %}
- <th class="day-name">{{ day }} {{ date }}</th>
- {% endfor %}
- </tr>
- {% for employee, shifts in shifts_by_employee.items %}
- <tr>
- <td class="employee-name">{{ employee.name }}</td>
- {% for day, date in days_with_dates %}
- {% with shift=shifts|get_item:forloop.counter0 %}
- {% if shift == None %}
- <td class="shift-none" {% if user.is_superuser %} onclick="window.location.href='{% url 'create_multiple_shifts' %}?date={{ date }}'"{% endif %}>
- F
- </td>
- {% else %}
- <td class="
- {% if shift.start and shift.end %}
- shift-none
- {% elif shift.shifttype == 'U' %}
- shift-vacation
- {% elif shift.shifttype == 'K' %}
- shift-sick
- {% else %}
- shift-other
- {% endif %}
- "
- {% if user.is_superuser %}
- onclick="window.location.href='{% url 'edit_shift' pk=shift.id %}'"
- {% endif %}
- {% if shift.info %}
- data-bs-toggle="tooltip" data-bs-placement="top" data-bs-html="true" title="Info: {{ shift.info }}"
- {% endif %}
- >
- {% if shift.start and shift.end %}
- {{ shift.start|time:"H:i" }} - {{ shift.end|time:"H:i" }}
- {% if shift.shiftchef %}
- {{ shift.shiftchef }}
- {% endif %}
- {% else %}
- {{ shift.get_shifttype_display }}
- {% endif %}
- </td>
- {% endif %}
- {% endwith %}
- {% endfor %}
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- {% endif %}
- </div>
- {% bootstrap_javascript %}
- <script>
- // Initialize all tooltips on the page
- var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
- var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
- return new bootstrap.Tooltip(tooltipTriggerEl)
- })
- </script>
- </body>
- </html>
|