Browse Source

Zurück/ Abbrechen Buttons auf JS / back

root 6 months ago
parent
commit
4f90ba8e0d

BIN
db.sqlite3


+ 2 - 0
main/models.py

@@ -49,6 +49,8 @@ class Shift(models.Model):
         KK = 'KKH', _('KKH')
         ST = 'ST', _('Stapler')
         AH = 'AH', _('Ausser Haus')
+        FT = 'FT', _('Feiertag')
+        WF = 'WF', _('F!')
 
     class ShiftChef(models.TextChoices):
         NONE = '', _('None')  # Placeholder for "None" if you're using it

+ 5 - 2
templates/main/create_multiple_shifts.html

@@ -1,6 +1,5 @@
 {% load bootstrap5 %}
 {{ form.media }}  {# Adds all flatpickr JS/CSS files from CDN #}
-
 <!DOCTYPE html>
 <html lang="de">
 <head>
@@ -70,6 +69,10 @@
 
                                   <option value="AH">Ausser Haus</option>
 
+                                  <option value="FT">Feiertag</option>
+
+                                  <option value="WF">F!</option>
+
                                 </select>
                               </td>
                               <td></td>
@@ -85,7 +88,7 @@
                             <td></td>
                             <td></td>
                             <td><button type="submit" class="btn btn-primary">Schichten erstellen</button></td>
-                            <td><a href="{% url 'home' %}" class="btn btn-secondary">Abbrechen</a></td>
+                            <td><a href="javascript:history.back()" class="btn btn-secondary">Abbrechen</a></td>
                           </tr>
                         </table>
                     </td>

+ 7 - 6
templates/main/edit_shift.html

@@ -48,15 +48,16 @@
               <tr >
                 <td></td>
                 <td></td>
-                <td><a href="{% url 'home' %}" class="btn btn-secondary">Abbrechen</a></td>
-                <td><form method="post" action="{% url 'delete_shift' pk=shift.id %}" class="mt-3">
-                         {% csrf_token %}
-                        <button type="submit" class="btn btn-danger">Löschen</button>
-                    </form></td>
+                <td><a href="javascript:history.back()" class="btn btn-secondary">Abbrechen</a></td>
+                <td>
+                </td>
               </tr>
             </table>
         </form>
-
+        <form method="post" action="{% url 'delete_shift' pk=shift.id %}" class="mt-3">
+            {% csrf_token %}
+            <button type="submit" class="btn btn-danger">Löschen</button>
+        </form>
     </div>
     {% bootstrap_javascript %}
 </body>

+ 1 - 1
templates/main/public.html

@@ -6,7 +6,7 @@
 <html lang="de">
 <head>
     <meta charset="UTF-8">
-    <meta http-equiv="refresh" content="120; URL=/" >
+    <meta http-equiv="refresh" content="120" >
     <title>Dienstplan</title>
     <link rel="icon" href="{% static 'favicon.png' %}">
     {% bootstrap_css %}