فهرست منبع

20240614_1400

Rene 1 سال پیش
والد
کامیت
687539a4d1
1فایلهای تغییر یافته به همراه7 افزوده شده و 50 حذف شده
  1. 7 50
      templates/main/current_week_shifts.html

+ 7 - 50
templates/main/current_week_shifts.html

@@ -6,7 +6,6 @@
 <html lang="de">
 <head>
     <meta charset="UTF-8">
-    <meta http-equiv="refresh" content="120; URL=/current-week-shifts/" >
     <title>Schichten der aktuellen Woche</title>
     <link rel="icon" href="{% static 'favicon.png' %}">
     {% bootstrap_css %}
@@ -20,7 +19,6 @@
         .shift-none {
             background-color: white !important;
             text-align: center;
-            cursor: pointer;
         }
         .shift-vacation {
             background-color: blue !important;
@@ -55,7 +53,6 @@
         }
         .employee-name {
             text-align: left;
-            font-weight: bold;
             width: 150px; /* Set a fixed width for the employee column */
         }
         .day-name {
@@ -65,8 +62,6 @@
         .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 */
@@ -81,62 +76,29 @@
 <body>
     <div class="buttons-container">
         <a href="?start_date={{ previous_week }}" class="btn btn-primary">Eine Woche zurück</a>
-        <a href="/current-week-shifts/" class="btn btn-primary">Aktuelle Woche</a>
-        <form method="post" action="{% url 'logout' %}" style="display: inline;">
-            {% csrf_token %}
-            <button type="submit" class="btn btn-secondary">Logout</button>
-        </form>
         <a href="?start_date={{ next_week }}" class="btn btn-primary">Eine Woche vorwärts</a>
     </div>
     <div class="container-fluid">
-        <h4 class="custom-heading">Dienstplan für KW {{ calendar_week }}</h4>
+        <h4 class="custom-heading">Dienstplan für KW {{ calendar_week }} - {{ start_of_week }} bis {{ end_of_week }}</h4>
         <div class="table-responsive">
             <table class="table table-bordered table-hover w-100">
                 <thead class="table-dark">
                     <tr>
-                        <th class="employee-name">Veranstaltungen</th>
+                        <th class="employee-name">Employee</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 %}
-                                    <td class="shift-none" onclick="window.location.href='{% url 'create_event' %}?date={{ date }}'"></td>
-                                {% else %}
-                                    <td class="shift-none" onclick="window.location.href='{% url 'edit_event' pk=event.id %}'" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-html="true" title="Name: {{ event.name }}<br> Location: {{ event.location }}<br> CVD: {{ event.cvd }}<br> CVT: {{ event.cvt }}">
-                                            {% if event.name %}
-                                                {{ event.name }}
-                                            {% else %}
-                                                F
-                                            {% endif %}
-                                    </td>
-                                {% endif %}
-                            {% endwith %}
-                        {% endfor %}
-                    </tr>
-                    {% endfor %}
-                </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" onclick="window.location.href='{% url 'create_multiple_shifts' %}?date={{ date }}'">
-                                        F
+                                    <td class="shift-none">
+                                        <a href="{% url 'create_multiple_shifts' %}?date={{ date }}">F</a>
                                     </td>
                                 {% else %}
                                     <td class="
@@ -149,12 +111,14 @@
                                         {% else %}
                                             shift-other
                                         {% endif %}
-                                    " onclick="window.location.href='{% url 'edit_shift' pk=shift.id %}'">
+                                    ">
+                                        <a href="{% url 'edit_shift' pk=shift.id %}">
                                             {% if shift.start and shift.end %}
                                                 {{ shift.start|time:"H:i" }} - {{ shift.end|time:"H:i" }}
                                             {% else %}
                                                 {{ shift.get_shifttype_display }}
                                             {% endif %}
+                                        </a>
                                     </td>
                                 {% endif %}
                             {% endwith %}
@@ -166,12 +130,5 @@
         </div>
     </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>